as described here
paradigmxyz/reth#14783
we're incorrectly tracking refunds because revm's refund function returns the refund per call which can go negative.
but we want the total refund counter.
to fix this we need to change the type to an i64 because this can go negative:
|
/// Gas refund counter before step execution |
|
pub gas_refund_counter: u64, |
and move this
|
gas_refund_counter: interp.gas.refunded() as u64, |
to the step_end function, here:
|
step.gas_cost = step.gas_remaining.saturating_sub(interp.gas.remaining()); |
this now only tracks the refund snapshot on call level, so what we need to do on call_end is to compute the total refund counter by looking at the previous calls
|
fn fill_trace_on_call_end<DB: Database>( |
and compute the real refund counters
as described here
paradigmxyz/reth#14783
we're incorrectly tracking refunds because revm's refund function returns the refund per call which can go negative.
but we want the total refund counter.
to fix this we need to change the type to an i64 because this can go negative:
revm-inspectors/src/tracing/types.rs
Lines 674 to 675 in c847b12
and move this
revm-inspectors/src/tracing/mod.rs
Line 445 in c847b12
to the step_end function, here:
revm-inspectors/src/tracing/mod.rs
Line 519 in c847b12
this now only tracks the refund snapshot on call level, so what we need to do on
call_endis to compute the total refund counter by looking at the previous callsrevm-inspectors/src/tracing/mod.rs
Line 341 in c847b12
and compute the real refund counters