Skip to content

fix(ckbtc): prevent double-mint of cached UTXOs after transaction finalization#9596

Open
gregorydemay wants to merge 5 commits intomasterfrom
gdemay/DEFI-2704-ckbtc-prevent-dedup-outpoints
Open

fix(ckbtc): prevent double-mint of cached UTXOs after transaction finalization#9596
gregorydemay wants to merge 5 commits intomasterfrom
gdemay/DEFI-2704-ckbtc-prevent-dedup-outpoints

Conversation

@gregorydemay
Copy link
Copy Markdown
Contributor

@gregorydemay gregorydemay commented Mar 26, 2026

Summary

  • Prevent double-minting of UTXOs that are returned by the get_utxos cache after their transaction has been finalized and forgotten by the minter
  • Filter processable UTXOs against minted_outpoints before check/mint to deduplicate already-minted outpoints
  • Track deduplicated outpoints in a new deduplicated_outpoints state field with a ckbtc_minter_deduplicated_outpoint_count metric for observability
  • Add a test (should_not_mint_cached_utxo) that reproduces the full scenario: mint → submit tx → cache fill → finalize tx → update_balance with stale cache

🤖 Generated with Claude Code

@github-actions github-actions bot added the fix label Mar 26, 2026
@gregorydemay gregorydemay changed the title fix(ckbtc): prevent double minting of outpoints fix(ckbtc): prevent double-mint of cached UTXOs after transaction finalization Mar 26, 2026
@gregorydemay gregorydemay marked this pull request as ready for review March 27, 2026 07:54
@gregorydemay gregorydemay requested a review from a team as a code owner March 27, 2026 07:54
@github-actions github-actions bot added the @defi label Mar 27, 2026
@gregorydemay gregorydemay requested review from THLO, ninegua and tmu0 March 27, 2026 07:55
Copy link
Copy Markdown
Contributor

@THLO THLO left a comment

Choose a reason for hiding this comment

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

Very nice PR! Thanks!

Copy link
Copy Markdown
Contributor

@tmu0 tmu0 left a comment

Choose a reason for hiding this comment

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

💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants