mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-21 06:15:41 +00:00
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:
@@ -286,6 +286,7 @@ fn build_polkadot_full_node(
|
|||||||
grandpa_pause: None,
|
grandpa_pause: None,
|
||||||
// Disable BEEFY. It should not be required by the internal relay chain node.
|
// Disable BEEFY. It should not be required by the internal relay chain node.
|
||||||
enable_beefy: false,
|
enable_beefy: false,
|
||||||
|
force_authoring_backoff: false,
|
||||||
jaeger_agent: None,
|
jaeger_agent: None,
|
||||||
telemetry_worker_handle,
|
telemetry_worker_handle,
|
||||||
|
|
||||||
|
|||||||
@@ -98,6 +98,10 @@ pub struct RunCmd {
|
|||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
pub no_beefy: bool,
|
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.
|
/// Add the destination address to the 'Jaeger' agent.
|
||||||
///
|
///
|
||||||
/// Must be valid socket address, of format `IP:Port` (commonly `127.0.0.1:6831`).
|
/// Must be valid socket address, of format `IP:Port` (commonly `127.0.0.1:6831`).
|
||||||
|
|||||||
@@ -259,6 +259,7 @@ where
|
|||||||
is_parachain_node: service::IsParachainNode::No,
|
is_parachain_node: service::IsParachainNode::No,
|
||||||
grandpa_pause,
|
grandpa_pause,
|
||||||
enable_beefy,
|
enable_beefy,
|
||||||
|
force_authoring_backoff: cli.run.force_authoring_backoff,
|
||||||
jaeger_agent,
|
jaeger_agent,
|
||||||
telemetry_worker_handle: None,
|
telemetry_worker_handle: None,
|
||||||
node_version,
|
node_version,
|
||||||
|
|||||||
@@ -625,6 +625,9 @@ pub struct NewFullParams<OverseerGenerator: OverseerGen> {
|
|||||||
pub is_parachain_node: IsParachainNode,
|
pub is_parachain_node: IsParachainNode,
|
||||||
pub grandpa_pause: Option<(u32, u32)>,
|
pub grandpa_pause: Option<(u32, u32)>,
|
||||||
pub enable_beefy: bool,
|
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 jaeger_agent: Option<std::net::SocketAddr>,
|
||||||
pub telemetry_worker_handle: Option<TelemetryWorkerHandle>,
|
pub telemetry_worker_handle: Option<TelemetryWorkerHandle>,
|
||||||
/// The version of the node. TESTING ONLY: `None` can be passed to skip the node/worker version
|
/// 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,
|
is_parachain_node,
|
||||||
grandpa_pause,
|
grandpa_pause,
|
||||||
enable_beefy,
|
enable_beefy,
|
||||||
|
force_authoring_backoff,
|
||||||
jaeger_agent,
|
jaeger_agent,
|
||||||
telemetry_worker_handle,
|
telemetry_worker_handle,
|
||||||
node_version,
|
node_version,
|
||||||
@@ -733,15 +737,21 @@ pub fn new_full<OverseerGenerator: OverseerGen>(
|
|||||||
let is_offchain_indexing_enabled = config.offchain_worker.indexing_enabled;
|
let is_offchain_indexing_enabled = config.offchain_worker.indexing_enabled;
|
||||||
let role = config.role.clone();
|
let role = config.role.clone();
|
||||||
let force_authoring = config.force_authoring;
|
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();
|
let mut backoff = sc_consensus_slots::BackoffAuthoringOnFinalizedHeadLagging::default();
|
||||||
|
|
||||||
if config.chain_spec.is_rococo() ||
|
if config.chain_spec.is_rococo() ||
|
||||||
config.chain_spec.is_wococo() ||
|
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
|
// on testnets that are in flux (like rococo or versi), finality has stalled
|
||||||
// to operational issues and it's annoying to slow down block
|
// sometimes due to operational issues and it's annoying to slow down block
|
||||||
// production to 1 block per hour.
|
// production to 1 block per hour.
|
||||||
backoff.max_interval = 10;
|
backoff.max_interval = 10;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ pub fn new_full(
|
|||||||
is_parachain_node,
|
is_parachain_node,
|
||||||
grandpa_pause: None,
|
grandpa_pause: None,
|
||||||
enable_beefy: true,
|
enable_beefy: true,
|
||||||
|
force_authoring_backoff: false,
|
||||||
jaeger_agent: None,
|
jaeger_agent: None,
|
||||||
telemetry_worker_handle: None,
|
telemetry_worker_handle: None,
|
||||||
node_version: None,
|
node_version: None,
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ fn main() -> Result<()> {
|
|||||||
),
|
),
|
||||||
grandpa_pause: None,
|
grandpa_pause: None,
|
||||||
enable_beefy: false,
|
enable_beefy: false,
|
||||||
|
force_authoring_backoff: false,
|
||||||
jaeger_agent: None,
|
jaeger_agent: None,
|
||||||
telemetry_worker_handle: None,
|
telemetry_worker_handle: None,
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ fn main() -> Result<()> {
|
|||||||
),
|
),
|
||||||
grandpa_pause: None,
|
grandpa_pause: None,
|
||||||
enable_beefy: false,
|
enable_beefy: false,
|
||||||
|
force_authoring_backoff: false,
|
||||||
jaeger_agent: None,
|
jaeger_agent: None,
|
||||||
telemetry_worker_handle: None,
|
telemetry_worker_handle: None,
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user