mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 21:41:02 +00:00
Companion for paritytech/substrate#12828 (#1939)
* Companion for paritytech/substrate#12764 * Remove `async-trait` * Companion for paritytech/substrate#12828 * carg fmt * Update client/relay-chain-minimal-node/src/network.rs Co-authored-by: Bastian Köcher <git@kchr.de> * update lockfile for {"polkadot", "substrate"} --------- Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: parity-processbot <>
This commit is contained in:
Generated
+266
-256
File diff suppressed because it is too large
Load Diff
@@ -369,11 +369,10 @@ pub fn build_inprocess_relay_chain(
|
|||||||
hwbench,
|
hwbench,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let sync_oracle: Arc<dyn SyncOracle + Send + Sync> = Arc::new(full_node.network.clone());
|
|
||||||
let relay_chain_interface_builder = RelayChainInProcessInterfaceBuilder {
|
let relay_chain_interface_builder = RelayChainInProcessInterfaceBuilder {
|
||||||
polkadot_client: full_node.client.clone(),
|
polkadot_client: full_node.client.clone(),
|
||||||
backend: full_node.backend.clone(),
|
backend: full_node.backend.clone(),
|
||||||
sync_oracle,
|
sync_oracle: full_node.sync_service.clone(),
|
||||||
overseer_handle: full_node.overseer_handle.clone().ok_or(RelayChainError::GenericError(
|
overseer_handle: full_node.overseer_handle.clone().ok_or(RelayChainError::GenericError(
|
||||||
"Overseer not running in full node.".to_string(),
|
"Overseer not running in full node.".to_string(),
|
||||||
))?,
|
))?,
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ pub(crate) struct CollatorOverseerGenArgs<'a> {
|
|||||||
pub runtime_client: Arc<BlockChainRpcClient>,
|
pub runtime_client: Arc<BlockChainRpcClient>,
|
||||||
/// Underlying network service implementation.
|
/// Underlying network service implementation.
|
||||||
pub network_service: Arc<sc_network::NetworkService<Block, PHash>>,
|
pub network_service: Arc<sc_network::NetworkService<Block, PHash>>,
|
||||||
|
/// Syncing oracle.
|
||||||
|
pub sync_oracle: Box<dyn sp_consensus::SyncOracle + Send>,
|
||||||
/// Underlying authority discovery service.
|
/// Underlying authority discovery service.
|
||||||
pub authority_discovery_service: AuthorityDiscoveryService,
|
pub authority_discovery_service: AuthorityDiscoveryService,
|
||||||
/// Receiver for collation request protocol
|
/// Receiver for collation request protocol
|
||||||
@@ -79,6 +81,7 @@ fn build_overseer<'a>(
|
|||||||
CollatorOverseerGenArgs {
|
CollatorOverseerGenArgs {
|
||||||
runtime_client,
|
runtime_client,
|
||||||
network_service,
|
network_service,
|
||||||
|
sync_oracle,
|
||||||
authority_discovery_service,
|
authority_discovery_service,
|
||||||
collation_req_receiver,
|
collation_req_receiver,
|
||||||
available_data_req_receiver,
|
available_data_req_receiver,
|
||||||
@@ -121,7 +124,7 @@ fn build_overseer<'a>(
|
|||||||
.network_bridge_rx(NetworkBridgeRxSubsystem::new(
|
.network_bridge_rx(NetworkBridgeRxSubsystem::new(
|
||||||
network_service.clone(),
|
network_service.clone(),
|
||||||
authority_discovery_service.clone(),
|
authority_discovery_service.clone(),
|
||||||
Box::new(network_service.clone()),
|
sync_oracle,
|
||||||
network_bridge_metrics.clone(),
|
network_bridge_metrics.clone(),
|
||||||
peer_set_protocol_names.clone(),
|
peer_set_protocol_names.clone(),
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ async fn new_minimal_relay_chain(
|
|||||||
let (collation_req_receiver, available_data_req_receiver) =
|
let (collation_req_receiver, available_data_req_receiver) =
|
||||||
build_request_response_protocol_receivers(&request_protocol_names, &mut config);
|
build_request_response_protocol_receivers(&request_protocol_names, &mut config);
|
||||||
|
|
||||||
let (network, network_starter) =
|
let (network, network_starter, sync_oracle) =
|
||||||
network::build_collator_network(network::BuildCollatorNetworkParams {
|
network::build_collator_network(network::BuildCollatorNetworkParams {
|
||||||
config: &config,
|
config: &config,
|
||||||
client: relay_chain_rpc_client.clone(),
|
client: relay_chain_rpc_client.clone(),
|
||||||
@@ -171,6 +171,7 @@ async fn new_minimal_relay_chain(
|
|||||||
let overseer_args = CollatorOverseerGenArgs {
|
let overseer_args = CollatorOverseerGenArgs {
|
||||||
runtime_client: relay_chain_rpc_client.clone(),
|
runtime_client: relay_chain_rpc_client.clone(),
|
||||||
network_service: network.clone(),
|
network_service: network.clone(),
|
||||||
|
sync_oracle,
|
||||||
authority_discovery_service,
|
authority_discovery_service,
|
||||||
collation_req_receiver,
|
collation_req_receiver,
|
||||||
available_data_req_receiver,
|
available_data_req_receiver,
|
||||||
|
|||||||
@@ -17,21 +17,15 @@
|
|||||||
use polkadot_core_primitives::{Block, Hash};
|
use polkadot_core_primitives::{Block, Hash};
|
||||||
use polkadot_service::{BlockT, NumberFor};
|
use polkadot_service::{BlockT, NumberFor};
|
||||||
|
|
||||||
use polkadot_node_network_protocol::PeerId;
|
use sc_network::NetworkService;
|
||||||
use sc_network::{NetworkService, SyncState};
|
|
||||||
|
|
||||||
use sc_client_api::HeaderBackend;
|
use sc_client_api::HeaderBackend;
|
||||||
use sc_consensus::{BlockImportError, BlockImportStatus, JustificationSyncLink, Link};
|
|
||||||
use sc_network_common::{
|
use sc_network_common::{
|
||||||
config::{
|
config::{
|
||||||
NonDefaultSetConfig, NonReservedPeerMode, NotificationHandshake, ProtocolId, SetConfig,
|
NonDefaultSetConfig, NonReservedPeerMode, NotificationHandshake, ProtocolId, SetConfig,
|
||||||
},
|
},
|
||||||
protocol::role::Roles,
|
protocol::role::Roles,
|
||||||
service::NetworkSyncForkRequest,
|
sync::message::BlockAnnouncesHandshake,
|
||||||
sync::{
|
|
||||||
message::{BlockAnnouncesHandshake, BlockRequest},
|
|
||||||
BadPeer, Metrics, OnBlockData, PollBlockAnnounceValidation, SyncStatus,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
use sc_service::{error::Error, Configuration, NetworkStarter, SpawnTaskHandle};
|
use sc_service::{error::Error, Configuration, NetworkStarter, SpawnTaskHandle};
|
||||||
|
|
||||||
@@ -53,12 +47,14 @@ pub(crate) struct BuildCollatorNetworkParams<'a> {
|
|||||||
/// Build the network service, the network status sinks and an RPC sender.
|
/// Build the network service, the network status sinks and an RPC sender.
|
||||||
pub(crate) fn build_collator_network(
|
pub(crate) fn build_collator_network(
|
||||||
params: BuildCollatorNetworkParams,
|
params: BuildCollatorNetworkParams,
|
||||||
) -> Result<(Arc<NetworkService<Block, Hash>>, NetworkStarter), Error> {
|
) -> Result<
|
||||||
|
(Arc<NetworkService<Block, Hash>>, NetworkStarter, Box<dyn sp_consensus::SyncOracle + Send>),
|
||||||
|
Error,
|
||||||
|
> {
|
||||||
let BuildCollatorNetworkParams { config, client, spawn_handle, genesis_hash } = params;
|
let BuildCollatorNetworkParams { config, client, spawn_handle, genesis_hash } = params;
|
||||||
|
|
||||||
let protocol_id = config.protocol_id();
|
let protocol_id = config.protocol_id();
|
||||||
let chain_sync = DummyChainSync;
|
let block_announce_config = get_block_announce_proto_config::<Block>(
|
||||||
let block_announce_config = chain_sync.get_block_announce_proto_config::<Block>(
|
|
||||||
protocol_id.clone(),
|
protocol_id.clone(),
|
||||||
&None,
|
&None,
|
||||||
Roles::from(&config.role),
|
Roles::from(&config.role),
|
||||||
@@ -76,13 +72,11 @@ pub(crate) fn build_collator_network(
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
fork_id: None,
|
fork_id: None,
|
||||||
chain_sync: Box::new(chain_sync),
|
|
||||||
network_config: config.network.clone(),
|
network_config: config.network.clone(),
|
||||||
chain: client.clone(),
|
chain: client.clone(),
|
||||||
protocol_id,
|
protocol_id,
|
||||||
metrics_registry: config.prometheus_config.as_ref().map(|config| config.registry.clone()),
|
metrics_registry: config.prometheus_config.as_ref().map(|config| config.registry.clone()),
|
||||||
block_announce_config,
|
block_announce_config,
|
||||||
chain_sync_service: Box::new(DummyChainSyncService::<Block>(Default::default())),
|
|
||||||
request_response_protocol_configs: Vec::new(),
|
request_response_protocol_configs: Vec::new(),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -113,246 +107,56 @@ pub(crate) fn build_collator_network(
|
|||||||
|
|
||||||
let network_starter = NetworkStarter::new(network_start_tx);
|
let network_starter = NetworkStarter::new(network_start_tx);
|
||||||
|
|
||||||
Ok((network_service, network_starter))
|
Ok((network_service, network_starter, Box::new(SyncOracle {})))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Empty ChainSync shell. Syncing code is not necessary for
|
struct SyncOracle;
|
||||||
/// the minimal node, but network currently requires it. So
|
|
||||||
/// we provide a noop implementation.
|
|
||||||
struct DummyChainSync;
|
|
||||||
|
|
||||||
impl DummyChainSync {
|
impl sp_consensus::SyncOracle for SyncOracle {
|
||||||
pub fn get_block_announce_proto_config<B: BlockT>(
|
fn is_major_syncing(&self) -> bool {
|
||||||
&self,
|
false
|
||||||
protocol_id: ProtocolId,
|
}
|
||||||
fork_id: &Option<String>,
|
|
||||||
roles: Roles,
|
|
||||||
best_number: NumberFor<B>,
|
|
||||||
best_hash: B::Hash,
|
|
||||||
genesis_hash: B::Hash,
|
|
||||||
) -> NonDefaultSetConfig {
|
|
||||||
let block_announces_protocol = {
|
|
||||||
let genesis_hash = genesis_hash.as_ref();
|
|
||||||
if let Some(ref fork_id) = fork_id {
|
|
||||||
format!(
|
|
||||||
"/{}/{}/block-announces/1",
|
|
||||||
array_bytes::bytes2hex("", genesis_hash),
|
|
||||||
fork_id
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
format!("/{}/block-announces/1", array_bytes::bytes2hex("", genesis_hash))
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
NonDefaultSetConfig {
|
fn is_offline(&self) -> bool {
|
||||||
notifications_protocol: block_announces_protocol.into(),
|
true
|
||||||
fallback_names: iter::once(
|
}
|
||||||
format!("/{}/block-announces/1", protocol_id.as_ref()).into(),
|
}
|
||||||
)
|
|
||||||
|
fn get_block_announce_proto_config<B: BlockT>(
|
||||||
|
protocol_id: ProtocolId,
|
||||||
|
fork_id: &Option<String>,
|
||||||
|
roles: Roles,
|
||||||
|
best_number: NumberFor<B>,
|
||||||
|
best_hash: B::Hash,
|
||||||
|
genesis_hash: B::Hash,
|
||||||
|
) -> NonDefaultSetConfig {
|
||||||
|
let block_announces_protocol = {
|
||||||
|
let genesis_hash = genesis_hash.as_ref();
|
||||||
|
if let Some(ref fork_id) = fork_id {
|
||||||
|
format!("/{}/{}/block-announces/1", array_bytes::bytes2hex("", genesis_hash), fork_id)
|
||||||
|
} else {
|
||||||
|
format!("/{}/block-announces/1", array_bytes::bytes2hex("", genesis_hash))
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
NonDefaultSetConfig {
|
||||||
|
notifications_protocol: block_announces_protocol.into(),
|
||||||
|
fallback_names: iter::once(format!("/{}/block-announces/1", protocol_id.as_ref()).into())
|
||||||
.collect(),
|
.collect(),
|
||||||
max_notification_size: 1024 * 1024,
|
max_notification_size: 1024 * 1024,
|
||||||
handshake: Some(NotificationHandshake::new(BlockAnnouncesHandshake::<B>::build(
|
handshake: Some(NotificationHandshake::new(BlockAnnouncesHandshake::<B>::build(
|
||||||
roles,
|
roles,
|
||||||
best_number,
|
best_number,
|
||||||
best_hash,
|
best_hash,
|
||||||
genesis_hash,
|
genesis_hash,
|
||||||
))),
|
))),
|
||||||
// NOTE: `set_config` will be ignored by `protocol.rs` as the block announcement
|
// NOTE: `set_config` will be ignored by `protocol.rs` as the block announcement
|
||||||
// protocol is still hardcoded into the peerset.
|
// protocol is still hardcoded into the peerset.
|
||||||
set_config: SetConfig {
|
set_config: SetConfig {
|
||||||
in_peers: 0,
|
in_peers: 0,
|
||||||
out_peers: 0,
|
out_peers: 0,
|
||||||
reserved_nodes: Vec::new(),
|
reserved_nodes: Vec::new(),
|
||||||
non_reserved_mode: NonReservedPeerMode::Deny,
|
non_reserved_mode: NonReservedPeerMode::Deny,
|
||||||
},
|
},
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<B: BlockT> sc_network_common::sync::ChainSync<B> for DummyChainSync {
|
|
||||||
fn peer_info(&self, _who: &PeerId) -> Option<sc_network_common::sync::PeerInfo<B>> {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
|
|
||||||
fn status(&self) -> sc_network_common::sync::SyncStatus<B> {
|
|
||||||
SyncStatus {
|
|
||||||
state: SyncState::Idle,
|
|
||||||
best_seen_block: None,
|
|
||||||
num_peers: 0,
|
|
||||||
queued_blocks: 0,
|
|
||||||
state_sync: None,
|
|
||||||
warp_sync: None,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn num_sync_requests(&self) -> usize {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
|
|
||||||
fn num_downloaded_blocks(&self) -> usize {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
|
|
||||||
fn num_peers(&self) -> usize {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
|
|
||||||
fn new_peer(
|
|
||||||
&mut self,
|
|
||||||
_who: PeerId,
|
|
||||||
_best_hash: <B as BlockT>::Hash,
|
|
||||||
_best_number: polkadot_service::NumberFor<B>,
|
|
||||||
) -> Result<
|
|
||||||
Option<sc_network_common::sync::message::BlockRequest<B>>,
|
|
||||||
sc_network_common::sync::BadPeer,
|
|
||||||
> {
|
|
||||||
Ok(None)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn update_chain_info(
|
|
||||||
&mut self,
|
|
||||||
_best_hash: &<B as BlockT>::Hash,
|
|
||||||
_best_number: polkadot_service::NumberFor<B>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
fn request_justification(
|
|
||||||
&mut self,
|
|
||||||
_hash: &<B as BlockT>::Hash,
|
|
||||||
_number: polkadot_service::NumberFor<B>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
fn clear_justification_requests(&mut self) {}
|
|
||||||
|
|
||||||
fn set_sync_fork_request(
|
|
||||||
&mut self,
|
|
||||||
_peers: Vec<PeerId>,
|
|
||||||
_hash: &<B as BlockT>::Hash,
|
|
||||||
_number: polkadot_service::NumberFor<B>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
fn on_block_data(
|
|
||||||
&mut self,
|
|
||||||
_who: &PeerId,
|
|
||||||
_request: Option<sc_network_common::sync::message::BlockRequest<B>>,
|
|
||||||
_response: sc_network_common::sync::message::BlockResponse<B>,
|
|
||||||
) -> Result<sc_network_common::sync::OnBlockData<B>, sc_network_common::sync::BadPeer> {
|
|
||||||
unimplemented!("Not supported on the RPC collator")
|
|
||||||
}
|
|
||||||
|
|
||||||
fn on_block_justification(
|
|
||||||
&mut self,
|
|
||||||
_who: PeerId,
|
|
||||||
_response: sc_network_common::sync::message::BlockResponse<B>,
|
|
||||||
) -> Result<sc_network_common::sync::OnBlockJustification<B>, sc_network_common::sync::BadPeer>
|
|
||||||
{
|
|
||||||
unimplemented!("Not supported on the RPC collator")
|
|
||||||
}
|
|
||||||
|
|
||||||
fn on_justification_import(
|
|
||||||
&mut self,
|
|
||||||
_hash: <B as BlockT>::Hash,
|
|
||||||
_number: polkadot_service::NumberFor<B>,
|
|
||||||
_success: bool,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
fn on_block_finalized(
|
|
||||||
&mut self,
|
|
||||||
_hash: &<B as BlockT>::Hash,
|
|
||||||
_number: polkadot_service::NumberFor<B>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
fn push_block_announce_validation(
|
|
||||||
&mut self,
|
|
||||||
_who: PeerId,
|
|
||||||
_hash: <B as BlockT>::Hash,
|
|
||||||
_announce: sc_network_common::sync::message::BlockAnnounce<<B as BlockT>::Header>,
|
|
||||||
_is_best: bool,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
fn poll_block_announce_validation(
|
|
||||||
&mut self,
|
|
||||||
_cx: &mut std::task::Context,
|
|
||||||
) -> std::task::Poll<sc_network_common::sync::PollBlockAnnounceValidation<<B as BlockT>::Header>>
|
|
||||||
{
|
|
||||||
std::task::Poll::Pending
|
|
||||||
}
|
|
||||||
|
|
||||||
fn peer_disconnected(&mut self, _who: &PeerId) {}
|
|
||||||
|
|
||||||
fn metrics(&self) -> sc_network_common::sync::Metrics {
|
|
||||||
Metrics {
|
|
||||||
queued_blocks: 0,
|
|
||||||
fork_targets: 0,
|
|
||||||
justifications: sc_network_common::sync::metrics::Metrics {
|
|
||||||
pending_requests: 0,
|
|
||||||
active_requests: 0,
|
|
||||||
importing_requests: 0,
|
|
||||||
failed_requests: 0,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn block_response_into_blocks(
|
|
||||||
&self,
|
|
||||||
_request: &sc_network_common::sync::message::BlockRequest<B>,
|
|
||||||
_response: sc_network_common::sync::OpaqueBlockResponse,
|
|
||||||
) -> Result<Vec<sc_network_common::sync::message::BlockData<B>>, String> {
|
|
||||||
unimplemented!("Not supported on the RPC collator")
|
|
||||||
}
|
|
||||||
|
|
||||||
fn poll(
|
|
||||||
&mut self,
|
|
||||||
_cx: &mut std::task::Context,
|
|
||||||
) -> std::task::Poll<PollBlockAnnounceValidation<B::Header>> {
|
|
||||||
std::task::Poll::Pending
|
|
||||||
}
|
|
||||||
|
|
||||||
fn send_block_request(&mut self, _who: PeerId, _request: BlockRequest<B>) {
|
|
||||||
unimplemented!("Not supported on the RPC collator")
|
|
||||||
}
|
|
||||||
|
|
||||||
fn num_active_peers(&self) -> usize {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
|
|
||||||
fn process_block_response_data(&mut self, _blocks_to_import: Result<OnBlockData<B>, BadPeer>) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct DummyChainSyncService<B>(std::marker::PhantomData<B>);
|
|
||||||
|
|
||||||
impl<B: BlockT> NetworkSyncForkRequest<B::Hash, NumberFor<B>> for DummyChainSyncService<B> {
|
|
||||||
fn set_sync_fork_request(&self, _peers: Vec<PeerId>, _hash: B::Hash, _number: NumberFor<B>) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<B: BlockT> JustificationSyncLink<B> for DummyChainSyncService<B> {
|
|
||||||
fn request_justification(&self, _hash: &B::Hash, _number: NumberFor<B>) {}
|
|
||||||
|
|
||||||
fn clear_justification_requests(&self) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<B: BlockT> Link<B> for DummyChainSyncService<B> {
|
|
||||||
fn blocks_processed(
|
|
||||||
&mut self,
|
|
||||||
_imported: usize,
|
|
||||||
_count: usize,
|
|
||||||
_results: Vec<(Result<BlockImportStatus<NumberFor<B>>, BlockImportError>, B::Hash)>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
fn justification_imported(
|
|
||||||
&mut self,
|
|
||||||
_who: PeerId,
|
|
||||||
_hash: &B::Hash,
|
|
||||||
_number: NumberFor<B>,
|
|
||||||
_success: bool,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
fn request_justification(&mut self, _hash: &B::Hash, _number: NumberFor<B>) {}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ sc-service = { git = "https://github.com/paritytech/substrate", branch = "master
|
|||||||
sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
|
sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
|
sc-network-sync = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sc-utils = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sc-utils = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sc-network-transactions = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sc-network-transactions = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
@@ -38,4 +40,4 @@ cumulus-client-network = { path = "../network" }
|
|||||||
cumulus-primitives-core = { path = "../../primitives/core" }
|
cumulus-primitives-core = { path = "../../primitives/core" }
|
||||||
cumulus-relay-chain-interface = { path = "../relay-chain-interface" }
|
cumulus-relay-chain-interface = { path = "../relay-chain-interface" }
|
||||||
cumulus-relay-chain-inprocess-interface = { path = "../relay-chain-inprocess-interface" }
|
cumulus-relay-chain-inprocess-interface = { path = "../relay-chain-inprocess-interface" }
|
||||||
cumulus-relay-chain-minimal-node = { path = "../relay-chain-minimal-node" }
|
cumulus-relay-chain-minimal-node = { path = "../relay-chain-minimal-node" }
|
||||||
|
|||||||
@@ -34,8 +34,13 @@ use polkadot_primitives::{CollatorPair, OccupiedCoreAssumption};
|
|||||||
use sc_client_api::{
|
use sc_client_api::{
|
||||||
Backend as BackendT, BlockBackend, BlockchainEvents, Finalizer, ProofProvider, UsageProvider,
|
Backend as BackendT, BlockBackend, BlockchainEvents, Finalizer, ProofProvider, UsageProvider,
|
||||||
};
|
};
|
||||||
use sc_consensus::{import_queue::ImportQueueService, BlockImport, ImportQueue};
|
use sc_consensus::{
|
||||||
use sc_network::{config::SyncMode, NetworkService};
|
import_queue::{ImportQueue, ImportQueueService},
|
||||||
|
BlockImport,
|
||||||
|
};
|
||||||
|
use sc_network::NetworkService;
|
||||||
|
use sc_network_common::config::SyncMode;
|
||||||
|
use sc_network_sync::SyncingService;
|
||||||
use sc_network_transactions::TransactionsHandlerController;
|
use sc_network_transactions::TransactionsHandlerController;
|
||||||
use sc_service::{Configuration, NetworkStarter, SpawnTaskHandle, TaskManager, WarpSyncParams};
|
use sc_service::{Configuration, NetworkStarter, SpawnTaskHandle, TaskManager, WarpSyncParams};
|
||||||
use sc_telemetry::{log, TelemetryWorkerHandle};
|
use sc_telemetry::{log, TelemetryWorkerHandle};
|
||||||
@@ -315,6 +320,7 @@ pub async fn build_network<'a, Block, Client, RCInterface, IQ>(
|
|||||||
TracingUnboundedSender<sc_rpc::system::Request<Block>>,
|
TracingUnboundedSender<sc_rpc::system::Request<Block>>,
|
||||||
TransactionsHandlerController<Block::Hash>,
|
TransactionsHandlerController<Block::Hash>,
|
||||||
NetworkStarter,
|
NetworkStarter,
|
||||||
|
Arc<SyncingService<Block>>,
|
||||||
)>
|
)>
|
||||||
where
|
where
|
||||||
Block: BlockT,
|
Block: BlockT,
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "mast
|
|||||||
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
|
sc-network-sync = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sc-service = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sc-service = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use std::{sync::Arc, time::Duration};
|
|||||||
|
|
||||||
use cumulus_client_cli::CollatorOptions;
|
use cumulus_client_cli::CollatorOptions;
|
||||||
// Local Runtime Types
|
// Local Runtime Types
|
||||||
use parachain_template_runtime::{opaque::Block, Hash, RuntimeApi};
|
use parachain_template_runtime::{opaque::Block, RuntimeApi};
|
||||||
|
|
||||||
// Cumulus Imports
|
// Cumulus Imports
|
||||||
use cumulus_client_consensus_aura::{AuraConsensus, BuildAuraConsensusParams, SlotProportion};
|
use cumulus_client_consensus_aura::{AuraConsensus, BuildAuraConsensusParams, SlotProportion};
|
||||||
@@ -23,8 +23,8 @@ use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface};
|
|||||||
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
|
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
|
||||||
use sc_consensus::ImportQueue;
|
use sc_consensus::ImportQueue;
|
||||||
use sc_executor::NativeElseWasmExecutor;
|
use sc_executor::NativeElseWasmExecutor;
|
||||||
use sc_network::NetworkService;
|
|
||||||
use sc_network_common::service::NetworkBlock;
|
use sc_network_common::service::NetworkBlock;
|
||||||
|
use sc_network_sync::SyncingService;
|
||||||
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
|
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
|
||||||
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
|
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
|
||||||
use sp_keystore::SyncCryptoStorePtr;
|
use sp_keystore::SyncCryptoStorePtr;
|
||||||
@@ -173,7 +173,7 @@ async fn start_node_impl(
|
|||||||
let transaction_pool = params.transaction_pool.clone();
|
let transaction_pool = params.transaction_pool.clone();
|
||||||
let import_queue_service = params.import_queue.service();
|
let import_queue_service = params.import_queue.service();
|
||||||
|
|
||||||
let (network, system_rpc_tx, tx_handler_controller, start_network) =
|
let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =
|
||||||
build_network(BuildNetworkParams {
|
build_network(BuildNetworkParams {
|
||||||
parachain_config: ¶chain_config,
|
parachain_config: ¶chain_config,
|
||||||
client: client.clone(),
|
client: client.clone(),
|
||||||
@@ -218,6 +218,7 @@ async fn start_node_impl(
|
|||||||
keystore: params.keystore_container.sync_keystore(),
|
keystore: params.keystore_container.sync_keystore(),
|
||||||
backend,
|
backend,
|
||||||
network: network.clone(),
|
network: network.clone(),
|
||||||
|
sync_service: sync_service.clone(),
|
||||||
system_rpc_tx,
|
system_rpc_tx,
|
||||||
tx_handler_controller,
|
tx_handler_controller,
|
||||||
telemetry: telemetry.as_mut(),
|
telemetry: telemetry.as_mut(),
|
||||||
@@ -245,8 +246,8 @@ async fn start_node_impl(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let announce_block = {
|
let announce_block = {
|
||||||
let network = network.clone();
|
let sync_service = sync_service.clone();
|
||||||
Arc::new(move |hash, data| network.announce_block(hash, data))
|
Arc::new(move |hash, data| sync_service.announce_block(hash, data))
|
||||||
};
|
};
|
||||||
|
|
||||||
let relay_chain_slot_duration = Duration::from_secs(6);
|
let relay_chain_slot_duration = Duration::from_secs(6);
|
||||||
@@ -264,7 +265,7 @@ async fn start_node_impl(
|
|||||||
&task_manager,
|
&task_manager,
|
||||||
relay_chain_interface.clone(),
|
relay_chain_interface.clone(),
|
||||||
transaction_pool,
|
transaction_pool,
|
||||||
network,
|
sync_service,
|
||||||
params.keystore_container.sync_keystore(),
|
params.keystore_container.sync_keystore(),
|
||||||
force_authoring,
|
force_authoring,
|
||||||
para_id,
|
para_id,
|
||||||
@@ -353,7 +354,7 @@ fn build_consensus(
|
|||||||
task_manager: &TaskManager,
|
task_manager: &TaskManager,
|
||||||
relay_chain_interface: Arc<dyn RelayChainInterface>,
|
relay_chain_interface: Arc<dyn RelayChainInterface>,
|
||||||
transaction_pool: Arc<sc_transaction_pool::FullPool<Block, ParachainClient>>,
|
transaction_pool: Arc<sc_transaction_pool::FullPool<Block, ParachainClient>>,
|
||||||
sync_oracle: Arc<NetworkService<Block, Hash>>,
|
sync_oracle: Arc<SyncingService<Block>>,
|
||||||
keystore: SyncCryptoStorePtr,
|
keystore: SyncCryptoStorePtr,
|
||||||
force_authoring: bool,
|
force_authoring: bool,
|
||||||
para_id: ParaId,
|
para_id: ParaId,
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch
|
|||||||
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
|
sc-network-sync = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ use sc_consensus::{
|
|||||||
BlockImportParams, ImportQueue,
|
BlockImportParams, ImportQueue,
|
||||||
};
|
};
|
||||||
use sc_executor::WasmExecutor;
|
use sc_executor::WasmExecutor;
|
||||||
use sc_network::NetworkService;
|
|
||||||
use sc_network_common::service::NetworkBlock;
|
use sc_network_common::service::NetworkBlock;
|
||||||
|
use sc_network_sync::SyncingService;
|
||||||
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
|
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
|
||||||
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
|
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
|
||||||
use sp_api::{ApiExt, ConstructRuntimeApi};
|
use sp_api::{ApiExt, ConstructRuntimeApi};
|
||||||
@@ -359,7 +359,7 @@ where
|
|||||||
&TaskManager,
|
&TaskManager,
|
||||||
Arc<dyn RelayChainInterface>,
|
Arc<dyn RelayChainInterface>,
|
||||||
Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
|
Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
|
||||||
Arc<NetworkService<Block, Hash>>,
|
Arc<SyncingService<Block>>,
|
||||||
SyncCryptoStorePtr,
|
SyncCryptoStorePtr,
|
||||||
bool,
|
bool,
|
||||||
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,
|
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,
|
||||||
@@ -394,7 +394,7 @@ where
|
|||||||
let transaction_pool = params.transaction_pool.clone();
|
let transaction_pool = params.transaction_pool.clone();
|
||||||
let import_queue_service = params.import_queue.service();
|
let import_queue_service = params.import_queue.service();
|
||||||
|
|
||||||
let (network, system_rpc_tx, tx_handler_controller, start_network) =
|
let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =
|
||||||
build_network(BuildNetworkParams {
|
build_network(BuildNetworkParams {
|
||||||
parachain_config: ¶chain_config,
|
parachain_config: ¶chain_config,
|
||||||
client: client.clone(),
|
client: client.clone(),
|
||||||
@@ -418,6 +418,7 @@ where
|
|||||||
keystore: params.keystore_container.sync_keystore(),
|
keystore: params.keystore_container.sync_keystore(),
|
||||||
backend: backend.clone(),
|
backend: backend.clone(),
|
||||||
network: network.clone(),
|
network: network.clone(),
|
||||||
|
sync_service: sync_service.clone(),
|
||||||
system_rpc_tx,
|
system_rpc_tx,
|
||||||
tx_handler_controller,
|
tx_handler_controller,
|
||||||
telemetry: telemetry.as_mut(),
|
telemetry: telemetry.as_mut(),
|
||||||
@@ -440,8 +441,8 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
let announce_block = {
|
let announce_block = {
|
||||||
let network = network.clone();
|
let sync_service = sync_service.clone();
|
||||||
Arc::new(move |hash, data| network.announce_block(hash, data))
|
Arc::new(move |hash, data| sync_service.announce_block(hash, data))
|
||||||
};
|
};
|
||||||
|
|
||||||
let relay_chain_slot_duration = Duration::from_secs(6);
|
let relay_chain_slot_duration = Duration::from_secs(6);
|
||||||
@@ -459,7 +460,7 @@ where
|
|||||||
&task_manager,
|
&task_manager,
|
||||||
relay_chain_interface.clone(),
|
relay_chain_interface.clone(),
|
||||||
transaction_pool,
|
transaction_pool,
|
||||||
network,
|
sync_service,
|
||||||
params.keystore_container.sync_keystore(),
|
params.keystore_container.sync_keystore(),
|
||||||
force_authoring,
|
force_authoring,
|
||||||
)?;
|
)?;
|
||||||
@@ -549,7 +550,7 @@ where
|
|||||||
&TaskManager,
|
&TaskManager,
|
||||||
Arc<dyn RelayChainInterface>,
|
Arc<dyn RelayChainInterface>,
|
||||||
Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
|
Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
|
||||||
Arc<NetworkService<Block, Hash>>,
|
Arc<SyncingService<Block>>,
|
||||||
SyncCryptoStorePtr,
|
SyncCryptoStorePtr,
|
||||||
bool,
|
bool,
|
||||||
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,
|
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,
|
||||||
@@ -583,8 +584,8 @@ where
|
|||||||
let transaction_pool = params.transaction_pool.clone();
|
let transaction_pool = params.transaction_pool.clone();
|
||||||
let import_queue_service = params.import_queue.service();
|
let import_queue_service = params.import_queue.service();
|
||||||
|
|
||||||
let (network, system_rpc_tx, tx_handler_controller, start_network) =
|
let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =
|
||||||
build_network(cumulus_client_service::BuildNetworkParams {
|
build_network(BuildNetworkParams {
|
||||||
parachain_config: ¶chain_config,
|
parachain_config: ¶chain_config,
|
||||||
client: client.clone(),
|
client: client.clone(),
|
||||||
transaction_pool: transaction_pool.clone(),
|
transaction_pool: transaction_pool.clone(),
|
||||||
@@ -620,6 +621,7 @@ where
|
|||||||
keystore: params.keystore_container.sync_keystore(),
|
keystore: params.keystore_container.sync_keystore(),
|
||||||
backend: backend.clone(),
|
backend: backend.clone(),
|
||||||
network: network.clone(),
|
network: network.clone(),
|
||||||
|
sync_service: sync_service.clone(),
|
||||||
system_rpc_tx,
|
system_rpc_tx,
|
||||||
tx_handler_controller,
|
tx_handler_controller,
|
||||||
telemetry: telemetry.as_mut(),
|
telemetry: telemetry.as_mut(),
|
||||||
@@ -642,8 +644,8 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
let announce_block = {
|
let announce_block = {
|
||||||
let network = network.clone();
|
let sync_service = sync_service.clone();
|
||||||
Arc::new(move |hash, data| network.announce_block(hash, data))
|
Arc::new(move |hash, data| sync_service.announce_block(hash, data))
|
||||||
};
|
};
|
||||||
|
|
||||||
let relay_chain_slot_duration = Duration::from_secs(6);
|
let relay_chain_slot_duration = Duration::from_secs(6);
|
||||||
@@ -660,7 +662,7 @@ where
|
|||||||
&task_manager,
|
&task_manager,
|
||||||
relay_chain_interface.clone(),
|
relay_chain_interface.clone(),
|
||||||
transaction_pool,
|
transaction_pool,
|
||||||
network,
|
sync_service,
|
||||||
params.keystore_container.sync_keystore(),
|
params.keystore_container.sync_keystore(),
|
||||||
force_authoring,
|
force_authoring,
|
||||||
)?;
|
)?;
|
||||||
@@ -1321,7 +1323,7 @@ where
|
|||||||
&TaskManager,
|
&TaskManager,
|
||||||
Arc<dyn RelayChainInterface>,
|
Arc<dyn RelayChainInterface>,
|
||||||
Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
|
Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
|
||||||
Arc<NetworkService<Block, Hash>>,
|
Arc<SyncingService<Block>>,
|
||||||
SyncCryptoStorePtr,
|
SyncCryptoStorePtr,
|
||||||
bool,
|
bool,
|
||||||
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,
|
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,
|
||||||
@@ -1355,7 +1357,7 @@ where
|
|||||||
let transaction_pool = params.transaction_pool.clone();
|
let transaction_pool = params.transaction_pool.clone();
|
||||||
let import_queue_service = params.import_queue.service();
|
let import_queue_service = params.import_queue.service();
|
||||||
|
|
||||||
let (network, system_rpc_tx, tx_handler_controller, start_network) =
|
let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =
|
||||||
build_network(BuildNetworkParams {
|
build_network(BuildNetworkParams {
|
||||||
parachain_config: ¶chain_config,
|
parachain_config: ¶chain_config,
|
||||||
client: client.clone(),
|
client: client.clone(),
|
||||||
@@ -1391,6 +1393,7 @@ where
|
|||||||
keystore: params.keystore_container.sync_keystore(),
|
keystore: params.keystore_container.sync_keystore(),
|
||||||
backend: backend.clone(),
|
backend: backend.clone(),
|
||||||
network: network.clone(),
|
network: network.clone(),
|
||||||
|
sync_service: sync_service.clone(),
|
||||||
system_rpc_tx,
|
system_rpc_tx,
|
||||||
tx_handler_controller,
|
tx_handler_controller,
|
||||||
telemetry: telemetry.as_mut(),
|
telemetry: telemetry.as_mut(),
|
||||||
@@ -1413,8 +1416,8 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
let announce_block = {
|
let announce_block = {
|
||||||
let network = network.clone();
|
let sync_service = sync_service.clone();
|
||||||
Arc::new(move |hash, data| network.announce_block(hash, data))
|
Arc::new(move |hash, data| sync_service.announce_block(hash, data))
|
||||||
};
|
};
|
||||||
|
|
||||||
let relay_chain_slot_duration = Duration::from_secs(6);
|
let relay_chain_slot_duration = Duration::from_secs(6);
|
||||||
@@ -1431,7 +1434,7 @@ where
|
|||||||
&task_manager,
|
&task_manager,
|
||||||
relay_chain_interface.clone(),
|
relay_chain_interface.clone(),
|
||||||
transaction_pool,
|
transaction_pool,
|
||||||
network,
|
sync_service,
|
||||||
params.keystore_container.sync_keystore(),
|
params.keystore_container.sync_keystore(),
|
||||||
force_authoring,
|
force_authoring,
|
||||||
)?;
|
)?;
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ async fn build_relay_chain_interface(
|
|||||||
Ok(Arc::new(RelayChainInProcessInterface::new(
|
Ok(Arc::new(RelayChainInProcessInterface::new(
|
||||||
relay_chain_full_node.client.clone(),
|
relay_chain_full_node.client.clone(),
|
||||||
relay_chain_full_node.backend.clone(),
|
relay_chain_full_node.backend.clone(),
|
||||||
Arc::new(relay_chain_full_node.network.clone()),
|
relay_chain_full_node.sync_service.clone(),
|
||||||
relay_chain_full_node.overseer_handle.ok_or(RelayChainError::GenericError(
|
relay_chain_full_node.overseer_handle.ok_or(RelayChainError::GenericError(
|
||||||
"Overseer should be running in full node.".to_string(),
|
"Overseer should be running in full node.".to_string(),
|
||||||
))?,
|
))?,
|
||||||
@@ -315,8 +315,7 @@ where
|
|||||||
})?;
|
})?;
|
||||||
|
|
||||||
let import_queue_service = params.import_queue.service();
|
let import_queue_service = params.import_queue.service();
|
||||||
|
let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =
|
||||||
let (network, system_rpc_tx, tx_handler_controller, start_network) =
|
|
||||||
build_network(BuildNetworkParams {
|
build_network(BuildNetworkParams {
|
||||||
parachain_config: ¶chain_config,
|
parachain_config: ¶chain_config,
|
||||||
client: client.clone(),
|
client: client.clone(),
|
||||||
@@ -344,14 +343,15 @@ where
|
|||||||
keystore: params.keystore_container.sync_keystore(),
|
keystore: params.keystore_container.sync_keystore(),
|
||||||
backend: backend.clone(),
|
backend: backend.clone(),
|
||||||
network: network.clone(),
|
network: network.clone(),
|
||||||
|
sync_service: sync_service.clone(),
|
||||||
system_rpc_tx,
|
system_rpc_tx,
|
||||||
tx_handler_controller,
|
tx_handler_controller,
|
||||||
telemetry: None,
|
telemetry: None,
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let announce_block = {
|
let announce_block = {
|
||||||
let network = network.clone();
|
let sync_service = sync_service.clone();
|
||||||
Arc::new(move |hash, data| network.announce_block(hash, data))
|
Arc::new(move |hash, data| sync_service.announce_block(hash, data))
|
||||||
};
|
};
|
||||||
|
|
||||||
let announce_block = wrap_announce_block
|
let announce_block = wrap_announce_block
|
||||||
|
|||||||
Reference in New Issue
Block a user