From e22f96b3a9b2ae760cbe8c8e31ffb34a9900aa2e Mon Sep 17 00:00:00 2001 From: Florian Date: Sat, 23 Nov 2024 16:03:14 +0700 Subject: [PATCH 1/4] add compilation test --- src/lib/proof-system/zkprogram.unit-test.ts | 33 +++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/lib/proof-system/zkprogram.unit-test.ts diff --git a/src/lib/proof-system/zkprogram.unit-test.ts b/src/lib/proof-system/zkprogram.unit-test.ts new file mode 100644 index 000000000..0b36bef28 --- /dev/null +++ b/src/lib/proof-system/zkprogram.unit-test.ts @@ -0,0 +1,33 @@ +import { Field } from '../provable/wrapped.js'; +import { ZkProgram } from './zkprogram.js'; + +const methodCount = 30; + +let MyProgram = ZkProgram({ + name: 'large-program', + publicOutput: Field, + methods: nMethods(methodCount), +}); + +function nMethods(i: number) { + let methods: Record = {}; + for (let j = 0; j < i; j++) { + methods['method' + j] = { + privateInputs: [Field], + async method(a: Field) { + return { + publicOutput: a.mul(1), + }; + }, + }; + } + return methods; +} + +try { + await MyProgram.compile(); +} catch (error) { + throw Error( + `Could not compile zkProgram with ${methodCount} branches: ${error}` + ); +} From 9e7ca4ff1c4677ee57af4a3e4b530c542821145b Mon Sep 17 00:00:00 2001 From: Florian Date: Sat, 23 Nov 2024 16:06:44 +0700 Subject: [PATCH 2/4] bindings --- src/bindings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings b/src/bindings index 2c62a9a75..34a05bc88 160000 --- a/src/bindings +++ b/src/bindings @@ -1 +1 @@ -Subproject commit 2c62a9a755f1b128f89cc2131814df7157f68109 +Subproject commit 34a05bc8888eb577aa73852dab5df90c7cae1050 From fc9a389c04e401a3409a7eec5012124fcf226b61 Mon Sep 17 00:00:00 2001 From: Florian Date: Sat, 23 Nov 2024 16:07:04 +0700 Subject: [PATCH 3/4] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index da97589a3..3862a9083 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased](https://github.com/o1-labs/o1js/compare/e1bac02...HEAD) +### Added + +- Increased maximum supported amount of methods in a `SmartContract` or `ZkProgram` to 30. https://github.com/o1-labs/o1js/pull/1918 + ### Fixed - Compiling stuck in the browser for recursive zkprograms https://github.com/o1-labs/o1js/pull/1906 From 18faf8808cbbdc21e0357b879f3f1fa070beaad1 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 4 Dec 2024 18:50:48 +0700 Subject: [PATCH 4/4] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f89592148..46f96c522 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,8 +22,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm -`ZkProgram` to support non-pure provable types as inputs and outputs https://github.com/o1-labs/o1js/pull/1828 - Add `enforceTransactionLimits` parameter on Network https://github.com/o1-labs/o1js/issues/1910 - - Method for optional types to assert none https://github.com/o1-labs/o1js/pull/1922 +- Increased maximum supported amount of methods in a `SmartContract` or `ZkProgram` to 30. https://github.com/o1-labs/o1js/pull/1918 ### Fixed