Skip to content

Commit 0d35be7

Browse files
fix pre-dispatch PoV underweight for ParasInherent (#7378)
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>
1 parent 48f69cc commit 0d35be7

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

polkadot/runtime/parachains/src/paras_inherent/weights.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,13 @@ pub fn paras_inherent_total_weight<T: Config>(
9494
bitfields: &UncheckedSignedAvailabilityBitfields,
9595
disputes: &MultiDisputeStatementSet,
9696
) -> Weight {
97-
backed_candidates_weight::<T>(backed_candidates)
97+
let weight = backed_candidates_weight::<T>(backed_candidates)
9898
.saturating_add(signed_bitfields_weight::<T>(bitfields))
9999
.saturating_add(multi_dispute_statement_sets_weight::<T>(disputes))
100-
.saturating_add(enact_candidates_max_weight::<T>(bitfields))
100+
.saturating_add(enact_candidates_max_weight::<T>(bitfields));
101+
// Relay chain blocks pre-dispatch weight can be set to any high enough value
102+
// but the proof size is irrelevant for the relay chain either way.
103+
weight.set_proof_size(u64::MAX)
101104
}
102105

103106
pub fn multi_dispute_statement_sets_weight<T: Config>(

prdoc/pr_7378.prdoc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
title: fix pre-dispatch PoV underweight for ParasInherent
2+
doc:
3+
- audience: Runtime Dev
4+
description: |-
5+
This should fix the error log related to PoV pre-dispatch weight being lower than post-dispatch for `ParasInherent`:
6+
```
7+
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.
8+
Pre dispatch weight: Weight { ref_time: 47793353978, proof_size: 1019 },
9+
Post dispatch weight: Weight { ref_time: 5030321719, proof_size: 135395 }
10+
```
11+
crates:
12+
- name: polkadot-runtime-parachains
13+
bump: patch

0 commit comments

Comments
 (0)