feat(chain-sources): fetch headers at caller-requested heights (#2200)#2241
Open
ANAMASGARD wants to merge 1 commit into
Open
feat(chain-sources): fetch headers at caller-requested heights (#2200)#2241ANAMASGARD wants to merge 1 commit into
ANAMASGARD wants to merge 1 commit into
Conversation
Add a reorg-aware on-demand CheckPoint<Header> fetch API to bitcoind_rpc, electrum, and esplora so wallets can obtain MTP windows without paying for prev-11 on every sync (bitcoindevkit#2200).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2200
Description
Adds
fetch_headers_at_heights(local_tip, heights) -> CheckPoint<Header>tobdk_bitcoind_rpc,bdk_electrum, andbdk_esplora.Wallets can fetch missing block headers on demand (for MTP, relative timelocks, confirmation timestamps) without paying for prev-11 fetches on every sync. The returned update is reorg-aware and applies via
LocalChain::apply_update.API contract:
local_tiplocal_tipunchanged (emptyChangeSet)Shared helpers in
bdk_core:bridge_heights,build_fetch_headers_updateNotes to the reviewers
bdk_bitcoind_rpc: standalonefetch_headers_at_heights(not onEmitter::next_block)bdk_electrum:BdkElectrumClient::fetch_headers_at_heightswithbatch_block_headerbdk_esplora: newheaders_at_heightsmodule; blocking + async trait methodssync/full_scanLocal verification : VERIFIED — all tests passed
Changelog notice
fetch_headers_at_heightstobdk_bitcoind_rpc,bdk_electrum, andbdk_esplorafor on-demandCheckPoint<Header>fetches at caller-requested heightsbridge_heightsandbuild_fetch_headers_updatehelpers inbdk_coreChecklists
All Submissions:
New Features: