ethereum / execution-specs

Specification for the Execution Layer. Tracking network upgrades.
Creative Commons Zero v1.0 Universal
808 stars 222 forks source link

Consensus issue 2 re `TSTORE/TLOAD` #917

Closed holiman closed 2 months ago

holiman commented 3 months ago

There appears to be some other TSTORE/TLOAD-related consensus issue:

Consensus error
Testcase: /fuzztmp/00021077-mixed-77.json
- gethbatch-0: /fuzztmp/gethbatch-0-output.jsonl
  - command: /gethvm --json --noreturndata --nomemory statetest
- eelsbatch-0: /fuzztmp/eelsbatch-0-output.jsonl
  - command: /ethereum-spec-evm statetest --json --noreturndata --nomemory
- nethbatch-0: /fuzztmp/nethbatch-0-output.jsonl
  - command: /neth/nethtest -x --trace -m
- besubatch-0: /fuzztmp/besubatch-0-output.jsonl
  - command: /evmtool/bin/evm --nomemory --notime --json state-test
- erigonbatch-0: /fuzztmp/erigonbatch-0-output.jsonl
  - command: /erigon_vm --json --noreturndata --nomemory statetest
- nimbus-0: /fuzztmp/nimbus-0-output.jsonl
  - command: /nimbvm --json --noreturndata --nomemory --nostorage /fuzztmp/00021077-mixed-77.json
- evmone-0: /fuzztmp/evmone-0-output.jsonl
  - command: /evmone --trace /fuzztmp/00021077-mixed-77.json
- revm-0: /fuzztmp/revm-0-output.jsonl
  - command: /revme statetest --json /fuzztmp/00021077-mixed-77.json

To view the difference with tracediff:
        tracediff /fuzztmp/gethbatch-0-output.jsonl /fuzztmp/eelsbatch-0-output.jsonl
-------
prev:           both: {"depth":14,"pc":58,"gas":99502,"op":92,"opName":"TLOAD","stack":["0x4"]}
diff:    gethbatch-0: {"depth":14,"pc":59,"gas":99402,"op":80,"opName":"POP","stack":["0x0"]}
diff:    eelsbatch-0: {"depth":14,"pc":59,"gas":99402,"op":80,"opName":"POP","stack":["0x2"]}

And yes, it's on the branch which is rebased on to the fixed cancun branch, afaict. git log inside the container:

commit cd02782b4af992a6c19b4053e53702beb8164996 (grafted, HEAD -> statetests, origin/statetests)
Author: Sam Wilson <sam@binarycake.ca>
Date:   Wed Mar 20 22:43:12 2024 -0400

    Output result on stderr when not tracing

With minimized testcase

prev:           both: {"depth":2,"pc":58,"gas":99217,"op":92,"opName":"TLOAD","stack":["0x4"]}
diff:         geth-0: {"depth":2,"pc":59,"gas":99117,"op":80,"opName":"POP","stack":["0x0"]}
diff:         eels-0: {"depth":2,"pc":59,"gas":99117,"op":80,"opName":"POP","stack":["0x2"]}
Consensus error
Testcase: /fuzztmp/00021077-mixed-77.json.tmp
- geth-0: /geth-0-output.jsonl
  - command: /gethvm --json --noreturndata --nomemory statetest /fuzztmp/00021077-mixed-77.json.tmp
- eels-0: /eels-0-output.jsonl
  - command: /ethereum-spec-evm statetest --json --noreturndata --nomemory /fuzztmp/00021077-mixed-77.json.tmp
{
  "00021077-mixed-77": {
    "env": {
      "currentCoinbase": "b94f5374fce5edbc8e2a8697c15331677e6ebf0b",
      "currentDifficulty": "0x200000",
      "currentRandom": "0x0000000000000000000000000000000000000000000000000000000000020000",
      "currentGasLimit": "0x26e1f476fe1e22",
      "currentNumber": "0x1",
      "currentTimestamp": "0x3e8",
      "previousHash": "0x044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d",
      "currentBaseFee": "0x10"
    },
    "pre": {
      "0x00000000000000000000000000000000000000f1": {
        "code": "0x6007600255600060006000600060065af4506000600060006000600060f15af1507f600060015d6001600355600260025560026002556001600155600160015560036000527f5c5060015450600260035560085c5060005450600060005560045c50600054506020527f60025c5060005c5060016002556002600455600260045d7f600154507f60095c6040527f50600160045d600554506060600053600c60015360ff60026000527f536060606060527f036000527f53600360045360606005536000600653605560075360606020527f6080527f6008536001600953606020527f54600a536050600b536060600c536003600d5360a0527f6040527f6054600e536050600f536060606040527f10536003601153605c601260c0527f536050606060527f13536060601453602060155360606016536060526060608060e0527f53600060815360606080527f60825360176083536053608453606060855360fd610100527f60865360606087536018608860a0527f5360536089536060608a536019608b53610120527f6060608c536000608d5360f3608e536060c0527e608f60006000f56000600060610140527e60006000855af1505060015450600360015d60e0527f600154506004ff6008610160527f600255600960045da3585d3b8f17600760045d60006000610100527f60006000610180527f600060f15af25060015c507f600060045d600160005d60055c507f60610120526101a0527f7e600060006000600e5af450600960026000527f5d525b19938ab1600560015d6101c0527f610140527f6001546000527f50600254506004545060015c506020527f60005c6101e0527f5060045450610160527f600460005529006020600060205260f3604053604160610200527ef36040526000606060610180527e6000f56000600060006000845af4505060610220527e5c506004545060015c5060045c6101a0527f507f7f837f60055c5060006002610240527f5560016001557f6000600060006000600060f86101c0527f5af26000527f5060610260527e527f60066000527f6004556000600060006000600060056101e0527f600052610280527f7f5af16020527f50600160026020527f5560025c50e16020527fb360006102006102a0527f527f60025d7f60075c507f7f6040527f600654507fb96020526040527f7f60086102c0527f6004610220527f55600060006040527f60006000606060527e60045af25060006102e0527f527f3f7b6a6060610240527f527f74a26000526040527f7f0560005260608052610300527f7f60527f7f5e596000606000610260527f527e600060006080527f60095af450610320527f6020527fe99960a0527ff5366060527f8b610280527f6080527f013960006020610340527f527f600460a0527f55d55a6020527f60c0527f726e116102a0527f6142600154610360527f60206040527f6060a0527f80527f527f5060c0527f60015c60e0526102c0527f610380527f7f50600260015d756040527ffe5489a43d6000600360405260c0527f7f5560e06103a0527f6102e0527f52610100527f7f7a60a0527f6060527f6e3a1afe53961160035c606103c0527f40527f5060610300527e6060527f60610120527fe0610100527f527f600060006103e0527f60006060c0527e60f9610320527f5a6080527ff2506060527f610140527fe960610400527f07600355610120527f6003610100610340527f527f5c50585698a09960805260610420527fe0527f610160527f7f6060605260326060a052610360527f610140527f7f8053610440527f60606081610120527f53602060610180527f608052608260610380527fa05360610460527f53610100527f60610160527fa153606060a0527f60a2536101a0527f606103a0610480527f527f610140527fc0527f606060a353606060a4536083610180527f60a55360616104a0527f01616103c0527f01c0527f20527f5360a653606060a7610160527f53600060a86104c0527f60c05260e061016103e0527fa0527f526101e0527f7f7f53606060a9536084606104e0527faa53610140527f6053606101610400527f80527fab5360606061610200527f01610500527fc0527fac5360fd60ad53606060ae536101610420527e527f6060e0527f856061610520527f016061610220527f01a0527f6101e0527f527faf53610440527f605360b05360610540527f6060b153608660b253606060b3610240527f5360006061012052610460527f7f610560527f610200527f6101c0527fb453610180527f60f360610100610260527f527fb561610580527f0480527f5360b660006000f0600060610220527e600060006101e0527f6000856105a0527f5a6102806104a0527f527ff261016101a0527f40527f505060086000556102406105c0527f527f600060610120526104c0527f7e606102a0527e610200527f600060f75af46105e0527f5060005450606101c0527e6102606104e0527f527f600061016102c0527f6052610600527f7f6000600060006000610220527f5af2504883610500527f3d610140527f6361610620527f0280526102e0527f7f9d0b33606101e0527f046004556001610520527f600061610640527f0180610240527f527f5d600560610300527e6102a0527f556857faf51a610540610660527f527f60f1ff7f60005450610200527f610160527f7f61610320527f0260527f31610680527ff361610560527f02c0527f48526f61576101a0527f7f60065c50600160015d606106a0527f610340527f0154610580527f50610220527f6061026102e0527f80527f6060006106c0527f53606000527f6101805261036105a0527f60527f7f0960016101c0527f5360606106e0527e527fff610300527f6002616102a0527f6105c0527f024052610380527f7f53610700527f606060036000527f53600160045360546005536103206105e0527f527f6101a0610720527f6101e06103a0527f527f6102c0527f527f6020610260527f527f60610600527f610740527f50600653606060610340527f076103c0527f6020527f53602060085360606102610760527f610620527fe0527f600953606061020052610280527f616103e0527f0360527f610780527f7f20526101610640527fc0527f600060406040527f5360610300527f606041536107a0527f60610400527f0a604253610660527f610380527f60536040526102a0527f7f616107c0527f0220527f6043536060604461042052610680527f7f610320527f6101e05261036107e0527fa0527f7f5360f360455360606060527f604661026106a0527fc0610440527f52610800527f7f53600b6047536102610340526103c0527f7f40527f6053606106c0527f4853610820527f60606049610460527f606052610200527f7f53600c6102e0527f604a61036106610840527fe0527fe0527f53610360527f6060610480527f604b53608052610260527f7f60610860527e604c610700527f5360f3604d536000610400527f604e606104a0527f610300610880527f610380527f527e61610720527f0220527f6000f56000608052606061028052616108a0527f04206104c0527f527f7f60a053610740527f60006060a0527f6103a0527fa1616108c0527f0320527f53606060a25360006104e0527f60610760527fa3610440527f5361026108e0527f40527f606060a4536102a0527f6103c0527f600060a561610780527f0500527f610900527f5360610340527f610460527f6060a653600060a75360c0527f6085606107a052610920527f7fa853605a610520527f606103e0527f610260527f61610480527f02c0527fa9610940527f616107c0527f0360527f5360f260aa610540527f53605060ab53605060ac5361610960527f0400527f60616107e0527f04a0527f6060ad53600160e0527f610560527f60ae610980527f536061610380527f02e052610800527f7f610280527f6060616104c0527f04206109a0527f527faf610580527f53600060b0536055610820527f60b153606060b2536007606109c0527fb36103a0527f53606104e0527f6105a0527f606061610840527f03610440527e6109e0527f527fb4610100526102a0527f7f53600160b553605560b66105c0610860527f52610a00527f7f610500527f53606103c0527f60610460527f60b753602060b8536103205261610a20527f0880527f7f606105e0527f6060b95360610520527e60ba536102c0527f606101610a40527f616104806108a0527f527f03e0527f20610600527f5260f36101405360606105610a60527f40527f6101415361036108c0527f40527f60bb61014253605361610620527f61610a80527f04a0527f01435360610400527f616108e0527f0560527f60616102e0527f0144610aa0527f5360bc61610640527f01455360606161036052610900527f6104c0527f7f0146610ac0527f53610580527f6000610147610420610660527f527f5360f3610920527f610148610ae0527f5361014960006103005260606104e0526105a0527f7f6103610680527f610940610b00527f527f20536000610380527f610321610440527f5360f061032253606061032361610b20527f05c0610960527f6106a0527f527f53610500527f600061032453606061032553610b40527f600061036103a0610980527f610460527f6106c0527f527f6105e0527f265360610b60527f606103610520527f275360006109a0527f610328536060610329536106e0527f610b80527f600061032a5360610600527f84610361046109c0527f80527f2b536161054052610ba0527f7f03c05260610700527f606103e053605a6103e153606109e0527f610620527f610bc0527f616103e25360036103e353602c6104610720527fa0610560527f52610a00527f610be0527f7f6103e45360536103e5610640527f5360606103e65360f461610740527f03e7610c00527f610a20527f5360616103e8536003610580527f61036104c052610660527f7fe9610c20527f53602d6107610a40527f60527f6103ea5360536103eb5360606103ec53605061610c40527f03ed6105a0527f536106610a60527f80527f610780527f60616103ee536104e0610c60527f527f60036103ef53602e6103f05360610a80527f536103f1536060616107a052610c80527f7f6106a0527f05c0527f6103f25360506103f353610aa0527f6061610500527f610ca0527f6103f45360036107c0527f6103f553606106c0527f2f6103f6610ac0527f6105610cc0527fe0527f5360536103f75360616103f8536107e0527f60036103610520527f610a610ce0527fe0527ff96106e0527f5360306103fa536060610600527f6103fb610800527f53610d00527f600061610b00527f03fc5360f36103fd536000610700527f6103fe6061054052610d20527f6000610561082052610b20527f7f6053610620527f6060610561536000610562610d40527f5360610720527ff56105635360610b40527f60610840527f6105645360006105610d60527f65536060610640527f610566536000610561610b60527f0740527f6753610860610d80527f527f606061056853600061056953606061056a53600061610b80527f05610660610da0527f527f6b53606107610880527f60527f6061056c53600061056d536085610ba052610dc0527f7f61056e53605a61056f5360f1610570536108a0527f610680610780527f5260610de0527f60610bc0527f6106a05360506106a15360616106a25360056106a36108c0527f610e00527f5360716106a4610be0527f53606107a0527f536106a55360606106a653605061610e20527f06a75360616108e0527f61610c00527f06a85360056106a9536072616107c052610e40527f7f06aa5360536106ab5360616106ac61610c20527f0900527f5360056106ad53610e60527f60736106ae5360606106af6107e0527f5360006106610c40527fb05360f36109610e80527f20527f6106b1536106b260006000f06000600060006000600085610c60527f61610ea0527f080052605a6108206109405260536109605360606109615360f2610962536061610ec0527f0c80527f61610963536008610964536021610965536053610966536060610967610ee0527f53605061610ca0527f096853606161096953600861096a53602261096b536053610f00527f61096c53606061096d610cc0527f53605061096e53606161096f536008610970610f20527f5360236109715360536109725360610ce0527f61610973536008610974536024610f40527f6109755360606109765360006109775360f361610d00526009610d2053607861610f60527f0d21536053610d22536060610d23536000610d24536061610d25536009610d26610f80527f536079610d27536060610d28536000610d29536060610d2a536000610d2b5360610fa0527ff5610d2c536060610d2d536000610d2e536060610d2f536000610d3053606061610fc0527f0d31536000610d32536060610d33536000610d34536084610d3553605a610d36610fe05260536110005360606110015360f461100253606161100353600d61100453603761100553605361100653606061100753605061100853606161100953600d61100a53603861100b53605361100c53606061100d53605061100e53606161100f53600d61101053603961101153605361101253606161101353600d61101453603a6110155360606110165360006110175360f361101853600061101960006000f560006000600060006000855af25050",
        "storage": {},
        "balance": "0x0",
        "nonce": "0x0"
      },
      "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": {
        "code": "0x",
        "storage": {},
        "balance": "0xffffffffff",
        "nonce": "0x0"
      }
    },
    "transaction": {
      "gasPrice": "0x10",
      "nonce": "0x0",
      "to": "0x00000000000000000000000000000000000000f1",
      "data": [
        "0x98559320dd3b9f8b102c1081b8c6c1bbb1e017cbc2a9daf61fb051736511a676ea35e55586bb3880232ade2f326bd8ac3b948fdaaefeec5d5bd550c66d459fde9d5cdb"
      ],
      "gasLimit": [
        "0xc9db3a"
      ],
      "value": [
        "0x34c3"
      ],
      "sender": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
      "secretKey": "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8"
    },
    "out": "0x",
    "post": {
      "Cancun": [
        {
          "hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
          "logs": "0x0000000000000000000000000000000000000000000000000000000000000000",
          "indexes": {
            "data": 0,
            "gas": 0,
            "value": 0
          }
        }
      ]
    }
  }
}

The minimized testcase appears to trigger some odd behaviour on reth:

root@5e23720425c8:/#  /revme statetest --json /fuzztmp/00021077-mixed-77.json.min

Running tests in /fuzztmp/00021077-mixed-77.json.min.
.....
0/0Finished execution. Total CPU time: 0.000000s
All tests passed!

If I rename it from ....json.min to foo.json, then it behaves differently. @rakita does reth treat non-json file suffixes differently? If so, I need to modify how my minimizer works.

After renaming the file, the consensus split is: [geth, nethermind, besu, nimbus, erigon, evmone, reth] vs [ eels ]

rakita commented 3 months ago

.json files are filtered out, we can lose this check if the path is a file, have created a issue to fix it.

holiman commented 2 months ago

Fixed!