This repository has been 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.6k
Conversation
This file contains 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 <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>
github-actions
bot
added
the
A3-in_progress
Pull request is in progress. No review needed at this stage.
label
Jan 17, 2023
gavofyork
reviewed
Jan 17, 2023
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>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This is probably what we have to do for all runtimes. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
github-actions
bot
added
A0-please_review
Pull request needs code review.
and removed
A3-in_progress
Pull request is in progress. No review needed at this stage.
labels
Jan 18, 2023
ggwpez
added
A3-in_progress
Pull request is in progress. No review needed at this stage.
and removed
A0-please_review
Pull request needs code review.
labels
Jan 18, 2023
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>
ggwpez
commented
Jan 18, 2023
ggwpez
commented
Jan 18, 2023
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
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 | ||
} |
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.
ggwpez
added
A0-please_review
Pull request needs code review.
and removed
A3-in_progress
Pull request is in progress. No review needed at this stage.
labels
Jan 19, 2023
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
The CI pipeline was cancelled due to failure one of the required jobs. |
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
PovLimitExceeded
and print a warning if a block consumes more than 5 MiB of proof size.🚨 breaking changes:
WeightsPerClass
changed the type ofmax_extrinsic
,max_total
andreserved
fromOption<Weight>
toWeightLimit
.BlockWeights
thereby slightly changed fromOption<Weight>
toWeightLimit
.CheckWeight
signed extension consider optional weight limits.PerDispatchClass::
since the naming was off.add
renamed tosaturating_accrue
checked_add
renamed tochecked_accrue
sub
renamed tosaturating_reduce
Non breaking additions:
sp_weights::WeightLimit
which can be used to express an upper limit for the consumption of some weight.frame_system::SOFT_POV_LIMIT_BYTES
and 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_WEIGHT
from typeWeight
toWeightLimit
and 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.
expect
on 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:
WeightLimit
Polkadot companion: paritytech/polkadot#6580
Cumulus companion: paritytech/cumulus#2117