You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are running Alto in a container locally alongside geth node as an infra for our AA tests. After switching to newer versions of go-ethereum, we have noticed that Alto is failing to estimate the callGasLimit properly.
To Reproduce
Steps to reproduce the behavior:
Start up geth locally
Deploy infra contracts (EntryPoint, SW, SW Factory etc)
Start Alto locally, supplying the EntryPoint and other necessary info
All eth_estimateUserOperationGas calls result in callGasLimit estimated to 9000, which leads to OOG errors in userop execution.
Expected behavior
Alto estimates callGasLimit correctly, so that userop is executed successfuly.
Versions
OS: macOS v14.1.2
Alto: v1.0.1, with balanceOverride = false
Go-ethereum: 1.13.14
Geth node: without eth_call overrides support
Reason
We have found that a magic number 9000 is used when estimated callGasLimit is lower than 9000. Given our geth and Alto settings, Alto uses viem to call EntryPoint.simulateHandleOp, which does NOT set gasPrice, feePerGas and priorityFeePerGas to eth_call call.
[email protected] introduced a change to block.basefee logic in the vm in the eth_call, eth_estimateGas etc. contexts: if gasPrice is not specified, then block.basefee returns 0. This is very important for the Alto Bundler, because its gas estimation depends on EntryPoint.simulateHandleOp, which uses block.basefee.
Currently, without specifying gasPrice when calling EntryPoint.simulateHandleOp, it returns paid equal to gasUsed * maxPriorityFeePerGas (without adding block.baseFee), which results in callGasLimit calculated to ~-1500000.
It works!
Strange, I have checked the code in main branch before opening the issue, and as I have not found the explicit fix, I have not run the Bundler.
Could you point out to why it works now, please? :)
Description
We are running Alto in a container locally alongside geth node as an infra for our AA tests. After switching to newer versions of go-ethereum, we have noticed that Alto is failing to estimate the
callGasLimit
properly.To Reproduce
Steps to reproduce the behavior:
eth_estimateUserOperationGas
calls result in callGasLimit estimated to 9000, which leads to OOG errors in userop execution.Expected behavior
Alto estimates callGasLimit correctly, so that userop is executed successfuly.
Versions
balanceOverride = false
eth_call
overrides supportReason
We have found that a magic number
9000
is used when estimatedcallGasLimit
is lower than 9000. Given our geth and Alto settings, Alto usesviem
to callEntryPoint.simulateHandleOp
, which does NOT setgasPrice
,feePerGas
andpriorityFeePerGas
toeth_call
call.[email protected] introduced a change to
block.basefee
logic in the vm in theeth_call
,eth_estimateGas
etc. contexts: ifgasPrice
is not specified, thenblock.basefee
returns 0. This is very important for the Alto Bundler, because its gas estimation depends onEntryPoint.simulateHandleOp
, which usesblock.basefee
.Currently, without specifying
gasPrice
when callingEntryPoint.simulateHandleOp
, it returnspaid
equal togasUsed * maxPriorityFeePerGas
(without addingblock.baseFee
), which results incallGasLimit
calculated to ~-1500000
.Fix
As specified in the go-ethereum PR, specifying
gasPrice
ineth_call
is sufficient. Indeed, after changingin
packages/rpc/src/validation/validator.ts
toAlto's gas limit estimation works as expected.
We hope you can incorporate this fix, as we use Alto heavily in our workflow.
The text was updated successfully, but these errors were encountered: