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

Anvil's debug_traceTransaction behaviour differs from geth #3206

Closed
shekhirin opened this issue Sep 14, 2022 · 1 comment
Closed

Anvil's debug_traceTransaction behaviour differs from geth #3206

shekhirin opened this issue Sep 14, 2022 · 1 comment
Labels
C-anvil Command: anvil T-bug Type: bug

Comments

@shekhirin
Copy link
Contributor

shekhirin commented Sep 14, 2022

Component

Anvil

Describe the bug

As of 6e5a613, Anvil's debug_traceTransaction differs from geth in several places which are also on screenshots:

  1. Incorrect memory state during MSTORE It was fixed for Geth in ethereum/go-ethereum@97f308a but my RPC uses Erigon which doesn't have these changes and still does memory expansion before tracing: https://github.com/ledgerwatch/erigon/blob/cd8cad6a8908970fa092aa5e2dcd8f38aedccd89/core/vm/interpreter.go#L316-L323
  2. Remaining gas and instruction gas cost calculated incorrectly:
    // TODO: calculate spent gas as in `Debugger::step`
    step.gas_cost = step.gas - interp.gas.remaining();

image

image

@shekhirin shekhirin added the T-bug Type: bug label Sep 14, 2022
@gakonst gakonst added this to Foundry Sep 14, 2022
@gakonst gakonst moved this to Todo in Foundry Sep 14, 2022
@shekhirin shekhirin changed the title Anvil's debug_traceTransaction behaviour differences from geth Anvil's debug_traceTransaction behaviour differs from geth Sep 14, 2022
@rkrasiuk rkrasiuk added the C-anvil Command: anvil label Sep 14, 2022
@gakonst
Copy link
Member

gakonst commented Sep 15, 2022

Good catch. Yep we want this to be 1:1 compatible. cc @mattsse to keep this in mind for reth, we want byte compatibility I think with Geth RPC (esp. for debug_traceTransaction) and with Parity's tracing responses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-anvil Command: anvil T-bug Type: bug
Projects
Archived in project
Development

No branches or pull requests

3 participants