Skip to content
Unverified Commit b18c199b authored by georgepisaltu's avatar georgepisaltu Committed by GitHub
Browse files

Add benchmarks to transaction extensions (#2726)



Follow up effort on top of
https://github.com/paritytech/polkadot-sdk/pull/2280

This PR implements benchmarking code for transaction extensions:

- ChargeTransactionPayment
- ChargeAssetTxPayment (asset-tx-payment)
- ChargeAssetTxPayment (asset-conversion-tx-payment)
- CheckWeight
- CheckTxVersion
- CheckSpecVersion
- CheckNonce
- CheckNonZeroSender
- CheckMortality
- CheckGenesis
- CheckOnlySudoAccount
- PrevalidateAttests

Extensions which still don't have benchmarks but could probably continue
to use the default impl of `Weight::zero()` or call some existing weight
function in the case of wrappers:

- Test extensions
   - DummyExtension
   - WatchDummy
- Wrappers
   - GenericTransactionExtension
   - TransactionExtension (chain-polkadot-bulletin)
- Bridge extensions (see discussion below)
   - RefundTransactionExtensionAdapter

Each extension's `TransactionExtensionBase::weight` impl needs to use
the resulting weight function and adapt existing runtimes' benchmarking
configuration to these changes. So far, this has been done for:

- [x] ChargeTransactionPayment
- [x] ChargeAssetTxPayment (asset-tx-payment)
- [x] ChargeAssetTxPayment (asset-conversion-tx-payment)
- [x] CheckWeight
- [x] CheckTxVersion
- [x] CheckSpecVersion
- [x] CheckNonce
- [x] CheckNonZeroSender
- [x] CheckMortality
- [x] CheckGenesis
- [x] CheckOnlySudoAccount
- [x] PrevalidateAttests
- [ ] ~RefundTransactionExtensionAdapter~

---------

Signed-off-by: default avatargeorgepisaltu <[email protected]>
parent e48d0399
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment