Skip to content

cnct: remove nursery dependency from success resolver#3977

Closed
joostjager wants to merge 3 commits into
lightningnetwork:masterfrom
joostjager:success-resolver-remove-nursery
Closed

cnct: remove nursery dependency from success resolver#3977
joostjager wants to merge 3 commits into
lightningnetwork:masterfrom
joostjager:success-resolver-remove-nursery

Conversation

@joostjager
Copy link
Copy Markdown
Contributor

@joostjager joostjager commented Feb 3, 2020

No description provided.

Persistence of the generated sweep tx was already removed earlier, so
this field serves no purpose anymore.
Comment thread contractcourt/htlc_success_resolver.go Outdated
To avoid complaints of the linter about copying the lock that will be
introduced in a next commit.
@joostjager joostjager force-pushed the success-resolver-remove-nursery branch from 76db847 to 8567cfc Compare February 3, 2020 15:21
@joostjager joostjager changed the title Success resolver remove nursery cnct: remove nursery dependency from success resolver Feb 3, 2020
@joostjager joostjager force-pushed the success-resolver-remove-nursery branch from 8567cfc to 69027e2 Compare February 3, 2020 15:26
@Roasbeef Roasbeef added commitments Commitment transactions containing the state of the channel contracts utxo sweeping labels Feb 3, 2020
@joostjager joostjager force-pushed the success-resolver-remove-nursery branch from 69027e2 to f59eb8f Compare February 4, 2020 13:10
@joostjager joostjager mentioned this pull request Feb 4, 2020
@joostjager joostjager force-pushed the success-resolver-remove-nursery branch from f59eb8f to 6f65189 Compare February 4, 2020 13:23
This commit updates the success resolver to (only) use the sweeper and
not rely on utxo nursery anymore. This also gets rid of an unnecessary
wait that was always performed in the nursery. In addition to that,
the resolver is made stateless. This prevents us from persisting the
contract report and makes the implementation more robust in general.
@joostjager joostjager force-pushed the success-resolver-remove-nursery branch from 6f65189 to 0bc598c Compare February 4, 2020 19:35
@joostjager
Copy link
Copy Markdown
Contributor Author

Todo: figure out migration path when nursery is already trying to sweep

@joostjager
Copy link
Copy Markdown
Contributor Author

For migration, it is probably enough to just run

func migrateTxHashes(tx *bbolt.Tx, txHashesBucket *bbolt.Bucket,
again so that sweeper recognizes nursery transactions as its own.

Other than that, the (new) resolvers are stateless and will pick up any state the resolution process was left in.

@joostjager
Copy link
Copy Markdown
Contributor Author

Code got outdated because we didn't prioritize this. Closing PR now, because priority is still low. If that changes in the future, it can still be found as a reference on the parent issue #3688.

@joostjager joostjager closed this Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commitments Commitment transactions containing the state of the channel contracts utxo sweeping

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants