Skip to content

Commit

Permalink
Fix extrinsics count logging in frame-system (paritytech#4461)
Browse files Browse the repository at this point in the history
The storage item ExtrinsicIndex is already taken before the `finalize()`
in `note_finished_extrinsics()`, rendering it's always 0 in the log.
This commit fixes it by using the proper API for extrinsics count.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
3 people committed Jun 19, 2024
1 parent 532878f commit 2ee8e13
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions prdoc/pr_4461.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
title: Fix extrinsics count logging in frame-system

doc:
- audience: Runtime Dev
description: |
Fixes the issue of the number of extrinsics in the block always being 0 in the log of frame-system.

crates:
- name: frame-system
bump: patch
2 changes: 1 addition & 1 deletion substrate/frame/system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1780,7 +1780,7 @@ impl<T: Config> Pallet<T> {
"[{:?}] {} extrinsics, length: {} (normal {}%, op: {}%, mandatory {}%) / normal weight:\
{} ({}%) op weight {} ({}%) / mandatory weight {} ({}%)",
Self::block_number(),
Self::extrinsic_index().unwrap_or_default(),
Self::extrinsic_count(),
Self::all_extrinsics_len(),
sp_runtime::Percent::from_rational(
Self::all_extrinsics_len(),
Expand Down

0 comments on commit 2ee8e13

Please sign in to comment.