Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
cheethas committed Apr 12, 2023
1 parent c150e7f commit 4019d9b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
6 changes: 4 additions & 2 deletions cpp/src/aztec3/circuits/rollup/base/.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,9 @@ TEST_F(base_rollup_tests, nullifier_tree_regression)
BaseRollupInputs empty_inputs = dummy_base_rollup_inputs_with_vk_proof();

// This test runs after some data has already been inserted into the tree
// TODO: explain data
// This test will pre-populate the tree with 24 values (0 item + 23 more) simulating that a rollup inserting two
// random values has already been performed. This rollup then adds two further random values that will end up having
// their low nullifiers point at each other
std::vector<fr> initial_values(23, 0);
for (size_t i = 0; i < 7; i++) {
initial_values[i] = i + 1;
Expand All @@ -493,7 +495,6 @@ TEST_F(base_rollup_tests, nullifier_tree_regression)
AppendOnlyTreeSnapshot<NT> nullifier_tree_start_snapshot = std::get<1>(inputs_and_snapshots);
AppendOnlyTreeSnapshot<NT> nullifier_tree_end_snapshot = std::get<2>(inputs_and_snapshots);

// We now have the correct tree - can debug in circuit
/**
* RUN
*/
Expand All @@ -512,6 +513,7 @@ TEST_F(base_rollup_tests, nullifier_tree_regression)
ASSERT_EQ(outputs.end_nullifier_tree_snapshot, nullifier_tree_end_snapshot);
}

// Note leaving this test here as there are no negative tests, even though it no longer passes
// TEST_F(base_rollup_tests, new_nullifier_tree_sparse_attack)
// {
// // @todo THIS SHOULD NOT BE PASSING. The circuit should fail with an assert as we are trying to double-spend.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,22 +291,13 @@ AppendOnlySnapshot check_nullifier_tree_non_membership_and_insert_to_tree(DummyC

// Witness containing index and path
auto nullifier_index = 4 * i + j;
info("nullifier index", nullifier_index);

// info(nullifier_insertion_subtree);

auto witness = baseRollupInputs.low_nullifier_membership_witness[nullifier_index];
// Preimage of the lo-index required for a non-membership proof
auto low_nullifier_preimage = baseRollupInputs.low_nullifier_leaf_preimages[nullifier_index];
// Newly created nullifier
auto nullifier = new_nullifiers[j];

// preimage
info("preimage");
info("value: ", low_nullifier_preimage.leaf_value);
info("next index: ", low_nullifier_preimage.next_index);
info("next value: ", low_nullifier_preimage.next_value);

// TODO: reason about this more strongly, can this cause issues?
if (nullifier != 0) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ NullifierMemoryTreeTestingHarness::circuit_prep_batch_insert(std::vector<fr> con
// Start insertion index
fr start_insertion_index = this->size();

info(values);

// Low nullifiers
std::vector<nullifier_leaf> low_nullifiers;
std::vector<nullifier_leaf> pending_insertion_tree;
Expand Down Expand Up @@ -105,10 +103,6 @@ NullifierMemoryTreeTestingHarness::circuit_prep_batch_insert(std::vector<fr> con
bool is_already_present;
std::tie(current, is_already_present) = find_closest_leaf(leaves_, new_value);

info("new value: ", new_value);
info("current");
info(current);

// If the inserted value is 0, then we ignore and provide a dummy low nullifier
if (new_value == 0) {
sibling_paths.push_back(empty_sp);
Expand Down

0 comments on commit 4019d9b

Please sign in to comment.