File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments