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

Gas limit when using multicall #254

Open
Uxio0 opened this issue May 16, 2022 · 6 comments
Open

Gas limit when using multicall #254

Uxio0 opened this issue May 16, 2022 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@Uxio0
Copy link
Member

Uxio0 commented May 16, 2022

Describe the bug
multicall sometimes exceeds eth_call gas limit and an out of gas error is raised.

To Reproduce
Do eth_call consuming the maximum gas allowed by the node. Library raises an exception. Example trace from the transaction-service:

2022-05-16 10:23:21,794 [WARNING] [MainProcess] https://safe-transaction.mainnet.gnosis.io/api/v1/safes/{address}/collectibles/ - Exception: NodeConnectionException - Data received {}
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/gnosis/eth/multicall.py", line 227, in _try_aggregate
    result = self.contract.functions.tryAggregate(
  File "/usr/local/lib/python3.10/site-packages/web3/contract.py", line 957, in call
    return call_contract_function(
  File "/usr/local/lib/python3.10/site-packages/web3/contract.py", line 1501, in call_contract_function
    return_data = web3.eth.call(
  File "/usr/local/lib/python3.10/site-packages/web3/module.py", line 57, in caller
    result = w3.manager.request_blocking(method_str,
  File "/usr/local/lib/python3.10/site-packages/web3/manager.py", line 198, in request_blocking
    return self.formatted_response(response,
  File "/usr/local/lib/python3.10/site-packages/web3/manager.py", line 171, in formatted_response
    raise ValueError(response["error"])
ValueError: {'code': -32015, 'message': 'VM execution error.', 'data': 'Out of gas'}

Expected behavior
Reverts to use batch call

@Uxio0 Uxio0 added the bug Something isn't working label May 16, 2022
@Uxio0 Uxio0 self-assigned this May 16, 2022
@007vasy
Copy link

007vasy commented Oct 6, 2022

@Uxio0 has a look at github.com/banteg/multicall.py if you want to fix it

@Uxio0
Copy link
Member Author

Uxio0 commented Oct 6, 2022

Sorry @007vasy , what exactly do we have to take a look at?

@007vasy
Copy link

007vasy commented Oct 9, 2022

you can set the maximum gas and also multicall.py does a backtrack and tries to do the multicall with less amount of calls

@Uxio0
Copy link
Member Author

Uxio0 commented Oct 10, 2022

Yeah, I mean, our biggest problem here is how to do it without impacting performance. Fallbacking to use less amount of calls after a failure is something we want to prevent

@007vasy
Copy link

007vasy commented Oct 10, 2022

my best guess is that some contracts are faulty and the functions are tagged incorrectly (a view function which is not tagged as view) therefore the node think it needs gas, but it does not (but that's just a guess)

@Uxio0
Copy link
Member Author

Uxio0 commented Oct 11, 2022

Well, it's not just gas. For example, Erigon has an evm timeout of 5 seconds and gas does not matter too much. Gladly, in the new Erigon versions it can be configured

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants