-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Deprecate Weight::from_{ref_time, proof_size}
#13475
Conversation
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
bot bench $ pallet dev pallet_balances |
@ggwpez https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2453130 was started for your command Comment |
@ggwpez Command |
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
{{#each benchmark.component_weight as |cw|}} | ||
// Standard Error: {{underscore cw.error}} | ||
.saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into())) | ||
.saturating_add(Weight::from_parts({{underscore cw.slope}}, 0).saturating_mul({{cw.name}}.into())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we ever using 0 for proof size?
@@ -72,7 +71,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { | |||
.saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into()))) | |||
{{/each}} | |||
{{#each benchmark.component_calculated_proof_size as |cp|}} | |||
.saturating_add(Weight::from_proof_size({{cp.slope}}).saturating_mul({{cp.name}}.into())) | |||
.saturating_add(Weight::from_parts(0, {{cp.slope}}).saturating_mul({{cp.name}}.into())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same - why 0 for ref time?
frame/assets/src/weights.rs
Outdated
.saturating_add(Weight::from_parts(13_799_167, 0).saturating_mul(c.into())) | ||
.saturating_add(T::DbWeight::get().reads(2_u64)) | ||
.saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(c.into()))) | ||
.saturating_add(T::DbWeight::get().writes(1_u64)) | ||
.saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(c.into()))) | ||
.saturating_add(Weight::from_proof_size(5180).saturating_mul(c.into())) | ||
.saturating_add(Weight::from_parts(0, 5180).saturating_mul(c.into())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do these two not just get combined into a single from_parts
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The template is a bit inflexible right now, I can try but it will not look much better. Having these written as a term is very poor choice in retrospect.
Something data-based would be better like https://github.com/paritytech/substrate/issues/12580#issuecomment-1304662025
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
bot merge |
* Deprecate Weight::from_{ref_time, proof_size} Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update templates Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use from_parts Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use from_parts Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Dont revert comment 🤦 Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_balances * Update weight files Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * More fixes Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Adapt to Master changes Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: command-bot <>
* polkadot update to v0.9.42 * remove deprecated trait Store uses See paritytech/substrate#13535 * remove deprecated Weight::from_{ref_time, proof_size} See paritytech/substrate#13475 * allowlist one constant weight See paritytech/substrate#13798 * add new trait associated types * polkadot update to v0.9.42 (xcm) * fixup! remove deprecated trait Store uses * teerex/mock: add missing trait imports * claims/tests: fix benchmark as described in substrate/12951 See: paritytech/substrate#12951 * claims/tests: fix claiming_while_vested_doesnt_work by giving it the existential deposit (ED) Co-authored-by: coax1d <andrewburger1991@gmail.com> --------- Co-authored-by: coax1d <andrewburger1991@gmail.com>
* Deprecate Weight::from_{ref_time, proof_size} Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update templates Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use from_parts Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use from_parts Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Dont revert comment 🤦 Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_balances * Update weight files Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * More fixes Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Adapt to Master changes Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: command-bot <>
Changes:
Weight::from_ref_time
andWeight::from_proof_size
and usefrom_parts
insteadTODO:
Polkadot companion: paritytech/polkadot#6794
Cumulus companion: paritytech/cumulus#2245
Migration script for down-stream projects: migrate-from-parts.py.