Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
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
11 changes: 8 additions & 3 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ pub struct RunCmd {
#[structopt(long = "force-westend")]
pub force_westend: bool,

/// Enable the authority discovery module.
/// 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
Expand All @@ -68,8 +73,8 @@ pub struct RunCmd {
/// (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 = "enable-authority-discovery")]
pub authority_discovery_enabled: bool,
#[structopt(long = "disable-authority-discovery")]
pub authority_discovery_disabled: bool,

/// Setup a GRANDPA scheduled voting pause.
///
Expand Down
8 changes: 4 additions & 4 deletions cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub fn run() -> Result<()> {

set_default_ss58_version(chain_spec);

let authority_discovery_enabled = cli.run.authority_discovery_enabled;
let authority_discovery_disabled = cli.run.authority_discovery_disabled;
let grandpa_pause = if cli.run.grandpa_pause.is_empty() {
None
} else {
Expand All @@ -132,7 +132,7 @@ pub fn run() -> Result<()> {
config,
None,
None,
authority_discovery_enabled,
authority_discovery_disabled,
6000,
grandpa_pause,
).map(|(components, _, _)| components)
Expand All @@ -145,7 +145,7 @@ pub fn run() -> Result<()> {
config,
None,
None,
authority_discovery_enabled,
authority_discovery_disabled,
6000,
grandpa_pause,
).map(|(components, _, _)| components)
Expand All @@ -158,7 +158,7 @@ pub fn run() -> Result<()> {
config,
None,
None,
authority_discovery_enabled,
authority_discovery_disabled,
6000,
grandpa_pause,
).map(|(components, _, _)| components)
Expand Down
16 changes: 8 additions & 8 deletions node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ fn real_overseer<S: futures::task::Spawn>(
network_bridge: DummySubsystem,
};
Overseer::new(
leaves,
leaves,
all_subsystems,
s,
).map_err(|e| ServiceError::Other(format!("Failed to create an Overseer: {:?}", e)))
Expand All @@ -299,7 +299,7 @@ macro_rules! new_full {
(
$config:expr,
$collating_for:expr,
$authority_discovery_enabled:expr,
$authority_discovery_disabled:expr,
$grandpa_pause:expr,
$runtime:ty,
$dispatch:ty,
Expand Down Expand Up @@ -600,7 +600,7 @@ pub fn polkadot_new_full(
mut config: Configuration,
collating_for: Option<(CollatorId, ParaId)>,
_max_block_data_size: Option<u64>,
_authority_discovery_enabled: bool,
_authority_discovery_disabled: bool,
_slot_duration: u64,
grandpa_pause: Option<(u32, u32)>,
)
Expand All @@ -617,7 +617,7 @@ pub fn polkadot_new_full(
let (components, client) = new_full!(
config,
collating_for,
authority_discovery_enabled,
authority_discovery_disabled,
grandpa_pause,
polkadot_runtime::RuntimeApi,
PolkadotExecutor,
Expand All @@ -632,7 +632,7 @@ pub fn kusama_new_full(
mut config: Configuration,
collating_for: Option<(CollatorId, ParaId)>,
_max_block_data_size: Option<u64>,
_authority_discovery_enabled: bool,
_authority_discovery_disabled: bool,
_slot_duration: u64,
grandpa_pause: Option<(u32, u32)>,
) -> Result<(
Expand All @@ -649,7 +649,7 @@ pub fn kusama_new_full(
let (components, client) = new_full!(
config,
collating_for,
authority_discovery_enabled,
authority_discovery_disabled,
grandpa_pause,
kusama_runtime::RuntimeApi,
KusamaExecutor,
Expand All @@ -664,7 +664,7 @@ pub fn westend_new_full(
mut config: Configuration,
collating_for: Option<(CollatorId, ParaId)>,
_max_block_data_size: Option<u64>,
_authority_discovery_enabled: bool,
_authority_discovery_disabled: bool,
_slot_duration: u64,
grandpa_pause: Option<(u32, u32)>,
)
Expand All @@ -681,7 +681,7 @@ pub fn westend_new_full(
let (components, client) = new_full!(
config,
collating_for,
authority_discovery_enabled,
authority_discovery_disabled,
grandpa_pause,
westend_runtime::RuntimeApi,
WestendExecutor,
Expand Down
8 changes: 4 additions & 4 deletions node/test-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub fn polkadot_test_new_full(
config: Configuration,
collating_for: Option<(CollatorId, ParaId)>,
max_block_data_size: Option<u64>,
authority_discovery_enabled: bool,
authority_discovery_disabled: bool,
slot_duration: u64,
) -> Result<
(
Expand All @@ -85,7 +85,7 @@ pub fn polkadot_test_new_full(
config,
collating_for,
max_block_data_size,
authority_discovery_enabled,
authority_discovery_disabled,
slot_duration,
polkadot_test_runtime::RuntimeApi,
PolkadotTestExecutor,
Expand Down Expand Up @@ -204,9 +204,9 @@ pub fn run_test_node(
> {
let config = node_config(storage_update_func, task_executor, key, boot_nodes);
let multiaddr = config.network.listen_addresses[0].clone();
let authority_discovery_enabled = false;
let authority_discovery_disabled = true;
let (task_manager, client, handles, network, rpc_handlers) =
polkadot_test_new_full(config, None, None, authority_discovery_enabled, 6000)
polkadot_test_new_full(config, None, None, authority_discovery_disabled, 6000)
.expect("could not create Polkadot test service");

let peer_id = network.local_peer_id().clone();
Expand Down
26 changes: 13 additions & 13 deletions service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ macro_rules! new_full {
$config:expr,
$collating_for:expr,
$max_block_data_size:expr,
$authority_discovery_enabled:expr,
$authority_discovery_disabled:expr,
$slot_duration:expr,
$grandpa_pause:expr,
$new_full_start:expr $(,)?
Expand All @@ -318,7 +318,7 @@ macro_rules! new_full {
let max_block_data_size = $max_block_data_size;
let disable_grandpa = $config.disable_grandpa;
let name = $config.network.node_name.clone();
let authority_discovery_enabled = $authority_discovery_enabled;
let authority_discovery_disabled = $authority_discovery_disabled;
let slot_duration = $slot_duration;

let (builder, mut import_setup, inherent_data_providers, mut rpc_setup) = $new_full_start;
Expand Down Expand Up @@ -459,7 +459,7 @@ macro_rules! new_full {
}

if matches!(role, Role::Authority{..} | Role::Sentry{..}) {
if authority_discovery_enabled {
if !authority_discovery_disabled {
let (sentries, authority_discovery_role) = match role {
Role::Authority { ref sentry_nodes } => (
sentry_nodes.clone(),
Expand Down Expand Up @@ -568,7 +568,7 @@ macro_rules! new_full {
$config:expr,
$collating_for:expr,
$max_block_data_size:expr,
$authority_discovery_enabled:expr,
$authority_discovery_disabled:expr,
$slot_duration:expr,
$grandpa_pause:expr,
$runtime:ty,
Expand All @@ -578,7 +578,7 @@ macro_rules! new_full {
$config,
$collating_for,
$max_block_data_size,
$authority_discovery_enabled,
$authority_discovery_disabled,
$slot_duration,
$grandpa_pause,
new_full_start!($config, $runtime, $dispatch),
Expand All @@ -589,7 +589,7 @@ macro_rules! new_full {
$config:expr,
$collating_for:expr,
$max_block_data_size:expr,
$authority_discovery_enabled:expr,
$authority_discovery_disabled:expr,
$slot_duration:expr,
$runtime:ty,
$dispatch:ty,
Expand All @@ -598,7 +598,7 @@ macro_rules! new_full {
$config,
$collating_for,
$max_block_data_size,
$authority_discovery_enabled,
$authority_discovery_disabled,
$slot_duration,
None,
new_full_start!(test $config, $runtime, $dispatch),
Expand Down Expand Up @@ -734,7 +734,7 @@ pub fn polkadot_new_full(
mut config: Configuration,
collating_for: Option<(CollatorId, parachain::Id)>,
max_block_data_size: Option<u64>,
authority_discovery_enabled: bool,
authority_discovery_disabled: bool,
slot_duration: u64,
grandpa_pause: Option<(u32, u32)>,
)
Expand All @@ -752,7 +752,7 @@ pub fn polkadot_new_full(
config,
collating_for,
max_block_data_size,
authority_discovery_enabled,
authority_discovery_disabled,
slot_duration,
grandpa_pause,
polkadot_runtime::RuntimeApi,
Expand All @@ -768,7 +768,7 @@ pub fn kusama_new_full(
mut config: Configuration,
collating_for: Option<(CollatorId, parachain::Id)>,
max_block_data_size: Option<u64>,
authority_discovery_enabled: bool,
authority_discovery_disabled: bool,
slot_duration: u64,
grandpa_pause: Option<(u32, u32)>,
) -> Result<(
Expand All @@ -786,7 +786,7 @@ pub fn kusama_new_full(
config,
collating_for,
max_block_data_size,
authority_discovery_enabled,
authority_discovery_disabled,
slot_duration,
grandpa_pause,
kusama_runtime::RuntimeApi,
Expand All @@ -802,7 +802,7 @@ pub fn westend_new_full(
mut config: Configuration,
collating_for: Option<(CollatorId, parachain::Id)>,
max_block_data_size: Option<u64>,
authority_discovery_enabled: bool,
authority_discovery_disabled: bool,
slot_duration: u64,
grandpa_pause: Option<(u32, u32)>,
)
Expand All @@ -820,7 +820,7 @@ pub fn westend_new_full(
config,
collating_for,
max_block_data_size,
authority_discovery_enabled,
authority_discovery_disabled,
slot_duration,
grandpa_pause,
westend_runtime::RuntimeApi,
Expand Down