diff --git a/Cargo.lock b/Cargo.lock index 06db9fe53148..7120b715df72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12299,7 +12299,6 @@ dependencies = [ "polkadot-node-core-pvf", "polkadot-node-core-pvf-common", "polkadot-node-core-pvf-execute-worker", - "polkadot-node-core-pvf-prepare-worker", "polkadot-node-metrics", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -12313,7 +12312,6 @@ dependencies = [ "slotmap", "sp-core", "sp-maybe-compressed-blob", - "sp-wasm-interface 14.0.0", "tempfile", "test-parachain-adder", "test-parachain-halt", @@ -12350,7 +12348,6 @@ name = "polkadot-node-core-pvf-common" version = "1.0.0" dependencies = [ "assert_matches", - "cfg-if", "cpu-time", "futures", "landlock", @@ -12400,10 +12397,7 @@ dependencies = [ "parity-scale-codec", "polkadot-node-core-pvf-common", "polkadot-primitives", - "rayon", "rococo-runtime", - "sc-executor-common", - "sc-executor-wasmtime", "sp-maybe-compressed-blob", "staging-tracking-allocator", "tikv-jemalloc-ctl", diff --git a/polkadot/node/core/pvf/Cargo.toml b/polkadot/node/core/pvf/Cargo.toml index a1e70eabc0e7..c8824f2ec84e 100644 --- a/polkadot/node/core/pvf/Cargo.toml +++ b/polkadot/node/core/pvf/Cargo.toml @@ -13,8 +13,7 @@ cfg-if = "1.0" futures = "0.3.21" futures-timer = "3.0.2" gum = { package = "tracing-gum", path = "../../gum" } -is_executable = "1.0.1" -libc = "0.2.139" +is_executable = { version = "1.0.1", optional = true } pin-project = "1.0.9" rand = "0.8.5" slotmap = "1.0" @@ -33,9 +32,7 @@ polkadot-node-subsystem = { path = "../../subsystem" } polkadot-primitives = { path = "../../../primitives" } sp-core = { path = "../../../../substrate/primitives/core" } -sp-wasm-interface = { path = "../../../../substrate/primitives/wasm-interface" } -sp-maybe-compressed-blob = { path = "../../../../substrate/primitives/maybe-compressed-blob" } -polkadot-node-core-pvf-prepare-worker = { path = "prepare-worker", optional = true } +sp-maybe-compressed-blob = { path = "../../../../substrate/primitives/maybe-compressed-blob", optional = true } polkadot-node-core-pvf-execute-worker = { path = "execute-worker", optional = true } [dev-dependencies] @@ -53,6 +50,7 @@ adder = { package = "test-parachain-adder", path = "../../../parachain/test-para halt = { package = "test-parachain-halt", path = "../../../parachain/test-parachains/halt" } [target.'cfg(target_os = "linux")'.dev-dependencies] +libc = "0.2.139" procfs = "0.16.0" rusty-fork = "0.3.0" sc-sysinfo = { path = "../../../../substrate/client/sysinfo" } @@ -66,6 +64,7 @@ ci-only-tests = [] jemalloc-allocator = ["polkadot-node-core-pvf-common/jemalloc-allocator"] # This feature is used to export test code to other crates without putting it in the production build. test-utils = [ - "polkadot-node-core-pvf-execute-worker", - "polkadot-node-core-pvf-prepare-worker", + "dep:is_executable", + "dep:sp-maybe-compressed-blob", + "dep:polkadot-node-core-pvf-execute-worker", ] diff --git a/polkadot/node/core/pvf/common/Cargo.toml b/polkadot/node/core/pvf/common/Cargo.toml index bfe1be9156fc..8f1e7563e8b0 100644 --- a/polkadot/node/core/pvf/common/Cargo.toml +++ b/polkadot/node/core/pvf/common/Cargo.toml @@ -7,7 +7,6 @@ edition.workspace = true license.workspace = true [dependencies] -cfg-if = "1.0" cpu-time = "1.0.0" futures = "0.3.21" gum = { package = "tracing-gum", path = "../../../gum" } diff --git a/polkadot/node/core/pvf/common/src/lib.rs b/polkadot/node/core/pvf/common/src/lib.rs index dced43ef2134..298e5e91d67b 100644 --- a/polkadot/node/core/pvf/common/src/lib.rs +++ b/polkadot/node/core/pvf/common/src/lib.rs @@ -16,6 +16,8 @@ //! Contains functionality related to PVFs that is shared by the PVF host and the PVF workers. +#![deny(unused_crate_dependencies)] + pub mod error; pub mod execute; pub mod executor_interface; diff --git a/polkadot/node/core/pvf/execute-worker/src/lib.rs b/polkadot/node/core/pvf/execute-worker/src/lib.rs index 8e7dd233b512..b5e47f2f26ac 100644 --- a/polkadot/node/core/pvf/execute-worker/src/lib.rs +++ b/polkadot/node/core/pvf/execute-worker/src/lib.rs @@ -16,6 +16,9 @@ //! Contains the logic for executing PVFs. Used by the polkadot-execute-worker binary. +#![deny(unused_crate_dependencies)] +#![warn(missing_docs)] + pub use polkadot_node_core_pvf_common::{ executor_interface::execute_artifact, worker_dir, SecurityStatus, }; diff --git a/polkadot/node/core/pvf/prepare-worker/Cargo.toml b/polkadot/node/core/pvf/prepare-worker/Cargo.toml index 4e53f7f46ca9..e6e52ea0219a 100644 --- a/polkadot/node/core/pvf/prepare-worker/Cargo.toml +++ b/polkadot/node/core/pvf/prepare-worker/Cargo.toml @@ -11,7 +11,6 @@ blake3 = "1.5" cfg-if = "1.0" gum = { package = "tracing-gum", path = "../../../gum" } libc = "0.2.139" -rayon = "1.5.1" tracking-allocator = { package = "staging-tracking-allocator", path = "../../../tracking-allocator" } tikv-jemalloc-ctl = { version = "0.5.0", optional = true } tikv-jemallocator = { version = "0.5.0", optional = true } @@ -23,9 +22,6 @@ parity-scale-codec = { version = "3.6.1", default-features = false, features = [ polkadot-node-core-pvf-common = { path = "../common" } polkadot-primitives = { path = "../../../../primitives" } -sc-executor-common = { path = "../../../../../substrate/client/executor/common" } -sc-executor-wasmtime = { path = "../../../../../substrate/client/executor/wasmtime" } - [target.'cfg(target_os = "linux")'.dependencies] tikv-jemallocator = "0.5.0" tikv-jemalloc-ctl = "0.5.0" diff --git a/polkadot/node/core/pvf/prepare-worker/src/lib.rs b/polkadot/node/core/pvf/prepare-worker/src/lib.rs index b3f8a6b11ba4..fd9e47b925fc 100644 --- a/polkadot/node/core/pvf/prepare-worker/src/lib.rs +++ b/polkadot/node/core/pvf/prepare-worker/src/lib.rs @@ -16,6 +16,9 @@ //! Contains the logic for preparing PVFs. Used by the polkadot-prepare-worker binary. +#![deny(unused_crate_dependencies)] +#![warn(missing_docs)] + mod memory_stats; use polkadot_node_core_pvf_common::executor_interface::{prepare, prevalidate}; diff --git a/polkadot/node/core/pvf/src/lib.rs b/polkadot/node/core/pvf/src/lib.rs index 79391630b2d3..de889a408a9e 100644 --- a/polkadot/node/core/pvf/src/lib.rs +++ b/polkadot/node/core/pvf/src/lib.rs @@ -14,8 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -#![warn(missing_docs)] - //! The PVF validation host. Responsible for coordinating preparation and execution of PVFs. //! //! For more background, refer to the Implementer's Guide: [PVF @@ -90,6 +88,8 @@ //! combination of a path to the compiled artifact and the //! [`params`][`polkadot_parachain_primitives::primitives::ValidationParams`]. +#![warn(missing_docs)] + mod artifacts; mod error; mod execute;