Skip to content

multi: cap anchors feerate at configurable maximum#4855

Merged
Roasbeef merged 3 commits into
lightningnetwork:masterfrom
halseth:anchors-clamp-max-feerate
Dec 15, 2020
Merged

multi: cap anchors feerate at configurable maximum#4855
Roasbeef merged 3 commits into
lightningnetwork:masterfrom
halseth:anchors-clamp-max-feerate

Conversation

@halseth
Copy link
Copy Markdown
Contributor

@halseth halseth commented Dec 10, 2020

This commit caps the update fee the initiator will send when the anchors
channel type is used. We do not limit anything on the receiver side.

10 sat/vbyte is the current default max fee rate we use. This should be
enough to ensure propagation before anchoring down the commitment
transaction.

Replaces #4795

@cfromknecht cfromknecht added this to the 0.12.0 milestone Dec 10, 2020
Copy link
Copy Markdown
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

As this is scheduled to land last, we can also use this PR to flip to zero-htlc fee anchors by default, and add the logic to reject the legacy anchors type (assuming we still need to advertise it), and also set up the proper feature dep.

Comment thread config.go Outdated
Comment thread fundingmanager.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this'll need to check a new bit once the zero fee changes are in.

@halseth halseth force-pushed the anchors-clamp-max-feerate branch 2 times, most recently from 8f706f1 to e918469 Compare December 14, 2020 20:54
Copy link
Copy Markdown
Contributor

@cfromknecht cfromknecht left a comment

Choose a reason for hiding this comment

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

looks good! only one small nit

Comment thread lnwallet/channel.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

above we use commitType == lnwallet.CommitmentTypeAnchorsZeroFeeHtlcTx, should that match here? otherwise the maximum will also apply to anchor_outputs channels?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, see this commit in the zero htlc fee PR: 7b0212f#diff-e308f199858d836b06a0c920d2dd019fbb3acb7ef0d9e3d8a360601623128d78R322

So we'll always set both the anchors bit and the zero fee htlc bit if ommitType == lnwallet.CommitmentTypeAnchorsZeroFeeHtlcTx

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Correct that this'll apply to "regular" anchors as well, though with the dependent PR we essentially don't advertise it at all from teh perspective of the public network.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it will also apply the the existing few legacy anchor channels, but I think that's okay.

Comment thread lnwallet/commitment.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

very char. much wow

@halseth halseth force-pushed the anchors-clamp-max-feerate branch from e918469 to 7aac569 Compare December 15, 2020 09:02
This commit caps the update fee the initiator will send when the anchors
channel type is used. We do not limit anything on the receiver side.

10 sat/vbyte is the current default max fee rate we use. This should be
enough to ensure propagation before anchoring down the commitment
transaction.
@halseth halseth force-pushed the anchors-clamp-max-feerate branch from 60434d3 to 413ece2 Compare December 15, 2020 18:54
@Roasbeef
Copy link
Copy Markdown
Member

Needs a rebase!

@halseth
Copy link
Copy Markdown
Contributor Author

halseth commented Dec 15, 2020

Rebased

Copy link
Copy Markdown
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

LGTM 🐋

@Roasbeef Roasbeef merged commit 63055ee into lightningnetwork:master Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants