From c573282fd59e44df70ae125f68281ebb67b7453d Mon Sep 17 00:00:00 2001 From: kevaundray Date: Mon, 28 Aug 2023 14:35:21 +0100 Subject: [PATCH] chore: use 2^19 as `MAX_CIRCUIT_SIZE` for NodeJS CLI (#1834) resolves #1829 # 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/ts/src/main.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/circuits/cpp/barretenberg/ts/src/main.ts b/circuits/cpp/barretenberg/ts/src/main.ts index eecda39aa0a..87f73773592 100755 --- a/circuits/cpp/barretenberg/ts/src/main.ts +++ b/circuits/cpp/barretenberg/ts/src/main.ts @@ -8,8 +8,13 @@ import { Command } from 'commander'; createDebug.log = console.error.bind(console); const debug = createDebug('bb.js'); -// Maximum we support natively. It is 2^19 for browser. -const MAX_CIRCUIT_SIZE = 2 ** 23; +// Maximum we support in node and the browser is 2^19. +// This is because both node and browser use barretenberg.wasm. +// +// This is not a restriction in the bb binary and one should be +// aware of this discrepancy, when creating proofs in bb versus +// creating the same proofs in the node CLI. +const MAX_CIRCUIT_SIZE = 2 ** 19; function getBytecode(bytecodePath: string) { const encodedCircuit = readFileSync(bytecodePath, 'utf-8');