fix(mint): return stored signatures on idempotent POST /mint retry - #1128
Open
Hardeezah wants to merge 1 commit into
Open
fix(mint): return stored signatures on idempotent POST /mint retry#1128Hardeezah wants to merge 1 commit into
Hardeezah wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1128 +/- ##
==========================================
- Coverage 74.85% 74.77% -0.08%
==========================================
Files 112 112
Lines 12589 12599 +10
==========================================
- Hits 9423 9421 -2
- Misses 3166 3178 +12 ☔ View full report in Codecov by Harness. |
When a wallet retries POST /mint with the same outputs after a connection drop, the mint now returns the previously stored signatures instead of raising an error. This prevents token loss when the connection is lost during the minting process. - Add get_blind_signatures_mint_id() and get_blinded_Bs_mint_id() to crud - Add idempotency block in ledger.mint() that checks quote state first - Verify B_ values match (not just output count) to prevent mismatched returns - Update test_mint_internal to expect success on retry - Add tests for idempotent retry and different-output rejection Closes cashubtc#257
Hardeezah
force-pushed
the
fix/mint-idempotent-retry
branch
from
August 20, 2026 11:28
4f9085c to
3c04c10
Compare
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.
When a wallet retries
POST /mintwith the same outputs after a connection drop, the mint now returns the previously stored signatures instead of raisingOutputsAlreadySignedError. This prevents token loss when the connection is lost during the minting process.get_blind_signatures_mint_id()andget_blinded_Bs_mint_id()tocrud.pyledger.mint()that checks quote state firstB_values match (not just output count) to prevent mismatched returnstest_mint_internalto expect success on retryCloses #257