Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bchain/coins/eth/ethrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,10 @@ func (b *EthereumRPC) EthereumTypeGetEip1559Fees() (*bchain.Eip1559Fees, error)

hs, _ := json.Marshal(h)
baseFee, _ := hexutil.DecodeUint64(h.BaseFeePerGas[blocks-1])
fees.BaseFeePerGas = big.NewInt(int64(baseFee))
// SetUint64, not big.NewInt(int64(...)): base fee is wei and a value above math.MaxInt64
// (~9.22e18) would wrap negative on the int64 cast. Unreachable on mainnet today but possible
// on high-fee L2s. Matches the header path in attachBlockGas.
fees.BaseFeePerGas = new(big.Int).SetUint64(baseFee)
// We expose only baseFeePerGas here and deliberately do NOT add a separate "next block" base-fee
// field. eth_feeHistory returns one extra projected element beyond the requested range, but its
// meaning is backend-dependent: nodes with no distinct pending block (e.g. Erigon, which ethereum
Expand Down
Loading