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

Simplify use of channel_update #6786

Merged

Conversation

rustyrussell
Copy link
Contributor

This is only the beginning of the cleanup I wanted to perform, but the rest requires that gossipd no longer handle private gossip, which will not be in this release.

Nonetheless, this removes some fairly complex code, so nice to have: channeld used to make the updates, and tell lightningd to tell gossipd, and now lightningd does it itself.

@rustyrussell rustyrussell added this to the v23.11 milestone Oct 16, 2023
`[False]` is considered True in Python, so this flake fix didn't work.

```
>>> if [False]:
...     print('x')
... 
x
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This is far simpler: lightningd no longer needs to tell channeld when updates change, etc.

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

channeld used to talk directly to gossipd, so it made sense for it to
tell gossipd directly when it wanted it to make a new channel_update.

When that changed with v0.11, we simply directed the message via
lightningd.

But much of the information is actually told to channeld by lightningd!

So I applied this assertion and ran the test suite, before the next patch makes it redundant.

We got one assertion: test_setchannel_zero deliberately drives the
advertized htlc_max over the real htlc max in test_setchannel_zero for
testing.

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

Rename it to `enable` and invert it everywhere.

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

Now we've asserted that channeld would tell lightningd the same thing it
would do anyway, we can simply have channeld say "enable=True|False" and
lightningd fill in the other fields.

This means there's a pile of things channeld doesn't need to know any more!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@cdecker
Copy link
Member

cdecker commented Oct 24, 2023

Very nice cleanup 👍

ACK fde56fd

@rustyrussell rustyrussell merged commit eeee5d6 into ElementsProject:master Oct 24, 2023
38 checks passed
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.

None yet

2 participants