fix: enforce correct length of hashConstructor args#321
Merged
iAmMichaelConnor merged 4 commits intomasterfrom Apr 21, 2023
Merged
fix: enforce correct length of hashConstructor args#321iAmMichaelConnor merged 4 commits intomasterfrom
args#321iAmMichaelConnor merged 4 commits intomasterfrom
Conversation
added 3 commits
April 20, 2023 22:50
…cbind. enforce args length. update snapshots
Contributor
Author
|
Thanks @suyash67 for pairing on this with me. @Cheethas looks like you and @LHerskind made a fix to the failing test in master while I was discovering this on my own.... Lmk what you think of my fix to |
6 tasks
spalladino
approved these changes
Apr 21, 2023
Contributor
spalladino
left a comment
There was a problem hiding this comment.
This explains why that snapshot had unexpectedly changed at some point. Thanks @dbanks12 for fixing it!
iAmMichaelConnor
approved these changes
Apr 21, 2023
Contributor
Author
My pleasure! |
ludamad
pushed a commit
that referenced
this pull request
Jul 14, 2023
codygunton
pushed a commit
that referenced
this pull request
Jan 23, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
args#320It was discovered that
hashConstructorwas sending any length array ofargsto theabis__hash_constructorcbind. That cbind always deserializesargsinto an array of lengthARRAY_LENGTHsince it expects a statically typed array. Ourabis.test.tswas passing 2 args in and the C++ was serializing those 2 plus 6 garbage args into the array. So the output ofhashConstructorwas wrong and non-deterministic.This PR fixes this by enforcing that the C++ cbind always gets an array of proper length.
Contents
hashConstructorenforces thatargs.length() <= ARGS_LENGTHhashConstructorfills outargsuntil full withnew Fr(0)throwon >max argsChecklist: