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

sweep: create sweeper #1960

Merged
merged 13 commits into from
Dec 19, 2018
Merged

sweep: create sweeper #1960

merged 13 commits into from
Dec 19, 2018

Conversation

joostjager
Copy link
Contributor

@joostjager joostjager commented Sep 21, 2018

This PR moves the sweeper logic from utxonursery into a separate sweeper struct.

A follow up PR is #2000, which will let resolvers use the sweeper directly instead of going through nursery. The end goal is to remove nursery completely.

In this PR, there is no db migration to clean up now unused nursery store data. This allows us to keep the downgrade path open for a while.

@Roasbeef Roasbeef added enhancement Improvements to existing features / behaviour channel management The management of the nodes channels contracts P3 might get fixed, nice to have utxo sweeping labels Sep 22, 2018
@joostjager joostjager force-pushed the sweeper branch 14 times, most recently from 369d13b to 58740fd Compare October 23, 2018 15:02
@joostjager
Copy link
Contributor Author

  • Commits cherry-picked except for wraps at 79 (instead of 80) chars.
  • Sweeper store bucket scan replaced by exact bucket retrieval.
  • Commit added to soften error handling again. Both error handling commits to be squashed when we are really certain that we want it like this.

@joostjager
Copy link
Contributor Author

Tested nursery tx migration again. Seems to work on my machine.

Roasbeef
Roasbeef previously approved these changes Dec 18, 2018
Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

🎉 LGTM 🎉

Ready to merge on my end once the final two commits squashed.

@joostjager
Copy link
Contributor Author

  • Added one more commit: lnwallet: prevent static fee estimator fees from being modified
  • Squashed error handling commits
  • Fixed unit test flake

joostjager and others added 13 commits December 18, 2018 10:50
Modifying the static fees is not thread safe. In this commit the fees
are made immutable.
We need to distinguish an lnd build for the purpose of integration
testing from a regular dev build. This makes it possible to adapt
parameters to let integration tests run faster (for example:
sweeper batch window).
This commit is a preparation for the implementation of remote spend
detection. Remote spends may happen before we broadcast our own sweep
tx. This calls for accurate height hints.
This commit adds a function that takes a set of inputs and splits them
in sensible sets to be used for generating transactions.
This commit adds a store for the sweeper. The sweeper needs minimal
persistent data to be able to recognize its own sweeps.
In this commit, the sweep package is extended from just tx generation to
an active sweeper that collects sweep inputs and autonomously proceeds
to publish the sweep tx after the batch window time interval has passed
without new inputs being added.
Previously, nursery generated and published its own sweep txes. It
stored the sweep tx in nursery_store to prevent a new tx with a new
sweep address from being generated on restart.

In this commit, sweep generation and publication is removed from nursery
and delegated to the sweeper. Also the confirmation notification is
received from the sweeper.
Copy link
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.

Awesome work @joostjager, excited to finally have this in and help people sweep their stuck outputs! Very happy with the final iteration and the huge reduction in complexity over the nursery, LGTM 🎉

Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

LGTM 🔮

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
channel management The management of the nodes channels contracts enhancement Improvements to existing features / behaviour needs testing PR hasn't yet been actively tested on testnet/mainnet P2 should be fixed if one has time utxo sweeping
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants