Repository navigation
fix: land the remaining stacked store fixes and fuzz coverage on master - #31
Merged
Merged
Conversation
bdk_core anchors are ordered over block height, block hash, and confirmation time. Key anchor_tx by the full identity and verify the stored columns against the JSON payload on load. Distinct anchors are no longer collapsed, and a stale changeset can no longer overwrite a newer confirmation time.
Replace Row::get (which unwraps decode failures) with try_get and map failures to BdkSqlxError::QueryError on both backends. Read SQLite integer columns as i64 and range-check them, so oversized height/vout/last_revealed/block_height values and wrong storage classes fail the load instead of panicking.
DescriptorExt::descriptor_id() unwraps at_derivation_index(0), which panics for multipath keys and hardened derivation. Validate those shapes first and derive index 0 fallibly, returning BdkSqlxError::UnsupportedDescriptor so a corrupt or caller-supplied changeset cannot panic the process.
…criptors Add a cargo-fuzz crate with four targets: changeset persist/load idempotence, corrupt SQLite row decoding, full anchor identity, and descriptor-id validation. Add a Fuzz workflow that builds and lints the fuzz crate and runs each target for 90 seconds on PRs (300 seconds on the weekly schedule).
test: add fuzz targets and CI for store boundaries
Remove the unused sqlx chrono/uuid features, which pulled uuid 1.28 and required Rust 1.89 despite the crate's 1.88 MSRV. Drop the example's bdk_electrum dependency, which transitively pinned vulnerable webpki-roots 0.25; the example now demonstrates persistence and wallet reloading without a network sync.
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.
Summary
PRs #27–#30 were merged into their stacked base branches, but the stack was never merged into
master. This PR lands the remaining commits:try_get, widen SQLite integer reads, and return typed errors instead of panicking on corrupt rows.descriptor_id()can panic.The anchor/local-chain decoupling from #26 is already on
master.Verification
DATABASE_TEST_URL=postgres://... cargo test --all-targets: 63 lib + 2 integration tests passed.cargo clippy --all-targets -- -D warnings: passed.cargo +nightly clippy --manifest-path fuzz/Cargo.toml --all-targets -- -D warnings: passed.Also
Re-enabled the repository's
CIworkflow, which GitHub had disabled for inactivity, so this PR and future changes get the full test suite.