-
Notifications
You must be signed in to change notification settings - Fork 419
Update channel_reestablish
for splicing
#3886
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
Open
jkczyz
wants to merge
18
commits into
lightningdevkit:main
Choose a base branch
from
jkczyz:2025-06-channel-reestablish
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
bd294b3
Add features for splicing
jkczyz 99affd3
Add funding_locked_txid TLVs to channel_reestablish
jkczyz fa4c9c9
Set funding_locked_txid TLVs in channel_reestablish
jkczyz 2c790d0
f - don't check splice feature bit
jkczyz 5789c8f
Update channel_reestablish logic for channel_ready
jkczyz ab5ccd1
Enter FundingNegotiated state after constructing funding tx
jkczyz cb31e89
Return an Option from ChannelContext::get_initial_commitment_signed
jkczyz cc4152f
f - TODO(splicing): Support async signing
jkczyz 4a0e343
Update next_funding_txid logic for channel_reestablish
jkczyz 5123cc8
f - clean up spec requirement
jkczyz 5619b37
Use consistent initial commitment_signed naming
jkczyz feffea4
Update next_commitment_number logic for channel_reestablish
jkczyz 1047dcd
f - add comment with spec requirement
jkczyz 71ffb50
Send splice_locked on channel_reestablish
jkczyz b647280
Retransmit channel_ready / splice_locked awaiting announcement_sigs
jkczyz a907398
Clear announcement_sigs on FundingScope promotion
jkczyz 15eef7b
Send channel_ready on channel_reestablish
jkczyz 8004c6f
Handle implicit splice_locked during channel_reestablish
jkczyz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update next_commitment_number logic for channel_reestablish
The splicing spec updates the logic pertaining to next_commitment_number when sending a channel_reestablish message. Specifically: The sending node: - if it has sent `commitment_signed` for an interactive transaction construction but it has not received `tx_signatures`: - MUST set `next_funding_txid` to the txid of that interactive transaction. - if it has not received `commitment_signed` for that interactive transaction: - MUST set `next_commitment_number` to the commitment number of the `commitment_signed` it sent.
- Loading branch information
commit feffea4356793b6b92ba72c669bd43a1ac67dda0
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Gah, so now we have a commitment number for which we only have a commitment tx on one funding context but not the others? Bleh.
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.
Hmmm... @wpaulino and I were walking through this the other day, but I can't recall exactly why
self.holder_commitment_point.transaction_number()
would have advanced here.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.
It feels wrong? Like, we should get a new
commitment_signed
for the new funding at the same index as the currentcommitment_signed
we have for the existing funding, but its also possible the spec wants a new index, that just sucks.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.
So the original requirements are:
Which in our code we had represented as:
IIUC, we are subtracting from
INITIAL_COMMITMENT_NUMBER
becausetransaction_number
is initialized byINITIAL_COMMITMENT_NUMBER
(counting down) butnext_commitment_number
is suppose to count up from 0, according to the spec:Then the splicing spec added the last two lines of the following:
So I think the intention of adding
1
here was to get the previous commitment number (i.e., the one for thecommitment_signed
we had sent)... are we assuming was it advanced then? This is where I'm a little foggy. But if that's suppose to be the intention, shouldn't we subtract givennext_commitment_number
is suppose to be counting up?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.
@jkczyz yeah I think we just assumed this was still decrementing from
INITIAL_COMMITMENT_NUMBER
as opposed to counting from 0, so we just need to subtract 1 instead.We subtract 1 because
holder_commitment_point
always points to the next commitment number we expect an update for, and splicing requires that we send/receive an initialcommitment_signed
for the current commitment number. However, we're not taking this into account when sending/receiving that initialcommitment_signed
, so that needs to be fixed separately.