Skip to content

Commit eef756b

Browse files
committed
chore(wasm-executor): add nicer error if you missed a feature flag during compilation (#2653)
## Linked Issues/PRs <!-- List of related issues/PRs --> ## Description <!-- List of detailed changes --> found a lot of `SerdeDeCustom` errors while compiling FuelLabs/fuel-core#2648 without the fault-proving feature flag in [the build script](crates/services/upgradable-executor/build.rs) ## Checklist - [ ] Breaking changes are clearly marked as such in the PR description and changelog - [ ] New behavior is reflected in tests - [ ] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed) ### Before requesting review - [ ] I have reviewed the code myself - [ ] I have created follow-up issues caused by this PR and linked them here ### After merging, notify other teams [Add or remove entries as needed] - [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/) - [ ] [Sway compiler](https://github.com/FuelLabs/sway/) - [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this) - [ ] Someone else?
1 parent 20c9ac6 commit eef756b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010

1111
- [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.
1212

13+
### Changed
14+
15+
- [2653](https://github.com/FuelLabs/fuel-core/pull/2653): Added cleaner error for wasm-executor upon failed deserialization.
16+
17+
1318
## [Version 0.41.6]
1419

1520
### Added

crates/services/upgradable-executor/src/instance.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,11 @@ impl Instance<InputData> {
636636
.expect("Memory was initialized above; qed");
637637
let slice = &memory.data(&self.store)[ptr..ptr.saturating_add(len)];
638638

639-
postcard::from_bytes(slice).map_err(|e| anyhow::anyhow!(e))
639+
postcard::from_bytes(slice).map_err(|e| {
640+
match e {
641+
postcard::Error::SerdeDeCustom => anyhow::anyhow!(e).context("Error in Deserialization; check feature flags of wasm module during compilation"),
642+
_ => anyhow::anyhow!(e).context("Error in Deserialization; fatal"),
643+
}
644+
})
640645
}
641646
}

0 commit comments

Comments
 (0)