MillauWeight -> BridgeWeight (#1593)

This commit is contained in:
Svyatoslav Nikolsky
2022-10-04 14:18:22 +03:00
committed by Bastian Köcher
parent 4f4200b0eb
commit 6f9bda5db0
12 changed files with 80 additions and 72 deletions
+6 -6
View File
@@ -432,7 +432,7 @@ impl pallet_bridge_grandpa::Config for Runtime {
type MaxRequests = MaxRequests; type MaxRequests = MaxRequests;
type HeadersToKeep = HeadersToKeep; type HeadersToKeep = HeadersToKeep;
type WeightInfo = pallet_bridge_grandpa::weights::MillauWeight<Runtime>; type WeightInfo = pallet_bridge_grandpa::weights::BridgeWeight<Runtime>;
} }
pub type WestendGrandpaInstance = pallet_bridge_grandpa::Instance1; pub type WestendGrandpaInstance = pallet_bridge_grandpa::Instance1;
@@ -441,7 +441,7 @@ impl pallet_bridge_grandpa::Config<WestendGrandpaInstance> for Runtime {
type MaxRequests = MaxRequests; type MaxRequests = MaxRequests;
type HeadersToKeep = HeadersToKeep; type HeadersToKeep = HeadersToKeep;
type WeightInfo = pallet_bridge_grandpa::weights::MillauWeight<Runtime>; type WeightInfo = pallet_bridge_grandpa::weights::BridgeWeight<Runtime>;
} }
impl pallet_shift_session_manager::Config for Runtime {} impl pallet_shift_session_manager::Config for Runtime {}
@@ -465,7 +465,7 @@ pub type WithRialtoMessagesInstance = ();
impl pallet_bridge_messages::Config<WithRialtoMessagesInstance> for Runtime { impl pallet_bridge_messages::Config<WithRialtoMessagesInstance> for Runtime {
type Event = Event; type Event = Event;
type WeightInfo = pallet_bridge_messages::weights::MillauWeight<Runtime>; type WeightInfo = pallet_bridge_messages::weights::BridgeWeight<Runtime>;
type Parameter = rialto_messages::MillauToRialtoMessagesParameter; type Parameter = rialto_messages::MillauToRialtoMessagesParameter;
type MaxMessagesToPruneAtOnce = MaxMessagesToPruneAtOnce; type MaxMessagesToPruneAtOnce = MaxMessagesToPruneAtOnce;
type MaxUnrewardedRelayerEntriesAtInboundLane = MaxUnrewardedRelayerEntriesAtInboundLane; type MaxUnrewardedRelayerEntriesAtInboundLane = MaxUnrewardedRelayerEntriesAtInboundLane;
@@ -500,7 +500,7 @@ pub type WithRialtoParachainMessagesInstance = pallet_bridge_messages::Instance1
impl pallet_bridge_messages::Config<WithRialtoParachainMessagesInstance> for Runtime { impl pallet_bridge_messages::Config<WithRialtoParachainMessagesInstance> for Runtime {
type Event = Event; type Event = Event;
type WeightInfo = pallet_bridge_messages::weights::MillauWeight<Runtime>; type WeightInfo = pallet_bridge_messages::weights::BridgeWeight<Runtime>;
type Parameter = rialto_parachain_messages::MillauToRialtoParachainMessagesParameter; type Parameter = rialto_parachain_messages::MillauToRialtoParachainMessagesParameter;
type MaxMessagesToPruneAtOnce = MaxMessagesToPruneAtOnce; type MaxMessagesToPruneAtOnce = MaxMessagesToPruneAtOnce;
type MaxUnrewardedRelayerEntriesAtInboundLane = MaxUnrewardedRelayerEntriesAtInboundLane; type MaxUnrewardedRelayerEntriesAtInboundLane = MaxUnrewardedRelayerEntriesAtInboundLane;
@@ -541,7 +541,7 @@ pub type WithRialtoParachainsInstance = ();
impl pallet_bridge_parachains::Config<WithRialtoParachainsInstance> for Runtime { impl pallet_bridge_parachains::Config<WithRialtoParachainsInstance> for Runtime {
type Event = Event; type Event = Event;
type WeightInfo = pallet_bridge_parachains::weights::MillauWeight<Runtime>; type WeightInfo = pallet_bridge_parachains::weights::BridgeWeight<Runtime>;
type BridgesGrandpaPalletInstance = RialtoGrandpaInstance; type BridgesGrandpaPalletInstance = RialtoGrandpaInstance;
type ParasPalletName = RialtoParasPalletName; type ParasPalletName = RialtoParasPalletName;
type TrackedParachains = frame_support::traits::Everything; type TrackedParachains = frame_support::traits::Everything;
@@ -553,7 +553,7 @@ pub type WithWestendParachainsInstance = pallet_bridge_parachains::Instance1;
impl pallet_bridge_parachains::Config<WithWestendParachainsInstance> for Runtime { impl pallet_bridge_parachains::Config<WithWestendParachainsInstance> for Runtime {
type Event = Event; type Event = Event;
type WeightInfo = pallet_bridge_parachains::weights::MillauWeight<Runtime>; type WeightInfo = pallet_bridge_parachains::weights::BridgeWeight<Runtime>;
type BridgesGrandpaPalletInstance = WestendGrandpaInstance; type BridgesGrandpaPalletInstance = WestendGrandpaInstance;
type ParasPalletName = WestendParasPalletName; type ParasPalletName = WestendParasPalletName;
type TrackedParachains = frame_support::traits::Everything; type TrackedParachains = frame_support::traits::Everything;
@@ -320,7 +320,7 @@ mod tests {
#[test] #[test]
fn ensure_millau_message_lane_weights_are_correct() { fn ensure_millau_message_lane_weights_are_correct() {
type Weights = pallet_bridge_messages::weights::MillauWeight<Runtime>; type Weights = pallet_bridge_messages::weights::BridgeWeight<Runtime>;
pallet_bridge_messages::ensure_weights_are_correct::<Weights>( pallet_bridge_messages::ensure_weights_are_correct::<Weights>(
bp_millau::DEFAULT_MESSAGE_DELIVERY_TX_WEIGHT, bp_millau::DEFAULT_MESSAGE_DELIVERY_TX_WEIGHT,
@@ -538,7 +538,7 @@ impl pallet_bridge_grandpa::Config for Runtime {
type BridgedChain = bp_millau::Millau; type BridgedChain = bp_millau::Millau;
type MaxRequests = MaxRequests; type MaxRequests = MaxRequests;
type HeadersToKeep = HeadersToKeep; type HeadersToKeep = HeadersToKeep;
type WeightInfo = pallet_bridge_grandpa::weights::MillauWeight<Runtime>; type WeightInfo = pallet_bridge_grandpa::weights::BridgeWeight<Runtime>;
} }
parameter_types! { parameter_types! {
@@ -559,7 +559,7 @@ pub type WithMillauMessagesInstance = ();
impl pallet_bridge_messages::Config<WithMillauMessagesInstance> for Runtime { impl pallet_bridge_messages::Config<WithMillauMessagesInstance> for Runtime {
type Event = Event; type Event = Event;
type WeightInfo = pallet_bridge_messages::weights::MillauWeight<Runtime>; type WeightInfo = pallet_bridge_messages::weights::BridgeWeight<Runtime>;
type Parameter = millau_messages::RialtoParachainToMillauMessagesParameter; type Parameter = millau_messages::RialtoParachainToMillauMessagesParameter;
type MaxMessagesToPruneAtOnce = MaxMessagesToPruneAtOnce; type MaxMessagesToPruneAtOnce = MaxMessagesToPruneAtOnce;
type MaxUnrewardedRelayerEntriesAtInboundLane = MaxUnrewardedRelayerEntriesAtInboundLane; type MaxUnrewardedRelayerEntriesAtInboundLane = MaxUnrewardedRelayerEntriesAtInboundLane;
+2 -2
View File
@@ -424,7 +424,7 @@ impl pallet_bridge_grandpa::Config for Runtime {
type BridgedChain = bp_millau::Millau; type BridgedChain = bp_millau::Millau;
type MaxRequests = MaxRequests; type MaxRequests = MaxRequests;
type HeadersToKeep = HeadersToKeep; type HeadersToKeep = HeadersToKeep;
type WeightInfo = pallet_bridge_grandpa::weights::MillauWeight<Runtime>; type WeightInfo = pallet_bridge_grandpa::weights::BridgeWeight<Runtime>;
} }
impl pallet_shift_session_manager::Config for Runtime {} impl pallet_shift_session_manager::Config for Runtime {}
@@ -447,7 +447,7 @@ pub type WithMillauMessagesInstance = ();
impl pallet_bridge_messages::Config<WithMillauMessagesInstance> for Runtime { impl pallet_bridge_messages::Config<WithMillauMessagesInstance> for Runtime {
type Event = Event; type Event = Event;
type WeightInfo = pallet_bridge_messages::weights::MillauWeight<Runtime>; type WeightInfo = pallet_bridge_messages::weights::BridgeWeight<Runtime>;
type Parameter = millau_messages::RialtoToMillauMessagesParameter; type Parameter = millau_messages::RialtoToMillauMessagesParameter;
type MaxMessagesToPruneAtOnce = MaxMessagesToPruneAtOnce; type MaxMessagesToPruneAtOnce = MaxMessagesToPruneAtOnce;
type MaxUnrewardedRelayerEntriesAtInboundLane = MaxUnrewardedRelayerEntriesAtInboundLane; type MaxUnrewardedRelayerEntriesAtInboundLane = MaxUnrewardedRelayerEntriesAtInboundLane;
@@ -315,7 +315,7 @@ mod tests {
#[test] #[test]
fn ensure_rialto_message_lane_weights_are_correct() { fn ensure_rialto_message_lane_weights_are_correct() {
type Weights = pallet_bridge_messages::weights::MillauWeight<Runtime>; type Weights = pallet_bridge_messages::weights::BridgeWeight<Runtime>;
pallet_bridge_messages::ensure_weights_are_correct::<Weights>( pallet_bridge_messages::ensure_weights_are_correct::<Weights>(
bp_rialto::DEFAULT_MESSAGE_DELIVERY_TX_WEIGHT, bp_rialto::DEFAULT_MESSAGE_DELIVERY_TX_WEIGHT,
+12 -10
View File
@@ -17,7 +17,7 @@
//! Autogenerated weights for `pallet_bridge_grandpa` //! Autogenerated weights for `pallet_bridge_grandpa`
//! //!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-07-06, STEPS: 50, REPEAT: 20 //! DATE: 2022-10-04, STEPS: 50, REPEAT: 20
//! LOW RANGE: [], HIGH RANGE: [] //! LOW RANGE: [], HIGH RANGE: []
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled
//! CHAIN: Some("dev"), DB CACHE: 1024 //! CHAIN: Some("dev"), DB CACHE: 1024
@@ -53,13 +53,15 @@ pub trait WeightInfo {
fn submit_finality_proof(p: u32, v: u32) -> Weight; fn submit_finality_proof(p: u32, v: u32) -> Weight;
} }
/// Weights for `pallet_bridge_grandpa` using the Millau node and recommended hardware. /// Weights for `pallet_bridge_grandpa` that are generated using one of the Bridge testnets.
pub struct MillauWeight<T>(PhantomData<T>); ///
impl<T: frame_system::Config> WeightInfo for MillauWeight<T> { /// 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> {
fn submit_finality_proof(p: u32, v: u32) -> Weight { fn submit_finality_proof(p: u32, v: u32) -> Weight {
(55_070_000 as Weight) (105_417_000 as Weight)
.saturating_add((39_678_000 as Weight).saturating_mul(p as Weight)) .saturating_add((40_923_000 as Weight).saturating_mul(p as Weight))
.saturating_add((1_540_000 as Weight).saturating_mul(v as Weight)) .saturating_add((1_691_000 as Weight).saturating_mul(v as Weight))
.saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().writes(6 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight))
} }
@@ -68,9 +70,9 @@ impl<T: frame_system::Config> WeightInfo for MillauWeight<T> {
// For backwards compatibility and tests // For backwards compatibility and tests
impl WeightInfo for () { impl WeightInfo for () {
fn submit_finality_proof(p: u32, v: u32) -> Weight { fn submit_finality_proof(p: u32, v: u32) -> Weight {
(55_070_000 as Weight) (105_417_000 as Weight)
.saturating_add((39_678_000 as Weight).saturating_mul(p as Weight)) .saturating_add((40_923_000 as Weight).saturating_mul(p as Weight))
.saturating_add((1_540_000 as Weight).saturating_mul(v as Weight)) .saturating_add((1_691_000 as Weight).saturating_mul(v as Weight))
.saturating_add(RocksDbWeight::get().reads(7 as Weight)) .saturating_add(RocksDbWeight::get().reads(7 as Weight))
.saturating_add(RocksDbWeight::get().writes(6 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight))
} }
+32 -30
View File
@@ -17,7 +17,7 @@
//! Autogenerated weights for `pallet_bridge_messages` //! Autogenerated weights for `pallet_bridge_messages`
//! //!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-07-20, STEPS: 50, REPEAT: 20 //! DATE: 2022-10-04, STEPS: 50, REPEAT: 20
//! LOW RANGE: [], HIGH RANGE: [] //! LOW RANGE: [], HIGH RANGE: []
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled
//! CHAIN: Some("dev"), DB CACHE: 1024 //! CHAIN: Some("dev"), DB CACHE: 1024
@@ -66,26 +66,28 @@ pub trait WeightInfo {
fn receive_delivery_proof_for_two_messages_by_two_relayers() -> Weight; fn receive_delivery_proof_for_two_messages_by_two_relayers() -> Weight;
} }
/// Weights for `pallet_bridge_messages` using the Millau node and recommended hardware. /// Weights for `pallet_bridge_messages` that are generated using one of the Bridge testnets.
pub struct MillauWeight<T>(PhantomData<T>); ///
impl<T: frame_system::Config> WeightInfo for MillauWeight<T> { /// 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> {
fn send_minimal_message_worst_case() -> Weight { fn send_minimal_message_worst_case() -> Weight {
(38_822_000 as Weight) (62_300_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(10 as Weight)) .saturating_add(T::DbWeight::get().writes(10 as Weight))
} }
fn send_1_kb_message_worst_case() -> Weight { fn send_1_kb_message_worst_case() -> Weight {
(39_799_000 as Weight) (63_176_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(10 as Weight)) .saturating_add(T::DbWeight::get().writes(10 as Weight))
} }
fn send_16_kb_message_worst_case() -> Weight { fn send_16_kb_message_worst_case() -> Weight {
(47_772_000 as Weight) (73_472_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(10 as Weight)) .saturating_add(T::DbWeight::get().writes(10 as Weight))
} }
fn maximal_increase_message_fee() -> Weight { fn maximal_increase_message_fee() -> Weight {
(3_081_804_000 as Weight) (2_539_209_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight))
} }
@@ -96,47 +98,47 @@ impl<T: frame_system::Config> WeightInfo for MillauWeight<T> {
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight))
} }
fn receive_single_message_proof() -> Weight { fn receive_single_message_proof() -> Weight {
(26_523_000 as Weight) (49_205_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight))
} }
fn receive_two_messages_proof() -> Weight { fn receive_two_messages_proof() -> Weight {
(39_278_000 as Weight) (62_182_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight))
} }
fn receive_single_message_proof_with_outbound_lane_state() -> Weight { fn receive_single_message_proof_with_outbound_lane_state() -> Weight {
(32_416_000 as Weight) (55_928_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight))
} }
fn receive_single_message_proof_1_kb() -> Weight { fn receive_single_message_proof_1_kb() -> Weight {
(27_078_000 as Weight) (47_298_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight))
} }
fn receive_single_message_proof_16_kb() -> Weight { fn receive_single_message_proof_16_kb() -> Weight {
(78_235_000 as Weight) (105_016_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight))
} }
fn receive_single_prepaid_message_proof() -> Weight { fn receive_single_prepaid_message_proof() -> Weight {
(27_635_000 as Weight) (49_067_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight))
} }
fn receive_delivery_proof_for_single_message() -> Weight { fn receive_delivery_proof_for_single_message() -> Weight {
(34_576_000 as Weight) (58_520_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight))
} }
fn receive_delivery_proof_for_two_messages_by_single_relayer() -> Weight { fn receive_delivery_proof_for_two_messages_by_single_relayer() -> Weight {
(37_318_000 as Weight) (61_563_000 as Weight)
.saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().reads(6 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight))
} }
fn receive_delivery_proof_for_two_messages_by_two_relayers() -> Weight { fn receive_delivery_proof_for_two_messages_by_two_relayers() -> Weight {
(41_245_000 as Weight) (63_197_000 as Weight)
.saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight))
} }
@@ -145,22 +147,22 @@ impl<T: frame_system::Config> WeightInfo for MillauWeight<T> {
// For backwards compatibility and tests // For backwards compatibility and tests
impl WeightInfo for () { impl WeightInfo for () {
fn send_minimal_message_worst_case() -> Weight { fn send_minimal_message_worst_case() -> Weight {
(38_822_000 as Weight) (62_300_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight))
.saturating_add(RocksDbWeight::get().writes(10 as Weight)) .saturating_add(RocksDbWeight::get().writes(10 as Weight))
} }
fn send_1_kb_message_worst_case() -> Weight { fn send_1_kb_message_worst_case() -> Weight {
(39_799_000 as Weight) (63_176_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight))
.saturating_add(RocksDbWeight::get().writes(10 as Weight)) .saturating_add(RocksDbWeight::get().writes(10 as Weight))
} }
fn send_16_kb_message_worst_case() -> Weight { fn send_16_kb_message_worst_case() -> Weight {
(47_772_000 as Weight) (73_472_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight))
.saturating_add(RocksDbWeight::get().writes(10 as Weight)) .saturating_add(RocksDbWeight::get().writes(10 as Weight))
} }
fn maximal_increase_message_fee() -> Weight { fn maximal_increase_message_fee() -> Weight {
(3_081_804_000 as Weight) (2_539_209_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight))
} }
@@ -171,47 +173,47 @@ impl WeightInfo for () {
.saturating_add(RocksDbWeight::get().writes(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight))
} }
fn receive_single_message_proof() -> Weight { fn receive_single_message_proof() -> Weight {
(26_523_000 as Weight) (49_205_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight))
} }
fn receive_two_messages_proof() -> Weight { fn receive_two_messages_proof() -> Weight {
(39_278_000 as Weight) (62_182_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight))
} }
fn receive_single_message_proof_with_outbound_lane_state() -> Weight { fn receive_single_message_proof_with_outbound_lane_state() -> Weight {
(32_416_000 as Weight) (55_928_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight))
} }
fn receive_single_message_proof_1_kb() -> Weight { fn receive_single_message_proof_1_kb() -> Weight {
(27_078_000 as Weight) (47_298_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight))
} }
fn receive_single_message_proof_16_kb() -> Weight { fn receive_single_message_proof_16_kb() -> Weight {
(78_235_000 as Weight) (105_016_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight))
} }
fn receive_single_prepaid_message_proof() -> Weight { fn receive_single_prepaid_message_proof() -> Weight {
(27_635_000 as Weight) (49_067_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight))
} }
fn receive_delivery_proof_for_single_message() -> Weight { fn receive_delivery_proof_for_single_message() -> Weight {
(34_576_000 as Weight) (58_520_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight))
} }
fn receive_delivery_proof_for_two_messages_by_single_relayer() -> Weight { fn receive_delivery_proof_for_two_messages_by_single_relayer() -> Weight {
(37_318_000 as Weight) (61_563_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().reads(6 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight))
} }
fn receive_delivery_proof_for_two_messages_by_two_relayers() -> Weight { fn receive_delivery_proof_for_two_messages_by_two_relayers() -> Weight {
(41_245_000 as Weight) (63_197_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(7 as Weight)) .saturating_add(RocksDbWeight::get().reads(7 as Weight))
.saturating_add(RocksDbWeight::get().writes(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight))
} }
+1 -1
View File
@@ -392,7 +392,7 @@ impl WeightInfoExt for () {
} }
} }
impl<T: frame_system::Config> WeightInfoExt for crate::weights::MillauWeight<T> { impl<T: frame_system::Config> WeightInfoExt for crate::weights::BridgeWeight<T> {
fn expected_extra_storage_proof_size() -> u32 { fn expected_extra_storage_proof_size() -> u32 {
EXTRA_STORAGE_PROOF_SIZE EXTRA_STORAGE_PROOF_SIZE
} }
+12 -10
View File
@@ -17,7 +17,7 @@
//! Autogenerated weights for `pallet_bridge_parachains` //! Autogenerated weights for `pallet_bridge_parachains`
//! //!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-07-06, STEPS: 50, REPEAT: 20 //! DATE: 2022-10-04, STEPS: 50, REPEAT: 20
//! LOW RANGE: [], HIGH RANGE: [] //! LOW RANGE: [], HIGH RANGE: []
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled
//! CHAIN: Some("dev"), DB CACHE: 1024 //! CHAIN: Some("dev"), DB CACHE: 1024
@@ -55,23 +55,25 @@ pub trait WeightInfo {
fn submit_parachain_heads_with_16kb_proof() -> Weight; fn submit_parachain_heads_with_16kb_proof() -> Weight;
} }
/// Weights for `pallet_bridge_parachains` using the Millau node and recommended hardware. /// Weights for `pallet_bridge_parachains` that are generated using one of the Bridge testnets.
pub struct MillauWeight<T>(PhantomData<T>); ///
impl<T: frame_system::Config> WeightInfo for MillauWeight<T> { /// 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> {
fn submit_parachain_heads_with_n_parachains(p: u32) -> Weight { fn submit_parachain_heads_with_n_parachains(p: u32) -> Weight {
(0 as Weight) (0 as Weight)
.saturating_add((18_706_000 as Weight).saturating_mul(p as Weight)) .saturating_add((24_869_000 as Weight).saturating_mul(p as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(p as Weight))) .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(p as Weight)))
.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(p as Weight))) .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(p as Weight)))
} }
fn submit_parachain_heads_with_1kb_proof() -> Weight { fn submit_parachain_heads_with_1kb_proof() -> Weight {
(27_549_000 as Weight) (56_262_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight))
} }
fn submit_parachain_heads_with_16kb_proof() -> Weight { fn submit_parachain_heads_with_16kb_proof() -> Weight {
(80_792_000 as Weight) (105_189_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight))
} }
@@ -81,18 +83,18 @@ impl<T: frame_system::Config> WeightInfo for MillauWeight<T> {
impl WeightInfo for () { impl WeightInfo for () {
fn submit_parachain_heads_with_n_parachains(p: u32) -> Weight { fn submit_parachain_heads_with_n_parachains(p: u32) -> Weight {
(0 as Weight) (0 as Weight)
.saturating_add((18_706_000 as Weight).saturating_mul(p as Weight)) .saturating_add((24_869_000 as Weight).saturating_mul(p as Weight))
.saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(p as Weight))) .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(p as Weight)))
.saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(p as Weight))) .saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(p as Weight)))
} }
fn submit_parachain_heads_with_1kb_proof() -> Weight { fn submit_parachain_heads_with_1kb_proof() -> Weight {
(27_549_000 as Weight) (56_262_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight))
} }
fn submit_parachain_heads_with_16kb_proof() -> Weight { fn submit_parachain_heads_with_16kb_proof() -> Weight {
(80_792_000 as Weight) (105_189_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight))
} }
@@ -16,7 +16,7 @@
//! Weight-related utilities. //! Weight-related utilities.
use crate::weights::{MillauWeight, WeightInfo}; use crate::weights::{BridgeWeight, WeightInfo};
use bp_runtime::Size; use bp_runtime::Size;
use frame_support::weights::{RuntimeDbWeight, Weight}; use frame_support::weights::{RuntimeDbWeight, Weight};
@@ -101,7 +101,7 @@ impl WeightInfoExt for () {
} }
} }
impl<T: frame_system::Config> WeightInfoExt for MillauWeight<T> { impl<T: frame_system::Config> WeightInfoExt for BridgeWeight<T> {
fn expected_extra_storage_proof_size() -> u32 { fn expected_extra_storage_proof_size() -> u32 {
EXTRA_STORAGE_PROOF_SIZE EXTRA_STORAGE_PROOF_SIZE
} }
+8 -6
View File
@@ -17,7 +17,7 @@
//! Autogenerated weights for `pallet_bridge_relayers` //! Autogenerated weights for `pallet_bridge_relayers`
//! //!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-07-20, STEPS: 50, REPEAT: 20 //! DATE: 2022-10-04, STEPS: 50, REPEAT: 20
//! LOW RANGE: [], HIGH RANGE: [] //! LOW RANGE: [], HIGH RANGE: []
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled
//! CHAIN: Some("dev"), DB CACHE: 1024 //! CHAIN: Some("dev"), DB CACHE: 1024
@@ -53,11 +53,13 @@ pub trait WeightInfo {
fn claim_rewards() -> Weight; fn claim_rewards() -> Weight;
} }
/// Weights for `pallet_bridge_relayers` using the Millau node and recommended hardware. /// Weights for `pallet_bridge_relayers` that are generated using one of the Bridge testnets.
pub struct MillauWeight<T>(PhantomData<T>); ///
impl<T: frame_system::Config> WeightInfo for MillauWeight<T> { /// 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> {
fn claim_rewards() -> Weight { fn claim_rewards() -> Weight {
(38_435_000 as Weight) (55_856_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight))
} }
@@ -66,7 +68,7 @@ impl<T: frame_system::Config> WeightInfo for MillauWeight<T> {
// For backwards compatibility and tests // For backwards compatibility and tests
impl WeightInfo for () { impl WeightInfo for () {
fn claim_rewards() -> Weight { fn claim_rewards() -> Weight {
(38_435_000 as Weight) (55_856_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight))
} }
@@ -484,7 +484,7 @@ mod tests {
use bp_runtime::Chain; use bp_runtime::Chain;
type RialtoToMillauMessagesWeights = type RialtoToMillauMessagesWeights =
pallet_bridge_messages::weights::MillauWeight<rialto_runtime::Runtime>; pallet_bridge_messages::weights::BridgeWeight<rialto_runtime::Runtime>;
#[test] #[test]
fn select_delivery_transaction_limits_works() { fn select_delivery_transaction_limits_works() {