ref-fvm icon indicating copy to clipboard operation
ref-fvm copied to clipboard

better support for mnontrapping-fptoint/sign-extend features

Open hunjixin opened this issue 3 years ago • 5 comments

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

hunjixin avatar Aug 02 '22 05:08 hunjixin

@Stebalien

hunjixin avatar Aug 02 '22 05:08 hunjixin

@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

hunjixin avatar Aug 12 '22 08:08 hunjixin

Well, we'd need your patch merged or we'd need to fork. I'll see if anyone has contacts at parity.

Stebalien avatar Aug 12 '22 15:08 Stebalien

@Stebalien sadly parity did not to maintain this repo. we may need to fork this repo

hunjixin avatar Aug 22 '22 07:08 hunjixin

I'd prefer to just switch to the crates they mentioned (wasmparser and wasm-encoder), but yeah, we might need to fork for now.

Stebalien avatar Sep 01 '22 14:09 Stebalien

We've now enabled the sign extension feature.

Stebalien avatar Nov 09 '22 05:11 Stebalien

Fixed upstream, now just need to update the FVM.

Stebalien avatar Dec 09 '22 16:12 Stebalien