ethereum / retesteth

testeth via RPC. Test run, generation by t8ntool protocol
http://retesteth.ethdevops.io/
GNU General Public License v3.0
113 stars 75 forks source link

Error: Invalid block: base fee not correct @ stRandom/randomStateTest153 #192

Closed meowsbits closed 1 year ago

meowsbits commented 1 year ago

The system evm tool version is etclabscore/core-geth@701eeb81235340f7c8bb120fbe2cfd048967c044 (defined in config via the default --clients t8ntool). The error does not happen when using an evm from ethereum/go-ethereum@master.

Expectations declared by the test seem to be met and passing. What is this makeRPCError Invalid block? How should I interpret this in order to debug core-geth?

$ git -C /home/ia/go/src/github.com/ethereum/go-ethereum/tests/testdata status
HEAD detached at a380655e5f
nothing to commit, working tree clean

$ ./build/retesteth/retesteth -t GeneralStateTests/stRandom -- -j1 --testpath /home/ia/go/src/github.com/ethereum/go-ethereum/tests/testdata --clients t8ntool --singletest randomStatetest153
Running 1 test case...
Running tests using path: /home/ia/go/src/github.com/ethereum/go-ethereum/tests/testdata
Options path `/home/ia/.retesteth` doesn't exist, attempt to create a new directory
Retesteth config path: /home/ia/.retesteth
Active client configurations: 't8ntool '
Filter: 'randomStatetest153'
Running tests for config 'Ethereum GO on StateTool' 2
Test Case "stRandom": (1 of 1)
100%
WARNING: tool vs retesteth basefee disagree: 0 vs 10
makeRPCError Invalid block: base fee not correct! Expected: `10`, got: `0`
Finishing retesteth run
*** Total Tests Run: 0

Error: Invalid block: base fee not correct! Expected: `10`, got: `0` (stRandom/randomStatetest153, fork: London, TrInfo: d: 0, g: 0, v: 0, TrData: ` 0x42..`)

--------
TestOutputHelper detected 1 errors during test execution!
/home/ia/dev/ethereum/retesteth/retesteth/TestOutputHelper.cpp(222): error: in "GeneralStateTests/stRandom": 

*** 1 failure is detected in the test module "EthereumTests"

Note that running the test with core-geth's evm statetest command the test passes:

./build/bin/evm --dump  statetest ./tests/testdata/GeneralStateTests/stRandom/randomStatetest153.json
[
  {
    "name": "randomStatetest153",
    "pass": true,
    "fork": "Berlin"
  },
  {
    "name": "randomStatetest153",
    "pass": true,
    "fork": "Istanbul"
  },
  {
    "name": "randomStatetest153",
    "pass": true,
    "fork": "London"
  }
]
meowsbits commented 1 year ago

Found it! It was a missing BaseFee field in core-geth's internal ExecutionResult struct. Fixed with https://github.com/etclabscore/core-geth/commit/03efbe99dd18df41fefd85517e4bfd26b1e51d9a.