mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-24 07:45:49 +00:00
Remove all code related to sentry nodes (#8079)
* Remove all code related to sentry nodes * More fixing
This commit is contained in:
@@ -224,7 +224,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
|||||||
name: Some(name),
|
name: Some(name),
|
||||||
observer_enabled: false,
|
observer_enabled: false,
|
||||||
keystore,
|
keystore,
|
||||||
is_authority: role.is_network_authority(),
|
is_authority: role.is_authority(),
|
||||||
};
|
};
|
||||||
|
|
||||||
if enable_grandpa {
|
if enable_grandpa {
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ pub fn new_full_base(
|
|||||||
name: Some(name),
|
name: Some(name),
|
||||||
observer_enabled: false,
|
observer_enabled: false,
|
||||||
keystore,
|
keystore,
|
||||||
is_authority: role.is_network_authority(),
|
is_authority: role.is_authority(),
|
||||||
};
|
};
|
||||||
|
|
||||||
if enable_grandpa {
|
if enable_grandpa {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ use crate::params::TransactionPoolParams;
|
|||||||
use crate::CliConfiguration;
|
use crate::CliConfiguration;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use sc_service::{
|
use sc_service::{
|
||||||
config::{BasePath, MultiaddrWithPeerId, PrometheusConfig, TransactionPoolOptions},
|
config::{BasePath, PrometheusConfig, TransactionPoolOptions},
|
||||||
ChainSpec, Role,
|
ChainSpec, Role,
|
||||||
};
|
};
|
||||||
use sc_telemetry::TelemetryEndpoints;
|
use sc_telemetry::TelemetryEndpoints;
|
||||||
@@ -43,33 +43,16 @@ pub struct RunCmd {
|
|||||||
/// participate in any consensus task that it can (e.g. depending on
|
/// participate in any consensus task that it can (e.g. depending on
|
||||||
/// availability of local keys).
|
/// availability of local keys).
|
||||||
#[structopt(
|
#[structopt(
|
||||||
long = "validator",
|
long = "validator"
|
||||||
conflicts_with_all = &[ "sentry" ]
|
|
||||||
)]
|
)]
|
||||||
pub validator: bool,
|
pub validator: bool,
|
||||||
|
|
||||||
/// Enable sentry mode.
|
|
||||||
///
|
|
||||||
/// The node will be started with the authority role and participate in
|
|
||||||
/// consensus tasks as an "observer", it will never actively participate
|
|
||||||
/// regardless of whether it could (e.g. keys are available locally). This
|
|
||||||
/// mode is useful as a secure proxy for validators (which would run
|
|
||||||
/// detached from the network), since we want this node to participate in
|
|
||||||
/// the full consensus protocols in order to have all needed consensus data
|
|
||||||
/// available to relay to private nodes.
|
|
||||||
#[structopt(
|
|
||||||
long = "sentry",
|
|
||||||
conflicts_with_all = &[ "validator", "light" ],
|
|
||||||
parse(try_from_str)
|
|
||||||
)]
|
|
||||||
pub sentry: Vec<MultiaddrWithPeerId>,
|
|
||||||
|
|
||||||
/// Disable GRANDPA voter when running in validator mode, otherwise disable the GRANDPA observer.
|
/// Disable GRANDPA voter when running in validator mode, otherwise disable the GRANDPA observer.
|
||||||
#[structopt(long)]
|
#[structopt(long)]
|
||||||
pub no_grandpa: bool,
|
pub no_grandpa: bool,
|
||||||
|
|
||||||
/// Experimental: Run in light client mode.
|
/// Experimental: Run in light client mode.
|
||||||
#[structopt(long = "light", conflicts_with = "sentry")]
|
#[structopt(long = "light")]
|
||||||
pub light: bool,
|
pub light: bool,
|
||||||
|
|
||||||
/// Listen to all RPC interfaces.
|
/// Listen to all RPC interfaces.
|
||||||
@@ -245,17 +228,6 @@ pub struct RunCmd {
|
|||||||
#[structopt(long)]
|
#[structopt(long)]
|
||||||
pub max_runtime_instances: Option<usize>,
|
pub max_runtime_instances: Option<usize>,
|
||||||
|
|
||||||
/// Specify a list of sentry node public addresses.
|
|
||||||
///
|
|
||||||
/// Can't be used with --public-addr as the sentry node would take precedence over the public address
|
|
||||||
/// specified there.
|
|
||||||
#[structopt(
|
|
||||||
long = "sentry-nodes",
|
|
||||||
value_name = "ADDR",
|
|
||||||
conflicts_with_all = &[ "sentry", "public-addr" ]
|
|
||||||
)]
|
|
||||||
pub sentry_nodes: Vec<MultiaddrWithPeerId>,
|
|
||||||
|
|
||||||
/// Run a temporary node.
|
/// Run a temporary node.
|
||||||
///
|
///
|
||||||
/// A temporary directory will be created to store the configuration and will be deleted
|
/// A temporary directory will be created to store the configuration and will be deleted
|
||||||
@@ -366,13 +338,7 @@ impl CliConfiguration for RunCmd {
|
|||||||
Ok(if is_light {
|
Ok(if is_light {
|
||||||
sc_service::Role::Light
|
sc_service::Role::Light
|
||||||
} else if is_authority {
|
} else if is_authority {
|
||||||
sc_service::Role::Authority {
|
sc_service::Role::Authority
|
||||||
sentry_nodes: self.sentry_nodes.clone(),
|
|
||||||
}
|
|
||||||
} else if !self.sentry.is_empty() {
|
|
||||||
sc_service::Role::Sentry {
|
|
||||||
validators: self.sentry.clone(),
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
sc_service::Role::Full
|
sc_service::Role::Full
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -486,7 +486,7 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
|
|||||||
let node_key = self.node_key(&net_config_dir)?;
|
let node_key = self.node_key(&net_config_dir)?;
|
||||||
let role = self.role(is_dev)?;
|
let role = self.role(is_dev)?;
|
||||||
let max_runtime_instances = self.max_runtime_instances()?.unwrap_or(8);
|
let max_runtime_instances = self.max_runtime_instances()?.unwrap_or(8);
|
||||||
let is_validator = role.is_network_authority();
|
let is_validator = role.is_authority();
|
||||||
let (keystore_remote, keystore) = self.keystore_config(&config_dir)?;
|
let (keystore_remote, keystore) = self.keystore_config(&config_dir)?;
|
||||||
let telemetry_endpoints = telemetry_handle
|
let telemetry_endpoints = telemetry_handle
|
||||||
.as_ref()
|
.as_ref()
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ impl PruningParams {
|
|||||||
// unless `unsafe_pruning` is set.
|
// unless `unsafe_pruning` is set.
|
||||||
Ok(match &self.pruning {
|
Ok(match &self.pruning {
|
||||||
Some(ref s) if s == "archive" => PruningMode::ArchiveAll,
|
Some(ref s) if s == "archive" => PruningMode::ArchiveAll,
|
||||||
None if role.is_network_authority() => PruningMode::ArchiveAll,
|
None if role.is_authority() => PruningMode::ArchiveAll,
|
||||||
None => PruningMode::default(),
|
None => PruningMode::default(),
|
||||||
Some(s) => {
|
Some(s) => {
|
||||||
if role.is_network_authority() && !unsafe_pruning {
|
if role.is_authority() && !unsafe_pruning {
|
||||||
return Err(error::Error::Input(
|
return Err(error::Error::Input(
|
||||||
"Validators should run with state pruning disabled (i.e. archive). \
|
"Validators should run with state pruning disabled (i.e. archive). \
|
||||||
You can ignore this check with `--unsafe-pruning`."
|
You can ignore this check with `--unsafe-pruning`."
|
||||||
|
|||||||
@@ -563,12 +563,10 @@ impl<N: Ord> Peers<N> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn authorities(&self) -> usize {
|
fn authorities(&self) -> usize {
|
||||||
// Note that our sentry and our validator are neither authorities nor non-authorities.
|
|
||||||
self.inner.iter().filter(|(_, info)| matches!(info.roles, ObservedRole::Authority)).count()
|
self.inner.iter().filter(|(_, info)| matches!(info.roles, ObservedRole::Authority)).count()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn non_authorities(&self) -> usize {
|
fn non_authorities(&self) -> usize {
|
||||||
// Note that our sentry and our validator are neither authorities nor non-authorities.
|
|
||||||
self.inner
|
self.inner
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|(_, info)| matches!(info.roles, ObservedRole::Full | ObservedRole::Light))
|
.filter(|(_, info)| matches!(info.roles, ObservedRole::Full | ObservedRole::Light))
|
||||||
@@ -665,8 +663,7 @@ impl CatchUpConfig {
|
|||||||
match self {
|
match self {
|
||||||
CatchUpConfig::Disabled => false,
|
CatchUpConfig::Disabled => false,
|
||||||
CatchUpConfig::Enabled { only_from_authorities, .. } => match peer.roles {
|
CatchUpConfig::Enabled { only_from_authorities, .. } => match peer.roles {
|
||||||
ObservedRole::Authority | ObservedRole::OurSentry |
|
ObservedRole::Authority => true,
|
||||||
ObservedRole::OurGuardedAuthority => true,
|
|
||||||
_ => !only_from_authorities
|
_ => !only_from_authorities
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1158,7 +1155,6 @@ impl<Block: BlockT> Inner<Block> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
match peer.roles {
|
match peer.roles {
|
||||||
ObservedRole::OurGuardedAuthority | ObservedRole::OurSentry => true,
|
|
||||||
ObservedRole::Authority => {
|
ObservedRole::Authority => {
|
||||||
let authorities = self.peers.authorities();
|
let authorities = self.peers.authorities();
|
||||||
|
|
||||||
@@ -1214,7 +1210,6 @@ impl<Block: BlockT> Inner<Block> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
match peer.roles {
|
match peer.roles {
|
||||||
ObservedRole::OurSentry | ObservedRole::OurGuardedAuthority => true,
|
|
||||||
ObservedRole::Authority => {
|
ObservedRole::Authority => {
|
||||||
let authorities = self.peers.authorities();
|
let authorities = self.peers.authorities();
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
config::{ProtocolId, Role},
|
config::ProtocolId,
|
||||||
bitswap::Bitswap,
|
bitswap::Bitswap,
|
||||||
discovery::{DiscoveryBehaviour, DiscoveryConfig, DiscoveryOut},
|
discovery::{DiscoveryBehaviour, DiscoveryConfig, DiscoveryOut},
|
||||||
protocol::{message::Roles, CustomMessageOutcome, NotificationsSink, Protocol},
|
protocol::{message::Roles, CustomMessageOutcome, NotificationsSink, Protocol},
|
||||||
@@ -71,10 +71,6 @@ pub struct Behaviour<B: BlockT, H: ExHashT> {
|
|||||||
#[behaviour(ignore)]
|
#[behaviour(ignore)]
|
||||||
events: VecDeque<BehaviourOut<B>>,
|
events: VecDeque<BehaviourOut<B>>,
|
||||||
|
|
||||||
/// Role of our local node, as originally passed from the configuration.
|
|
||||||
#[behaviour(ignore)]
|
|
||||||
role: Role,
|
|
||||||
|
|
||||||
/// Light client request handling.
|
/// Light client request handling.
|
||||||
#[behaviour(ignore)]
|
#[behaviour(ignore)]
|
||||||
light_client_request_sender: light_client_requests::sender::LightClientRequestSender<B>,
|
light_client_request_sender: light_client_requests::sender::LightClientRequestSender<B>,
|
||||||
@@ -180,7 +176,6 @@ impl<B: BlockT, H: ExHashT> Behaviour<B, H> {
|
|||||||
/// Builds a new `Behaviour`.
|
/// Builds a new `Behaviour`.
|
||||||
pub fn new(
|
pub fn new(
|
||||||
substrate: Protocol<B, H>,
|
substrate: Protocol<B, H>,
|
||||||
role: Role,
|
|
||||||
user_agent: String,
|
user_agent: String,
|
||||||
local_public_key: PublicKey,
|
local_public_key: PublicKey,
|
||||||
light_client_request_sender: light_client_requests::sender::LightClientRequestSender<B>,
|
light_client_request_sender: light_client_requests::sender::LightClientRequestSender<B>,
|
||||||
@@ -206,7 +201,6 @@ impl<B: BlockT, H: ExHashT> Behaviour<B, H> {
|
|||||||
request_responses::RequestResponsesBehaviour::new(request_response_protocols.into_iter())?,
|
request_responses::RequestResponsesBehaviour::new(request_response_protocols.into_iter())?,
|
||||||
light_client_request_sender,
|
light_client_request_sender,
|
||||||
events: VecDeque::new(),
|
events: VecDeque::new(),
|
||||||
role,
|
|
||||||
|
|
||||||
block_request_protocol_name,
|
block_request_protocol_name,
|
||||||
})
|
})
|
||||||
@@ -290,15 +284,9 @@ impl<B: BlockT, H: ExHashT> Behaviour<B, H> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn reported_roles_to_observed_role(local_role: &Role, remote: &PeerId, roles: Roles) -> ObservedRole {
|
fn reported_roles_to_observed_role(roles: Roles) -> ObservedRole {
|
||||||
if roles.is_authority() {
|
if roles.is_authority() {
|
||||||
match local_role {
|
ObservedRole::Authority
|
||||||
Role::Authority { sentry_nodes }
|
|
||||||
if sentry_nodes.iter().any(|s| s.peer_id == *remote) => ObservedRole::OurSentry,
|
|
||||||
Role::Sentry { validators }
|
|
||||||
if validators.iter().any(|s| s.peer_id == *remote) => ObservedRole::OurGuardedAuthority,
|
|
||||||
_ => ObservedRole::Authority
|
|
||||||
}
|
|
||||||
} else if roles.is_full() {
|
} else if roles.is_full() {
|
||||||
ObservedRole::Full
|
ObservedRole::Full
|
||||||
} else {
|
} else {
|
||||||
@@ -337,11 +325,10 @@ Behaviour<B, H> {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
CustomMessageOutcome::NotificationStreamOpened { remote, protocol, roles, notifications_sink } => {
|
CustomMessageOutcome::NotificationStreamOpened { remote, protocol, roles, notifications_sink } => {
|
||||||
let role = reported_roles_to_observed_role(&self.role, &remote, roles);
|
|
||||||
self.events.push_back(BehaviourOut::NotificationStreamOpened {
|
self.events.push_back(BehaviourOut::NotificationStreamOpened {
|
||||||
remote,
|
remote,
|
||||||
protocol,
|
protocol,
|
||||||
role: role.clone(),
|
role: reported_roles_to_observed_role(roles),
|
||||||
notifications_sink: notifications_sink.clone(),
|
notifications_sink: notifications_sink.clone(),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ impl <B: BlockT> BlockRequestHandler<B> {
|
|||||||
pub fn new(protocol_id: &ProtocolId, client: Arc<dyn Client<B>>) -> (Self, ProtocolConfig) {
|
pub fn new(protocol_id: &ProtocolId, client: Arc<dyn Client<B>>) -> (Self, ProtocolConfig) {
|
||||||
// Rate of arrival multiplied with the waiting time in the queue equals the queue length.
|
// Rate of arrival multiplied with the waiting time in the queue equals the queue length.
|
||||||
//
|
//
|
||||||
// An average Polkadot sentry node serves less than 5 requests per second. The 95th percentile
|
// An average Polkadot node serves less than 5 requests per second. The 95th percentile
|
||||||
// serving a request is less than 2 second. Thus one would estimate the queue length to be
|
// serving a request is less than 2 second. Thus one would estimate the queue length to be
|
||||||
// below 10.
|
// below 10.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -128,18 +128,8 @@ pub enum Role {
|
|||||||
Full,
|
Full,
|
||||||
/// Regular light node.
|
/// Regular light node.
|
||||||
Light,
|
Light,
|
||||||
/// Sentry node that guards an authority. Will be reported as "authority" on the wire protocol.
|
|
||||||
Sentry {
|
|
||||||
/// Address and identity of the validator nodes that we're guarding.
|
|
||||||
///
|
|
||||||
/// The nodes will be granted some priviledged status.
|
|
||||||
validators: Vec<MultiaddrWithPeerId>,
|
|
||||||
},
|
|
||||||
/// Actual authority.
|
/// Actual authority.
|
||||||
Authority {
|
Authority,
|
||||||
/// List of public addresses and identities of our sentry nodes.
|
|
||||||
sentry_nodes: Vec<MultiaddrWithPeerId>,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Role {
|
impl Role {
|
||||||
@@ -147,12 +137,6 @@ impl Role {
|
|||||||
pub fn is_authority(&self) -> bool {
|
pub fn is_authority(&self) -> bool {
|
||||||
matches!(self, Role::Authority { .. })
|
matches!(self, Role::Authority { .. })
|
||||||
}
|
}
|
||||||
|
|
||||||
/// True for `Role::Authority` and `Role::Sentry` since they're both
|
|
||||||
/// announced as having the authority role to the network.
|
|
||||||
pub fn is_network_authority(&self) -> bool {
|
|
||||||
matches!(self, Role::Authority { .. } | Role::Sentry { .. })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for Role {
|
impl fmt::Display for Role {
|
||||||
@@ -160,7 +144,6 @@ impl fmt::Display for Role {
|
|||||||
match self {
|
match self {
|
||||||
Role::Full => write!(f, "FULL"),
|
Role::Full => write!(f, "FULL"),
|
||||||
Role::Light => write!(f, "LIGHT"),
|
Role::Light => write!(f, "LIGHT"),
|
||||||
Role::Sentry { .. } => write!(f, "SENTRY"),
|
|
||||||
Role::Authority { .. } => write!(f, "AUTHORITY"),
|
Role::Authority { .. } => write!(f, "AUTHORITY"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -384,21 +384,6 @@ impl<B: BlockT, H: ExHashT> Protocol<B, H> {
|
|||||||
let mut sets = Vec::with_capacity(NUM_HARDCODED_PEERSETS + network_config.extra_sets.len());
|
let mut sets = Vec::with_capacity(NUM_HARDCODED_PEERSETS + network_config.extra_sets.len());
|
||||||
|
|
||||||
let mut default_sets_reserved = HashSet::new();
|
let mut default_sets_reserved = HashSet::new();
|
||||||
match config_role {
|
|
||||||
config::Role::Sentry { validators } => {
|
|
||||||
for validator in validators {
|
|
||||||
default_sets_reserved.insert(validator.peer_id.clone());
|
|
||||||
known_addresses.push((validator.peer_id.clone(), validator.multiaddr.clone()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
config::Role::Authority { sentry_nodes } => {
|
|
||||||
for sentry_node in sentry_nodes {
|
|
||||||
default_sets_reserved.insert(sentry_node.peer_id.clone());
|
|
||||||
known_addresses.push((sentry_node.peer_id.clone(), sentry_node.multiaddr.clone()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_ => {}
|
|
||||||
};
|
|
||||||
for reserved in network_config.default_peers_set.reserved_nodes.iter() {
|
for reserved in network_config.default_peers_set.reserved_nodes.iter() {
|
||||||
default_sets_reserved.insert(reserved.peer_id.clone());
|
default_sets_reserved.insert(reserved.peer_id.clone());
|
||||||
known_addresses.push((reserved.peer_id.clone(), reserved.multiaddr.clone()));
|
known_addresses.push((reserved.peer_id.clone(), reserved.multiaddr.clone()));
|
||||||
|
|||||||
@@ -92,16 +92,16 @@ pub enum Event {
|
|||||||
|
|
||||||
/// Role that the peer sent to us during the handshake, with the addition of what our local node
|
/// Role that the peer sent to us during the handshake, with the addition of what our local node
|
||||||
/// knows about that peer.
|
/// knows about that peer.
|
||||||
|
///
|
||||||
|
/// > **Note**: This enum is different from the `Role` enum. The `Role` enum indicates what a
|
||||||
|
/// > node says about itself, while `ObservedRole` is a `Role` merged with the
|
||||||
|
/// > information known locally about that node.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum ObservedRole {
|
pub enum ObservedRole {
|
||||||
/// Full node.
|
/// Full node.
|
||||||
Full,
|
Full,
|
||||||
/// Light node.
|
/// Light node.
|
||||||
Light,
|
Light,
|
||||||
/// When we are a validator node, this is a sentry that protects us.
|
|
||||||
OurSentry,
|
|
||||||
/// When we are a sentry node, this is the authority we are protecting.
|
|
||||||
OurGuardedAuthority,
|
|
||||||
/// Third-party authority.
|
/// Third-party authority.
|
||||||
Authority,
|
Authority,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -191,7 +191,6 @@ pub mod generic {
|
|||||||
match roles {
|
match roles {
|
||||||
crate::config::Role::Full => Roles::FULL,
|
crate::config::Role::Full => Roles::FULL,
|
||||||
crate::config::Role::Light => Roles::LIGHT,
|
crate::config::Role::Light => Roles::LIGHT,
|
||||||
crate::config::Role::Sentry { .. } => Roles::AUTHORITY,
|
|
||||||
crate::config::Role::Authority { .. } => Roles::AUTHORITY,
|
crate::config::Role::Authority { .. } => Roles::AUTHORITY,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
ExHashT, NetworkStateInfo, NetworkStatus,
|
ExHashT, NetworkStateInfo, NetworkStatus,
|
||||||
behaviour::{self, Behaviour, BehaviourOut},
|
behaviour::{self, Behaviour, BehaviourOut},
|
||||||
config::{parse_str_addr, Params, Role, TransportConfig},
|
config::{parse_str_addr, Params, TransportConfig},
|
||||||
DhtEvent,
|
DhtEvent,
|
||||||
discovery::DiscoveryConfig,
|
discovery::DiscoveryConfig,
|
||||||
error::Error,
|
error::Error,
|
||||||
@@ -225,22 +225,6 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkWorker<B, H> {
|
|||||||
}
|
}
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
// Print a message about the deprecation of sentry nodes.
|
|
||||||
let print_deprecated_message = match ¶ms.role {
|
|
||||||
Role::Sentry { .. } => true,
|
|
||||||
Role::Authority { sentry_nodes } if !sentry_nodes.is_empty() => true,
|
|
||||||
_ => false,
|
|
||||||
};
|
|
||||||
if print_deprecated_message {
|
|
||||||
log::warn!(
|
|
||||||
"🙇 Sentry nodes are deprecated, and the `--sentry` and `--sentry-nodes` \
|
|
||||||
CLI options will eventually be removed in a future version. The Substrate \
|
|
||||||
and Polkadot networking protocol require validators to be \
|
|
||||||
publicly-accessible. Please do not block access to your validator nodes. \
|
|
||||||
For details, see https://github.com/paritytech/substrate/issues/6845."
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
let checker = params.on_demand.as_ref()
|
let checker = params.on_demand.as_ref()
|
||||||
.map(|od| od.checker().clone())
|
.map(|od| od.checker().clone())
|
||||||
.unwrap_or_else(|| Arc::new(AlwaysBadChecker));
|
.unwrap_or_else(|| Arc::new(AlwaysBadChecker));
|
||||||
@@ -339,7 +323,6 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkWorker<B, H> {
|
|||||||
let bitswap = if params.network_config.ipfs_server { Some(Bitswap::new(client)) } else { None };
|
let bitswap = if params.network_config.ipfs_server { Some(Bitswap::new(client)) } else { None };
|
||||||
let result = Behaviour::new(
|
let result = Behaviour::new(
|
||||||
protocol,
|
protocol,
|
||||||
params.role,
|
|
||||||
user_agent,
|
user_agent,
|
||||||
local_public,
|
local_public,
|
||||||
light_client_request_sender,
|
light_client_request_sender,
|
||||||
|
|||||||
@@ -82,8 +82,6 @@ pub enum NodeRole {
|
|||||||
LightClient,
|
LightClient,
|
||||||
/// The node is an authority
|
/// The node is an authority
|
||||||
Authority,
|
Authority,
|
||||||
/// The node is a sentry
|
|
||||||
Sentry,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The state of the syncing of the node.
|
/// The state of the syncing of the node.
|
||||||
|
|||||||
@@ -309,7 +309,6 @@ async fn build_network_future<
|
|||||||
Role::Authority { .. } => NodeRole::Authority,
|
Role::Authority { .. } => NodeRole::Authority,
|
||||||
Role::Light => NodeRole::LightClient,
|
Role::Light => NodeRole::LightClient,
|
||||||
Role::Full => NodeRole::Full,
|
Role::Full => NodeRole::Full,
|
||||||
Role::Sentry { .. } => NodeRole::Sentry,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let _ = sender.send(vec![node_role]);
|
let _ = sender.send(vec![node_role]);
|
||||||
|
|||||||
@@ -135,7 +135,6 @@ impl MetricsService {
|
|||||||
let role_bits = match config.role {
|
let role_bits = match config.role {
|
||||||
Role::Full => 1u64,
|
Role::Full => 1u64,
|
||||||
Role::Light => 2u64,
|
Role::Light => 2u64,
|
||||||
Role::Sentry { .. } => 3u64,
|
|
||||||
Role::Authority { .. } => 4u64,
|
Role::Authority { .. } => 4u64,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ impl<G, E, F, L, U> TestNet<G, E, F, L, U> where
|
|||||||
let node_config = node_config(
|
let node_config = node_config(
|
||||||
self.nodes,
|
self.nodes,
|
||||||
&self.chain_spec,
|
&self.chain_spec,
|
||||||
Role::Authority { sentry_nodes: Vec::new() },
|
Role::Authority,
|
||||||
task_executor.clone(),
|
task_executor.clone(),
|
||||||
Some(key),
|
Some(key),
|
||||||
self.base_port,
|
self.base_port,
|
||||||
|
|||||||
Reference in New Issue
Block a user