-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: clean up proof lengths and IPA #11020
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a4f5856
added formuli to ultra and ultra rollup flavors
lucasxia01 f7fd9c7
Merge remote-tracking branch 'origin/master' into lx/proof-formalas-i…
lucasxia01 01ddd05
clean up some IPA stuff
lucasxia01 e0e2c53
fix transcript tests to include ultrarollupflavor
lucasxia01 012bae5
fix test
lucasxia01 8a4699a
use the flavor proof lengths
lucasxia01 401b16e
fix tests
lucasxia01 25ca149
try again
lucasxia01 c57d9dc
try this fix
lucasxia01 4c5e373
fix prove_tube
lucasxia01 9fa667a
added proof length test to ultra transcript tests
lucasxia01 e8ea563
Merge remote-tracking branch 'origin/master' into lx/proof-formalas-i…
lucasxia01 ae4455d
Merge branch 'master' into lx/proof-formalas-in-flavor
codygunton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,9 +67,9 @@ class UltraFlavor { | |
// Note: made generic for use in MegaRecursive. | ||
template <typename FF> | ||
|
||
// List of relations reflecting the Ultra arithmetisation. WARNING: As UltraKeccak flavor inherits from Ultra flavor | ||
// any change of ordering in this tuple needs to be reflected in the smart contract, otherwise relation accumulation | ||
// will not match. | ||
// List of relations reflecting the Ultra arithmetisation. WARNING: As UltraKeccak flavor inherits from | ||
// Ultra flavor any change of ordering in this tuple needs to be reflected in the smart contract, otherwise | ||
// relation accumulation will not match. | ||
using Relations_ = std::tuple<bb::UltraArithmeticRelation<FF>, | ||
bb::UltraPermutationRelation<FF>, | ||
bb::LogDerivLookupRelation<FF>, | ||
|
@@ -97,6 +97,22 @@ class UltraFlavor { | |
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH = MAX_PARTIAL_RELATION_LENGTH + 1; | ||
static constexpr size_t NUM_RELATIONS = std::tuple_size_v<Relations>; | ||
|
||
// Proof length formula: | ||
// 1. HONK_PROOF_PUBLIC_INPUT_OFFSET are the circuit_size, num_public_inputs, pub_inputs_offset | ||
// 2. PAIRING_POINT_ACCUMULATOR_SIZE public inputs for pairing point accumulator | ||
// 3. NUM_WITNESS_ENTITIES commitments | ||
// 4. CONST_PROOF_SIZE_LOG_N sumcheck univariates | ||
// 5. NUM_ALL_ENTITIES sumcheck evaluations | ||
// 6. CONST_PROOF_SIZE_LOG_N Gemini Fold commitments | ||
// 7. CONST_PROOF_SIZE_LOG_N Gemini a evaluations | ||
// 8. KZG W commitment | ||
static constexpr size_t num_frs_comm = bb::field_conversion::calc_num_bn254_frs<Commitment>(); | ||
static constexpr size_t num_frs_fr = bb::field_conversion::calc_num_bn254_frs<FF>(); | ||
static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS = | ||
HONK_PROOF_PUBLIC_INPUT_OFFSET + NUM_WITNESS_ENTITIES * num_frs_comm + | ||
CONST_PROOF_SIZE_LOG_N * BATCHED_RELATION_PARTIAL_LENGTH * num_frs_fr + NUM_ALL_ENTITIES * num_frs_fr + | ||
CONST_PROOF_SIZE_LOG_N * num_frs_comm + CONST_PROOF_SIZE_LOG_N * num_frs_fr + num_frs_comm; | ||
|
||
template <size_t NUM_KEYS> | ||
using ProtogalaxyTupleOfTuplesOfUnivariatesNoOptimisticSkipping = | ||
decltype(create_protogalaxy_tuple_of_tuples_of_univariates<Relations, NUM_KEYS>()); | ||
|
@@ -537,7 +553,6 @@ class UltraFlavor { | |
* @brief A container for storing the partially evaluated multivariates produced by sumcheck. | ||
*/ | ||
class PartiallyEvaluatedMultivariates : public AllEntities<Polynomial> { | ||
|
||
public: | ||
PartiallyEvaluatedMultivariates() = default; | ||
PartiallyEvaluatedMultivariates(const size_t circuit_size) | ||
|
@@ -675,7 +690,7 @@ class UltraFlavor { | |
this->z_perm = commitments.z_perm; | ||
} | ||
} | ||
}; | ||
}; // namespace bb | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. delete |
||
// Specialize for Ultra (general case used in UltraRecursive). | ||
using VerifierCommitments = VerifierCommitments_<Commitment, VerificationKey>; | ||
|
||
|
16 changes: 16 additions & 0 deletions
16
barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_rollup_flavor.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,26 @@ | ||
#pragma once | ||
#include "barretenberg/commitment_schemes/ipa/ipa.hpp" | ||
#include "barretenberg/stdlib_circuit_builders/ultra_flavor.hpp" | ||
|
||
namespace bb { | ||
|
||
class UltraRollupFlavor : public bb::UltraFlavor { | ||
public: | ||
// Proof length formula: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. update comment |
||
// 1. HONK_PROOF_PUBLIC_INPUT_OFFSET are the circuit_size, num_public_inputs, pub_inputs_offset | ||
// 2. PAIRING_POINT_ACCUMULATOR_SIZE public inputs for pairing point accumulator | ||
// 3. IPA_CLAIM_SIZE public inputs for IPA claim | ||
// 4. NUM_WITNESS_ENTITIES commitments | ||
// 5. CONST_PROOF_SIZE_LOG_N sumcheck univariates | ||
// 6. NUM_ALL_ENTITIES sumcheck evaluations | ||
// 7. CONST_PROOF_SIZE_LOG_N Gemini Fold commitments | ||
// 8. CONST_PROOF_SIZE_LOG_N Gemini a evaluations | ||
// 9. KZG W commitment | ||
static constexpr size_t num_frs_comm = bb::field_conversion::calc_num_bn254_frs<Commitment>(); | ||
static constexpr size_t num_frs_fr = bb::field_conversion::calc_num_bn254_frs<FF>(); | ||
static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS = | ||
UltraFlavor::PROOF_LENGTH_WITHOUT_PUB_INPUTS + IPA_PROOF_LENGTH; | ||
|
||
using UltraFlavor::UltraFlavor; | ||
class ProvingKey : public UltraFlavor::ProvingKey { | ||
public: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
barretenberg_module(ultra_honk sumcheck) | ||
barretenberg_module(ultra_honk sumcheck stdlib_primitives) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update comment