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

EXPERIMENTAL: channel upgrade support #4532

Merged

Commits on Jun 3, 2021

  1. gen/impl_template: fix generation of singleton varsize elements.

    And as Lisa requested, add testcases.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 3, 2021
    Configuration menu
    Copy the full SHA
    559fc6c View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2021

  1. onchaind: don't rely on knowing option_static_remotekey for unknown c…

    …ommitments.
    
    Just always handle both cases.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    a6e93fa View commit details
    Browse the repository at this point in the history
  2. onchaind: don't hand redundant commit_num to handle_unknown_commitment.

    It's a global.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    1241362 View commit details
    Browse the repository at this point in the history
  3. onchaind: limp along if we cheat.

    We don't handle our own cheat txs: rather than crash, we should just
    log broken and limp along.
    
    This also makes our upcoming penalty test easier: we don't have to
    spin up a new node.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    7d5693f View commit details
    Browse the repository at this point in the history
  4. channeld: tweak function to allow testing for pending *uncommitted* c…

    …hanges.
    
    For quiescence, we can't have sent any updates at all.
    
    But for upgrades on reconnection, we may have already added
    uncommitted HTLCs for retransmission, but they don't count towards
    "are we quiesced" since they're not sent yet.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    67a10cb View commit details
    Browse the repository at this point in the history
  5. common/features: helper to pretty-print feature bits.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    5a613c2 View commit details
    Browse the repository at this point in the history
  6. channel: import upgrade spec.

    See lightning/bolts#868
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    f129870 View commit details
    Browse the repository at this point in the history
  7. channeld: send next_to_send if EXPERIMENTAL_FEATURES

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    50e65ae View commit details
    Browse the repository at this point in the history
  8. channeld: send current features (EXPERIMENTAL_FEATURES)

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    7136b25 View commit details
    Browse the repository at this point in the history
  9. channeld: send upgradable types, add logging (EXPERIMENTAL_FEATURES)

    For now the only upgrade possible is to enable option_static_remotekey.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    996511c View commit details
    Browse the repository at this point in the history
  10. wallet: save thresholds for option_static_remotekey.

    Since we will soon be able to activate it on existing channels,
    we need to mark the threshold.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    2cf0fbc View commit details
    Browse the repository at this point in the history
  11. onchaind: handle static_remotekey thresholds.

    No longer a global "on" or "off", it depends on the commitment number.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    90687de View commit details
    Browse the repository at this point in the history
  12. channeld: handle upgrade match.

    We don't actually set desired_type yet, but this handles it.
    
    Changelog-EXPERIMENTAL: Protocol: we can now upgrade old channels to `option_static_remotekey` from lightning/bolts#868
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    b7139fc View commit details
    Browse the repository at this point in the history
  13. channeld: set desired_type to upgrade option_static_remotekey if no…

    …t already.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    0fd620d View commit details
    Browse the repository at this point in the history
  14. pytest: test onchaind handles unilateral and penalty txs on either si…

    …de of upgrade.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    b678493 View commit details
    Browse the repository at this point in the history
  15. pytest: test that both sides refuse upgrade if not quiescent.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    519adf7 View commit details
    Browse the repository at this point in the history