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

Rename InstantiateContractCosts -> SetupContractCost; Remove NewContractInstanceCosts #1797

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

webmaster128
Copy link
Member

This PR makes to changes to improve clarity on how starting a contract execution is charged. They are independent an in one commit each:

  1. Rename InstantiateContractCosts -> SetupContractCost. The term "instantiate" has two different meanings in our stack: (a) the contract instance identified by a blockchain address (b) the Wasmer instance created before calling an entry point. Here "InstantiateContract" was referring to the later, which is more an implementation detail. To avoid confusion we can use a different term that was in the codebase already: "setup".
  2. Remove NewContractInstanceCosts. This was just an alias that was used for one entry point (MsgInstantiateContract/MsgInstantiateContract2). However, we do not maintain entry-point specific gas values for all other cases. So having this extra is confusing. If we want entrypoint specific functions here, we should create them for all entry points.

Also in general we should migrate "costs" -> "cost" when we get the chance since this the the price for a single operation.

We do not have entry-point specific gas metering and
NewContractInstanceCosts is just an alias for setup cost. No need to
maintain it. If we really need it, we should better explain why.
@pinosu pinosu added this to the v0.51 milestone Jan 25, 2024
Copy link
Contributor

@pinosu pinosu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! LGTM 👍

@webmaster128 webmaster128 merged commit 796907e into main Jan 25, 2024
16 checks passed
@webmaster128 webmaster128 deleted the rename-to-setup-cost branch January 25, 2024 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants