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

Commit

Permalink
*: Update authority discovery and remove WorkerConfig
Browse files Browse the repository at this point in the history
With paritytech/substrate#7545 the authority
discovery module queries and publishes addresses on an exponentially
increasing interval. Doing so should make custom configurations
obsolete, as operations are retried in a timely fashion in the first
minutes.
  • Loading branch information
mxinden committed Nov 16, 2020
1 parent 120d5dd commit 9de081a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 20 deletions.
1 change: 0 additions & 1 deletion cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ pub fn run() -> Result<()> {
config,
service::IsCollator::No,
grandpa_pause,
None,
).map(|full| full.task_manager),
}
})
Expand Down
11 changes: 2 additions & 9 deletions node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use {
polkadot_node_core_proposer::ProposerFactory,
polkadot_overseer::{AllSubsystems, BlockInfo, Overseer, OverseerHandler},
polkadot_primitives::v1::ParachainHost,
sc_authority_discovery::{Service as AuthorityDiscoveryService, WorkerConfig as AuthorityWorkerConfig},
sc_authority_discovery::Service as AuthorityDiscoveryService,
sp_blockchain::HeaderBackend,
sp_core::traits::SpawnNamed,
sp_keystore::SyncCryptoStorePtr,
Expand Down Expand Up @@ -478,7 +478,6 @@ pub fn new_full<RuntimeApi, Executor>(
mut config: Configuration,
is_collator: IsCollator,
grandpa_pause: Option<(u32, u32)>,
authority_discovery_config: Option<AuthorityWorkerConfig>,
isolation_strategy: IsolationStrategy,
) -> Result<NewFull<Arc<FullClient<RuntimeApi, Executor>>>, Error>
where
Expand Down Expand Up @@ -589,8 +588,7 @@ pub fn new_full<RuntimeApi, Executor>(
Event::Dht(e) => Some(e),
_ => None,
}});
let (worker, service) = sc_authority_discovery::new_worker_and_service_with_config(
authority_discovery_config.unwrap_or_default(),
let (worker, service) = sc_authority_discovery::new_worker_and_service(
client.clone(),
network.clone(),
Box::pin(dht_event_stream),
Expand Down Expand Up @@ -910,38 +908,33 @@ pub fn build_full(
config: Configuration,
is_collator: IsCollator,
grandpa_pause: Option<(u32, u32)>,
authority_discovery_config: Option<AuthorityWorkerConfig>,
) -> Result<NewFull<Client>, Error> {
if config.chain_spec.is_rococo() {
new_full::<rococo_runtime::RuntimeApi, RococoExecutor>(
config,
is_collator,
grandpa_pause,
authority_discovery_config,
Default::default(),
).map(|full| full.with_client(Client::Rococo))
} else if config.chain_spec.is_kusama() {
new_full::<kusama_runtime::RuntimeApi, KusamaExecutor>(
config,
is_collator,
grandpa_pause,
authority_discovery_config,
Default::default(),
).map(|full| full.with_client(Client::Kusama))
} else if config.chain_spec.is_westend() {
new_full::<westend_runtime::RuntimeApi, WestendExecutor>(
config,
is_collator,
grandpa_pause,
authority_discovery_config,
Default::default(),
).map(|full| full.with_client(Client::Westend))
} else {
new_full::<polkadot_runtime::RuntimeApi, PolkadotExecutor>(
config,
is_collator,
grandpa_pause,
authority_discovery_config,
Default::default(),
).map(|full| full.with_client(Client::Polkadot))
}
Expand Down
5 changes: 0 additions & 5 deletions node/test/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ pub fn new_full(
config,
is_collator,
None,
Some(sc_authority_discovery::WorkerConfig {
query_interval: Duration::from_secs(1),
query_start_delay: Duration::from_secs(0),
..Default::default()
}),
polkadot_parachain::wasm_executor::IsolationStrategy::InProcess,
).map_err(Into::into)
}
Expand Down
5 changes: 0 additions & 5 deletions parachain/test-parachains/adder/collator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ fn main() -> Result<()> {
config,
polkadot_service::IsCollator::Yes(collator.collator_id()),
None,
Some(sc_authority_discovery::WorkerConfig {
query_interval: Duration::from_secs(1),
query_start_delay: Duration::from_secs(0),
..Default::default()
}),
)?;
let mut overseer_handler = full_node.overseer_handler
.expect("Overseer handler should be initialized for collators");
Expand Down

0 comments on commit 9de081a

Please sign in to comment.