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

Fix cache access structure and update submodules to the latest #1804

Merged
merged 4 commits into from
Aug 23, 2024
Merged

Conversation

Trivo25
Copy link
Member

@Trivo25 Trivo25 commented Aug 23, 2024

A handful of changes to the cache system in the Mina repository changed and resulted in o1js accessing an out of bounds elements in the header structure of the cached data, this fixes it.
Additionally, this updates the bindings and mina submodule to the latest commit while making sure everything builds correctly (this wasn't the case previously)

Caching continues to work as intended as the change was only in the structure of the header data

o1js-bindings o1-labs/o1js-bindings#298

@Trivo25 Trivo25 changed the title cache bug Fix cache access structure and update submodules to the latest Aug 23, 2024
@Trivo25 Trivo25 marked this pull request as ready for review August 23, 2024 15:22
Copy link
Member

@svv232 svv232 left a comment

Choose a reason for hiding this comment

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

What is the review methodology here out of curiosity? I am inclined to think this is fine as long as CI passes since we are just modifying the submodule binding. The access seems like a fine solution as well, because I don't know of way to length check/sanity check the header to prevent this issue from happening again.

@Trivo25
Copy link
Member Author

Trivo25 commented Aug 23, 2024

What is the review methodology here out of curiosity? I am inclined to think this is fine as long as CI passes since we are just modifying the submodule binding. The access seems like a fine solution as well, because I don't know of way to length check/sanity check the header to prevent this issue from happening again.

Good question! Generally, CI is a good indicator when it comes to updating submodules and making sure the freshly built bindings don't break anything. Other than that, the cache access change was just a hot fix that I did and since it now "just works" it should be good to go (given it didn't do that before :D)

@@ -53,7 +53,7 @@ function parseHeader(
methods: MethodInterface[],
header: SnarkKeyHeader
): CacheHeader {
let hash = Pickles.util.fromMlString(header[1][2][7]);
let hash = Pickles.util.fromMlString(header[1][2][6]);
Copy link
Collaborator

@mitschabaude mitschabaude Aug 23, 2024

Choose a reason for hiding this comment

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

so, did the ocaml type change? if yes it would be nice to also change MlSnarkKeysHeader
(the TS type)

Copy link
Member Author

@Trivo25 Trivo25 Aug 23, 2024

Choose a reason for hiding this comment

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

@Trivo25 Trivo25 merged commit 0f57e36 into main Aug 23, 2024
24 checks passed
@Trivo25 Trivo25 deleted the cache-fix branch August 23, 2024 21:21
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.

4 participants