[Help] Unable to estimateUserOperationGas
Troublor opened this issue · 1 comments
Hi, very appreciate this great work.
However, I am trying to use alto on a local testnet and could not make estimateUserOperation
json-rpc work. The error message is: Cannot decode zero data ("0x") with ABI parameters.
.
I investigated the code of alto and found that alto seems to call callExecute
function in EntryPoint
address during simulateHandleOp
:
alto/packages/rpc/src/gasEstimation.ts
Lines 197 to 205 in adb3696
I don't think there is a function called callExecute
in the entrypoint. Then I notice there is a special parameter in the RPC parameters called finalParam
, which seems to instruct the RPC backend to replace the bytecode of entrypoint to a given ExecuteSimulator
code.
alto/packages/rpc/src/gasEstimation.ts
Lines 24 to 59 in adb3696
Is this contract bytecode replacement feature in the Ethereum JSON-RPC standard? Or are you using a customized Ethereum node to handle such RPCs? How can I make this work on a local testnet (e.g., anvil)?
bytecode replacement is part of the Ethereum JSON-RPC spec (using StateOverrides). However not all rpc providers allow state overrides.
Anvil does support code overrides but if your rpc doesn't then you can run alto with the --noEthCallOverrideSupport
flag