ChainSafe / ChainSafe/gossamer

Gossamer Should Propogate Panics from the Runtime

Open
#2,669 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
454
Forks
144
PR merge metrics
No merged PRs in 30d

Description

Currently, Gossamer just logs errors that occur in the runtime - instead, when a Gossamer node experiences a runtime panic, the node itself should also panic.

We should check every `logger.Error` calls in `lib/runtime/wasmer/imports.go` together with https://spec.polkadot.network/ and replace them with panics if no error value is meant to be returned.

Historical context:

1. Implementers parity matrix chat
> There are a few runtime functions such as https://spec.polkadot.network/#_version_1_prototype_65 where there is no possible error defined, but our implementation can produce an error. How should we handle such functions? Right now we return 0 as the result pointer and log the error, but I'm wondering if this 0 error code should be added to the spec? Or should we do something else?

> You should consider the block as bad (or fail the runtime call, or similar). When people say above that you should panic, they don't literally mean panic, they mean treat the situation as if the runtime had panicked

1. Standup discussion:
- Eclesio mentioned Rust works differently than Go, so we can't really wrap an error in the return value to stop runtime execution 🤔
- Proposed by Tim: let's just panic for now to see if it ever happens

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.