Skip to content

Commit

Permalink
add TODOs and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasxia01 committed Dec 9, 2024
1 parent fa045f2 commit 616fe1d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,9 @@ PairingPointAccumulatorIndices process_honk_recursion_constraints(
commitment_key, ipa_transcript_1, nested_ipa_claims[0], ipa_transcript_2, nested_ipa_claims[1]);
} else if (nested_ipa_claims.size() == 1) {
builder.add_ipa_claim(nested_ipa_claims[0].get_witness_indices());
builder.ipa_proof = convert_stdlib_proof_to_native(
nested_ipa_proofs[0]); // WORKTODO: is this bad? or is it fine to just pass the proofs along
// This conversion looks suspicious but there's no need to make this an output of the circuit since its a proof
// that will be checked anyway.
builder.ipa_proof = convert_stdlib_proof_to_native(nested_ipa_proofs[0]);
}
return current_aggregation_object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ void create_dummy_vkey_and_proof(Builder& builder,
// Set vkey->circuit_size correctly based on the proof size
size_t num_frs_comm = bb::field_conversion::calc_num_bn254_frs<typename Flavor::Commitment>();
size_t num_frs_fr = bb::field_conversion::calc_num_bn254_frs<typename Flavor::FF>();
// TODO(https://github.com/AztecProtocol/barretenberg/issues/1168): Add formula to flavor
assert((proof_size - bb::HONK_PROOF_PUBLIC_INPUT_OFFSET - Flavor::NUM_WITNESS_ENTITIES * num_frs_comm -
Flavor::NUM_ALL_ENTITIES * num_frs_fr - num_frs_comm) %
(num_frs_comm + num_frs_fr * (Flavor::BATCHED_RELATION_PARTIAL_LENGTH + 1)) ==
Expand Down Expand Up @@ -248,9 +249,10 @@ HonkRecursionConstraintOutput create_honk_recursion_constraints(
std::vector<field_ct> honk_proof = proof_fields;
HonkRecursionConstraintOutput output;
if (is_rollup_honk_recursion_constraint) {
// TODO(https://github.com/AztecProtocol/barretenberg/issues/1168): Add formula to flavor
const size_t HONK_PROOF_LENGTH = 473;
ASSERT(input.proof.size() ==
HONK_PROOF_LENGTH + 65); // WORKTODO: figure out how to not involve random constants
// The extra calculation is for the IPA proof length.
ASSERT(input.proof.size() == HONK_PROOF_LENGTH + 1 + 4 * (CONST_ECCVM_LOG_N) + 2 + 2);
ASSERT(proof_fields.size() == HONK_PROOF_LENGTH + 65 + input.public_inputs.size());
// split out the ipa proof
const std::ptrdiff_t honk_proof_with_pub_inputs_length =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ template <IsUltraFlavor Flavor> HonkProof UltraProver_<Flavor>::export_proof()
proof = transcript->proof_data;
// Add the IPA proof
if constexpr (HasIPAAccumulator<Flavor>) {
// The extra calculation is for the IPA proof length.
ASSERT(proving_key->proving_key.ipa_proof.size() == 1 + 4 * (CONST_ECCVM_LOG_N) + 2 + 2);
proof.insert(proof.end(), proving_key->proving_key.ipa_proof.begin(), proving_key->proving_key.ipa_proof.end());
}
Expand Down

0 comments on commit 616fe1d

Please sign in to comment.