Skip to content

Commit

Permalink
Merge pull request #1624 from o1-labs/lazy-dummy-proof
Browse files Browse the repository at this point in the history
make dummy proof lazy
  • Loading branch information
Trivo25 committed Apr 29, 2024
2 parents 8fcba8e + b806883 commit 29d40e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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

0 comments on commit 29d40e5

Please sign in to comment.