This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
☭ Liberate workers! ☭ #7570
Open
s0me0ne-unkn0wn
wants to merge
15
commits into
master
Choose a base branch
from
s0me0ne/liberate-workers
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
☭ Liberate workers! ☭ #7570
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
cc8e1fd
Move PVF worker CLI binaries to separate packages
s0me0ne-unkn0wn 3c43f00
Move worker CLIs closer to the root package
s0me0ne-unkn0wn 25f950c
Rename crates
s0me0ne-unkn0wn 53d035d
Fix malus
s0me0ne-unkn0wn 5ae83f3
Fix tests
s0me0ne-unkn0wn c9329ca
`Cargo.lock` & `cargo fmt`
s0me0ne-unkn0wn dcbd057
Merge remote-tracking branch 'origin/master' into s0me0ne/liberate-wo…
s0me0ne-unkn0wn 8d50a4c
Try to fix `cargo run` not building worker binaries
mrcnski 3ab5657
Resolve some TODOs, make output nicer
mrcnski 96d2a90
Fix filename typo
s0me0ne-unkn0wn 63ee515
Remove duplicated constants
s0me0ne-unkn0wn c172aab
`cargo fmt`
s0me0ne-unkn0wn 85f0a50
Fix build script
mrcnski c4d8844
Update build script
mrcnski a8c98c1
Update comment
mrcnski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,16 @@ | ||
[package] | ||
name = "polkadot-execute-worker" | ||
version.workspace = true | ||
authors.workspace = true | ||
edition.workspace = true | ||
|
||
[[bin]] | ||
name = "polkadot-execute-worker" | ||
path = "src/main.rs" | ||
|
||
[dependencies] | ||
polkadot-node-core-pvf-common = { path = "../../node/core/pvf/common" } | ||
polkadot-node-core-pvf-execute-worker = { path = "../../node/core/pvf/execute-worker" } | ||
|
||
[build-dependencies] | ||
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" } |
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,22 @@ | ||
// Copyright (C) Parity Technologies (UK) Ltd. | ||
// This file is part of Polkadot. | ||
|
||
// Polkadot is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Polkadot is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
fn main() { | ||
substrate_build_script_utils::generate_cargo_keys(); | ||
// For the node/worker version check, make sure we always rebuild the node and binary workers | ||
// when the version changes. | ||
substrate_build_script_utils::rerun_if_git_head_changed(); | ||
} |
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,18 @@ | ||
// Copyright (C) Parity Technologies (UK) Ltd. | ||
// This file is part of Polkadot. | ||
|
||
// Polkadot is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Polkadot is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/// Execute worker binary name | ||
pub const BINARY_NAME: &str = "polkadot-execute-worker"; |
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,33 @@ | ||
// Copyright (C) Parity Technologies (UK) Ltd. | ||
// This file is part of Polkadot. | ||
|
||
// Polkadot is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Polkadot is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
//! Execute worker. | ||
|
||
#[cfg(test)] | ||
use polkadot_execute_worker::BINARY_NAME; | ||
|
||
polkadot_node_core_pvf_common::decl_worker_main!( | ||
"execute-worker", | ||
polkadot_node_core_pvf_execute_worker::worker_entrypoint, | ||
env!("SUBSTRATE_CLI_IMPL_VERSION") | ||
); | ||
|
||
#[test] | ||
fn name_test() { | ||
// If binary name ever needs to change, it must be changed in the package manifest | ||
// as well as in the constant value | ||
assert_eq!(env!("CARGO_BIN_NAME"), BINARY_NAME); | ||
} |
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,16 @@ | ||
[package] | ||
name = "polkadot-prepare-worker" | ||
version.workspace = true | ||
authors.workspace = true | ||
edition.workspace = true | ||
|
||
[[bin]] | ||
name = "polkadot-prepare-worker" | ||
path = "src/main.rs" | ||
|
||
[dependencies] | ||
polkadot-node-core-pvf-common = { path = "../../node/core/pvf/common" } | ||
polkadot-node-core-pvf-prepare-worker = { path = "../../node/core/pvf/prepare-worker" } | ||
|
||
[build-dependencies] | ||
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" } |
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,22 @@ | ||
// Copyright (C) Parity Technologies (UK) Ltd. | ||
// This file is part of Polkadot. | ||
|
||
// Polkadot is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Polkadot is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
fn main() { | ||
substrate_build_script_utils::generate_cargo_keys(); | ||
// For the node/worker version check, make sure we always rebuild the node and binary workers | ||
// when the version changes. | ||
substrate_build_script_utils::rerun_if_git_head_changed(); | ||
} |
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,18 @@ | ||
// Copyright (C) Parity Technologies (UK) Ltd. | ||
// This file is part of Polkadot. | ||
|
||
// Polkadot is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Polkadot is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/// Prepare worker binary name | ||
pub const BINARY_NAME: &str = "polkadot-prepare-worker"; | ||
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,33 @@ | ||
// Copyright (C) Parity Technologies (UK) Ltd. | ||
// This file is part of Polkadot. | ||
|
||
// Polkadot is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Polkadot is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
//! Prepare worker. | ||
|
||
#[cfg(test)] | ||
use polkadot_prepare_worker::BINARY_NAME; | ||
|
||
polkadot_node_core_pvf_common::decl_worker_main!( | ||
"prepare-worker", | ||
polkadot_node_core_pvf_prepare_worker::worker_entrypoint, | ||
env!("SUBSTRATE_CLI_IMPL_VERSION") | ||
); | ||
|
||
#[test] | ||
fn name_test() { | ||
// If binary name ever needs to change, it must be changed in the package manifest | ||
// as well as in the constant value | ||
assert_eq!(env!("CARGO_BIN_NAME"), BINARY_NAME); | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same as
PREPARE_BINARY_NAME
in pvf-host. Can we move it to the pvf/prepare-worker crate, and use that here, for less duplication?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm there is an issue with the PVF host depending on the worker binaries in this way. The worker binaries will be recompiled after every commit which will be annoying when hacking on
pvf
crate. I think we can move the binary names intopvf-common
.