From 0122b55686c78d4c40a20a5f60e9f5dfb0211ddf Mon Sep 17 00:00:00 2001 From: LHerskind Date: Wed, 6 Dec 2023 13:32:59 +0000 Subject: [PATCH] revert: revert modifications to base_rollup_inputs --- .../crates/rollup-lib/src/base/base_rollup_inputs.nr | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/yarn-project/noir-protocol-circuits/src/crates/rollup-lib/src/base/base_rollup_inputs.nr b/yarn-project/noir-protocol-circuits/src/crates/rollup-lib/src/base/base_rollup_inputs.nr index a662ce150900..a453771ce150 100644 --- a/yarn-project/noir-protocol-circuits/src/crates/rollup-lib/src/base/base_rollup_inputs.nr +++ b/yarn-project/noir-protocol-circuits/src/crates/rollup-lib/src/base/base_rollup_inputs.nr @@ -186,11 +186,9 @@ impl BaseRollupInputs { fn check_nullifier_tree_non_membership_and_insert_to_tree(self) -> AppendOnlyTreeSnapshot { let mut new_nullifiers = [0; MAX_NEW_NULLIFIERS_PER_BASE_ROLLUP]; - for i in 0..KERNELS_PER_BASE_ROLLUP { - let new_nullifiers_per_tx = self.kernel_data[i].public_inputs.end.new_nullifiers; - assert(new_nullifiers_per_tx.len() == MAX_NEW_NULLIFIERS_PER_TX, "New nullifiers in kernel data must be MAX_NEW_NULLIFIERS_PER_TX (see constants.hpp)"); + for i in 0..2 { for j in 0..MAX_NEW_NULLIFIERS_PER_TX { - new_nullifiers[i * MAX_NEW_NULLIFIERS_PER_TX + j] = new_nullifiers_per_tx[j]; + new_nullifiers[i * MAX_NEW_NULLIFIERS_PER_TX + j] = self.kernel_data[i].public_inputs.end.new_nullifiers[j]; } }; @@ -238,6 +236,10 @@ impl BaseRollupInputs { ) } + fn create_nullifier_subtree(self, leaves: [NullifierLeafPreimage; N]) -> Field { + calculate_subtree(leaves.map(|leaf:NullifierLeafPreimage| leaf.hash())) + } + fn validate_and_process_public_state(self) -> Field { // TODO(#2521) - data read validation should happen against the current state of the tx and not the start state. // Blocks all interesting usecases that read and write to the same public state in the same tx.