Skip to content

Conversation

pedronfigueiredo
Copy link
Contributor

@pedronfigueiredo pedronfigueiredo commented Oct 15, 2025

Description

  • Added a shared #normalizeCallData helper in Delegation7702PublishHook so we always feed canonical 0x calldata into both the caveat builder and execution encoder, preventing stray zero bytes from drifting into caveat terms.
  • Updated exactExecutionBuilder to reuse encodeSingleExecution so the stored caveat terms are guaranteed to match the execution payload, and relaxed validation so empty calldata is treated as 0x instead of 0x0.

Open in GitHub Codespaces

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

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.

Note

Normalizes calldata and keeps caveat terms byte-identical to execution, while sending sponsored transactions through the delegation publish hook.

  • EIP-7702 Delegation flow:
    • Add #normalizeCallData to canonicalize txParams.data (lowercase, 0x-prefixed, even-length) and use it in #buildExecutions and #buildCaveats.
    • Route when to use delegation: include transactionMeta.isGasFeeSponsored in the non-smart/non-send-bundle condition in publishHook.
  • Caveats/encoding:
    • exactExecutionBuilder: reuse encodeSingleExecution so terms match the execution payload; relax data validation to accept empty calldata as 0x (not 0x0).

Written by Cursor Bugbot for commit 1403824. This will update automatically on new commits. Configure here.

@pedronfigueiredo pedronfigueiredo self-assigned this Oct 15, 2025
@pedronfigueiredo pedronfigueiredo requested a review from a team as a code owner October 15, 2025 15:45
@pedronfigueiredo pedronfigueiredo added the team-confirmations Push issues to confirmations team label Oct 15, 2025
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.

@pedronfigueiredo pedronfigueiredo changed the title fix: Sponsored transaction by normalising calldata handling and aligning exact-execution caveat encoding fix: Sponsored transaction by normalising calldata handling Oct 15, 2025
@pedronfigueiredo pedronfigueiredo added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Oct 15, 2025
@metamaskbot
Copy link
Collaborator

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (1 files, +5 -1)
  • 📁 app/
    • 📁 scripts/
      • 📁 controller-init/
        • 📁 confirmations/
          • 📄 transaction-controller-init.ts +5 -1

cursor[bot]

This comment was marked as outdated.

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/testing-gas-sponsorship branch from a605f72 to 1403824 Compare October 15, 2025 16:06
@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 1403824 | Date: 10/15/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±73ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 749ms (±86ms) 🟢 | historical mean value: 739ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 82ms (±44ms) 🟢 | historical mean value: 78ms ⬆️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 73ms 1.01s 1.36s 1.28s 1.36s
domContentLoaded 749ms 86ms 701ms 1.31s 957ms 1.31s
firstPaint 82ms 44ms 60ms 512ms 88ms 512ms
firstContentfulPaint 82ms 44ms 60ms 512ms 88ms 512ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [1403824]
UI Startup Metrics (1212 ± 72 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1212109115627212581317
load104294912965910801133
domContentLoaded103694612885810761127
domInteractive1713121121635
firstPaint726128129241310651122
backgroundConnect2472332766250258
firstReactRender25185062542
getState16577101838
initialActions817012738
loadScripts794708103657830882
setupStore962331017
WebpackHomeuiStartup833710112169848978
load62757595767635765
domContentLoaded61957194766629758
domInteractive15115071435
firstPaint19654950196190598
backgroundConnect21114272434
firstReactRender27176593243
getState932441119
initialActions3015246
loadScripts61756993663627747
setupStore1042131214
FirefoxBrowserifyHomeuiStartup14451257197313814901800
load1210106914228312801383
domContentLoaded1209106914218312791383
domInteractive1013428556104245
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3521131163960
firstReactRender30256353139
getState85334817
initialActions5212312313
loadScripts1187105013698112621319
setupStore176208311155
WebpackHomeuiStartup15541353198412315771824
load1328118916319213671530
domContentLoaded1327118816319213661530
domInteractive97313796495322
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3621162184066
firstReactRender33268093341
getState9511111913
initialActions7118424315
loadScripts1303116916059013381504
setupStore12571121035
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 292 Bytes (0.01%)
  • ui: 0 Bytes (0%)
  • common: 10 Bytes (0%)

@pedronfigueiredo pedronfigueiredo added this pull request to the merge queue Oct 16, 2025
Merged via the queue into main with commit ed02e92 Oct 16, 2025
170 checks passed
@pedronfigueiredo pedronfigueiredo deleted the pnf/testing-gas-sponsorship branch October 16, 2025 11:13
@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2025
@metamaskbot metamaskbot added the release-13.6.0 Issue or pull request that will be included in release 13.6.0 label Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-13.6.0 Issue or pull request that will be included in release 13.6.0 size-S team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants