Skip to content

Commit e11d5bd

Browse files
dzhelezovclaude
andcommitted
fix(traces): port stock-ponder's ancestor-error cascade into Portal historical assembly
Stock ponder's debug_traceBlockByNumber/ByHash DFS (src/rpc/actions.ts, dist/esm/rpc/actions.js:100-118) smears a reverted ancestor's error/revertReason onto every descendant lacking its OWN error, transitively (an inheriting frame becomes a source for its own children); a frame with its own error keeps it. The Portal historical path builds trace frames itself (parityToCallFrame) from Portal's geth-faithful per-frame errors and never invokes that DFS, so a succeeded child of a reverted parent was stored with error=null where the RPC path inherits the parent's error — a traces.error/revert_reason divergence between the two store paths. Realtime/fallback already flow through the untouched RPC cascade, so the fork DB must be uniformly ponder-shaped. rankTraces now applies the same cascade over the DFS-sorted (cmpTraceAddr) frames of each tx, keyed by traceAddress prefix (parent of [a,b,c] is [a,b]). Applied only here; the realtime path is untouched and cannot double-apply. Oracle regression test over a real reverted tx (eth block 20351061, tx 26) plus synthetic own-error-survives / 3-deep-transitive / non-reverted-stays-null cases; mutation-verified to fail on the pre-shim code. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 310b21f commit e11d5bd

3 files changed

Lines changed: 569 additions & 2 deletions

File tree

Lines changed: 386 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,386 @@
1+
{
2+
"source": "geth callTracer, eth mainnet block 20351061, tx index 26 (0x...) \u2014 real reverted V3-router swap",
3+
"note": "Parity-flat RawTrace shape derived from geth callTracer output; per-frame error/revertReason preserved verbatim (Portal input shape). Ground-truth RPC-store output: whole reverted subtree carries error=execution reverted / revertReason=Too little received.",
4+
"traces": [
5+
{
6+
"transactionIndex": 26,
7+
"traceAddress": [],
8+
"type": "call",
9+
"subtraces": 1,
10+
"action": {
11+
"from": "0xc24d30475eca133302192b502085a3cc124b0b9b",
12+
"to": "0x364e94a1bf09fc6498e979e7715bb13fa6e9f807",
13+
"value": "0x0",
14+
"gas": "0x13dcc7",
15+
"input": "0x3043891e9f00986f265b6e82f121df3d30cfaeb42196abd76cc1f4d6bdaff37b8b28b9bd00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000140cd061d39302e34dc5e4ba4d9f61202dc632cc9e39c1988dc413ea3cbd8398e6e48e3c44dccb879417a16a6c0dd422259c0e0d9e00f93dea6b4133b46ca782d28e051271266f520c74d78a6c0dd422259c0e0dba89782fea6b4133b46ca782d28cdf9df7400696a164d78a6c0dd422259c0e0dba89782fea6b4133b46ca782d29cdfba5510d3f5aa2822b31f9026e7ff57426825adf0ffc8eb72886a1e89211f4218a108aa63177efb4baf11e1d68886072c325259d8ca2e993f9e24ef60d41ea286b9d0e0a85833bae9548dfc5a23725c566cecc96a93e8c1e2a896534f5272691b6f89ed961566321baa6c0b998e326556df54db420dec4b28a7ed10b45ae360af9df7400696a164d78a6c0dd422259c0e0dba89782fea6b4133b46ca782d283ae1f159e2e0ff599de32ce1486c031335228cfdf380e8557d5c0bd6336e7a49",
16+
"callType": "call"
17+
},
18+
"result": {
19+
"gasUsed": "0x3cebd",
20+
"output": "0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000013546f6f206c6974746c6520726563656976656400000000000000000000000000"
21+
},
22+
"error": "execution reverted",
23+
"revertReason": "Too little received"
24+
},
25+
{
26+
"transactionIndex": 26,
27+
"traceAddress": [
28+
0
29+
],
30+
"type": "call",
31+
"subtraces": 3,
32+
"action": {
33+
"from": "0x364e94a1bf09fc6498e979e7715bb13fa6e9f807",
34+
"to": "0x95fe1ebf8d88063ef986ea4208fde554d902e842",
35+
"value": "0x0",
36+
"gas": "0x1312c0",
37+
"input": "0x3043891e9f00986f265b6e82f121df3d30cfaeb42196abd76cc1f4d6bdaff37b8b28b9bd00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000140cd061d39302e34dc5e4ba4d9f61202dc632cc9e39c1988dc413ea3cbd8398e6e48e3c44dccb879417a16a6c0dd422259c0e0d9e00f93dea6b4133b46ca782d28e051271266f520c74d78a6c0dd422259c0e0dba89782fea6b4133b46ca782d28cdf9df7400696a164d78a6c0dd422259c0e0dba89782fea6b4133b46ca782d29cdfba5510d3f5aa2822b31f9026e7ff57426825adf0ffc8eb72886a1e89211f4218a108aa63177efb4baf11e1d68886072c325259d8ca2e993f9e24ef60d41ea286b9d0e0a85833bae9548dfc5a23725c566cecc96a93e8c1e2a896534f5272691b6f89ed961566321baa6c0b998e326556df54db420dec4b28a7ed10b45ae360af9df7400696a164d78a6c0dd422259c0e0dba89782fea6b4133b46ca782d283ae1f159e2e0ff599de32ce1486c031335228cfdf380e8557d5c0bd6336e7a49",
38+
"callType": "delegatecall"
39+
},
40+
"result": {
41+
"gasUsed": "0x35204",
42+
"output": "0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000013546f6f206c6974746c6520726563656976656400000000000000000000000000"
43+
},
44+
"error": "execution reverted",
45+
"revertReason": "Too little received"
46+
},
47+
{
48+
"transactionIndex": 26,
49+
"traceAddress": [
50+
0,
51+
0
52+
],
53+
"type": "call",
54+
"subtraces": 0,
55+
"action": {
56+
"from": "0x364e94a1bf09fc6498e979e7715bb13fa6e9f807",
57+
"to": "0x033bbde722ea3cdcec73cffea6581df9f9c257de",
58+
"value": "0x0",
59+
"gas": "0x128e2d",
60+
"input": "0x23b872dd000000000000000000000000c24d30475eca133302192b502085a3cc124b0b9b000000000000000000000000364e94a1bf09fc6498e979e7715bb13fa6e9f8070000000000000000000000000000000000000000000000000000000248981120",
61+
"callType": "call"
62+
},
63+
"result": {
64+
"gasUsed": "0x7ea7",
65+
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
66+
}
67+
},
68+
{
69+
"transactionIndex": 26,
70+
"traceAddress": [
71+
0,
72+
1
73+
],
74+
"type": "call",
75+
"subtraces": 3,
76+
"action": {
77+
"from": "0x364e94a1bf09fc6498e979e7715bb13fa6e9f807",
78+
"to": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
79+
"value": "0x0",
80+
"gas": "0x11fcbe",
81+
"input": "0x38ed17390000000000000000000000000000000000000000000000000000000248981120000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000364e94a1bf09fc6498e979e7715bb13fa6e9f80700000000000000000000000000000000000000000000000000000000669c49af0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000033bbde722ea3cdcec73cffea6581df9f9c257de000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
82+
"callType": "call"
83+
},
84+
"result": {
85+
"gasUsed": "0x12fad",
86+
"output": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000024898112000000000000000000000000000000000000000000000000002c728c4dbe74df1"
87+
}
88+
},
89+
{
90+
"transactionIndex": 26,
91+
"traceAddress": [
92+
0,
93+
1,
94+
0
95+
],
96+
"type": "call",
97+
"subtraces": 0,
98+
"action": {
99+
"from": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
100+
"to": "0x006e75729351b9ad1d71cfd100051ec079b9d6bc",
101+
"value": "0x0",
102+
"gas": "0x11a283",
103+
"input": "0x0902f1ac",
104+
"callType": "staticcall"
105+
},
106+
"result": {
107+
"gasUsed": "0x9c8",
108+
"output": "0x0000000000000000000000000000000000000000000000000000006e3a01809e0000000000000000000000000000000000000000000000008945af91f203decd00000000000000000000000000000000000000000000000000000000669c49af"
109+
}
110+
},
111+
{
112+
"transactionIndex": 26,
113+
"traceAddress": [
114+
0,
115+
1,
116+
1
117+
],
118+
"type": "call",
119+
"subtraces": 0,
120+
"action": {
121+
"from": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
122+
"to": "0x033bbde722ea3cdcec73cffea6581df9f9c257de",
123+
"value": "0x0",
124+
"gas": "0x118e17",
125+
"input": "0x23b872dd000000000000000000000000364e94a1bf09fc6498e979e7715bb13fa6e9f807000000000000000000000000006e75729351b9ad1d71cfd100051ec079b9d6bc0000000000000000000000000000000000000000000000000000000248981120",
126+
"callType": "call"
127+
},
128+
"result": {
129+
"gasUsed": "0x291b",
130+
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
131+
}
132+
},
133+
{
134+
"transactionIndex": 26,
135+
"traceAddress": [
136+
0,
137+
1,
138+
2
139+
],
140+
"type": "call",
141+
"subtraces": 3,
142+
"action": {
143+
"from": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
144+
"to": "0x006e75729351b9ad1d71cfd100051ec079b9d6bc",
145+
"value": "0x0",
146+
"gas": "0x115d0e",
147+
"input": "0x022c0d9f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002c728c4dbe74df1000000000000000000000000364e94a1bf09fc6498e979e7715bb13fa6e9f80700000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000",
148+
"callType": "call"
149+
},
150+
"result": {
151+
"gasUsed": "0xd4c1",
152+
"output": null
153+
}
154+
},
155+
{
156+
"transactionIndex": 26,
157+
"traceAddress": [
158+
0,
159+
1,
160+
2,
161+
0
162+
],
163+
"type": "call",
164+
"subtraces": 0,
165+
"action": {
166+
"from": "0x006e75729351b9ad1d71cfd100051ec079b9d6bc",
167+
"to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
168+
"value": "0x0",
169+
"gas": "0x10e40e",
170+
"input": "0xa9059cbb000000000000000000000000364e94a1bf09fc6498e979e7715bb13fa6e9f80700000000000000000000000000000000000000000000000002c728c4dbe74df1",
171+
"callType": "call"
172+
},
173+
"result": {
174+
"gasUsed": "0x750a",
175+
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
176+
}
177+
},
178+
{
179+
"transactionIndex": 26,
180+
"traceAddress": [
181+
0,
182+
1,
183+
2,
184+
1
185+
],
186+
"type": "call",
187+
"subtraces": 0,
188+
"action": {
189+
"from": "0x006e75729351b9ad1d71cfd100051ec079b9d6bc",
190+
"to": "0x033bbde722ea3cdcec73cffea6581df9f9c257de",
191+
"value": "0x0",
192+
"gas": "0x106e7e",
193+
"input": "0x70a08231000000000000000000000000006e75729351b9ad1d71cfd100051ec079b9d6bc",
194+
"callType": "staticcall"
195+
},
196+
"result": {
197+
"gasUsed": "0x232",
198+
"output": "0x00000000000000000000000000000000000000000000000000000070829991be"
199+
}
200+
},
201+
{
202+
"transactionIndex": 26,
203+
"traceAddress": [
204+
0,
205+
1,
206+
2,
207+
2
208+
],
209+
"type": "call",
210+
"subtraces": 0,
211+
"action": {
212+
"from": "0x006e75729351b9ad1d71cfd100051ec079b9d6bc",
213+
"to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
214+
"value": "0x0",
215+
"gas": "0x106ac0",
216+
"input": "0x70a08231000000000000000000000000006e75729351b9ad1d71cfd100051ec079b9d6bc",
217+
"callType": "staticcall"
218+
},
219+
"result": {
220+
"gasUsed": "0x216",
221+
"output": "0x000000000000000000000000000000000000000000000000867e86cd161c90dc"
222+
}
223+
},
224+
{
225+
"transactionIndex": 26,
226+
"traceAddress": [
227+
0,
228+
2
229+
],
230+
"type": "call",
231+
"subtraces": 1,
232+
"action": {
233+
"from": "0x364e94a1bf09fc6498e979e7715bb13fa6e9f807",
234+
"to": "0xe592427a0aece92de3edee1f18e0157c05861564",
235+
"value": "0x0",
236+
"gas": "0x10bef5",
237+
"input": "0xc04b8d59000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000767af52d988d1241a346851a1b39ccd11357376e00000000000000000000000000000000000000000000000000000000669c49af00000000000000000000000000000000000000000000000002c728c4dbe74df1000000000000000000000000000000000000000000000000000000002da8f866000000000000000000000000000000000000000000000000000000000000002bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000064dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000",
238+
"callType": "call"
239+
},
240+
"result": {
241+
"gasUsed": "0x14213",
242+
"output": "0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000013546f6f206c6974746c6520726563656976656400000000000000000000000000"
243+
},
244+
"error": "execution reverted",
245+
"revertReason": "Too little received"
246+
},
247+
{
248+
"transactionIndex": 26,
249+
"traceAddress": [
250+
0,
251+
2,
252+
0
253+
],
254+
"type": "call",
255+
"subtraces": 4,
256+
"action": {
257+
"from": "0xe592427a0aece92de3edee1f18e0157c05861564",
258+
"to": "0xc7bbec68d12a0d1830360f8ec58fa599ba1b0e9b",
259+
"value": "0x0",
260+
"gas": "0x105f78",
261+
"input": "0x128acb08000000000000000000000000767af52d988d1241a346851a1b39ccd11357376e000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000002c728c4dbe74df100000000000000000000000000000000000000000000000000000001000276a400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000040000000000000000000000000364e94a1bf09fc6498e979e7715bb13fa6e9f807000000000000000000000000000000000000000000000000000000000000002bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000064dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000",
262+
"callType": "call"
263+
},
264+
"result": {
265+
"gasUsed": "0x1233f",
266+
"output": "0x00000000000000000000000000000000000000000000000002c728c4dbe74df1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffd6003cd9"
267+
}
268+
},
269+
{
270+
"transactionIndex": 26,
271+
"traceAddress": [
272+
0,
273+
2,
274+
0,
275+
0
276+
],
277+
"type": "call",
278+
"subtraces": 0,
279+
"action": {
280+
"from": "0xc7bbec68d12a0d1830360f8ec58fa599ba1b0e9b",
281+
"to": "0xdac17f958d2ee523a2206206994597c13d831ec7",
282+
"value": "0x0",
283+
"gas": "0xfaf4a",
284+
"input": "0xa9059cbb000000000000000000000000767af52d988d1241a346851a1b39ccd11357376e0000000000000000000000000000000000000000000000000000000029ffc327",
285+
"callType": "call"
286+
},
287+
"result": {
288+
"gasUsed": "0x5fb5",
289+
"output": null
290+
}
291+
},
292+
{
293+
"transactionIndex": 26,
294+
"traceAddress": [
295+
0,
296+
2,
297+
0,
298+
1
299+
],
300+
"type": "call",
301+
"subtraces": 0,
302+
"action": {
303+
"from": "0xc7bbec68d12a0d1830360f8ec58fa599ba1b0e9b",
304+
"to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
305+
"value": "0x0",
306+
"gas": "0xf4e2b",
307+
"input": "0x70a08231000000000000000000000000c7bbec68d12a0d1830360f8ec58fa599ba1b0e9b",
308+
"callType": "staticcall"
309+
},
310+
"result": {
311+
"gasUsed": "0x9e6",
312+
"output": "0x00000000000000000000000000000000000000000000002eb96c0243779dfa8d"
313+
}
314+
},
315+
{
316+
"transactionIndex": 26,
317+
"traceAddress": [
318+
0,
319+
2,
320+
0,
321+
2
322+
],
323+
"type": "call",
324+
"subtraces": 1,
325+
"action": {
326+
"from": "0xc7bbec68d12a0d1830360f8ec58fa599ba1b0e9b",
327+
"to": "0xe592427a0aece92de3edee1f18e0157c05861564",
328+
"value": "0x0",
329+
"gas": "0xf4157",
330+
"input": "0xfa461e3300000000000000000000000000000000000000000000000002c728c4dbe74df1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffd6003cd9000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000040000000000000000000000000364e94a1bf09fc6498e979e7715bb13fa6e9f807000000000000000000000000000000000000000000000000000000000000002bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000064dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000",
331+
"callType": "call"
332+
},
333+
"result": {
334+
"gasUsed": "0x3009",
335+
"output": null
336+
}
337+
},
338+
{
339+
"transactionIndex": 26,
340+
"traceAddress": [
341+
0,
342+
2,
343+
0,
344+
2,
345+
0
346+
],
347+
"type": "call",
348+
"subtraces": 0,
349+
"action": {
350+
"from": "0xe592427a0aece92de3edee1f18e0157c05861564",
351+
"to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
352+
"value": "0x0",
353+
"gas": "0xef5e6",
354+
"input": "0x23b872dd000000000000000000000000364e94a1bf09fc6498e979e7715bb13fa6e9f807000000000000000000000000c7bbec68d12a0d1830360f8ec58fa599ba1b0e9b00000000000000000000000000000000000000000000000002c728c4dbe74df1",
355+
"callType": "call"
356+
},
357+
"result": {
358+
"gasUsed": "0x2021",
359+
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
360+
}
361+
},
362+
{
363+
"transactionIndex": 26,
364+
"traceAddress": [
365+
0,
366+
2,
367+
0,
368+
3
369+
],
370+
"type": "call",
371+
"subtraces": 0,
372+
"action": {
373+
"from": "0xc7bbec68d12a0d1830360f8ec58fa599ba1b0e9b",
374+
"to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
375+
"value": "0x0",
376+
"gas": "0xf0f95",
377+
"input": "0x70a08231000000000000000000000000c7bbec68d12a0d1830360f8ec58fa599ba1b0e9b",
378+
"callType": "staticcall"
379+
},
380+
"result": {
381+
"gasUsed": "0x216",
382+
"output": "0x00000000000000000000000000000000000000000000002ebc332b085385487e"
383+
}
384+
}
385+
]
386+
}

0 commit comments

Comments
 (0)