Skip to content

fix: set/unset melt quote and associated proofs in same transaction#880

Open
a1denvalu3 wants to merge 14 commits intomainfrom
test/repro-melt-race-condition
Open

fix: set/unset melt quote and associated proofs in same transaction#880
a1denvalu3 wants to merge 14 commits intomainfrom
test/repro-melt-race-condition

Conversation

@a1denvalu3
Copy link
Collaborator

This PR adds a test case that reproduces a race condition in the melt operation. When two concurrent melt requests attempt to spend the same proofs, one fails as expected, but leaves the proofs in a PENDING state indefinitely.

@TheRealCheebs
Copy link
Contributor

This looks good. We should just take this and then add the branch on top. I'll close my draft which got to the same spot but your test looks cleaner and more direct.

Approved

@a1denvalu3 a1denvalu3 force-pushed the test/repro-melt-race-condition branch from 038f845 to 9556e46 Compare January 29, 2026 11:25
@a1denvalu3 a1denvalu3 changed the title test: add reproduction for melt race condition leaving proofs pending fix: set melt quote and associated proofs in same transaction Jan 29, 2026
@a1denvalu3 a1denvalu3 changed the title fix: set melt quote and associated proofs in same transaction fix: set/unset melt quote and associated proofs in same transaction Jan 29, 2026
@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.66%. Comparing base (516cee2) to head (b256235).
⚠️ Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
cashu/mint/ledger.py 52.94% 8 Missing ⚠️
cashu/mint/db/write.py 93.93% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #880      +/-   ##
==========================================
- Coverage   64.71%   60.66%   -4.05%     
==========================================
  Files          91       90       -1     
  Lines       10900    10866      -34     
==========================================
- Hits         7054     6592     -462     
- Misses       3846     4274     +428     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TheRealCheebs
Copy link
Contributor

LGTM

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

3 participants