diff --git a/.gitlab/ci/pipelines/before_merging.yml b/.gitlab/ci/pipelines/before_merging.yml index 8974e4a7b6fba26b6402c2879bc67c242a510006..a605e579a2c6bb51e46156eb909e91c7f54b0211 100644 --- a/.gitlab/ci/pipelines/before_merging.yml +++ b/.gitlab/ci/pipelines/before_merging.yml @@ -743,6 +743,65 @@ oc.build_x86_64-exp-dev-extra: - _build/default/contrib/octez_injector_server/octez_injector_server.exe when: on_success +wasm-runtime-check: + image: ${ci_image_name}/build:${ci_image_tag} + stage: build + tags: + - gcp + rules: + - changes: + - .gitlab-ci.yml + - .gitlab/**/* + - etherlink/lib_wasm_runtime/**/*.rs + when: on_success + needs: + - job: oc.docker:ci:amd64 + - job: trigger + - job: sanity_ci + optional: true + - job: docker:hadolint + optional: true + - job: oc.ocaml_fmt + optional: true + - job: oc.semgrep + optional: true + - job: oc.misc_checks + optional: true + - job: check_jsonnet_fmt + optional: true + - job: check_rust_fmt + optional: true + - job: documentation:rst-check + optional: true + - job: nix + optional: true + - job: commit_titles + optional: true + dependencies: + - oc.docker:ci:amd64 + timeout: 60 minutes + cache: + - key: cargo-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/.cargo/registry/cache + policy: pull-push + - key: sccache-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/_sccache + policy: pull-push + before_script: + - ./scripts/ci/take_ownership.sh + - . ./scripts/version.sh + - eval $(opam env) + - . ./scripts/ci/sccache-start.sh + script: + - etherlink/lib_wasm_runtime/lint.sh + after_script: + - ./scripts/ci/sccache-stop.sh + variables: + CARGO_NET_OFFLINE: "false" + SCCACHE_DIR: $CI_PROJECT_DIR/_sccache + ocaml-check: image: ${ci_image_name}/build:${ci_image_tag} stage: build diff --git a/.gitlab/ci/pipelines/merge_train.yml b/.gitlab/ci/pipelines/merge_train.yml index 6c2379b7c47fb5d1c964c71f40c00a3c29893373..eacfc4ba14997657827aa253c90d3660e0b62565 100644 --- a/.gitlab/ci/pipelines/merge_train.yml +++ b/.gitlab/ci/pipelines/merge_train.yml @@ -743,6 +743,65 @@ oc.build_x86_64-exp-dev-extra: - _build/default/contrib/octez_injector_server/octez_injector_server.exe when: on_success +wasm-runtime-check: + image: ${ci_image_name}/build:${ci_image_tag} + stage: build + tags: + - gcp + rules: + - changes: + - .gitlab-ci.yml + - .gitlab/**/* + - etherlink/lib_wasm_runtime/**/*.rs + when: on_success + needs: + - job: oc.docker:ci:amd64 + - job: trigger + - job: sanity_ci + optional: true + - job: docker:hadolint + optional: true + - job: oc.ocaml_fmt + optional: true + - job: oc.semgrep + optional: true + - job: oc.misc_checks + optional: true + - job: check_jsonnet_fmt + optional: true + - job: check_rust_fmt + optional: true + - job: documentation:rst-check + optional: true + - job: nix + optional: true + - job: commit_titles + optional: true + dependencies: + - oc.docker:ci:amd64 + timeout: 60 minutes + cache: + - key: cargo-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/.cargo/registry/cache + policy: pull-push + - key: sccache-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/_sccache + policy: pull-push + before_script: + - ./scripts/ci/take_ownership.sh + - . ./scripts/version.sh + - eval $(opam env) + - . ./scripts/ci/sccache-start.sh + script: + - etherlink/lib_wasm_runtime/lint.sh + after_script: + - ./scripts/ci/sccache-stop.sh + variables: + CARGO_NET_OFFLINE: "false" + SCCACHE_DIR: $CI_PROJECT_DIR/_sccache + ocaml-check: image: ${ci_image_name}/build:${ci_image_tag} stage: build diff --git a/.gitlab/ci/pipelines/schedule_extended_test.yml b/.gitlab/ci/pipelines/schedule_extended_test.yml index f2b75590a2e73dc7e14a3c4f89beb93c5d019c5b..85169cdf9ac5cbe13baeac5edc115b095385d059 100644 --- a/.gitlab/ci/pipelines/schedule_extended_test.yml +++ b/.gitlab/ci/pipelines/schedule_extended_test.yml @@ -485,6 +485,39 @@ oc.build_x86_64-exp-dev-extra: - _build/default/contrib/octez_injector_server/octez_injector_server.exe when: on_success +wasm-runtime-check: + image: ${ci_image_name}/build:${ci_image_tag} + stage: build + tags: + - gcp + rules: + - when: always + dependencies: + - oc.docker:ci:amd64 + timeout: 60 minutes + cache: + - key: cargo-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/.cargo/registry/cache + policy: pull-push + - key: sccache-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/_sccache + policy: pull-push + interruptible: false + before_script: + - ./scripts/ci/take_ownership.sh + - . ./scripts/version.sh + - eval $(opam env) + - . ./scripts/ci/sccache-start.sh + script: + - etherlink/lib_wasm_runtime/lint.sh + after_script: + - ./scripts/ci/sccache-stop.sh + variables: + CARGO_NET_OFFLINE: "false" + SCCACHE_DIR: $CI_PROJECT_DIR/_sccache + ocaml-check: image: ${ci_image_name}/build:${ci_image_tag} stage: build diff --git a/Makefile b/Makefile index 36d21e2d330831d06f91899c553596edc0e86d4f..fb07e1063c7740ab7ef7a06a8f75d8f073622d06 100644 --- a/Makefile +++ b/Makefile @@ -577,3 +577,9 @@ clean-kernels: $(MAKE) -f kernels.mk clean $(MAKE) -f etherlink.mk clean $(MAKE) -C src/riscv clean + +.PHONY: wasm_runtime_gen_files +wasm_runtime_gen_files:: + @cd etherlink/lib_wasm_runtime; cargo build 2> /dev/null + +octez-evm-node: wasm_runtime_gen_files diff --git a/ci/bin/code_verification.ml b/ci/bin/code_verification.ml index 1f8220db541f4cd42ffa0cd85d0c924ab4c9c1a2..f9156d7a93122d147c9c9f3239a590f6e09fb5b6 100644 --- a/ci/bin/code_verification.ml +++ b/ci/bin/code_verification.ml @@ -596,6 +596,23 @@ let jobs pipeline_type = [job_build_rpm_amd64] | Before_merging | Merge_train -> [] in + let wasm_runtime_check : tezos_job = + job + ~__POS__ + ~name:"wasm-runtime-check" + ~image:Images.CI.build + ~stage:Stages.build + ~dependencies:dependencies_needs_start + ~rules:(make_rules ~changes:changeset_wasm_runtime_check_files ()) + ~before_script: + (before_script + ~take_ownership:true + ~source_version:true + ~eval_opam:true + []) + ["etherlink/lib_wasm_runtime/lint.sh"] + |> enable_cargo_cache |> enable_sccache + in let job_ocaml_check : tezos_job = job ~__POS__ @@ -651,6 +668,7 @@ let jobs pipeline_type = job_static_x86_64_experimental; job_build_x86_64_release; job_build_x86_64_exp_dev_extra; + wasm_runtime_check; job_ocaml_check; job_build_kernels; job_build_dsn_node; diff --git a/ci/bin/common.ml b/ci/bin/common.ml index 3a45b291cfb050a31ee3a1ba464bdd47bce97526..92a54bc3273b8417e64a487ff2f3d4920b95af29 100644 --- a/ci/bin/common.ml +++ b/ci/bin/common.ml @@ -479,6 +479,10 @@ let changeset_ocaml_check_files = changeset_base @ make ["src/**/*"; "tezt/**/*"; "devtools/**/*"; "**/*.ml"; "**/*.mli"]) +(** Set of files for checking the WASM Runtime bindings. *) +let changeset_wasm_runtime_check_files = + Changeset.(changeset_base @ make ["etherlink/lib_wasm_runtime/**/*.rs"]) + let changeset_lift_limits_patch = Changeset.( changeset_base diff --git a/etherlink/bin_node/dune b/etherlink/bin_node/dune index beacb55d4c00f362eb4c8f37b1ed27de5f789756..d8a33c193562346dafdf8216425ec1e1d4335280 100644 --- a/etherlink/bin_node/dune +++ b/etherlink/bin_node/dune @@ -18,7 +18,8 @@ octez-shell-libs.client-base-unix octez-l2-libs.sqlite octez-evm-node-libs.evm_node_lib_dev - octez-evm-node-libs.evm_node_config) + octez-evm-node-libs.evm_node_config + octez-rust-deps) (link_flags (:standard) (:include %{workspace_root}/static-link-flags.sexp) diff --git a/etherlink/bin_node/index.mld b/etherlink/bin_node/index.mld index 6a7321d330d87958af661308119b1871b8a660f3..7cfd6ef2aa26710ffb1e87d9e449a1bc84157652 100644 --- a/etherlink/bin_node/index.mld +++ b/etherlink/bin_node/index.mld @@ -9,4 +9,5 @@ It contains the following libraries: - {{!module-Evm_node_lib_dev}Evm_node_lib_dev}: An implementation of a subset of Ethereum JSON-RPC API for the EVM rollup [dev version] - {{!module-Evm_node_lib_dev_encoding}Evm_node_lib_dev_encoding}: EVM encodings for the EVM node and plugin for the WASM Debugger [dev version] - {{!module-Evm_node_migrations}Evm_node_migrations}: SQL migrations for the EVM node store +- {{!module-Evm_node_wasm_runtime}Evm_node_wasm_runtime}: WASM runtime compatible with the WASM PVM - {{!module-Wasm_runtime_callbacks}Wasm_runtime_callbacks}: Callbacks implementing the I/O functions required to implement the host functions of the WASM runtime diff --git a/etherlink/bin_node/lib_dev/dune b/etherlink/bin_node/lib_dev/dune index 746ac30556f1fa77029a29fb92da586de088ac99..4ad8f9b6cacecf244d6313e78c47d409bd70b626 100644 --- a/etherlink/bin_node/lib_dev/dune +++ b/etherlink/bin_node/lib_dev/dune @@ -30,7 +30,8 @@ octez-evm-node-libs.evm_node_migrations octez-evm-node-libs.evm_node_kernels octez-libs.prometheus-app - tezos-dal-node-services) + tezos-dal-node-services + octez-evm-node-libs.evm_node_wasm_runtime) (flags (:standard) -open Tezos_base.TzPervasives diff --git a/etherlink/bin_node/lib_dev/wasm_runtime.ml b/etherlink/bin_node/lib_dev/wasm_runtime.ml new file mode 100644 index 0000000000000000000000000000000000000000..4ed9c27a9370c3e59d52bfbc38e4dd148f5ab7a6 --- /dev/null +++ b/etherlink/bin_node/lib_dev/wasm_runtime.ml @@ -0,0 +1,10 @@ +(*****************************************************************************) +(* *) +(* SPDX-License-Identifier: MIT *) +(* Copyright (c) 2024 Nomadic Labs *) +(* *) +(*****************************************************************************) + +let run tree = + let open Lwt_syntax in + return (Evm_node_wasm_runtime.wasm_runtime_id tree) diff --git a/etherlink/bin_node/lib_dev/wasm_runtime.mli b/etherlink/bin_node/lib_dev/wasm_runtime.mli new file mode 100644 index 0000000000000000000000000000000000000000..5960ae89880a8b93e55d2d7d37c6eec50bd3426c --- /dev/null +++ b/etherlink/bin_node/lib_dev/wasm_runtime.mli @@ -0,0 +1,10 @@ +(*****************************************************************************) +(* *) +(* SPDX-License-Identifier: MIT *) +(* Copyright (c) 2024 Nomadic Labs *) +(* *) +(*****************************************************************************) + +(** [run tree] calls the WASM runtime, feeding it [tree], and computing the + next [tree]. *) +val run : Irmin_context.tree -> Irmin_context.tree Lwt.t diff --git a/etherlink/bin_node/test/dune b/etherlink/bin_node/test/dune index f3904f982c754c3657aec8ed31ccfd51d72be134..c781ca69b4818e9c4a5120ab79e2d2c5e5add374 100644 --- a/etherlink/bin_node/test/dune +++ b/etherlink/bin_node/test/dune @@ -15,6 +15,7 @@ octez-evm-node-libs.evm_node_lib_dev octez-libs.tezt-wrapper tezt-tezos + octez-l2-libs.layer2_store tezos-protocol-alpha.protocol) (library_flags (:standard -linkall)) (flags @@ -28,8 +29,9 @@ -open Tezt_wrapper -open Tezt_wrapper.Base -open Tezt_tezos - -open Tezt_tezos.Runnable.Syntax) - (modules test_rlp test_ethbloom test_call_tracer_algo)) + -open Tezt_tezos.Runnable.Syntax + -open Tezos_layer2_store) + (modules test_rlp test_ethbloom test_call_tracer_algo test_wasm_runtime)) (executable (name main) diff --git a/etherlink/bin_node/test/test_wasm_runtime.ml b/etherlink/bin_node/test/test_wasm_runtime.ml new file mode 100644 index 0000000000000000000000000000000000000000..9749e64e9b186a73e2fab0cbb9613d01ecaab971 --- /dev/null +++ b/etherlink/bin_node/test/test_wasm_runtime.ml @@ -0,0 +1,36 @@ +(*****************************************************************************) +(* *) +(* SPDX-License-Identifier: MIT *) +(* Copyright (c) 2024 Nomadic Labs *) +(* *) +(*****************************************************************************) + +(* Testing + ------- + Component: EVM Node’s WASM Runtime + Invocation: dune exec -- etherlink/bin_node/test/main.exe wasm_runtime +*) + +open Evm_node_lib_dev + +let register ?(tags = []) = + Test.register + ~uses_node:false + ~uses_client:false + ~uses_admin_client:false + ~__FILE__ + ~tags:("wasm_runtime" :: tags) + +let context_hash_typ = Check.(convert Context_hash.to_b58check string) + +let empty_tree = Irmin_context.PVMState.empty () + +let test_wasm_runtime_id () = + register ~title:"test wasm_runtime_run" @@ fun () -> + let hash = Irmin_context.Tree.hash empty_tree in + let* empty_tree_id = Wasm_runtime.run empty_tree in + let hash_id = Irmin_context.Tree.hash empty_tree_id in + Check.((hash = hash_id) context_hash_typ ~error_msg:"Hash should be the same") ; + unit + +let () = test_wasm_runtime_id () diff --git a/etherlink/lib_wasm_runtime/.gitignore b/etherlink/lib_wasm_runtime/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..2f7896d1d1365eafb0da03d9fe456fac81408487 --- /dev/null +++ b/etherlink/lib_wasm_runtime/.gitignore @@ -0,0 +1 @@ +target/ diff --git a/etherlink/lib_wasm_runtime/Cargo.lock b/etherlink/lib_wasm_runtime/Cargo.lock new file mode 100644 index 0000000000000000000000000000000000000000..c0bb7c1dabc08397c5b058402a85a323e1f8c782 --- /dev/null +++ b/etherlink/lib_wasm_runtime/Cargo.lock @@ -0,0 +1,1448 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +dependencies = [ + "gimli 0.31.0", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "ahash" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytecheck" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" + +[[package]] +name = "cc" +version = "1.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "corosensei" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80128832c58ea9cbd041d2a759ec449224487b2c1e400453d99d244eead87a8e" +dependencies = [ + "autocfg", + "cfg-if", + "libc", + "scopeguard", + "windows-sys 0.33.0", +] + +[[package]] +name = "cranelift-bforest" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2ab4512dfd3a6f4be184403a195f76e81a8a9f9e6c898e19d2dc3ce20e0115" +dependencies = [ + "cranelift-entity", +] + +[[package]] +name = "cranelift-codegen" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98b022ed2a5913a38839dfbafe6cf135342661293b08049843362df4301261dc" +dependencies = [ + "arrayvec", + "bumpalo", + "cranelift-bforest", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-egraph", + "cranelift-entity", + "cranelift-isle", + "gimli 0.26.2", + "log", + "regalloc2", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "639307b45434ad112a98f8300c0f0ab085cbefcd767efcdef9ef19d4c0756e74" +dependencies = [ + "cranelift-codegen-shared", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "278e52e29c53fcf32431ef08406c295699a70306d05a0715c5b1bf50e33a9ab7" + +[[package]] +name = "cranelift-egraph" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624b54323b06e675293939311943ba82d323bb340468ce1889be5da7932c8d73" +dependencies = [ + "cranelift-entity", + "fxhash", + "hashbrown 0.12.3", + "indexmap", + "log", + "smallvec", +] + +[[package]] +name = "cranelift-entity" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a59bcbca89c3f1b70b93ab3cbba5e5e0cbf3e63dadb23c7525cb142e21a9d4c" + +[[package]] +name = "cranelift-frontend" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d70abacb8cfef3dc8ff7e8836e9c1d70f7967dfdac824a4cd5e30223415aca6" +dependencies = [ + "cranelift-codegen", + "log", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-isle" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "393bc73c451830ff8dbb3a07f61843d6cb41a084f9996319917c0b291ed785bb" + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "enum-iterator" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eeac5c5edb79e4e39fe8439ef35207780a11f69c52cbe424ce3dfad4cb78de6" +dependencies = [ + "enum-iterator-derive", +] + +[[package]] +name = "enum-iterator-derive" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "enumset" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07a4b049558765cef5f0c1a273c3fc57084d768b44d2f98127aef4cceb17293" +dependencies = [ + "enumset_derive", +] + +[[package]] +name = "enumset_derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +dependencies = [ + "fallible-iterator", + "indexmap", + "stable_deref_trait", +] + +[[package]] +name = "gimli" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "js-sys" +version = "0.3.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "mach" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", +] + +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + +[[package]] +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + +[[package]] +name = "object" +version = "0.36.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +dependencies = [ + "memchr", +] + +[[package]] +name = "ocaml" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d8d4c8f085edfe98a1edf883c560019626194814237b12138ac160caa6c776c" +dependencies = [ + "ocaml-boxroot-sys", + "ocaml-derive", + "ocaml-sys", +] + +[[package]] +name = "ocaml-boxroot-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "541b4c121093aa5bfb1b0e0d6f8ca00c807b156445bc4f4e19683421f6d26208" +dependencies = [ + "cc", +] + +[[package]] +name = "ocaml-build" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d51b05aa0083eaec54b22a3f2a3d49175e04b4fb77ca7abb5a85731736239c3" +dependencies = [ + "cc", + "proc-macro2", + "syn 2.0.77", +] + +[[package]] +name = "ocaml-derive" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3de4a0decff0fd3ee0928dfa15dac08651157f8f814e93b34fdf962190354035" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "ocaml-sys" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff95caad36996cfaa425f1469bf0c132afac668e2654d5d1d89d1cc64001be02" +dependencies = [ + "cc", + "cty", +] + +[[package]] +name = "octez-evm-node-wasm-runtime" +version = "0.0.0-dev" +dependencies = [ + "ocaml", + "ocaml-build", + "wasmer", + "wasmer-compiler-cranelift", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" +dependencies = [ + "bitflags 2.6.0", +] + +[[package]] +name = "regalloc2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300d4fbfb40c1c66a78ba3ddd41c1110247cf52f97b87d0f2fc9209bd49b030c" +dependencies = [ + "fxhash", + "log", + "slice-group-by", + "smallvec", +] + +[[package]] +name = "region" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" +dependencies = [ + "bitflags 1.3.2", + "libc", + "mach2", + "windows-sys 0.52.0", +] + +[[package]] +name = "rend" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" +dependencies = [ + "bytecheck", +] + +[[package]] +name = "rkyv" +version = "0.7.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" +dependencies = [ + "bitvec", + "bytecheck", + "bytes", + "hashbrown 0.12.3", + "indexmap", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "serde" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "thiserror" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "tinyvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "unicode-normalization" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "url" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +dependencies = [ + "cfg-if", + "once_cell", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.77", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-downcast" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dac026d43bcca6e7ce1c0956ba68f59edf6403e8e930a5d891be72c31a44340" +dependencies = [ + "js-sys", + "once_cell", + "wasm-bindgen", + "wasm-bindgen-downcast-macros", +] + +[[package]] +name = "wasm-bindgen-downcast-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5020cfa87c7cecefef118055d44e3c1fc122c7ec25701d528ee458a0b45f38f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" + +[[package]] +name = "wasm-encoder" +version = "0.217.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b88b0814c9a2b323a9b46c687e726996c255ac8b64aa237dd11c81ed4854760" +dependencies = [ + "leb128", +] + +[[package]] +name = "wasmer" +version = "3.3.0" +dependencies = [ + "bytes", + "cfg-if", + "derivative", + "indexmap", + "js-sys", + "more-asserts", + "rustc-demangle", + "serde", + "serde-wasm-bindgen", + "target-lexicon", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-downcast", + "wasmer-compiler", + "wasmer-compiler-cranelift", + "wasmer-derive", + "wasmer-types", + "wasmer-vm", + "wat", + "winapi", +] + +[[package]] +name = "wasmer-compiler" +version = "3.3.0" +dependencies = [ + "backtrace", + "cfg-if", + "enum-iterator", + "enumset", + "lazy_static", + "leb128", + "memmap2", + "more-asserts", + "region", + "smallvec", + "thiserror", + "wasmer-types", + "wasmer-vm", + "wasmparser", + "winapi", +] + +[[package]] +name = "wasmer-compiler-cranelift" +version = "3.3.0" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "gimli 0.26.2", + "more-asserts", + "rayon", + "smallvec", + "target-lexicon", + "tracing", + "wasmer-compiler", + "wasmer-types", +] + +[[package]] +name = "wasmer-derive" +version = "3.3.0" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "wasmer-types" +version = "3.3.0" +dependencies = [ + "bytecheck", + "enum-iterator", + "enumset", + "indexmap", + "more-asserts", + "rkyv", + "target-lexicon", + "thiserror", +] + +[[package]] +name = "wasmer-vm" +version = "3.3.0" +dependencies = [ + "backtrace", + "cc", + "cfg-if", + "corosensei", + "dashmap", + "derivative", + "enum-iterator", + "fnv", + "indexmap", + "lazy_static", + "libc", + "mach", + "memoffset", + "more-asserts", + "region", + "scopeguard", + "thiserror", + "wasmer-types", + "winapi", +] + +[[package]] +name = "wasmparser" +version = "0.95.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ea896273ea99b15132414be1da01ab0d8836415083298ecaffbe308eaac87a" +dependencies = [ + "indexmap", + "url", +] + +[[package]] +name = "wast" +version = "217.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79004ecebded92d3c710d4841383368c7f04b63d0992ddd6b0c7d5029b7629b7" +dependencies = [ + "bumpalo", + "leb128", + "memchr", + "unicode-width", + "wasm-encoder", +] + +[[package]] +name = "wat" +version = "1.217.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c126271c3d92ca0f7c63e4e462e40c69cca52fd4245fcda730d1cf558fb55088" +dependencies = [ + "wast", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43dbb096663629518eb1dfa72d80243ca5a6aca764cae62a2df70af760a9be75" +dependencies = [ + "windows_aarch64_msvc 0.33.0", + "windows_i686_gnu 0.33.0", + "windows_i686_msvc 0.33.0", + "windows_x86_64_gnu 0.33.0", + "windows_x86_64_msvc 0.33.0", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] diff --git a/etherlink/lib_wasm_runtime/Cargo.toml b/etherlink/lib_wasm_runtime/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..b564de3e74325cde2b4cdd47f370cb49582c3198 --- /dev/null +++ b/etherlink/lib_wasm_runtime/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "octez-evm-node-wasm-runtime" +version = "0.0.0-dev" +authors = [ "Etherlink Core Engineers " ] +edition = "2021" + +[build-dependencies] +ocaml-build = { version = "1.*", features = ["dune"] } + +[dependencies] +ocaml = { version = "1.*" } +wasmer = { path = "../../src/rust_deps/wasmer-3.3.0/lib/api", features = [] } +wasmer-compiler-cranelift = { path = "../../src/rust_deps/wasmer-3.3.0/lib/compiler-cranelift" } diff --git a/etherlink/lib_wasm_runtime/README.md b/etherlink/lib_wasm_runtime/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8f5b2f6c5c7c818031971e395005928c52cb6f36 --- /dev/null +++ b/etherlink/lib_wasm_runtime/README.md @@ -0,0 +1,15 @@ +# A WASM Runtime for the EVM Node + +- The `octez-evm-node-wasm-runtime` crate is the place where the WASM Runtime + (in Rust) is implemented. +- We add a `build.rs` script to generate an OCaml module allowing to call the + FFI functions exposed by `ocaml-rs`. The resulting module is exported as part + of the `evm_node_wasm_runtime` library. The module needs to be generated + manually, and the script `lint.sh` allows anyone to verify the files in + `ocaml-api` are up-to-date. +- We add `octez-evm-node-wasm-runtime` to the `rust_deps` crate. This means + the WASM Runtime will be part of the `.a` static library generated by this + crate. Since this static library is already used by the EVM node, this is + enough to make the WASM Runtime available to the EVM Node library. + +![Architecture diagram explaining how this library works](architecture.png) diff --git a/etherlink/lib_wasm_runtime/architecture.png b/etherlink/lib_wasm_runtime/architecture.png new file mode 100644 index 0000000000000000000000000000000000000000..0288af625cf5b225144ab8cfb1d5dffeadd3c519 Binary files /dev/null and b/etherlink/lib_wasm_runtime/architecture.png differ diff --git a/etherlink/lib_wasm_runtime/build.rs b/etherlink/lib_wasm_runtime/build.rs new file mode 100644 index 0000000000000000000000000000000000000000..9c2f4cccf979225c354db63983bfcd24487f1a48 --- /dev/null +++ b/etherlink/lib_wasm_runtime/build.rs @@ -0,0 +1,15 @@ +// SPDX-FileCopyrightText: 2024 Nomadic Labs + +fn main() { + let dune = std::env::var("INSIDE_DUNE").is_err(); + let lint = std::env::var("LINT").is_ok(); + + if lint || dune { + ocaml_build::Sigs::new(format!( + "ocaml-api/{}wasm_runtime_gen.ml", + if lint { ".expected-" } else { "" } + )) + .generate() + .unwrap(); + } +} diff --git a/etherlink/lib_wasm_runtime/lint.sh b/etherlink/lib_wasm_runtime/lint.sh new file mode 100755 index 0000000000000000000000000000000000000000..d2f1120ba35feb12015ac1d8c2231ab696cd4e17 --- /dev/null +++ b/etherlink/lib_wasm_runtime/lint.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +BUILD_LOGS="$(mktemp)" +START_DIR="$(pwd)" +TOPLEVEL="$(git rev-parse --show-toplevel)" +FILES=("wasm_runtime_gen.ml" "wasm_runtime_gen.mli") + +cd "$TOPLEVEL/etherlink/lib_wasm_runtime" || exit 3 + +# shellcheck disable=SC2317 +function cleanup() { + for file in "${FILES[@]}"; do + rm -f "ocaml-api/.expected-$file" + done + rm -f "$BUILD_LOGS" + + cd "$START_DIR" || return +} + +trap 'cleanup' SIGINT SIGTERM +trap 'cleanup; exit' EXIT + +# ensure the necessary toolchain is installed +rustup show active-toolchain > /dev/null 2> /dev/null +# ensure the build script will be run +touch build.rs + +if ! LINT=yes cargo build 2> "$BUILD_LOGS"; then + echo "'cargo build' failed:" + cat "$BUILD_LOGS" + + exit 2 +fi + +exit_code="0" + +for file in "${FILES[@]}"; do + if ! diff "ocaml-api/$file" "ocaml-api/.expected-$file"; then + echo "$file is outdated" + exit_code=1 + fi +done + +if [ "$exit_code" -ne 0 ]; then + echo "Run 'cargo clean; cargo build' to regenerate outdated files" +fi + +exit $exit_code diff --git a/etherlink/lib_wasm_runtime/ocaml-api/.ocamlformat-ignore b/etherlink/lib_wasm_runtime/ocaml-api/.ocamlformat-ignore new file mode 100644 index 0000000000000000000000000000000000000000..4fbfb9a858668acf6133079c613bf4d5a64af400 --- /dev/null +++ b/etherlink/lib_wasm_runtime/ocaml-api/.ocamlformat-ignore @@ -0,0 +1,2 @@ +wasm_runtime_gen.ml +wasm_runtime_gen.mli diff --git a/etherlink/lib_wasm_runtime/ocaml-api/dune b/etherlink/lib_wasm_runtime/ocaml-api/dune new file mode 100644 index 0000000000000000000000000000000000000000..bc6d17d9393e8542091e5af2d75b4e28dd8eb5ae --- /dev/null +++ b/etherlink/lib_wasm_runtime/ocaml-api/dune @@ -0,0 +1,15 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name evm_node_wasm_runtime) + (public_name octez-evm-node-libs.evm_node_wasm_runtime) + (instrumentation (backend bisect_ppx)) + (libraries + octez-l2-libs.layer2_store + octez-rust-deps + octez-evm-node-libs.wasm_runtime_callbacks) + (flags + (:standard) + -w -66 + -open Tezos_layer2_store)) diff --git a/etherlink/lib_wasm_runtime/ocaml-api/evm_node_wasm_runtime.ml b/etherlink/lib_wasm_runtime/ocaml-api/evm_node_wasm_runtime.ml new file mode 100644 index 0000000000000000000000000000000000000000..0572ac0f1eef16f5243db9848fbd888d26c11560 --- /dev/null +++ b/etherlink/lib_wasm_runtime/ocaml-api/evm_node_wasm_runtime.ml @@ -0,0 +1,10 @@ +(*****************************************************************************) +(* *) +(* SPDX-License-Identifier: MIT *) +(* Copyright (c) 2024 Nomadic Labs *) +(* *) +(*****************************************************************************) + +let () = Wasm_runtime_callbacks.register () + +include Wasm_runtime_gen diff --git a/etherlink/lib_wasm_runtime/ocaml-api/evm_node_wasm_runtime.mli b/etherlink/lib_wasm_runtime/ocaml-api/evm_node_wasm_runtime.mli new file mode 100644 index 0000000000000000000000000000000000000000..1a7b4fbf8feefa0cd0409775889e57a38102d339 --- /dev/null +++ b/etherlink/lib_wasm_runtime/ocaml-api/evm_node_wasm_runtime.mli @@ -0,0 +1,13 @@ +(*****************************************************************************) +(* *) +(* SPDX-License-Identifier: MIT *) +(* Copyright (c) 2024 Nomadic Labs *) +(* *) +(*****************************************************************************) + +(** [id tree] is the identity function, returning [tree] untouched. + + It will be removed in a later version, but is introduced temporarily to + prove the library is working. *) +external wasm_runtime_id : Irmin_context.tree -> Irmin_context.tree + = "wasm_runtime_id" diff --git a/etherlink/lib_wasm_runtime/ocaml-api/wasm_runtime_gen.ml b/etherlink/lib_wasm_runtime/ocaml-api/wasm_runtime_gen.ml new file mode 100644 index 0000000000000000000000000000000000000000..c542b3f42d8585a4a5b0f79d3040e3f7606e16c8 --- /dev/null +++ b/etherlink/lib_wasm_runtime/ocaml-api/wasm_runtime_gen.ml @@ -0,0 +1,7 @@ +(* Generated by ocaml-rs *) + +open! Bigarray + +(* file: api.rs *) + +external wasm_runtime_id: Irmin_context.tree -> Irmin_context.tree = "wasm_runtime_id" diff --git a/etherlink/lib_wasm_runtime/ocaml-api/wasm_runtime_gen.mli b/etherlink/lib_wasm_runtime/ocaml-api/wasm_runtime_gen.mli new file mode 100644 index 0000000000000000000000000000000000000000..c542b3f42d8585a4a5b0f79d3040e3f7606e16c8 --- /dev/null +++ b/etherlink/lib_wasm_runtime/ocaml-api/wasm_runtime_gen.mli @@ -0,0 +1,7 @@ +(* Generated by ocaml-rs *) + +open! Bigarray + +(* file: api.rs *) + +external wasm_runtime_id: Irmin_context.tree -> Irmin_context.tree = "wasm_runtime_id" diff --git a/etherlink/lib_wasm_runtime/src/api.rs b/etherlink/lib_wasm_runtime/src/api.rs new file mode 100644 index 0000000000000000000000000000000000000000..2b92b8332da264e1f46f109d007045f64644d7c7 --- /dev/null +++ b/etherlink/lib_wasm_runtime/src/api.rs @@ -0,0 +1,9 @@ +// SPDX-FileCopyrightText: 2024 Nomadic Labs + +use crate::types::EvmTree; + +#[ocaml::func] +#[ocaml::sig("Irmin_context.tree -> Irmin_context.tree")] +pub fn wasm_runtime_id(evm_tree: EvmTree) -> EvmTree { + evm_tree +} diff --git a/etherlink/lib_wasm_runtime/src/lib.rs b/etherlink/lib_wasm_runtime/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..eaaf49a899d7f2532194da8d707c949e6052fde9 --- /dev/null +++ b/etherlink/lib_wasm_runtime/src/lib.rs @@ -0,0 +1,4 @@ +// SPDX-FileCopyrightText: 2024 Nomadic Labs + +pub mod api; +mod types; diff --git a/etherlink/lib_wasm_runtime/src/types.rs b/etherlink/lib_wasm_runtime/src/types.rs new file mode 100644 index 0000000000000000000000000000000000000000..8fa16af9d6f0615d50d8aceb50ed48bb2856533e --- /dev/null +++ b/etherlink/lib_wasm_runtime/src/types.rs @@ -0,0 +1,18 @@ +// SPDX-FileCopyrightText: 2024 Nomadic Labs + +use ocaml::{FromValue, Runtime, ToValue, Value}; + +#[derive(Clone)] +pub struct EvmTree(Value); + +unsafe impl ToValue for EvmTree { + fn to_value(&self, _gc: &Runtime) -> Value { + self.0.clone() + } +} + +unsafe impl FromValue for EvmTree { + fn from_value(value: Value) -> Self { + EvmTree(value) + } +} diff --git a/manifest/product_etherlink.ml b/manifest/product_etherlink.ml index 25dabf54b96c348807784d47578536a121e01314..8e03af93c0a48f2680c642c4b8b05380bcaa4f27 100644 --- a/manifest/product_etherlink.ml +++ b/manifest/product_etherlink.ml @@ -98,7 +98,7 @@ let wasm_runtime_callbacks_tests = ["test_vector"; "test_store"] ~path:"etherlink/lib_wasm_runtime_callbacks/test" ~opam:"octez-evm-wasm-runtime-tests" - ~synopsis:"Tests for the WASM Runtime callbacks" + ~synopsis:"Tests for the WASM Runtime" ~with_macos_security_framework:true ~deps: [ @@ -114,6 +114,18 @@ let wasm_runtime_callbacks_tests = wasm_runtime_callbacks; ] +let wasm_runtime = + octez_evm_node_lib + "evm_node_wasm_runtime" + ~path:"etherlink/lib_wasm_runtime/ocaml-api" + ~synopsis:"WASM runtime compatible with the WASM PVM" + ~deps:[octez_layer2_store |> open_; octez_rust_deps; wasm_runtime_callbacks] + ~flags: + (Flags.standard + ~disable_warnings:[66] + (* We disable the warnings emitted by the files generated by [ocaml-rs]. *) + ()) + let evm_node_migrations = octez_evm_node_lib "evm_node_migrations" @@ -224,11 +236,12 @@ let evm_node_lib_dev = evm_node_kernels; prometheus_app; octez_dal_node_services; + wasm_runtime; ] let _octez_evm_node_tests = tezt - ["test_rlp"; "test_ethbloom"; "test_call_tracer_algo"] + ["test_rlp"; "test_ethbloom"; "test_call_tracer_algo"; "test_wasm_runtime"] ~path:"etherlink/bin_node/test" ~opam:"octez-evm-node-tests" ~synopsis:"Tests for the EVM Node" @@ -244,6 +257,7 @@ let _octez_evm_node_tests = evm_node_lib_dev; tezt_wrapper |> open_ |> open_ ~m:"Base"; tezt_tezos |> open_ |> open_ ~m:"Runnable.Syntax"; + octez_layer2_store |> open_; Protocol.(main alpha); ] @@ -293,6 +307,7 @@ let _evm_node = octez_sqlite |> open_; evm_node_lib_dev; evm_node_config |> open_; + octez_rust_deps; ] ~bisect_ppx:Yes diff --git a/manifest/product_octez.ml b/manifest/product_octez.ml index e09c605a01b8fac67084e562707fbd0308b7e71d..9d84ba395ba27aab589a26eba14626872a9c8413 100644 --- a/manifest/product_octez.ml +++ b/manifest/product_octez.ml @@ -521,6 +521,12 @@ let octez_rust_deps = [S "source_tree"; S "src"]; [S "source_tree"; S "../riscv"]; [S "source_tree"; S "../kernel_sdk"]; + [S "file"; S "../../etherlink/lib_wasm_runtime/Cargo.toml"]; + [S "file"; S "../../etherlink/lib_wasm_runtime/build.rs"]; + [ + S "glob_files_rec"; + S "../../etherlink/lib_wasm_runtime/src/**.rs"; + ]; ]; [S "action"; [S "no-infer"; [S "bash"; S "./build.sh"]]]; ]; diff --git a/manifest/product_octez.mli b/manifest/product_octez.mli index 269d9390ceded0fe5e0beb44fc3976dcb99b991f..b40c74c29d1d03d91b4cec74cc7ad8f89d37c147 100644 --- a/manifest/product_octez.mli +++ b/manifest/product_octez.mli @@ -47,6 +47,8 @@ val octez_rpc_http : Manifest.target val octez_rpc_http_server : Manifest.target +val octez_rust_deps : Manifest.target + val octez_scoru_wasm_debugger_lib : Manifest.target val octez_scoru_wasm_debugger_plugin : Manifest.target diff --git a/opam/octez-evm-node-libs.opam b/opam/octez-evm-node-libs.opam index 1a43709874670798af541a664ab489b76376ce6c..024f6e150d8579fa8f0c728a488cab2de0e3c2ff 100644 --- a/opam/octez-evm-node-libs.opam +++ b/opam/octez-evm-node-libs.opam @@ -13,6 +13,7 @@ depends: [ "octez-libs" "octez-shell-libs" "octez-l2-libs" + "octez-rust-deps" "caqti-lwt" { >= "2.0.1" } "crunch" { >= "3.3.0" } "re" { >= "1.10.0" } diff --git a/opam/octez-evm-node-tests.opam b/opam/octez-evm-node-tests.opam index 242746bd93fc5d7d4ab6e99c44d9a42f01caf48a..ee41c59d710be8a946c81c3d73d185866a4fb9a3 100644 --- a/opam/octez-evm-node-tests.opam +++ b/opam/octez-evm-node-tests.opam @@ -16,6 +16,7 @@ depends: [ "octez-alcotezt" {with-test} "octez-evm-node-libs" {with-test} "tezt-tezos" {with-test} + "octez-l2-libs" {with-test} "tezos-protocol-alpha" {with-test} ] build: [ diff --git a/opam/octez-evm-node.opam b/opam/octez-evm-node.opam index f37571ae82150b3e07206d9b88b5cec5b21e8342..bcc83a6097203024c62a083a0f51cfa608432db5 100644 --- a/opam/octez-evm-node.opam +++ b/opam/octez-evm-node.opam @@ -15,6 +15,7 @@ depends: [ "octez-shell-libs" "octez-l2-libs" "octez-evm-node-libs" { = version } + "octez-rust-deps" ] build: [ ["rm" "-r" "vendors" "contrib"] diff --git a/opam/octez-evm-wasm-runtime-tests.opam b/opam/octez-evm-wasm-runtime-tests.opam index 7f26a7b8913bd45e7760c8d300537130f935eafc..12cc0fb478bf43e732ec1effbff0db45d900f18a 100644 --- a/opam/octez-evm-wasm-runtime-tests.opam +++ b/opam/octez-evm-wasm-runtime-tests.opam @@ -23,4 +23,4 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ["dune" "runtest" "-p" name "-j" jobs] {with-test} ] -synopsis: "Tests for the WASM Runtime callbacks" +synopsis: "Tests for the WASM Runtime" diff --git a/scripts/lint.sh b/scripts/lint.sh index 553fbfb2b19c5c6b6ec6bdcc0b607f20c9de2f54..924be15649bc9fa319f1134219e713f2b736a920 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -45,6 +45,8 @@ license_check_exclude=$( src/lib_protocol_environment/sigs/.* src/riscv/lib/octez_riscv_api.ml src/riscv/lib/octez_riscv_api.mli +etherlink/lib_wasm_runtime/ocaml-api/wasm_runtime_gen.ml +etherlink/lib_wasm_runtime/ocaml-api/wasm_runtime_gen.mli EOF ) diff --git a/src/rust_deps/Cargo.lock b/src/rust_deps/Cargo.lock index 6e60d1f18fcdf5aa5c87671defbc2fdd74c54943..a385d7a4b5864e8a0f17f7cfa18cddebb970926f 100644 --- a/src/rust_deps/Cargo.lock +++ b/src/rust_deps/Cargo.lock @@ -2170,6 +2170,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d51b05aa0083eaec54b22a3f2a3d49175e04b4fb77ca7abb5a85731736239c3" dependencies = [ + "cc", "proc-macro2", "syn 2.0.77", ] @@ -2195,6 +2196,16 @@ dependencies = [ "cty", ] +[[package]] +name = "octez-evm-node-wasm-runtime" +version = "0.0.0-dev" +dependencies = [ + "ocaml", + "ocaml-build", + "wasmer", + "wasmer-compiler-cranelift", +] + [[package]] name = "octez-riscv" version = "0.0.0" @@ -2228,6 +2239,7 @@ name = "octez-rust-deps" version = "0.0.0" dependencies = [ "librustzcash", + "octez-evm-node-wasm-runtime", "octez-riscv", "wasmer-c-api", ] @@ -3933,6 +3945,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-downcast", "wasmer-compiler", + "wasmer-compiler-cranelift", "wasmer-derive", "wasmer-types", "wasmer-vm", diff --git a/src/rust_deps/Cargo.toml b/src/rust_deps/Cargo.toml index c550b9df0d438876949419c2875c0cd87ee9b61f..4097004530c7d7a2664c656f7e0a5ec1ad07986d 100644 --- a/src/rust_deps/Cargo.toml +++ b/src/rust_deps/Cargo.toml @@ -17,3 +17,6 @@ path = "librustzcash" [dependencies.octez-riscv] path = "../riscv/lib" features = ["ocaml-api"] + +[dependencies.octez-evm-node-wasm-runtime] +path = "../../etherlink/lib_wasm_runtime" diff --git a/src/rust_deps/dune b/src/rust_deps/dune index de48dbfde8c66fb0adea090aac2f99f3bc426cd5..675b94fb70403979246368311eaaefec9bfbcf62 100644 --- a/src/rust_deps/dune +++ b/src/rust_deps/dune @@ -21,5 +21,8 @@ (source_tree wasmer-3.3.0) (source_tree src) (source_tree ../riscv) - (source_tree ../kernel_sdk)) + (source_tree ../kernel_sdk) + (file ../../etherlink/lib_wasm_runtime/Cargo.toml) + (file ../../etherlink/lib_wasm_runtime/build.rs) + (glob_files_rec ../../etherlink/lib_wasm_runtime/src/**.rs)) (action (no-infer (bash ./build.sh)))) diff --git a/src/rust_deps/src/lib.rs b/src/rust_deps/src/lib.rs index c9c0d21a1c7d18ab84465a05c8a93212ce4ba0ea..b47795a4936ff9a06a3c33552635fd704a8d5da7 100644 --- a/src/rust_deps/src/lib.rs +++ b/src/rust_deps/src/lib.rs @@ -1,3 +1,4 @@ +pub use octez_evm_node_wasm_runtime::api::*; pub use octez_riscv::ocaml_api::*; pub use rustzcash::*; pub use wasmer::*;