Describe the bug
KeychainTxOutIndex stages newly derived script pubkeys in an internal staging buffer and the flushes that buffer into the next returned ChangeSet. As a result, per-call ChangeSet results aren't operation-local: a call such as reveal_next_spk could return SPK cache entries derived by earlier operations (for example descriptor insertion / index store replenishment), which is surprising for downstream consumers that persist deltas per API call.
To Reproduce
- Create KeychainTxOutIndex with persist_spks = true and a nonzero lookahead.
- Insert a descriptor.
- Call reveal_next_spk once.
- Inspect the returned ChangeSet.spk_cache.
Expected behavior
Each mutating API call should return a ChangeSet containing only the cache delta created by that call. For example, reveal_next_spk should return only newly derived scripts from that reveal step, not previously staged scripts from unrelated prior calls.
Build environment
- BDK tag/commit: 47556ab
- OS+version:
- Rust/Cargo version: rustc 1.94.1
- Rust/Cargo target:
Which backend(s) are relevant (if any)?
Is this blocking production use?
Describe the bug
KeychainTxOutIndex stages newly derived script pubkeys in an internal staging buffer and the flushes that buffer into the next returned ChangeSet. As a result, per-call ChangeSet results aren't operation-local: a call such as
reveal_next_spkcould return SPK cache entries derived by earlier operations (for example descriptor insertion / index store replenishment), which is surprising for downstream consumers that persist deltas per API call.To Reproduce
Expected behavior
Each mutating API call should return a ChangeSet containing only the cache delta created by that call. For example, reveal_next_spk should return only newly derived scripts from that reveal step, not previously staged scripts from unrelated prior calls.
Build environment
Which backend(s) are relevant (if any)?
____Is this blocking production use?