You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now when a Rust contract panics, we don't get the panic message or location in a Wasm build. We just see an unreachable in a Wasmer error message. This is because an unreachable Wasm instruction is hit that terminates the contract.
Now what we can do to get more information is install a panic handler in the contract (i.e. Wasm) that sends those information out before the contract stops. This can be done with set_hook. In PanicInfo we see that we at least get the panic message and location.
With this information the contract can call the host and send the information along with an abort request. The VM can log the information and stop the execution.
Implementing this requres a new import which we can add as chain feature for compatibility. Then panic handlers can only be used on chains that support it.
The text was updated successfully, but these errors were encountered:
Right now when a Rust contract panics, we don't get the panic message or location in a Wasm build. We just see an
unreachable
in a Wasmer error message. This is because an unreachable Wasm instruction is hit that terminates the contract.Now what we can do to get more information is install a panic handler in the contract (i.e. Wasm) that sends those information out before the contract stops. This can be done with set_hook. In PanicInfo we see that we at least get the panic message and location.
With this information the contract can call the host and send the information along with an abort request. The VM can log the information and stop the execution.
Implementing this requres a new import which we can add as chain feature for compatibility. Then panic handlers can only be used on chains that support it.
The text was updated successfully, but these errors were encountered: