@@ -8,7 +8,7 @@ use crate::{
88 constraint_builder:: { ConstrainBuilderCommon , EVMConstraintBuilder } ,
99 math_gadget:: { IsZeroGadget , LtGadget } ,
1010 memory_gadget:: MemoryExpandedAddressGadget ,
11- or, CachedRegion , Cell ,
11+ or, CachedRegion , Cell , StepRws ,
1212 } ,
1313 } ,
1414 table:: CallContextFieldTag ,
@@ -126,26 +126,32 @@ impl<F: Field> ExecutionGadget<F> for ErrorOOGCallGadget<F> {
126126 let opcode = step. opcode ( ) . unwrap ( ) ;
127127 let is_call_or_callcode =
128128 usize:: from ( [ OpcodeId :: CALL , OpcodeId :: CALLCODE ] . contains ( & opcode) ) ;
129- let [ tx_id, is_static] =
130- [ 0 , 1 ] . map ( |index| block. get_rws ( step, index) . call_context_value ( ) ) ;
131- let [ gas, callee_address] = [ 2 , 3 ] . map ( |index| block. get_rws ( step, index) . stack_value ( ) ) ;
129+
130+ let mut rws = StepRws :: new ( block, step) ;
131+
132+ let tx_id = rws. next ( ) . call_context_value ( ) ;
133+ let is_static = rws. next ( ) . call_context_value ( ) ;
134+
135+ let gas = rws. next ( ) . stack_value ( ) ;
136+ let callee_address = rws. next ( ) . stack_value ( ) ;
137+
132138 let value = if is_call_or_callcode == 1 {
133- block . get_rws ( step , 4 ) . stack_value ( )
139+ rws . next ( ) . stack_value ( )
134140 } else {
135141 U256 :: zero ( )
136142 } ;
137- let [ cd_offset, cd_length, rd_offset, rd_length] =
138- [ 4 , 5 , 6 , 7 ] . map ( |i| block. get_rws ( step, is_call_or_callcode + i) . stack_value ( ) ) ;
139143
140- let callee_code_hash = block
141- . get_rws ( step, 9 + is_call_or_callcode)
142- . account_codehash_pair ( )
143- . 0 ;
144+ let cd_offset = rws. next ( ) . stack_value ( ) ;
145+ let cd_length = rws. next ( ) . stack_value ( ) ;
146+
147+ let rd_offset = rws. next ( ) . stack_value ( ) ;
148+ let rd_length = rws. next ( ) . stack_value ( ) ;
149+
150+ let callee_code_hash = rws. next ( ) . account_codehash_pair ( ) . 0 ;
151+
144152 let callee_exists = !callee_code_hash. is_zero ( ) ;
145153
146- let ( is_warm, is_warm_prev) = block
147- . get_rws ( step, 10 + is_call_or_callcode)
148- . tx_access_list_value_pair ( ) ;
154+ let ( is_warm, is_warm_prev) = rws. next ( ) . tx_access_list_value_pair ( ) ;
149155
150156 let memory_expansion_gas_cost = self . call . assign (
151157 region,
0 commit comments