From 708b05ca6638dc0d6ca7cb34fb8de76665a43b58 Mon Sep 17 00:00:00 2001 From: kevaundray Date: Tue, 22 Aug 2023 22:36:25 +0100 Subject: [PATCH] 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 9b3764a1b92..506341e1849 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 e70bedd121e..eecda39aa0a 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');