-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify fee modifiers #1420
Unify fee modifiers #1420
Conversation
// 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Closing this in favor of #1765 |
What does it do?
This accomplishes two things:
transaction-payment
Note that
transaction-payment
doesn't actually use theMultiplierUpdate
trait outside of itsintegrity_test
hook, it actually uses theConvert
trait at runtime:https://github.com/paritytech/substrate/blob/9461b2de04210c6c193726a745c3ec6552b4ce9f/frame/transaction-payment/src/lib.rs#L344
The previously used
TargetedFeeAdjustment
impl 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
moonbase
runtimes currentlyTODO:
integrity_test