test: add Cashu Fault Lab mint recovery lane - #415
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #415 +/- ##
==========================================
- Coverage 93.40% 93.40% -0.01%
==========================================
Files 113 113
Lines 17930 17930
==========================================
- Hits 16748 16747 -1
- Misses 1182 1183 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
295405a to
c9acc89
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 637dd7ca94
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| await manager.mint.addMint(input.mint, { trusted: true }); | ||
| const quote = await manager.quotes.mint.create({ |
There was a problem hiding this comment.
Reserve operation IDs before creating mint side effects
If two requests with the same operationId overlap—or a request fails after quote creation but before the row is inserted—both pass the existence check and create separate paid quotes and Coco operations; only the later insert detects the collision, leaving an orphaned operation or funds behind. Persist or lock the lifecycle identity atomically before creating the quote, and roll it forward from that reservation.
AGENTS.md reference: AGENTS.md:L164-L167
Useful? React with 👍 / 👎.
| pull_request: | ||
| paths: | ||
| - 'test/fault-lab/**' | ||
| - '.github/workflows/cashu-fault-lab.yml' |
There was a problem hiding this comment.
Run the recovery lane when core recovery code changes
For pull requests that modify only packages/core/**, including MintOperationService or the NUT-09 recovery handlers this scenario is intended to validate, this workflow is skipped because its path filter includes only the Fault Lab files and its own YAML. Consequently, the external response-loss regression test does not protect the production recovery changes it targets; include the relevant core and storage package paths in this trigger.
Useful? React with 👍 / 👎.
| sourceDigest: `sha256:${digest('cashu-fault-lab/coco/source/v1', version)}`, | ||
| buildDigest: `sha256:${digest('cashu-fault-lab/coco/adapter/v1', 'mint')}`, |
There was a problem hiding this comment.
Derive provenance digests from the tested revision
In the supplied runner COCO_FAULT_LAB_VERSION is unset, so version is always workspace and both digest inputs are constants; every Coco revision and dependency build therefore reports the same sourceDigest and buildDigest. This misidentifies Fault Lab artifacts and prevents results from being tied to the code that produced them, so derive these values from the checked-out revision and actual build inputs.
Useful? React with 👍 / 👎.
Problem
Coco has durable mint-operation recovery, but its response-loss behavior is not exercised by an external fault-injection oracle. A mint may commit issuance while the wallet never receives the response, so the same persisted output plan must be reconciled without a duplicate credit.
Summary
cashu-fault-lab@0.2.0mint-response-lostscenario through pinned mintd and Fault Lab gateway imagesmintoperation with process durabilityVerification
bun run test:fault-lab:adapterbunx tsc -p test/fault-lab/tsconfig.jsonbash -n test/fault-lab/run-mint-response-lost.shbun run test:coverage:core(1,243 tests passed locally)test/fault-lab/compose.ymland the workflow as YAMLcashu-fault-lab / mint-response-lost: passed with a 64 sat credit and persisted output-plan evidencePollingTransporttests; three retries failed at three differentwaitForassertions, while the full suite passes locallyChangeset