Input validation
- Currently most of our Runtime APIs do not validate the incoming input and throws generic
Runtime: Unreachable error. In most of the cases, when we receive the input, we decode it to the desired type and expect it to be encoded correctly. For instance, in /api/others.ts in function system_accountNonce we decode input to AccountId like this
const account = AccountId.fromU8Array(input).result.
which does not assume the case when input might be encoded incorrectly.
TO-DO
- Implement new function/tool that validates each input incoming to the runtime and returns corresponding error code and message.
Input validation
Runtime: Unreachableerror. In most of the cases, when we receive the input, we decode it to the desired type and expect it to be encoded correctly. For instance, in/api/others.tsin functionsystem_accountNoncewe decode input toAccountIdlike thiswhich does not assume the case when input might be encoded incorrectly.
TO-DO