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

TS hashConstructor is not providing fixed length 8 array for args #320

Closed
dbanks12 opened this issue Apr 20, 2023 · 0 comments · Fixed by #321
Closed

TS hashConstructor is not providing fixed length 8 array for args #320

dbanks12 opened this issue Apr 20, 2023 · 0 comments · Fixed by #321
Assignees

Comments

@dbanks12
Copy link
Collaborator

C++ expects a length 8 (ARGS_LENGTH) array as input for abis__hash_constructor(), but TS is allowing any # of args. C++ has no clue since serialized arrays don't include a length prefix (only vectors do). So, in abis.test.ts, TS was calling hashConstructor with args of length 2, and C++ was assuming it should be length 8 and reading in garbage for the last 6 entries.

Whenever we call a cbind from TS that has a fixed-length std::array arg, TS should enforce that the length is correct. The other option would be to always accept dynamic length vectors in cbinds and enforce in C++ that they do not surpass the required length before copying them into a fixed-length array for use in circuits.

@dbanks12 dbanks12 added this to A3 Apr 20, 2023
@dbanks12 dbanks12 self-assigned this Apr 20, 2023
@dbanks12 dbanks12 converted this from a draft issue Apr 20, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in A3 Apr 21, 2023
@iAmMichaelConnor iAmMichaelConnor removed this from A3 Jul 26, 2023
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 a pull request may close this issue.

1 participant