Skip to content

Commit a1093d9

Browse files
authored
eth/tracers: flatCallTracer error compatible with parity (ethereum#30497)
Compatible error message in the flat call tracer with parity-style endpoints. Signed-off-by: jsvisa <[email protected]>
1 parent f3b4bbb commit a1093d9

13 files changed

+115
-40
lines changed

eth/tracers/internal/tracetest/testdata/call_tracer_flat/callcode_precompiled_fail_hide.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@
6666
"transactionPosition": 74,
6767
"transactionHash": "0x5ef60b27ac971c22a7d484e546e50093ca62300c8986d165154e47773764b6a4",
6868
"blockNumber": 1555279,
69-
"blockHash": "0xd6c98d1b87dfa92a210d99bad2873adaf0c9e51fe43addc63fd9cca03a5c6f46",
70-
"time": "209.346µs"
69+
"blockHash": "0xd6c98d1b87dfa92a210d99bad2873adaf0c9e51fe43addc63fd9cca03a5c6f46"
7170
},
7271
{
7372
"action": {

eth/tracers/internal/tracetest/testdata/call_tracer_flat/callcode_precompiled_oog.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@
6666
"transactionPosition": 141,
6767
"transactionHash": "0x1592cbda0d928b8d18eed98857942b91ade32d088e55b8bf63418917cb0231f1",
6868
"blockNumber": 1555278,
69-
"blockHash": "0x755bd54de4b2f5a7a589a10d69888b4ead48a6311d5d69f2f69ca85ec35fbe0b",
70-
"time": "300.9µs"
69+
"blockHash": "0x755bd54de4b2f5a7a589a10d69888b4ead48a6311d5d69f2f69ca85ec35fbe0b"
7170
},
7271
{
7372
"type": "call",
@@ -80,14 +79,12 @@
8079
"callType": "callcode"
8180
},
8281
"error": "out of gas",
83-
"traceAddress": [
84-
0
85-
],
82+
"traceAddress": [0],
8683
"subtraces": 0,
8784
"transactionPosition": 141,
8885
"transactionHash": "0x1592cbda0d928b8d18eed98857942b91ade32d088e55b8bf63418917cb0231f1",
8986
"blockNumber": 1555278,
9087
"blockHash": "0x755bd54de4b2f5a7a589a10d69888b4ead48a6311d5d69f2f69ca85ec35fbe0b"
9188
}
9289
]
93-
}
90+
}

eth/tracers/internal/tracetest/testdata/call_tracer_flat/callcode_precompiled_throw.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@
6262
"transactionPosition": 117,
6363
"transactionHash": "0x7fe4dec901e1a62c1a1d96b8267bb9ff9dc1f75def43aa45b998743455eff8f9",
6464
"blockNumber": 1555275,
65-
"blockHash": "0x80945caaff2fc67253cbb0217d2e5a307afde943929e97d8b36e58b88cbb02fd",
66-
"time": "332.877µs"
65+
"blockHash": "0x80945caaff2fc67253cbb0217d2e5a307afde943929e97d8b36e58b88cbb02fd"
6766
},
6867
{
6968
"type": "call",
@@ -76,14 +75,12 @@
7675
"callType": "callcode"
7776
},
7877
"error": "invalid input length",
79-
"traceAddress": [
80-
0
81-
],
78+
"traceAddress": [0],
8279
"subtraces": 0,
8380
"transactionPosition": 117,
8481
"transactionHash": "0x7fe4dec901e1a62c1a1d96b8267bb9ff9dc1f75def43aa45b998743455eff8f9",
8582
"blockNumber": 1555275,
8683
"blockHash": "0x80945caaff2fc67253cbb0217d2e5a307afde943929e97d8b36e58b88cbb02fd"
8784
}
8885
]
89-
}
86+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
{
2+
"genesis": {
3+
"difficulty": "4639933",
4+
"extraData": "0xd883010b05846765746888676f312e31342e33856c696e7578",
5+
"gasLimit": "9280188",
6+
"hash": "0x9a5f3a98eb1c60f6e3f450658a9cea190157e7021d04f927b752ad6482cf9194",
7+
"miner": "0x73f26d124436b0791169d63a3af29c2ae47765a3",
8+
"mixHash": "0x6b6f8fcaa54b8565c4c1ae7cf0a020e938a53007f4561e758b17bc05c9044d78",
9+
"nonce": "0x773aba50dc51b462",
10+
"number": "1555169",
11+
"stateRoot": "0xc4b9703de3e59ff795baae2c3afa010cf039c37244a7a6af7f3f491a10601348",
12+
"timestamp": "1590794111",
13+
"totalDifficulty": "2242105342155",
14+
"alloc": {
15+
"0x5ac5599fc9df172c89ee7ec55ad9104ccbfed40d": {
16+
"balance": "0x0",
17+
"nonce": "0",
18+
"code": "0x",
19+
"storage": {}
20+
},
21+
"0x877bd459c9b7d8576b44e59e09d076c25946f443": {
22+
"balance": "0x62325b40cbbd0915c4b9",
23+
"nonce": "260875",
24+
"code": "0x",
25+
"storage": {}
26+
}
27+
},
28+
"config": {
29+
"chainId": 63,
30+
"daoForkSupport": true,
31+
"eip150Block": 0,
32+
"eip150Hash": "0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d",
33+
"eip155Block": 0,
34+
"eip158Block": 0,
35+
"ethash": {},
36+
"homesteadBlock": 0,
37+
"byzantiumBlock": 0,
38+
"constantinopleBlock": 301243,
39+
"petersburgBlock": 999983,
40+
"istanbulBlock": 999983
41+
}
42+
},
43+
"context": {
44+
"number": "1555170",
45+
"difficulty": "4642198",
46+
"timestamp": "1590794112",
47+
"gasLimit": "9289249",
48+
"miner": "0x877bd459c9b7d8576b44e59e09d076c25946f443"
49+
},
50+
"input": "0xf8658303fb0b843b9aca0083019ee48080915a600055600060006000f0505a6001550081a2a01a7deb3a16d967b766459ef486b00656c6581e5ad58968184a33701e27e0eb8aa07162ccdfe2018d64360a605310a62c399dd586c7282dd42a88c54f02f51d451f",
51+
"tracerConfig": {
52+
"convertParityErrors": true
53+
},
54+
"result": [
55+
{
56+
"type": "create",
57+
"action": {
58+
"from": "0x877bd459c9b7d8576b44e59e09d076c25946f443",
59+
"value": "0x0",
60+
"gas": "0x19ee4",
61+
"init": "0x5a600055600060006000f0505a60015500"
62+
},
63+
"error": "Out of gas",
64+
"traceAddress": [],
65+
"subtraces": 1,
66+
"transactionPosition": 63,
67+
"transactionHash": "0x60e881fae3884657b5430925c5d0053535b45cce0b8188f2a6be1feee8bcc650",
68+
"blockNumber": 1555170,
69+
"blockHash": "0xea46fbf941d51bf1e4180fbf26d22fda3896f49c7f371d109c226de95dd7b02e"
70+
},
71+
{
72+
"type": "create",
73+
"action": {
74+
"from": "0x9c5cfe45b15eaff4ad617af4250189e26024a4f8",
75+
"value": "0x0",
76+
"gas": "0x3cb",
77+
"init": "0x"
78+
},
79+
"result": {
80+
"gasUsed": "0x0",
81+
"code": "0x",
82+
"address": "0x5ac5599fc9df172c89ee7ec55ad9104ccbfed40d"
83+
},
84+
"traceAddress": [0],
85+
"subtraces": 0,
86+
"transactionPosition": 63,
87+
"transactionHash": "0x60e881fae3884657b5430925c5d0053535b45cce0b8188f2a6be1feee8bcc650",
88+
"blockNumber": 1555170,
89+
"blockHash": "0xea46fbf941d51bf1e4180fbf26d22fda3896f49c7f371d109c226de95dd7b02e"
90+
}
91+
]
92+
}

eth/tracers/internal/tracetest/testdata/call_tracer_flat/gas.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@
6666
"transactionPosition": 18,
6767
"transactionHash": "0xc1c42a325856d513523aec464811923b2e2926f54015c7ba37877064cf889803",
6868
"blockNumber": 1555275,
69-
"blockHash": "0x80945caaff2fc67253cbb0217d2e5a307afde943929e97d8b36e58b88cbb02fd",
70-
"time": "453.925µs"
69+
"blockHash": "0x80945caaff2fc67253cbb0217d2e5a307afde943929e97d8b36e58b88cbb02fd"
7170
},
7271
{
7372
"type": "call",

eth/tracers/internal/tracetest/testdata/call_tracer_flat/nested_create.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@
6666
"transactionPosition": 23,
6767
"transactionHash": "0xe267552ce8437a5bc7081385c99f912de5723ad34b958db215dbc41abd5f6c03",
6868
"blockNumber": 555462,
69-
"blockHash": "0x38bba9e3965b57205097ea5ec53fc403cf3941bec2e4c933faae244de5ca4ba1",
70-
"time": "1.147715ms"
69+
"blockHash": "0x38bba9e3965b57205097ea5ec53fc403cf3941bec2e4c933faae244de5ca4ba1"
7170
},
7271
{
7372
"type": "create",

eth/tracers/internal/tracetest/testdata/call_tracer_flat/nested_create2_action_gas.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@
6666
"transactionPosition": 31,
6767
"transactionHash": "0x1257b698c5833c54ce786734087002b097275abc3877af082b5c2a538e894a41",
6868
"blockNumber": 1555161,
69-
"blockHash": "0xb0793dd508dd106a19794b8ce1dfc0ff8d98c76aab61bf32a11799854149a171",
70-
"time": "889.048µs"
69+
"blockHash": "0xb0793dd508dd106a19794b8ce1dfc0ff8d98c76aab61bf32a11799854149a171"
7170
},
7271
{
7372
"type": "create",

eth/tracers/internal/tracetest/testdata/call_tracer_flat/nested_create_action_gas.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@
6262
"transactionPosition": 63,
6363
"transactionHash": "0x60e881fae3884657b5430925c5d0053535b45cce0b8188f2a6be1feee8bcc650",
6464
"blockNumber": 1555170,
65-
"blockHash": "0xea46fbf941d51bf1e4180fbf26d22fda3896f49c7f371d109c226de95dd7b02e",
66-
"time": "952.736µs"
65+
"blockHash": "0xea46fbf941d51bf1e4180fbf26d22fda3896f49c7f371d109c226de95dd7b02e"
6766
},
6867
{
6968
"type": "create",

eth/tracers/internal/tracetest/testdata/call_tracer_flat/nested_create_inerror.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@
7373
"transactionPosition": 26,
7474
"transactionHash": "0xcb1090fa85d2a3da8326b75333e92b3dca89963c895d9c981bfdaa64643135e4",
7575
"blockNumber": 839247,
76-
"blockHash": "0xce7ff7d84ca97f0f89d6065e2c12409a795c9f607cdb14aef0713cad5d7e311c",
77-
"time": "182.267µs"
76+
"blockHash": "0xce7ff7d84ca97f0f89d6065e2c12409a795c9f607cdb14aef0713cad5d7e311c"
7877
},
7978
{
8079
"action": {
@@ -90,4 +89,4 @@
9089
"type": "create"
9190
}
9291
]
93-
}
92+
}

eth/tracers/internal/tracetest/testdata/call_tracer_flat/result_output.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@
8080
"transactionPosition": 5,
8181
"transactionHash": "0x04d2029a5cbbed30969cdc0a2ca9e9fc6b719e323af0802b52466f07ee0ecada",
8282
"blockNumber": 553416,
83-
"blockHash": "0x8df024322173d225a09681d35edeaa528aca60743a11a70f854c158862bf5282",
84-
"time": "617.42µs"
83+
"blockHash": "0x8df024322173d225a09681d35edeaa528aca60743a11a70f854c158862bf5282"
8584
},
8685
{
8786
"type": "call",
@@ -97,14 +96,12 @@
9796
"gasUsed": "0x0",
9897
"output": "0x"
9998
},
100-
"traceAddress": [
101-
0
102-
],
99+
"traceAddress": [0],
103100
"subtraces": 0,
104101
"transactionPosition": 5,
105102
"transactionHash": "0x04d2029a5cbbed30969cdc0a2ca9e9fc6b719e323af0802b52466f07ee0ecada",
106103
"blockNumber": 553416,
107104
"blockHash": "0x8df024322173d225a09681d35edeaa528aca60743a11a70f854c158862bf5282"
108105
}
109106
]
110-
}
107+
}

0 commit comments

Comments
 (0)