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

Add OutputSweeper utility persisting and sweeping spendable outputs #2825

Merged

Commits on Apr 18, 2024

  1. Introduce OutputSpender trait and implement for (Phantom)KeysManager

    .. we move `spend_spendable_outputs` to a new trait which we can easily
    reuse in `OutputSweeper` later.
    tnull committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    d8021c7 View commit details
    Browse the repository at this point in the history
  2. Introduce ChangeDestinationSource trait

    .. which users should implement on their on-chain wallet to allow us to
    retrieve a new change destination script.
    tnull committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    cd4cc20 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ec95651 View commit details
    Browse the repository at this point in the history
  4. Add OutputSweeper utility persisting and sweeping spendable outputs

    We add a `OutputSweeper` utility that allows to track the state of
    spendable output descriptors as emitted by `Event::SpendableOutputs`.
    
    To this end, the `OutputSweeper` persists the necessary information in
    our `KVStore` and regularly tries to sweep the spendable outputs,
    removing them after reaching threshold confirmations, i.e.,
    `ANTI_REORG_DELAY`.
    tnull committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    071337a View commit details
    Browse the repository at this point in the history
  5. Allow delaying generation and broadcasting of spending txs

    .. which enables users to batch output spends.
    tnull committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    a574f8b View commit details
    Browse the repository at this point in the history
  6. Add basic OutputSweeper test in BP

    .. we simply check that the `OutputSweeper` generates a spending tx and
    that the `TrackedSpendableOutput` is pruned once it reaches
    `ANTI_REORG_DELAY`.
    tnull committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    681106d View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    be8c0d0 View commit details
    Browse the repository at this point in the history