This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Poor error handling on invalid transaction input #1649
Labels
I4-annoyance
The client behaves within expectations, however this “expected behaviour” itself is at issue.
Z2-medium
Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase.
Milestone
I got this error
Message from polkadot.js side
After a whole afternoon of digging, the root cause is I removed the indices module, which changed the format of
Address
changed fromenum Address
toAccountId
. This is a codec breaking change but I was unaware about it.As the result, the polkadot.js still encodes the transaction with the enum format, and substrate failed to decode it and panicking at this
unwrap
while validating the transactionsubstrate/core/sr-api-macros/src/decl_runtime_apis.rs
Lines 160 to 166 in e6d9814
#1328 should improve the compatibility issue (which I am aiming to finish it early next week) that it allows polkadot.js to discover the correct types.
However, substrate should just handle the decode issue and reject the invalid encoded transaction instead of panic.
The text was updated successfully, but these errors were encountered: