Skip to content
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

make dummy proof lazy #1624

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- Fixed issue in `UInt64.rightShift()` where it incorrectly performed a left shift instead of a right shift. https://github.com/o1-labs/o1js/pull/1617
- Fixed issue in `ForeignField.toBits()` where high limbs were under-constrained for input length less than 176. https://github.com/o1-labs/o1js/pull/1617
- Make `dummyBase64Proof()` lazy. Significant speed up when generating many account updates with authorization `Proof` while proofs turned off. https://github.com/o1-labs/o1js/pull/1624

### Added

Expand Down
7 changes: 6 additions & 1 deletion src/lib/proof-system/zkprogram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1193,9 +1193,14 @@ async function dummyProof(maxProofsVerified: 0 | 1 | 2, domainLog2: number) {
);
}

let dummyProofCache: string | undefined;

async function dummyBase64Proof() {
if (dummyProofCache) return dummyProofCache;
let proof = await dummyProof(2, 15);
return Pickles.proofToBase64([2, proof]);
let base64Proof = Pickles.proofToBase64([2, proof]);
dummyProofCache = base64Proof;
return base64Proof;
}

// what feature flags to set to enable certain gate types
Expand Down
Loading