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

Commit ac68a13

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

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

bus-mapping/src/circuit_input_builder.rs

Lines changed: 5 additions & 4 deletions
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

Lines changed: 0 additions & 5 deletions
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(

zkevm-circuits/src/root_circuit.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,17 @@ struct SuperCircuitInstance<T> {
6363
pub sc_permu_alpha: T,
6464
pub sc_permu_gamma: T,
6565
pub sc_rwtable_row_prev_fingerprint: T,
66-
pub sc_rwtable_row_next_fingerprint: T,
66+
pub sc_rwtable_row_curr_fingerprint: T,
6767
pub sc_rwtable_prev_fingerprint: T,
68-
pub sc_rwtable_next_fingerprint: T,
68+
pub sc_rwtable_curr_fingerprint: T,
6969

7070
// evm circuit
7171
pub ec_permu_alpha: T,
7272
pub ec_permu_gamma: T,
7373
pub ec_rwtable_row_prev_fingerprint: T,
74-
pub ec_rwtable_row_next_fingerprint: T,
74+
pub ec_rwtable_row_curr_fingerprint: T,
7575
pub ec_rwtable_prev_fingerprint: T,
76-
pub ec_rwtable_next_fingerprint: T,
76+
pub ec_rwtable_curr_fingerprint: T,
7777
}
7878

7979
impl<T: Clone + Copy> SuperCircuitInstance<T> {
@@ -91,15 +91,15 @@ impl<T: Clone + Copy> SuperCircuitInstance<T> {
9191
sc_permu_alpha: iter_instances.next().unwrap(),
9292
sc_permu_gamma: iter_instances.next().unwrap(),
9393
sc_rwtable_row_prev_fingerprint: iter_instances.next().unwrap(),
94-
sc_rwtable_row_next_fingerprint: iter_instances.next().unwrap(),
94+
sc_rwtable_row_curr_fingerprint: iter_instances.next().unwrap(),
9595
sc_rwtable_prev_fingerprint: iter_instances.next().unwrap(),
96-
sc_rwtable_next_fingerprint: iter_instances.next().unwrap(),
96+
sc_rwtable_curr_fingerprint: iter_instances.next().unwrap(),
9797
ec_permu_alpha: iter_instances.next().unwrap(),
9898
ec_permu_gamma: iter_instances.next().unwrap(),
9999
ec_rwtable_row_prev_fingerprint: iter_instances.next().unwrap(),
100-
ec_rwtable_row_next_fingerprint: iter_instances.next().unwrap(),
100+
ec_rwtable_row_curr_fingerprint: iter_instances.next().unwrap(),
101101
ec_rwtable_prev_fingerprint: iter_instances.next().unwrap(),
102-
ec_rwtable_next_fingerprint: iter_instances.next().unwrap(),
102+
ec_rwtable_curr_fingerprint: iter_instances.next().unwrap(),
103103
}
104104
}
105105
}
@@ -401,13 +401,13 @@ where
401401
instance_i_plus_one.sc_permu_gamma.assigned(),
402402
),
403403
(
404-
instance_i.sc_rwtable_row_next_fingerprint.assigned(),
404+
instance_i.sc_rwtable_row_curr_fingerprint.assigned(),
405405
instance_i_plus_one
406406
.sc_rwtable_row_prev_fingerprint
407407
.assigned(),
408408
),
409409
(
410-
instance_i.sc_rwtable_next_fingerprint.assigned(),
410+
instance_i.sc_rwtable_curr_fingerprint.assigned(),
411411
instance_i_plus_one.sc_rwtable_prev_fingerprint.assigned(),
412412
),
413413
// evm circuit
@@ -420,11 +420,11 @@ where
420420
instance_i_plus_one.ec_permu_gamma.assigned(),
421421
),
422422
(
423-
instance_i.ec_rwtable_next_fingerprint.assigned(),
423+
instance_i.ec_rwtable_curr_fingerprint.assigned(),
424424
instance_i_plus_one.ec_rwtable_prev_fingerprint.assigned(),
425425
),
426426
(
427-
instance_i.ec_rwtable_row_next_fingerprint.assigned(),
427+
instance_i.ec_rwtable_row_curr_fingerprint.assigned(),
428428
instance_i_plus_one
429429
.ec_rwtable_row_prev_fingerprint
430430
.assigned(),

0 commit comments

Comments
 (0)