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.
C++ expects a length 8 (
ARGS_LENGTH) array as input forabis__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 callinghashConstructorwithargsof 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::arrayarg, 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.