Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Fix eth_gasPrice RPC method #1883

Merged
merged 6 commits into from
Sep 7, 2023
Merged
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions jsonrpc/eth_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ type ethTxPoolStore interface {

// GetNonce returns the next nonce for this address
GetNonce(addr types.Address) uint64

// returns the current base fee of TxPool
GetBaseFee() uint64
}

type Account struct {
Expand Down Expand Up @@ -397,6 +400,10 @@ func (e *Eth) GasPrice() (interface{}, error) {
avgGasPrice := e.store.GetAvgGasPrice().Uint64()

// Return --price-limit flag defined value if it is greater than avgGasPrice
if e.store.GetForksInTime(e.store.Header().Number).London {
return argUint64(common.Max(e.priceLimit, common.Max(avgGasPrice, e.store.GetBaseFee()))), nil
}

return argUint64(common.Max(e.priceLimit, avgGasPrice)), nil
}

Expand Down
Loading