From abcaa3f8c1cc667faca20d6883a4819f9bee65b1 Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Mon, 6 Feb 2023 15:39:26 +0300 Subject: [PATCH] Decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2_048 (#1852) * decrease number of GRANDPA authorities in Polkadot-like chains from 100_000 to 2048 * spelling --- bridges/primitives/chain-rococo/src/lib.rs | 5 ----- bridges/primitives/chain-westend/src/lib.rs | 5 ----- bridges/primitives/polkadot-core/src/lib.rs | 10 ++++++++++ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bridges/primitives/chain-rococo/src/lib.rs b/bridges/primitives/chain-rococo/src/lib.rs index 57a47211e4ea3..41fc65e0e93d1 100644 --- a/bridges/primitives/chain-rococo/src/lib.rs +++ b/bridges/primitives/chain-rococo/src/lib.rs @@ -42,9 +42,4 @@ pub const WITH_ROCOCO_GRANDPA_PALLET_NAME: &str = "BridgeRococoGrandpa"; /// reserve. pub const MAX_NESTED_PARACHAIN_HEAD_DATA_SIZE: u32 = 128; -/// Maximal number of GRANDPA authorities at Rococo. -/// -/// Corresponds to the `MaxAuthorities` constant value from the Rococo runtime configuration. -pub const MAX_AUTHORITIES_COUNT: u32 = 100_000; - decl_bridge_finality_runtime_apis!(rococo); diff --git a/bridges/primitives/chain-westend/src/lib.rs b/bridges/primitives/chain-westend/src/lib.rs index 8a3794b418e02..910a6c4acbd01 100644 --- a/bridges/primitives/chain-westend/src/lib.rs +++ b/bridges/primitives/chain-westend/src/lib.rs @@ -63,11 +63,6 @@ pub const WITH_WESTEND_GRANDPA_PALLET_NAME: &str = "BridgeWestendGrandpa"; /// Name of the With-Westend parachains bridge pallet instance that is deployed at bridged chains. pub const WITH_WESTEND_BRIDGE_PARAS_PALLET_NAME: &str = "BridgeWestendParachains"; -/// Maximal number of GRANDPA authorities at Westend. -/// -/// Corresponds to the `MaxAuthorities` constant value from the Westend runtime configuration. -pub const MAX_AUTHORITIES_COUNT: u32 = 100_000; - /// Maximal SCALE-encoded size of parachains headers that are stored at Westend `Paras` pallet. /// /// It includes the block number and state root, so it shall be near 40 bytes, but let's have some diff --git a/bridges/primitives/polkadot-core/src/lib.rs b/bridges/primitives/polkadot-core/src/lib.rs index 1d9e9f7a009c7..b13ceb5df50d4 100644 --- a/bridges/primitives/polkadot-core/src/lib.rs +++ b/bridges/primitives/polkadot-core/src/lib.rs @@ -43,6 +43,16 @@ pub use sp_runtime::{traits::Convert, Perbill}; pub mod parachains; +/// Maximal number of GRANDPA authorities at Polkadot-like chains. +/// +/// Ideally, we would set it to the value of `MaxAuthorities` constant from bridged runtime +/// configurations. But right now it is set to the `100_000`, which makes PoV size for +/// our bridge hub parachains huge. So let's stick to the real-world value here. +/// +/// Right now both Kusama and Polkadot aim to have around 1000 validators. Let's be safe here and +/// take twice as much here. +pub const MAX_AUTHORITIES_COUNT: u32 = 2_048; + /// Number of extra bytes (excluding size of storage value itself) of storage proof, built at /// Polkadot-like chain. This mostly depends on number of entries in the storage trie. /// Some reserve is reserved to account future chain growth.