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

Channel gossip rework #8136

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

rustyrussell
Copy link
Contributor

(Based on #8135)

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.

_in_ versions complain if used, _out_ don't (since we don't know if they are
going to use it).  This was the wrong choice, and thus causes a BROKEN log
message when we update CLN_NEXT_VERSION.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…do_stress any more.

In d18f564 "pytest: stop using
deprecated commando_rune commands." we stopped using deprecated commands in these tests,
but we didn't remove the 'allow-deprecated-apis' flag.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…utput.

Somehow we missed this when we added libplugin support.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
When we update the CLN_NEXT_VERSION, these will only be available with --i-promise-to-fix-broken-api-user.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We now have to explicitly enable various deprecated commando commands, and now
when deprecations are disabled, we honour missing MPP option in bolt12 invoices.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We haven't printed this since v24.08.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: listconfigs raw listing (deprecated v23.08, disabled by default in v24.11).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: connection/disconnection/block_added notification raw fields (deprecated v23.08, disabled by default in v24.11).
Changelog-Removed: accept-htlc-tlv-types (deprecated v23.08, disabled by default in v24.11).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
… sockets.

Changelog-Removed: --bind-addr and --addr on onion addresses and local sockets (deprecated v23.08, disabled by default in v24.11).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: Config: `announce-addr-dns` (deprecated v23.08, disabled in v24.11).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: allowing 0/1 instead of false/true for plugin options (deprecated v23.08, disabled by default in v24.11).
…t values.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: default settings for flag options in plugins which aren't "false".
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: plugins which didn't accept string JSON RPC fields (deprecated v23.08, disabled by default in v24.11).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: RPC `listchannels` no longer includes private local channels (deprecated v23.08, disabled by default in v24.11).
…fore sending announcement_signatures.

We have a replacement quote which is suitable here, but it comes in a later BOLT commit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…ices.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@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
Unfortunately a spec typo means the data fields are missing (PR pending),
so we still patch those in.

The message "your_peer_storage" got renamed to "peer_storage_retrieval",
and the option "want_peer_backup_storage" was removed.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…ound `channel_announcement` handling (ElementsProject#1220)"

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Since we included the spec for it, this is a good time to implement
it.

I also asked chatgpt to write some unit tests.  I had to mangle them a
bit, but it probably saved me a few minutes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Calling the funding tx an anchor is pre-spec terminology, which is now
confusing; let's rename the variable.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
In this case a "are we closed onchain".

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell rustyrussell force-pushed the channel-gossip-rework branch from bb22533 to 4a98198 Compare March 4, 2025 04:01
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 <rusty@rustcorp.com.au>
This message was too verbose (even for trace!)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
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 <rusty@rustcorp.com.au>
… 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 <rusty@rustcorp.com.au>
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 4a98198 to 49de315 Compare March 5, 2025 01:14
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