Skip to content

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

@dbanks12

Description

@dbanks12

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions