Error 'FAILED_TO_DESERIALIZE_ARGUMENT' with Array Parameter Exceeding 10 Values in Aptos SDK v1.17.0 #503
-
Discord user IDNo response Describe your question in detail.Hi , we are encountering the error 'FAILED_TO_DESERIALIZE_ARGUMENT' when passing function arguments. Specifically, if an array parameter contains more than 10 values, this error occurs in the SDK during the signAndSubmitTransaction process. Could you please assist us with resolving this issue. What error, if any, are you getting?FAILED_TO_DESERIALIZE_ARGUMENT What have you tried or looked at? Or how can we reproduce the error?when passing function arguments. Specifically, if an array parameter contains more than 10 values Which operating system are you using?Windows Which SDK or tool are you using? (if any)TypeScript SDK Describe your environment or tooling in detailSDK --> version: @aptos-labs/ts-sdk": "^1.17.0 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
a few options you can try.
cc @0xmaayan |
Beta Was this translation helpful? Give feedback.
-
@ajselvan Could you help with providing a code snippet so we can try and reproduce the error |
Beta Was this translation helpful? Give feedback.
-
Hi @0xmaayan Could you please assist us with resolving this issue. |
Beta Was this translation helpful? Give feedback.
-
I'm getting
|
Beta Was this translation helpful? Give feedback.
I'm getting
FAILED_TO_DESERIALIZE_ARGUMENT
when using a vector with more than10
structs in it (e.g.Option
,Object
, etc.)What happened?
The limit on the number of nested or unpacked structs (including in a vector) is 10.
This is from a previous security mitigation in the current VM implementation and for the moment, will stay at that amount.
https://github.com/aptos-labs/aptos-core/pull/8568/files#diff-ce29aaa4f72d88fa625f39d7ba651b6cb38014b3d38326538a630b2107384eabR255-R264
How can I address this?
There are two paths:
vector<Object<T>>
you can usevector<address>
instead.vector<Option<T>>
you can usevector<T>
, and have a sentinel value that isn't used…