Skip to content

Error 'FAILED_TO_DESERIALIZE_ARGUMENT' with Array Parameter Exceeding 10 Values in Aptos SDK v1.17.0 #503

Answered by gregnazario
ajselvan asked this question in Questions
Discussion options

You must be logged in to vote

I'm getting FAILED_TO_DESERIALIZE_ARGUMENT when using a vector with more than 10 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:

  • if you're using vector<Object<T>> you can use vector<address> instead.
  • if you're using vector<Option<T>> you can use vector<T>, and have a sentinel value that isn't used…

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ajselvan
Comment options

Comment options

You must be logged in to vote
2 replies
@0xmaayan
Comment options

@ajselvan
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by gregnazario
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants