Commit 5470e31
authored
feat: zero network fees in relay execute flow (#8181)
## Explanation
When using the Relay execute flow (EIP-7702 + execute enabled), network
fees are subsidized by the relayer for cross-chain transactions. This
change zeroes out the displayed source network fees in the quote
normalization step so users see the correct zero cost.
relayer.
## References
- Builds on top of #8133
## Checklist
- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [x] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Changes fee calculation and submit-path selection for Relay
transactions based on `quote.metamask.isExecute`, which could impact gas
estimation/fee display and which submission mechanism is used. Risk is
moderate due to user-visible fee outputs and execution-path branching,
but scope is limited to Relay strategy.
>
> **Overview**
> **Relay execute quotes now drive fee display and submission behavior
via `metamask.isExecute`.** When a Relay quote indicates execute flow,
quote normalization zeroes `fees.sourceNetwork` and clears
`metamask.gasLimits` since the relayer subsidizes origin gas.
>
> `relay-submit` now chooses the `/execute` submission path solely based
on `quote.original.metamask.isExecute` (removing EIP-7702/feature-flag
gating in this decision), with corresponding test updates. Types and
changelog are updated to include the optional `metamask.isExecute` flag.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
91323fc. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent a618f17 commit 5470e31
File tree
6 files changed
+102
-35
lines changed- packages/transaction-pay-controller
- src/strategy/relay
6 files changed
+102
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
Lines changed: 75 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2163 | 2163 | | |
2164 | 2164 | | |
2165 | 2165 | | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
2166 | 2241 | | |
2167 | 2242 | | |
2168 | 2243 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
| 476 | + | |
476 | 477 | | |
477 | 478 | | |
478 | 479 | | |
| |||
566 | 567 | | |
567 | 568 | | |
568 | 569 | | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
569 | 573 | | |
570 | 574 | | |
571 | 575 | | |
| |||
585 | 589 | | |
586 | 590 | | |
587 | 591 | | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
588 | 600 | | |
589 | 601 | | |
590 | 602 | | |
| |||
Lines changed: 8 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 17 | + | |
22 | 18 | | |
23 | 19 | | |
24 | 20 | | |
| |||
135 | 131 | | |
136 | 132 | | |
137 | 133 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | 134 | | |
142 | 135 | | |
143 | 136 | | |
| |||
155 | 148 | | |
156 | 149 | | |
157 | 150 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | 151 | | |
162 | 152 | | |
163 | 153 | | |
| |||
1022 | 1012 | | |
1023 | 1013 | | |
1024 | 1014 | | |
1025 | | - | |
1026 | | - | |
| 1015 | + | |
1027 | 1016 | | |
1028 | 1017 | | |
1029 | 1018 | | |
| |||
1113 | 1102 | | |
1114 | 1103 | | |
1115 | 1104 | | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
1116 | 1109 | | |
1117 | 1110 | | |
1118 | 1111 | | |
| |||
1261 | 1254 | | |
1262 | 1255 | | |
1263 | 1256 | | |
1264 | | - | |
1265 | | - | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | | - | |
1272 | | - | |
1273 | | - | |
1274 | | - | |
| 1257 | + | |
| 1258 | + | |
1275 | 1259 | | |
1276 | 1260 | | |
1277 | 1261 | | |
| |||
Lines changed: 2 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 25 | + | |
30 | 26 | | |
31 | 27 | | |
32 | 28 | | |
| |||
320 | 316 | | |
321 | 317 | | |
322 | 318 | | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
| 319 | + | |
329 | 320 | | |
330 | 321 | | |
331 | 322 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
0 commit comments