We are seeing the following error whenever an invalidly encoded but properly signed extrinsic is submitted in our substrate based chain.
{
"jsonrpc": "2.0",
"error": {
"code": 1002,
"message": "Verification Error: Runtime error: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed\nWASM backtrace:\n\n 0: 0x2011df - <unknown>!rust_begin_unwind\n 1: 0x9a20 - <unknown>!core::panicking::panic_fmt::h57b56b1dc717ba48\n 2: 0x1c763d - <unknown>!TaggedTransactionQueue_validate_transaction\n",
"data": "RuntimeApi(\"Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed\\nWASM backtrace:\\n\\n 0: 0x2011df - <unknown>!rust_begin_unwind\\n 1: 0x9a20 - <unknown>!core::panicking::panic_fmt::h57b56b1dc717ba48\\n 2: 0x1c763d - <unknown>!TaggedTransactionQueue_validate_transaction\\n\")"
},
"id": 55
}
As it's shown in the error, it looks like that the extrinsic decoding code inside WASM panics and throws this wasm trap error that is caught by the Node.
Some of our questions and concerns are as following:
- What are the security implications of panicking inside the WASM when an extrinsic can not get decoded successfully? And if this might expose any new attack surface.
- Are there any plans to handle these decoding errors more gracefully?