From 978cd43e70243b4df8cec6f645bd24782b5127f2 Mon Sep 17 00:00:00 2001 From: Suyash Bagad Date: Fri, 21 Apr 2023 14:06:42 +0000 Subject: [PATCH] Update bb submodule and perform related fixes in circuits. --- circuits/cpp/barretenberg | 2 +- .../base/nullifier_tree_testing_harness.cpp | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/circuits/cpp/barretenberg b/circuits/cpp/barretenberg index 274c8623f867..c974cdca18e0 160000 --- a/circuits/cpp/barretenberg +++ b/circuits/cpp/barretenberg @@ -1 +1 @@ -Subproject commit 274c8623f86794f7004ce5eef4e02f855af35eaa +Subproject commit c974cdca18e078acea7b94ea75bc9a6b46c1eb5e diff --git a/circuits/cpp/src/aztec3/circuits/rollup/base/nullifier_tree_testing_harness.cpp b/circuits/cpp/src/aztec3/circuits/rollup/base/nullifier_tree_testing_harness.cpp index 87806528439e..ff7522d60273 100644 --- a/circuits/cpp/src/aztec3/circuits/rollup/base/nullifier_tree_testing_harness.cpp +++ b/circuits/cpp/src/aztec3/circuits/rollup/base/nullifier_tree_testing_harness.cpp @@ -46,12 +46,12 @@ fr NullifierMemoryTreeTestingHarness::append_value(fr const& value) std::tie(current, is_already_present) = find_closest_leaf(leaves_, value); nullifier_leaf new_leaf = { .value = value, - .nextIndex = leaves_[current].nextIndex, - .nextValue = leaves_[current].nextValue }; + .nextIndex = leaves_[current].data->nextIndex, + .nextValue = leaves_[current].data->nextValue }; if (!is_already_present) { // Update the current leaf to point it to the new leaf - leaves_[current].nextIndex = leaves_.size(); - leaves_[current].nextValue = value; + leaves_[current].data->nextIndex = leaves_.size(); + leaves_[current].data->nextValue = value; // Insert the new leaf with (nextIndex, nextValue) of the current leaf leaves_.push_back(new_leaf); @@ -160,7 +160,10 @@ NullifierMemoryTreeTestingHarness::circuit_prep_batch_insert(std::vector con prev_nodes->second.push_back(new_value); } - nullifier_leaf low_nullifier = leaves_[current]; + nullifier_leaf low_nullifier; + if (leaves_[current].data.has_value()) { + low_nullifier = leaves_[current].data.value(); + } std::vector sibling_path = this->get_sibling_path(current); sibling_paths.push_back(sibling_path); @@ -197,8 +200,8 @@ std::pair NullifierMemoryTreeTestingHarness::find_lower( // TODO: handle is already present case if (!is_already_present) { - return std::make_pair(leaves_[current], current); + return std::make_pair(leaves_[current].data.value(), current); } else { - return std::make_pair(leaves_[current], current); + return std::make_pair(leaves_[current].data.value(), current); } } \ No newline at end of file