Description
Add sequence resynchronisation that cannot race an in-flight reservation.
Problem Statement
After a failed submission or a fee bump, the cached sequence must be resynced from the network. In vero-core-engine this is vero-core-engine#183: refresh() reads and writes sequence state without taking the per-account lock, so it can clobber a reservation another caller is mid-way through using.
Proposed Changes
Technical Implementation Scaffolding
- Target Repository: vero-sdk
- Target Path: src/nonce/index.ts
- Branch Naming: feat/issue--nonce-refresh-locked
- Authority Context: Security-sensitive — transaction sequencing
Acceptance Criteria
Definition of Done
Description
Add sequence resynchronisation that cannot race an in-flight reservation.
Problem Statement
After a failed submission or a fee bump, the cached sequence must be resynced from the network. In
vero-core-enginethis is vero-core-engine#183:refresh()reads and writes sequence state without taking the per-account lock, so it can clobber a reservation another caller is mid-way through using.Proposed Changes
refresh(account)toNonceManager, acquiring the same per-account lock asreserve()Technical Implementation Scaffolding
Acceptance Criteria
refresh()running concurrently withreserve()never produces a duplicate sequencenpm test,npm run typecheck,npm run lint, andnpm run buildall passDefinition of Done