-
-
Notifications
You must be signed in to change notification settings - Fork 261
feat: simplify transaction timeout #7464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+185
−141
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a09f150 to
f861274
Compare
packages/transaction-controller/src/helpers/PendingTransactionTracker.ts
Show resolved
Hide resolved
c57f946 to
e776a73
Compare
Member
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
OGPoyraz
approved these changes
Dec 19, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
blockTimefrom the accelerated polling feature flags.References
Checklist
Note
Replaces attempt-based pending transaction timeout with a time-based check (since submit or last seen), using
blockTime * threshold, and updates feature flags/tests accordingly.src/helpers/PendingTransactionTracker.ts):submittedTimeor last seen timestamp; derive timeout fromgetAcceleratedPollingParams().blockTime * threshold.hashvia#lastSeenTimestampByHash; reset when tx is seen and clear on confirm/fail/drop.#cleanTransactionto clear force-poll and last-seen state; remove timeout counter usage.src/utils/feature-flags.ts):blockTime(12s) and include optionalblockTimeinacceleratedPolling.perChainConfig.getAcceleratedPollingParamsto return{ blockTime, countMax, intervalMs }.PendingTransactionTracker.test.tsto use fake timers and validate time-based timeout, last-seen resets, and threshold behavior.feature-flags.test.tsto assertblockTimedefaults, per-chain overrides, and merging.acceleratedPolling.blockTime.Written by Cursor Bugbot for commit e776a73. This will update automatically on new commits. Configure here.