eth: should return basefee for the next block as doc says (#35023)

This commit is contained in:
cui 2026-05-27 18:53:03 +08:00 committed by GitHub
parent ac1fdc5f8f
commit 90cd7d1937
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -446,8 +446,10 @@ func (b *EthAPIBackend) FeeHistory(ctx context.Context, blockCount uint64, lastB
} }
func (b *EthAPIBackend) BaseFee(ctx context.Context) *big.Int { func (b *EthAPIBackend) BaseFee(ctx context.Context) *big.Int {
if b.ChainConfig().IsLondon(b.CurrentHeader().Number) { header := b.CurrentHeader()
return eip1559.CalcBaseFee(b.ChainConfig(), b.CurrentHeader()) next := new(big.Int).Add(header.Number, common.Big1)
if b.ChainConfig().IsLondon(next) {
return eip1559.CalcBaseFee(b.ChainConfig(), header)
} }
return nil return nil
} }