Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions collator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ use polkadot_service_new::{
use sc_service::SpawnTaskHandle;
use sp_core::traits::SpawnNamed;
use sp_runtime::traits::BlakeTwo256;
use consensus_common::SyncOracle;

const COLLATION_TIMEOUT: Duration = Duration::from_secs(30);

Expand Down Expand Up @@ -120,7 +121,7 @@ pub trait BuildParachainContext {
self,
client: polkadot_service::Client,
spawner: SP,
network: impl Network + Clone + 'static,
network: impl Network + SyncOracle + Clone + 'static,
) -> Result<Self::ParachainContext, ()>
where
SP: SpawnNamed + Clone + Send + Sync + 'static;
Expand Down Expand Up @@ -391,7 +392,7 @@ where
.into());
}

let (task_manager, client, handlers) = polkadot_service::build_full(
let (task_manager, client, handles) = polkadot_service::build_full(
config,
Some((key.public(), para_id)),
None,
Expand All @@ -402,11 +403,11 @@ where

let future = build_collator_service(
task_manager.spawn_handle(),
handlers,
handles,
client,
para_id,
key,
build_parachain_context
build_parachain_context,
)?;

Ok((future, task_manager))
Expand Down
1 change: 1 addition & 0 deletions network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ polkadot-erasure-coding = { path = "../erasure-coding" }
codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false, features = ["derive"] }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-network-gossip = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" }
futures = "0.3.5"
Expand Down
10 changes: 10 additions & 0 deletions network/src/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,16 @@ impl<N> av_store::ErasureNetworking for Service<N> {
}
}

impl<N> sp_consensus::SyncOracle for Service<N> where for<'r> &'r N: sp_consensus::SyncOracle {
fn is_major_syncing(&mut self) -> bool {
self.network_service.is_major_syncing()
}

fn is_offline(&mut self) -> bool {
self.network_service.is_offline()
}
}

/// Errors when interacting with the statement router.
#[derive(Debug, derive_more::Display, derive_more::From)]
pub enum RouterError {
Expand Down