-
Notifications
You must be signed in to change notification settings - Fork 147
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
Dynamic arrays in o1js #1848
base: main
Are you sure you want to change the base?
Dynamic arrays in o1js #1848
Conversation
@querolita @Trivo25 maybe of interest: I created quite polished general-purpose types for both static and dynamic arrays in this PR: zksecurity/mina-attestations#25 They made it pretty easy to implement dynamic-length sha256. I think they could serve as a starting point for arrays in o1js that are (even) better designed than the D. Gretzke repo! |
…and null/synthesize
TODO
|
Is it possible to use Additionally, it would be great to get some insights into the constraint optimization for dynamic array indexing or updates. For example, how does its efficiency compare to classic techniques for an array of 100 elements versus using dynamic arrays? |
zkApps and ZkProgram are the same actually. This limitation shouldn't be relevant to dynamic arrays since it's pure whenever the element type is pure. However, this might not be currently reflected in the type signature! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far! Let's wait for the runtime tables before we finish and merge this PR, otherwise we would have to break backwards compatilbility later which is a bit meh
methods: { | ||
pushAndPop: { | ||
privateInputs: [], | ||
async method() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall the tested cases look good to me, but we should restructure the tests a bit differently - lets talk about that next time!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
soft blocked on #2079 |
Addressing #1086, based on #633
Making this public as WIP to receive early feedback