Skip to content

Commit

Permalink
Only assign final row first time assign is called
Browse files Browse the repository at this point in the history
  • Loading branch information
Mason Liang committed Nov 27, 2023
1 parent 93d15eb commit ca56617
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/mpt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,17 @@ impl MptCircuitConfig {
let randomness = self.rlc_randomness.value(layouter);
let (u32s, u64s, u128s, frs) = byte_representations(proofs);

let mut is_first_call = true;

layouter.assign_region(
|| "mpt circuit",
|mut region| {
move |mut region| {
if is_first_call {
is_first_call = false;
self.selector.enable(&mut region, n_rows - 1);
return Ok(())
}

for offset in 1..n_rows {
self.selector.enable(&mut region, offset);
}
Expand Down

0 comments on commit ca56617

Please sign in to comment.