Skip to content

Commit 30e1c40

Browse files
committed
Revert "Fix reservoir handling: restore state gas on revert/halt"
This reverts commit 1e1d64d.
1 parent 8891655 commit 30e1c40

1 file changed

Lines changed: 7 additions & 16 deletions

File tree

crates/handler/src/handler.rs

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -462,22 +462,13 @@ pub trait Handler {
462462
gas.record_refund(refunded);
463463
}
464464

465-
// Reservoir handling at the top-level frame:
466-
// - On success: use the frame's final reservoir as-is, state gas was consumed.
467-
// - On revert/halt: restore state gas spent back to the reservoir,
468-
// because state changes are rolled back so state gas should be refunded.
469-
//
470-
// Note: eth devnet3 does NOT do this — it ignores state_gas_spent and
471-
// unconditionally sets gas.set_reservoir(reservoir) regardless of the
472-
// instruction_result kind. This is a bug in the devnet3 spec.
473-
if instruction_result.is_ok() {
474-
gas.set_state_gas_spent(state_gas_spent);
475-
gas.set_reservoir(reservoir);
476-
} else {
477-
// State changes rolled back, so no execution state gas was consumed.
478-
gas.set_state_gas_spent(0);
479-
gas.set_reservoir(reservoir + state_gas_spent);
480-
}
465+
// Always track state gas spent regardless of outcome.
466+
gas.set_state_gas_spent(state_gas_spent);
467+
468+
// Reservoir handling at the top-level frame.
469+
// Use the frame's final reservoir directly — it already reflects
470+
// child frame restorations and any state gas consumed/spilled during execution.
471+
gas.set_reservoir(reservoir);
481472

482473
Ok(())
483474
}

0 commit comments

Comments
 (0)