Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

New PVF validation host #2710

Merged
merged 53 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
3da7e43
Implement PVF validation host
pepyakin Mar 25, 2021
ff2d3ff
WIP: Diener
pepyakin Mar 25, 2021
d0603dc
Increase the alloted compilation time
pepyakin Mar 25, 2021
3f1087a
Add more comments
pepyakin Mar 29, 2021
9413fac
Minor clean up
pepyakin Mar 29, 2021
d73db14
Apply suggestions from code review
pepyakin Mar 29, 2021
3fec908
Fix pruning artifact removal
pepyakin Mar 29, 2021
b9d0b6b
Fix formatting and newlines
pepyakin Mar 29, 2021
aa3ef8e
Fix the thread pool
pepyakin Mar 29, 2021
f4c3a5e
Update node/core/pvf/src/executor_intf.rs
pepyakin Mar 29, 2021
83082dd
Remove redundant test declaration
pepyakin Mar 29, 2021
f4f4383
Don't convert the path into an intermediate string
pepyakin Mar 29, 2021
54f6ac0
Try to workaround the test failure
pepyakin Mar 29, 2021
393a1d7
Use the puppet_worker trick again
pepyakin Mar 30, 2021
1482878
Fix a blip
pepyakin Mar 30, 2021
01e572c
Move `ensure_wasmtime_version` under the tests mod
pepyakin Mar 30, 2021
fd16b2b
Add a macro for puppet_workers
pepyakin Mar 30, 2021
0df8f39
fix build for not real-overseer
pepyakin Mar 30, 2021
bb7b05a
Rename the puppet worker for adder collator
pepyakin Mar 30, 2021
4270358
play it safe with the name of adder puppet worker
pepyakin Mar 30, 2021
9154534
Typo: triggered
pepyakin Apr 6, 2021
1bd24e2
Add more comments
pepyakin Apr 6, 2021
bd4d06c
Do not kill exec worker on every error
pepyakin Apr 6, 2021
cd2916a
Plumb Duration for timeouts
pepyakin Apr 6, 2021
031e272
typo: critical
pepyakin Apr 6, 2021
d895900
Add proofs
pepyakin Apr 6, 2021
0b40ebe
Clean unused imports
pepyakin Apr 6, 2021
540e8fd
Revert "WIP: Diener"
pepyakin Apr 7, 2021
ae4f15d
Merge remote-tracking branch 'origin/master' into ser-wasm-cache
pepyakin Apr 7, 2021
3939d91
Sync version of wasmtime
pepyakin Apr 7, 2021
2e1423d
Update cargo.lock
pepyakin Apr 7, 2021
d81f29f
Update Substrate
pepyakin Apr 7, 2021
6485b99
Merge fixes still
pepyakin Apr 7, 2021
0d6bce6
Update wasmtime version in test
pepyakin Apr 7, 2021
4307e46
bastifmt
pepyakin Apr 8, 2021
5be5c5c
Squash spaces
pepyakin Apr 8, 2021
fc71fa3
Trailing new line for testing.rs
pepyakin Apr 8, 2021
f90876e
Remove controversial code
pepyakin Apr 8, 2021
b878844
comment about biasing
pepyakin Apr 8, 2021
4b1d1be
Fix suggestion
pepyakin Apr 8, 2021
26ed193
Add comments
pepyakin Apr 8, 2021
8db420e
make it more clear why unwrap_err
pepyakin Apr 8, 2021
7842469
tmpfile retry
pepyakin Apr 8, 2021
c06a2fd
proper proofs for claim_idle
pepyakin Apr 8, 2021
ef58171
Remove mutex from ValidationHost
pepyakin Apr 8, 2021
1feca0c
Add some more logging
pepyakin Apr 8, 2021
ffb3caa
Extract exec timeout into a constant
pepyakin Apr 8, 2021
d151556
Add some clarifying logging
pepyakin Apr 8, 2021
406fd71
Use blake2_256
pepyakin Apr 8, 2021
0fb7311
Merge remote-tracking branch 'origin/master' into ser-wasm-cache
pepyakin Apr 8, 2021
d5ab3a1
Clean up the merge
pepyakin Apr 8, 2021
3f23214
Merge remote-tracking branch 'origin/master' into ser-wasm-cache
pepyakin Apr 8, 2021
250a5ae
Update parachain/test-parachains/adder/collator/Cargo.toml
pepyakin Apr 8, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
416 changes: 217 additions & 199 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ members = [
"node/core/chain-api",
"node/core/proposer",
"node/core/provisioner",
"node/core/pvf",
"node/core/runtime-api",
"node/network/approval-distribution",
"node/network/bridge",
Expand Down
7 changes: 4 additions & 3 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ wasm-bindgen-futures = { version = "0.4.19", optional = true }
futures = "0.3.12"

service = { package = "polkadot-service", path = "../node/service", default-features = false, optional = true }
polkadot-parachain = { path = "../parachain", optional = true }
polkadot-node-core-pvf = { path = "../node/core/pvf", optional = true }

sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true }
Expand All @@ -39,15 +39,16 @@ sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master",
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" }

[features]
default = [ "wasmtime", "db", "cli", "full-node", "trie-memory-tracker", "polkadot-parachain" ]
wasmtime = [ "sc-cli/wasmtime", "polkadot-parachain/wasmtime" ]
default = [ "wasmtime", "db", "cli", "full-node", "trie-memory-tracker" ]
wasmtime = [ "sc-cli/wasmtime" ]
db = [ "service/db" ]
cli = [
"structopt",
"sc-cli",
"sc-service",
"frame-benchmarking-cli",
"try-runtime-cli",
"polkadot-node-core-pvf",
]
browser = [
"wasm-bindgen",
Expand Down
15 changes: 8 additions & 7 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ pub enum Subcommand {
Revert(sc_cli::RevertCmd),

#[allow(missing_docs)]
#[structopt(name = "validation-worker", setting = structopt::clap::AppSettings::Hidden)]
ValidationWorker(ValidationWorkerCommand),
#[structopt(name = "prepare-worker", setting = structopt::clap::AppSettings::Hidden)]
PvfPrepareWorker(ValidationWorkerCommand),

#[allow(missing_docs)]
#[structopt(name = "execute-worker", setting = structopt::clap::AppSettings::Hidden)]
PvfExecuteWorker(ValidationWorkerCommand),

/// The custom benchmark subcommand benchmarking runtime pallets.
#[structopt(
Expand All @@ -64,11 +68,8 @@ pub enum Subcommand {
#[allow(missing_docs)]
#[derive(Debug, StructOpt)]
pub struct ValidationWorkerCommand {
/// The path that the executor can use for its caching purposes.
pub cache_base_path: std::path::PathBuf,

#[allow(missing_docs)]
pub mem_id: String,
/// The path to the validation host's socket.
pub socket_path: String,
}

#[allow(missing_docs)]
Expand Down
38 changes: 29 additions & 9 deletions cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,19 +256,39 @@ pub fn run() -> Result<()> {
Ok((cmd.run(client, backend).map_err(Error::SubstrateCli), task_manager))
})?)
},
Some(Subcommand::ValidationWorker(cmd)) => {
Some(Subcommand::PvfPrepareWorker(cmd)) => {
let mut builder = sc_cli::LoggerBuilder::new("");
builder.with_colors(false);
let _ = builder.init();

if cfg!(feature = "browser") || cfg!(target_os = "android") {
Err(sc_cli::Error::Input("Cannot run validation worker in browser".into()).into())
} else {
#[cfg(not(any(target_os = "android", feature = "browser")))]
polkadot_parachain::wasm_executor::run_worker(
&cmd.mem_id,
Some(cmd.cache_base_path.clone()),
)?;
#[cfg(any(target_os = "android", feature = "browser"))]
{
return Err(
sc_cli::Error::Input("PVF preparation workers are not supported under this platform".into()).into()
);
}

#[cfg(not(any(target_os = "android", feature = "browser")))]
{
polkadot_node_core_pvf::prepare_worker_entrypoint(&cmd.socket_path);
Ok(())
}
},
Some(Subcommand::PvfExecuteWorker(cmd)) => {
let mut builder = sc_cli::LoggerBuilder::new("");
builder.with_colors(false);
let _ = builder.init();

#[cfg(any(target_os = "android", feature = "browser"))]
{
return Err(
sc_cli::Error::Input("PVF execution workers are not supported under this platform".into()).into()
);
}

#[cfg(not(any(target_os = "android", feature = "browser")))]
{
polkadot_node_core_pvf::execute_worker_entrypoint(&cmd.socket_path);
Ok(())
}
},
Expand Down
6 changes: 5 additions & 1 deletion node/core/candidate-validation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

[dependencies]
async-trait = "0.1.42"
futures = "0.3.12"
tracing = "0.1.25"

sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate", branch = "master" }
parity-scale-codec = { version = "2.0.0", default-features = false, features = ["bit-vec", "derive"] }

polkadot-primitives = { path = "../../../primitives" }
Expand All @@ -17,8 +17,12 @@ polkadot-node-primitives = { path = "../../primitives" }
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" }
polkadot-node-subsystem-util = { path = "../../subsystem-util" }

[target.'cfg(not(any(target_os = "android", target_os = "unknown")))'.dependencies]
polkadot-node-core-pvf = { path = "../pvf" }

[dev-dependencies]
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" }
futures = { version = "0.3.12", features = ["thread-pool"] }
assert_matches = "1.4.0"
polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
Loading