This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Optional PoV block limits #13164
Closed
Closed
Optional PoV block limits #13164
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
gavofyork
reviewed
Jan 17, 2023
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
This is probably what we have to do for all runtimes. Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
ggwpez
commented
Jan 18, 2023
ggwpez
commented
Jan 18, 2023
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
ggwpez
commented
Jan 19, 2023
Comment on lines
+440
to
+446
| // This is kind of a hack, but since the mandatory needs to happen *anyway*, we can | ||
| // exclude it from the regular `max_block`. The reason is that you normally want | ||
| // `unlimited` mandatory, which will always lead to a `max_block` of `(u64::MAX, | ||
| // u64::MAX)` as well. | ||
| if class == &DispatchClass::Mandatory { | ||
| continue | ||
| } |
Member
Author
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 compromise that i had to make.
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
|
The CI pipeline was cancelled due to failure one of the required jobs. |
Member
Author
|
Okay this is not really what we want.
|
1 task
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This MR makes it possible to have optional block weight limits for Ref Time and Proof Size.
Additionally to this it will emit a
PovLimitExceededand print a warning if a block consumes more than 5 MiB of proof size.🚨 breaking changes:
WeightsPerClasschanged the type ofmax_extrinsic,max_totalandreservedfromOption<Weight>toWeightLimit.BlockWeightsthereby slightly changed fromOption<Weight>toWeightLimit.CheckWeightsigned extension consider optional weight limits.PerDispatchClass::since the naming was off.addrenamed tosaturating_accruechecked_addrenamed tochecked_accruesubrenamed tosaturating_reduceNon breaking additions:
sp_weights::WeightLimitwhich can be used to express an upper limit for the consumption of some weight.frame_system::SOFT_POV_LIMIT_BYTESand Warning + Event for blocks that consume more weight.sp_weights::Weight::{from_all, without_ref_time, without_proof_size, saturating_reduce, checked_accrue, checked_reduce}Integration Guide (For all chains)
Change your
MAXIMUM_BLOCK_WEIGHTfrom typeWeighttoWeightLimitand use it in theBlockWeights::builder().The difference is here that before we had to use
u64::MAX, whereas now we can make it actually unlimited.Before and after example from the kitchensink of this MR:


And the block weight builder:
You can now also specify a soft PoV limit by calling
.pov_soft_limit(…)on the builder. Polkadot et al uses 5 MiB for this limit.Other errors can arise from testing code.
expecton the optional limits: Use.exact_limits().expect()instead.unwrap_or(Something)on on the optional limits: Use.limited_or(Something),.limited_or_max()or.limited_or_min()instead.TODO:
WeightLimitPolkadot companion: paritytech/polkadot#6580
Cumulus companion: paritytech/cumulus#2117