Description
Release reserved sequences that were never actually consumed on-chain.
Problem Statement
A reserved sequence whose transaction fails to submit — network error, timeout, rejection — is currently never returned to the pool. vero-core-engine#181 describes exactly this: TxAggregator.execute() leaks reserved nonces on failure, permanently desyncing the account sequence cache and forcing a manual refresh.
Proposed Changes
Technical Implementation Scaffolding
- Target Repository: vero-sdk
- Target Path: src/nonce/index.ts
- Branch Naming: feat/issue--nonce-leak-recovery
- Authority Context: Security-sensitive — transaction sequencing
Acceptance Criteria
Definition of Done
Description
Release reserved sequences that were never actually consumed on-chain.
Problem Statement
A reserved sequence whose transaction fails to submit — network error, timeout, rejection — is currently never returned to the pool. vero-core-engine#181 describes exactly this:
TxAggregator.execute()leaks reserved nonces on failure, permanently desyncing the account sequence cache and forcing a manual refresh.Proposed Changes
release(account, sequence)to return an unused reservationwithReservation(account, fn)helper that reserves, runsfn, and releases automatically iffnthrowsreleaseis only valid for a sequence that never reached the networkTechnical Implementation Scaffolding
Acceptance Criteria
withReservationcallback leaves the sequence available for reusenpm test,npm run typecheck,npm run lint, andnpm run buildall passDefinition of Done