Skip to content

Commit

Permalink
fix: remove embedded srs (#5173)
Browse files Browse the repository at this point in the history
Removes the embedding of the ignition srs in the dockerfile in favor of calling/downloading directly within bb.

Streamlines the bb-avm interface as we don't need the crs path anymore
  • Loading branch information
IlyasRidhuan authored Mar 13, 2024
1 parent aa90f6e commit cfd673d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 17 deletions.
3 changes: 2 additions & 1 deletion barretenberg/cpp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ src/wasi-sdk-*
src/barretenberg/proof_system/proving_key/fixtures
src/barretenberg/rollup/proofs/*/fixtures
srs_db/*/*/transcript*
srs_db/*/bn254_g*
CMakeUserPresets.json
.vscode/settings.json
acir_tests
# we may download go in scripts/collect_heap_information.sh
go*.tar.gz
barretenberg_modules.dot
barretenberg_modules.png
barretenberg_modules.png
7 changes: 3 additions & 4 deletions barretenberg/cpp/src/barretenberg/bb/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ void acvm_info(const std::string& output_path)
*/
void avm_prove(const std::filesystem::path& bytecode_path,
const std::filesystem::path& calldata_path,
const std::string& crs_path,
const std::filesystem::path& output_path)
{
// Get Bytecode
Expand All @@ -485,7 +484,8 @@ void avm_prove(const std::filesystem::path& bytecode_path,
}
std::vector<fr> const call_data = many_from_buffer<fr>(call_data_bytes);

srs::init_crs_factory(crs_path);
// Hardcoded circuit size for now
init_bn254_crs(256);

// Prove execution and return vk
auto const [verification_key, proof] = avm_trace::Execution::prove(avm_bytecode, call_data);
Expand Down Expand Up @@ -601,9 +601,8 @@ int main(int argc, char* argv[])
} else if (command == "avm_prove") {
std::filesystem::path avm_bytecode_path = get_option(args, "-b", "./target/avm_bytecode.bin");
std::filesystem::path calldata_path = get_option(args, "-d", "./target/call_data.bin");
std::string crs_path = get_option(args, "-c", "../srs_db/ignition");
std::filesystem::path output_path = get_option(args, "-o", "./proofs/avm_proof");
avm_prove(avm_bytecode_path, calldata_path, crs_path, output_path);
avm_prove(avm_bytecode_path, calldata_path, output_path);
} else if (command == "avm_verify") {
std::filesystem::path proof_path = get_option(args, "-p", "./proofs/avm_proof");
return avm_verify(proof_path) ? 0 : 1;
Expand Down
4 changes: 0 additions & 4 deletions yarn-project/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ COPY --from=noir-projects /usr/src/noir-projects /usr/src/noir-projects
COPY --from=noir /usr/src/noir/noir-repo/target/release/acvm /usr/src/noir/noir-repo/target/release/acvm
COPY --from=barretenberg /usr/src/barretenberg/cpp/build/bin/bb /usr/src/barretenberg/cpp/build/bin/bb

COPY --from=barretenberg /usr/src/barretenberg/cpp/srs_db/ /usr/src/barretenberg/cpp/srs_db/
WORKDIR /usr/src/barretenberg/cpp/srs_db
RUN ./download_ignition.sh 0

WORKDIR /usr/src/yarn-project
COPY . .

Expand Down
4 changes: 0 additions & 4 deletions yarn-project/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ COPY --from=contracts /usr/src/l1-contracts /usr/src/l1-contracts
COPY --from=noir-projects /usr/src/noir-projects /usr/src/noir-projects
COPY --from=barretenberg /usr/src/barretenberg/cpp/build/bin/bb /usr/src/barretenberg/cpp/build/bin/bb

COPY --from=barretenberg /usr/src/barretenberg/cpp/srs_db/ /usr/src/barretenberg/cpp/srs_db/
WORKDIR /usr/src/barretenberg/cpp/srs_db
RUN ./download_ignition.sh 0

WORKDIR /usr/src/yarn-project
COPY . .

Expand Down
4 changes: 0 additions & 4 deletions yarn-project/simulator/src/public/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,6 @@ export class PublicExecutor {
*/
public async getAvmProof(avmExecution: PublicExecution): Promise<Buffer[]> {
// The paths for the barretenberg binary and the write path are hardcoded for now.
// We additionally need the path to a valid crs for proof generation.
// const bbPath = '../../barretenberg/cpp';
const bbPath = path.resolve('../../barretenberg/cpp');
const artifactsPath = path.resolve('target');

Expand Down Expand Up @@ -283,8 +281,6 @@ export class PublicExecutor {
bytecodePath,
'-d',
calldataPath,
'-c',
path.join(bbPath, 'srs_db', 'ignition'),
'-o',
proofPath,
]);
Expand Down

0 comments on commit cfd673d

Please sign in to comment.