@@ -8,7 +8,7 @@ use crate::{
8
8
constraint_builder:: { ConstrainBuilderCommon , EVMConstraintBuilder } ,
9
9
math_gadget:: { IsZeroGadget , LtGadget } ,
10
10
memory_gadget:: MemoryExpandedAddressGadget ,
11
- or, CachedRegion , Cell ,
11
+ or, CachedRegion , Cell , StepRws ,
12
12
} ,
13
13
} ,
14
14
table:: CallContextFieldTag ,
@@ -127,26 +127,30 @@ impl<F: Field> ExecutionGadget<F> for ErrorOOGCallGadget<F> {
127
127
let opcode = step. opcode ( ) . unwrap ( ) ;
128
128
let is_call_or_callcode =
129
129
usize:: from ( [ OpcodeId :: CALL , OpcodeId :: CALLCODE ] . contains ( & opcode) ) ;
130
- let [ tx_id, is_static] =
131
- [ 0 , 1 ] . map ( |index| block. get_rws ( step, index) . call_context_value ( ) ) ;
132
- let [ gas, callee_address] = [ 2 , 3 ] . map ( |index| block. get_rws ( step, index) . stack_value ( ) ) ;
130
+
131
+ let mut rws = StepRws :: new ( block, step) ;
132
+
133
+ let tx_id = rws. next ( ) . call_context_value ( ) ;
134
+ let is_static = rws. next ( ) . call_context_value ( ) ;
135
+ let gas = rws. next ( ) . stack_value ( ) ;
136
+ let callee_address = rws. next ( ) . stack_value ( ) ;
137
+
133
138
let value = if is_call_or_callcode == 1 {
134
- block . get_rws ( step , 4 ) . stack_value ( )
139
+ rws . next ( ) . stack_value ( )
135
140
} else {
136
141
U256 :: zero ( )
137
142
} ;
138
- let [ cd_offset, cd_length, rd_offset, rd_length] =
139
- [ 4 , 5 , 6 , 7 ] . map ( |i| block. get_rws ( step, is_call_or_callcode + i) . stack_value ( ) ) ;
140
143
141
- let callee_code_hash = block
142
- . get_rws ( step, 9 + is_call_or_callcode)
143
- . account_codehash_pair ( )
144
- . 0 ;
145
- let callee_exists = !callee_code_hash. is_zero ( ) ;
144
+ let cd_offset = rws. next ( ) . stack_value ( ) ;
145
+ let cd_length = rws. next ( ) . stack_value ( ) ;
146
+ let rd_offset = rws. next ( ) . stack_value ( ) ;
147
+ let rd_length = rws. next ( ) . stack_value ( ) ;
148
+
149
+ rws. offset_add ( 1 ) ;
146
150
147
- let ( is_warm , is_warm_prev ) = block
148
- . get_rws ( step , 10 + is_call_or_callcode )
149
- . tx_access_list_value_pair ( ) ;
151
+ let callee_code_hash = rws . next ( ) . account_codehash_pair ( ) . 0 ;
152
+ let callee_exists = !callee_code_hash . is_zero ( ) ;
153
+ let ( is_warm , is_warm_prev ) = rws . next ( ) . tx_access_list_value_pair ( ) ;
150
154
151
155
let memory_expansion_gas_cost = self . call . assign (
152
156
region,
0 commit comments