lncli: base_fee_msat and fee_rate_ppm for openchannel#6753
lncli: base_fee_msat and fee_rate_ppm for openchannel#6753guggero merged 7 commits intolightningnetwork:masterfrom
base_fee_msat and fee_rate_ppm for openchannel#6753Conversation
d7776b7 to
cc21c9d
Compare
cc21c9d to
895b1b9
Compare
base_fee_msat and fee_rate for openchannel
895b1b9 to
f7b7442
Compare
265d99e to
a1abd60
Compare
positiveblue
left a comment
There was a problem hiding this comment.
Nice work @hieblmi this looks pretty good!
I left some comments/nits.
The most pressing thing would be to ensure that this data is persisted + loaded when lnd starts again so we don't lose it during restarts.
Something useful could also be break the PR in smaller commits so they are easier to review:
- Add fields to support custom fees in funding
- Add rpc fields
- Update rpc server to use the new fields
- Add new fields to cmd
- Add Notes
base_fee_msat and fee_rate for openchannelbase_fee_msat and fee_rate_ppm for openchannel
a1abd60 to
a9c708a
Compare
SachinMeier
left a comment
There was a problem hiding this comment.
This is a great change! Excited to see it merged.
a9c708a to
a13c691
Compare
a13c691 to
62e23a3
Compare
f39f054 to
33dbf59
Compare
|
@guggero addressed the nits in latest change set. |
|
Thanks for addressing the nits in all commits, not just the ones I pointed out. Though the formatting is off, please see https://github.com/lightningnetwork/lnd/blob/master/docs/code_formatting_rules.md (part of the checklist in the PR template). |
925b537 to
8978aee
Compare
|
@guggero I think I caught all formatting issues and will keep them in mind. |
guggero
left a comment
There was a problem hiding this comment.
Last set of nits, then we're good to go 🚀
8978aee to
ba400cf
Compare
|
@guggero addressed latest nits. |
lntest/harness_net.go
Outdated
There was a problem hiding this comment.
I thought I already added this comment in my last review, but it looks like I forgot. But those struct fields all need an individual Godoc comment.
funding/manager.go
Outdated
There was a problem hiding this comment.
The question about the TODO is still open. Is this something that actually needs to be decided or can we remove the TODO instead?
Also, the lines following after the comment are now duplicated between this case and the default case. If we set the values when we initialize chanUpdateAnn and only overwrite what we can actually configure this switch statement becomes easier to read and understand IMO.
ba400cf to
5083cc5
Compare
|
Unreal 🍾🎉. Thanks yalls for reviewing and teaching this flow! |
Motivation
Node operators often see their newly confirmed channels' local balance leaking to the remote side especially when connecting to capacity sinks while having configured low default fee rates in
lnd.conf, e.g.The issue is also mentioned here #6610.
This PR introduces two parameters
base_fee_msatandfee_rateforlncli openchannelin order to default to the so specified fees in the channel announcement phase. This way immediate channel leakage can be avoided.Implementation
OpenChannelRequest, baseFee, feeRate, useBaseFee and useFeeRate. The use* fields are added to distinguish between the scenarios where the user provides fee values base_fee 0 / fee_rate 0 onlncli openchanneland where the user omits one of the fee values and when the default config parameters for fees should be used in the channel announcement.rpcserver.goparses the fields intoinitFundingMsgfunding/manager.gothese new fields are added to a channel reservation context.newChanAnnouncementwe check if we find a fee entry in the database for a completed channel id. If so we apply the fees provided and delete the entry from the bucket.Steps to Test
testOpenChannelUpdateFeePolicyandfunding/manager_test.golnd.conf.Pull Request Checklist
Testing
Code Style and Documentation
[skip ci]in the commit message for small changes.📝 Please see our Contribution Guidelines for further guidance.