Skip to content

fix(kyoto): honor recovery birthdays on non mainnet networks - #1077

Open
reez wants to merge 1 commit into
bitcoindevkit:masterfrom
reez:kyoto-recov
Open

reez wants to merge 1 commit into
bitcoindevkit:masterfrom
reez:kyoto-recov

Conversation

@reez

@reez reez commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Description

Honors explicit Kyoto recovery birthdays on every network (previously we had non mainnet birthdays fall back to genesis)

We had a non mainnet guard that predated RecoveryPoint::Other so I thought this might just be an oversight to fix now, but let me know if I'm wrong!

Notes to the reviewers

Documentation

Changelog

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing
  • I've added exactly one changelog:* label
  • I've linked the relevant upstream docs or specs above

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

@reez
reez marked this pull request as ready for review August 12, 2026 21:19
Comment thread bdk-ffi/src/kyoto.rs
checkpoint: HashCheckpoint::from_genesis(network),
}
}
RecoveryPoint::Other { birthday } => bdk_kyoto::ScanType::Recovery {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a regression test using RecoveryPoint::Other on a non-mainnet wallet and assert that the resulting checkpoint preserves the supplied birthday? This exact branch was previously bypassed for every non-mainnet network, and the current test suite would not catch that behavior returning.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I considered this when I was writing the code because I agree it'd be strong regression coverage, and actually did it at first before I changed to whats currently in the PR. I opted to change it to what I have now because previously the cleanest unit test approach required extracting the mapping into a private helper solely to create a test seam, so I wasn’t loving that because I couldn’t find any real similar patterns of that here since conversions are generally handled through From/TryFrom. And then testing CbfBuilder::build directly would instead require running a Kyoto node with a loopback peer because the configured checkpoint is private upstream, etc. So what I preferred was what I ended up with but happy to see how you feel still and what others think, totally open to it if we feel like the tradeoff makes more sense.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that makes sense given CbfBuilder::build does not expose the configured checkpoint. I still think a small pure mapping helper would be justified here because it isolates this network-sensitive conversion and would let us regression-test the exact branch, but I don’t consider that blocking for this focused fix.

@reez
reez requested a review from rustaceanrob August 13, 2026 13:37
@rustaceanrob

Copy link
Copy Markdown
Member

Looks good to me

@rustaceanrob rustaceanrob left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to go in without a dedicated test. The match is straightforward and this only effects test networks.

@thunderbiscuit thunderbiscuit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 9155ecd. Please rebase and merge.

@thunderbiscuit thunderbiscuit added this to the 3.2.0 milestone Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants