mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 03:31:05 +00:00
node/service/src/lib: Do not spawn authority discovery on sentries (#1835)
* node/service/src/lib: Do not spawn authority discovery on sentries The notion of sentry nodes has been deprecated (see [1] for details). Support for sentry nodes in the `client/authority-discovery` module has been removed. This commit adjusts the instantiation of the authority discovery worker accordingly, only spawning the module on authority nodes. [1] https://github.com/paritytech/substrate/issues/6845 * "Update Substrate" Co-authored-by: parity-processbot <>
This commit is contained in:
Generated
+137
-136
File diff suppressed because it is too large
Load Diff
@@ -531,34 +531,21 @@ pub fn new_full<RuntimeApi, Executor>(
|
||||
grandpa::setup_disabled_grandpa(network.clone())?;
|
||||
}
|
||||
|
||||
if matches!(role, Role::Authority{..} | Role::Sentry{..}) {
|
||||
if role.is_authority() && !authority_discovery_disabled {
|
||||
use sc_network::Event;
|
||||
use futures::StreamExt;
|
||||
|
||||
if !authority_discovery_disabled {
|
||||
let (sentries, authority_discovery_role) = match role {
|
||||
Role::Authority { ref sentry_nodes } => (
|
||||
sentry_nodes.clone(),
|
||||
authority_discovery::Role::Authority (
|
||||
let authority_discovery_role = authority_discovery::Role::PublishAndDiscover(
|
||||
keystore_container.keystore(),
|
||||
),
|
||||
),
|
||||
Role::Sentry {..} => (
|
||||
vec![],
|
||||
authority_discovery::Role::Sentry,
|
||||
),
|
||||
_ => unreachable!("Due to outer matches! constraint; qed."),
|
||||
};
|
||||
|
||||
let network_event_stream = network.event_stream("authority-discovery");
|
||||
let dht_event_stream = network_event_stream.filter_map(|e| async move { match e {
|
||||
);
|
||||
let dht_event_stream = network.event_stream("authority-discovery")
|
||||
.filter_map(|e| async move { match e {
|
||||
Event::Dht(e) => Some(e),
|
||||
_ => None,
|
||||
}});
|
||||
let (authority_discovery_worker, _service) = authority_discovery::new_worker_and_service(
|
||||
client.clone(),
|
||||
network.clone(),
|
||||
sentries,
|
||||
Box::pin(dht_event_stream),
|
||||
authority_discovery_role,
|
||||
prometheus_registry.clone(),
|
||||
@@ -566,7 +553,6 @@ pub fn new_full<RuntimeApi, Executor>(
|
||||
|
||||
task_manager.spawn_handle().spawn("authority-discovery-worker", authority_discovery_worker.run());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
network_starter.start_network();
|
||||
|
||||
Reference in New Issue
Block a user