Skip to content

Commit 08f6a2a

Browse files
authored
cmd/evm: update readmes for the tests (#26841)
1 parent 5395362 commit 08f6a2a

File tree

8 files changed

+578
-144
lines changed

8 files changed

+578
-144
lines changed

cmd/evm/testdata/10/readme.md

Lines changed: 70 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -9,71 +9,77 @@ INFO [05-09|22:11:59.436] rejected tx index=3 hash=
99
Output:
1010
```json
1111
{
12-
"alloc": {
13-
"0x1111111111111111111111111111111111111111": {
14-
"code": "0xfe",
15-
"balance": "0x10000000000",
16-
"nonce": "0x1"
12+
"alloc": {
13+
"0x1111111111111111111111111111111111111111": {
14+
"code": "0xfe",
15+
"balance": "0x10000000000",
16+
"nonce": "0x1"
17+
},
18+
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": {
19+
"balance": "0x10000000000",
20+
"nonce": "0x1"
21+
},
22+
"0xd02d72e067e77158444ef2020ff2d325f929b363": {
23+
"balance": "0xff5beffffc95",
24+
"nonce": "0x4"
25+
}
1726
},
18-
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": {
19-
"balance": "0x10000000000",
20-
"nonce": "0x1"
21-
},
22-
"0xd02d72e067e77158444ef2020ff2d325f929b363": {
23-
"balance": "0xff5beffffc95",
24-
"nonce": "0x4"
25-
}
26-
},
27-
"result": {
28-
"stateRoot": "0xf91a7ec08e4bfea88719aab34deabb000c86902360532b52afa9599d41f2bb8b",
29-
"txRoot": "0xda925f2306a52fa24c15d5cd212d736ee016415fd8dd0c45fd368de7917d64bb",
30-
"receiptRoot": "0x439a25f7fc424c10fb1f89800e4aa1df74156b137239d9ac3eaa7c911c353cd5",
31-
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
32-
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
33-
"receipts": [
34-
{
35-
"type": "0x2",
36-
"root": "0x",
37-
"status": "0x0",
38-
"cumulativeGasUsed": "0x10000001",
39-
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
40-
"logs": null,
41-
"transactionHash": "0x88980f6efcc5358d9c359663e7b9414722d430497637340ea056b076bc206701",
42-
"contractAddress": "0x0000000000000000000000000000000000000000",
43-
"gasUsed": "0x10000001",
44-
"blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
45-
"transactionIndex": "0x0"
46-
},
47-
{
48-
"type": "0x2",
49-
"root": "0x",
50-
"status": "0x0",
51-
"cumulativeGasUsed": "0x20000001",
27+
"result": {
28+
"stateRoot": "0xf91a7ec08e4bfea88719aab34deabb000c86902360532b52afa9599d41f2bb8b",
29+
"txRoot": "0xda925f2306a52fa24c15d5cd212d736ee016415fd8dd0c45fd368de7917d64bb",
30+
"receiptsRoot": "0x439a25f7fc424c10fb1f89800e4aa1df74156b137239d9ac3eaa7c911c353cd5",
31+
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
5232
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
53-
"logs": null,
54-
"transactionHash": "0xd7bf3886f4e2aef74d525ae072c680f3846f550254401b67cbfda4a233757582",
55-
"contractAddress": "0x0000000000000000000000000000000000000000",
56-
"gasUsed": "0x10000000",
57-
"blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
58-
"transactionIndex": "0x1"
59-
},
60-
{
61-
"type": "0x2",
62-
"root": "0x",
63-
"status": "0x0",
64-
"cumulativeGasUsed": "0x30000001",
65-
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
66-
"logs": null,
67-
"transactionHash": "0x50308296760f01f1eeec7500e9e73cad67469249b1f59e9a9f55e6625a4923db",
68-
"contractAddress": "0x0000000000000000000000000000000000000000",
69-
"gasUsed": "0x10000000",
70-
"blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
71-
"transactionIndex": "0x2"
72-
}
73-
],
74-
"rejected": [
75-
3
76-
]
77-
}
33+
"receipts": [
34+
{
35+
"type": "0x2",
36+
"root": "0x",
37+
"status": "0x0",
38+
"cumulativeGasUsed": "0x10000001",
39+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
40+
"logs": null,
41+
"transactionHash": "0x88980f6efcc5358d9c359663e7b9414722d430497637340ea056b076bc206701",
42+
"contractAddress": "0x0000000000000000000000000000000000000000",
43+
"gasUsed": "0x10000001",
44+
"blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
45+
"transactionIndex": "0x0"
46+
},
47+
{
48+
"type": "0x2",
49+
"root": "0x",
50+
"status": "0x0",
51+
"cumulativeGasUsed": "0x20000001",
52+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
53+
"logs": null,
54+
"transactionHash": "0xd7bf3886f4e2aef74d525ae072c680f3846f550254401b67cbfda4a233757582",
55+
"contractAddress": "0x0000000000000000000000000000000000000000",
56+
"gasUsed": "0x10000000",
57+
"blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
58+
"transactionIndex": "0x1"
59+
},
60+
{
61+
"type": "0x2",
62+
"root": "0x",
63+
"status": "0x0",
64+
"cumulativeGasUsed": "0x30000001",
65+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
66+
"logs": null,
67+
"transactionHash": "0x50308296760f01f1eeec7500e9e73cad67469249b1f59e9a9f55e6625a4923db",
68+
"contractAddress": "0x0000000000000000000000000000000000000000",
69+
"gasUsed": "0x10000000",
70+
"blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
71+
"transactionIndex": "0x2"
72+
}
73+
],
74+
"rejected": [
75+
{
76+
"index": 3,
77+
"error": "gas limit reached"
78+
}
79+
],
80+
"currentDifficulty": "0x20000",
81+
"gasUsed": "0x30000001",
82+
"currentBaseFee": "0x36b"
83+
}
7884
}
7985
```

cmd/evm/testdata/12/readme.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,32 @@ dir=./testdata/12 && ./evm t8n --state.fork=London --input.alloc=$dir/alloc.json
1111
With the fix applied, the result is:
1212
```
1313
dir=./testdata/12 && ./evm t8n --state.fork=London --input.alloc=$dir/alloc.json --input.txs=$dir/txs.json --input.env=$dir/env.json --output.alloc=stdout --output.result=stdout
14-
INFO [07-21|19:03:50.276] rejected tx index=0 hash=ccc996..d83435 from=0xa94f5374Fce5edBC8E2a8697C15331677e6EbF0B error="insufficient funds for gas * price + value: address 0xa94f5374Fce5edBC8E2a8697C15331677e6EbF0B have 84000000 want 84000032"
15-
INFO [07-21|19:03:50.276] Trie dumping started root=e05f81..6597a5
16-
INFO [07-21|19:03:50.276] Trie dumping complete accounts=1 elapsed="39.549µs"
14+
INFO [03-09|10:43:12.649] rejected tx index=0 hash=ccc996..d83435 from=0xa94f5374Fce5edBC8E2a8697C15331677e6EbF0B error="insufficient funds for gas * price + value: address 0xa94f5374Fce5edBC8E2a8697C15331677e6EbF0B have 84000000 want 84000032"
15+
INFO [03-09|10:43:12.650] Trie dumping started root=e05f81..6597a5
16+
INFO [03-09|10:43:12.650] Trie dumping complete accounts=1 elapsed="46.393µs"
1717
{
18-
"alloc": {
19-
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": {
20-
"balance": "0x501bd00"
18+
"alloc": {
19+
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": {
20+
"balance": "0x501bd00"
21+
}
22+
},
23+
"result": {
24+
"stateRoot": "0xe05f81f8244a76503ceec6f88abfcd03047a612a1001217f37d30984536597a5",
25+
"txRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
26+
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
27+
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
28+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
29+
"receipts": [],
30+
"rejected": [
31+
{
32+
"index": 0,
33+
"error": "insufficient funds for gas * price + value: address 0xa94f5374Fce5edBC8E2a8697C15331677e6EbF0B have 84000000 want 84000032"
34+
}
35+
],
36+
"currentDifficulty": "0x20000",
37+
"gasUsed": "0x0",
38+
"currentBaseFee": "0x20"
2139
}
22-
},
23-
"result": {
24-
"stateRoot": "0xe05f81f8244a76503ceec6f88abfcd03047a612a1001217f37d30984536597a5",
25-
"txRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
26-
"receiptRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
27-
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
28-
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
29-
"receipts": [],
30-
"rejected": [
31-
{
32-
"index": 0,
33-
"error": "insufficient funds for gas * price + value: address 0xa94f5374Fce5edBC8E2a8697C15331677e6EbF0B have 84000000 want 84000032"
34-
}
35-
]
36-
}
3740
}
3841
```
3942

cmd/evm/testdata/14/readme.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,40 @@ This test shows how the `evm t8n` can be used to calculate the (ethash) difficul
55
Calculating it (with an empty set of txs) using `London` rules (and no provided unclehash for the parent block):
66
```
77
[user@work evm]$ ./evm t8n --input.alloc=./testdata/14/alloc.json --input.txs=./testdata/14/txs.json --input.env=./testdata/14/env.json --output.result=stdout --state.fork=London
8-
INFO [08-30|20:43:09.352] Trie dumping started root=6f0588..7f4bdc
9-
INFO [08-30|20:43:09.352] Trie dumping complete accounts=2 elapsed="82.533µs"
10-
INFO [08-30|20:43:09.352] Wrote file file=alloc.json
8+
INFO [03-09|10:43:57.070] Trie dumping started root=6f0588..7f4bdc
9+
INFO [03-09|10:43:57.070] Trie dumping complete accounts=2 elapsed="214.663µs"
10+
INFO [03-09|10:43:57.071] Wrote file file=alloc.json
1111
{
1212
"result": {
1313
"stateRoot": "0x6f058887ca01549716789c380ede95aecc510e6d1fdc4dbf67d053c7c07f4bdc",
1414
"txRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
15-
"receiptRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
15+
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
1616
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
1717
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
1818
"receipts": [],
19-
"currentDifficulty": "0x2000020000000"
19+
"currentDifficulty": "0x2000020000000",
20+
"gasUsed": "0x0",
21+
"currentBaseFee": "0x500"
2022
}
2123
}
2224
```
2325
Same thing, but this time providing a non-empty (and non-`emptyKeccak`) unclehash, which leads to a slightly different result:
2426
```
2527
[user@work evm]$ ./evm t8n --input.alloc=./testdata/14/alloc.json --input.txs=./testdata/14/txs.json --input.env=./testdata/14/env.uncles.json --output.result=stdout --state.fork=London
26-
INFO [08-30|20:44:33.102] Trie dumping started root=6f0588..7f4bdc
27-
INFO [08-30|20:44:33.102] Trie dumping complete accounts=2 elapsed="72.91µs"
28-
INFO [08-30|20:44:33.102] Wrote file file=alloc.json
28+
INFO [03-09|10:44:20.511] Trie dumping started root=6f0588..7f4bdc
29+
INFO [03-09|10:44:20.511] Trie dumping complete accounts=2 elapsed="184.319µs"
30+
INFO [03-09|10:44:20.512] Wrote file file=alloc.json
2931
{
3032
"result": {
3133
"stateRoot": "0x6f058887ca01549716789c380ede95aecc510e6d1fdc4dbf67d053c7c07f4bdc",
3234
"txRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
33-
"receiptRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
35+
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
3436
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
3537
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
3638
"receipts": [],
37-
"currentDifficulty": "0x1ff8020000000"
39+
"currentDifficulty": "0x1ff8020000000",
40+
"gasUsed": "0x0",
41+
"currentBaseFee": "0x500"
3842
}
3943
}
4044
```

cmd/evm/testdata/19/readme.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,20 @@ this time on `GrayGlacier` (Eip 5133).
66
Calculating it (with an empty set of txs) using `GrayGlacier` rules (and no provided unclehash for the parent block):
77
```
88
[user@work evm]$ ./evm t8n --input.alloc=./testdata/19/alloc.json --input.txs=./testdata/19/txs.json --input.env=./testdata/19/env.json --output.result=stdout --state.fork=GrayGlacier
9+
INFO [03-09|10:45:26.777] Trie dumping started root=6f0588..7f4bdc
10+
INFO [03-09|10:45:26.777] Trie dumping complete accounts=2 elapsed="176.471µs"
11+
INFO [03-09|10:45:26.777] Wrote file file=alloc.json
12+
{
13+
"result": {
14+
"stateRoot": "0x6f058887ca01549716789c380ede95aecc510e6d1fdc4dbf67d053c7c07f4bdc",
15+
"txRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
16+
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
17+
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
18+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
19+
"receipts": [],
20+
"currentDifficulty": "0x2000000004000",
21+
"gasUsed": "0x0",
22+
"currentBaseFee": "0x500"
23+
}
24+
}
925
```

0 commit comments

Comments
 (0)