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: mark transactions as failed for cancelled / unknown smart transactions #12664

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

dan437
Copy link
Contributor

@dan437 dan437 commented Dec 12, 2024

Description

Resolves an issue with stuck transactions for some users who used smart transactions, which was mainly caused by mistakenly believing that this PR was in the 7.37.0 release based on the label from metamaskbot, when it was in fact in the 7.36.0 release.

Related issues

Fixes:

Manual testing steps

  1. Cancelled transaction stuck thanks to super low gas settings
  2. All other submitted transactions afterwards as well with the invalid_nonce error.
  3. Upgrade to 7.37.1 and see all cancelled tx
  4. Try a new tx

Screenshots/Recordings

Before

https://consensys.slack.com/archives/C084S32G337/p1734034013370979

After

https://consensys.slack.com/archives/C084S32G337/p1734039388196979

Pre-merge author checklist

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.

@dan437 dan437 requested a review from a team as a code owner December 12, 2024 18:06
@dan437 dan437 marked this pull request as draft December 12, 2024 18:06
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.

@metamaskbot metamaskbot added the team-transactions Transactions team label Dec 12, 2024
@sethkfman sethkfman added the Run Smoke E2E Triggers smoke e2e on Bitrise label Dec 12, 2024
Copy link
Contributor

github-actions bot commented Dec 12, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: e8bd386
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/0b45945e-582a-4eff-abfd-8293c804734d

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@dan437 dan437 force-pushed the tx-params-migration branch from 8a5bb41 to 4922c55 Compare December 12, 2024 19:41
@dan437 dan437 marked this pull request as ready for review December 12, 2024 20:27
@dan437 dan437 added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Dec 12, 2024
Copy link
Contributor

github-actions bot commented Dec 12, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: ce8842e
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/3666cf3c-28c8-4a06-b801-e7a6935040d2

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

…ctions (WIP)

Code cleanup, update tests

Disable a lint line

Linting
@dan437 dan437 force-pushed the tx-params-migration branch from ce8842e to 1b71a0e Compare December 12, 2024 21:09
@dan437 dan437 added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Dec 12, 2024
Copy link
Contributor

github-actions bot commented Dec 12, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 1b71a0e
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/ea232f6c-2091-42c0-b4ed-63f6009c6b28

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Copy link

sonarcloud bot commented Dec 12, 2024

Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks fine to me. Would not recommend using any type though. Would be good to have an approval from someone from transactions team too

Copy link
Contributor

@kylanhurt kylanhurt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kylanhurt kylanhurt added this pull request to the merge queue Dec 12, 2024
app/store/migrations/063.ts Show resolved Hide resolved
}

const transactionControllerState =
state.engine.backgroundState.TransactionController;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, could we assign these at the start to avoid the duplicate property chains?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for feedback, Matt! I just copied the 039.ts TransactionController migration and slightly modified it to get this fix out of the door asap. Will keep your comments in mind for another migration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I've resolved your feedback in a follow up PR: #12694

app/store/migrations/063.ts Show resolved Hide resolved
app/store/migrations/063.ts Show resolved Hide resolved
app/store/migrations/063.ts Show resolved Hide resolved
app/store/migrations/063.ts Show resolved Hide resolved
app/store/migrations/063.test.ts Show resolved Hide resolved
Merged via the queue into main with commit cfb77b9 Dec 12, 2024
42 checks passed
@kylanhurt kylanhurt deleted the tx-params-migration branch December 12, 2024 23:03
@github-actions github-actions bot locked and limited conversation to collaborators Dec 12, 2024
@metamaskbot metamaskbot added the release-7.39.0 Issue or pull request that will be included in release 7.39.0 label Dec 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.39.0 Issue or pull request that will be included in release 7.39.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-transactions Transactions team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants