Commit bd27dda
authored
execution/tracers: emit empty code in diff mode for EIP-7702 deauthorization (#20601)
This PR fixes prestate tracer diff-mode output for EIP-7702
deauthorization in Erigon.
Previously, when a transaction deauthorized an EIP-7702 delegated
account (authorization to address(0)), the tracer omitted the `code`
field from the `post` object after the delegation code was cleared. That
treated the change as if the field had been deleted entirely.
In reality, the account still exists and its code is simply updated from
delegated code (`0xef0100 || delegate`) to empty code (`0x`). Since this
is a normal state transition - not an account deletion - the `post`
object should include the updated empty code value.
This makes code handling consistent with how other account fields like
balance are represented when they transition to zero, and keeps
diff-mode semantics clearer: omitted fields should represent actual
deletions, while modified fields should appear in `post` even if their
new value is empty.
After this change, EIP-7702 deauthorization traces correctly return
`"code": "0x"` in the `post` state.
Refrence: ethereum/go-ethereum#346481 parent bad7f58 commit bd27dda
File tree
3 files changed
+134
-22
lines changed- execution/tracing/tracers
- internal/tracetest/testdata/prestate_tracer_with_diff_mode
- native
3 files changed
+134
-22
lines changedLines changed: 98 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
51 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
58 | | - | |
| 61 | + | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
63 | | - | |
| 66 | + | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| |||
274 | 277 | | |
275 | 278 | | |
276 | 279 | | |
277 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
278 | 284 | | |
279 | 285 | | |
280 | 286 | | |
281 | | - | |
| 287 | + | |
282 | 288 | | |
283 | 289 | | |
284 | 290 | | |
| |||
292 | 298 | | |
293 | 299 | | |
294 | 300 | | |
295 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
296 | 304 | | |
297 | 305 | | |
298 | 306 | | |
| |||
303 | 311 | | |
304 | 312 | | |
305 | 313 | | |
306 | | - | |
307 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
308 | 319 | | |
309 | | - | |
| 320 | + | |
310 | 321 | | |
311 | 322 | | |
312 | 323 | | |
| |||
317 | 328 | | |
318 | 329 | | |
319 | 330 | | |
320 | | - | |
| 331 | + | |
321 | 332 | | |
322 | 333 | | |
323 | 334 | | |
| |||
375 | 386 | | |
376 | 387 | | |
377 | 388 | | |
378 | | - | |
| 389 | + | |
379 | 390 | | |
380 | 391 | | |
381 | 392 | | |
| 393 | + | |
382 | 394 | | |
| 395 | + | |
383 | 396 | | |
384 | | - | |
385 | | - | |
386 | | - | |
| 397 | + | |
387 | 398 | | |
388 | | - | |
389 | | - | |
390 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
391 | 402 | | |
| 403 | + | |
392 | 404 | | |
393 | | - | |
| 405 | + | |
394 | 406 | | |
| 407 | + | |
| 408 | + | |
395 | 409 | | |
396 | 410 | | |
397 | 411 | | |
| |||
0 commit comments