-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Apply WeightToFeePolynomial
s to pallet_transaction_payment
's length fee
#10785
Apply WeightToFeePolynomial
s to pallet_transaction_payment
's length fee
#10785
Conversation
seems like a fine change to me |
frame/transaction-payment/src/lib.rs
Outdated
@@ -536,6 +538,10 @@ where | |||
} | |||
} | |||
|
|||
fn length_to_fee(length: u32) -> BalanceOf<T> { | |||
T::LengthToFee::calc(&(length as u64)) // TODO: saturating / upper bound |
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.
I had left this TODO here because fn weight_to_fee
below provides an upper bound.
While I'm not quite sure why it's needed in weight_to_fee
, it's guaranteed to be no larger than u32::MAX
in the case of length_to_fee
, which is likely much smaller than max_block
.
Another pair of eyes would be great though.
Any update on this, esp. @kianenigma ? |
some warnings seem legit, CI will run now. |
I'm guessing my polkadot companion PR has CI blocked as well: |
My companion polkadot PR is building locally for me. If I'm reading CONTRIBUTING.adoc correctly, I think its CI is expected to be failing at this point. Let me know if I can do anything else to push this along. |
I added a It may need CI enabled for me. Thanks :) |
bot merge |
…th fee (paritytech#10785) * Apply WeightToFeePolynomials to length fee * Remove TransactionByteFee * Add test cases for ConstantModifierFee * Restore import * Use pallet::constant_name * Remove irrelevant TODO comment * Update frame/support/src/weights.rs * Update frame/transaction-payment/src/lib.rs * Update frame/transaction-payment/src/lib.rs * Update frame/transaction-payment/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * s/ConstantModifierFee/ConstantMultiplier/ * Impl LengthToFee for test configs * fmt * Remove unused import * Impl WeightToFeePolynomial for byte fee in ExtBuilder * Remove unused import * fix doc Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
…th fee (paritytech#10785) * Apply WeightToFeePolynomials to length fee * Remove TransactionByteFee * Add test cases for ConstantModifierFee * Restore import * Use pallet::constant_name * Remove irrelevant TODO comment * Update frame/support/src/weights.rs * Update frame/transaction-payment/src/lib.rs * Update frame/transaction-payment/src/lib.rs * Update frame/transaction-payment/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * s/ConstantModifierFee/ConstantMultiplier/ * Impl LengthToFee for test configs * fmt * Remove unused import * Impl WeightToFeePolynomial for byte fee in ExtBuilder * Remove unused import * fix doc Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
…th fee (paritytech#10785) * Apply WeightToFeePolynomials to length fee * Remove TransactionByteFee * Add test cases for ConstantModifierFee * Restore import * Use pallet::constant_name * Remove irrelevant TODO comment * Update frame/support/src/weights.rs * Update frame/transaction-payment/src/lib.rs * Update frame/transaction-payment/src/lib.rs * Update frame/transaction-payment/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * s/ConstantModifierFee/ConstantMultiplier/ * Impl LengthToFee for test configs * fmt * Remove unused import * Impl WeightToFeePolynomial for byte fee in ExtBuilder * Remove unused import * fix doc Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This PR is one potential way to address #10784. It adds the same
WeightToFeePolynomial
mechanics used for weight fees inpallet_transaction_payment
to length fee. The main goal is to provide more flexibility in charging for transaction size; see the issue for more info on the motivation.This PR would need substantial work, and would probably introduce breaking changes wherever the pallet's config is used.
polkadot companion: paritytech/polkadot#5028
cumulus companion: paritytech/cumulus#1152