mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-21 06:15:41 +00:00
Cleanup light client leftovers (#1456)
* Cleanup light client leftovers * Readme: make it clear that Collator is full node of parachain * cargo update -p sp-io * cargo update -p polkadot-primitives
This commit is contained in:
Generated
+247
-247
File diff suppressed because it is too large
Load Diff
@@ -30,7 +30,7 @@ use futures::{FutureExt, Stream, StreamExt};
|
|||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
use polkadot_client::{ClientHandle, ExecuteWithClient, FullBackend};
|
use polkadot_client::{ClientHandle, ExecuteWithClient, FullBackend};
|
||||||
use polkadot_service::{
|
use polkadot_service::{
|
||||||
AuxStore, BabeApi, CollatorPair, Configuration, Handle, NewFull, Role, TaskManager,
|
AuxStore, BabeApi, CollatorPair, Configuration, Handle, NewFull, TaskManager,
|
||||||
};
|
};
|
||||||
use sc_cli::SubstrateCli;
|
use sc_cli::SubstrateCli;
|
||||||
use sc_client_api::{
|
use sc_client_api::{
|
||||||
@@ -330,33 +330,28 @@ fn build_polkadot_full_node(
|
|||||||
telemetry_worker_handle: Option<TelemetryWorkerHandle>,
|
telemetry_worker_handle: Option<TelemetryWorkerHandle>,
|
||||||
hwbench: Option<sc_sysinfo::HwBench>,
|
hwbench: Option<sc_sysinfo::HwBench>,
|
||||||
) -> Result<(NewFull<polkadot_client::Client>, Option<CollatorPair>), polkadot_service::Error> {
|
) -> Result<(NewFull<polkadot_client::Client>, Option<CollatorPair>), polkadot_service::Error> {
|
||||||
let is_light = matches!(config.role, Role::Light);
|
let (is_collator, maybe_collator_key) = if parachain_config.role.is_authority() {
|
||||||
if is_light {
|
let collator_key = CollatorPair::generate().0;
|
||||||
Err(polkadot_service::Error::Sub("Light client not supported.".into()))
|
(polkadot_service::IsCollator::Yes(collator_key.clone()), Some(collator_key))
|
||||||
} else {
|
} else {
|
||||||
let (is_collator, maybe_collator_key) = if parachain_config.role.is_authority() {
|
(polkadot_service::IsCollator::No, None)
|
||||||
let collator_key = CollatorPair::generate().0;
|
};
|
||||||
(polkadot_service::IsCollator::Yes(collator_key.clone()), Some(collator_key))
|
|
||||||
} else {
|
|
||||||
(polkadot_service::IsCollator::No, None)
|
|
||||||
};
|
|
||||||
|
|
||||||
let relay_chain_full_node = polkadot_service::build_full(
|
let relay_chain_full_node = polkadot_service::build_full(
|
||||||
config,
|
config,
|
||||||
is_collator,
|
is_collator,
|
||||||
None,
|
None,
|
||||||
// Disable BEEFY. It should not be required by the internal relay chain node.
|
// Disable BEEFY. It should not be required by the internal relay chain node.
|
||||||
false,
|
false,
|
||||||
None,
|
None,
|
||||||
telemetry_worker_handle,
|
telemetry_worker_handle,
|
||||||
true,
|
true,
|
||||||
polkadot_service::RealOverseerGen,
|
polkadot_service::RealOverseerGen,
|
||||||
None,
|
None,
|
||||||
hwbench,
|
hwbench,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
Ok((relay_chain_full_node, maybe_collator_key))
|
Ok((relay_chain_full_node, maybe_collator_key))
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Builds a relay chain interface by constructing a full relay chain node
|
/// Builds a relay chain interface by constructing a full relay chain node
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ the notification the so-called candidate message. This candidate message is issu
|
|||||||
validator after approving a block. This proof of possible inclusion prevents spamming other collators
|
validator after approving a block. This proof of possible inclusion prevents spamming other collators
|
||||||
of the network with useless blocks.
|
of the network with useless blocks.
|
||||||
The Collator joins the relay-chain network for two reasons. First, the Collator uses it to send the
|
The Collator joins the relay-chain network for two reasons. First, the Collator uses it to send the
|
||||||
Parachain blocks to the Parachain validators. Secondly, the Collator participates as light/full-node
|
Parachain blocks to the Parachain validators. Secondly, the Collator participates as a full-node
|
||||||
of the relay chain to be informed of new relay-chain blocks. This information will be used for the
|
of the relay chain to be informed of new relay-chain blocks. This information will be used for the
|
||||||
consensus and the block production logic.
|
consensus and the block production logic.
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ use cumulus_relay_chain_rpc_interface::RelayChainRPCInterface;
|
|||||||
use sc_client_api::ExecutorProvider;
|
use sc_client_api::ExecutorProvider;
|
||||||
use sc_executor::NativeElseWasmExecutor;
|
use sc_executor::NativeElseWasmExecutor;
|
||||||
use sc_network::NetworkService;
|
use sc_network::NetworkService;
|
||||||
use sc_service::{Configuration, PartialComponents, Role, 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::ConstructRuntimeApi;
|
use sp_api::ConstructRuntimeApi;
|
||||||
use sp_keystore::SyncCryptoStorePtr;
|
use sp_keystore::SyncCryptoStorePtr;
|
||||||
@@ -257,10 +257,6 @@ where
|
|||||||
bool,
|
bool,
|
||||||
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,
|
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,
|
||||||
{
|
{
|
||||||
if matches!(parachain_config.role, Role::Light) {
|
|
||||||
return Err("Light client not supported!".into())
|
|
||||||
}
|
|
||||||
|
|
||||||
let parachain_config = prepare_node_config(parachain_config);
|
let parachain_config = prepare_node_config(parachain_config);
|
||||||
|
|
||||||
let params = new_partial::<RuntimeApi, Executor, BIQ>(¶chain_config, build_import_queue)?;
|
let params = new_partial::<RuntimeApi, Executor, BIQ>(¶chain_config, build_import_queue)?;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ use sc_consensus::{
|
|||||||
};
|
};
|
||||||
use sc_executor::WasmExecutor;
|
use sc_executor::WasmExecutor;
|
||||||
use sc_network::NetworkService;
|
use sc_network::NetworkService;
|
||||||
use sc_service::{Configuration, PartialComponents, Role, 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};
|
||||||
use sp_consensus::CacheKeyId;
|
use sp_consensus::CacheKeyId;
|
||||||
@@ -374,10 +374,6 @@ where
|
|||||||
bool,
|
bool,
|
||||||
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,
|
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,
|
||||||
{
|
{
|
||||||
if matches!(parachain_config.role, Role::Light) {
|
|
||||||
return Err("Light client not supported!".into())
|
|
||||||
}
|
|
||||||
|
|
||||||
let parachain_config = prepare_node_config(parachain_config);
|
let parachain_config = prepare_node_config(parachain_config);
|
||||||
|
|
||||||
let params = new_partial::<RuntimeApi, BIQ>(¶chain_config, build_import_queue)?;
|
let params = new_partial::<RuntimeApi, BIQ>(¶chain_config, build_import_queue)?;
|
||||||
@@ -576,10 +572,6 @@ where
|
|||||||
bool,
|
bool,
|
||||||
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,
|
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,
|
||||||
{
|
{
|
||||||
if matches!(parachain_config.role, Role::Light) {
|
|
||||||
return Err("Light client not supported!".into())
|
|
||||||
}
|
|
||||||
|
|
||||||
let parachain_config = prepare_node_config(parachain_config);
|
let parachain_config = prepare_node_config(parachain_config);
|
||||||
|
|
||||||
let params = new_partial::<RuntimeApi, BIQ>(¶chain_config, build_import_queue)?;
|
let params = new_partial::<RuntimeApi, BIQ>(¶chain_config, build_import_queue)?;
|
||||||
@@ -1400,10 +1392,6 @@ where
|
|||||||
bool,
|
bool,
|
||||||
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,
|
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,
|
||||||
{
|
{
|
||||||
if matches!(parachain_config.role, Role::Light) {
|
|
||||||
return Err("Light client not supported!".into())
|
|
||||||
}
|
|
||||||
|
|
||||||
let parachain_config = prepare_node_config(parachain_config);
|
let parachain_config = prepare_node_config(parachain_config);
|
||||||
|
|
||||||
let params = new_partial::<RuntimeApi, BIQ>(¶chain_config, build_import_queue)?;
|
let params = new_partial::<RuntimeApi, BIQ>(¶chain_config, build_import_queue)?;
|
||||||
|
|||||||
@@ -227,10 +227,6 @@ pub async fn start_node_impl<RB>(
|
|||||||
where
|
where
|
||||||
RB: Fn(Arc<Client>) -> Result<jsonrpsee::RpcModule<()>, sc_service::Error> + Send + 'static,
|
RB: Fn(Arc<Client>) -> Result<jsonrpsee::RpcModule<()>, sc_service::Error> + Send + 'static,
|
||||||
{
|
{
|
||||||
if matches!(parachain_config.role, Role::Light) {
|
|
||||||
return Err("Light client not supported!".into())
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut parachain_config = prepare_node_config(parachain_config);
|
let mut parachain_config = prepare_node_config(parachain_config);
|
||||||
|
|
||||||
let params = new_partial(&mut parachain_config)?;
|
let params = new_partial(&mut parachain_config)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user