bdk icon indicating copy to clipboard operation
bdk copied to clipboard

feat(rpc): introduce FilterIter

Open ValuedMammal opened this issue 1 year ago • 4 comments

The PR adds a bip158 module to the bdk_bitcoind_rpc crate along with a new type FilterIter that can be used for retrieving blocks from a full node which contain transactions relevant to a list of script pubkeys.

Notes to the reviewers

Changelog notice

bdk_bitcoind_rpc: Added bip158 module as a means of updating bdk_chain structures

Checklists

All Submissions:

  • [x] I've signed all my commits
  • [x] I followed the contribution guidelines
  • [x] I ran cargo fmt and cargo clippy before committing

New Features:

  • [x] I've added tests for the new feature
  • [x] I've added docs for the new feature

ValuedMammal avatar Sep 15 '24 22:09 ValuedMammal

This is what we've all been waiting for.

evanlinjin avatar Sep 16 '24 04:09 evanlinjin

ConceptACK. Don't have time for a full review now. @evanlinjin?

LLFourn avatar Sep 30 '24 04:09 LLFourn

Thanks for the review @oleonardolima

ValuedMammal avatar Oct 21 '24 12:10 ValuedMammal

Rebased and addressed comments from @oleonardolima

ValuedMammal avatar Oct 23 '24 14:10 ValuedMammal

In the last push

  • Removed unneeded next_filter field
  • Fixed up test checking for Error::NoScripts
  • Added test filter_iter_returns_matched_blocks

CI failure seems unrelated

ValuedMammal avatar Jan 11 '25 17:01 ValuedMammal

Rebased

ValuedMammal avatar Jan 18 '25 00:01 ValuedMammal

Rebased

ValuedMammal avatar Jan 24 '25 00:01 ValuedMammal

Thanks @notmandatory

ValuedMammal avatar Jan 27 '25 15:01 ValuedMammal

We need to test this against reorgs. It seems like the architecture of this may result in inconsistent state of checkpoints during reorgs.

  1. Have a chain with blocks .. [100:A] [101:B] with relevant txs in both A and B.
  2. Sync up to 100 (calling .next).
  3. Reorg so that blocks from 100 are replaced (inclusive). .. [100:A'] [101:B'].
  4. Call .next again.
  5. Check that checkpoints end in .. [100:A'] [101:B'] and we have emitted relevant txs in A' and B'.

evanlinjin avatar Feb 20 '25 16:02 evanlinjin