-
Notifications
You must be signed in to change notification settings - Fork 234
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: new test program for verifying honk #6781
Conversation
Benchmark resultsNo metrics with a significant change found. Detailed resultsAll benchmarks are run on txs on the This benchmark source data is available in JSON format on S3 here. Proof generationEach column represents the number of threads used in proof generation.
L2 block published to L1Each column represents the number of txs on an L2 block published to L1.
L2 chain processingEach column represents the number of blocks on the L2 chain where each block has 16 txs.
Circuits statsStats on running time and I/O sizes collected for every kernel circuit run across all benchmarks.
Stats on running time collected for app circuits
Tree insertion statsThe duration to insert a fixed batch of leaves into each tree type.
MiscellaneousTransaction sizes based on how many contract classes are registered in the tx.
Transaction size based on fee payment method | Metric | | |
@@ -3,7 +3,7 @@ | |||
# BIN: to specify a different binary to test with (e.g. bb.js or bb.js-dev). | |||
set -eu | |||
|
|||
BIN=${BIN:-../cpp/build/bin/bb} | |||
BIN=${BIN:-../cpp/build-debug/bin/bb} |
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.
now that the debug build and standard build have diverged, I just changed this to debug, but maybe I can print out something that informs the user that the binary is defaulted to the debug version.
@@ -28,18 +28,15 @@ VFLAG=${VERBOSE:+-v} | |||
RFLAG=${RECURSIVE:+-r} | |||
|
|||
echo "Write VK to file for assert_statement..." | |||
$BIN write_vk_ultra_honk $VFLAG -c $CRS_PATH -o ./target/vk | |||
$BIN write_vk_ultra_honk $VFLAG -c $CRS_PATH -o ./target/honk_vk |
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.
just some name changes to separate it from the plonk vk and proof
@@ -732,8 +737,7 @@ template <IsUltraFlavor Flavor> void vk_as_fields_honk(const std::string& vk_pat | |||
|
|||
auto verification_key = std::make_shared<VerificationKey>(from_buffer<VerificationKey>(read_file(vk_path))); | |||
std::vector<bb::fr> data = verification_key->to_field_elements(); | |||
|
|||
auto json = vk_to_json(data); | |||
auto json = honk_vk_to_json(data); |
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.
fixing the vk generation for honk.
@@ -0,0 +1,21 @@ | |||
use dep::std; |
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.
new test program that verifies 1 honk proof recursively
@@ -115,6 +112,23 @@ std::array<uint32_t, HonkRecursionConstraint::AGGREGATION_OBJECT_SIZE> create_ho | |||
|
|||
// Recursively verify the proof | |||
auto vkey = std::make_shared<RecursiveVerificationKey>(builder, key_fields); | |||
if (!has_valid_witness_assignments) { |
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.
second fix: we must know what recursive verifier to generate without knowing the witnesses
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.
LGTM. Would be good to make these tests something more similar to double_verify_*
and double_verify_nested_*
as that follows the use case for recursion more closely.
// ASSERT(static_cast<uint32_t>(circuit_size.get_value()) == key->circuit_size); | ||
// ASSERT(static_cast<uint32_t>(public_input_size.get_value()) == key->num_public_inputs); | ||
// ASSERT(static_cast<uint32_t>(pub_inputs_offset.get_value()) == key->pub_inputs_offset); |
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.
// ASSERT(static_cast<uint32_t>(circuit_size.get_value()) == key->circuit_size); | |
// ASSERT(static_cast<uint32_t>(public_input_size.get_value()) == key->num_public_inputs); | |
// ASSERT(static_cast<uint32_t>(pub_inputs_offset.get_value()) == key->pub_inputs_offset); | |
ASSERT(static_cast<uint32_t>(circuit_size.get_value()) == key->circuit_size); | |
ASSERT(static_cast<uint32_t>(public_input_size.get_value()) == key->num_public_inputs); | |
ASSERT(static_cast<uint32_t>(pub_inputs_offset.get_value()) == key->pub_inputs_offset); |
Should we bring these back?
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.
no, they don't work anymore since the proof is garbage when the witnesses are not valid
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.
Then let's delete or pass in the has_valid_witness_params field
Adds a new test Noir program verify_honk_proof that takes in a honk proof and calls the honk recursive verifier. Fixes a couple of errors in the flow: we shouldn't be doing vkey hash stuff when processing the vkey anymore since taht isn't being attached, and we need to be able to figure out the proof size and public input size without having valid witnesses (for the write_vk_honk flow).
Adds a new test Noir program verify_honk_proof that takes in a honk proof and calls the honk recursive verifier. Fixes a couple of errors in the flow: we shouldn't be doing vkey hash stuff when processing the vkey anymore since taht isn't being attached, and we need to be able to figure out the proof size and public input size without having valid witnesses (for the write_vk_honk flow).
Adds a new test Noir program verify_honk_proof that takes in a honk proof and calls the honk recursive verifier.
Please read contributing guidelines and remove this line.