Skip to content

feat: add optimized batch mint finalization#165

Draft
Egge21M wants to merge 5 commits into
masterfrom
feature/batch-minting
Draft

feat: add optimized batch mint finalization#165
Egge21M wants to merge 5 commits into
masterfrom
feature/batch-minting

Conversation

@Egge21M
Copy link
Copy Markdown
Collaborator

@Egge21M Egge21M commented May 6, 2026

This pull request adds output-deferred single minting and optimized BOLT11 batch mint finalization for NUT-29-capable mints.

Problem

Preparing output data at quote creation prevents multiple paid quotes from being combined into better denomination splits. That keeps single 23-sat quotes at 16,4,2,1 each, instead of allowing three quotes to mint as 64,4,1.

Summary

  • Moves single mint output-data creation to execution, persisted before calling the mint.
  • Adds batch attempt persistence and recovery metadata across core and storage adapters.
  • Adds a shared SQLite-backed integration test proving three 23-sat quotes mint into 3 consolidated proofs.
  • Updates the integration mint image to cashubtc/mintd:v0.16.0.
  • Adds .changeset/batch-minting.md.

Verification

  • bun --cwd packages/adapter-tests typecheck
  • bun --cwd packages/core typecheck
  • bun --cwd packages/core test:unit
  • bun --cwd packages/sqlite3 typecheck
  • bun --cwd packages/sqlite-bun typecheck
  • bun --cwd packages/expo-sqlite typecheck
  • bun --cwd packages/indexeddb typecheck
  • ./scripts/test-integration.sh sqlite3
  • targeted batch integration for sqlite3, sqlite-bun, and expo-sqlite

IndexedDB browser integration was skipped because Playwright does not work on this system.

Changeset

  • Added .changeset/batch-minting.md.

@github-project-automation github-project-automation Bot moved this to Backlog in coco May 6, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 6, 2026

🦋 Changeset detected

Latest commit: a6e2385

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@cashu/coco-core Major
@cashu/coco-indexeddb Major
@cashu/coco-expo-sqlite Major
@cashu/coco-sqlite Major
@cashu/coco-sqlite-bun Major
@cashu/coco-adapter-tests Major
@cashu/coco-react Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Egge21M Egge21M linked an issue May 6, 2026 that may be closed by this pull request
@Egge21M Egge21M changed the title Feature: Add batch-minting feat: add optimized batch mint finalization May 6, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

❌ Patch coverage is 27.42760% with 426 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.12%. Comparing base (5f35420) to head (a6e2385).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
...kages/core/operations/mint/MintOperationService.ts 21.38% 239 Missing ⚠️
...ages/core/infra/handlers/mint/MintBolt11Handler.ts 12.26% 93 Missing ⚠️
...itories/memory/MemoryMintBatchAttemptRepository.ts 22.64% 41 Missing ⚠️
...s/core/services/watchers/MintOperationProcessor.ts 68.53% 28 Missing ⚠️
packages/core/services/MintService.ts 10.00% 18 Missing ⚠️
packages/core/services/ProofService.ts 0.00% 6 Missing ⚠️
packages/core/operations/mint/MintOperation.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #165      +/-   ##
==========================================
- Coverage   79.82%   77.12%   -2.70%     
==========================================
  Files         108      110       +2     
  Lines       11772    12409     +637     
==========================================
+ Hits         9397     9571     +174     
- Misses       2375     2838     +463     
Flag Coverage Δ
core-integration 61.92% <ø> (+0.56%) ⬆️
core-unit 78.27% <27.42%> (-2.94%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

feat: batch minting

1 participant