Repository navigation
draft(wallet): batched NUT-07 pre-flight for Send/TokenCreated sagas — context sketch for the startup-recovery cost (#2631) - #2632
Draft
Amperstrand wants to merge 1 commit into
Conversation
…recovery Draft raised to showcase a wallet-side recovery cost: one sequential NUT-07 round-trip per accumulated saga row at every startup. Details, measurements, and discussion in the linked issue. This shape is a sketch for context, not a proposed final design.
3 tasks
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.
What this sketch shows
A pre-flight inside
recover_incomplete_sagasthat:Send/TokenCreatedcandidates and their reserved proofs,(256 proofs per request in the sketch — one round-trip where the
sequential loop would make 256),
spent-branch bookkeeping
recover_or_complete_sendapplies (proofsSpent, transactionPending → Completed, row deleted),kinds, and the whole chunk on any request failure — untouched to the
existing sequential resume paths, so offline/flaky mints see no
behavior change.
Deliberately open questions (why this is a draft)
pass, vs. both. Our production daemon chose the periodic pass; this
sketch puts it in recovery because that's where every wallet pays the
cost today.
(per-saga locking, re-fetch). This pre-flight is structurally
independent of the loop's shape, but would need to be re-expressed on
top of it — hence sketching now rather than proposing.
get_incomplete_sagasstill returns every row; astate/kind filter might be the better or additional fix. We did not
touch it here because that changes the primitive's contract for other
callers.
Evidence the shape is viable
cargo test -p cdk --lib: 730 passed / 0 failed (3 new tests: batchfinalization, unspent rows retained, unreachable-mint deferral).
(
MockMintConnector::set_check_state_response_persistent) because theone-shot staged response is consumed by the batch call while the
sequential path legitimately asks again.
Feedback very welcome — especially "wrong place, here's the right one".