mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 15:47:58 +00:00
client/authority-discovery: Remove sentry node logic (#7368)
* client/authority-discovery: Remove sentry node logic The notion of sentry nodes has been deprecated (see [1] for details). This commit removes support for sentry nodes in the `client/authority-discovery` module. While removing `Role::Sentry` this commit also introduces `Role::Discover`, allowing a node to discover addresses of authorities without publishing ones own addresses. This will be needed in Polkadot for collator nodes. [1] https://github.com/paritytech/substrate/issues/6845 * client/authority-discovery/service: Improve PeerId comment
This commit is contained in:
@@ -26,7 +26,7 @@ use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider};
|
||||
use node_primitives::Block;
|
||||
use node_runtime::RuntimeApi;
|
||||
use sc_service::{
|
||||
config::{Role, Configuration}, error::{Error as ServiceError},
|
||||
config::{Configuration}, error::{Error as ServiceError},
|
||||
RpcHandlers, TaskManager,
|
||||
};
|
||||
use sp_inherents::InherentDataProviders;
|
||||
@@ -258,21 +258,10 @@ pub fn new_full_base(
|
||||
}
|
||||
|
||||
// Spawn authority discovery module.
|
||||
if matches!(role, Role::Authority{..} | Role::Sentry {..}) {
|
||||
let (sentries, authority_discovery_role) = match role {
|
||||
sc_service::config::Role::Authority { ref sentry_nodes } => (
|
||||
sentry_nodes.clone(),
|
||||
sc_authority_discovery::Role::Authority (
|
||||
keystore_container.keystore(),
|
||||
),
|
||||
),
|
||||
sc_service::config::Role::Sentry {..} => (
|
||||
vec![],
|
||||
sc_authority_discovery::Role::Sentry,
|
||||
),
|
||||
_ => unreachable!("Due to outer matches! constraint; qed.")
|
||||
};
|
||||
|
||||
if role.is_authority() {
|
||||
let authority_discovery_role = sc_authority_discovery::Role::PublishAndDiscover(
|
||||
keystore_container.keystore(),
|
||||
);
|
||||
let dht_event_stream = network.event_stream("authority-discovery")
|
||||
.filter_map(|e| async move { match e {
|
||||
Event::Dht(e) => Some(e),
|
||||
@@ -281,7 +270,6 @@ pub fn new_full_base(
|
||||
let (authority_discovery_worker, _service) = sc_authority_discovery::new_worker_and_service(
|
||||
client.clone(),
|
||||
network.clone(),
|
||||
sentries,
|
||||
Box::pin(dht_event_stream),
|
||||
authority_discovery_role,
|
||||
prometheus_registry.clone(),
|
||||
|
||||
Reference in New Issue
Block a user