@@ -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 ,
@@ -126,26 +126,32 @@ impl<F: Field> ExecutionGadget<F> for ErrorOOGCallGadget<F> {
126
126
let opcode = step. opcode ( ) . unwrap ( ) ;
127
127
let is_call_or_callcode =
128
128
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
+
132
138
let value = if is_call_or_callcode == 1 {
133
- block . get_rws ( step , 4 ) . stack_value ( )
139
+ rws . next ( ) . stack_value ( )
134
140
} else {
135
141
U256 :: zero ( )
136
142
} ;
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 ( ) ) ;
139
143
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
+
144
152
let callee_exists = !callee_code_hash. is_zero ( ) ;
145
153
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 ( ) ;
149
155
150
156
let memory_expansion_gas_cost = self . call . assign (
151
157
region,
0 commit comments