github.com/theQRL/go-zond@v0.1.1/cmd/evm/testdata/9/readme.md (about) 1 ## EIP-1559 testing 2 3 This test contains testcases for EIP-1559, which uses an new transaction type and has a new block parameter. 4 5 ### Prestate 6 7 The alloc portion contains one contract (`0x000000000000000000000000000000000000aaaa`), containing the 8 following code: `0x58585454`: `PC; PC; SLOAD; SLOAD`. 9 10 Essentially, this contract does `SLOAD(0)` and `SLOAD(1)`. 11 12 The alloc also contains some funds on `0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b`. 13 14 ## Transactions 15 16 There are two transactions, each invokes the contract above. 17 18 1. EIP-1559 ACL-transaction, which contains the `0x0` slot for `0xaaaa` 19 2. Legacy transaction 20 21 ## Execution 22 23 Running it yields: 24 ``` 25 $ dir=./testdata/9 && ./evm t8n --state.fork=London --input.alloc=$dir/alloc.json --input.txs=$dir/txs.json --input.env=$dir/env.json --trace 2>/dev/null && cat trace-* | grep SLOAD 26 {"pc":1,"op":84,"gas":"0x484be","gasCost":"0x834","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"SLOAD"} 27 {"pc":4,"op":84,"gas":"0x47c86","gasCost":"0x834","memSize":0,"stack":["0x3"],"depth":1,"refund":0,"opName":"SLOAD"} 28 {"pc":2,"op":84,"gas":"0x48c28","gasCost":"0x834","memSize":0,"stack":["0x0","0x1"],"depth":1,"refund":0,"opName":"SLOAD"} 29 {"pc":3,"op":84,"gas":"0x483f4","gasCost":"0x64","memSize":0,"stack":["0x0","0x0"],"depth":1,"refund":0,"opName":"SLOAD"} 30 {"pc":1,"op":84,"gas":"0x49cf6","gasCost":"0x834","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"SLOAD"} 31 {"pc":4,"op":84,"gas":"0x494be","gasCost":"0x834","memSize":0,"stack":["0x3"],"depth":1,"refund":0,"opName":"SLOAD"} 32 {"pc":2,"op":84,"gas":"0x49cf4","gasCost":"0x834","memSize":0,"stack":["0x0","0x1"],"depth":1,"refund":0,"opName":"SLOAD"} 33 {"pc":3,"op":84,"gas":"0x494c0","gasCost":"0x834","memSize":0,"stack":["0x0","0x0"],"depth":1,"refund":0,"opName":"SLOAD"} 34 {"pc":1,"op":84,"gas":"0x484be","gasCost":"0x64","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"SLOAD"} 35 {"pc":4,"op":84,"gas":"0x48456","gasCost":"0x64","memSize":0,"stack":["0x3"],"depth":1,"refund":0,"opName":"SLOAD"} 36 ``` 37 38 We can also get the post-alloc: 39 ``` 40 $ dir=./testdata/9 && ./evm t8n --state.fork=London --input.alloc=$dir/alloc.json --input.txs=$dir/txs.json --input.env=$dir/env.json --output.alloc=stdout 2>/dev/null 41 { 42 "alloc": { 43 "0x000000000000000000000000000000000000aaaa": { 44 "code": "0x58585454", 45 "balance": "0x3", 46 "nonce": "0x1" 47 }, 48 "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba": { 49 "balance": "0x5bb10ddef6e0" 50 }, 51 "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": { 52 "balance": "0xff745ee8832120", 53 "nonce": "0x2" 54 } 55 } 56 } 57 ``` 58 59 If we try to execute it on older rules: 60 ``` 61 dir=./testdata/9 && ./evm t8n --state.fork=Berlin --input.alloc=$dir/alloc.json --input.txs=$dir/txs.json --input.env=$dir/env.json --output.alloc=stdout 62 ERROR(10): Failed signing transactions: ERROR(10): Tx 0: failed to sign tx: transaction type not supported 63 ``` 64 65 It fails, due to the `evm t8n` cannot sign them in with the given signer. We can bypass that, however, 66 by feeding it presigned transactions, located in `txs_signed.json`. 67 68 ``` 69 dir=./testdata/9 && ./evm t8n --state.fork=Berlin --input.alloc=$dir/alloc.json --input.txs=$dir/txs_signed.json --input.env=$dir/env.json 70 WARN [03-09|11:06:22.065] rejected tx index=0 hash=334e09..f8dce5 error="transaction type not supported" 71 INFO [03-09|11:06:22.066] rejected tx index=1 hash=a9c6c6..fa4036 from=0xa94f5374Fce5edBC8E2a8697C15331677e6EbF0B error="nonce too high: address 0xa94f5374Fce5edBC8E2a8697C15331677e6EbF0B, tx: 1 state: 0" 72 INFO [03-09|11:06:22.066] Trie dumping started root=6eebe9..a0fda5 73 INFO [03-09|11:06:22.066] Trie dumping complete accounts=2 elapsed="55.844µs" 74 INFO [03-09|11:06:22.066] Wrote file file=alloc.json 75 INFO [03-09|11:06:22.066] Wrote file file=result.json 76 ``` 77 78 Number `0` is not applicable, and therefore number `1` has wrong nonce, and both are rejected. 79