-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
add new max channel size config option #4567
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Straightforward diff, thanks for the contribution! Only request is to add either a unit test at the funding manager, or extend an existing itest to exercise the code path.
fundingmanager.go
Outdated
@@ -1254,7 +1259,7 @@ func (f *fundingManager) handleFundingOpen(fmsg *fundingOpenMsg) { | |||
// We'll reject any request to create a channel that's above the | |||
// current soft-limit for channel size, but only if we're rejecting all | |||
// wumbo channel initiations. | |||
if f.cfg.NoWumboChans && msg.FundingAmount > MaxFundingAmount { | |||
if f.cfg.NoWumboChans && amt > MaxFundingAmount { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
NP on not using a channel acceptor, this is much simpler after all, in the future we may opt to roll it out into one, just so we can have all the logic coupled in a single place.
What do you mean above the old soft limit? You mean like ensuring if wumbo isn't activated, then we don't allow this value to be set? One other thing I think we should consider is adding a new default soft-limit if wumbo is activated. Just to make sure users are protected somewhat, and need to explicitly allow mega-wumbo channels. |
2d76256
to
a9ec4f0
Compare
Hi @Roasbeef, thanks for the review. I was hoping to get the test case and validation added in before you made a first pass, but alas. I’ve added those in and made a couple changes. Apologies for any confusion, here is where things are currently:
Maybe there is a better way to do this than using a zero value. This breaks down should the user set One more thing: Right now I only enforce |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, awesome change 👍
I agree that perhaps a soft-limit by default is preferred. If you opt into wumbo, then you should be able to open channels of any size you like, but IMO it should be a second opt-in to start accepting huuuge channels.
At first a new larger default seemed to defeat the nature of WUMBO channels, but given that people will be entrusting their wealth to Any thoughts on what the new default maximum channel size should be? |
10 BTC? |
Yeh there's a distinction here:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is super close! IMO we want to have a default soft-limit for for wumbo chans in place. In the past, we threw around a value of 10 BTC which seemed reasonable at the time. This would only be for accepting the channels as mentioned.
We'd like to tag our v0.11.1 version in a few days here, and I think this is really close, so I'd like to get it in.
227d0a1
to
a4646db
Compare
Latest update contains enforcement for I agree this is close. One thing I am unsure on right now is whether my setting of the default limits will screw up the case where lnd is run with Litecoin. I will think on this a bit more and do my best to finish this PR off this weekend. |
a4646db
to
0358ad0
Compare
The default can always be overridden in that case. FWIW, the 0.16 number itself was very Bitcoin specific. |
The latest set of changes is looking pretty good to me! Final thing is to either squashed down these commits into one, or update the title+body for each of the commits. As the change is relatively contained, I think maybe we can just squash them into one. Thanks again for working on this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🧬
Changed looking good to me, final nit is just to squash into a single commit. Will test this out a bit locally and also wait on the other reviewer before merging.
- let users specify their MAXIMUM WUMBO with new config option which sets the maximum channel size lnd will accept - current implementation is a simple check by the fundingManager rather than anything to do with the ChannelAcceptor - Add test cases which verify that maximum channel limit is respected for wumbo/non-wumbo channels - use --maxchansize 0 value to distinguish set/unset config. If user sets max value to 0 it will not do anything as 0 is currently used to indicate to the funding manager that the limit should not be enforced. This seems justifiable since --maxchansize=0 doesn't seem to make sense at first glance. - add integration test case to ensure that config parsing and valiation is proper. I simplified the funding managers check electing to rely on config.go to correctly parse and set up either i) non wumbo default limit of 0.16 BTC OR ii) wumbo default soft limit of 10 BTC Addresses: lightningnetwork#4557
0358ad0
to
f5fb64e
Compare
@Roasbeef Squashed ✅ Thanks for the guidance on the way through. It was fun to start learning the 2nd most important codebase in the world. I'll be on the lookout for another issue/PR soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @calvinrzachman!! Very clean PR, LGTM 👌
Addresses: #4557
Pull Request Checklist
Contribution Guidelines
the positive and negative (error paths) conditions (if applicable)
the bug being fixed to prevent regressions
logging level
go fmt
lnrpc/**/*.proto
) have been formatted withmake rpc-format
and compiled withmake rpc
(the tab character should be counted as 8 characters, not 4, as some IDEs do
per default)
make check
does not fail any testsgo vet
does not report any issuesmake lint
does not report any new issues that did notalready exist
cases it can be justifiable to violate this condition. In that case, the
reason should be stated in the commit message.