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

Display real extrinsic costs when interacting with contracts #2608

Closed
athei opened this issue Apr 23, 2020 · 5 comments
Closed

Display real extrinsic costs when interacting with contracts #2608

athei opened this issue Apr 23, 2020 · 5 comments
Labels
Support Tracks issues or requests related to troubleshooting, answering questions, and user assistance.

Comments

@athei
Copy link

athei commented Apr 23, 2020

With an upcoming PR (paritytech/substrate#5712) the weight and therefore the fees of any contract related extrinsic will reflect the real costs of that extrinsic. Previously the gas costs where on top as a completely separate matter. This distinction is gone.

That means the TransactionPaymentApi::query_info will take into account the gas_limit of an extrinsic (or the code length for put_code) and returns the complete costs for the sender as for any other extrinsic.

However, during my tests with the linked PR I noticed that for the contracts module the costs that the UI displayed when sending an extrinsic stays fixed no matter what gas limit I supply:
Screenshot 2020-04-23 at 09 47 41

This is different from other modules where this fee seems to change when the weight of an extrinsic changes given another input. I guess that this behavior is somehow disabled in the contracts UI.

I suppose to display the fees as calculated by TransactionPaymentApi::query_info when submitting a contract extrinsic as for any other extrinsic. However, we should change the wording slightly as those costs are a maximum and the rest is refunded. This is true for all extrinsics lately but contracts might be an extreme case. I propose something like this:

According to (your entered gas limit | the length of the supplied wasm blob) fees of at most $UNIT Unit will be applied to the submission

@athei athei changed the title Take real extrinsic costs into account when interacting with contracts Display real extrinsic costs when interacting with contracts Apr 23, 2020
@jacogr
Copy link
Member

jacogr commented Apr 23, 2020

Please move this to substrate - the UI calls query_paymentInfowhich has the estimation. If incorrect, it is not returning the correct results.

@jacogr jacogr closed this as completed Apr 23, 2020
@jacogr jacogr added the Support Tracks issues or requests related to troubleshooting, answering questions, and user assistance. label Apr 23, 2020
@athei
Copy link
Author

athei commented Apr 23, 2020

I cannot find a function with this name. Is this distinct from the TransactionPaymentApi::query_info I mentioned?

@athei
Copy link
Author

athei commented Apr 23, 2020

I did a little investigation. Everything is working as intended. I mistakenly thought that the weight contribution was not accounted for. In reality the numbers were just too small to notice it in the UI because of #2604. So nothing is to be done here.

@polkadot-js-bot
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Jun 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Support Tracks issues or requests related to troubleshooting, answering questions, and user assistance.
Projects
None yet
Development

No branches or pull requests

3 participants