-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(octez): allow float in octez rollup node
This commit patches both the debugger and the node (and even fast exec)
- Loading branch information
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
diff --git a/src/lib_scoru_wasm/fast/module_cache.ml b/src/lib_scoru_wasm/fast/module_cache.ml | ||
index 92ab9996c8..42960b9bd9 100644 | ||
--- a/src/lib_scoru_wasm/fast/module_cache.ml | ||
+++ b/src/lib_scoru_wasm/fast/module_cache.ml | ||
@@ -55,7 +55,7 @@ let load_parse_module ~hooks store key durable = | ||
(fun () -> | ||
let* _ast = | ||
Tezos_webassembly_interpreter.Decode.decode | ||
- ~allow_floats:false | ||
+ ~allow_floats:true | ||
~name:"boot.wasm" | ||
~bytes:kernel | ||
in | ||
diff --git a/src/lib_scoru_wasm/wasm_vm.ml b/src/lib_scoru_wasm/wasm_vm.ml | ||
index 62b8ef3104..3cc1efb96f 100644 | ||
--- a/src/lib_scoru_wasm/wasm_vm.ml | ||
+++ b/src/lib_scoru_wasm/wasm_vm.ml | ||
@@ -220,7 +220,7 @@ let unsafe_next_tick_state ~wasm_entrypoint ~version ~stack_size_limit | ||
let* kernel = Durable.find_value_exn durable Constants.kernel_key in | ||
let* m = | ||
Tezos_webassembly_interpreter.Decode.module_step | ||
- ~allow_floats:false | ||
+ ~allow_floats:true | ||
kernel | ||
m | ||
in | ||
diff --git a/src/lib_wasm_debugger/wasm_debugger.ml b/src/lib_wasm_debugger/wasm_debugger.ml | ||
index 4a0748f917..612bd3e500 100644 | ||
--- a/src/lib_wasm_debugger/wasm_debugger.ml | ||
+++ b/src/lib_wasm_debugger/wasm_debugger.ml | ||
@@ -28,7 +28,7 @@ module Make (Wasm : Wasm_utils_intf.S) = struct | ||
|
||
let parse_binary_module name module_ = | ||
let bytes = Tezos_lazy_containers.Chunked_byte_vector.of_string module_ in | ||
- Tezos_webassembly_interpreter.Decode.decode ~allow_floats:false ~name ~bytes | ||
+ Tezos_webassembly_interpreter.Decode.decode ~allow_floats:true ~name ~bytes | ||
|
||
(* [typecheck_module module_ast] runs the typechecker on the module, which is | ||
not done by the PVM. *) | ||
diff --git a/src/lib_wasmer/api_funcs_desc.ml b/src/lib_wasmer/api_funcs_desc.ml | ||
index 40e1a1612c..8b3f776f2e 100644 | ||
--- a/src/lib_wasmer/api_funcs_desc.ml | ||
+++ b/src/lib_wasmer/api_funcs_desc.ml | ||
@@ -160,6 +160,12 @@ module Functions (S : FOREIGN) = struct | ||
"wasm_config_set_features" | ||
(ptr Types.Config.t @-> ptr Types.Wasmer.Features.t @-> returning void) | ||
|
||
+ let canonicalize_nans = | ||
+ foreign | ||
+ "wasm_config_canonicalize_nans" | ||
+ (ptr Types.Config.t @-> bool @-> returning void) | ||
+ | ||
+ | ||
let delete = | ||
foreign "wasm_config_delete" (ptr Types.Config.t @-> returning void) | ||
end | ||
diff --git a/src/lib_wasmer/config.ml b/src/lib_wasmer/config.ml | ||
index e32b7203bc..8f5fbca586 100644 | ||
--- a/src/lib_wasmer/config.ml | ||
+++ b/src/lib_wasmer/config.ml | ||
@@ -62,4 +62,5 @@ let to_owned desc = | ||
if not has_compiler then raise (Compiler_unavailable desc.compiler) ; | ||
Functions.Config.set_compiler conf desc.compiler ; | ||
Functions.Config.set_features conf (make_features ()) ; | ||
+ Functions.Config.canonicalize_nans conf true ; | ||
conf |