-
Notifications
You must be signed in to change notification settings - Fork 237
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
feat: Goblin acir composer #4112
Merged
Merged
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
a485b04
split honk acir composer from original
ledwards2225 44259ee
use accumulate framework for basic GUH
ledwards2225 735fd29
use accumulate nomenclature
ledwards2225 ebbc8f7
update to use accumulate nomenclature everywhere
ledwards2225 f95a12a
update docker files to use accumulate
ledwards2225 22bfac8
debug prints
ledwards2225 934e38a
full goblin verifies
ledwards2225 1402ef7
cleanup and commenting
ledwards2225 851d430
Add goblin flow to docker
ledwards2225 f370400
name change honk to goblin
ledwards2225 8c7ef97
Merge branch 'master' into lde/honk_acir_composer
ledwards2225 8fc65a4
fix wasm: create goblin acir composer
ledwards2225 d9f5b67
fix index ts formatting
ledwards2225 a05e3b4
removed grumpkin from the wrong flow
ledwards2225 d415de2
js flow for full goblin prove and verify
ledwards2225 4a14cdc
debug
ledwards2225 8b71f47
test faking it with accum methods
ledwards2225 a49026b
Merge branch 'master' into lde/honk_acir_composer
ledwards2225 52c52a2
WiP debug
ledwards2225 3c91cdc
Merge branch 'master' into lde/honk_acir_composer
ledwards2225 28c085c
bring it all together
ledwards2225 cad7ac7
Merge branch 'master' into lde/honk_acir_composer
ledwards2225 91fc81e
fix bberg and acir
ledwards2225 57af750
additional comments
ledwards2225 f8efa12
Merge branch 'master' into lde/honk_acir_composer
ledwards2225 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
6 changes: 6 additions & 0 deletions
6
barretenberg/acir_tests/flows/accumulate_and_verify_goblin.sh
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
VFLAG=${VERBOSE:+-v} | ||
|
||
$BIN accumulate_and_verify_goblin $VFLAG -c $CRS_PATH -b ./target/acir.gz |
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
68 changes: 68 additions & 0 deletions
68
barretenberg/cpp/src/barretenberg/dsl/acir_proofs/goblin_acir_composer.cpp
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#include "goblin_acir_composer.hpp" | ||
#include "barretenberg/common/throw_or_abort.hpp" | ||
#include "barretenberg/dsl/acir_format/acir_format.hpp" | ||
#include "barretenberg/dsl/types.hpp" | ||
#include "barretenberg/goblin/mock_circuits.hpp" | ||
|
||
namespace acir_proofs { | ||
|
||
GoblinAcirComposer::GoblinAcirComposer() {} | ||
|
||
void GoblinAcirComposer::create_circuit(acir_format::acir_format& constraint_system, | ||
acir_format::WitnessVector& witness) | ||
{ | ||
// Construct a builder using the witness and public input data from acir and with the goblin-owned op_queue | ||
builder_ = acir_format::GoblinBuilder{ | ||
goblin.op_queue, witness, constraint_system.public_inputs, constraint_system.varnum | ||
}; | ||
|
||
// Populate constraints in the builder via the data in constraint_system | ||
acir_format::build_constraints(builder_, constraint_system, true); | ||
|
||
// TODO(https://github.com/AztecProtocol/barretenberg/issues/817): Add some arbitrary op gates to ensure the | ||
// associated polynomials are non-zero and to give ECCVM and Translator some ECC ops to process. | ||
GoblinMockCircuits::construct_goblin_ecc_op_circuit(builder_); | ||
} | ||
|
||
std::vector<uint8_t> GoblinAcirComposer::accumulate() | ||
{ | ||
// // Construct a GUH proof for the circuit via the accumulate mechanism | ||
// return goblin.accumulate_for_acir(builder_); | ||
|
||
// Construct one final GUH proof via the accumulate mechanism | ||
std::vector<uint8_t> ultra_proof = goblin.accumulate_for_acir(builder_); | ||
|
||
// Construct a Goblin proof (ECCVM, Translator, Merge); result stored internally | ||
goblin.prove_for_acir(); | ||
|
||
return ultra_proof; | ||
} | ||
|
||
bool GoblinAcirComposer::verify_accumulator(std::vector<uint8_t> const& proof) | ||
{ | ||
return goblin.verify_accumulator_for_acir(proof); | ||
} | ||
|
||
std::vector<uint8_t> GoblinAcirComposer::accumulate_and_prove() | ||
{ | ||
// Construct one final GUH proof via the accumulate mechanism | ||
std::vector<uint8_t> ultra_proof = goblin.accumulate_for_acir(builder_); | ||
|
||
// Construct a Goblin proof (ECCVM, Translator, Merge); result stored internally | ||
goblin.prove_for_acir(); | ||
|
||
return ultra_proof; | ||
} | ||
|
||
bool GoblinAcirComposer::verify(std::vector<uint8_t> const& proof) | ||
{ | ||
// Verify the final GUH proof | ||
bool ultra_verified = goblin.verify_accumulator_for_acir(proof); | ||
|
||
// Verify the Goblin proof (ECCVM, Translator, Merge) | ||
bool goblin_verified = goblin.verify_for_acir(); | ||
|
||
return ultra_verified && goblin_verified; | ||
} | ||
|
||
} // namespace acir_proofs |
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.
You love to see it.