Skip to content

cnct: commit sweep without nursery#3644

Merged
halseth merged 8 commits into
lightningnetwork:masterfrom
joostjager:commit-sweep-no-nursery
Nov 15, 2019
Merged

cnct: commit sweep without nursery#3644
halseth merged 8 commits into
lightningnetwork:masterfrom
joostjager:commit-sweep-no-nursery

Conversation

@joostjager
Copy link
Copy Markdown
Contributor

@joostjager joostjager commented Oct 29, 2019

This PR (finally) removes the dependency on the legacy utxo nursery from the commit sweep resolver.

The reason for doing this now, is that the new anchor output commitment format will also csv-lock the to_remote output. This requires changes and testing in this area and it seems like a good opportunity to clean up this technical debt.

Subtask of #3587

@joostjager joostjager requested a review from Roasbeef as a code owner October 29, 2019 16:24
@joostjager joostjager added chain handling commitments Commitment transactions containing the state of the channel contracts incomplete WIP PR, not fully finalized, but light review possible labels Oct 29, 2019
@joostjager joostjager added this to the 0.9.0 milestone Oct 29, 2019
@joostjager joostjager removed the request for review from Roasbeef October 29, 2019 16:29
@joostjager joostjager self-assigned this Oct 29, 2019
@joostjager
Copy link
Copy Markdown
Contributor Author

joostjager commented Oct 29, 2019

Note to self: reporting in PendingChannels (no more nursery report)

@joostjager joostjager force-pushed the commit-sweep-no-nursery branch from 496d99f to a9925dc Compare October 30, 2019 10:39
@joostjager joostjager force-pushed the commit-sweep-no-nursery branch 3 times, most recently from 947635d to c3b6337 Compare October 30, 2019 11:00
@joostjager joostjager requested a review from halseth October 30, 2019 11:02
@joostjager joostjager force-pushed the commit-sweep-no-nursery branch from c3b6337 to ff7f118 Compare October 30, 2019 11:06
@joostjager joostjager force-pushed the commit-sweep-no-nursery branch from ff7f118 to 840f46f Compare October 30, 2019 11:50
@joostjager
Copy link
Copy Markdown
Contributor Author

To do: add commit sweep resolver unit test

@joostjager joostjager force-pushed the commit-sweep-no-nursery branch 2 times, most recently from bed44a0 to fad80f9 Compare October 31, 2019 12:01
@joostjager joostjager requested a review from halseth October 31, 2019 12:02
@joostjager
Copy link
Copy Markdown
Contributor Author

Unit test added, ready for review

Copy link
Copy Markdown
Contributor

@halseth halseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome change, I can see this making it much simpler to add the new commitment ouputs later, and nice to have more of the sweeping being done by the sweeper 👍

Comment thread contractcourt/commit_sweep_resolver.go Outdated
Comment thread contractcourt/channel_arbitrator.go Outdated
Comment thread contractcourt/commit_sweep_resolver.go Outdated
Comment thread contractcourt/commit_sweep_resolver.go Outdated
Comment thread rpcserver.go Outdated
Comment thread rpcserver.go Outdated
Comment thread contractcourt/commit_sweep_resolver_test.go Outdated
Comment thread contractcourt/commit_sweep_resolver_test.go Outdated
@joostjager joostjager force-pushed the commit-sweep-no-nursery branch from fad80f9 to 3a69ab2 Compare October 31, 2019 16:46
Comment thread contractcourt/htlc_incoming_resolver_test.go Outdated
Comment thread input/input.go Outdated
Comment thread contractcourt/channel_arbitrator.go Outdated
Comment thread contractcourt/chain_arbitrator.go Outdated
Comment thread rpcserver.go Outdated
Comment thread contractcourt/chain_arbitrator.go Outdated
Copy link
Copy Markdown
Contributor

@halseth halseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💹

Comment thread contractcourt/channel_arbitrator.go Outdated
Comment thread contractcourt/channel_arbitrator.go Outdated
Comment thread contractcourt/channel_arbitrator.go Outdated
Comment thread contractcourt/commit_sweep_resolver_test.go Outdated
Comment thread contractcourt/commit_sweep_resolver_test.go Outdated
@joostjager joostjager mentioned this pull request Nov 7, 2019
@joostjager joostjager force-pushed the commit-sweep-no-nursery branch 4 times, most recently from 01f1b14 to 5d330d6 Compare November 12, 2019 14:28
@joostjager
Copy link
Copy Markdown
Contributor Author

Rebased on top of resolver constructors

@joostjager joostjager removed the incomplete WIP PR, not fully finalized, but light review possible label Nov 12, 2019
Unify resolver specific log statements. Leaves modification of
the other resolvers for a later moment when it can be combined with a
real change.
This commit prepares for the commit sweep resolver to report on its
state.
@joostjager joostjager force-pushed the commit-sweep-no-nursery branch from 5d330d6 to 41d84f3 Compare November 13, 2019 09:17
Copy link
Copy Markdown
Contributor

@cfromknecht cfromknecht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice commit structure 🤘

Comment thread contractcourt/channel_arbitrator.go Outdated
Comment thread contractcourt/commit_sweep_resolver.go Outdated
Comment thread contractcourt/commit_sweep_resolver.go Outdated
Comment thread contractcourt/commit_sweep_resolver.go Outdated
Comment thread contractcourt/commit_sweep_resolver.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the report at various times during the test?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check added

@joostjager joostjager force-pushed the commit-sweep-no-nursery branch from 41d84f3 to 5e7af0f Compare November 14, 2019 12:24
The channel arbitrator no longer passes the direct commitment output to
the nursery for incubation. Instead the resolver itself will await the
csv lock if any.

The reason to change this now is to prevent having to deal with the
(legacy) nursery code for a planned anchor outputs related change to the
commit sweep resolver (also csv lock to_remote).

It is no problem if there are any lingering incubating outputs at the
time of upgrade. This just means that the output will be offered twice
to the sweeper and this doesn't hurt.
Now that the commit sweep resolver is no longer relying on the nursery,
all code associated with commit sweeping can be removed.
@joostjager joostjager force-pushed the commit-sweep-no-nursery branch from 5e7af0f to 462d86d Compare November 14, 2019 12:38
@joostjager joostjager requested a review from halseth November 14, 2019 12:38
Copy link
Copy Markdown
Contributor

@halseth halseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎩

@halseth halseth merged commit 840051c into lightningnetwork:master Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chain handling commitments Commitment transactions containing the state of the channel contracts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants