mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 16:21:02 +00:00
Companion for Weight v1.5 Follow Up (#5949)
* updates
* remove new
* fix up some stuff
* fix cargo files
* fix
* fix template
* update lockfile for {"substrate"}
* Update block_weights.rs
* remove unused
* remove unused
Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -285,7 +285,7 @@ impl<BlockNumber: Default + From<u32>> Default for HostConfiguration<BlockNumber
|
||||
hrmp_max_parachain_outbound_channels: Default::default(),
|
||||
hrmp_max_parathread_outbound_channels: Default::default(),
|
||||
hrmp_max_message_num_per_candidate: Default::default(),
|
||||
ump_max_individual_weight: 20 * WEIGHT_PER_MILLIS,
|
||||
ump_max_individual_weight: 20u64 * WEIGHT_PER_MILLIS,
|
||||
pvf_checking_enabled: false,
|
||||
pvf_voting_ttl: 2u32.into(),
|
||||
minimum_validation_upgrade_delay: 2.into(),
|
||||
|
||||
@@ -797,7 +797,7 @@ impl<T: Config> Pallet<T> {
|
||||
pub(crate) fn initializer_initialize(now: T::BlockNumber) -> Weight {
|
||||
let config = <configuration::Pallet<T>>::config();
|
||||
|
||||
let mut weight = Weight::new();
|
||||
let mut weight = Weight::zero();
|
||||
for (session_index, candidate_hash, mut dispute) in <Disputes<T>>::iter() {
|
||||
weight += T::DbWeight::get().reads_writes(1, 0);
|
||||
|
||||
|
||||
@@ -953,7 +953,7 @@ impl<T: Config> Pallet<T> {
|
||||
}
|
||||
|
||||
pub(crate) fn prune_hrmp(recipient: ParaId, new_hrmp_watermark: T::BlockNumber) -> Weight {
|
||||
let mut weight = Weight::new();
|
||||
let mut weight = Weight::zero();
|
||||
|
||||
// sift through the incoming messages digest to collect the paras that sent at least one
|
||||
// message to this parachain between the old and new watermarks.
|
||||
@@ -1020,7 +1020,7 @@ impl<T: Config> Pallet<T> {
|
||||
sender: ParaId,
|
||||
out_hrmp_msgs: Vec<OutboundHrmpMessage<ParaId>>,
|
||||
) -> Weight {
|
||||
let mut weight = Weight::new();
|
||||
let mut weight = Weight::zero();
|
||||
let now = <frame_system::Pallet<T>>::block_number();
|
||||
|
||||
for out_msg in out_hrmp_msgs {
|
||||
|
||||
@@ -222,7 +222,7 @@ impl crate::paras::Config for Test {
|
||||
impl crate::dmp::Config for Test {}
|
||||
|
||||
parameter_types! {
|
||||
pub const FirstMessageFactorPercent: Weight = Weight::from_ref_time(100);
|
||||
pub const FirstMessageFactorPercent: u64 = 100;
|
||||
}
|
||||
|
||||
impl crate::ump::Config for Test {
|
||||
|
||||
@@ -449,7 +449,7 @@ impl WeightInfo for TestWeightInfo {
|
||||
}
|
||||
fn include_pvf_check_statement() -> Weight {
|
||||
// This special value is to distinguish from the finalizing variants above in tests.
|
||||
Weight::MAX - Weight::one()
|
||||
Weight::MAX - Weight::from_ref_time(1)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1372,7 +1372,7 @@ impl<T: Config> Pallet<T> {
|
||||
sessions_observed: SessionIndex,
|
||||
cfg: &configuration::HostConfiguration<T::BlockNumber>,
|
||||
) -> Weight {
|
||||
let mut weight = Weight::new();
|
||||
let mut weight = Weight::zero();
|
||||
for cause in causes {
|
||||
weight += T::DbWeight::get().reads_writes(3, 2);
|
||||
Self::deposit_event(Event::PvfCheckAccepted(*code_hash, cause.para_id()));
|
||||
@@ -1417,7 +1417,7 @@ impl<T: Config> Pallet<T> {
|
||||
relay_parent_number: T::BlockNumber,
|
||||
cfg: &configuration::HostConfiguration<T::BlockNumber>,
|
||||
) -> Weight {
|
||||
let mut weight = Weight::new();
|
||||
let mut weight = Weight::zero();
|
||||
|
||||
// Compute the relay-chain block number starting at which the code upgrade is ready to be
|
||||
// applied.
|
||||
@@ -1457,7 +1457,7 @@ impl<T: Config> Pallet<T> {
|
||||
code_hash: &ValidationCodeHash,
|
||||
causes: Vec<PvfCheckCause<T::BlockNumber>>,
|
||||
) -> Weight {
|
||||
let mut weight = Weight::new();
|
||||
let mut weight = Weight::zero();
|
||||
|
||||
for cause in causes {
|
||||
// Whenever PVF pre-checking is started or a new cause is added to it, the RC is bumped.
|
||||
@@ -1746,7 +1746,7 @@ impl<T: Config> Pallet<T> {
|
||||
code: ValidationCode,
|
||||
cfg: &configuration::HostConfiguration<T::BlockNumber>,
|
||||
) -> Weight {
|
||||
let mut weight = Weight::new();
|
||||
let mut weight = Weight::zero();
|
||||
|
||||
weight += T::DbWeight::get().reads_writes(3, 2);
|
||||
Self::deposit_event(Event::PvfCheckStarted(code_hash, cause.para_id()));
|
||||
|
||||
@@ -99,12 +99,12 @@ pub fn multi_dispute_statement_sets_weight<
|
||||
.as_ref()
|
||||
.iter()
|
||||
.map(|d| dispute_statement_set_weight::<T, &S>(d))
|
||||
.fold(Weight::new(), |acc_weight, weight| acc_weight.saturating_add(weight))
|
||||
.fold(Weight::zero(), |acc_weight, weight| acc_weight.saturating_add(weight))
|
||||
}
|
||||
|
||||
pub fn signed_bitfields_weight<T: Config>(bitfields_len: usize) -> Weight {
|
||||
<<T as Config>::WeightInfo as WeightInfo>::enter_bitfields()
|
||||
.saturating_mul(Weight::from_ref_time(bitfields_len as u64))
|
||||
.saturating_mul(bitfields_len as u64)
|
||||
}
|
||||
|
||||
pub fn backed_candidate_weight<T: frame_system::Config + Config>(
|
||||
@@ -125,5 +125,5 @@ pub fn backed_candidates_weight<T: frame_system::Config + Config>(
|
||||
candidates
|
||||
.iter()
|
||||
.map(|c| backed_candidate_weight::<T>(c))
|
||||
.fold(Weight::new(), |acc, x| acc.saturating_add(x))
|
||||
.fold(Weight::zero(), |acc, x| acc.saturating_add(x))
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ pub mod pallet {
|
||||
/// stalls the queue in doing so. More than 100 will provide additional weight for the first message only.
|
||||
///
|
||||
/// Generally you'll want this to be a bit more - 150 or 200 would be good values.
|
||||
type FirstMessageFactorPercent: Get<Weight>;
|
||||
type FirstMessageFactorPercent: Get<u64>;
|
||||
|
||||
/// Origin which is allowed to execute overweight messages.
|
||||
type ExecuteOverweightOrigin: EnsureOrigin<Self::Origin>;
|
||||
@@ -387,7 +387,7 @@ impl<T: Config> Pallet<T> {
|
||||
/// Iterate over all paras that were noted for offboarding and remove all the data
|
||||
/// associated with them.
|
||||
fn perform_outgoing_para_cleanup(outgoing: &[ParaId]) -> Weight {
|
||||
let mut weight: Weight = Weight::new();
|
||||
let mut weight: Weight = Weight::zero();
|
||||
for outgoing_para in outgoing {
|
||||
weight = weight.saturating_add(Self::clean_ump_after_outgoing(outgoing_para));
|
||||
}
|
||||
@@ -469,7 +469,7 @@ impl<T: Config> Pallet<T> {
|
||||
para: ParaId,
|
||||
upward_messages: Vec<UpwardMessage>,
|
||||
) -> Weight {
|
||||
let mut weight = Weight::new();
|
||||
let mut weight = Weight::zero();
|
||||
|
||||
if !upward_messages.is_empty() {
|
||||
let (extra_count, extra_size) = upward_messages
|
||||
@@ -505,7 +505,7 @@ impl<T: Config> Pallet<T> {
|
||||
|
||||
/// Devote some time into dispatching pending upward messages.
|
||||
pub(crate) fn process_pending_upward_messages() -> Weight {
|
||||
let mut weight_used = Weight::new();
|
||||
let mut weight_used = Weight::zero();
|
||||
|
||||
let config = <configuration::Pallet<T>>::config();
|
||||
let mut cursor = NeedsDispatchCursor::new::<T>();
|
||||
|
||||
Reference in New Issue
Block a user