go-ethereum
go-ethereum copied to clipboard
internal/ethapi: `eth_createAccessList` fails without fee parameters
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.
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.
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.