ref-fvm
ref-fvm copied to clipboard
better support for mnontrapping-fptoint/sign-extend features
when use fvm tester to run, got failed message when install actor, but when i disable this feature the tester work fine, so I guess there might be a problem here, please check the code here.
fn load_raw(&self, raw_wasm: &[u8]) -> anyhow::Result<Module> {
// First make sure that non-instrumented wasm is valid
Module::validate(&self.0.engine, raw_wasm)
.map_err(anyhow::Error::msg)
.with_context(|| "failed to validate actor wasm")?;
// Note: when adding debug mode support (with recorded syscall replay) don't instrument to
// avoid breaking debug info
use fvm_wasm_instrument::gas_metering::inject;
use fvm_wasm_instrument::inject_stack_limiter;
use fvm_wasm_instrument::parity_wasm::deserialize_buffer;
let m = deserialize_buffer(raw_wasm)?;
this code use parity-wasm to parse wasm binary, but but this library not support mnontrapping-fptoint feature, i have a pr to support this feature https://github.com/paritytech/parity-wasm/pull/333/files
and in fvm-wasm-instrument export feature ext_sign, bulk, and in ref-fvm only enable bulk feature, maybe need to be fixed
@Stebalien
@Stebalien did plan to fix this issue? if you do not have time, i could help to fix this issue include fvm-wasm-instrument/ref-fvm
Well, we'd need your patch merged or we'd need to fork. I'll see if anyone has contacts at parity.
@Stebalien sadly parity did not to maintain this repo. we may need to fork this repo
I'd prefer to just switch to the crates they mentioned (wasmparser and wasm-encoder), but yeah, we might need to fork for now.
We've now enabled the sign extension feature.
Fixed upstream, now just need to update the FVM.