From dd61c6ba7e8808cc25cd295f0951d8d2083eafb7 Mon Sep 17 00:00:00 2001 From: Joel Liu <83172559+csdtowards@users.noreply.github.com> Date: Sat, 21 Dec 2024 08:14:13 +0800 Subject: [PATCH] increase gas price (#68) * increase gas price * fix issue --- disperser/contract/contract.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/disperser/contract/contract.go b/disperser/contract/contract.go index 3ef0fb5..19f4c36 100644 --- a/disperser/contract/contract.go +++ b/disperser/contract/contract.go @@ -219,6 +219,16 @@ func (c *DAContract) CreateTransactOpts() (*bind.TransactOpts, error) { var gasPrice *big.Int if CustomGasPrice > 0 { gasPrice = new(big.Int).SetUint64(CustomGasPrice) + } else { + price, err := c.client.Eth.GasPrice() + if err != nil { + c.logger.Debug("[contract] failed to get gas price", "err", err) + } else { + increased := new(big.Int) + increased.Div(price, big.NewInt(10)) + gasPrice = new(big.Int) + gasPrice.Add(price, increased) + } } var nonce = new(big.Int).SetUint64(c.nonce)