Repository navigation
Commit da38ec6
committed
build: restore Hardhat 2 debug traces in the patch
Hardhat 2 converts EDR's geth-format debug traces back to its legacy
format in the open NomicFoundation/hardhat#7985. EDR's patched Hardhat
2.28.6 lacked that conversion, and the debug fixtures in hardhat-tests
had been switched to geth's format by f4bdc36. EDR CI therefore tested
a format that Hardhat 2 no longer returns.
Port the conversion from NomicFoundation/hardhat#7985. The port adds
edrRpcDebugTraceToHardhat2 and its StorageTracker to convertToEdr.ts. It
wires the memory default, the empty tracer handling and the result
conversion into the provider's request method. RpcStructLog gains the
returnData field. The debug trace code matches #7985. Outside it, the
port keeps EDR's existing patch and its formatting.
The compiled files come from TypeScript 5.0.4 with the package's own
2.28.6 tsconfig. That compiler reproduces the patched provider.js byte
for byte. The source maps are now regenerated with the code they map.
Restore the fixtures, the modules/debug tests and assertEqualTraces from
f4bdc36^ in the same commit, so every commit keeps the debug tests
green. Requests drop enableMemory, since the package captures memory by
default. assertEqualTraces loses the empty-memory and refund
normalisations that only geth's format needed. It now compares
returnValue without the 0x prefix that Hardhat 2 adds, because the
fixtures store it unprefixed. The reverted mainnet fixture is exempt,
since TurboGeth recorded no return value for it. The zeroed gasCost of
call and create steps is dropped. The only such step left, a STATICCALL
in the revert fixture, matches EDR's value.
The skipped post-London fork case and its fixture are removed instead of
restored. The case was skipped for
https://github.com/NomicFoundation/hardhat/issues/3519, and the fixture
served nothing else. The stale TODO about ethereumjs memory words goes
with them.
Some later changes still apply and are kept. The tests use ALCHEMY_URL
without a non-null assertion, as in d2e5ae8. assertEqualTraces drops
the assertions that the stricter eslint preset rejects. The unsupported
tracer tests keep the expectations of f4bdc36, because EDR rejects
such a tracer as a JavaScript tracer and debug_traceTransaction checks
the hash first.1 parent d2644ab commit da38ec6
15 files changed
Lines changed: 55201 additions & 298297 deletions
File tree
- hardhat-tests/test
- fixture-debug-traces
- traceCall
- internal/hardhat-network/provider
- modules/debug
- utils
- patches
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 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 | 3 | | |
71 | 4 | | |
72 | 5 | | |
73 | | - | |
| 6 | + | |
74 | 7 | | |
75 | 8 | | |
76 | 9 | | |
| |||
79 | 12 | | |
80 | 13 | | |
81 | 14 | | |
| 15 | + | |
| 16 | + | |
82 | 17 | | |
83 | 18 | | |
84 | 19 | | |
85 | 20 | | |
86 | 21 | | |
87 | 22 | | |
88 | 23 | | |
89 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
90 | 29 | | |
91 | 30 | | |
92 | 31 | | |
93 | 32 | | |
94 | 33 | | |
95 | 34 | | |
96 | 35 | | |
97 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
98 | 44 | | |
99 | 45 | | |
100 | 46 | | |
| |||
104 | 50 | | |
105 | 51 | | |
106 | 52 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 53 | + | |
119 | 54 | | |
| 55 | + | |
120 | 56 | | |
121 | 57 | | |
122 | 58 | | |
0 commit comments