core
core copied to clipboard
feat: simplify transaction timeout
Explanation
Simplify the transaction timeout mechanism to not count attempts, but instead check the time since submit, or when the transaction was last seen on the network.
Calculates the timeout duration using the blockTime from the accelerated polling feature flags.
References
Checklist
- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
- [x] I've communicated my changes to consumers by updating changelogs for packages I've changed
- [x] I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them
[!NOTE] Replaces attempt-based pending transaction timeout with duration-based logic using
blockTimefrom feature flags, tracking last-seen timestamps; updates feature flag utils, tests, and changelog.
- PendingTransactionTracker:
- Replace attempt-counter timeout with time-based check using
submittedTimeor last seen on network; fail whendurationSinceLastSeen >= blockTime * threshold.- Track
#lastSeenTimestampByHash; reset when tx is seen; remove#timeoutCountByHash.- Use
getAcceleratedPollingParams(chainId).blockTime; keep existing skips (disabled, future nonce, missing hash/nonce) and ignore timeout if nosubmittedTime.- Feature Flags:
- Extend
acceleratedPollingto includeblockTime(default 12s); updategetAcceleratedPollingParamsto return{ blockTime, countMax, intervalMs }.- Tests:
- Update timeout tests to use fake timers and time-based assertions; add coverage for last-seen reset and missing
submittedTime.- Update feature flag tests to assert
blockTimehandling.- Changelog: Document the new time-based timeout behavior and use of
blockTime.Written by Cursor Bugbot for commit a09f1507d5f3e02ebcdb1cb139abba4a64441ea9. This will update automatically on new commits. Configure here.