FuelLabs / fuel-indexer

*Archived* 🗃 The Fuel indexer is a standalone service that can be used to index various components of the Fuel blockchain.
140 stars 67 forks source link

enhancement: use panic_hook to retrieve message from a failed WASM execution #1404

Closed lostman closed 1 year ago

lostman commented 1 year ago

Description

Closes #1402.

This PR adds WasmIndexerError::Panic variant and registers a panic hook in the WASM indexer.

The panic message is stored in a static mut String, and an early_exit is triggered. The message is then retrieved by thy indexer service and logged.

Testing steps

CI tests should pass.

For manual testing, deploy an indexer that causes panic (for instance, by calling unwrap() on the None value in the handler function), and observe the panic error message in the logs of fuel-indexer.

Changelog