Add Compact Block Filters Syncing#1055
Closed
vladimirfomene wants to merge 5 commits intobitcoindevkit:masterfrom
Closed
Add Compact Block Filters Syncing#1055vladimirfomene wants to merge 5 commits intobitcoindevkit:masterfrom
vladimirfomene wants to merge 5 commits intobitcoindevkit:masterfrom
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? |
Member
|
@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 |
26 tasks
30 tasks
Member
|
Thank you for this work! Since BDK has changed significantly since then, I will close this for now. Refer to #679 |
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.
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_gapcondition 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 fmtandcargo clippybefore committingNew Features: