reported: paradigmxyz/reth#10959
we use incorrect gasCost value:
|
cost: interp.gas.spent(), |
this should be gas cost of the opcode:
https://github.com/ethereum/go-ethereum/blob/0dd173a727dd2d2409b8e401b22e85d20c25b71f/core/vm/interpreter.go#L237-L237
this becomes a bit tricky for dynamic gas, because we don't know how much gas the opcode will cost if we call the tracer in the step fn, only if we track and call it on step_end.
see also:
|
let gas_cost = gas_remaining.saturating_sub(interp.gas().remaining()); |
so we'd need to move this call to step_end, but this messes with memory because the tracer should be called with mem before opcode I believe...
I don't think there's an easier way to get this than doing
step: gas_remaining
step_end: gas_remaining - spent
@rakita
reported: paradigmxyz/reth#10959
we use incorrect gasCost value:
revm-inspectors/src/tracing/js/mod.rs
Line 401 in 0648673
this should be gas cost of the opcode:
https://github.com/ethereum/go-ethereum/blob/0dd173a727dd2d2409b8e401b22e85d20c25b71f/core/vm/interpreter.go#L237-L237
this becomes a bit tricky for dynamic gas, because we don't know how much gas the opcode will cost if we call the tracer in the
stepfn, only if we track and call it on step_end.see also:
revm-inspectors/src/opcode.rs
Line 78 in 0648673
so we'd need to move this call to step_end, but this messes with memory because the tracer should be called with mem before opcode I believe...
I don't think there's an easier way to get this than doing
step: gas_remaining
step_end: gas_remaining - spent
@rakita