Closed
Conversation
notlesh
commented
Jun 7, 2022
Comment on lines
+2519
to
+2521
| // TODO: there may be a better way to do this (use a different pub fn from | ||
| // transaction-payment for testing?) | ||
| let known_encoded_overhead_bytes = 11; |
Contributor
Author
There was a problem hiding this comment.
This test sucks. Basically, I tried to exploit the fact that remark's weight fn returns its length, but after some debugging this appears to be the encoded length, not the actual remark length.
#[pallet::weight(T::SystemWeightInfo::remark(_remark.len() as u32))]The overhead increases as the remark grows in size, probably because it takes more bytes to describe the size of a larger vec.
I think the test does its job, but it's pretty ugly. I'd like to find a cleaner way to accomplish the same thing.
Contributor
Author
|
Closing this in favor of #1765 |
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.
What does it do?
This accomplishes two things:
transaction-paymentNote that
transaction-paymentdoesn't actually use theMultiplierUpdatetrait outside of itsintegrity_testhook, it actually uses theConverttrait at runtime:https://github.com/paritytech/substrate/blob/9461b2de04210c6c193726a745c3ec6552b4ce9f/frame/transaction-payment/src/lib.rs#L344
The previously used
TargetedFeeAdjustmentimpl used these values, but without that they are completely unused at runtime (please review).I believe, then, that this will work with fixed fees for now and should also be fine in the future when EIP-1559 congestion-based fee modifier is properly implemented.
This is closely related to #1353 but should be fine if done independently.
🧷 This only affects
moonbaseruntimes currentlyTODO:
integrity_test