diff --git a/substrate/node/src/service.rs b/substrate/node/src/service.rs index 19618220..1de4e6ed 100644 --- a/substrate/node/src/service.rs +++ b/substrate/node/src/service.rs @@ -21,12 +21,12 @@ pub(crate) use sc_tendermint::{ use serai_runtime::{self, MILLISECS_PER_BLOCK, opaque::Block, RuntimeApi}; type FullBackend = sc_service::TFullBackend; -type FullSelectChain = TendermintSelectChain; +pub type FullClient = TFullClient>; type PartialComponents = sc_service::PartialComponents< FullClient, FullBackend, - FullSelectChain, + TendermintSelectChain, sc_consensus::DefaultImportQueue, sc_transaction_pool::FullPool, Option, @@ -48,8 +48,6 @@ impl NativeExecutionDispatch for ExecutorDispatch { } } -pub type FullClient = TFullClient>; - pub struct Cidp; #[async_trait::async_trait] impl CreateInherentDataProviders for Cidp { @@ -169,11 +167,13 @@ pub async fn new_full(mut config: Configuration) -> Result Result Result TendermintAuthority { /// as it will not return until the P2P stack shuts down. pub async fn authority( mut self, + protocol: ProtocolName, keys: Arc, providers: T::CIDP, env: T::Environment, @@ -158,7 +159,6 @@ impl TendermintAuthority { // Create the gossip network let mut gossip = GossipEngine::new( network.clone(), - PROTOCOL_NAME, protocol, Arc::new(TendermintGossip::new(number.clone(), self.import.validators.clone())), registry, diff --git a/substrate/tendermint/client/src/lib.rs b/substrate/tendermint/client/src/lib.rs index 63b563e0..7c3e96c4 100644 --- a/substrate/tendermint/client/src/lib.rs +++ b/substrate/tendermint/client/src/lib.rs @@ -35,7 +35,7 @@ pub(crate) const KEY_TYPE_ID: KeyTypeId = KeyTypeId(CONSENSUS_ID); const PROTOCOL_NAME: &str = "/tendermint/1"; -fn protocol_name>(genesis: Hash, fork: Option<&str>) -> ProtocolName { +pub fn protocol_name>(genesis: Hash, fork: Option<&str>) -> ProtocolName { let mut name = format!("/{}", hex::encode(genesis.as_ref())); if let Some(fork) = fork { name += &format!("/{}", fork); @@ -44,9 +44,9 @@ fn protocol_name>(genesis: Hash, fork: Option<&str>) -> Protoc name.into() } -pub fn set_config>(genesis: Hash, fork: Option<&str>) -> NonDefaultSetConfig { +pub fn set_config(protocol: ProtocolName) -> NonDefaultSetConfig { // TODO: 1 MiB Block Size + 1 KiB - let mut cfg = NonDefaultSetConfig::new(protocol_name(genesis, fork), (1024 * 1024) + 1024); + let mut cfg = NonDefaultSetConfig::new(protocol, (1024 * 1024) + 1024); cfg.allow_non_reserved(25, 25); cfg }