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

BOLT 2: upgrade protocol on reestablish #868

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

Conversation

rustyrussell
Copy link
Collaborator

@rustyrussell rustyrussell commented May 7, 2021

This is the simplest upgrade mechanism I could come up with. It's ready for option_anchors_zero_fee_htlc_tx, too.

Note the reason it's on reconnect: whatever we do, we need to handle reconnect during an upgrade attempt, which meant some kind of fallback "where were we up to?" at that point. Simplest to make that "fallback" technique the only technique.

And in practice we don't upgrade software without reconnecting anyway.

@rustyrussell rustyrussell requested a review from t-bast May 7, 2021 03:04
@rustyrussell rustyrussell force-pushed the guilt/upgrade_protocol branch 3 times, most recently from fff174e to 494e54c Compare May 7, 2021 04:34
rustyrussell added a commit to rustyrussell/lightning that referenced this pull request May 14, 2021
See lightning/bolts#868

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
rustyrussell added a commit to rustyrussell/lightning that referenced this pull request May 14, 2021
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 added a commit to rustyrussell/lightning that referenced this pull request May 17, 2021
See lightning/bolts#868

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
rustyrussell added a commit to rustyrussell/lightning that referenced this pull request May 17, 2021
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 added a commit to rustyrussell/lightning that referenced this pull request May 18, 2021
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>
cdecker pushed a commit to rustyrussell/lightning that referenced this pull request May 26, 2021
See lightning/bolts#868

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
cdecker pushed a commit to rustyrussell/lightning that referenced this pull request May 26, 2021
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>
cdecker pushed a commit to rustyrussell/lightning that referenced this pull request May 26, 2021
See lightning/bolts#868

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
cdecker pushed a commit to rustyrussell/lightning that referenced this pull request May 26, 2021
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 added a commit to rustyrussell/lightning that referenced this pull request May 31, 2021
See lightning/bolts#868

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
rustyrussell added a commit to rustyrussell/lightning that referenced this pull request May 31, 2021
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 added a commit to rustyrussell/lightning that referenced this pull request Jun 1, 2021
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 added a commit to rustyrussell/lightning that referenced this pull request Jun 1, 2021
See lightning/bolts#868

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
rustyrussell added a commit to rustyrussell/lightning that referenced this pull request Jun 1, 2021
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 added a commit to rustyrussell/lightning that referenced this pull request Jun 3, 2021
See lightning/bolts#868

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
rustyrussell added a commit to rustyrussell/lightning that referenced this pull request Jun 3, 2021
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 added a commit to rustyrussell/lightning that referenced this pull request Jun 3, 2021
See lightning/bolts#868

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
rustyrussell added a commit to rustyrussell/lightning that referenced this pull request Jun 3, 2021
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 added a commit to rustyrussell/lightning that referenced this pull request Jun 3, 2021
See lightning/bolts#868

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
rustyrussell added a commit to rustyrussell/lightning that referenced this pull request Jun 3, 2021
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 added a commit to rustyrussell/lightning that referenced this pull request Jun 4, 2021
See lightning/bolts#868

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
rustyrussell added a commit to rustyrussell/lightning that referenced this pull request Jun 4, 2021
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 added a commit to rustyrussell/lightning-rfc that referenced this pull request Jun 21, 2021
This is extracted from channel_upgrade (lightning#868), but used for opening
negotiation as suggested by @Roasbeef on the last spec meeting.

It's a trivial change, fully backwards compatible, but now each channel
has a channel_type, which defines its behavior, rather than an ad-hoc
set of "sticky" feature bits.  It also means both peers can *support* a
feature without endorsing it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
rustyrussell added a commit to rustyrussell/lightning-rfc that referenced this pull request Aug 31, 2021
This is extracted from channel_upgrade (lightning#868), but used for opening
negotiation as suggested by @Roasbeef on the last spec meeting.

It's a trivial change, fully backwards compatible, but now each channel
has a channel_type, which defines its behavior, rather than an ad-hoc
set of "sticky" feature bits.  It also means both peers can *support* a
feature without endorsing it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
rustyrussell added a commit that referenced this pull request Aug 31, 2021
This is extracted from channel_upgrade (#868), but used for opening
negotiation as suggested by @Roasbeef on the last spec meeting.

It's a trivial change, fully backwards compatible, but now each channel
has a channel_type, which defines its behavior, rather than an ad-hoc
set of "sticky" feature bits.  It also means both peers can *support* a
feature without endorsing it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell rustyrussell changed the title BOLT 2: upgrade protocol on reestablish (option_upgrade_channel 34/35) BOLT 2: upgrade protocol on reestablish Sep 30, 2021
@rustyrussell
Copy link
Collaborator Author

Rebased and further simplified.

@rustyrussell rustyrussell force-pushed the guilt/upgrade_protocol branch 2 times, most recently from 427d950 to 7be9947 Compare September 30, 2021 06:22
@TheBlueMatt
Copy link
Collaborator

Concept ACK, can we drop it being based on quiescence? Seems like we can parallelize those efforts.

This is the simplest upgrade mechanism I could come up with.  It's
ready for option_anchors_zero_fee_htlc_tx, too.

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


Header from folded patch 'spell-out-upgrades.patch':

upgrade: spell out upgrade possibilities.

This uses explicit "channel types", which are now merged into master.

Also spell out the potential issues with back-to-back upgrades, and
workarounds if you were to even have this issue.

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


Header from folded patch 'remove-channel-subtype.patch':

BOLT 2: remove channel_type subtype, only allow one upgrade.

We also define channel type elsewhere, so we can remove the
now-outdated one.  And clarify the example.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This makes it clear who supports it.  Also point out that it can be
used to enable anchors, and remove link to quiescence protocol, since
this is no longer dependent.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
i.e. it was present in the init feature bits.  We use this in several places, but assume everyone knows what it means.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell
Copy link
Collaborator Author

Rebased, and added an explicit feature bit. As a bonus I threw in a commit which defined what "negotiated" and "offered" mean for features!

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