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

Better control of gas accounting #1823

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Better control of gas accounting #1823

wants to merge 11 commits into from

Conversation

feliam
Copy link
Contributor

@feliam feliam commented Dec 7, 2020

Add evm.gas configuration constant/variable/thing to control how to account gas. For example "static" will ignore all dynamic calculated fees. (This is different from evm.oog. The latter controls how and when to check for Out Of Gas)

Change rpl -> rust-rpl dependency.

@feliam feliam marked this pull request as ready for review December 7, 2020 20:01
@feliam feliam requested a review from ehennenfent December 7, 2020 22:25
@feliam feliam requested a review from ggrieco-tob December 9, 2020 22:37
default="static",
description=(
"Control how to keep the gas count"
"insane: Keep static and dynamic gas including transaction fee VERY EXPENSIVE (INSANE)."
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit, but can we make this "exhaustive"? Or, if you want to preserve the suggestion that it's over-the-top, perhaps "ludicrous"?

available_gas = self._gas
available_gas -= fee

exception = Operators.OR(
Operators.UGT(fee, self._gas),
Operators.ULT(self.safe_mul(available_gas, 63), available_gas),
)
self.fail_if(exception)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this line need to check the value of consts.gas before deciding to raise the exception?

@ehennenfent
Copy link
Contributor

@feliam were you still hoping to merge this? I think those couple of nits are the only things blocking it.

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.

Add configuration constant to ignore any gas related calculations.
2 participants