chore(runway): cherry-pick fix(metamask-pay): cp-7.80.0 use latest on-chain nonce for EIP-7702 authorization list#30849
Merged
runway-github[bot] merged 2 commits intoJun 1, 2026
Conversation
…-chain nonce for EIP-7702 authorization list (#30297) ## **Description** When building the EIP-7702 authorization list for a Pay delegation transaction, the nonce was previously read from `NonceLock.nextNonce` — the value computed by the nonce tracker, which accounts for locally-pending transactions the Relay has no visibility into. This could produce a nonce ahead of the true on-chain state, causing the Relay to reject the authorization as invalid. The fix reads `NonceLock.nonceDetails.params.nextNetworkNonce` instead — the raw `eth_getTransactionCount` result that the nonce tracker already fetches internally. This gives the committed on-chain nonce the Relay needs to verify the authorization signature, without introducing a separate provider call or adding a new Engine dependency. ## **Changelog** CHANGELOG entry: null ## **Related issues** Related to: #30798 ## **Manual testing steps** ```gherkin Feature: EIP-7702 Pay delegation transaction Scenario: user submits a Pay transaction requiring EIP-7702 upgrade Given the account has not yet been delegated (not upgraded to EIP-7702) And the account has locally-pending transactions in the queue When user initiates a Pay transaction and confirms Then the authorization list is signed with the correct on-chain nonce And the transaction submits successfully via Relay ``` ## **Screenshots/Recordings** ### **Before** <!-- N/A — no UI change --> ### **After** <!-- N/A — no UI change --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### Performance checks (if applicable) - [ ] I've tested on Android - Ideally on a mid-range device; emulator is acceptable - [ ] I've tested with a power user scenario - Use these [power-user SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [ ] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes nonce selection for EIP-7702 authorization signing in Pay flows; wrong nonce would break Relay submission but scope is limited to delegation authorization building. > > **Overview** > **EIP-7702 Pay delegation** now signs the authorization list with the **committed on-chain nonce** (`nonceLock.nonceDetails.params.nextNetworkNonce`) instead of the nonce tracker’s **`nextNonce`**, which can include locally pending txs the Relay cannot see. > > Tests were updated to mock `networkClientId` on transaction meta and to return the new nonce lock shape so `KeyringController:signEip7702Authorization` still receives the expected nonce. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7d0387b. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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. |
Contributor
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - PR targets a release or stable branch (release/* or stable) All E2E tests pre-selected. |
vpintorico
approved these changes
Jun 1, 2026
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
When building the EIP-7702 authorization list for a Pay delegation
transaction, the nonce was previously read from
NonceLock.nextNonce—the value computed by the nonce tracker, which accounts for
locally-pending transactions the Relay has no visibility into. This
could produce a nonce ahead of the true on-chain state, causing the
Relay to reject the authorization as invalid.
The fix reads
NonceLock.nonceDetails.params.nextNetworkNonceinstead —the raw
eth_getTransactionCountresult that the nonce tracker alreadyfetches internally. This gives the committed on-chain nonce the Relay
needs to verify the authorization signature, without introducing a
separate provider call or adding a new Engine dependency.
Changelog
CHANGELOG entry: null
Related issues
Related to: #30798
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Performance checks (if applicable)
SRPs
to import wallets with many accounts and tokens
performance metrics
trace()for usage andaddTokenfor an example
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Medium Risk
Changes nonce selection for EIP-7702 authorization signing in Pay
flows; wrong nonce would break Relay submission but scope is limited to
delegation authorization building.
Overview
EIP-7702 Pay delegation now signs the authorization list with the
committed on-chain nonce
(
nonceLock.nonceDetails.params.nextNetworkNonce) instead of the noncetracker’s
nextNonce, which can include locally pending txs theRelay cannot see.
Tests were updated to mock
networkClientIdon transaction meta andto return the new nonce lock shape so
KeyringController:signEip7702Authorizationstill receives the expectednonce.
Reviewed by Cursor Bugbot for commit
7d0387b. Bugbot is set up for automated
code reviews on this repo. Configure
here.