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

Move transaction broadcasting and fee estimation to dedicated modules #205

Merged
merged 5 commits into from
Dec 4, 2023

Commits on Nov 29, 2023

  1. Clean up types.rs

    tnull committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    88b0cdf View commit details
    Browse the repository at this point in the history

Commits on Dec 4, 2023

  1. Introduce TransactionBroadcaster

    We introduce a separate `TransactionBroadcaster` which will regularly
    process a message queue of transactions to be broadcast. This allows us
    to a) decouple broadcasting from the BDK wallet and b) add transactions
    to the queue from a blocking context, without the need to schlep around
    a separate runtime or mess with it.
    tnull committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    3c08268 View commit details
    Browse the repository at this point in the history
  2. Retry broadcasts after 500ms if they failed due to an HTTP error

    Due to the rate-limiting applied by many Esplora servers we often
    receive HTTP 429 ('too many requests') errors during syncing. Here, we
    simply give broadcasting transactions a second chance after a slight
    delay of 500ms to ease the pain of immediate failures. Generally,
    rebroadcasting will then be initiated by the `OuputSweeper`.
    tnull committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    6a70348 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    372a520 View commit details
    Browse the repository at this point in the history
  4. Introduce OnchainFeeEstimator

    We also decouple fee estimation from the BDK on-chain wallet and BDK's
    corresponding `EsploraBlockchain`. Instead we use the esplora client
    directly in a dedicated `OnchainFeeEstimator` object.
    
    For one, this change is nice as it allows us
    to move more things out of the `Wallet` thread and corresponding locks.
    Moreover, it makes things more modular in general, which makes future
    upgrades and testing easier.
    tnull committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    ea31d2d View commit details
    Browse the repository at this point in the history