Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Contracts: return proof_size with ContractResult from dry-runs #12410

Closed
ascjones opened this issue Oct 3, 2022 · 2 comments · Fixed by #12421
Closed

Contracts: return proof_size with ContractResult from dry-runs #12410

ascjones opened this issue Oct 3, 2022 · 2 comments · Fixed by #12421
Labels
Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder

Comments

@ascjones
Copy link
Contributor

ascjones commented Oct 3, 2022

Currently, in order to choose a value for gas_limit a UI would first dry-run the extrinsic via state_call and use the resulting ContractResult::gas_required as a parameter to the actual extrinsic.

Now that weights are two dimensional and also include proof_size, we should add that to the ContractResult in order for UIs to correctly populate that value, without having to manually supply a value.

Rel paritytech/subxt#679

@ascjones ascjones added the Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder label Oct 3, 2022
@burdges
Copy link

burdges commented Oct 3, 2022

As an aside, actual runtimes could change since other transactions could impact Merkle proof CPU time, but not sure this impacts weight. It won't change much usually though..

@athei
Copy link
Member

athei commented Oct 5, 2022

Yes state can always change in-between and make the gas estimation stale. In practice it works well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants