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

Applying blocks APIs #903

Closed
evanlinjin opened this issue Mar 17, 2023 · 3 comments
Closed

Applying blocks APIs #903

evanlinjin opened this issue Mar 17, 2023 · 3 comments
Assignees
Labels
new feature New feature or request

Comments

@evanlinjin
Copy link
Member

We need a set of APIs to easily apply blocks to a keychain tracker. I propse the following:

  • ChainGraph::<ConfirmationTime>::from_block(block): This creates a chain graph with two checkpoints (one for the block at height and one for prev block hash).
  • KeychainTracker::apply_update_relevant(scan: KeychainScan), does this same thing as apply_update but doesn't not take transactions that don't send to or from things in the txout index. Also add determine_relevant_changeset.
  • ChainGraph::apply_update_relevant(|tx| is_this_relevant(tx)) same as above except you can pass a predicate (also needs the changeset option).

In addition to adding these APIs it looks like KeychainTracker::determine_changeset has a TODO in it that needs to be fixed before this whole workflow will work properly:

Old ticket: LLFourn/bdk_core_staging#193

@evanlinjin evanlinjin added new feature New feature or request BDK 1.0.0 labels Mar 17, 2023
@evanlinjin evanlinjin added this to the 1.0.0 milestone Mar 17, 2023
@evanlinjin evanlinjin mentioned this issue Mar 17, 2023
5 tasks
@LLFourn
Copy link
Contributor

LLFourn commented Mar 20, 2023

After #895, ChainGraph::from_block is no longer needed and apply_update_relevent applies to IndexedTxGraph.

@notmandatory notmandatory removed this from the 1.0.0 milestone May 4, 2023
@danielabrozzoni
Copy link
Member

See #896 (comment)

@LLFourn
Copy link
Contributor

LLFourn commented Oct 13, 2023

I think we can say this is done now. If disagree re-open. Improvements to it can be done in other issues.

@LLFourn LLFourn closed this as completed Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants