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

Conversation

rustyrussell
Copy link
Contributor

Based on #4520, though we don't currently use quiescence to force an upgrade.

This is an implementation of lightning/bolts#868, though much of it is more about the mechanics of the upgrade we actually end up supporting (option_static_remotekey).

@rustyrussell rustyrussell added the Optech Make Me Famous! Look! Look! Look! COOL NEW FEATURE! label May 14, 2021
@rustyrussell rustyrussell added this to the v0.10.1 milestone May 14, 2021
@rustyrussell rustyrussell force-pushed the guilt/channel-upgrade branch 2 times, most recently from 7d1571e to 3b26c2b Compare May 18, 2021 02:07
@cdecker cdecker force-pushed the guilt/channel-upgrade branch 2 times, most recently from 45b1e1a to 9fb05c0 Compare May 26, 2021 16:32
@cdecker
Copy link
Member

cdecker commented May 26, 2021

Sorry for the rebase noise, but a merge caused the SQL files to conflict again.

ACK 9fb05c0

wallet/db.c Outdated Show resolved Hide resolved
@rustyrussell
Copy link
Contributor Author

Simple fix for sql non-portability, and rebased on new quiescence branch.

@rustyrussell rustyrussell requested a review from cdecker May 31, 2021 03:17
@rustyrussell rustyrussell force-pushed the guilt/channel-upgrade branch 3 times, most recently from 5bdb1ab to 7422978 Compare June 3, 2021 03:33
@rustyrussell
Copy link
Contributor Author

Rebase, and remove first patch (will go into separate PR, but only the rest was acked by @cdecker so I'd rather keep it simple)

And as Lisa requested, add testcases.

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

Just always handle both cases.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
It's a global.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
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>
…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>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell
Copy link
Contributor Author

Fixed elements: we were not ignoring fee outputs in "onchaind: don't rely on knowing option_static_remotekey for unknown commitments.".

@rustyrussell
Copy link
Contributor Author

Ack d4809d8

(Since fix is trivial, and rest has been reviewed already)

See lightning/bolts#868

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
For now the only upgrade possible is to enable option_static_remotekey.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
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>
No longer a global "on" or "off", it depends on the commitment number.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
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>
…t already.

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

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

Finally fixed all the dumb trivial stuff. Self-ack

Ack 519adf7

@rustyrussell rustyrussell merged commit 2f21435 into ElementsProject:master Jun 4, 2021
fiatjaf pushed a commit to fiatjaf/mcldsp that referenced this pull request Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Optech Make Me Famous! Look! Look! Look! COOL NEW FEATURE!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants