Skip to content
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

Improve WASM error processing - avoid Unknown when there is a wasm trap #321

Open
miloszm opened this issue Feb 6, 2024 · 1 comment
Open
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)

Comments

@miloszm
Copy link
Contributor

miloszm commented Feb 6, 2024

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.

@miloszm miloszm added team:Core Low Level Core Development Team (Rust) type:enhancement Issues concerning code or feature improvement (performance, refactoring, etc) type:tech-debt the issue is a tech debt that needs fixing labels Feb 6, 2024
@HDauven HDauven added need:brainstorm Call for participation: group brainstorming is requested to fix this issue and removed type:tech-debt the issue is a tech debt that needs fixing labels Apr 10, 2024
@HDauven
Copy link
Member

HDauven commented Apr 10, 2024

We need to think a bit more about this, including whether this would lead to breaking changes later on.

CC: @ureeves

@HDauven HDauven added this to the Mainnet milestone Apr 10, 2024
@HDauven HDauven removed this from the Mainnet milestone Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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)
Projects
None yet
Development

No branches or pull requests

2 participants