polkadot: disable block authoring backoff on production networks (#2510)

Currently the polkadot node will backoff from block authoring if
finality starts lagging. This PR disables this mechanism on production
networks (polkadot and kusama) and adds a flags to optionally force
enabling it.
This commit is contained in:
André Silva
2023-11-28 09:18:26 +00:00
committed by GitHub
parent 0f7ffc66a5
commit 58a1f9c53d
7 changed files with 23 additions and 4 deletions
@@ -286,6 +286,7 @@ fn build_polkadot_full_node(
grandpa_pause: None,
// Disable BEEFY. It should not be required by the internal relay chain node.
enable_beefy: false,
force_authoring_backoff: false,
jaeger_agent: None,
telemetry_worker_handle,
+4
View File
@@ -98,6 +98,10 @@ pub struct RunCmd {
#[arg(long)]
pub no_beefy: bool,
/// Enable the block authoring backoff that is triggered when finality is lagging.
#[arg(long)]
pub force_authoring_backoff: bool,
/// Add the destination address to the 'Jaeger' agent.
///
/// Must be valid socket address, of format `IP:Port` (commonly `127.0.0.1:6831`).
+1
View File
@@ -259,6 +259,7 @@ where
is_parachain_node: service::IsParachainNode::No,
grandpa_pause,
enable_beefy,
force_authoring_backoff: cli.run.force_authoring_backoff,
jaeger_agent,
telemetry_worker_handle: None,
node_version,
+14 -4
View File
@@ -625,6 +625,9 @@ pub struct NewFullParams<OverseerGenerator: OverseerGen> {
pub is_parachain_node: IsParachainNode,
pub grandpa_pause: Option<(u32, u32)>,
pub enable_beefy: bool,
/// Whether to enable the block authoring backoff on production networks
/// where it isn't enabled by default.
pub force_authoring_backoff: bool,
pub jaeger_agent: Option<std::net::SocketAddr>,
pub telemetry_worker_handle: Option<TelemetryWorkerHandle>,
/// The version of the node. TESTING ONLY: `None` can be passed to skip the node/worker version
@@ -716,6 +719,7 @@ pub fn new_full<OverseerGenerator: OverseerGen>(
is_parachain_node,
grandpa_pause,
enable_beefy,
force_authoring_backoff,
jaeger_agent,
telemetry_worker_handle,
node_version,
@@ -733,15 +737,21 @@ pub fn new_full<OverseerGenerator: OverseerGen>(
let is_offchain_indexing_enabled = config.offchain_worker.indexing_enabled;
let role = config.role.clone();
let force_authoring = config.force_authoring;
let backoff_authoring_blocks = {
let backoff_authoring_blocks = if !force_authoring_backoff &&
(config.chain_spec.is_polkadot() || config.chain_spec.is_kusama())
{
// the block authoring backoff is disabled by default on production networks
None
} else {
let mut backoff = sc_consensus_slots::BackoffAuthoringOnFinalizedHeadLagging::default();
if config.chain_spec.is_rococo() ||
config.chain_spec.is_wococo() ||
config.chain_spec.is_versi()
config.chain_spec.is_versi() ||
config.chain_spec.is_dev()
{
// it's a testnet that's in flux, finality has stalled sometimes due
// to operational issues and it's annoying to slow down block
// on testnets that are in flux (like rococo or versi), finality has stalled
// sometimes due to operational issues and it's annoying to slow down block
// production to 1 block per hour.
backoff.max_interval = 10;
}
+1
View File
@@ -82,6 +82,7 @@ pub fn new_full(
is_parachain_node,
grandpa_pause: None,
enable_beefy: true,
force_authoring_backoff: false,
jaeger_agent: None,
telemetry_worker_handle: None,
node_version: None,
@@ -64,6 +64,7 @@ fn main() -> Result<()> {
),
grandpa_pause: None,
enable_beefy: false,
force_authoring_backoff: false,
jaeger_agent: None,
telemetry_worker_handle: None,
@@ -84,6 +84,7 @@ fn main() -> Result<()> {
),
grandpa_pause: None,
enable_beefy: false,
force_authoring_backoff: false,
jaeger_agent: None,
telemetry_worker_handle: None,