From 4fe51143344de0af0b1109d22efb67b9c8ed8a54 Mon Sep 17 00:00:00 2001 From: luanxu-mxc Date: Thu, 27 Jul 2023 07:35:35 +0800 Subject: [PATCH] feat: gas price oracle minium bid 100k gwei --- eth/gasprice/gasprice.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth/gasprice/gasprice.go b/eth/gasprice/gasprice.go index 7312ddc2c86b..b35f35e7da10 100644 --- a/eth/gasprice/gasprice.go +++ b/eth/gasprice/gasprice.go @@ -217,8 +217,8 @@ func (oracle *Oracle) SuggestTipCap(ctx context.Context) (*big.Int, error) { // CHANGE(MXC): When there are network restrictions, the baseFee should be increased here to avoid transaction delays. The minimum bid is 100,000 gwei. price = price.Add(price, new(big.Int).Div(head.BaseFee, big.NewInt(20))) - if price.Cmp(big.NewInt(1e14)) < 0 { - price = big.NewInt(1e14) + if head.BaseFee.Cmp(big.NewInt(1e14)) < 0 { + price = new(big.Int).Add(price, new(big.Int).Sub(big.NewInt(1e14), head.BaseFee)) } oracle.cacheLock.Lock()