Remove all code related to sentry nodes (#8079)

* Remove all code related to sentry nodes

* More fixing
This commit is contained in:
Pierre Krieger
2021-02-15 09:45:03 +01:00
committed by GitHub
parent 019f04e99f
commit f6273f7914
17 changed files with 22 additions and 128 deletions
+4 -38
View File
@@ -27,7 +27,7 @@ use crate::params::TransactionPoolParams;
use crate::CliConfiguration;
use regex::Regex;
use sc_service::{
config::{BasePath, MultiaddrWithPeerId, PrometheusConfig, TransactionPoolOptions},
config::{BasePath, PrometheusConfig, TransactionPoolOptions},
ChainSpec, Role,
};
use sc_telemetry::TelemetryEndpoints;
@@ -43,33 +43,16 @@ pub struct RunCmd {
/// participate in any consensus task that it can (e.g. depending on
/// availability of local keys).
#[structopt(
long = "validator",
conflicts_with_all = &[ "sentry" ]
long = "validator"
)]
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.
#[structopt(long)]
pub no_grandpa: bool,
/// Experimental: Run in light client mode.
#[structopt(long = "light", conflicts_with = "sentry")]
#[structopt(long = "light")]
pub light: bool,
/// Listen to all RPC interfaces.
@@ -245,17 +228,6 @@ pub struct RunCmd {
#[structopt(long)]
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.
///
/// 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 {
sc_service::Role::Light
} else if is_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(),
}
sc_service::Role::Authority
} else {
sc_service::Role::Full
})
+1 -1
View File
@@ -486,7 +486,7 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
let node_key = self.node_key(&net_config_dir)?;
let role = self.role(is_dev)?;
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 telemetry_endpoints = telemetry_handle
.as_ref()
@@ -46,10 +46,10 @@ impl PruningParams {
// unless `unsafe_pruning` is set.
Ok(match &self.pruning {
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(),
Some(s) => {
if role.is_network_authority() && !unsafe_pruning {
if role.is_authority() && !unsafe_pruning {
return Err(error::Error::Input(
"Validators should run with state pruning disabled (i.e. archive). \
You can ignore this check with `--unsafe-pruning`."