@@ -704,7 +704,7 @@ impl CircuitInputBuilder<FixedCParams> {
704704 geth_traces : & [ eth_types:: GethExecTrace ] ,
705705 ) -> Result < ( Option < ExecStep > , Option < Call > ) , Error > {
706706 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 ( ) ,
708708 "Fixed max_rws not enough for rws reserve"
709709 ) ;
710710
@@ -867,8 +867,8 @@ fn push_op<T: Op>(
867867}
868868
869869impl < 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 {
872872 // rw ops reserved for EndBlock
873873 let end_block_rws = if self . chunk_ctx . is_last_chunk ( ) && self . chunk_rws ( ) > 0 {
874874 1
@@ -910,7 +910,8 @@ impl<C: CircuitsParams> CircuitInputBuilder<C> {
910910 * 2
911911 + 4 ; // disabled and unused rows.
912912
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 ( ) ;
914915
915916 // Computing the number of rows for the EVM circuit requires the size of ExecStep,
916917 // which is determined in the code of zkevm-circuits and cannot be imported here.
0 commit comments