diff --git a/polkadot/runtime/parachains/src/paras_inherent/weights.rs b/polkadot/runtime/parachains/src/paras_inherent/weights.rs index 81c926a90e0bf81e427fe6ecfbb71c4c4c62f3b2..31958cf4acfb340274aeebcfb4e4997581fe9f59 100644 --- a/polkadot/runtime/parachains/src/paras_inherent/weights.rs +++ b/polkadot/runtime/parachains/src/paras_inherent/weights.rs @@ -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>( diff --git a/prdoc/pr_7378.prdoc b/prdoc/pr_7378.prdoc new file mode 100644 index 0000000000000000000000000000000000000000..8754966d3e82c18cd7abfa1f4ef6065e1d5c2edf --- /dev/null +++ b/prdoc/pr_7378.prdoc @@ -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