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

latest API of snarkyjs #36

Merged
merged 167 commits into from
Jan 19, 2022
Merged

latest API of snarkyjs #36

merged 167 commits into from
Jan 19, 2022

Conversation

mimoo
Copy link
Contributor

@mimoo mimoo commented Dec 1, 2021

No description provided.

src/lib/merkle_proof.ts Show resolved Hide resolved
src/lib/data_store.ts Outdated Show resolved Hide resolved
src/lib/circuit_value.ts Show resolved Hide resolved
src/lib/optional.ts Show resolved Hide resolved
src/lib/proof_system.ts Show resolved Hide resolved
src/lib/party.ts Show resolved Hide resolved
src/lib/party.ts Show resolved Hide resolved
export class Perm {
constant: Bool;
signatureNecessary: Bool;
signatureSufficient: Bool;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be less confusing to me if "signatureSufficient" would instead be called "proofNecessary", and the Bool negated (if that's accurate)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly does constant mean? I thought whether no one has the permission, but below it's also used for the case where everyone has the permission..

src/lib/party.ts Outdated Show resolved Hide resolved
src/lib/party.ts Show resolved Hide resolved
.github/workflows/doc.yml Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/build/build.mjs Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/build/buildWeb.mjs Outdated Show resolved Hide resolved
src/build/run.mjs Show resolved Hide resolved
} from '@o1labs/snarkyjs';

class SimpleSnapp extends SmartContract {
@state(Field) x = State<Field>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder: we need to PR the docs after this update is merged please, so the changes are reflected in the docs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And change the examples (at least the ones in snapp CLI)

src/examples/simple_snapp.ts Outdated Show resolved Hide resolved
src/lib/int.ts Outdated Show resolved Hide resolved
src/lib/int.ts Show resolved Hide resolved
src/lib/int.ts Show resolved Hide resolved
return new Int64(this.value.sub(y.value));
}

repr(): { magnitude: Field; isPos: Sgn } {
Copy link
Contributor

@jasongitmail jasongitmail Jan 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this method do?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -15,9 +24,24 @@ class Main extends Circuit {
}
}

console.log('generating keypair...');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these console logs all junk?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest - I run this example file often for testing, and I like them because the whole operation takes more than 10 seconds and this waiting time is less confusing/annoying if you see what is currently happening. We could remove the timings

src/examples/wip.ts Outdated Show resolved Hide resolved
src/lib/data_store.ts Outdated Show resolved Hide resolved
];
}

y_ = y_.seal();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and seal here (or more broadly, anywhere). What does the seal function do? Can we document this better?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seal and rangeCheckHelper both have TODOs in snarky.d.ts to document cc @imeckler to provide color for what these methods do

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see what rangeCheckHelper does from context -- is there a good reason this needs to be bridged instead of just reimplemented in typescript? is it doing something particularly special under-the-hood that we can't remake in user-space?

src/lib/party.ts Show resolved Hide resolved
@jasongitmail
Copy link
Contributor

jasongitmail commented Jan 11, 2022

General comment: Our builds are output to web & server directories. I prefer that naming convention over than chrome and node unless we're intended to maintain separate code for different runtimes, it'd make sense to stick with the generic names and list which runtimes we support in the README.

@mitschabaude
Copy link
Member

General comment: Our builds are output to web & server directories. I prefer that naming convention over than chrome and node unless we're intended to maintain separate code for different runtimes, it'd make sense to stick with the generic names and list which runtimes we support in the README.

I agree, at least with chrome -> web, but I'd rather make it server -> node because the node code is specifically targeted at the node runtime, not so much at a server environment. (And the web code is targeted at browser runtimes more than at being run on a website). If we at one point were to add deno compatibility, there's a small likelihood that we could reuse the web code, because the deno runtime tries to be close to web standards - but we could definitely not use the node code (and then the "server" label would become wrong).

I'll change the bindings directories' names after I changed them in the mina repo to keep copying simple, but will wait for that until everything is merged together there because merging changed directories is a pain

@mitschabaude
Copy link
Member

mitschabaude commented Jan 12, 2022

FYI, I now merged in the latest version of the @state API, I think @imeckler didn't have time to review it but I wanted to get a stable version out there and avoid having to change docs & examples again later. The only changes are in src/lib/snapp.ts.

@mitschabaude mitschabaude mentioned this pull request Jan 18, 2022
@mitschabaude mitschabaude merged commit 3789dcd into main Jan 19, 2022
@mitschabaude mitschabaude deleted the feature/workshop-examples branch May 9, 2022 14:30
mitschabaude added a commit that referenced this pull request Sep 5, 2023
Remove uses of JS classes in OCaml, part 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants