Skip to content

feat: support updated EIP-5792 specification #30967

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 9 commits into from
Mar 14, 2025
Merged

Conversation

matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Mar 13, 2025

Description

Support updated EIP-5792 specification.

See #363 for specification changes.

Specifically:

  • Add GetCallsStatus hook.
  • Throw if any non-optional capabilities specified in wallet_sendCalls.
  • Throw if version not supported in wallet_sendCalls.
  • Locate transaction using batchId.
  • Return empty object from wallet_getCapabilities.
  • Return standardised status code from wallet_getCallsStatus.
  • Update @metamask/transaction-controller to 49.0.0.
  • Update @metamask/eth-json-rpc-middleware to 16.0.0.

Open in GitHub Codespaces

Related issues

Manual testing steps

Screenshots/Recordings

Before

After

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.

@matthewwalsh0 matthewwalsh0 added the team-confirmations Push issues to confirmations team label Mar 13, 2025
Copy link

socket-security bot commented Mar 13, 2025

Updated dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@metamask/[email protected]49.0.0 None 0 2.37 MB danfinlay, gudahtt, kumavis, ...6 more

View full report↗︎

@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review March 13, 2025 11:38
OGPoyraz
OGPoyraz previously approved these changes Mar 13, 2025
vinistevam
vinistevam previously approved these changes Mar 13, 2025
@matthewwalsh0 matthewwalsh0 dismissed stale reviews from vinistevam and OGPoyraz via 4c50ef7 March 13, 2025 13:50
@matthewwalsh0 matthewwalsh0 requested review from a team as code owners March 13, 2025 14:38
@matthewwalsh0 matthewwalsh0 requested a review from a team as a code owner March 14, 2025 01:03
@metamaskbot
Copy link
Collaborator

Builds ready [6940043]
Page Load Metrics (3290 ± 1452 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint172114956306728711379
domContentLoaded161214186272127411316
load174015628329030241452
domInteractive25246737435
backgroundConnect1251512510408196
firstReactRender50178913818
getState49907283254122
initialActions01000
loadScripts116512366205924241164
setupStore2084214418890
uiStartup236818248544039401892
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 93.51 KiB (1.50%)
  • ui: 0 Bytes (0.00%)
  • common: 145.19 KiB (1.41%)

// Temporary fix for E2E tests that rely on `gasLimit` being ignored
// and resulting `eth_estimateGas` delaying confirmation.
if (process.env.IN_TEST && transactionParams.gasLimit?.length) {
transactionParams.gasLimit = undefined;
Copy link
Member Author

@matthewwalsh0 matthewwalsh0 Mar 14, 2025

Choose a reason for hiding this comment

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

Upgrading @metamask/transaction-controller past 48.2.0 includes a fix that supports both gas and gasLimit in params.

Many of the E2E tests use the #sendButton to create legacy transactions via the test dApp, which includes gasLimit.

As this was previously ignored, the transaction controller would automatically estimate the gas limit via eth_estimateGas which would slightly delay the display of the confirmation.

Some of these tests were reliant on that timing, meaning they now break since the confirmations display quicker as no estimate is performed since the gasLimit is provided.

This is the quickest and least invasive fix as it doesn't require new releases, doesn't require refactoring multiple E2E tests, and doesn't require a patch which would be very large since the test dApp code is minimised to a single line.

@matthewwalsh0 matthewwalsh0 enabled auto-merge March 14, 2025 01:50
@matthewwalsh0 matthewwalsh0 added this pull request to the merge queue Mar 14, 2025
Merged via the queue into main with commit c192d34 Mar 14, 2025
76 checks passed
@matthewwalsh0 matthewwalsh0 deleted the feat/5792-updates branch March 14, 2025 10:24
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2025
@metamaskbot metamaskbot added the release-12.16.0 Issue or pull request that will be included in release 12.16.0 label Mar 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.16.0 Issue or pull request that will be included in release 12.16.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants