Skip to content

Add optional user specified channel limits of bolt 2 #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

SWvheerden
Copy link
Contributor

Added a config struct to use when passing configurations into the channel.

Before accepting a channel the channel will test optional limits as specified by BOLT 2.
The default values of these test are set to not test the limits, but the user can supply other values.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a few whitespace things I didn't mark, but if you do git show it should highlight them for you. Also, best to avoid merge commits in pull requests, its easier to keep track of where things are in the eventual git log if you rebase instead.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs rebase. Note that you may also want to set your editor to highlight extra whitespace at EOLs, since you've got that in a few places, though I'm generally fine cleaning up whitespace errors during merge.

@SWvheerden SWvheerden force-pushed the add-optional-user-spesified-channel-limits-of-BOLT-2- branch from 653f418 to 9a3e171 Compare September 17, 2018 06:35
@SWvheerden SWvheerden force-pushed the add-optional-user-spesified-channel-limits-of-BOLT-2- branch from f423a15 to 99b1c24 Compare September 19, 2018 09:15
@SWvheerden SWvheerden force-pushed the add-optional-user-spesified-channel-limits-of-BOLT-2- branch 5 times, most recently from ecaa1a2 to 86c84ed Compare September 26, 2018 13:31
@TheBlueMatt
Copy link
Collaborator

Why not something like TheBlueMatt@96889fd instead of all of the per-Channel storage just to get the announced_channel flag?

@SWvheerden
Copy link
Contributor Author

mmm that could work as well. This is why I put the annouce channel and fee_proportional_millionths in the config: #169 (comment)

I liked the idea of storing as much as possible in a "config" as I believe this makes the code easier to read, but both will work just as well.

But not even storing a reference to the limits removes the issue of using an ARC or lifetimes which solves one problem we have.

@SWvheerden SWvheerden force-pushed the add-optional-user-spesified-channel-limits-of-BOLT-2- branch 4 times, most recently from 7b75169 to 6c72a35 Compare October 2, 2018 08:09
@SWvheerden
Copy link
Contributor Author

#129

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a bunch of out-of-date docs in configurations.rs that should be rewritten for the latest version of this PR. Also, it may make sense to shorten some names as Configuration/Configurations in needlessly long - Config is equally descriptive and much shorter, generally.

@SWvheerden SWvheerden force-pushed the add-optional-user-spesified-channel-limits-of-BOLT-2- branch from 6c72a35 to 0bb08f5 Compare October 17, 2018 06:54
@SWvheerden SWvheerden changed the title Add optional user spesified channel limits of bolt 2 Add optional user specified channel limits of bolt 2 Oct 19, 2018
// TODO: We should refactor this to be an Inbound/OutboundChannel until initial setup handshaking
// has been completed, and then turn into a Channel to get compiler-time enforcement of things like
// calling channel_id() before we're set up or things like get_outbound_funding_signed on an
// inbound channel.
pub(super) struct Channel {
pub config : ChannelConfig,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I feel awkward making this pub - we cant change announce_publicly at runtime and it would also be the only field not hidden behind accessors.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, code looks good, but the docs here aren't really at all informative, they read more just like "had to add a doc, so wrote the variable name" in a few places, whereas especially for configuration nobs we really need to be descriptive and tell users what is going on.

@SWvheerden SWvheerden force-pushed the add-optional-user-spesified-channel-limits-of-BOLT-2- branch 5 times, most recently from 26a8e5f to 39c2e7b Compare October 26, 2018 06:04
@SWvheerden SWvheerden force-pushed the add-optional-user-spesified-channel-limits-of-BOLT-2- branch 4 times, most recently from b163b89 to 17b7611 Compare October 30, 2018 11:49
@SWvheerden SWvheerden force-pushed the add-optional-user-spesified-channel-limits-of-BOLT-2- branch from 35b1eb2 to b57407a Compare October 31, 2018 11:03
@TheBlueMatt TheBlueMatt mentioned this pull request Oct 31, 2018
@TheBlueMatt
Copy link
Collaborator

Will take as #234.

@SWvheerden SWvheerden deleted the add-optional-user-spesified-channel-limits-of-BOLT-2- branch November 1, 2018 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants