ethereum / go-ethereum

Go implementation of the Ethereum protocol
https://geth.ethereum.org
GNU Lesser General Public License v3.0
47.56k stars 20.13k forks source link

err: gas limit reached (supplied gas 9223372036854775807) #30467

Closed YuXiaoCoder closed 1 month ago

YuXiaoCoder commented 1 month ago

System information

Geth version: 1.14.9 CL client & version: Prysm@v5.1.0 OS & Version: Linux

Expected behaviour

eth_call returns the response normally

Actual behaviour

INFO [09-19|20:29:30.936] rpc response                             method=eth_call logId=5 err="err: gas limit reached (supplied gas 9223372036854775807)" result="\"0x\"" attempt=0 args="[{\"from\":\"0x0000000000000000000000000000000000000000\",\"input\":\"0xe8eb1dc3\",\"to\":\"0x211e1c4c7f1bf5351ac850ed10fd68cffcf6c21b\"}, \"latest\"]" errorData=null
ERROR[09-19|20:29:30.936] error fetching MaxDataSize from sequencer inbox err="err: gas limit reached (supplied gas 9223372036854775807)"

Steps to reproduce the behaviour

Prysm Command:

/opt/ethmain/core/beacon-chain --mainnet --chain-id=1 --network-id=1 --checkpoint-sync-url=https://sync-mainnet
.beaconcha.in --execution-endpoint=http://127.0.0.1:8551 --jwt-secret=/mnt/ethmain/node/jwt.hex --datadir=/mnt/ethmain/node/prysm/beacon --enable-historical-state-representation
--suggested-fee-recipient=0xcDA9D71bdfAe59b89Cee131eD3079f8AC4c77062 --http-mev-relay=http://127.0.0.1:18550 --rpc-host=0.0.0.0 --rpc-port=4000 --rpc-max-page-size=200000 --http-
modules=prysm,eth --grpc-gateway-host=0.0.0.0 --grpc-gateway-port=3500 --grpc-gateway-corsdomain=* --grpc-max-msg-size=268435456 --p2p-tcp-port=13000 --p2p-udp-port=12000 --disab
le-monitoring --accept-terms-of-use

Geth Command:

/opt/ethmain/core/geth --config=/mnt/ethmain/conf/config.toml --rpc.gascap=0 --rpc.txfeecap=0

The version of Geth before we upgraded was 1.14.5,When I remove the --rpc.gascap=0 --rpc.txfeecap=0 parameter, the node responds normally, but the 0 value is unlimited in meaning ah!

jwasinger commented 1 month ago

I don't see "error fetching MaxDataSize from sequencer inbox" anywhere in the prysm codebase. Additionally, the rpc call you have provided doesn't make sense in the context of eth mainnet: it is a call from the zero address to an arbitrum contract.

Are you trying to run an Arbitrum node?

Edit: yes, the error looks to originate from arbitrum nitro which is meant to be coupled with Geth.

jwasinger commented 1 month ago

I assume "the node responds normally" means that the eth_call succeeds which doesn't make sense to me. why would it succeed when the gas cap is set to the 50_000_000 default, and not when it is infinite... Maybe others will have more insight on this.

YuXiaoCoder commented 1 month ago

Yes, I'm running arbitrum nitro.

YuXiaoCoder commented 1 month ago

I found the bug, in the doCall method in internal/ethapi/api.go, it was previously setting AddGas as

gp := new(core.GasPool).AddGas(math.MaxUint64)

the new code changed to new(core.GasPool).AddGas(globalGasCap), if we set RPCGasCap(globalGasCap) to 0, we intended to set infinite If we set RPCGasCap(globalGasCap) to 0, it is meant to be infinite.

YuXiaoCoder commented 1 month ago

This bug can be bypassed by changing the run command

/opt/ethmain/core/geth --config=/mnt/ethmain/conf/config.toml --rpc.gascap=9223372036854775807 --rpc.txfeecap=0
cbfyi commented 1 month ago

Experiencing similar issues.

Assuming that is related to https://github.com/ethereum/go-ethereum/pull/27720