github.com/theQRL/go-zond@v0.2.1/cmd/zvm/testdata/8/readme.md (about)

     1  ## EIP-2930 testing
     2  
     3  This test contains testcases for EIP-2930, which uses transactions with access lists. 
     4  
     5  ### Prestate
     6  
     7  The alloc portion contains one contract (`Z000000000000000000000000000000000000aaaa`), containing the 
     8  following code: `0x5854505854`: `PC ;SLOAD; POP; PC; SLOAD`.
     9  
    10  Essentially, this contract does `SLOAD(0)` and `SLOAD(3)`.
    11  
    12  The alloc also contains some funds on `Z204cc644e26bdf879db422658edee62e302c3da8`. 
    13  
    14  ## Transactions
    15  
    16  There are three transactions, each invokes the contract above. 
    17  
    18  1. ACL-transaction, which contains some non-used slots
    19  2. Regular transaction
    20  3. ACL-transaction, which contains the slots `1` and `3` in `0x000000000000000000000000000000000000aaaa`
    21  
    22  ## Execution 
    23  
    24  Running it yields: 
    25  ```
    26  $ go run . t8n --state.fork=Shanghai --input.alloc=testdata/8/alloc.json --input.txs=testdata/8/txs.json --input.env=testdata/8/env.json --trace 2>/dev/null && cat trace-* | grep SLOAD
    27  {"pc":1,"op":84,"gas":"0x484be","gasCost":"0x834","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"SLOAD"}
    28  {"pc":4,"op":84,"gas":"0x47c86","gasCost":"0x834","memSize":0,"stack":["0x3"],"depth":1,"refund":0,"opName":"SLOAD"}
    29  {"pc":1,"op":84,"gas":"0x49cf6","gasCost":"0x834","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"SLOAD"}
    30  {"pc":4,"op":84,"gas":"0x494be","gasCost":"0x834","memSize":0,"stack":["0x3"],"depth":1,"refund":0,"opName":"SLOAD"}
    31  {"pc":1,"op":84,"gas":"0x484be","gasCost":"0x64","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"SLOAD"}
    32  {"pc":4,"op":84,"gas":"0x48456","gasCost":"0x64","memSize":0,"stack":["0x3"],"depth":1,"refund":0,"opName":"SLOAD"}
    33  ```
    34  
    35  Simlarly, we can provide the input transactions via `stdin` instead of as file: 
    36  
    37  ```
    38  $ cat testdata/8/txs.json | jq "{txs: .}" \
    39    | go run . t8n --state.fork=Shanghai \
    40       --input.alloc=testdata/8/alloc.json \
    41       --input.txs=stdin \
    42       --input.env=testdata/8/env.json \
    43       --trace  \
    44       2>/dev/null \
    45    && cat trace-* | grep SLOAD
    46  {"pc":1,"op":84,"gas":"0x484be","gasCost":"0x834","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"SLOAD"}
    47  {"pc":4,"op":84,"gas":"0x47c86","gasCost":"0x834","memSize":0,"stack":["0x3"],"depth":1,"refund":0,"opName":"SLOAD"}
    48  {"pc":1,"op":84,"gas":"0x49cf6","gasCost":"0x834","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"SLOAD"}
    49  {"pc":4,"op":84,"gas":"0x494be","gasCost":"0x834","memSize":0,"stack":["0x3"],"depth":1,"refund":0,"opName":"SLOAD"}
    50  {"pc":1,"op":84,"gas":"0x484be","gasCost":"0x64","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"SLOAD"}
    51  {"pc":4,"op":84,"gas":"0x48456","gasCost":"0x64","memSize":0,"stack":["0x3"],"depth":1,"refund":0,"opName":"SLOAD"}
    52  ```