Skip to content

Channel gossip rework #8136

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
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

rustyrussell
Copy link
Contributor

@rustyrussell rustyrussell commented Mar 4, 2025

(Based on #8135) Merged into master

I tried modifying our state machine to allow us to send (as allowed in the latest spec revisions) announcement_signatures before 6 blocks have passed. However, our state machine did not capture the entire state, so it proved fragile. The result is a rework on the state machine to be more robust.

@rustyrussell rustyrussell added this to the v25.05 milestone Mar 4, 2025
@rustyrussell rustyrussell requested a review from cdecker as a code owner March 4, 2025 03:20
@rustyrussell rustyrussell force-pushed the channel-gossip-rework branch 2 times, most recently from 4a98198 to 49de315 Compare March 5, 2025 01:14
Calling the funding tx an anchor is pre-spec terminology, which is now
confusing; let's rename the variable.

Signed-off-by: Rusty Russell <[email protected]>
In this case a "are we closed onchain".

Signed-off-by: Rusty Russell <[email protected]>
We want a more fine-grained approach, so we now have:

1. update_channel_update() - returns true if it changed.
2. channel_should_enable() - should this channel be marked enabled.
3. arm_refresh_timer() - start a refresh timer for the channel_update.

Signed-off-by: Rusty Russell <[email protected]>
This message was too verbose (even for trace!)

Signed-off-by: Rusty Russell <[email protected]>
They can all call get_block_height(); the extra argument confused me and
I thought they were called before the block height was actually updated.

Signed-off-by: Rusty Russell <[email protected]>
@rustyrussell rustyrussell force-pushed the channel-gossip-rework branch from 49de315 to ddaa077 Compare March 18, 2025 04:06
… wait until 6 deep.

The spec used to say you had to wait for channel to be ready, *and* 6
depth before exchanging signatures.  Now the 6 depth requirement is only
on the actual announcing of the channel: you can send sigs any time.

This means our state machine goes from:

  NOT_USABLE -> NOT_DEEP_ENOUGH -> NEED_PEER_SIGS -> ANNOUNCED

to:

  NOT_USABLE -> NEED_PEER_SIGS -> NOT_DEEP_ENOUGH -> ANNOUNCED

However, this revealed that our state machine is insufficient, so
rework it to be more general and understandable.  In particular,
check for unexpected state transitions, and thus document them.

Signed-off-by: Rusty Russell <[email protected]>
Changelog-Changed: Protocol: We now exchange `announcement_signatures` as soon as we're ready, rather than waiting for 6 blocks (as per recent BOLT update)
@rustyrussell rustyrussell force-pushed the channel-gossip-rework branch from ddaa077 to af559ce Compare March 19, 2025 01: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.

1 participant