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

Introduce canonicalization modifiers. #1808

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

evanlinjin
Copy link
Member

Partially Fixes #1748

Description

Add the ability to modify the canonicalization algorithm. Right now, the only modifier is assume_canonical which takes in a Vec (ordered list) of txids and superimposes it on the canonicalization algorithm. Txs later in the list (higher index) have a higher priority (in case of conflicts).

This is a "partial fix" because I haven't figured out how to expose this on the bdk_wallet level yet (some thoughts on this will be very appreciated).

Notes to the reviewers

None at the moment.

Changelog notice

  • Added CanonicalizationMods to allow the caller to modify the canonicalization algorithm. This in a new parameter on CanonicalIter::new.

Checklists

All Submissions:

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

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

@evanlinjin evanlinjin self-assigned this Jan 23, 2025
@evanlinjin evanlinjin added the api A breaking API change label Jan 23, 2025
@evanlinjin evanlinjin added this to the 1.1.0 milestone Jan 23, 2025
Introduce `CanonicalizationMods` which is passed in to
`CanonicalIter::new`.

`CanonicalizationMods::assume_canonical` is the only field right now.
This contains a list of txids that we assume to be canonical,
superceding any other canonicalization rules.
Also change `TxTemplate` API to allow for testing with
`assume_canonical`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api A breaking API change
Projects
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

Don't double spend created transaction just because they haven't been broadcasted
1 participant