-
Notifications
You must be signed in to change notification settings - Fork 93
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
Add VM error code #697
Add VM error code #697
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline comments optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline comments optional
@@ -107,6 +107,7 @@ sequence number and try again. | |||
| RESOURCE_ALREADY_EXISTS | We tried to create a resource under an account where that resource already exists. | Check the contract and possibly change it to handle resources that already exist | | |||
| UNKNOWN_STATUS | A reserved status to represent an unknown vm status. This is std::u64::MAX, but we can't pattern match on that, so put the hardcoded value in. | N/A | | |||
| LINKER_ERROR | This may be due to the function has not been published on chain or by trying to call an invalid function as the result of either an incorrect account address, module name, or function name. This might not happen locally if the sources are available locally but have yet to be published on-chain. | There are many reasons, but you should check your account addresses, module names, and function names to determine that they're correct and published | | |||
| FAILED_TO_DESERIALIZE_ARGUMENT | The is due to exceeding the limit on the number of nested or unpacked structs (including in a vector). The limit is currently 10. | N/A | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be other reasons for this error to be thrown (i.e. bad serialized format. Maybe we should say that as well?). Also for solution, we can say something like "Re-submit the transaction with fewer number of nested XYZ if possible?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other reasons for this right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC structs are checked, but the fields of these structs are not. https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/src/extended_checks.rs#L240
They are checked when the the arguments are deserialized. It would cause panic. The limit 10 is deduced drom the max number of overall args.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at transaction_arg_validation.rs, I see that error thrown in a few other places as well:
- When "The serialized arguments to constructor contained extra data" (line 290)
- When deserializing utf8 but struct_constructors are disabled (line 419)
- Same, but when the string argument is too long (line 432)
- When BCS deserialization fails for utf8 (line 441)
... Some more BCS deserialization errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Please re-review
b15f7a5
to
4c87eb7
Compare
4c87eb7
to
b4d1382
Compare
Add VM error code `FAILED_TO_DESERIALIZE_ARGUMENT`
b4d1382
to
49d91dd
Compare
Description
Add VM error code
FAILED_TO_DESERIALIZE_ARGUMENT
Checklist
CI