Skip to content

Commit

Permalink
fix pre-dispatch PoV underweight for ParasInherent (#7378)
Browse files Browse the repository at this point in the history
This should fix the error log related to PoV pre-dispatch weight being
lower than post-dispatch for `ParasInherent`:
```
ERROR tokio-runtime-worker runtime::frame-support: Post dispatch weight is greater than pre dispatch weight. Pre dispatch weight may underestimating the actual weight. Greater post dispatch weight components are ignored.
                                        Pre dispatch weight: Weight { ref_time: 47793353978, proof_size: 1019 },
                                        Post dispatch weight: Weight { ref_time: 5030321719, proof_size: 135395 }
```

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and Ank4n committed Feb 6, 2025
1 parent 1f7c73b commit cc0fdde
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
7 changes: 5 additions & 2 deletions polkadot/runtime/parachains/src/paras_inherent/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,13 @@ pub fn paras_inherent_total_weight<T: Config>(
bitfields: &UncheckedSignedAvailabilityBitfields,
disputes: &MultiDisputeStatementSet,
) -> Weight {
backed_candidates_weight::<T>(backed_candidates)
let weight = backed_candidates_weight::<T>(backed_candidates)
.saturating_add(signed_bitfields_weight::<T>(bitfields))
.saturating_add(multi_dispute_statement_sets_weight::<T>(disputes))
.saturating_add(enact_candidates_max_weight::<T>(bitfields))
.saturating_add(enact_candidates_max_weight::<T>(bitfields));
// Relay chain blocks pre-dispatch weight can be set to any high enough value
// but the proof size is irrelevant for the relay chain either way.
weight.set_proof_size(u64::MAX)
}

pub fn multi_dispute_statement_sets_weight<T: Config>(
Expand Down
13 changes: 13 additions & 0 deletions prdoc/pr_7378.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
title: fix pre-dispatch PoV underweight for ParasInherent
doc:
- audience: Runtime Dev
description: |-
This should fix the error log related to PoV pre-dispatch weight being lower than post-dispatch for `ParasInherent`:
```
ERROR tokio-runtime-worker runtime::frame-support: Post dispatch weight is greater than pre dispatch weight. Pre dispatch weight may underestimating the actual weight. Greater post dispatch weight components are ignored.
Pre dispatch weight: Weight { ref_time: 47793353978, proof_size: 1019 },
Post dispatch weight: Weight { ref_time: 5030321719, proof_size: 135395 }
```
crates:
- name: polkadot-runtime-parachains
bump: patch

0 comments on commit cc0fdde

Please sign in to comment.