github.1485827954.workers.dev/ethereum/go-ethereum@v1.14.3/cmd/evm/testdata/14/readme.md (about)

     1  ## Difficulty calculation
     2  
     3  This test shows how the `evm t8n` can be used to calculate the (ethash) difficulty, if none is provided by the caller. 
     4  
     5  Calculating it (with an empty set of txs) using `London` rules (and no provided unclehash for the parent block):
     6  ```
     7  [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 [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
    11  {
    12    "result": {
    13      "stateRoot": "0x6f058887ca01549716789c380ede95aecc510e6d1fdc4dbf67d053c7c07f4bdc",
    14      "txRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    15      "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    16      "logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    17      "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    18      "receipts": [],
    19      "currentDifficulty": "0x2000020000000",
    20      "gasUsed": "0x0",
    21      "currentBaseFee": "0x500"
    22    }
    23  }
    24  ```
    25  Same thing, but this time providing a non-empty (and non-`emptyKeccak`) unclehash, which leads to a slightly different result:
    26  ```
    27  [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
    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
    31  {
    32    "result": {
    33      "stateRoot": "0x6f058887ca01549716789c380ede95aecc510e6d1fdc4dbf67d053c7c07f4bdc",
    34      "txRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    35      "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    36      "logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    37      "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    38      "receipts": [],
    39      "currentDifficulty": "0x1ff8020000000",
    40      "gasUsed": "0x0",
    41      "currentBaseFee": "0x500"
    42    }
    43  }
    44  ```
    45