-
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
config: improve management of htlc amount lower limit #3697
Conversation
9351bc2
to
30363dd
Compare
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.
Should we consider allowing this value to be modified through UpdateChannelPolicy
as a follow-up?
So this value isn't the regular The benefit of setting this to anything other than 0 (or 1) msat seems very limited and it does reduce the flexibility. Also, if node A sets the minimum on channel open, this has consequences for node B. node B won't be able to forward anything below A's min_htlc channel parameters. It won't affect A's policy towards B. For that reason, LND nodes connected to CL advertize a min_htlc channel policy of 0. CL has no minimum by default (or maybe it isn't even possible to set it). Adding |
30363dd
to
04aa7a6
Compare
8232001
to
f46d5f9
Compare
f46d5f9
to
c2baace
Compare
@wpaulino re-requesting review because I changed significantly more to separate fwd policy from the min htlc channel parameter. |
e37799e
to
8e5a9f2
Compare
2580009
to
8fcec6f
Compare
8fcec6f
to
f5a6ddf
Compare
f8281d1
to
60cc0a4
Compare
@@ -2209,6 +2209,12 @@ func (f *fundingManager) addToRouterGraph(completeChan *channeldb.OpenChannel, | |||
// need to determine the smallest HTLC it deems economically relevant. | |||
fwdMinHTLC := completeChan.LocalChanCfg.MinHTLC | |||
|
|||
// We don't necessarily want to go as low as the remote party |
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.
Not clear to me why we need to clamp 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.
This is the change that you requested. Not to just use the remote's min htlc in our forwarding policy, but apply our default instead. I'd rather not make this change though and stay closer to what people are used to. Let me know your final opinion on it.
chainregistry.go
Outdated
// | ||
// All forwarded payments are subjected to the min htlc constraint of | ||
// the routing policy of the outgoing channel. This implicitly controls | ||
// the minimum htlc value on the incoming channel too. | ||
defaultBitcoinMinHTLCInMSat = lnwire.MilliSatoshi(1000) | ||
defaultBitcoinMinHTLCInMSat = lnwire.MilliSatoshi(0) |
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.
Why would accepting a zero amount HTLC ever be useful? I'm not even sure we have any tests to exercise if it'll even flow as normal for a point-to-point (direct, no hops) payment.
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.
The reason for this is pretty far-fetched. It would prepare for a future where 0 sat payments are possible. It seemed safe to me, as CL is also setting this value to zero. But the direct payment case I didn't consider. Changed to 1 msat.
9b2fcc3
to
a28c4c1
Compare
Needs rebase. |
a28c4c1
to
1326915
Compare
rebased |
5263faa
to
e425022
Compare
e425022
to
61e114f
Compare
The minimum htlc amount is set when a channel is opened and thereafter it isn't possible anymore to change it. The other end of the channel will never be able to advertize a htlc_minimum_msat forwarding policy below this lower bound.
Until now, the default value was 1000 msat. Users who are not aware of the importance of this minimum value when opening the channel, may inadvertently contribute to a Lightning Network that is not able to carry sub-satoshi payments. Also when accepting a channel open request, this default value is used.
In this commit, the minimum htlc amount is lowered to 1 msat. Changing the default will not force nodes to forward lower amount payments. If the forward doesn't satisfy the node's htlc_minimum_msat policy of the outgoing channel, the htlc is still canceled back. It
remains possible to set htlc_minimum_msat to any desired value and will still default to 1000 msat.
This commit improves the capability of the network to facilitate sub-satoshi (streaming) micro payments without reducing the level of control that node operators have over the htlcs they forward.
Furthermore the rpc
UpdateChanPolicy
is extended with the ability set the min htlc value.