Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Renames
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez committed Jan 17, 2023
commit 09989f4c3770fdf3a4ffaa6d70fc8ce84182179a
4 changes: 2 additions & 2 deletions frame/system/src/limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ impl BlockWeights {
weights.max_extrinsic,
max_for_class.saturating_sub(base_for_class),
);
// Max extrinsic should have a value for each component.
// Max extrinsic must non be zero in any component.
error_assert!(
!weights.max_extrinsic.is_nothing(),
weights.max_extrinsic.all_gt(&Weight::zero()),
&mut error,
"[{:?}] {:?} (max_extrinsic) must not be 0. Check base cost and average initialization cost.",
class, weights.max_extrinsic,
Expand Down
6 changes: 2 additions & 4 deletions frame/transaction-payment/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,8 @@ where

let weights = T::BlockWeights::get();
// the computed ratio is only among the normal class.
let normal_max_weight = weights
.get(DispatchClass::Normal)
.max_total
.chromatic_limited_or(weights.max_block);
let normal_max_weight =
weights.get(DispatchClass::Normal).max_total.limited_or(weights.max_block);
let current_block_weight = <frame_system::Pallet<T>>::block_weight();
let normal_block_weight =
current_block_weight.get(DispatchClass::Normal).min(normal_max_weight);
Expand Down