Skip to content
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

Apply 0-reserve to both peers #556

Merged
merged 1 commit into from
Nov 10, 2023
Merged

Apply 0-reserve to both peers #556

merged 1 commit into from
Nov 10, 2023

Conversation

t-bast
Copy link
Member

@t-bast t-bast commented Oct 23, 2023

We previously only applied 0-reserve to the non-initiator when the feature bit was active. We should apply it to both sides of the channel.

This reduces the liquidity requirements on the initiator side, and allows receiving more funds over lightning before requiring a splice to get more inbound liquidity.

This doesn't create any backwards-compatibility issue on the lightning-kmp side, because if we release with that change, we simply allow our peer to dip into their reserve, which they may or may not do (so we can merge this PR whenever we want). On the eclair side, we can "activate" this when the Phoenix node also supports quiescence, which implicitly means that it contains this change. In the longer term, we can clean-up those requirements as being simply dependent on the 0-reserve feature bit.

Fixes #552

We previously only applied 0-reserve to the non-initiator when the feature
bit was active. We should apply it to both sides of the channel.

This reduces the liquidity requirements on the initiator side, and allows
receiving more funds over lightning before requiring a splice to get more
inbound liquidity.
@t-bast t-bast force-pushed the remote-zero-reserve branch from 1bb2d36 to 025aa27 Compare November 3, 2023 08:39
@t-bast t-bast marked this pull request as ready for review November 7, 2023 09:53
@t-bast t-bast requested a review from pm47 November 7, 2023 09:53
@@ -515,11 +508,11 @@ data class FullCommitment(
val fundingTxId: ByteVector32 = commitInput.outPoint.txid
val fundingAmount = commitInput.txOut.amount
val localChannelReserve = when {
params.channelFeatures.hasFeature(Feature.ZeroReserveChannels) && !params.localParams.isInitiator -> 0.sat
params.channelFeatures.hasFeature(Feature.ZeroReserveChannels) -> 0.sat
Copy link
Member

Choose a reason for hiding this comment

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

The duplication between Commitments and FullCommitments shows that there is some cleanup to do

Copy link
Member Author

Choose a reason for hiding this comment

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

True, but I'm not sure how it could be cleaned up though, so I'm leaving it as-is for now.

@t-bast t-bast merged commit 79b7477 into master Nov 10, 2023
2 checks passed
@t-bast t-bast deleted the remote-zero-reserve branch November 10, 2023 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restore channel reserve computation when receiving update_fee
2 participants