Skip to content

Conversation

@matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Dec 7, 2025

Explanation

Automatically fail pending transactions if no receipt and hash is not recognised by network after multiple attempts.

Threshold is defined in new feature flag, supporting chain specific and default values.

Ignores transactions with future nonce or if new optional isTimeoutEnabled callback returns false.

References

Related to #23563

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Automatically fails pending transactions with no receipt and not found on-network after a feature-flagged number of attempts, with per-transaction opt-out.

  • Pending Transaction Handling:
    • Add timeout logic in helpers/PendingTransactionTracker.ts to fail transactions lacking a receipt and absent from the network (getTransactionByHash) after getTimeoutAttempts threshold.
      • Skips when nonce is in the future; resets counter if transaction later appears; emits failure with Transaction not found on network after timeout.
      • Uses new isTimeoutEnabled hook; tracks attempts per hash; leverages messenger feature flags.
    • Integrate into TransactionController by adding hooks.isTimeoutEnabled and passing it to PendingTransactionTracker.
  • Feature Flags:
    • Add getTimeoutAttempts in utils/feature-flags.ts (per-chain and default support).
  • Tests:
    • Update PendingTransactionTracker.test.ts to mock specific RPC calls and cover timeout paths, counter reset, and edge cases.
    • Add tests for getTimeoutAttempts in utils/feature-flags.test.ts.
  • Docs/Changelog:
    • Update CHANGELOG.md with the new auto-fail behavior and configuration details.

Written by Cursor Bugbot for commit 2efcfba. This will update automatically on new commits. Configure here.

@matthewwalsh0 matthewwalsh0 force-pushed the feat/transaction-timeout branch from 59e4905 to c055654 Compare December 7, 2025 14:19
@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review December 7, 2025 15:44
@matthewwalsh0 matthewwalsh0 requested review from a team as code owners December 7, 2025 15:44
vinistevam
vinistevam previously approved these changes Dec 9, 2025
OGPoyraz
OGPoyraz previously approved these changes Dec 9, 2025
@matthewwalsh0 matthewwalsh0 dismissed stale reviews from OGPoyraz and vinistevam via 3d841de December 9, 2025 11:00
@matthewwalsh0 matthewwalsh0 force-pushed the feat/transaction-timeout branch from bd9428a to 3d841de Compare December 9, 2025 11:00
@matthewwalsh0 matthewwalsh0 added this pull request to the merge queue Dec 9, 2025
Merged via the queue into main with commit 6289f81 Dec 9, 2025
283 checks passed
@matthewwalsh0 matthewwalsh0 deleted the feat/transaction-timeout branch December 9, 2025 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants