Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add base-weight to System::Extrinsic* events #12329

Merged
merged 2 commits into from
Sep 24, 2022

Conversation

ggwpez
Copy link
Member

@ggwpez ggwpez commented Sep 22, 2022

Closes #12252:

  • Adds the base-weight of the respective dispatch class into the event by modifying note_applied_extrinsic.
  • Update tests and give the mocked Operational class a distinct base weight, to improve testing.

PolkadotJs now also shows the correct weight of a Remark: 87_298_000 = 86_298_000 (base) + 1_000_000 (remark).
This is identical to the result of System::blockWeight(block_hash) in that case.

Screenshot from 2022-09-22 15-31-37
cc @notlesh

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@ggwpez ggwpez added A0-please_review Pull request needs code review. B7-runtimenoteworthy C1-low PR touches the given topic and has a low impact on builders. D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed. labels Sep 22, 2022
@ggwpez ggwpez changed the title Add base-weight to ExtrinsicSuccess Add base-weight to System::Extrinsic* events Sep 22, 2022
@bkchr
Copy link
Member

bkchr commented Sep 24, 2022

@ggwpez now you just need to fix the tests.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@ggwpez
Copy link
Member Author

ggwpez commented Sep 24, 2022

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 9476d21 into master Sep 24, 2022
@paritytech-processbot paritytech-processbot bot deleted the oty-fix-event-weight branch September 24, 2022 15:17
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
* Add base-weight to events

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ExtrinsicSuccess reports wrong weight consumption
3 participants