-
Notifications
You must be signed in to change notification settings - Fork 338
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 Compact Block Filters Syncing #1055
Add Compact Block Filters Syncing #1055
Conversation
This implements a structure that help us start a Nakamoto client and watch for events like BlockMatched, BlockDisconnected and Sync for the scripts that we are interested in. We also implement a ChainOracle for the CBF client.
CBFUpdateIterator will return CBFUpdate data until the Nakamoto client has reached the tip of the chain. At that point, the iterator will return None. The new method, `into_tx_graph_update`, will convert the CBFUpdate into a TxGraph update. This method is a helper that will be necessary for updating the TxGraph once we have a CBFUpdate.
Update into_tx_graph_update to take a Vec of tuples of blocks and transactions as input to create a TxGraph. Add scanning with Nakamoto client. We start by creating a list of scripts to scan and we continue to scan the chain until we have satisfied stop_gap condition. On each scan we get a fresh list of script to watch. We then update the IndexedGraph and return the IndexedAdditions.
d4d897a
to
4afc158
Compare
from CI I think I should finish the cloudhead/nakamoto#145 What version of rust-bitcoin bdk is using? |
@vincenzopalazzo the team recently merged #1023 which updates bdk ( |
@notmandatory Nice, so I can finish my PR now, because #1023 was blocking me in nakamoto |
Thank you for this work! Since BDK has changed significantly since then, I will close this for now. Refer to #679 |
Description
This PR uses the Nakamoto crate to add a CBF syncing logic to BDK. This implementation doesn't create/update a
LocalChain
, it just updates theIndexedTxGraph
. The syncing logic will do a rescan if thestop_gap
condition is not met.Notes to the reviewers
I'm still not sure what logic to implement when a reorg happens. I will love to hear your thoughts on the subject.
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features: