@@ -704,7 +704,7 @@ impl CircuitInputBuilder<FixedCParams> {
704
704
geth_traces : & [ eth_types:: GethExecTrace ] ,
705
705
) -> Result < ( Option < ExecStep > , Option < Call > ) , Error > {
706
706
assert ! (
707
- self . circuits_params. max_rws( ) . unwrap_or_default( ) > self . rws_reserve ( ) ,
707
+ self . circuits_params. max_rws( ) . unwrap_or_default( ) > self . last_exec_step_rws_reserved ( ) ,
708
708
"Fixed max_rws not enough for rws reserve"
709
709
) ;
710
710
@@ -867,8 +867,8 @@ fn push_op<T: Op>(
867
867
}
868
868
869
869
impl < C : CircuitsParams > CircuitInputBuilder < C > {
870
- ///
871
- pub fn rws_reserve ( & self ) -> usize {
870
+ /// return the rw row reserved for end_block/end_chunk
871
+ pub fn last_exec_step_rws_reserved ( & self ) -> usize {
872
872
// rw ops reserved for EndBlock
873
873
let end_block_rws = if self . chunk_ctx . is_last_chunk ( ) && self . chunk_rws ( ) > 0 {
874
874
1
@@ -910,7 +910,8 @@ impl<C: CircuitsParams> CircuitInputBuilder<C> {
910
910
* 2
911
911
+ 4 ; // disabled and unused rows.
912
912
913
- let max_rws = <RWCounter as Into < usize > >:: into ( self . block_ctx . rwc ) - 1 + self . rws_reserve ( ) ;
913
+ let max_rws = <RWCounter as Into < usize > >:: into ( self . block_ctx . rwc ) - 1
914
+ + self . last_exec_step_rws_reserved ( ) ;
914
915
915
916
// Computing the number of rows for the EVM circuit requires the size of ExecStep,
916
917
// which is determined in the code of zkevm-circuits and cannot be imported here.
0 commit comments