mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 10:31:04 +00:00
Add storage size component to weights (#12277)
* Add storage size component to weights * Rename storage_size to proof_size * Update primitives/weights/src/weight_v2.rs Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fixes * cargo fmt * Implement custom Decode and CompactAs * Add missing import * Fixes * Remove CompactAs implementation * Properly migrate from 1D weight * Remove #[pallet::compact] from Weight parameters * More #[pallet::compact] removals * Add unit tests * Set appropriate default block proof size * cargo fmt * Remove nonsensical weight constant * Test only for the reference time weight in frame_system::limits * Only check for reference time weight on idle * Use destructuring syntax * Update test expectations * Fixes * Fixes * Fixes * Correctly migrate from 1D weights * cargo fmt * Migrate using extra extrinsics instead of custom Decode * Fixes * Silence dispatch call warnings that were previously allowed * Fix gas_left test * Use OldWeight instead of u64 * Fixes * Only check for reference time weight in election provider * Fix test expectations * Fix test expectations * Use only reference time weight in grandpa test * Use only reference time weight in examples test * Use only reference time weight in examples test * Fix test expectations Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Alexander Theißen <alex.theissen@me.com>
This commit is contained in:
@@ -459,7 +459,8 @@ where
|
||||
let max_weight = <System::BlockWeights as frame_support::traits::Get<_>>::get().max_block;
|
||||
let remaining_weight = max_weight.saturating_sub(weight.total());
|
||||
|
||||
if remaining_weight.all_gt(Weight::zero()) {
|
||||
// TODO: account for proof size weight
|
||||
if remaining_weight.ref_time() > 0 {
|
||||
let used_weight = <AllPalletsWithSystem as OnIdle<System::BlockNumber>>::on_idle(
|
||||
block_number,
|
||||
remaining_weight,
|
||||
@@ -938,13 +939,13 @@ mod tests {
|
||||
block_import_works_inner(
|
||||
new_test_ext_v0(1),
|
||||
array_bytes::hex_n_into_unchecked(
|
||||
"1039e1a4bd0cf5deefe65f313577e70169c41c7773d6acf31ca8d671397559f5",
|
||||
"0d786e24c1f9e6ce237806a22c005bbbc7dee4edd6692b6c5442843d164392de",
|
||||
),
|
||||
);
|
||||
block_import_works_inner(
|
||||
new_test_ext(1),
|
||||
array_bytes::hex_n_into_unchecked(
|
||||
"75e7d8f360d375bbe91bcf8019c01ab6362448b4a89e3b329717eb9d910340e5",
|
||||
"348485a4ab856467b440167e45f99b491385e8528e09b0e51f85f814a3021c93",
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user