baking-bad / tezos-on-tezos

Michelson VM and Tezos OS in Rust
MIT License
25 stars 1 forks source link

Floating point operations from serde #15

Closed renatoalencar closed 1 year ago

renatoalencar commented 1 year ago

When running make debug I receive the following output:

cargo build --package tez_kernel --target wasm32-unknown-unknown --profile release --target-dir ./target/repl
    Finished release [optimized] target(s) in 0.32s
wasm-strip -o ./.bin/debug_kernel.wasm ./target/repl/wasm32-unknown-unknown/release/tez_kernel.wasm
docker run --rm -it --entrypoint=/bin/sh --name wasm-repl -v $PWD/.bin:/.bin tezos/tezos:master_f9675b19_20230303221946 -c '/usr/local/bin/octez-smart-rollup-wasm-debugger /.bin/debug_kernel.wasm --inputs /.bin/inputs.json'
Error
  Unknown exception: Error(_, "float instructions are forbidden")

make: *** [debug] Error 1

Running grep -nE 'f(32|64)\.' ./.bin/kernel.wat I can find a few occurrences of floating point instructions, and looking into the wat file I could find the following functions, with mangled names:

I'm not sure how to solve this, but I believe we could do something with conditional compilation directly on serde, since cfg(no_integer128) (example https://github.com/serde-rs/serde/blob/master/serde/src/de/mod.rs#L121) opens this possibility.