From ddf6c795eb69c2facbabd68d1bc2097ac7593bea Mon Sep 17 00:00:00 2001 From: Rachit Sonthalia Date: Wed, 6 Sep 2023 23:48:37 +0530 Subject: [PATCH] fix rpc methdod --- jsonrpc/eth_endpoint.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jsonrpc/eth_endpoint.go b/jsonrpc/eth_endpoint.go index e517bbb06f..4cc471a6ea 100644 --- a/jsonrpc/eth_endpoint.go +++ b/jsonrpc/eth_endpoint.go @@ -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 { @@ -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 }