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

Charge for the gas that the contract init function spends while executing during deployment #2629

Open
miloszm opened this issue Oct 8, 2024 · 0 comments
Assignees
Labels
module:rusk Issues related to rusk module

Comments

@miloszm
Copy link
Contributor

miloszm commented Oct 8, 2024

Summary

Currently, init function of a deployed contract is being executed under a gas limit regime, yet the gas spent is ignored and not charged. This may lead to an unaccounted for usage of gas, as user may effectively pay for less gas than is actually spent during deployment.

Possible solution design or implementation

Do not ignore the gas-spent result of the init function and introduce proper gas accounting for the function execution. Make sure that a contract with init function consuming a lot of gas causes one of the following:

  • either OutOfGas error (charges the caller (deployer) an entire gas limit)
  • or graceful exit (yet the caller (deployer) pays for the gas that has been used)
@miloszm miloszm added the module:rusk Issues related to rusk module label Oct 8, 2024
@miloszm miloszm self-assigned this Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:rusk Issues related to rusk module
Projects
None yet
Development

No branches or pull requests

1 participant