diff --git a/CHANGELOG.md b/CHANGELOG.md index aa91bdea080..1fc9a030e42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - [2648](https://github.com/FuelLabs/fuel-core/pull/2648): Add feature-flagged field to block header `fault_proving_header` that contains a commitment to all transaction ids. +### Changed + +- [2653](https://github.com/FuelLabs/fuel-core/pull/2653): Added cleaner error for wasm-executor upon failed deserialization. + + ## [Version 0.41.6] ### Added diff --git a/crates/services/upgradable-executor/src/instance.rs b/crates/services/upgradable-executor/src/instance.rs index fc0aa0532ee..60787306c5f 100644 --- a/crates/services/upgradable-executor/src/instance.rs +++ b/crates/services/upgradable-executor/src/instance.rs @@ -636,6 +636,11 @@ impl Instance { .expect("Memory was initialized above; qed"); let slice = &memory.data(&self.store)[ptr..ptr.saturating_add(len)]; - postcard::from_bytes(slice).map_err(|e| anyhow::anyhow!(e)) + postcard::from_bytes(slice).map_err(|e| { + match e { + postcard::Error::SerdeDeCustom => anyhow::anyhow!(e).context("Error in Deserialization; check feature flags of wasm module during compilation"), + _ => anyhow::anyhow!(e).context("Error in Deserialization; fatal"), + } + }) } }