From 708b05ca6638dc0d6ca7cb34fb8de76665a43b58 Mon Sep 17 00:00:00 2001 From: kevaundray Date: Tue, 22 Aug 2023 22:36:25 +0100 Subject: [PATCH 1/4] fix: proving fails when circuit has size > ~500K (#1739) resolve #1737 # Checklist: Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge. - [ ] If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag. - [ ] I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code. - [ ] Every change is related to the PR description. - [ ] I have [linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) this pull request to relevant issues (if any exist). --- circuits/cpp/barretenberg/cpp/src/barretenberg/bb/main.cpp | 7 +++++-- circuits/cpp/barretenberg/ts/src/main.ts | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/bb/main.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/bb/main.cpp index 9b3764a1b92d..506341e1849e 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/bb/main.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/bb/main.cpp @@ -11,8 +11,11 @@ #include using namespace barretenberg; - -uint32_t MAX_CIRCUIT_SIZE = 1 << 19; +// The maximum size that we can do in the browser is 2^19 +// based on memory constraints for UltraPlonk. +// However, since this will be ran natively, we can increase the +// size. +uint32_t MAX_CIRCUIT_SIZE = 1 << 23; std::string CRS_PATH = "./crs"; bool verbose = false; diff --git a/circuits/cpp/barretenberg/ts/src/main.ts b/circuits/cpp/barretenberg/ts/src/main.ts index e70bedd121e7..eecda39aa0aa 100755 --- a/circuits/cpp/barretenberg/ts/src/main.ts +++ b/circuits/cpp/barretenberg/ts/src/main.ts @@ -8,8 +8,8 @@ import { Command } from 'commander'; createDebug.log = console.error.bind(console); const debug = createDebug('bb.js'); -// Maximum we support. -const MAX_CIRCUIT_SIZE = 2 ** 19; +// Maximum we support natively. It is 2^19 for browser. +const MAX_CIRCUIT_SIZE = 2 ** 23; function getBytecode(bytecodePath: string) { const encodedCircuit = readFileSync(bytecodePath, 'utf-8'); From d65be217eb089eb5930ff375ae5b2b433cd58b3e Mon Sep 17 00:00:00 2001 From: AztecBot Date: Tue, 22 Aug 2023 21:36:49 +0000 Subject: [PATCH 2/4] git subrepo push --branch=master circuits/cpp/barretenberg subrepo: subdir: "circuits/cpp/barretenberg" merged: "6d323838a" upstream: origin: "https://github.com/AztecProtocol/barretenberg" branch: "master" commit: "6d323838a" git-subrepo: version: "0.4.6" origin: "???" commit: "???" --- circuits/cpp/barretenberg/.gitrepo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circuits/cpp/barretenberg/.gitrepo b/circuits/cpp/barretenberg/.gitrepo index be5a43a440da..4d9c31d52bef 100644 --- a/circuits/cpp/barretenberg/.gitrepo +++ b/circuits/cpp/barretenberg/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/AztecProtocol/barretenberg branch = master - commit = 65a38bc045c66c5f64e87ba8c6e446945f2f0a24 - parent = a931e077f2efac2aaa50c5336ead87a0e87a813e + commit = 6d323838a525190618d608598357ee4608c46699 + parent = 708b05ca6638dc0d6ca7cb34fb8de76665a43b58 method = merge cmdver = 0.4.6 From 899b05557365a5bf97e64793dd563a1b4bfa0f3f Mon Sep 17 00:00:00 2001 From: kevaundray Date: Tue, 22 Aug 2023 23:07:01 +0100 Subject: [PATCH 3/4] fix: Download SRS using one canonical URL across the codebase (#1748) resolves #1747 # Checklist: Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge. - [ ] If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag. - [ ] I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code. - [ ] Every change is related to the PR description. - [ ] I have [linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) this pull request to relevant issues (if any exist). --- .../cpp/barretenberg/cpp/src/barretenberg/bb/get_crs.hpp | 4 ++-- circuits/cpp/barretenberg/ts/src/crs/net_crs.ts | 4 ++-- yarn-project/circuits.js/src/crs/index.ts | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/bb/get_crs.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/bb/get_crs.hpp index b85749209d38..cfc8fc59c5b7 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/bb/get_crs.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/bb/get_crs.hpp @@ -20,10 +20,10 @@ inline std::vector download_g1_data(size_t num_points) inline std::vector download_g2_data() { - size_t g2_start = 28 + 5040000 * 64; + size_t g2_start = 28 + 5040001 * 64; size_t g2_end = g2_start + 128 - 1; std::string command = "curl -s -H \"Range: bytes=" + std::to_string(g2_start) + "-" + std::to_string(g2_end) + - "\" 'https://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/sealed/transcript00.dat'"; + "\" 'https://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/monomial/transcript00.dat'"; return exec_pipe(command); } diff --git a/circuits/cpp/barretenberg/ts/src/crs/net_crs.ts b/circuits/cpp/barretenberg/ts/src/crs/net_crs.ts index 8a46fb48cb93..203968499248 100644 --- a/circuits/cpp/barretenberg/ts/src/crs/net_crs.ts +++ b/circuits/cpp/barretenberg/ts/src/crs/net_crs.ts @@ -38,10 +38,10 @@ export class NetCrs { * Download the G2 points data. */ async downloadG2Data() { - const g2Start = 28 + 5040000 * 64; + const g2Start = 28 + 5040001 * 64; const g2End = g2Start + 128 - 1; - const response2 = await fetch('https://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/sealed/transcript00.dat', { + const response2 = await fetch('https://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/monomial/transcript00.dat', { headers: { Range: `bytes=${g2Start}-${g2End}`, }, diff --git a/yarn-project/circuits.js/src/crs/index.ts b/yarn-project/circuits.js/src/crs/index.ts index ca2c6701ff50..41355990cc7d 100644 --- a/yarn-project/circuits.js/src/crs/index.ts +++ b/yarn-project/circuits.js/src/crs/index.ts @@ -27,7 +27,7 @@ export class NetCrs { const g1End = g1Start + this.numPoints * 64 - 1; // Download required range of data. - const response = await fetch('https://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/sealed/transcript00.dat', { + const response = await fetch('https://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/monomial/transcript00.dat', { headers: { Range: `bytes=${g1Start}-${g1End}`, }, @@ -42,10 +42,10 @@ export class NetCrs { * Download the G2 points data. */ async downloadG2Data() { - const g2Start = 28 + 5040000 * 64; + const g2Start = 28 + 5040001 * 64; const g2End = g2Start + 128 - 1; - const response2 = await fetch('https://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/sealed/transcript00.dat', { + const response2 = await fetch('https://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/monomial/transcript00.dat', { headers: { Range: `bytes=${g2Start}-${g2End}`, }, From 16b8967a5a28ea0fa8c5e80f4368cadac8744478 Mon Sep 17 00:00:00 2001 From: AztecBot Date: Tue, 22 Aug 2023 22:07:27 +0000 Subject: [PATCH 4/4] git subrepo push --branch=master circuits/cpp/barretenberg subrepo: subdir: "circuits/cpp/barretenberg" merged: "5c91de729" upstream: origin: "https://github.com/AztecProtocol/barretenberg" branch: "master" commit: "5c91de729" git-subrepo: version: "0.4.6" origin: "???" commit: "???" --- circuits/cpp/barretenberg/.gitrepo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circuits/cpp/barretenberg/.gitrepo b/circuits/cpp/barretenberg/.gitrepo index 4d9c31d52bef..314976ae54f8 100644 --- a/circuits/cpp/barretenberg/.gitrepo +++ b/circuits/cpp/barretenberg/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/AztecProtocol/barretenberg branch = master - commit = 6d323838a525190618d608598357ee4608c46699 - parent = 708b05ca6638dc0d6ca7cb34fb8de76665a43b58 + commit = 5c91de7296e054f6d5ac3dca94ca85e06d496048 + parent = 899b05557365a5bf97e64793dd563a1b4bfa0f3f method = merge cmdver = 0.4.6