Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.

Commit 87f2cb8

Browse files
committed
chores: renaming and cleanup
1 parent fdd6e4a commit 87f2cb8

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

bus-mapping/src/circuit_input_builder.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -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

869869
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 {
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.

zkevm-circuits/src/evm_circuit/util/constraint_builder.rs

-5
Original file line numberDiff line numberDiff line change
@@ -1872,11 +1872,6 @@ impl<'a, F: Field> EVMConstraintBuilder<'a, F> {
18721872
let cell = self.query_cell_with_type(cell_type);
18731873
self.in_next_step = in_next_step;
18741874

1875-
// cb.step_XXXXXXX(|cb| {cb.context_lookup()})
1876-
1877-
// gate1: step_first_selector * (lookup_cell.expr() == by_pass_expr()) == 0
1878-
// lookup_gate = lookup(by_pass_expr())
1879-
18801875
// Require the stored value to equal the value of the expression
18811876
let name = format!("{} (stored expression)", name);
18821877
self.push_constraint(

0 commit comments

Comments
 (0)