erigontech / erigon

Ethereum implementation on the efficiency frontier https://erigon.gitbook.io
GNU Lesser General Public License v3.0
3.12k stars 1.11k forks source link

eth_feeHistory returning less blocks than requested when used with pending #8827

Open SMihai97 opened 10 months ago

SMihai97 commented 10 months ago

System information

Erigon version: ./erigon --version

erigon version 2.53.3-07f2389e

OS & Version: Linux

Commit hash: e59704f

Erigon Command (with flags/config): /usr/local/bin/erigon --datadir /node/data --metrics --metrics.addr=0.0.0.0 --metrics.port=6060 --rpc.gascap=150000000 --pprof --pprof.addr=0.0.0.0 --pprof.port=6061 --authrpc.port=8551 --downloader.verify --private.api.addr=0.0.0.0:9191 --torrent.download.rate=512mb --http=false --authrpc.jwtsecret=/node/data/jwt.hex

Consensus Layer: prysm

Consensus Layer Command (with flags/config): /node/prysm-node/prysm-4.0.8/prysm.sh beacon-chain --execution-endpoint=http://127.0.0.1:8551 --mainnet --accept-terms-of-use --jwt-secret=/node/prysm-data/jwt.hex --grpc-gateway-host=0.0.0.0 --datadir=/node/prysm-data --checkpoint-sync-url=https://beaconstate-mainnet.chainsafe.io

Chain/Network: Ethereum Mainnet

Expected behaviour

eth_feeHistory should return 4 blocks when using this request with pending

'{"method":"eth_feeHistory","params":[4,"pending",[10,65,85]],"id":1,"jsonrpc":"2.0"}'

Actual behaviour

When pending is used the number of blocks returned is no_of_requested_blocks - 1

Steps to reproduce the behaviour

Make an eth_feeHistory request with pending in params

This does not seem to be the case for geth

SMihai97 commented 10 months ago

An example of a call for erigon

curl localhost:8545 -X POST -H "Content-Type:application/json" -d '{"method":"eth_feeHistory","params":[4,"pending",[10,65,85]],"id":1,"jsonrpc":"2.0"}' {"jsonrpc":"2.0","id":1,"result":{"oldestBlock":"0x11c7323","reward":[["0x19c3d92","0x1dcd6500","0x77359400"],["0x5f5e100","0xab1c53c8","0x12a05f200"],["0x45e6730","0x3b9aca00","0x165a0bc00"]],"baseFeePerGas":["0x6aa0dcd8f","0x68f01307f","0x6b27aa77c","0x6ea8b03e5"],"gasUsedRatio":[0.4365805,0.5845131,0.6308010333333334]}}

An example of a call for geth

curl https://rpc.ankr.com/eth -X POST -H "Content-Type:application/json" -d '{"method":"eth_feeHistory","params":[4,"pending",[10,65,85]],"id":1,"jsonrpc":"2.0"}' {"jsonrpc":"2.0","id":1,"result":{"oldestBlock":"0x11c733c","reward":[["0x19c3d92","0x3b9aca00","0xb2d05e00"],["0x19c3d92","0x77359400","0x100e8b2cd"],["0x5f5e100","0x77359400","0xb2d05e00"],["0x5f5e100","0x3b9aca00","0xb2d05e00"]],"baseFeePerGas":["0x7356ce5a9","0x74bff21b3","0x748ebcfb9","0x7989b980c","0x6e792cfc8"],"gasUsedRatio":[0.5489236333333334,0.4934144,0.6709169333333334,0.13584573333333333]}}

curl https://rpc.ankr.com/eth -X POST -H "Content-Type:application/json" -d '{"method":"web3_clientVersion","params":[],"id":1,"jsonrpc":"2.0"}' {"jsonrpc":"2.0","id":1,"result":"Geth/v1.13.5-stable-916d6a44/linux-amd64/go1.20.5"}