translator: discover quotes by pubkey and sweep every per-epoch unit #32
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/nutxx-pubkey-lookup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Mining rewards were being lost silently, in two ways, and this fixes both. On a live dev stack it now mines shares, mints ecash in the genesis epoch to a balance of 2752, keeps minting across two epoch rotations, and drains a backlog of 55 previously stuck rewards in a single pass. If this is wrong, revert the two commits: the wallet DB schema is untouched and master stays functional on its current cdk pin.
Replaces vnprc/hashpool#21, closed only so the history could be squashed; the forge refuses force-push on an open pull request branch. The tree is byte-identical to the state verified there. It also carries the multi-unit sweeper, which merged into this branch as vnprc/hashpool#31 — hence the retitle.
Merges to master. vnprc/hashpool#24 follows.
In plain English
The pool's wallet has to know which rewards it is owed before it can collect them. It used to be told, one message per reward, and a lost message meant that reward was never collected and nothing reported it. The wallet now asks the mint instead, so a lost message costs seconds rather than money.
Separately, once the mint issues a different kind of ecash each epoch, the wallet has to collect all of them. It could only collect the first, so every epoch after the first lost everything it earned. It now collects every kind it sees, working through a backlog in bounded batches so one bad reward cannot block the rest.
Two more faults turned up only by running the real stack: on first seeing a new kind of ecash the wallet never asked the mint for the matching key, so collection failed forever; and a failed attempt left the reward marked "in progress" with nothing to clear it, so it could never be retried. Both fixed here, because a new epoch cannot be collected without them.
Commits
910f1f32moves the cdk dependency to the forge and pins it, including theCurrencyUnit::Customsignature adaptation and the cargo fetch setting without which the repository does not build. Builds alone.96c766abis the translator work: pubkey discovery, per-epoch unit sweeping, the keyset refresh, and the reservation cleanup.Twenty-seven commits became two. They are grouped as dependency then application code rather than one-per-fix, because the pin must land first — the sweeper calls a cdk API that does not exist in the older revision — and because the two translator features are interleaved in one file, so splitting them would mean hunk surgery rather than a meaningful boundary.
Risk
R2. The cdk pin moves in all five sites that must agree and resolves in
roles/Cargo.lock; MSRV-pinned transitive deps are unchanged (time0.3.41,serde_with3.17.0,darling0.21.3,simple_asn10.6.3 against rustc 1.86.0), and a fresh re-resolve would picktime0.3.55 and fail. Per-unit wallet handles share one sqlite localstore and one metadata cache; the schema and NUT-13 counters are unit- or keyset-scoped and units are swept sequentially, so there is no cross-unit contention. A unit whose keyset refresh fails is deferred to the next pass, so a mint outage delays that unit rather than leaking reservations. The reconcile log format changed to a per-unit summary; anything scraping the old string needs updating. The SV2 quote-id fetch path is retained but disabled, so discovery is sweep-only.Validation
cargo check -p mintclean on the first commit alone;cargo test -p translator_sv237 passed, 0 failed on the tip, re-run by the integrator.Not re-established: the original 2026-08-10 live run, which was performed against a cdk revision that no longer exists anywhere and so cannot be diffed against the current pin. The run above supersedes it.