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 type support #4616

Merged
merged 14 commits into from
Sep 13, 2021
Merged

Commits on Sep 9, 2021

  1. openingd: don't hand redundant feature flags.

    Openingd can query them itself (as dualopend already does).  And move
    the two feature args next to each other on the wire.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    16dc3ea View commit details
    Browse the repository at this point in the history
  2. tools: handle generating print templates for CSV without tlvs, messages

    We want to use this to handle the simple description for channel_type.
    
    It also needs to handle variable-size types (just like subtypes).
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    9c41420 View commit details
    Browse the repository at this point in the history
  3. common/channel_type: wrapper for generated 'struct channel_type'.

    We make it a first-class citizen internally, even though we won't use
    it over the wire (at least, non-experimental builds).  This scheme
    follows the latest draft, in which features are flagged compulsory.
    
    We also add several helper functions.
    
    Since uses the *even* bits (as per latest spec), not the *odd* bits,
    we have some other fixups.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    74e71f7 View commit details
    Browse the repository at this point in the history
  4. common/initial_channel: use channel_type instead of individual option…

    … bools.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    71aa238 View commit details
    Browse the repository at this point in the history
  5. lightningd: use channel_type, pass to-and-from channeld.

    Instead of explicit option_static_remotekey and option_anchor_outputs flags.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    ee2b57d View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2021

  1. openingd: tell lightningd what channel type we negotiated.

    Currently we actually insist it's the default, but in future it could be
    different.
    
    We also need to tell openingd what the channel_type was, if we resume
    via openingd_funder_complete().
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 10, 2021
    Configuration menu
    Copy the full SHA
    d562086 View commit details
    Browse the repository at this point in the history
  2. openingd: EXPERIMENTAL_FEATURES provide and use channel_types.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 10, 2021
    Configuration menu
    Copy the full SHA
    3dd37ec View commit details
    Browse the repository at this point in the history
  3. openingd: channel_type TLV no longer experimental.

    It was merged (but this doesn't update the BOLT quotes, that's in another patch).
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    Changelog-Added: Protocol: We now send and support channel_type in channel open (not dual-funding though).
    rustyrussell committed Sep 10, 2021
    Configuration menu
    Copy the full SHA
    f86a5a1 View commit details
    Browse the repository at this point in the history
  4. openingd: allow channel_type to *downgrade* from default.

    e.g. you can negotiate anchor_outputs, but still ask for a
    non-anchor-output channel.
    
    If/when we make those features compulsory, downgrade will
    not be allowed.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 10, 2021
    Configuration menu
    Copy the full SHA
    610fcf7 View commit details
    Browse the repository at this point in the history
  5. lightningd: print out support for channel_types in --list-features.

    It's not a separate option, but lnprototest needs it to know to expect
    the tlvs.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 10, 2021
    Configuration menu
    Copy the full SHA
    d95b72a View commit details
    Browse the repository at this point in the history
  6. openingd: tell them channel_type if signature is bad.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 10, 2021
    Configuration menu
    Copy the full SHA
    86686ea View commit details
    Browse the repository at this point in the history
  7. closingd: fix BOLT quotes to match final spec version.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 10, 2021
    Configuration menu
    Copy the full SHA
    ec687ab View commit details
    Browse the repository at this point in the history
  8. common/channel_type: fix up bolt quotes now channel-types is merged.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 10, 2021
    Configuration menu
    Copy the full SHA
    43bfe74 View commit details
    Browse the repository at this point in the history
  9. openingd: clean up state properly when a hook says to reject opening.

    This was just a minor leak, found by CI for
    test_openchannel_hook_chaining.  We didn't call negotiation_aborted
    which frees various fields: negotiation_failed() does that for us.
    
    ```
     MEMLEAK: 0x55b0f2d5f3c8
       label=common/channel_type.c:19:struct channel_type
       backtrace:
         ccan/ccan/tal/tal.c:442 (tal_alloc_)
         common/channel_type.c:19 (channel_type_none)
         common/channel_type.c:27 (channel_type_static_remotekey)
         common/channel_type.c:136 (channel_type_accept)
         openingd/openingd.c:844 (fundee_channel)
         openingd/openingd.c:1240 (handle_peer_in)
         openingd/openingd.c:1510 (main)
       parents:
         openingd/openingd.c:1414:struct state
    ```
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 10, 2021
    Configuration menu
    Copy the full SHA
    707164f View commit details
    Browse the repository at this point in the history