multi: add control over maximum acceptable local CSV delay#4735
Merged
carlaKC merged 3 commits intolightningnetwork:masterfrom Nov 5, 2020
Merged
multi: add control over maximum acceptable local CSV delay#4735carlaKC merged 3 commits intolightningnetwork:masterfrom
carlaKC merged 3 commits intolightningnetwork:masterfrom
Conversation
272e2f0 to
d532d44
Compare
halseth
approved these changes
Oct 30, 2020
fundingmanager.go
Outdated
Contributor
There was a problem hiding this comment.
rename to defaultMaxLocalCSVDelay and move to config
bhandras
approved these changes
Nov 4, 2020
Collaborator
bhandras
left a comment
There was a problem hiding this comment.
LGTM, just a few nits 🦘
fundingmanager_test.go
Outdated
Collaborator
There was a problem hiding this comment.
I think you wanted to write "our maximum is is less than"
fundingmanager_test.go
Outdated
Collaborator
There was a problem hiding this comment.
nit: could add a new line
lncfg/chain.go
Outdated
Collaborator
There was a problem hiding this comment.
q: why not call this config value MaxLocalCSVDelay?
Collaborator
Author
There was a problem hiding this comment.
I was following the naming for the existing DefaultRemoteDelay, since they're related.
Collaborator
|
needs rebase |
To allow nodes more control over the amount of time that their funds will be locked up, we add a MaxLocalCSVDelay option which sets the maximum csv delay we will accept for all channels. We default to the existing constant of 10000, and set a sane minimum on this value so that clients cannot set unreasonably low maximum csv delays which will result in their node rejecting all channels.
d532d44 to
f1aa3d2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR provides nodes with a
MaxLocalCSVconfig option which specifies the maximum delay that we will accept from the remote peer. This value allows users to set a maximum default value that suits their time preference. We do cap this value at144blocks at present, to ensure that users don't set an unreasonably low CSV which results in no channels ever succeeding.For channels we open: this maximum can be set on a per-channel basis using
max_local_csv, defaulting to our config option if this value is not setFor channels peers open: we will enforce the default value for all channels, and the
channelacceptorcan be used to take more custom actions.Fixes #2426