Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVMOne minor incompatibility #127

Closed
namiloh opened this issue Mar 6, 2024 · 3 comments
Closed

EVMOne minor incompatibility #127

namiloh opened this issue Mar 6, 2024 · 3 comments

Comments

@namiloh
Copy link
Contributor

namiloh commented Mar 6, 2024

root@a72fba356d78:/# /evmone --trace /fuzztmp/00161676-mixed-1.json.min 
Note: Google Test filter = -stCreateTest.CreateOOGafterMaxCodesize:stQuadraticComplexityTest.Call50000_sha256:stTimeConsuming.static_Call50000_sha256:stTimeConsuming.CALLBlake2f_MaxRounds:VMTests/vmPerformance.*:
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from /fuzztmp
[ RUN      ] /fuzztmp.00161676-mixed-1.json
unknown file: Failure
C++ exception with description "unexpected code with EOF prefix at 0x00000000000000000000000000000000000000f4" thrown in the test body.

[  FAILED  ] /fuzztmp.00161676-mixed-1.json (0 ms)
[----------] 1 test from /fuzztmp (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (0 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] /fuzztmp.00161676-mixed-1.json

testcase

{
  "00161676-mixed-1": {
    "env": {
      "currentCoinbase": "b94f5374fce5edbc8e2a8697c15331677e6ebf0b",
      "currentDifficulty": "0x200000",
      "currentRandom": "0x0000000000000000000000000000000000000000000000000000000000020000",
      "currentGasLimit": "0x26e1f476fe1e22",
      "currentNumber": "0x1",
      "currentTimestamp": "0x3e8",
      "previousHash": "0x044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d",
      "currentBaseFee": "0x10"
    },
    "pre": {
      "0x00000000000000000000000000000000000000f4": {
        "code": "0xef00",
        "storage": {},
        "balance": "0x0",
        "nonce": "0x0"
      }
    },
    "transaction": {
      "gasPrice": "0x10",
      "nonce": "0x0",
      "to": "0x00000000000000000000000000000000000000f1",
      "data": [
        "0x38"
      ],
      "gasLimit": [
        "0x0"
      ],
      "value": [
        "0x"
      ],
      "sender": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
      "secretKey": "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8"
    },
    "out": "0x",
    "post": {
      "Cancun": [
        {
          "hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
          "logs": "0x0000000000000000000000000000000000000000000000000000000000000000",
          "indexes": {
            "data": 0,
            "gas": 0,
            "value": 0
          }
        }
      ]
    }
  }
}

Geth accepts the state, and spits out a stateroot.

 /gethvm --json --noreturndata --nomemory statetest /fuzztmp/00161676-mixed-1.json.min
{"stateRoot": "0x53f6733a696cb3bbf77b635d96ace97f25ffee2d08d3e3d4ae1e566bfc060d6f"}
[
  {
    "name": "00161676-mixed-1",
    "pass": false,
    "stateRoot": "0x53f6733a696cb3bbf77b635d96ace97f25ffee2d08d3e3d4ae1e566bfc060d6f",
    "fork": "Cancun",
    "error": "unexpected error: intrinsic gas too low: have 0, want 21016"
  }
]
@holiman
Copy link
Owner

holiman commented Mar 6, 2024

@chfast is it intentional/to be expected behaviour that evmone rejects state with eof-code in it?

@chfast
Copy link
Contributor

chfast commented Mar 6, 2024

Yes, this is a test sanity check: there should be no deployed code with EOF prefix.

@holiman
Copy link
Owner

holiman commented Mar 22, 2024

Ok, added as expected failure, also added a workaround in #128 to prevent it from happening during fuzzing: dec3cf9

@holiman holiman closed this as completed Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants