Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul-kothari committed Apr 4, 2023
1 parent 75b66d4 commit 095526f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ template <typename NCT> void read(uint8_t const*& it, MergeRollupPublicInputs<NC
read(it, obj.start_private_data_tree_snapshot);
read(it, obj.end_private_data_tree_snapshot);
read(it, obj.start_nullifier_tree_snapshot);
read(it, obj.end_nullifier_tree_snapshots);
read(it, obj.end_nullifier_tree_snapshot);
read(it, obj.start_contract_tree_snapshot);
read(it, obj.end_contract_tree_snapshot);
read(it, obj.calldata_hash);
Expand All @@ -67,7 +67,7 @@ template <typename NCT> void write(std::vector<uint8_t>& buf, MergeRollupPublicI
write(buf, obj.start_private_data_tree_snapshot);
write(buf, obj.end_private_data_tree_snapshot);
write(buf, obj.start_nullifier_tree_snapshot);
write(buf, obj.end_nullifier_tree_snapshots);
write(buf, obj.end_nullifier_tree_snapshot);
write(buf, obj.start_contract_tree_snapshot);
write(buf, obj.end_contract_tree_snapshot);
write(buf, obj.calldata_hash);
Expand All @@ -91,8 +91,8 @@ template <typename NCT> std::ostream& operator<<(std::ostream& os, MergeRollupPu
"start_nullifier_tree_snapshot:\n"
<< obj.start_nullifier_tree_snapshot
<< "\n"
"end_nullifier_tree_snapshots:\n"
<< obj.end_nullifier_tree_snapshots
"end_nullifier_tree_snapshot:\n"
<< obj.end_nullifier_tree_snapshot
<< "\n"
"start_contract_tree_snapshot:\n"
<< obj.start_contract_tree_snapshot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,14 @@ void assert_both_input_proofs_of_same_rollup_type(MergeRollupInputs mergeRollupI
{
assert(mergeRollupInputs.previous_rollup_data[0].merge_rollup_public_inputs.rollup_type ==
mergeRollupInputs.previous_rollup_data[1].merge_rollup_public_inputs.rollup_type);
(void)mergeRollupInputs;
}

void assert_equal_constants(ConstantRollupData left, ConstantRollupData right)
{
assert(left.base_rollup_vk_hash == right.base_rollup_vk_hash);
assert(left.merge_rollup_vk_hash == right.merge_rollup_vk_hash);
assert(left.private_kernel_vk_tree_root == right.private_kernel_vk_tree_root);
assert(left.public_kernel_vk_tree_root == right.public_kernel_vk_tree_root);
assert(left.start_tree_of_historic_private_data_tree_roots_snapshot ==
right.start_tree_of_historic_private_data_tree_roots_snapshot);
assert(left.start_tree_of_historic_contract_tree_roots_snapshot ==
right.start_tree_of_historic_contract_tree_roots_snapshot);
assert(left.tree_of_historic_l1_to_l2_msg_tree_roots_snapshot ==
right.tree_of_historic_l1_to_l2_msg_tree_roots_snapshot);
assert(left == right);
(void)left;
(void)right;
}

// function that does sha256 hash of the calldata from each previous rollup data
Expand Down Expand Up @@ -109,6 +103,13 @@ void ensure_prev_rollups_follow_on_from_each_other(MergeRollupInputs mergeRollup

assert(privateDataEndSnapshot0 == privateDataStartSnapshot1 && nullifierEndSnapshot0 == nullifierStartSnapshot1 &&
contractEndSnapshot0 == contractStartSnapshot1);
// void variables since despite using in assert, it says, "unused variable"
(void)privateDataEndSnapshot0;
(void)privateDataStartSnapshot1;
(void)nullifierEndSnapshot0;
(void)nullifierStartSnapshot1;
(void)contractEndSnapshot0;
(void)contractStartSnapshot1;
}

MergeRollupPublicInputs merge_rollup_circuit(MergeRollupInputs mergeRollupInputs)
Expand Down
7 changes: 3 additions & 4 deletions cpp/src/aztec3/circuits/rollup/merge/utils.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "aztec3/circuits/abis/rollup/base/base_rollup_public_inputs.hpp"
#include "aztec3/circuits/abis/rollup/merge/merge_rollup_inputs.hpp"
#include "aztec3/circuits/abis/rollup/merge/merge_rollup_public_inputs.hpp"
#include "aztec3/circuits/rollup/merge/utils.hpp"
#include "aztec3/constants.hpp"
#include "barretenberg/proof_system/verification_key/verification_key.hpp"
#include "index.hpp"
Expand Down Expand Up @@ -31,7 +30,7 @@ using aztec3::circuits::kernel::private_kernel::utils::dummy_previous_kernel_wit
using plonk::TurboComposer;
} // namespace

namespace aztec3::circuits::rollup::base::utils {
namespace aztec3::circuits::rollup::merge::utils {

// Helper method since MergeRollupInputs.PreviousRollupData can only take the type of `MergeRollupPublicInputs`
// So we convert the output of base to look like output of merge and add the `rollup_type` field.
Expand All @@ -57,7 +56,7 @@ PreviousRollupData<NT> dummy_previous_rollup_with_vk_proof()
{
// MergeInput requires base_rollup_public_inputs. So create a dummy BaseRollupInput object and pass it through the
// base rollup circuit.
auto emptyInputs = dummy_base_rollup_inputs_with_vk_proof();
auto emptyInputs = base::utils::dummy_base_rollup_inputs_with_vk_proof();
BaseRollupPublicInputs dummy_base_public_inputs =
aztec3::circuits::rollup::native_base_rollup::base_rollup_circuit(emptyInputs);

Expand All @@ -82,4 +81,4 @@ MergeRollupInputs<NT> dummy_merge_rollup_inputs_with_vk_proof()
dummy_previous_rollup_with_vk_proof() } };
return merge_rollup_inputs;
}
} // namespace aztec3::circuits::rollup::base::utils
} // namespace aztec3::circuits::rollup::merge::utils
3 changes: 2 additions & 1 deletion cpp/src/aztec3/circuits/rollup/merge/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ using aztec3::circuits::abis::MergeRollupPublicInputs;
using aztec3::circuits::abis::PreviousRollupData;
} // namespace

MergeRollupPublicInputs<NT> convert_base_public_inputs_to_merge_public_inputs(BaseRollupPublicInputs<NT>);
MergeRollupPublicInputs<NT> convert_base_public_inputs_to_merge_public_inputs(
BaseRollupPublicInputs<NT> baseRollupPublicInputs);
MergeRollupInputs<NT> dummy_merge_rollup_inputs_with_vk_proof();
PreviousRollupData<NT> dummy_previous_rollup_with_vk_proof();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ void assert_both_input_proofs_of_same_rollup_type(RootRollupInputs rootRollupInp
{
assert(rootRollupInputs.previous_rollup_data[0].merge_rollup_public_inputs.rollup_type ==
rootRollupInputs.previous_rollup_data[1].merge_rollup_public_inputs.rollup_type);
(void)rootRollupInputs;
}

bool is_constants_equal(ConstantRollupData left, ConstantRollupData right)
Expand Down

0 comments on commit 095526f

Please sign in to comment.