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: missing specific error string for OOG in check_memory #2745

Open
Sixtysixter opened this issue Feb 22, 2025 · 0 comments
Open

evmone: missing specific error string for OOG in check_memory #2745

Sixtysixter opened this issue Feb 22, 2025 · 0 comments

Comments

@Sixtysixter
Copy link
Contributor

Sixtysixter commented Feb 22, 2025

Calling

{
  "jsonrpc":"2.0",
  "method":"debug_traceTransaction",
  "params":[
     "0x2a4e49c20034492eabf4a82d50994e3c49ecc1ee733d189059304c1e285305ab",
     {"disableStorage": true,"disableMemory": true,"disableStack": true}
  ],
  "id":1
}

the silkworm RPC JSON result differs from erigon in the trace error field for opcode CODECOPY at PC 70 (the last one).
That's due to the check made in check_memory.

The size value passed to check_memory is

[0] = 6148606209921031844
[1] = 744862842900218413
[2] = 2901806814
[3] = 0

that does not fit into uint64_t type. The check_memory function returns false and so codecopy function returns the status code EVMC_OUT_OF_GAS. We would need to receive also an error string indicating the specific reason for the OOG error.

Current JSON result:

     {
        "depth": 1,
        "error": "out of gas",
        "gas": 426354,
        "gasCost": 3,
        "op": "CODECOPY",
        "pc": 70
     }

Expected JSON result:

      {
        "depth": 1,
        "error": "gas uint64 overflow",
        "gas": 426354,
        "gasCost": 3,
        "op": "CODECOPY",
        "pc": 70
      }

See also skipped integration tests in #2754

@canepat canepat changed the title evmone doent't return the right failure code from check_memory func evmone: missing specific error string for OOG in check_memory Feb 26, 2025
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

1 participant