core icon indicating copy to clipboard operation
core copied to clipboard

feat: simplify transaction timeout

Open matthewwalsh0 opened this issue 2 months ago • 0 comments

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 blockTime from feature flags, tracking last-seen timestamps; updates feature flag utils, tests, and changelog.

  • PendingTransactionTracker:
    • Replace attempt-counter timeout with time-based check using submittedTime or last seen on network; fail when durationSinceLastSeen >= 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 no submittedTime.
  • Feature Flags:
    • Extend acceleratedPolling to include blockTime (default 12s); update getAcceleratedPollingParams to 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 blockTime handling.
  • 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.

matthewwalsh0 avatar Dec 12 '25 13:12 matthewwalsh0