Improve WASM error processing - avoid Unknown when there is a wasm trap #321
Labels
need:brainstorm
Call for participation: group brainstorming is requested to fix this issue
team:Core
Low Level Core Development Team (Rust)
type:enhancement
Issues concerning code or feature improvement (performance, refactoring, etc)
Summary
Currently, soma runtime wasm traps are converted to ContractError::Unknown which is making problem diagnostics harder. It would be nice to have these kind of errors passed through back to contract call receipt. Currently, the receipt only contains ContractError::Unknown value with no further information.
Possible solution design or implementation
RuntimeError(wasm trap: out of bounds memory access) should be converted into some new value of ContractError, and not to ContractError::Unknown. This could be done in file imports.rs line 271:
let c_err = ContractError::from(err)
Additional context
The issue was detected when troubleshooting errors in protected transfer contract method test.
The text was updated successfully, but these errors were encountered: