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

When max gas = -1, the SDK doesn't allow for infinite gas #3791

Closed
ValarDragon opened this issue Mar 4, 2019 · 1 comment · Fixed by #3801
Closed

When max gas = -1, the SDK doesn't allow for infinite gas #3791

ValarDragon opened this issue Mar 4, 2019 · 1 comment · Fixed by #3801
Assignees

Comments

@ValarDragon
Copy link
Contributor

ValarDragon commented Mar 4, 2019

See:

if maxGas := app.getMaximumBlockGas(); maxGas > 0 {

The semantics of max_gas < 0 is for it to allow for infinite gas. However, in getMaximumBlockGas,

func (app *BaseApp) getMaximumBlockGas() (maxGas uint64) {
the SDK currently does uint64(max_gas). For negative values of gas this yields something on the order of 2**64 - 1, which then yields a gas meter with around 2**64 gas. This is far off from the desired infinity 😜

@alexanderbez
Copy link
Contributor

imho, we simply need to check for overflow here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants