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

Allow gasLimit to be specified on eth_calls #819

Closed
cag opened this issue May 6, 2020 · 4 comments
Closed

Allow gasLimit to be specified on eth_calls #819

cag opened this issue May 6, 2020 · 4 comments
Labels
enhancement New feature or improvement. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@cag
Copy link

cag commented May 6, 2020

Related: #316

If trying to specify gasLimit on an eth_call, ethers.js will throw an Error: call cannot override gasLimit. Sometimes, being able to override the gas limit is desirable though, like when trying to determine how a different gas limit might affect the result of a call.

For example, eth_calling execTransaction on a Gnosis Safe with different gas limits to see where the transaction success value changes.

Also related: #299

Nodes will expect to see a gas parameter, and while eth_sendTransaction can be handled by signing transactions on the frontend, for eth_call to work, one would either have to allow/preserve the gas name expected by nodes or transform gasLimit to gas on the backend.

@ricmoo
Copy link
Member

ricmoo commented May 6, 2020

I was under the impression that call ignored the gasLimit, but I'll experiment and can add it as a valid call override.

@ricmoo ricmoo added enhancement New feature or improvement. next version (v5) labels May 6, 2020
@cag
Copy link
Author

cag commented May 6, 2020

Something like this might be useful for checking:

contract EthCallGasDependent {
  function txGasEnough() external pure returns (bool) { return gasleft() > 20000; }
}

@ricmoo
Copy link
Member

ricmoo commented May 30, 2020

This should have happened as a consequence of the Contract refactor in 5.0.0-beta.189. Try it out and let me know if there are still issues.

@ricmoo ricmoo added the fixed/complete This Bug is fixed or Enhancement is complete and published. label May 30, 2020
@ricmoo
Copy link
Member

ricmoo commented Jun 3, 2020

This should be fixed now. If not, please re-open.

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

No branches or pull requests

2 participants