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

Merge Rampup into Main #1123

Merged
merged 56 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
67d200d
Update bindings for evaluated columns
mrmr1993 Jul 7, 2023
bf51b3b
Update bindings for optional column evaluations
mrmr1993 Jul 7, 2023
ec5a4b5
Update bindings
mrmr1993 Jul 10, 2023
f3776ca
Bump bindings for merge
mrmr1993 Jul 14, 2023
6cf9b4b
fix unit test
mitschabaude Jul 14, 2023
50b67aa
Revert "dump vks"
mitschabaude Jul 14, 2023
86757ba
Merge pull request #1034 from o1-labs/merge-back-to-berkeley-2023-07-14
mrmr1993 Jul 15, 2023
f690523
Merge branch 'berkeley' into HEAD
dannywillems Jul 20, 2023
11a1961
remove hard-coded digest from unit test
mitschabaude Jul 20, 2023
811cd14
dump new vks
mitschabaude Jul 20, 2023
90467b2
Bump up snarkyjs-bindings
dannywillems Jul 20, 2023
163656e
Merge branch 'feature/evaluate-selectors' into feature/evaluate-optio…
mrmr1993 Jul 21, 2023
a44c34b
Expose overrideWrapDomain and use it to fix failing tests
mrmr1993 Jul 23, 2023
115b55c
Update bindings
mrmr1993 Jul 23, 2023
27b7593
Merge branch 'feature/remove-special-casing-of-lookups' into feature/…
mrmr1993 Jul 24, 2023
cc9f149
Update bindings
mrmr1993 Jul 24, 2023
e02505b
Merge pull request #1016 from o1-labs/feature/evaluate-selectors
mitschabaude Jul 25, 2023
e2ea109
Merge branch 'berkeley' into feature/evaluate-optional-gate-selectors
mitschabaude Jul 25, 2023
b6f855a
dump vks
mitschabaude Jul 25, 2023
0004222
Merge pull request #1017 from o1-labs/feature/evaluate-optional-gate-…
mitschabaude Jul 25, 2023
300f20a
better default for overrideWrapDomain, harden type
mitschabaude Jul 26, 2023
d4bb96a
dump vks
mitschabaude Jul 26, 2023
b77127d
Merge branch 'berkeley' into feature/stop-linearizing-optional-gate-s…
mitschabaude Jul 26, 2023
75bd0c9
Merge pull request #1045 from o1-labs/feature/stop-linearizing-option…
mitschabaude Jul 26, 2023
632bb7a
Merge branch 'berkeley' into feature/remove-special-casing-of-lookups
mitschabaude Jul 26, 2023
77cbdfd
vks
mitschabaude Jul 26, 2023
0bd76ff
Merge pull request #1047 from o1-labs/feature/remove-special-casing-o…
mitschabaude Jul 26, 2023
694b0ca
Merge branch 'berkeley' into feature/evaluate-lookup-selectors
mitschabaude Jul 26, 2023
f790767
dump vks
mitschabaude Jul 26, 2023
ed63481
Merge pull request #1024 from o1-labs/feature/evaluate-lookup-selectors
mitschabaude Jul 26, 2023
3cbb3aa
Merge branch 'berkeley' into feature/remove-wrap-features-3
mitschabaude Jul 27, 2023
bbb612f
bindings
mitschabaude Jul 27, 2023
70323fa
Merge pull request #1048 from o1-labs/feature/remove-wrap-features-3
mitschabaude Jul 27, 2023
fd9813c
update snarkyjs bindings
Aug 17, 2023
0b0f351
update bindings
Aug 17, 2023
0d25e7b
Bump up bindings after artefacts generation
dannywillems Aug 21, 2023
160fbf3
Merge pull request #1084 from o1-labs/dannywillems/lookup-verifier-in…
dannywillems Aug 22, 2023
a0fd427
Update bindings before artefacts generation
dannywillems Aug 23, 2023
8321c3b
Update bindings after artefacts generated
dannywillems Aug 23, 2023
3ceff6d
Merge pull request #1089 from o1-labs/dannywillems/lookup-commitments…
dannywillems Aug 24, 2023
5659a18
Merge branch 'berkeley' of ssh://github.com/o1-labs/snarkyjs into fea…
Aug 24, 2023
92ebf4d
update digest
Aug 25, 2023
33d677d
Merge pull request #1077 from o1-labs/feature/include-network-id-for-…
ghost-not-in-the-shell Aug 28, 2023
024cedd
Merge pull request #1100 from o1-labs/berkeley
shimkiv Sep 1, 2023
4b00a9e
bindings
mitschabaude Sep 6, 2023
7e1fcba
bindings
mitschabaude Sep 7, 2023
7918755
better handling of getAccount error
mitschabaude Sep 7, 2023
e19589b
Update CHANGELOG.md
shimkiv Sep 14, 2023
4932775
Resolving conflicts before submodule pins update.
shimkiv Sep 14, 2023
91fb577
Update bindings pin.
shimkiv Sep 14, 2023
a34d558
Bump version.
shimkiv Sep 14, 2023
b3850c4
Update bindings pin.
shimkiv Sep 14, 2023
c9e8cf3
Update CHANGELOG.md
shimkiv Sep 14, 2023
c2f392f
Bump mina-signer version.
shimkiv Sep 14, 2023
41177b1
Update CHANGELOG.md
shimkiv Sep 14, 2023
3cda1cd
Bump version.
shimkiv Sep 14, 2023
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
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
_Security_ in case of vulnerabilities.
-->

## [Unreleased](https://github.com/o1-labs/o1js/compare/fbd4b2717...HEAD)
## [0.12.3](https://github.com/o1-labs/o1js/compare/fbd4b2717...c2f392fe5)

> No unreleased changes yet
### Breaking changes

- Changes to verification keys caused by updates to the proof system. This breaks all deployed contracts https://github.com/o1-labs/o1js/pull/1016

## [0.12.2](https://github.com/o1-labs/o1js/compare/b1d8d5910...fbd4b2717)

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "o1js",
"description": "TypeScript framework for zk-SNARKs and zkApps",
"version": "0.12.2",
"version": "0.12.3",
"license": "Apache-2.0",
"homepage": "https://github.com/o1-labs/o1js/",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/bindings
104 changes: 52 additions & 52 deletions src/examples/regression_test.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/lib/account_update.unit-test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { mocks } from '../bindings/crypto/constants.js';
import {
AccountUpdate,
PrivateKey,
Expand Down Expand Up @@ -102,7 +103,7 @@ function createAccountUpdate() {
let accountUpdate = createAccountUpdate();
expect(
accountUpdate.body.authorizationKind.verificationKeyHash.toString()
).toEqual('0');
).toEqual(mocks.dummyVerificationKeyHash);
}

// does not throw an error if private key is missing unless if .send is executed
Expand Down
26 changes: 20 additions & 6 deletions src/lib/proof_system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ function ZkProgram<
Types[I]
>;
};
overrideWrapDomain?: 0 | 1 | 2;
}
): {
name: string;
Expand Down Expand Up @@ -246,10 +247,7 @@ function ZkProgram<
sortMethodArguments('program', key, methods[key].privateInputs, SelfProof)
);
let methodFunctions = keys.map((key) => methods[key].method);
let maxProofsVerified = methodIntfs.reduce(
(acc, { proofArgs }) => Math.max(acc, proofArgs.length),
0
) as any as 0 | 1 | 2;
let maxProofsVerified = getMaxProofsVerified(methodIntfs);

let compileOutput:
| {
Expand All @@ -267,7 +265,8 @@ function ZkProgram<
publicOutputType,
methodIntfs,
methodFunctions,
selfTag
selfTag,
config.overrideWrapDomain
);
compileOutput = { provers, verify };
return { verificationKey: verificationKey.data };
Expand Down Expand Up @@ -498,12 +497,16 @@ type MethodInterface = {
returnType?: Provable<any>;
};

// reasonable default choice for `overrideWrapDomain`
const maxProofsToWrapDomain = { 0: 0, 1: 1, 2: 1 } as const;

async function compileProgram(
publicInputType: ProvablePure<any>,
publicOutputType: ProvablePure<any>,
methodIntfs: MethodInterface[],
methods: ((...args: any) => void)[],
proofSystemTag: { name: string }
proofSystemTag: { name: string },
overrideWrapDomain?: 0 | 1 | 2
) {
let rules = methodIntfs.map((methodEntry, i) =>
picklesRuleFromFunction(
Expand All @@ -514,6 +517,9 @@ async function compileProgram(
methodEntry
)
);
let maxProofs = getMaxProofsVerified(methodIntfs);
overrideWrapDomain ??= maxProofsToWrapDomain[maxProofs];

let { verificationKey, provers, verify, tag } =
await prettifyStacktracePromise(
withThreadPool(async () => {
Expand All @@ -523,6 +529,7 @@ async function compileProgram(
result = Pickles.compile(MlArray.to(rules), {
publicInputSize: publicInputType.sizeInFields(),
publicOutputSize: publicOutputType.sizeInFields(),
overrideWrapDomain,
});
} finally {
snarkContext.leave(id);
Expand Down Expand Up @@ -773,6 +780,13 @@ function getStatementType<
};
}

function getMaxProofsVerified(methodIntfs: MethodInterface[]) {
return methodIntfs.reduce(
(acc, { proofArgs }) => Math.max(acc, proofArgs.length),
0
) as any as 0 | 1 | 2;
}

function fromFieldVars<T>(type: ProvablePure<T>, fields: MlFieldArray) {
return type.fromFields(MlFieldArray.from(fields));
}
Expand Down
7 changes: 1 addition & 6 deletions src/lib/proof_system.unit-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,4 @@ const CounterProgram = ZkProgram({
});

const incrementMethodMetadata = CounterProgram.analyzeMethods()[0];
expect(incrementMethodMetadata).toEqual(
expect.objectContaining({
rows: 18,
digest: '62d893f727b12d540bdc483427cbd70b',
})
);
expect(incrementMethodMetadata).toEqual(expect.objectContaining({ rows: 18 }));
19 changes: 12 additions & 7 deletions src/lib/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,18 +256,23 @@ function createState<T>(): InternalStateType<T> {
contract.instance.address,
contract.instance.self.body.tokenId
);
} catch (err) {
} catch (err: any) {
// TODO: there should also be a reasonable error here
if (inProver_) {
throw err;
}
throw Error(
let message =
`${contract.key}.get() failed, either:\n` +
`1. We can't find this zkapp account in the ledger\n` +
`2. Because the zkapp account was not found in the cache. ` +
`Try calling \`await fetchAccount(zkappAddress)\` first.\n` +
`If none of these are the case, then please reach out on Discord at #zkapp-developers and/or open an issue to tell us!`
);
`1. We can't find this zkapp account in the ledger\n` +
`2. Because the zkapp account was not found in the cache. ` +
`Try calling \`await fetchAccount(zkappAddress)\` first.\n` +
`If none of these are the case, then please reach out on Discord at #zkapp-developers and/or open an issue to tell us!`;
if (err.message) {
err.message = message + `\n\n${err.message}`;
throw err;
} else {
throw Error(message);
}
}
if (account.zkapp?.appState === undefined) {
// if the account is not a zkapp account, let the default state be all zeroes
Expand Down
4 changes: 2 additions & 2 deletions src/mina-signer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/mina-signer/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mina-signer",
"description": "Node API for signing transactions on various networks for Mina Protocol",
"version": "2.1.0",
"version": "2.1.1",
"type": "module",
"scripts": {
"build": "tsc -p ../../tsconfig.mina-signer.json",
Expand Down
6 changes: 5 additions & 1 deletion src/snarky.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,11 @@ declare const Pickles: {
*/
compile: (
rules: MlArray<Pickles.Rule>,
signature: { publicInputSize: number; publicOutputSize: number }
signature: {
publicInputSize: number;
publicOutputSize: number;
overrideWrapDomain?: 0 | 1 | 2;
}
) => {
provers: MlArray<Pickles.Prover>;
verify: (
Expand Down