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

remove the --disable-authority-discovery flag & related #1870

Merged
merged 1 commit into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,6 @@ pub struct RunCmd {
#[structopt(long = "force-rococo")]
pub force_rococo: bool,

/// Disable the authority discovery module on validator or sentry nodes.
///
/// Enabled by default on validator and sentry nodes. Always disabled on non
/// validator or sentry nodes.
///
/// When enabled:
///
/// (1) As a validator node: Make oneself discoverable by publishing either
/// ones own network addresses, or the ones of ones sentry nodes
/// (configured via the `sentry-nodes` flag).
///
/// (2) As a validator or sentry node: Discover addresses of validators or
/// addresses of their sentry nodes and maintain a permanent connection
/// to a subset.
#[structopt(long = "disable-authority-discovery")]
pub authority_discovery_disabled: bool,

/// Setup a GRANDPA scheduled voting pause.
///
/// This parameter takes two values, namely a block number and a delay (in
Expand Down
2 changes: 0 additions & 2 deletions cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ pub fn run() -> Result<()> {

set_default_ss58_version(chain_spec);

let authority_discovery_disabled = cli.run.authority_discovery_disabled;
let grandpa_pause = if cli.run.grandpa_pause.is_empty() {
None
} else {
Expand All @@ -147,7 +146,6 @@ pub fn run() -> Result<()> {
Role::Light => service::build_light(config).map(|(task_manager, _)| task_manager),
_ => service::build_full(
config,
authority_discovery_disabled,
service::IsCollator::No,
grandpa_pause,
).map(|full| full.task_manager),
Expand Down
10 changes: 0 additions & 10 deletions node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ impl IsCollator {
#[cfg(feature = "full-node")]
pub fn new_full<RuntimeApi, Executor>(
mut config: Configuration,
authority_discovery_disabled: bool,
is_collator: IsCollator,
grandpa_pause: Option<(u32, u32)>,
) -> Result<NewFull<Arc<FullClient<RuntimeApi, Executor>>>, Error>
Expand Down Expand Up @@ -535,10 +534,6 @@ pub fn new_full<RuntimeApi, Executor>(
use sc_network::Event;
use futures::StreamExt;

if authority_discovery_disabled {
Err("Authority discovery is mandatory for a validator.")?;
}

let authority_discovery_role = if role.is_authority() {
authority_discovery::Role::PublishAndDiscover(
keystore_container.keystore(),
Expand Down Expand Up @@ -867,35 +862,30 @@ pub fn build_light(config: Configuration) -> Result<(TaskManager, RpcHandlers),
#[cfg(feature = "full-node")]
pub fn build_full(
config: Configuration,
authority_discovery_disabled: bool,
is_collator: IsCollator,
grandpa_pause: Option<(u32, u32)>,
) -> Result<NewFull<Client>, Error> {
if config.chain_spec.is_rococo() {
new_full::<rococo_runtime::RuntimeApi, RococoExecutor>(
config,
authority_discovery_disabled,
is_collator,
grandpa_pause,
).map(|full| full.with_client(Client::Rococo))
} else if config.chain_spec.is_kusama() {
new_full::<kusama_runtime::RuntimeApi, KusamaExecutor>(
config,
authority_discovery_disabled,
is_collator,
grandpa_pause,
).map(|full| full.with_client(Client::Kusama))
} else if config.chain_spec.is_westend() {
new_full::<westend_runtime::RuntimeApi, WestendExecutor>(
config,
authority_discovery_disabled,
is_collator,
grandpa_pause,
).map(|full| full.with_client(Client::Westend))
} else {
new_full::<polkadot_runtime::RuntimeApi, PolkadotExecutor>(
config,
authority_discovery_disabled,
is_collator,
grandpa_pause,
).map(|full| full.with_client(Client::Polkadot))
Expand Down
5 changes: 1 addition & 4 deletions node/test/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,12 @@ pub use polkadot_service::FullBackend;
#[sc_cli::prefix_logs_with(config.network.node_name.as_str())]
pub fn polkadot_test_new_full(
config: Configuration,
authority_discovery_disabled: bool,
) -> Result<
NewFull<Arc<Client>>,
ServiceError,
> {
new_full::<polkadot_test_runtime::RuntimeApi, PolkadotTestExecutor>(
config,
authority_discovery_disabled,
IsCollator::No,
None,
).map_err(Into::into)
Expand Down Expand Up @@ -205,9 +203,8 @@ pub fn run_test_node(
) -> PolkadotTestNode {
let config = node_config(storage_update_func, task_executor, key, boot_nodes);
let multiaddr = config.network.listen_addresses[0].clone();
let authority_discovery_disabled = false;
let NewFull {task_manager, client, network, rpc_handlers, overseer_handler, ..} =
polkadot_test_new_full(config, authority_discovery_disabled)
polkadot_test_new_full(config)
.expect("could not create Polkadot test service");

let overseer_handler = overseer_handler.expect("test node must have an overseer handler");
Expand Down