-
Notifications
You must be signed in to change notification settings - Fork 306
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: Client IVC API #10217
Merged
Merged
feat: Client IVC API #10217
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
58fad33
WIP exposing CIVC
codygunton 1960bdf
Fix common typo
codygunton 15b0ea4
Attaching attempt doesn't work
codygunton 96c9690
const
codygunton c263ba0
This works; next make robut
codygunton 6388a0b
Split out folding stack building
codygunton ec10320
Pare down writes
codygunton 410a829
Handle case of one circuit
codygunton cac38b5
revert typo
codygunton 2fbd248
Fix prove_then_verify
codygunton 28a9906
Merge remote-tracking branch 'origin/master' into cg/api-civc
codygunton 07cc89e
Fix after merge, resolving vk interface TODO
codygunton 202bd25
Merge remote-tracking branch 'origin/master' into cg/api-civc
codygunton dea89e0
Uniformize interface with flags var
codygunton ed993ca
remove bad debug launch
codygunton 52760b2
Client IVC unified
codygunton 9595f28
Merge branch 'master' into cg/api-civc
codygunton 361da96
Don't default --scheme
codygunton 6c721a2
bootstrap formatted
codygunton 4903b8d
Remove use of fold_and_verify; try to fix e2e
codygunton 6954daf
use _ not - in command line params
codygunton 902c4ec
Revert for bb.js
codygunton a67d8d6
delete stray log
codygunton ba6cd30
Update verify method ff call
codygunton 7c00eb1
Clean up
codygunton dab17b3
single_circuit is a compiletime_stack; dep mega flows
codygunton 57d602a
Comments
codygunton d7614e4
mega ~> civc in gh workflow
codygunton 26e3876
More mega removal
codygunton a6ce141
Skip failing compiletime folding tests
codygunton 7a1e22c
Skip ram_blowup_regression (redundant, needs more SRS)
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
# this flow is deprecated. currently it is bb.js only. for bb is is replaced by: | ||
# prove_and_verify --scheme client_ivc --input-type compiletime_stack | ||
VFLAG=${VERBOSE:+-v} | ||
|
||
$BIN fold_and_verify_program $VFLAG -c $CRS_PATH -b ./target/program.json |
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,9 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
VFLAG=${VERBOSE:+-v} | ||
INFLAG=${INPUT_TYPE=compiletime_stack} | ||
|
||
FLAGS="$CRS_PATH -b ./target/program.json $VFLAG --scheme client_ivc -c --input_type $INFLAG" | ||
|
||
$BIN prove_and_verify $FLAGS |
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
34 changes: 34 additions & 0 deletions
34
barretenberg/cpp/src/barretenberg/bb/acir_format_getters.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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#pragma once | ||
#include "barretenberg/bb/config.hpp" | ||
#include "barretenberg/bb/file_io.hpp" | ||
#include "barretenberg/bb/get_bytecode.hpp" | ||
#include "barretenberg/dsl/acir_format/acir_format.hpp" | ||
#include "barretenberg/dsl/acir_format/acir_to_constraint_buf.hpp" | ||
|
||
namespace bb { | ||
|
||
acir_format::WitnessVector get_witness(std::string const& witness_path) | ||
{ | ||
auto witness_data = get_bytecode(witness_path); | ||
return acir_format::witness_buf_to_witness_data(witness_data); | ||
} | ||
|
||
acir_format::AcirFormat get_constraint_system(std::string const& bytecode_path, bool honk_recursion) | ||
{ | ||
auto bytecode = get_bytecode(bytecode_path); | ||
return acir_format::circuit_buf_to_acir_format(bytecode, honk_recursion); | ||
} | ||
|
||
acir_format::WitnessVectorStack get_witness_stack(std::string const& witness_path) | ||
{ | ||
auto witness_data = get_bytecode(witness_path); | ||
return acir_format::witness_buf_to_witness_stack(witness_data); | ||
} | ||
|
||
std::vector<acir_format::AcirFormat> get_constraint_systems(std::string const& bytecode_path, bool honk_recursion) | ||
{ | ||
auto bytecode = get_bytecode(bytecode_path); | ||
return acir_format::program_buf_to_acir_format(bytecode, honk_recursion); | ||
} | ||
|
||
} // namespace bb |
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,39 @@ | ||
#pragma once | ||
#include <filesystem> | ||
|
||
namespace bb { | ||
|
||
class API { | ||
public: | ||
struct Flags { | ||
std::optional<std::string> output_type; // bytes, fields, bytes_and_fields, fields_msgpack | ||
std::optional<std::string> input_type; // compiletime_stack, runtime_stack | ||
}; | ||
|
||
virtual void prove(const Flags& flags, | ||
const std::filesystem::path& bytecode_path, | ||
const std::filesystem::path& witness_path, | ||
const std::filesystem::path& output_dir) = 0; | ||
|
||
virtual bool verify(const Flags& flags, | ||
const std::filesystem::path& proof_path, | ||
const std::filesystem::path& vk_path) = 0; | ||
|
||
virtual bool prove_and_verify(const Flags& flags, | ||
const std::filesystem::path& bytecode_path, | ||
const std::filesystem::path& witness_path) = 0; | ||
|
||
virtual void gates(const Flags& flags, | ||
const std::filesystem::path& bytecode_path, | ||
const std::filesystem::path& witness_path) = 0; | ||
|
||
virtual void contract(const Flags& flags, | ||
const std::filesystem::path& output_path, | ||
const std::filesystem::path& vk_path) = 0; | ||
|
||
virtual void to_fields(const Flags& flags, | ||
const std::filesystem::path& proof_path, | ||
const std::filesystem::path& vk_path, | ||
const std::filesystem::path& output_path) = 0; | ||
}; | ||
} // namespace bb |
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.
it would be great to have docs for each of this getter but not part of the focus of this PR.