Merged
Conversation
notlesh
commented
Sep 12, 2022
| .actual_weight | ||
| .unwrap(); | ||
|
|
||
| let expected_weight = base_extrinsic_weight.saturating_add(post_dispatch_weight); |
Contributor
Author
There was a problem hiding this comment.
This implies that we are adding Substrate`s notion of base weight and Ethereum's. I don't believe these should be added in this way, as they both account for the same things (signature verification and basic accounting of fees).
It would be great if we could convince substrate not to include the extrinsic_base_weight...
2 tasks
abhijeetbhagat
pushed a commit
to web3labs/frontier
that referenced
this pull request
Jan 11, 2023
* Call post_dispatch for CheckedSignature::SelfContained * add tests * rename tests Co-authored-by: Nisheeth Barthwal <nbaztec@gmail.com>
icodezjb
pushed a commit
to chainx-org/frontier
that referenced
this pull request
Dec 27, 2023
* Call post_dispatch for CheckedSignature::SelfContained * add tests * rename tests Co-authored-by: Nisheeth Barthwal <nbaztec@gmail.com> (cherry picked from commit d3beddc)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a bug where weight was not refunded after execution, which meant that the worst-case weight (based on
gas_limit) was accounted for in all cases. This change callsExtra::post_dispatchwhich can invokeCheckWeight::post_dispatch, which will properly refund any extra weight.Note that this only applies to
weightaccounting, the currency used for fees was already working as designed.Thanks to @nbaztec for adding tests.