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

Correctly set next_commitment_number during splice reconnect #736

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

t-bast
Copy link
Member

@t-bast t-bast commented Dec 13, 2024

As pointed out in lightning/bolts#1214, when reconnecting a partially signed interactive-tx session, we should set next_commitment_number to the current commitment number if we haven't received our peer's commit_sig, which tells them they need to retransmit it.

More importantly, if our peer behaves correctly and sends us the current commitment number, we must not think that they're late and halt, waiting for them to send error. This commit fixes that by allowing our peers to use the current commitment number when they set next_funding_txid.

Note that we keep retransmitting our commit_sig regardless of the value our peer set in next_commitment_number, because we need to wait for them to have an opportunity to upgrade. In a future commit we will stop sending spurious commit_sig.

This PR must only be merged once ACINQ/eclair#2965 has been deployed on the ACINQ node.

pm47
pm47 previously approved these changes Jan 13, 2025
Copy link
Member

@pm47 pm47 left a comment

Choose a reason for hiding this comment

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

LGTM, integration tests with eclair would be nice.

NB: ACINQ/eclair#2965 isn't yet on mainnet

@t-bast
Copy link
Member Author

t-bast commented Jan 15, 2025

LGTM, integration tests with eclair would be nice.

I have tested that channel creation and splices are correctly resumed on reconnection.

As pointed out in lightning/bolts#1214, when
reconnecting a partially signed `interactive-tx` session, we should
set `next_commitment_number` to the current commitment number if we
haven't received our peer's `commit_sig`, which tells them they need
to retransmit it.

More importantly, if our peer behaves correctly and sends us the
current commitment number, we must not think that they're late and
halt, waiting for them to send `error`. This commit fixes that by
allowing our peers to use the current commitment number when they
set `next_funding_txid`.

Note that we keep retransmitting our `commit_sig` regardless of the
value our peer set in `next_commitment_number`, because we need to
wait for them to have an opportunity to upgrade. In a future commit
we will stop sending spurious `commit_sig`.
@t-bast t-bast force-pushed the reconnect-interactive-tx-next-commitment-number branch from e882792 to 95f6261 Compare January 17, 2025 08:42
@t-bast
Copy link
Member Author

t-bast commented Jan 17, 2025

Rebased to fix trivial import conflict.

@t-bast t-bast marked this pull request as ready for review January 17, 2025 08:42
@t-bast t-bast requested a review from pm47 January 17, 2025 08:42
Copy link
Member

@pm47 pm47 left a comment

Choose a reason for hiding this comment

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

Now safe to merge

@t-bast t-bast merged commit a79262f into master Jan 17, 2025
2 checks passed
@t-bast t-bast deleted the reconnect-interactive-tx-next-commitment-number branch January 17, 2025 08:59
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.

2 participants