mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-22 21:55:45 +00:00
* drop Rialto <> Millau bridges * clippy
This commit is contained in:
committed by
Bastian Köcher
parent
1c2b6b21da
commit
7a8c87a450
@@ -23,7 +23,7 @@
|
||||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
|
||||
|
||||
// Executed Command:
|
||||
// target/release/millau-bridge-node
|
||||
// target/release/unknown-bridge-node
|
||||
// benchmark
|
||||
// pallet
|
||||
// --chain=dev
|
||||
@@ -58,39 +58,39 @@ pub trait WeightInfo {
|
||||
/// Those weights are test only and must never be used in production.
|
||||
pub struct BridgeWeight<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
|
||||
/// Storage: BridgeRialtoGrandpa PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa PalletOperatingMode (max_values: Some(1), max_size: Some(1),
|
||||
/// Proof: BridgeUnknownGrandpa PalletOperatingMode (max_values: Some(1), max_size: Some(1),
|
||||
/// added: 496, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa RequestCount (r:1 w:1)
|
||||
/// Storage: BridgeUnknownGrandpa RequestCount (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa RequestCount (max_values: Some(1), max_size: Some(4), added: 499,
|
||||
/// mode: MaxEncodedLen)
|
||||
/// Proof: BridgeUnknownGrandpa RequestCount (max_values: Some(1), max_size: Some(4), added:
|
||||
/// 499, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa BestFinalized (r:1 w:1)
|
||||
/// Storage: BridgeUnknownGrandpa BestFinalized (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa BestFinalized (max_values: Some(1), max_size: Some(36), added:
|
||||
/// Proof: BridgeUnknownGrandpa BestFinalized (max_values: Some(1), max_size: Some(36), added:
|
||||
/// 531, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa CurrentAuthoritySet (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa CurrentAuthoritySet (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa CurrentAuthoritySet (max_values: Some(1), max_size: Some(209),
|
||||
/// Proof: BridgeUnknownGrandpa CurrentAuthoritySet (max_values: Some(1), max_size: Some(209),
|
||||
/// added: 704, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHashesPointer (r:1 w:1)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHashesPointer (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHashesPointer (max_values: Some(1), max_size: Some(4),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHashesPointer (max_values: Some(1), max_size: Some(4),
|
||||
/// added: 499, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHashes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHashes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHashes (max_values: Some(14400), max_size: Some(36),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHashes (max_values: Some(14400), max_size: Some(36),
|
||||
/// added: 2016, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:0 w:2)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:0 w:2)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// The range of component `p` is `[1, 4]`.
|
||||
@@ -113,39 +113,39 @@ impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
|
||||
|
||||
// For backwards compatibility and tests
|
||||
impl WeightInfo for () {
|
||||
/// Storage: BridgeRialtoGrandpa PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa PalletOperatingMode (max_values: Some(1), max_size: Some(1),
|
||||
/// Proof: BridgeUnknownGrandpa PalletOperatingMode (max_values: Some(1), max_size: Some(1),
|
||||
/// added: 496, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa RequestCount (r:1 w:1)
|
||||
/// Storage: BridgeUnknownGrandpa RequestCount (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa RequestCount (max_values: Some(1), max_size: Some(4), added: 499,
|
||||
/// mode: MaxEncodedLen)
|
||||
/// Proof: BridgeUnknownGrandpa RequestCount (max_values: Some(1), max_size: Some(4), added:
|
||||
/// 499, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa BestFinalized (r:1 w:1)
|
||||
/// Storage: BridgeUnknownGrandpa BestFinalized (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa BestFinalized (max_values: Some(1), max_size: Some(36), added:
|
||||
/// Proof: BridgeUnknownGrandpa BestFinalized (max_values: Some(1), max_size: Some(36), added:
|
||||
/// 531, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa CurrentAuthoritySet (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa CurrentAuthoritySet (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa CurrentAuthoritySet (max_values: Some(1), max_size: Some(209),
|
||||
/// Proof: BridgeUnknownGrandpa CurrentAuthoritySet (max_values: Some(1), max_size: Some(209),
|
||||
/// added: 704, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHashesPointer (r:1 w:1)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHashesPointer (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHashesPointer (max_values: Some(1), max_size: Some(4),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHashesPointer (max_values: Some(1), max_size: Some(4),
|
||||
/// added: 499, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHashes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHashes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHashes (max_values: Some(14400), max_size: Some(36),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHashes (max_values: Some(14400), max_size: Some(36),
|
||||
/// added: 2016, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:0 w:2)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:0 w:2)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// The range of component `p` is `[1, 4]`.
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Autogenerated weights for RialtoMessages
|
||||
//! Autogenerated weights for pallet_bridge_messages
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
|
||||
//! DATE: 2023-03-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
@@ -23,13 +23,13 @@
|
||||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
|
||||
|
||||
// Executed Command:
|
||||
// target/release/millau-bridge-node
|
||||
// target/release/unknown-bridge-node
|
||||
// benchmark
|
||||
// pallet
|
||||
// --chain=dev
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --pallet=RialtoMessages
|
||||
// --pallet=pallet_bridge_messages
|
||||
// --extrinsic=*
|
||||
// --execution=wasm
|
||||
// --wasm-execution=Compiled
|
||||
@@ -48,7 +48,7 @@ use frame_support::{
|
||||
};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
/// Weight functions needed for RialtoMessages.
|
||||
/// Weight functions needed for pallet_bridge_messages.
|
||||
pub trait WeightInfo {
|
||||
fn receive_single_message_proof() -> Weight;
|
||||
fn receive_two_messages_proof() -> Weight;
|
||||
@@ -61,24 +61,24 @@ pub trait WeightInfo {
|
||||
fn receive_single_message_proof_with_dispatch(i: u32) -> Weight;
|
||||
}
|
||||
|
||||
/// Weights for `RialtoMessages` that are generated using one of the Bridge testnets.
|
||||
/// Weights for `pallet_bridge_messages` that are generated using one of the Bridge testnets.
|
||||
///
|
||||
/// Those weights are test only and must never be used in production.
|
||||
pub struct BridgeWeight<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
|
||||
/// Storage: BridgeRialtoMessages PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// added: 497, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoMessages InboundLanes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownMessages InboundLanes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// Proof: BridgeUnknownMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// 51655, mode: MaxEncodedLen)
|
||||
fn receive_single_message_proof() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
@@ -89,19 +89,19 @@ impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
|
||||
.saturating_add(T::DbWeight::get().reads(3_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoMessages PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// added: 497, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoMessages InboundLanes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownMessages InboundLanes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// Proof: BridgeUnknownMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// 51655, mode: MaxEncodedLen)
|
||||
fn receive_two_messages_proof() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
@@ -112,19 +112,19 @@ impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
|
||||
.saturating_add(T::DbWeight::get().reads(3_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoMessages PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// added: 497, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoMessages InboundLanes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownMessages InboundLanes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// Proof: BridgeUnknownMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// 51655, mode: MaxEncodedLen)
|
||||
fn receive_single_message_proof_with_outbound_lane_state() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
@@ -135,19 +135,19 @@ impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
|
||||
.saturating_add(T::DbWeight::get().reads(3_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoMessages PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// added: 497, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoMessages InboundLanes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownMessages InboundLanes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// Proof: BridgeUnknownMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// 51655, mode: MaxEncodedLen)
|
||||
fn receive_single_message_proof_1_kb() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
@@ -158,19 +158,19 @@ impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
|
||||
.saturating_add(T::DbWeight::get().reads(3_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoMessages PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// added: 497, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoMessages InboundLanes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownMessages InboundLanes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// Proof: BridgeUnknownMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// 51655, mode: MaxEncodedLen)
|
||||
fn receive_single_message_proof_16_kb() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
@@ -181,19 +181,19 @@ impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
|
||||
.saturating_add(T::DbWeight::get().reads(3_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoMessages PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// added: 497, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoMessages OutboundLanes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownMessages OutboundLanes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added:
|
||||
/// Proof: BridgeUnknownMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added:
|
||||
/// 539, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRelayers RelayerRewards (r:1 w:1)
|
||||
@@ -209,19 +209,19 @@ impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
|
||||
.saturating_add(T::DbWeight::get().reads(4_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(2_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoMessages PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// added: 497, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoMessages OutboundLanes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownMessages OutboundLanes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added:
|
||||
/// Proof: BridgeUnknownMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added:
|
||||
/// 539, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRelayers RelayerRewards (r:1 w:1)
|
||||
@@ -237,19 +237,19 @@ impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
|
||||
.saturating_add(T::DbWeight::get().reads(4_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(2_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoMessages PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// added: 497, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoMessages OutboundLanes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownMessages OutboundLanes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added:
|
||||
/// Proof: BridgeUnknownMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added:
|
||||
/// 539, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRelayers RelayerRewards (r:2 w:2)
|
||||
@@ -265,19 +265,19 @@ impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
|
||||
.saturating_add(T::DbWeight::get().reads(5_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(3_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoMessages PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// added: 497, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoMessages InboundLanes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownMessages InboundLanes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// Proof: BridgeUnknownMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// 51655, mode: MaxEncodedLen)
|
||||
///
|
||||
/// The range of component `i` is `[128, 2048]`.
|
||||
@@ -296,19 +296,19 @@ impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
|
||||
|
||||
// For backwards compatibility and tests
|
||||
impl WeightInfo for () {
|
||||
/// Storage: BridgeRialtoMessages PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// added: 497, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoMessages InboundLanes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownMessages InboundLanes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// Proof: BridgeUnknownMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// 51655, mode: MaxEncodedLen)
|
||||
fn receive_single_message_proof() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
@@ -319,19 +319,19 @@ impl WeightInfo for () {
|
||||
.saturating_add(RocksDbWeight::get().reads(3_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoMessages PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// added: 497, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoMessages InboundLanes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownMessages InboundLanes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// Proof: BridgeUnknownMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// 51655, mode: MaxEncodedLen)
|
||||
fn receive_two_messages_proof() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
@@ -342,19 +342,19 @@ impl WeightInfo for () {
|
||||
.saturating_add(RocksDbWeight::get().reads(3_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoMessages PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// added: 497, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoMessages InboundLanes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownMessages InboundLanes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// Proof: BridgeUnknownMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// 51655, mode: MaxEncodedLen)
|
||||
fn receive_single_message_proof_with_outbound_lane_state() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
@@ -365,19 +365,19 @@ impl WeightInfo for () {
|
||||
.saturating_add(RocksDbWeight::get().reads(3_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoMessages PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// added: 497, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoMessages InboundLanes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownMessages InboundLanes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// Proof: BridgeUnknownMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// 51655, mode: MaxEncodedLen)
|
||||
fn receive_single_message_proof_1_kb() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
@@ -388,19 +388,19 @@ impl WeightInfo for () {
|
||||
.saturating_add(RocksDbWeight::get().reads(3_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoMessages PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// added: 497, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoMessages InboundLanes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownMessages InboundLanes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// Proof: BridgeUnknownMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// 51655, mode: MaxEncodedLen)
|
||||
fn receive_single_message_proof_16_kb() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
@@ -411,19 +411,19 @@ impl WeightInfo for () {
|
||||
.saturating_add(RocksDbWeight::get().reads(3_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoMessages PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// added: 497, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoMessages OutboundLanes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownMessages OutboundLanes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added:
|
||||
/// Proof: BridgeUnknownMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added:
|
||||
/// 539, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRelayers RelayerRewards (r:1 w:1)
|
||||
@@ -439,19 +439,19 @@ impl WeightInfo for () {
|
||||
.saturating_add(RocksDbWeight::get().reads(4_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(2_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoMessages PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// added: 497, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoMessages OutboundLanes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownMessages OutboundLanes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added:
|
||||
/// Proof: BridgeUnknownMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added:
|
||||
/// 539, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRelayers RelayerRewards (r:1 w:1)
|
||||
@@ -467,19 +467,19 @@ impl WeightInfo for () {
|
||||
.saturating_add(RocksDbWeight::get().reads(4_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(2_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoMessages PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// added: 497, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoMessages OutboundLanes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownMessages OutboundLanes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added:
|
||||
/// Proof: BridgeUnknownMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added:
|
||||
/// 539, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRelayers RelayerRewards (r:2 w:2)
|
||||
@@ -495,19 +495,19 @@ impl WeightInfo for () {
|
||||
.saturating_add(RocksDbWeight::get().reads(5_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(3_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoMessages PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
|
||||
/// added: 497, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoMessages InboundLanes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownMessages InboundLanes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// Proof: BridgeUnknownMessages InboundLanes (max_values: None, max_size: Some(49180), added:
|
||||
/// 51655, mode: MaxEncodedLen)
|
||||
///
|
||||
/// The range of component `i` is `[128, 2048]`.
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
|
||||
|
||||
// Executed Command:
|
||||
// target/release/millau-bridge-node
|
||||
// target/release/unknown-bridge-node
|
||||
// benchmark
|
||||
// pallet
|
||||
// --chain=dev
|
||||
@@ -60,29 +60,29 @@ pub trait WeightInfo {
|
||||
/// Those weights are test only and must never be used in production.
|
||||
pub struct BridgeWeight<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
|
||||
/// Storage: BridgeRialtoParachains PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownParachains PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains PalletOperatingMode (max_values: Some(1), max_size: Some(1),
|
||||
/// Proof: BridgeUnknownParachains PalletOperatingMode (max_values: Some(1), max_size: Some(1),
|
||||
/// added: 496, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoParachains ParasInfo (r:1 w:1)
|
||||
/// Storage: BridgeUnknownParachains ParasInfo (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains ParasInfo (max_values: Some(1), max_size: Some(60), added:
|
||||
/// Proof: BridgeUnknownParachains ParasInfo (max_values: Some(1), max_size: Some(60), added:
|
||||
/// 555, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoParachains ImportedParaHashes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownParachains ImportedParaHashes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains ImportedParaHashes (max_values: Some(1024), max_size:
|
||||
/// Proof: BridgeUnknownParachains ImportedParaHashes (max_values: Some(1024), max_size:
|
||||
/// Some(64), added: 1549, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoParachains ImportedParaHeads (r:0 w:1)
|
||||
/// Storage: BridgeUnknownParachains ImportedParaHeads (r:0 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains ImportedParaHeads (max_values: Some(1024), max_size:
|
||||
/// Proof: BridgeUnknownParachains ImportedParaHeads (max_values: Some(1024), max_size:
|
||||
/// Some(196), added: 1681, mode: MaxEncodedLen)
|
||||
///
|
||||
/// The range of component `p` is `[1, 2]`.
|
||||
@@ -97,29 +97,29 @@ impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
|
||||
.saturating_add(T::DbWeight::get().reads(4_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(3_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoParachains PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownParachains PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains PalletOperatingMode (max_values: Some(1), max_size: Some(1),
|
||||
/// Proof: BridgeUnknownParachains PalletOperatingMode (max_values: Some(1), max_size: Some(1),
|
||||
/// added: 496, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoParachains ParasInfo (r:1 w:1)
|
||||
/// Storage: BridgeUnknownParachains ParasInfo (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains ParasInfo (max_values: Some(1), max_size: Some(60), added:
|
||||
/// Proof: BridgeUnknownParachains ParasInfo (max_values: Some(1), max_size: Some(60), added:
|
||||
/// 555, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoParachains ImportedParaHashes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownParachains ImportedParaHashes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains ImportedParaHashes (max_values: Some(1024), max_size:
|
||||
/// Proof: BridgeUnknownParachains ImportedParaHashes (max_values: Some(1024), max_size:
|
||||
/// Some(64), added: 1549, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoParachains ImportedParaHeads (r:0 w:1)
|
||||
/// Storage: BridgeUnknownParachains ImportedParaHeads (r:0 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains ImportedParaHeads (max_values: Some(1024), max_size:
|
||||
/// Proof: BridgeUnknownParachains ImportedParaHeads (max_values: Some(1024), max_size:
|
||||
/// Some(196), added: 1681, mode: MaxEncodedLen)
|
||||
fn submit_parachain_heads_with_1kb_proof() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
@@ -130,29 +130,29 @@ impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
|
||||
.saturating_add(T::DbWeight::get().reads(4_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(3_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoParachains PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownParachains PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains PalletOperatingMode (max_values: Some(1), max_size: Some(1),
|
||||
/// Proof: BridgeUnknownParachains PalletOperatingMode (max_values: Some(1), max_size: Some(1),
|
||||
/// added: 496, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoParachains ParasInfo (r:1 w:1)
|
||||
/// Storage: BridgeUnknownParachains ParasInfo (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains ParasInfo (max_values: Some(1), max_size: Some(60), added:
|
||||
/// Proof: BridgeUnknownParachains ParasInfo (max_values: Some(1), max_size: Some(60), added:
|
||||
/// 555, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoParachains ImportedParaHashes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownParachains ImportedParaHashes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains ImportedParaHashes (max_values: Some(1024), max_size:
|
||||
/// Proof: BridgeUnknownParachains ImportedParaHashes (max_values: Some(1024), max_size:
|
||||
/// Some(64), added: 1549, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoParachains ImportedParaHeads (r:0 w:1)
|
||||
/// Storage: BridgeUnknownParachains ImportedParaHeads (r:0 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains ImportedParaHeads (max_values: Some(1024), max_size:
|
||||
/// Proof: BridgeUnknownParachains ImportedParaHeads (max_values: Some(1024), max_size:
|
||||
/// Some(196), added: 1681, mode: MaxEncodedLen)
|
||||
fn submit_parachain_heads_with_16kb_proof() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
@@ -167,29 +167,29 @@ impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
|
||||
|
||||
// For backwards compatibility and tests
|
||||
impl WeightInfo for () {
|
||||
/// Storage: BridgeRialtoParachains PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownParachains PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains PalletOperatingMode (max_values: Some(1), max_size: Some(1),
|
||||
/// Proof: BridgeUnknownParachains PalletOperatingMode (max_values: Some(1), max_size: Some(1),
|
||||
/// added: 496, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoParachains ParasInfo (r:1 w:1)
|
||||
/// Storage: BridgeUnknownParachains ParasInfo (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains ParasInfo (max_values: Some(1), max_size: Some(60), added:
|
||||
/// Proof: BridgeUnknownParachains ParasInfo (max_values: Some(1), max_size: Some(60), added:
|
||||
/// 555, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoParachains ImportedParaHashes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownParachains ImportedParaHashes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains ImportedParaHashes (max_values: Some(1024), max_size:
|
||||
/// Proof: BridgeUnknownParachains ImportedParaHashes (max_values: Some(1024), max_size:
|
||||
/// Some(64), added: 1549, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoParachains ImportedParaHeads (r:0 w:1)
|
||||
/// Storage: BridgeUnknownParachains ImportedParaHeads (r:0 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains ImportedParaHeads (max_values: Some(1024), max_size:
|
||||
/// Proof: BridgeUnknownParachains ImportedParaHeads (max_values: Some(1024), max_size:
|
||||
/// Some(196), added: 1681, mode: MaxEncodedLen)
|
||||
///
|
||||
/// The range of component `p` is `[1, 2]`.
|
||||
@@ -204,29 +204,29 @@ impl WeightInfo for () {
|
||||
.saturating_add(RocksDbWeight::get().reads(4_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(3_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoParachains PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownParachains PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains PalletOperatingMode (max_values: Some(1), max_size: Some(1),
|
||||
/// Proof: BridgeUnknownParachains PalletOperatingMode (max_values: Some(1), max_size: Some(1),
|
||||
/// added: 496, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoParachains ParasInfo (r:1 w:1)
|
||||
/// Storage: BridgeUnknownParachains ParasInfo (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains ParasInfo (max_values: Some(1), max_size: Some(60), added:
|
||||
/// Proof: BridgeUnknownParachains ParasInfo (max_values: Some(1), max_size: Some(60), added:
|
||||
/// 555, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoParachains ImportedParaHashes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownParachains ImportedParaHashes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains ImportedParaHashes (max_values: Some(1024), max_size:
|
||||
/// Proof: BridgeUnknownParachains ImportedParaHashes (max_values: Some(1024), max_size:
|
||||
/// Some(64), added: 1549, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoParachains ImportedParaHeads (r:0 w:1)
|
||||
/// Storage: BridgeUnknownParachains ImportedParaHeads (r:0 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains ImportedParaHeads (max_values: Some(1024), max_size:
|
||||
/// Proof: BridgeUnknownParachains ImportedParaHeads (max_values: Some(1024), max_size:
|
||||
/// Some(196), added: 1681, mode: MaxEncodedLen)
|
||||
fn submit_parachain_heads_with_1kb_proof() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
@@ -237,29 +237,29 @@ impl WeightInfo for () {
|
||||
.saturating_add(RocksDbWeight::get().reads(4_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(3_u64))
|
||||
}
|
||||
/// Storage: BridgeRialtoParachains PalletOperatingMode (r:1 w:0)
|
||||
/// Storage: BridgeUnknownParachains PalletOperatingMode (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains PalletOperatingMode (max_values: Some(1), max_size: Some(1),
|
||||
/// Proof: BridgeUnknownParachains PalletOperatingMode (max_values: Some(1), max_size: Some(1),
|
||||
/// added: 496, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:1 w:0)
|
||||
/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:1 w:0)
|
||||
///
|
||||
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
|
||||
/// added: 2048, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoParachains ParasInfo (r:1 w:1)
|
||||
/// Storage: BridgeUnknownParachains ParasInfo (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains ParasInfo (max_values: Some(1), max_size: Some(60), added:
|
||||
/// Proof: BridgeUnknownParachains ParasInfo (max_values: Some(1), max_size: Some(60), added:
|
||||
/// 555, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoParachains ImportedParaHashes (r:1 w:1)
|
||||
/// Storage: BridgeUnknownParachains ImportedParaHashes (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains ImportedParaHashes (max_values: Some(1024), max_size:
|
||||
/// Proof: BridgeUnknownParachains ImportedParaHashes (max_values: Some(1024), max_size:
|
||||
/// Some(64), added: 1549, mode: MaxEncodedLen)
|
||||
///
|
||||
/// Storage: BridgeRialtoParachains ImportedParaHeads (r:0 w:1)
|
||||
/// Storage: BridgeUnknownParachains ImportedParaHeads (r:0 w:1)
|
||||
///
|
||||
/// Proof: BridgeRialtoParachains ImportedParaHeads (max_values: Some(1024), max_size:
|
||||
/// Proof: BridgeUnknownParachains ImportedParaHeads (max_values: Some(1024), max_size:
|
||||
/// Some(196), added: 1681, mode: MaxEncodedLen)
|
||||
fn submit_parachain_heads_with_16kb_proof() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
|
||||
@@ -31,7 +31,7 @@ use frame_support::weights::{RuntimeDbWeight, Weight};
|
||||
pub const DEFAULT_PARACHAIN_HEAD_SIZE: u32 = 384;
|
||||
|
||||
/// Number of extra bytes (excluding size of storage value itself) of storage proof, built at
|
||||
/// the Rialto chain.
|
||||
/// some generic chain.
|
||||
pub const EXTRA_STORAGE_PROOF_SIZE: u32 = 1024;
|
||||
|
||||
/// Extended weight info.
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
|
||||
|
||||
// Executed Command:
|
||||
// target/release/millau-bridge-node
|
||||
// target/release/rip-bridge-node
|
||||
// benchmark
|
||||
// pallet
|
||||
// --chain=dev
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
[package]
|
||||
name = "pallet-shift-session-manager"
|
||||
description = "A Substrate Runtime module that selects 2/3 of initial validators for every session"
|
||||
version = "0.1.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2021"
|
||||
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
|
||||
scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
|
||||
|
||||
# Substrate Dependencies
|
||||
|
||||
frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false }
|
||||
frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false }
|
||||
pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false }
|
||||
sp-staking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false }
|
||||
sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" }
|
||||
sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" }
|
||||
sp-state-machine = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" }
|
||||
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" }
|
||||
|
||||
[features]
|
||||
default = [ "std" ]
|
||||
std = [
|
||||
"codec/std",
|
||||
"frame-support/std",
|
||||
"frame-system/std",
|
||||
"pallet-session/std",
|
||||
"scale-info/std",
|
||||
"sp-staking/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime" ]
|
||||
@@ -1,10 +0,0 @@
|
||||
# Shift Session Manager Pallet
|
||||
|
||||
**THIS PALLET IS NOT INTENDED TO BE USED IN PRODUCTION**
|
||||
|
||||
The pallet does not provide any calls or runtime storage entries. It only provides implementation of the
|
||||
`pallet_session::SessionManager`. This implementation, starting from session `3` selects two thirds of initial
|
||||
validators and changes the set on every session. We are using it at our testnets ([Rialto](../../bin/rialto/) and
|
||||
[Millau](../../bin/millau/)) to be sure that the set changes every session. On well-known production chains
|
||||
(like Kusama and Polkadot) the alternative is the set of [nPoS](https://research.web3.foundation/en/latest/polkadot/NPoS/index.html)
|
||||
pallets, which selects validators, based on their nominations.
|
||||
@@ -1,259 +0,0 @@
|
||||
// Copyright 2019-2021 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Parity Bridges Common.
|
||||
|
||||
// Parity Bridges Common is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Parity Bridges Common is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Substrate session manager that selects 2/3 validators from initial set,
|
||||
//! starting from session 2.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
use frame_support::traits::{ValidatorSet, ValidatorSetWithIdentification};
|
||||
use sp_std::prelude::*;
|
||||
|
||||
pub use pallet::*;
|
||||
|
||||
#[frame_support::pallet]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
use frame_support::pallet_prelude::*;
|
||||
use frame_system::pallet_prelude::*;
|
||||
|
||||
#[pallet::config]
|
||||
#[pallet::disable_frame_system_supertrait_check]
|
||||
pub trait Config: pallet_session::Config {}
|
||||
|
||||
#[pallet::pallet]
|
||||
#[pallet::without_storage_info]
|
||||
pub struct Pallet<T>(PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {}
|
||||
|
||||
/// Validators of first two sessions.
|
||||
#[pallet::storage]
|
||||
pub(super) type InitialValidators<T: Config> = StorageValue<_, Vec<T::ValidatorId>>;
|
||||
}
|
||||
|
||||
impl<T: pallet_session::Config + Config> ValidatorSet<T::AccountId> for Pallet<T> {
|
||||
type ValidatorId = T::ValidatorId;
|
||||
type ValidatorIdOf = T::ValidatorIdOf;
|
||||
|
||||
fn session_index() -> sp_staking::SessionIndex {
|
||||
pallet_session::Pallet::<T>::current_index()
|
||||
}
|
||||
|
||||
fn validators() -> Vec<Self::ValidatorId> {
|
||||
pallet_session::Pallet::<T>::validators()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> ValidatorSetWithIdentification<T::AccountId> for Pallet<T> {
|
||||
type Identification = ();
|
||||
type IdentificationOf = ();
|
||||
}
|
||||
|
||||
impl<T: Config> pallet_session::SessionManager<T::ValidatorId> for Pallet<T> {
|
||||
fn end_session(_: sp_staking::SessionIndex) {}
|
||||
fn start_session(_: sp_staking::SessionIndex) {}
|
||||
fn new_session(session_index: sp_staking::SessionIndex) -> Option<Vec<T::ValidatorId>> {
|
||||
// we don't want to add even more fields to genesis config => just return None
|
||||
if session_index == 0 || session_index == 1 {
|
||||
return None
|
||||
}
|
||||
|
||||
// the idea that on first call (i.e. when session 1 ends) we're reading current
|
||||
// set of validators from session module (they are initial validators) and save
|
||||
// in our 'local storage'.
|
||||
// then for every session we select (deterministically) 2/3 of these initial
|
||||
// validators to serve validators of new session
|
||||
let available_validators = InitialValidators::<T>::get().unwrap_or_else(|| {
|
||||
let validators = <pallet_session::Pallet<T>>::validators();
|
||||
InitialValidators::<T>::put(validators.clone());
|
||||
validators
|
||||
});
|
||||
|
||||
Some(Self::select_validators(session_index, &available_validators))
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> Pallet<T> {
|
||||
/// Select validators for session.
|
||||
fn select_validators(
|
||||
session_index: sp_staking::SessionIndex,
|
||||
available_validators: &[T::ValidatorId],
|
||||
) -> Vec<T::ValidatorId> {
|
||||
let available_validators_count = available_validators.len();
|
||||
let count = sp_std::cmp::max(1, 2 * available_validators_count / 3);
|
||||
let offset = session_index as usize % available_validators_count;
|
||||
let end = offset + count;
|
||||
let session_validators = match end.overflowing_sub(available_validators_count) {
|
||||
(wrapped_end, false) if wrapped_end != 0 => available_validators[offset..]
|
||||
.iter()
|
||||
.chain(available_validators[..wrapped_end].iter())
|
||||
.cloned()
|
||||
.collect(),
|
||||
_ => available_validators[offset..end].to_vec(),
|
||||
};
|
||||
|
||||
session_validators
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
// From construct_runtime macro
|
||||
#![allow(clippy::from_over_into)]
|
||||
|
||||
use super::*;
|
||||
use frame_support::{
|
||||
parameter_types,
|
||||
sp_runtime::{
|
||||
testing::UintAuthorityId,
|
||||
traits::{BlakeTwo256, ConvertInto, IdentityLookup},
|
||||
BuildStorage, Perbill, RuntimeAppPublic,
|
||||
},
|
||||
weights::Weight,
|
||||
};
|
||||
use sp_core::H256;
|
||||
use sp_io::TestExternalities;
|
||||
use sp_state_machine::BasicExternalities;
|
||||
|
||||
type AccountId = u64;
|
||||
|
||||
type Block = frame_system::mocking::MockBlock<TestRuntime>;
|
||||
|
||||
frame_support::construct_runtime! {
|
||||
pub enum TestRuntime {
|
||||
System: frame_system::{Pallet, Call, Config<T>, Storage, Event<T>},
|
||||
Session: pallet_session::{Pallet},
|
||||
}
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
|
||||
pub const MaximumBlockLength: u32 = 2 * 1024;
|
||||
pub const AvailableBlockRatio: Perbill = Perbill::one();
|
||||
}
|
||||
|
||||
impl frame_system::Config for TestRuntime {
|
||||
type RuntimeOrigin = RuntimeOrigin;
|
||||
type Nonce = u64;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type Hash = H256;
|
||||
type Hashing = BlakeTwo256;
|
||||
type AccountId = AccountId;
|
||||
type Lookup = IdentityLookup<Self::AccountId>;
|
||||
type Block = Block;
|
||||
type RuntimeEvent = ();
|
||||
type BlockHashCount = frame_support::traits::ConstU64<250>;
|
||||
type Version = ();
|
||||
type PalletInfo = PalletInfo;
|
||||
type AccountData = ();
|
||||
type OnNewAccount = ();
|
||||
type OnKilledAccount = ();
|
||||
type BaseCallFilter = frame_support::traits::Everything;
|
||||
type SystemWeightInfo = ();
|
||||
type BlockWeights = ();
|
||||
type BlockLength = ();
|
||||
type DbWeight = ();
|
||||
type SS58Prefix = ();
|
||||
type OnSetCode = ();
|
||||
type MaxConsumers = frame_support::traits::ConstU32<16>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const Period: u64 = 1;
|
||||
pub const Offset: u64 = 0;
|
||||
}
|
||||
|
||||
impl pallet_session::Config for TestRuntime {
|
||||
type RuntimeEvent = ();
|
||||
type ValidatorId = <Self as frame_system::Config>::AccountId;
|
||||
type ValidatorIdOf = ConvertInto;
|
||||
type ShouldEndSession = pallet_session::PeriodicSessions<Period, Offset>;
|
||||
type NextSessionRotation = pallet_session::PeriodicSessions<Period, Offset>;
|
||||
type SessionManager = ();
|
||||
type SessionHandler = TestSessionHandler;
|
||||
type Keys = UintAuthorityId;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
impl Config for TestRuntime {}
|
||||
|
||||
pub struct TestSessionHandler;
|
||||
impl pallet_session::SessionHandler<AccountId> for TestSessionHandler {
|
||||
const KEY_TYPE_IDS: &'static [sp_runtime::KeyTypeId] = &[UintAuthorityId::ID];
|
||||
|
||||
fn on_genesis_session<Ks: sp_runtime::traits::OpaqueKeys>(_validators: &[(AccountId, Ks)]) {
|
||||
}
|
||||
|
||||
fn on_new_session<Ks: sp_runtime::traits::OpaqueKeys>(
|
||||
_: bool,
|
||||
_: &[(AccountId, Ks)],
|
||||
_: &[(AccountId, Ks)],
|
||||
) {
|
||||
}
|
||||
|
||||
fn on_disabled(_: u32) {}
|
||||
}
|
||||
|
||||
fn new_test_ext() -> TestExternalities {
|
||||
let mut t = frame_system::GenesisConfig::<TestRuntime>::default().build_storage().unwrap();
|
||||
|
||||
let keys = vec![
|
||||
(1, 1, UintAuthorityId(1)),
|
||||
(2, 2, UintAuthorityId(2)),
|
||||
(3, 3, UintAuthorityId(3)),
|
||||
(4, 4, UintAuthorityId(4)),
|
||||
(5, 5, UintAuthorityId(5)),
|
||||
];
|
||||
|
||||
BasicExternalities::execute_with_storage(&mut t, || {
|
||||
for (ref k, ..) in &keys {
|
||||
frame_system::Pallet::<TestRuntime>::inc_providers(k);
|
||||
}
|
||||
});
|
||||
|
||||
pallet_session::GenesisConfig::<TestRuntime> { keys }
|
||||
.assimilate_storage(&mut t)
|
||||
.unwrap();
|
||||
TestExternalities::new(t)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn shift_session_manager_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let all_accs = vec![1, 2, 3, 4, 5];
|
||||
|
||||
// at least 1 validator is selected
|
||||
assert_eq!(Pallet::<TestRuntime>::select_validators(0, &[1]), vec![1],);
|
||||
|
||||
// at session#0, shift is also 0
|
||||
assert_eq!(Pallet::<TestRuntime>::select_validators(0, &all_accs), vec![1, 2, 3],);
|
||||
|
||||
// at session#1, shift is also 1
|
||||
assert_eq!(Pallet::<TestRuntime>::select_validators(1, &all_accs), vec![2, 3, 4],);
|
||||
|
||||
// at session#3, we're wrapping
|
||||
assert_eq!(Pallet::<TestRuntime>::select_validators(3, &all_accs), vec![4, 5, 1],);
|
||||
|
||||
// at session#5, we're starting from the beginning again
|
||||
assert_eq!(Pallet::<TestRuntime>::select_validators(5, &all_accs), vec![1, 2, 3],);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
|
||||
|
||||
// Executed Command:
|
||||
// target/release/millau-bridge-node
|
||||
// target/release/rip-bridge-node
|
||||
// benchmark
|
||||
// pallet
|
||||
// --chain=dev
|
||||
|
||||
Reference in New Issue
Block a user