From ca56617ef144fc54c751912849cd37e5b20b4f17 Mon Sep 17 00:00:00 2001 From: Mason Liang Date: Sun, 19 Nov 2023 14:22:56 -0500 Subject: [PATCH] Only assign final row first time assign is called --- src/mpt.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mpt.rs b/src/mpt.rs index 12ce206c..1b024f71 100644 --- a/src/mpt.rs +++ b/src/mpt.rs @@ -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); }