Skip to content

Commit a091b84

Browse files
svyatonikbkchr
authored andcommitted
Update Substrate/Polkadot/Cumulus dependencies + weights v2 (#1850)
* cargo update * weights v2 * clippy * no spellcheck for weights.rs * fix proof_size component in MAXIMUM_BLOCK_WEIGHT constants * "fix" proof_size in select_delivery_transaction_limits_works * spellcheck
1 parent 14b6e13 commit a091b84

File tree

19 files changed

+807
-133
lines changed

19 files changed

+807
-133
lines changed

bridges/bin/millau/node/src/chain_spec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ fn testnet_genesis(
202202
balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 50)).collect(),
203203
},
204204
aura: AuraConfig { authorities: Vec::new() },
205-
beefy: BeefyConfig { authorities: Vec::new() },
205+
beefy: BeefyConfig { authorities: Vec::new(), genesis_block: Some(0) },
206206
grandpa: GrandpaConfig { authorities: Vec::new() },
207207
sudo: SudoConfig { key: Some(root_key) },
208208
session: SessionConfig {

bridges/bin/millau/node/src/cli.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pub struct Cli {
2828

2929
/// Possible subcommands of the main binary.
3030
#[derive(Debug, Parser)]
31+
#[allow(clippy::large_enum_variant)]
3132
pub enum Subcommand {
3233
/// Key management CLI utilities
3334
#[clap(subcommand)]

bridges/bin/millau/node/src/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub fn new_partial(
125125

126126
let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import(
127127
client.clone(),
128-
&(client.clone() as Arc<_>),
128+
&client,
129129
select_chain.clone(),
130130
telemetry.as_ref().map(|x| x.handle()),
131131
)?;

bridges/bin/millau/runtime/src/lib.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ pub use frame_support::{
6161
construct_runtime,
6262
dispatch::DispatchClass,
6363
parameter_types,
64-
traits::{ConstU32, ConstU8, Currency, ExistenceRequirement, Imbalance, KeyOwnerProofSystem},
64+
traits::{
65+
ConstU32, ConstU64, ConstU8, Currency, ExistenceRequirement, Imbalance, KeyOwnerProofSystem,
66+
},
6567
weights::{
6668
constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, IdentityFee, RuntimeDbWeight,
6769
Weight,
@@ -240,6 +242,7 @@ impl pallet_grandpa::Config for Runtime {
240242
// TODO: update me (https://github.com/paritytech/parity-bridges-common/issues/78)
241243
type WeightInfo = ();
242244
type MaxAuthorities = ConstU32<10>;
245+
type MaxSetIdSessionEntries = ConstU64<0>;
243246
}
244247

245248
/// MMR helper types.
@@ -752,6 +755,12 @@ impl_runtime_apis! {
752755
fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {
753756
TransactionPayment::query_fee_details(uxt, len)
754757
}
758+
fn query_weight_to_fee(weight: Weight) -> Balance {
759+
TransactionPayment::weight_to_fee(weight)
760+
}
761+
fn query_length_to_fee(length: u32) -> Balance {
762+
TransactionPayment::length_to_fee(length)
763+
}
755764
}
756765

757766
impl sp_session::SessionKeys<Block> for Runtime {
@@ -767,6 +776,10 @@ impl_runtime_apis! {
767776
}
768777

769778
impl sp_beefy::BeefyApi<Block> for Runtime {
779+
fn beefy_genesis() -> Option<BlockNumber> {
780+
Beefy::genesis_block()
781+
}
782+
770783
fn validator_set() -> Option<ValidatorSet<BeefyId>> {
771784
Beefy::validator_set()
772785
}

bridges/bin/rialto-parachain/runtime/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,12 @@ impl_runtime_apis! {
735735
) -> pallet_transaction_payment::FeeDetails<Balance> {
736736
TransactionPayment::query_fee_details(uxt, len)
737737
}
738+
fn query_weight_to_fee(weight: Weight) -> Balance {
739+
TransactionPayment::weight_to_fee(weight)
740+
}
741+
fn query_length_to_fee(length: u32) -> Balance {
742+
TransactionPayment::length_to_fee(length)
743+
}
738744
}
739745

740746
impl bp_millau::MillauFinalityApi<Block> for Runtime {

bridges/bin/rialto/node/src/chain_spec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ fn testnet_genesis(
213213
authorities: Vec::new(),
214214
epoch_config: Some(rialto_runtime::BABE_GENESIS_EPOCH_CONFIG),
215215
},
216-
beefy: BeefyConfig { authorities: Vec::new() },
216+
beefy: BeefyConfig { authorities: Vec::new(), genesis_block: Some(0) },
217217
grandpa: GrandpaConfig { authorities: Vec::new() },
218218
sudo: SudoConfig { key: Some(root_key) },
219219
session: SessionConfig {

bridges/bin/rialto/node/src/cli.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pub struct Cli {
2828

2929
/// Possible subcommands of the main binary.
3030
#[derive(Debug, Parser)]
31+
#[allow(clippy::large_enum_variant)]
3132
pub enum Subcommand {
3233
/// Key management CLI utilities
3334
#[clap(subcommand)]

bridges/bin/rialto/runtime/src/lib.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ pub use frame_support::{
5757
construct_runtime,
5858
dispatch::DispatchClass,
5959
parameter_types,
60-
traits::{ConstU32, ConstU8, Currency, ExistenceRequirement, Imbalance, KeyOwnerProofSystem},
60+
traits::{
61+
ConstU32, ConstU64, ConstU8, Currency, ExistenceRequirement, Imbalance, KeyOwnerProofSystem,
62+
},
6163
weights::{constants::WEIGHT_REF_TIME_PER_SECOND, IdentityFee, RuntimeDbWeight, Weight},
6264
StorageValue,
6365
};
@@ -263,6 +265,7 @@ impl pallet_grandpa::Config for Runtime {
263265
type HandleEquivocation = ();
264266
// TODO: update me (https://github.com/paritytech/parity-bridges-common/issues/78)
265267
type WeightInfo = ();
268+
type MaxSetIdSessionEntries = ConstU64<0>;
266269
}
267270

268271
impl pallet_mmr::Config for Runtime {
@@ -626,6 +629,10 @@ impl_runtime_apis! {
626629
}
627630

628631
impl sp_beefy::BeefyApi<Block> for Runtime {
632+
fn beefy_genesis() -> Option<BlockNumber> {
633+
Beefy::genesis_block()
634+
}
635+
629636
fn validator_set() -> Option<ValidatorSet<BeefyId>> {
630637
Beefy::validator_set()
631638
}
@@ -864,6 +871,12 @@ impl_runtime_apis! {
864871
fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {
865872
TransactionPayment::query_fee_details(uxt, len)
866873
}
874+
fn query_weight_to_fee(weight: Weight) -> Balance {
875+
TransactionPayment::weight_to_fee(weight)
876+
}
877+
fn query_length_to_fee(length: u32) -> Balance {
878+
TransactionPayment::length_to_fee(length)
879+
}
867880
}
868881

869882
impl sp_session::SessionKeys<Block> for Runtime {

bridges/modules/grandpa/src/weights.rs

Lines changed: 104 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
1616

17-
//! Autogenerated weights for `pallet_bridge_grandpa`
17+
//! Autogenerated weights for pallet_bridge_grandpa
1818
//!
1919
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
20-
//! DATE: 2022-12-21, STEPS: 50, REPEAT: 20
21-
//! LOW RANGE: [], HIGH RANGE: []
22-
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled
23-
//! CHAIN: Some("dev"), DB CACHE: 1024
20+
//! DATE: 2023-02-06, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
21+
//! WORST CASE MAP SIZE: `1000000`
22+
//! HOSTNAME: `covid`, CPU: `11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz`
23+
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
2424
2525
// Executed Command:
2626
// target/release/millau-bridge-node
@@ -48,7 +48,7 @@ use frame_support::{
4848
};
4949
use sp_std::marker::PhantomData;
5050

51-
/// Weight functions needed for `pallet_bridge_grandpa`.
51+
/// Weight functions needed for pallet_bridge_grandpa.
5252
pub trait WeightInfo {
5353
fn submit_finality_proof(p: u32, v: u32) -> Weight;
5454
}
@@ -58,22 +58,110 @@ pub trait WeightInfo {
5858
/// Those weights are test only and must never be used in production.
5959
pub struct BridgeWeight<T>(PhantomData<T>);
6060
impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
61+
/// Storage: BridgeRialtoGrandpa PalletOperatingMode (r:1 w:0)
62+
///
63+
/// Proof: BridgeRialtoGrandpa PalletOperatingMode (max_values: Some(1), max_size: Some(1),
64+
/// added: 496, mode: MaxEncodedLen)
65+
///
66+
/// Storage: BridgeRialtoGrandpa RequestCount (r:1 w:1)
67+
///
68+
/// Proof: BridgeRialtoGrandpa RequestCount (max_values: Some(1), max_size: Some(4), added: 499,
69+
/// mode: MaxEncodedLen)
70+
///
71+
/// Storage: BridgeRialtoGrandpa BestFinalized (r:1 w:1)
72+
///
73+
/// Proof: BridgeRialtoGrandpa BestFinalized (max_values: Some(1), max_size: Some(36), added:
74+
/// 531, mode: MaxEncodedLen)
75+
///
76+
/// Storage: BridgeRialtoGrandpa CurrentAuthoritySet (r:1 w:0)
77+
///
78+
/// Proof: BridgeRialtoGrandpa CurrentAuthoritySet (max_values: Some(1), max_size: Some(40970),
79+
/// added: 41465, mode: MaxEncodedLen)
80+
///
81+
/// Storage: BridgeRialtoGrandpa ImportedHashesPointer (r:1 w:1)
82+
///
83+
/// Proof: BridgeRialtoGrandpa ImportedHashesPointer (max_values: Some(1), max_size: Some(4),
84+
/// added: 499, mode: MaxEncodedLen)
85+
///
86+
/// Storage: BridgeRialtoGrandpa ImportedHashes (r:1 w:1)
87+
///
88+
/// Proof: BridgeRialtoGrandpa ImportedHashes (max_values: None, max_size: Some(36), added:
89+
/// 2511, mode: MaxEncodedLen)
90+
///
91+
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:0 w:2)
92+
///
93+
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: None, max_size: Some(68), added:
94+
/// 2543, mode: MaxEncodedLen)
95+
///
96+
/// The range of component `p` is `[51, 102]`.
97+
///
98+
/// The range of component `v` is `[50, 100]`.
6199
fn submit_finality_proof(p: u32, v: u32) -> Weight {
62-
Weight::from_ref_time(192_130_822 as u64)
63-
.saturating_add(Weight::from_ref_time(39_781_096 as u64).saturating_mul(p as u64))
64-
.saturating_add(Weight::from_ref_time(1_365_108 as u64).saturating_mul(v as u64))
65-
.saturating_add(T::DbWeight::get().reads(6 as u64))
66-
.saturating_add(T::DbWeight::get().writes(6 as u64))
100+
// Proof Size summary in bytes:
101+
// Measured: `2524 + p * (40 ±0)`
102+
// Estimated: `46001`
103+
// Minimum execution time: 2_282_140 nanoseconds.
104+
Weight::from_parts(142_496_714, 46001)
105+
// Standard Error: 32_796
106+
.saturating_add(Weight::from_ref_time(40_232_935).saturating_mul(p.into()))
107+
// Standard Error: 33_574
108+
.saturating_add(Weight::from_ref_time(1_185_407).saturating_mul(v.into()))
109+
.saturating_add(T::DbWeight::get().reads(6_u64))
110+
.saturating_add(T::DbWeight::get().writes(6_u64))
67111
}
68112
}
69113

70114
// For backwards compatibility and tests
71115
impl WeightInfo for () {
116+
/// Storage: BridgeRialtoGrandpa PalletOperatingMode (r:1 w:0)
117+
///
118+
/// Proof: BridgeRialtoGrandpa PalletOperatingMode (max_values: Some(1), max_size: Some(1),
119+
/// added: 496, mode: MaxEncodedLen)
120+
///
121+
/// Storage: BridgeRialtoGrandpa RequestCount (r:1 w:1)
122+
///
123+
/// Proof: BridgeRialtoGrandpa RequestCount (max_values: Some(1), max_size: Some(4), added: 499,
124+
/// mode: MaxEncodedLen)
125+
///
126+
/// Storage: BridgeRialtoGrandpa BestFinalized (r:1 w:1)
127+
///
128+
/// Proof: BridgeRialtoGrandpa BestFinalized (max_values: Some(1), max_size: Some(36), added:
129+
/// 531, mode: MaxEncodedLen)
130+
///
131+
/// Storage: BridgeRialtoGrandpa CurrentAuthoritySet (r:1 w:0)
132+
///
133+
/// Proof: BridgeRialtoGrandpa CurrentAuthoritySet (max_values: Some(1), max_size: Some(40970),
134+
/// added: 41465, mode: MaxEncodedLen)
135+
///
136+
/// Storage: BridgeRialtoGrandpa ImportedHashesPointer (r:1 w:1)
137+
///
138+
/// Proof: BridgeRialtoGrandpa ImportedHashesPointer (max_values: Some(1), max_size: Some(4),
139+
/// added: 499, mode: MaxEncodedLen)
140+
///
141+
/// Storage: BridgeRialtoGrandpa ImportedHashes (r:1 w:1)
142+
///
143+
/// Proof: BridgeRialtoGrandpa ImportedHashes (max_values: None, max_size: Some(36), added:
144+
/// 2511, mode: MaxEncodedLen)
145+
///
146+
/// Storage: BridgeRialtoGrandpa ImportedHeaders (r:0 w:2)
147+
///
148+
/// Proof: BridgeRialtoGrandpa ImportedHeaders (max_values: None, max_size: Some(68), added:
149+
/// 2543, mode: MaxEncodedLen)
150+
///
151+
/// The range of component `p` is `[51, 102]`.
152+
///
153+
/// The range of component `v` is `[50, 100]`.
72154
fn submit_finality_proof(p: u32, v: u32) -> Weight {
73-
Weight::from_ref_time(192_130_822 as u64)
74-
.saturating_add(Weight::from_ref_time(39_781_096 as u64).saturating_mul(p as u64))
75-
.saturating_add(Weight::from_ref_time(1_365_108 as u64).saturating_mul(v as u64))
76-
.saturating_add(RocksDbWeight::get().reads(6 as u64))
77-
.saturating_add(RocksDbWeight::get().writes(6 as u64))
155+
// Proof Size summary in bytes:
156+
// Measured: `2524 + p * (40 ±0)`
157+
// Estimated: `46001`
158+
// Minimum execution time: 2_282_140 nanoseconds.
159+
Weight::from_parts(142_496_714, 46001)
160+
// Standard Error: 32_796
161+
.saturating_add(Weight::from_ref_time(40_232_935).saturating_mul(p.into()))
162+
// Standard Error: 33_574
163+
.saturating_add(Weight::from_ref_time(1_185_407).saturating_mul(v.into()))
164+
.saturating_add(RocksDbWeight::get().reads(6_u64))
165+
.saturating_add(RocksDbWeight::get().writes(6_u64))
78166
}
79167
}

0 commit comments

Comments
 (0)