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

Commit

Permalink
chores: renaming and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hero78119 committed Mar 15, 2024
1 parent fdd6e4a commit 87f2cb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
9 changes: 5 additions & 4 deletions bus-mapping/src/circuit_input_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ impl CircuitInputBuilder<FixedCParams> {
geth_traces: &[eth_types::GethExecTrace],
) -> Result<(Option<ExecStep>, Option<Call>), Error> {
assert!(
self.circuits_params.max_rws().unwrap_or_default() > self.rws_reserve(),
self.circuits_params.max_rws().unwrap_or_default() > self.last_exec_step_rws_reserved(),
"Fixed max_rws not enough for rws reserve"
);

Expand Down Expand Up @@ -867,8 +867,8 @@ fn push_op<T: Op>(
}

impl<C: CircuitsParams> CircuitInputBuilder<C> {
///
pub fn rws_reserve(&self) -> usize {
/// return the rw row reserved for end_block/end_chunk
pub fn last_exec_step_rws_reserved(&self) -> usize {
// rw ops reserved for EndBlock
let end_block_rws = if self.chunk_ctx.is_last_chunk() && self.chunk_rws() > 0 {
1
Expand Down Expand Up @@ -910,7 +910,8 @@ impl<C: CircuitsParams> CircuitInputBuilder<C> {
* 2
+ 4; // disabled and unused rows.

let max_rws = <RWCounter as Into<usize>>::into(self.block_ctx.rwc) - 1 + self.rws_reserve();
let max_rws = <RWCounter as Into<usize>>::into(self.block_ctx.rwc) - 1
+ self.last_exec_step_rws_reserved();

// Computing the number of rows for the EVM circuit requires the size of ExecStep,
// which is determined in the code of zkevm-circuits and cannot be imported here.
Expand Down
5 changes: 0 additions & 5 deletions zkevm-circuits/src/evm_circuit/util/constraint_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1872,11 +1872,6 @@ impl<'a, F: Field> EVMConstraintBuilder<'a, F> {
let cell = self.query_cell_with_type(cell_type);
self.in_next_step = in_next_step;

// cb.step_XXXXXXX(|cb| {cb.context_lookup()})

// gate1: step_first_selector * (lookup_cell.expr() == by_pass_expr()) == 0
// lookup_gate = lookup(by_pass_expr())

// Require the stored value to equal the value of the expression
let name = format!("{} (stored expression)", name);
self.push_constraint(
Expand Down

0 comments on commit 87f2cb8

Please sign in to comment.