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

Move Bool to JS #936

Merged
merged 72 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
f90e6c9
feat(bool.ts): Scaffold new Bool class
MartinMinkov May 31, 2023
31fcd5f
refactor(bool.ts): change Field to FieldVar
MartinMinkov May 31, 2023
2492270
feat(snarky.d.ts): add bool API to support boolean operations in circ…
MartinMinkov Jun 1, 2023
5e19814
refactor(snarky.d.ts): move BoolVar type to bool.ts
MartinMinkov Jun 1, 2023
74883fe
feat(bool.ts): add isConstant, isBoolean, and refactor constructor
MartinMinkov Jun 1, 2023
a685130
feat(bool.ts): add support for BoolVar type in constructor
MartinMinkov Jun 1, 2023
a95bea7
feat(bool.ts): implement not()
MartinMinkov Jun 1, 2023
f3b6e56
feat(bool.ts): add isConstant function to check if a boolean or Bool …
MartinMinkov Jun 1, 2023
db4f9b8
feat(bool.ts): implement and()
MartinMinkov Jun 1, 2023
1cca348
feat(bool.ts): implement or()
MartinMinkov Jun 1, 2023
24a127a
feat(bool.ts): implement assertEquals()
MartinMinkov Jun 1, 2023
6ed996d
feat(bool.ts): implement assertTrue()
MartinMinkov Jun 1, 2023
1faddde
feat(bool.ts): implement assertFalse()
MartinMinkov Jun 1, 2023
4f4bf50
feat(bindings): update bindings
MartinMinkov Jun 1, 2023
6c1d058
chore(bindings): update bindings
MartinMinkov Jun 1, 2023
4c53337
feat(bool.ts): implement equals()
MartinMinkov Jun 1, 2023
ae836a8
feat(bool.ts): add additional methods
MartinMinkov Jun 2, 2023
704e39f
scalar constructor
mitschabaude May 31, 2023
8eb7a09
to fields compressed
mitschabaude May 31, 2023
523fd70
constant scalar ops
mitschabaude May 31, 2023
f26a8a9
provable scalar
mitschabaude May 31, 2023
56e7eee
from bits
mitschabaude May 31, 2023
45f8d22
fix api example
mitschabaude May 31, 2023
f4c232f
remaining methods
mitschabaude May 31, 2023
14c97dc
move back to ml-equivalent repr for Group.scale compatibility
mitschabaude Jun 1, 2023
0f9420d
fixup scalar representation
mitschabaude Jun 1, 2023
9a8c8c9
export new scalar everywhere
mitschabaude Jun 1, 2023
e2b74c5
update tests
mitschabaude Jun 1, 2023
9595498
remove new test
mitschabaude Jun 1, 2023
4cc35f3
remove old scalar
mitschabaude Jun 1, 2023
825e6f5
remove old scalar class
mitschabaude Jun 1, 2023
2aaf3ed
move private key conversions & base58 to js
mitschabaude Jun 1, 2023
66a27e2
add test for consistency with ml function that's no longer used
mitschabaude Jun 1, 2023
be0155e
move private key conversion to a saner place
mitschabaude Jun 1, 2023
9f8a83b
bindings
mitschabaude Jun 1, 2023
21a3f56
remove sign fee payer and its deps
mitschabaude Jun 1, 2023
01397db
doccomments
mitschabaude Jun 1, 2023
a6b14a5
changelog
mitschabaude Jun 1, 2023
2ff62d9
remove comment
mitschabaude Jun 1, 2023
73d93ac
refactor(bool.ts): use FieldConst.equal instead of custom areUint8Arr…
MartinMinkov Jun 5, 2023
60b4b87
refactor(bool.ts): change Snarky.bool.readVar to Snarky.field.readVar
MartinMinkov Jun 5, 2023
b6b756a
feat(bool.ts): add toInput()
MartinMinkov Jun 5, 2023
2d7fbaf
refactor(bool.ts): rename unused param to '_'
MartinMinkov Jun 5, 2023
85bc0c2
refactor(core.ts): Remove unused Bool.toAuxillary method
MartinMinkov Jun 5, 2023
09b3d9d
feat(bool.ts): add support for binary serialization and deserializati…
MartinMinkov Jun 5, 2023
624bac6
refactor(bool.ts): implement toJSON and fromJSON methods to convert B…
MartinMinkov Jun 5, 2023
497a10d
feat(bool.ts): implement fromFields method
MartinMinkov Jun 5, 2023
bfed050
feat(bool.ts): add Unsafe.ofField() method
MartinMinkov Jun 5, 2023
7872fb4
feat(bool.ts): match return types of original Bool impl
MartinMinkov Jun 5, 2023
2857d9e
refactor(bool): import new Bool instead of old Bool impl
MartinMinkov Jun 5, 2023
3fc8aee
feat(bindings): update bindings
MartinMinkov Jun 5, 2023
7162c8e
feat(bool.ts): add check method
MartinMinkov Jun 6, 2023
bff041f
refactor(bool.ts): fix toFields
MartinMinkov Jun 6, 2023
25636db
wip
MartinMinkov Jun 6, 2023
1dbef9b
Merge branch 'main' into refactor/bool
MartinMinkov Jun 6, 2023
cf14da4
fix(bool.ts): update bool module
MartinMinkov Jun 7, 2023
ddf118b
feat(bindings): update bindings
MartinMinkov Jun 7, 2023
43ba295
chore: trigger CI
MartinMinkov Jun 7, 2023
f3f6acd
feat(bindings): update bindings
MartinMinkov Jun 7, 2023
ba9dd00
fix: account for old bool not having .isConstant()
mitschabaude Jun 7, 2023
1129e3c
fix: always use assertion message in assertTrue/False
mitschabaude Jun 7, 2023
6a76354
bindings
mitschabaude Jun 7, 2023
d073b2a
fix logic in some static methods
mitschabaude Jun 7, 2023
b4ff6cd
fix vk regression
mitschabaude Jun 7, 2023
44a2f77
make debugging vk regressions easier
mitschabaude Jun 7, 2023
13307b1
fix vk regression at the correct place
mitschabaude Jun 7, 2023
c1a1ac6
docs(bool.ts): add JSDoc comments to all methods and properties of th…
MartinMinkov Jun 7, 2023
04d6479
Merge branch 'main' into refactor/bool
mitschabaude Jun 12, 2023
392e70a
fixup
mitschabaude Jun 12, 2023
5ba75da
fixup compilation after merge
mitschabaude Jun 7, 2023
ad7f597
doccomment
mitschabaude Jun 12, 2023
ba96139
bindings
mitschabaude Jun 12, 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
2 changes: 1 addition & 1 deletion src/bindings
12 changes: 9 additions & 3 deletions src/examples/vk_regression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { HelloWorld } from './zkapps/hello_world/hello_world.js';
import { TokenContract, createDex } from './zkapps/dex/dex.js';
import { GroupCS } from './primitive_constraint_system.js';

// toggle this for quick iteration when debugging vk regressions
const skipVerificationKeys = false;

// usage ./run ./src/examples/vk_regression.ts --bundle --dump ./src/examples/regression_test.json
let dump = process.argv[4] === '--dump';
let jsonPath = process.argv[dump ? 5 : 4];
Expand Down Expand Up @@ -132,7 +135,10 @@ async function dumpVk(contracts: typeof ConstraintSystems) {
for await (const c of contracts) {
let data = c.analyzeMethods();
let digest = c.digest();
let { verificationKey } = await c.compile();
let verificationKey:
| { data: string; hash: { toString(): string } }
| undefined;
if (!skipVerificationKeys) ({ verificationKey } = await c.compile());
newEntries[c.name] = {
digest,
methods: Object.fromEntries(
Expand All @@ -142,8 +148,8 @@ async function dumpVk(contracts: typeof ConstraintSystems) {
])
),
verificationKey: {
data: verificationKey.data,
hash: verificationKey.hash.toString(),
data: verificationKey?.data ?? '',
hash: verificationKey?.hash.toString() ?? '0',
},
};
}
Expand Down
Loading