Skip to content
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

fix: transactions stuck in submitted status #7519

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Oct 17, 2023

Description

Resolve a bug causing some new transactions to be stuck in the submitted status as they are rejected by the network due to nonce values that are too high.

This is caused by incorrect callbacks in the NonceTracker in the TransactionController, resulting in correct nonce values being skipped because a local confirmed transaction (with the same address but a different chain ID) has the same nonce.

The solution is to update the callbacks used by the NonceTracker to filter transactions to the current chain only.

For a cleaner diff, see this core commit.

Manual testing steps

  1. Create a new account.
  2. Send some Goerli to the account.
  3. Send some Sepolia to the account.
  4. Send a transaction on Goerli using the new account.
  5. Send a transaction on Sepolia using the new account.
  6. Verify both are successful and both using the same nonce.

Recordings

iOS

nonce_ios.mov

Android

nonce.mov

Related issues

Fixes #1304

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained:
    • What problem this PR is solving.
    • How this problem was solved.
    • How reviewers can test my changes.
  • I’ve indicated what issue this PR is linked to: Fixes #???
  • I’ve included tests if applicable.
  • I’ve documented any added code.
  • I’ve applied the right labels on the PR (see labeling guidelines).
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@matthewwalsh0 matthewwalsh0 requested a review from a team as a code owner October 17, 2023 15:03
@matthewwalsh0 matthewwalsh0 added the team-confirmations-system DEPRECATED: please use "team-confirmations" label instead label Oct 17, 2023
vinistevam
vinistevam previously approved these changes Oct 17, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@sleepytanya
Copy link
Contributor

sleepytanya commented Oct 17, 2023

Transactions with the same nonce values on different networks submitted successfully.
Android build:

nonce.mov

iOS build:

nonce_ios.mov

OGPoyraz
OGPoyraz previously approved these changes Oct 17, 2023
@sleepytanya sleepytanya added the QA Passed A successful QA run through has been done label Oct 17, 2023
@sethkfman sethkfman added the release-7.9.0 Issue or pull request that will be included in release 7.9.0 label Oct 17, 2023
@Andepande Andepande changed the base branch from main to release/7.9.0 October 18, 2023 08:58
@matthewwalsh0
Copy link
Member Author

Bitrise Report

@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@matthewwalsh0 matthewwalsh0 changed the base branch from release/7.9.0 to main October 18, 2023 09:04
@matthewwalsh0 matthewwalsh0 dismissed stale reviews from OGPoyraz and vinistevam October 18, 2023 09:04

The base branch was changed.

@matthewwalsh0 matthewwalsh0 merged commit 3d80490 into main Oct 18, 2023
@matthewwalsh0 matthewwalsh0 deleted the fix/1304-transaction-stuck-submitted branch October 18, 2023 09:14
@github-actions github-actions bot locked and limited conversation to collaborators Oct 18, 2023
@metamaskbot metamaskbot added the release-7.10.0 Issue or pull request that will be included in release 7.10.0 label Oct 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
QA Passed A successful QA run through has been done release-7.9.0 Issue or pull request that will be included in release 7.9.0 release-7.10.0 Issue or pull request that will be included in release 7.10.0 team-confirmations-system DEPRECATED: please use "team-confirmations" label instead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants