Skip to content
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

Add Benchmarking/Weights for Signed Extensions #87

Open
joepetrowski opened this issue Jun 25, 2023 · 1 comment
Open

Add Benchmarking/Weights for Signed Extensions #87

joepetrowski opened this issue Jun 25, 2023 · 1 comment
Labels
I5-enhancement An additional feature request. T1-FRAME This PR/Issue is related to core FRAME, the framework.

Comments

@joepetrowski
Copy link
Contributor

joepetrowski commented Jun 25, 2023

With the introduction of Asset Conversion for fee payment, sometimes Signed Extensions can execute "heavier" logic themselves in pre-/post-dispatch. See for example asset-conversion-tx-payment.

In this case, these pre_dispatch and post_dispatch functions should allow some weight annotation that will add the weight of their execution to the extrinsic weight and charge when appropriate.

@bkchr
Copy link
Member

bkchr commented Jun 25, 2023

Just a note as we normally call the same logic as in pre_dispatch in validate. For this "heavier" logic signed extensions we should may move away from this. We should only do basic checks, which in the case of the asset conversion extension would be to check that the user has the asset and that there exists a pool to sell it. Maybe also some preliminarily checks on the pool liquidity.

While writing this down and thinking more about this, I'm not sure it is that easy :P Currently the BaseExtrinsicWeight is fixed and includes the weight for all signed extrinsics. This BaseExtrinsicWeight is included when calculating the weight of a call and thus, also used to calculate the fees to pay. We would need to make the BaseExtrinsicWeight "dynamic" to calculate it on the fly. It should be possible, but it will not be nice 🙈

@joepetrowski joepetrowski transferred this issue from paritytech/substrate Aug 24, 2023
@the-right-joyce the-right-joyce added I5-enhancement An additional feature request. T1-FRAME This PR/Issue is related to core FRAME, the framework. and removed J0-enhancement labels Aug 25, 2023
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
jonathanudd pushed a commit to jonathanudd/polkadot-sdk that referenced this issue Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request. T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
Status: Backlog
Development

No branches or pull requests

3 participants