Skip to content
Snippets Groups Projects
Commit 77681d2f authored by José Molina Colmenero's avatar José Molina Colmenero Committed by github-actions[bot]
Browse files

Add debugging info for `StorageWeightReclaim` (#5594)


When inspecting the logs we often encounter the following message:

`Benchmarked storage weight smaller than consumed storage weight.
benchmarked: {benchmarked_weight} consumed: {consumed_weight} unspent:
{unspent}`

However, it is very hard to guess which call is causing the issue.

With the changes proposed in this PR, information about the call is
provided so that we can easily identify the source of the problem
without further delay, and this way work more efficiently in solving the
issue.

---------

Co-authored-by: default avatarBastian Köcher <git@kchr.de>
(cherry picked from commit 016421ac)
parent e484c015
No related merge requests found
Pipeline #497787 waiting for manual action with stages
in 34 minutes and 52 seconds
......@@ -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)
}
......
# 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% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment