-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Apply WeightToFeePolynomials to pallet_transaction_payment's length fee
#10785
Apply WeightToFeePolynomials to pallet_transaction_payment's length fee
#10785
Conversation
|
seems like a fine change to me |
frame/transaction-payment/src/lib.rs
Outdated
| } | ||
|
|
||
| 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 ? |
|
Any update on the reviews :) ? (also CI is not running) |
|
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 <[email protected]> * 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 <[email protected]> Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Shawn Tabrizi <[email protected]>
…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 <[email protected]> * 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 <[email protected]> Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Shawn Tabrizi <[email protected]>
…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 <[email protected]> * 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 <[email protected]> Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Shawn Tabrizi <[email protected]>
This PR is one potential way to address #10784. It adds the same
WeightToFeePolynomialmechanics used for weight fees inpallet_transaction_paymentto 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