o1-labs / snarky

OCaml DSL for verifiable computation
MIT License
496 stars 74 forks source link

Get rid of AST monad #685

Closed mimoo closed 1 year ago

mimoo commented 1 year ago

attempt to make the imperative interface not rely on the checked AST monad

https://github.com/o1-labs/snarky/pull/730 needs to be merged here before we can land this

testing it in mina: https://github.com/MinaProtocol/mina/pull/12238

mimoo commented 1 year ago

"This function can't be run outside of a checked computation"

This doesn't pass CI in mina (https://github.com/MinaProtocol/mina/pull/12238):

I think this might be the issue: https://github.com/o1-labs/snarky/pull/681/files#diff-c0ab6ec2224bcd68193e211907c02f1f81f70c82c2216856a0f7db1b37585defL1079

image

The problem I'm facing right now is to reproduce that error in OCaml

"bad verify"

also, when I ran the tests in pickles I get these:

bad verify: b: 0x09BEB52F2E6DA2D8BD95929F84F6DB3BE98D63680A3F32447A46ECA094873320 != 0x27FBBF28E802C45D42AD687D91F37A092FED695F13F8F419420C0956EB192F56
bad verify: b: 0x26A09AE9FAAC1AE08E7DBE3114D8949DC99EC8D7C339B6998E15E5386B058303 != 0x1C7524E33C475279208CBE76552F175E9439D0CA2E870AFF3B62D70FD6DEC530

but interestingly tests do not seem to fail (so it's not clear to me which tests are triggering these messages)

mimoo commented 1 year ago

for the first issue, my proposal is to check if the state was mutated instead of checking if we're running: https://github.com/o1-labs/snarky/discussions/691#discussioncomment-4186011

it would still be nice to be able to reproduce that issue with a test in OCaml though to make sure we're covering our bases

mimoo commented 1 year ago

@mrmr1993 the PR is fixed in https://github.com/o1-labs/snarky/pull/730