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

Conversation

4 participants
@joostjager
Copy link
Collaborator

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.

@joostjager joostjager force-pushed the joostjager:sweeper branch 9 times, most recently from 5ce7feb to 0e9fbeb Sep 22, 2018

@joostjager joostjager force-pushed the joostjager:sweeper branch 14 times, most recently from 369d13b to 58740fd Oct 22, 2018

@joostjager joostjager force-pushed the joostjager:sweeper branch from 70f685e to fe1b247 Dec 17, 2018

@joostjager

This comment has been minimized.

Copy link
Collaborator Author

joostjager commented Dec 17, 2018

  • 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

This comment has been minimized.

Copy link
Collaborator Author

joostjager commented Dec 17, 2018

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

@joostjager joostjager force-pushed the joostjager:sweeper branch from fe1b247 to 6a5b7bf Dec 17, 2018

@Roasbeef
Copy link
Member

Roasbeef left a comment

🎉 LGTM 🎉

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

@Roasbeef Roasbeef added this to Final Testing -- Ready For Merge in High Priority Dec 18, 2018

@joostjager joostjager force-pushed the joostjager:sweeper branch from 6a5b7bf to e1ebec2 Dec 18, 2018

High Priority automation moved this from Final Testing -- Ready For Merge to Needs review Dec 18, 2018

@joostjager

This comment has been minimized.

Copy link
Collaborator Author

joostjager commented Dec 18, 2018

  • 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 some commits Oct 29, 2018

lnwallet: prevent static fee estimator fees from being modified
Modifying the static fees is not thread safe. In this commit the fees
are made immutable.
build: apply rpctest tag in itest
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).
sweep+utxonursery+cnct+breacharbiter: add height hint to input
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.
sweep: add input partitionings generator
This commit adds a function that takes a set of inputs and splits them
in sensible sets to be used for generating transactions.
sweep: add sweeper store
This commit adds a store for the sweeper. The sweeper needs minimal
persistent data to be able to recognize its own sweeps.
sweep: add time-based sweeper
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.
utxonursery: connect to time-based sweeper
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.

@joostjager joostjager force-pushed the joostjager:sweeper branch from e1ebec2 to 687d4e7 Dec 18, 2018

@cfromknecht
Copy link
Collaborator

cfromknecht left a comment

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 🎉

@Roasbeef
Copy link
Member

Roasbeef left a comment

LGTM 🔮

@Roasbeef Roasbeef merged commit 2f17030 into lightningnetwork:master Dec 19, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.2%) to 55.898%
Details

High Priority automation moved this from Needs review to Done Dec 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.