Skip to content

Commit

Permalink
[stable2409] Backport #5594 (#5767)
Browse files Browse the repository at this point in the history
Backport #5594 into `stable2409` from Moliholy.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

Co-authored-by: José Molina Colmenero <jose@blockdeep.io>
  • Loading branch information
1 parent 56ce901 commit c9fbeb7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cumulus/primitives/storage-weight-reclaim/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,15 @@ where
if consumed_weight > benchmarked_weight {
log::error!(
target: LOG_TARGET,
"Benchmarked storage weight smaller than consumed storage weight. benchmarked: {benchmarked_weight} consumed: {consumed_weight} unspent: {unspent}"
"Benchmarked storage weight smaller than consumed storage weight. extrinsic: {} benchmarked: {benchmarked_weight} consumed: {consumed_weight} unspent: {unspent}",
frame_system::Pallet::<T>::extrinsic_index().unwrap_or(0)
);
current.accrue(Weight::from_parts(0, storage_size_diff), info.class)
} else {
log::trace!(
target: LOG_TARGET,
"Reclaiming storage weight. benchmarked: {benchmarked_weight}, consumed: {consumed_weight} unspent: {unspent}"
"Reclaiming storage weight. extrinsic: {} benchmarked: {benchmarked_weight} consumed: {consumed_weight} unspent: {unspent}",
frame_system::Pallet::<T>::extrinsic_index().unwrap_or(0)
);
current.reduce(Weight::from_parts(0, storage_size_diff), info.class)
}
Expand Down
13 changes: 13 additions & 0 deletions prdoc/pr_5594.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json

title: "Add debugging info for `StorageWeightReclaim`"

doc:
- audience: Runtime Dev
description: |
- Includes extrinsic index to be displayed in the logs when the consumed weight is higher than the measured one.

crates:
- name: cumulus-primitives-storage-weight-reclaim
bump: patch

0 comments on commit c9fbeb7

Please sign in to comment.