Skip to content

Commit 81a3af9

Browse files
parachain-system: Ensure left-over message budget fits into the PoV (#10863)
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 0a38650 commit 81a3af9

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

cumulus/pallets/parachain-system/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,11 @@ impl<T: Config> Pallet<T> {
11181118
fn messages_collection_size_limit() -> usize {
11191119
let max_block_weight = <T as frame_system::Config>::BlockWeights::get().max_block;
11201120
let max_block_pov = max_block_weight.proof_size();
1121-
(max_block_pov / 6).saturated_into()
1121+
1122+
let remaining_proof_size =
1123+
frame_system::Pallet::<T>::remaining_block_weight().remaining().proof_size();
1124+
1125+
(max_block_pov / 6).min(remaining_proof_size).saturated_into()
11221126
}
11231127

11241128
/// Updates inherent data to only include the messages that weren't already processed

prdoc/pr_10863.prdoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
title: 'parachain-system: Ensure left-over message budget fits into the PoV'
2+
doc:
3+
- audience: Runtime Dev
4+
description: Ensure we check the buget against the remaining proof size in the block.
5+
crates:
6+
- name: cumulus-pallet-parachain-system
7+
bump: patch

0 commit comments

Comments
 (0)