Skip to content

Commit ea187b5

Browse files
gzliudanjsvisa
andauthored
eth/tracers: flatCallTracer error compatible with parity ethereum#30497 (#1499)
Compatible error message in the flat call tracer with parity-style endpoints. Signed-off-by: jsvisa <delweng@gmail.com> Co-authored-by: Delweng <delweng@gmail.com>
1 parent 2b906f2 commit ea187b5

13 files changed

+113
-36
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
@@ -67,8 +67,7 @@
6767
"transactionPosition": 74,
6868
"transactionHash": "0x5ef60b27ac971c22a7d484e546e50093ca62300c8986d165154e47773764b6a4",
6969
"blockNumber": 1555279,
70-
"blockHash": "0xd6c98d1b87dfa92a210d99bad2873adaf0c9e51fe43addc63fd9cca03a5c6f46",
71-
"time": "209.346µs"
70+
"blockHash": "0xd6c98d1b87dfa92a210d99bad2873adaf0c9e51fe43addc63fd9cca03a5c6f46"
7271
},
7372
{
7473
"action": {

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@
6767
"transactionPosition": 141,
6868
"transactionHash": "0x1592cbda0d928b8d18eed98857942b91ade32d088e55b8bf63418917cb0231f1",
6969
"blockNumber": 1555278,
70-
"blockHash": "0x755bd54de4b2f5a7a589a10d69888b4ead48a6311d5d69f2f69ca85ec35fbe0b",
71-
"time": "300.9µs"
70+
"blockHash": "0x755bd54de4b2f5a7a589a10d69888b4ead48a6311d5d69f2f69ca85ec35fbe0b"
7271
},
7372
{
7473
"type": "call",
@@ -81,9 +80,7 @@
8180
"callType": "callcode"
8281
},
8382
"error": "out of gas",
84-
"traceAddress": [
85-
0
86-
],
83+
"traceAddress": [0],
8784
"subtraces": 0,
8885
"transactionPosition": 141,
8986
"transactionHash": "0x1592cbda0d928b8d18eed98857942b91ade32d088e55b8bf63418917cb0231f1",

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@
6363
"transactionPosition": 117,
6464
"transactionHash": "0x7fe4dec901e1a62c1a1d96b8267bb9ff9dc1f75def43aa45b998743455eff8f9",
6565
"blockNumber": 1555275,
66-
"blockHash": "0x80945caaff2fc67253cbb0217d2e5a307afde943929e97d8b36e58b88cbb02fd",
67-
"time": "332.877µs"
66+
"blockHash": "0x80945caaff2fc67253cbb0217d2e5a307afde943929e97d8b36e58b88cbb02fd"
6867
},
6968
{
7069
"type": "call",
@@ -77,9 +76,7 @@
7776
"callType": "callcode"
7877
},
7978
"error": "invalid input length",
80-
"traceAddress": [
81-
0
82-
],
79+
"traceAddress": [0],
8380
"subtraces": 0,
8481
"transactionPosition": 117,
8582
"transactionHash": "0x7fe4dec901e1a62c1a1d96b8267bb9ff9dc1f75def43aa45b998743455eff8f9",
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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": "0x165",
77+
"init": "0x"
78+
},
79+
"result": {
80+
"gasUsed": "0x0",
81+
"code": "0x",
82+
"address": "0x5ac5599fc9df172c89ee7ec55ad9104ccbfed40d"
83+
},
84+
"traceAddress": [
85+
0
86+
],
87+
"subtraces": 0,
88+
"transactionPosition": 63,
89+
"transactionHash": "0x60e881fae3884657b5430925c5d0053535b45cce0b8188f2a6be1feee8bcc650",
90+
"blockNumber": 1555170,
91+
"blockHash": "0xea46fbf941d51bf1e4180fbf26d22fda3896f49c7f371d109c226de95dd7b02e"
92+
}
93+
]
94+
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@
6767
"transactionPosition": 18,
6868
"transactionHash": "0xc1c42a325856d513523aec464811923b2e2926f54015c7ba37877064cf889803",
6969
"blockNumber": 1555275,
70-
"blockHash": "0x80945caaff2fc67253cbb0217d2e5a307afde943929e97d8b36e58b88cbb02fd",
71-
"time": "453.925µs"
70+
"blockHash": "0x80945caaff2fc67253cbb0217d2e5a307afde943929e97d8b36e58b88cbb02fd"
7271
},
7372
{
7473
"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
@@ -67,8 +67,7 @@
6767
"transactionPosition": 23,
6868
"transactionHash": "0xe267552ce8437a5bc7081385c99f912de5723ad34b958db215dbc41abd5f6c03",
6969
"blockNumber": 555462,
70-
"blockHash": "0x38bba9e3965b57205097ea5ec53fc403cf3941bec2e4c933faae244de5ca4ba1",
71-
"time": "1.147715ms"
70+
"blockHash": "0x38bba9e3965b57205097ea5ec53fc403cf3941bec2e4c933faae244de5ca4ba1"
7271
},
7372
{
7473
"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
@@ -67,8 +67,7 @@
6767
"transactionPosition": 31,
6868
"transactionHash": "0x1257b698c5833c54ce786734087002b097275abc3877af082b5c2a538e894a41",
6969
"blockNumber": 1555161,
70-
"blockHash": "0xb0793dd508dd106a19794b8ce1dfc0ff8d98c76aab61bf32a11799854149a171",
71-
"time": "889.048µs"
70+
"blockHash": "0xb0793dd508dd106a19794b8ce1dfc0ff8d98c76aab61bf32a11799854149a171"
7271
},
7372
{
7473
"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
@@ -63,8 +63,7 @@
6363
"transactionPosition": 63,
6464
"transactionHash": "0x60e881fae3884657b5430925c5d0053535b45cce0b8188f2a6be1feee8bcc650",
6565
"blockNumber": 1555170,
66-
"blockHash": "0xea46fbf941d51bf1e4180fbf26d22fda3896f49c7f371d109c226de95dd7b02e",
67-
"time": "952.736µs"
66+
"blockHash": "0xea46fbf941d51bf1e4180fbf26d22fda3896f49c7f371d109c226de95dd7b02e"
6867
},
6968
{
7069
"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
@@ -74,8 +74,7 @@
7474
"transactionPosition": 26,
7575
"transactionHash": "0xcb1090fa85d2a3da8326b75333e92b3dca89963c895d9c981bfdaa64643135e4",
7676
"blockNumber": 839247,
77-
"blockHash": "0xce7ff7d84ca97f0f89d6065e2c12409a795c9f607cdb14aef0713cad5d7e311c",
78-
"time": "182.267µs"
77+
"blockHash": "0xce7ff7d84ca97f0f89d6065e2c12409a795c9f607cdb14aef0713cad5d7e311c"
7978
},
8079
{
8180
"action": {
@@ -91,4 +90,4 @@
9190
"type": "create"
9291
}
9392
]
94-
}
93+
}

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
@@ -81,8 +81,7 @@
8181
"transactionPosition": 5,
8282
"transactionHash": "0x04d2029a5cbbed30969cdc0a2ca9e9fc6b719e323af0802b52466f07ee0ecada",
8383
"blockNumber": 553416,
84-
"blockHash": "0x8df024322173d225a09681d35edeaa528aca60743a11a70f854c158862bf5282",
85-
"time": "617.42µs"
84+
"blockHash": "0x8df024322173d225a09681d35edeaa528aca60743a11a70f854c158862bf5282"
8685
},
8786
{
8887
"type": "call",
@@ -98,14 +97,12 @@
9897
"gasUsed": "0x0",
9998
"output": "0x"
10099
},
101-
"traceAddress": [
102-
0
103-
],
100+
"traceAddress": [0],
104101
"subtraces": 0,
105102
"transactionPosition": 5,
106103
"transactionHash": "0x04d2029a5cbbed30969cdc0a2ca9e9fc6b719e323af0802b52466f07ee0ecada",
107104
"blockNumber": 553416,
108105
"blockHash": "0x8df024322173d225a09681d35edeaa528aca60743a11a70f854c158862bf5282"
109106
}
110107
]
111-
}
108+
}

0 commit comments

Comments
 (0)