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

Commit

Permalink
Merge remote-tracking branch 'origin/master' into s0me0ne/liberate-wo…
Browse files Browse the repository at this point in the history
…rkers
  • Loading branch information
s0me0ne-unkn0wn committed Aug 8, 2023
2 parents c9329ca + a1c8d72 commit dcbd057
Show file tree
Hide file tree
Showing 114 changed files with 518 additions and 256 deletions.
370 changes: 186 additions & 184 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ path = "src/main.rs"
[package]
name = "polkadot"
description = "Implementation of a `https://polkadot.network` node in Rust based on the Substrate framework."
license = "GPL-3.0-only"
rust-version = "1.64.0" # workspace properties
readme = "README.md"
default-run = "polkadot"
authors.workspace = true
edition.workspace = true
license.workspace = true
version.workspace = true

[workspace.package]
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
license = "GPL-3.0-only"
repository = "https://github.com/paritytech/polkadot.git"
version = "0.9.43"

Expand Down
1 change: 1 addition & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description = "Polkadot Relay-chain Client Node"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[package.metadata.wasm-pack.profile.release]
# `wasm-opt` has some problems on Linux, see
Expand Down
1 change: 1 addition & 0 deletions core-primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "polkadot-core-primitives"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions erasure-coding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "polkadot-erasure-coding"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
polkadot-primitives = { path = "../primitives" }
Expand Down
1 change: 1 addition & 0 deletions erasure-coding/fuzzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "erasure_coding_fuzzer"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
publish = false

[dependencies]
Expand Down
1 change: 1 addition & 0 deletions node/collation-generation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "polkadot-node-collation-generation"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
futures = "0.3.21"
Expand Down
1 change: 1 addition & 0 deletions node/core/approval-voting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "polkadot-node-core-approval-voting"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
futures = "0.3.21"
Expand Down
1 change: 1 addition & 0 deletions node/core/av-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "polkadot-node-core-av-store"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
futures = "0.3.21"
Expand Down
1 change: 1 addition & 0 deletions node/core/backing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "polkadot-node-core-backing"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
futures = "0.3.21"
Expand Down
1 change: 1 addition & 0 deletions node/core/bitfield-signing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "polkadot-node-core-bitfield-signing"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
futures = "0.3.21"
Expand Down
2 changes: 2 additions & 0 deletions node/core/candidate-validation/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[package]
name = "polkadot-node-core-candidate-validation"
description = "Polkadot crate that implements the Candidate Validation subsystem. Handles requests to validate candidates according to a PVF."
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
async-trait = "0.1.57"
Expand Down
1 change: 1 addition & 0 deletions node/core/chain-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "polkadot-node-core-chain-api"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
futures = "0.3.21"
Expand Down
1 change: 1 addition & 0 deletions node/core/chain-selection/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description = "Chain Selection Subsystem"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
futures = "0.3.21"
Expand Down
1 change: 1 addition & 0 deletions node/core/dispute-coordinator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "polkadot-node-core-dispute-coordinator"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
futures = "0.3.21"
Expand Down
1 change: 1 addition & 0 deletions node/core/parachains-inherent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "polkadot-node-core-parachains-inherent"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
futures = "0.3.21"
Expand Down
1 change: 1 addition & 0 deletions node/core/provisioner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "polkadot-node-core-provisioner"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] }
Expand Down
2 changes: 2 additions & 0 deletions node/core/pvf-checker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[package]
name = "polkadot-node-core-pvf-checker"
description = "Polkadot crate that implements the PVF pre-checking subsystem. Responsible for checking and voting for PVFs that are pending approval."
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
futures = "0.3.21"
Expand Down
2 changes: 2 additions & 0 deletions node/core/pvf/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[package]
name = "polkadot-node-core-pvf"
description = "Polkadot crate that implements the PVF validation host. Responsible for coordinating preparation and execution of PVFs."
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[[bin]]
name = "puppet_worker"
Expand Down
2 changes: 2 additions & 0 deletions node/core/pvf/common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[package]
name = "polkadot-node-core-pvf-common"
description = "Polkadot crate that contains functionality related to PVFs that is shared by the PVF host and the PVF workers."
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
cpu-time = "1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion node/core/pvf/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.

//! Functionality that is shared by the host and the workers.
//! Contains functionality related to PVFs that is shared by the PVF host and the PVF workers.

pub mod error;
pub mod execute;
Expand Down
2 changes: 2 additions & 0 deletions node/core/pvf/execute-worker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[package]
name = "polkadot-node-core-pvf-execute-worker"
description = "Polkadot crate that contains the logic for executing PVFs. Used by the polkadot-execute-worker binary."
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
cpu-time = "1.0.0"
Expand Down
2 changes: 2 additions & 0 deletions node/core/pvf/execute-worker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.

//! Contains the logic for executing PVFs. Used by the polkadot-execute-worker binary.

pub use polkadot_node_core_pvf_common::executor_intf::Executor;

// NOTE: Initializing logging in e.g. tests will not have an effect in the workers, as they are
Expand Down
2 changes: 2 additions & 0 deletions node/core/pvf/prepare-worker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[package]
name = "polkadot-node-core-pvf-prepare-worker"
description = "Polkadot crate that contains the logic for preparing PVFs. Used by the polkadot-prepare-worker binary."
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
futures = "0.3.21"
Expand Down
2 changes: 2 additions & 0 deletions node/core/pvf/prepare-worker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.

//! Contains the logic for preparing PVFs. Used by the polkadot-prepare-worker binary.

mod executor_intf;
mod memory_stats;

Expand Down
2 changes: 1 addition & 1 deletion node/core/pvf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#![warn(missing_docs)]

//! A crate that implements the PVF validation host.
//! The PVF validation host. Responsible for coordinating preparation and execution of PVFs.
//!
//! For more background, refer to the Implementer's Guide: [PVF
//! Pre-checking](https://paritytech.github.io/polkadot/book/pvf-prechecking.html) and [Candidate
Expand Down
1 change: 1 addition & 0 deletions node/core/runtime-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "polkadot-node-core-runtime-api"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
futures = "0.3.21"
Expand Down
1 change: 1 addition & 0 deletions node/gum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "tracing-gum"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
description = "Stick logs together with the TraceID as provided by tempo"

[dependencies]
Expand Down
1 change: 1 addition & 0 deletions node/gum/proc-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "tracing-gum-proc-macro"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
description = "Generate an overseer including builder pattern and message wrapper from a single annotated struct definition."

[package.metadata.docs.rs]
Expand Down
1 change: 1 addition & 0 deletions node/jaeger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "polkadot-node-jaeger"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
description = "Polkadot Jaeger primitives, but equally useful for Grafana/Tempo"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion node/malus/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "polkadot-test-malus"
description = "Misbehaving nodes for local testnets, system and Simnet tests."
license = "GPL-3.0-only"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
readme = "README.md"
publish = false

Expand Down
1 change: 1 addition & 0 deletions node/metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description = "Subsystem metric helpers"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
futures = "0.3.21"
Expand Down
1 change: 1 addition & 0 deletions node/network/approval-distribution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "polkadot-approval-distribution"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
polkadot-node-metrics = { path = "../../metrics" }
Expand Down
1 change: 1 addition & 0 deletions node/network/availability-distribution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "polkadot-availability-distribution"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
futures = "0.3.21"
Expand Down
1 change: 1 addition & 0 deletions node/network/availability-recovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "polkadot-availability-recovery"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
futures = "0.3.21"
Expand Down
1 change: 1 addition & 0 deletions node/network/bitfield-distribution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "polkadot-availability-bitfield-distribution"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
futures = "0.3.21"
Expand Down
4 changes: 1 addition & 3 deletions node/network/bitfield-distribution/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,6 @@ fn receive_duplicate_messages() {
}

#[test]
// FIXME <https://github.com/paritytech/polkadot/issues/7407>
#[cfg(feature = "enable-flaky")]
fn delay_reputation_change() {
use polkadot_node_subsystem_util::reputation::add_reputation;

Expand Down Expand Up @@ -471,7 +469,7 @@ fn delay_reputation_change() {
let pool = sp_core::testing::TaskExecutor::new();
let (ctx, mut handle) = make_subsystem_context::<BitfieldDistributionMessage, _>(pool);
let mut rng = dummy_rng();
let reputation_interval = Duration::from_millis(1);
let reputation_interval = Duration::from_millis(100);

let bg = async move {
let subsystem = BitfieldDistribution::new(Default::default());
Expand Down
1 change: 1 addition & 0 deletions node/network/bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "polkadot-network-bridge"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
always-assert = "0.1"
Expand Down
14 changes: 11 additions & 3 deletions node/network/bridge/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ pub trait Network: Clone + Send + 'static {
) -> Result<(), String>;

/// Removes the peers for the protocol's peer set (both reserved and non-reserved).
async fn remove_from_peers_set(&mut self, protocol: ProtocolName, peers: Vec<PeerId>);
async fn remove_from_peers_set(
&mut self,
protocol: ProtocolName,
peers: Vec<PeerId>,
) -> Result<(), String>;

/// Send a request to a remote peer.
async fn start_request<AD: AuthorityDiscovery>(
Expand Down Expand Up @@ -129,8 +133,12 @@ impl Network for Arc<NetworkService<Block, Hash>> {
NetworkService::set_reserved_peers(&**self, protocol, multiaddresses)
}

async fn remove_from_peers_set(&mut self, protocol: ProtocolName, peers: Vec<PeerId>) {
NetworkService::remove_peers_from_reserved_set(&**self, protocol, peers);
async fn remove_from_peers_set(
&mut self,
protocol: ProtocolName,
peers: Vec<PeerId>,
) -> Result<(), String> {
NetworkService::remove_peers_from_reserved_set(&**self, protocol, peers)
}

fn report_peer(&self, who: PeerId, rep: ReputationChange) {
Expand Down
8 changes: 7 additions & 1 deletion node/network/bridge/src/rx/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,13 @@ impl Network for TestNetwork {
Ok(())
}

async fn remove_from_peers_set(&mut self, _protocol: ProtocolName, _: Vec<PeerId>) {}
async fn remove_from_peers_set(
&mut self,
_protocol: ProtocolName,
_: Vec<PeerId>,
) -> Result<(), String> {
Ok(())
}

async fn start_request<AD: AuthorityDiscovery>(
&self,
Expand Down
Loading

0 comments on commit dcbd057

Please sign in to comment.