go-ethereum icon indicating copy to clipboard operation
go-ethereum copied to clipboard

internal/ethapi: `eth_createAccessList` fails without fee parameters

Open lightclient opened this issue 3 years ago • 2 comments

Currently when making an eth_createAccessList request with no fee parameters set, the client fails to generate the access list.

Request:

>> {"jsonrpc":"2.0","id":12,"method":"eth_createAccessList","params":[{"from":"0xaa00000000000000000000000000000000000000","to":"0xbb00000000000000000000000000000000000000"}]}
<< {"jsonrpc":"2.0","id":12,"error":{"code":-32000,"message":"gas required exceeds allowance (0)"}}

Geth:

WARN [07-17|16:22:03.089] Gas estimation capped by limited funds   original=5,004,881 balance=1 sent=0 maxFeePerGas=2,343,061,306 fundable=0
WARN [07-17|16:22:03.090] Served eth_createAccessList              conn=127.0.0.1:52137 reqid=12 duration="332.041µs" err="gas required exceeds allowance (0)" fail.

lightclient avatar Jul 17 '22 22:07 lightclient

The gas upper limit of estimation is capped by balance. In your example the account balance is 1 which leads to fundable=0 upper limit.

But I guess your point is why the fee will be automatically set. https://github.com/ethereum/go-ethereum/blob/master/internal/ethapi/api.go#L1399 I think gasPrice is fed by GasPriceOracle in this setDefault function.

rjl493456442 avatar Jul 18 '22 06:07 rjl493456442

Yep, that does appear to be the cause. It just seems a bit counterintuitive for it to fail with such a flexible request, especially since no gas limit was explicitly defined.

lightclient avatar Jul 18 '22 13:07 lightclient