Skip to content

Commit f0af68a

Browse files
fix: aggregator 2x bump in mainnet (#1551)
Co-authored-by: Julian Arce <[email protected]>
1 parent 65bac39 commit f0af68a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

core/chainio/avs_writer.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func (w *AvsWriter) SendAggregatedResponse(batchIdentifierHash [32]byte, batchMe
100100
// Set the nonce, as we might have to replace the transaction with a higher gas price
101101
txNonce := big.NewInt(int64(simTx.Nonce()))
102102
txOpts.Nonce = txNonce
103-
txOpts.GasPrice = simTx.GasPrice()
103+
txOpts.GasPrice = nil
104104
txOpts.NoSend = false
105105
i := 0
106106

@@ -113,7 +113,16 @@ func (w *AvsWriter) SendAggregatedResponse(batchIdentifierHash [32]byte, batchMe
113113
if err != nil {
114114
return nil, err
115115
}
116-
previousTxGasPrice := txOpts.GasPrice
116+
117+
// if txOpts.GasPrice wasn't previously set use the fetched gasPrice
118+
// this should happen on the first iteration only
119+
var previousTxGasPrice *big.Int
120+
if txOpts.GasPrice == nil {
121+
previousTxGasPrice = gasPrice
122+
} else {
123+
previousTxGasPrice = txOpts.GasPrice
124+
}
125+
117126
// in order to avoid replacement transaction underpriced
118127
// the bumped gas price has to be at least 10% higher than the previous one.
119128
minimumGasPriceBump := utils.CalculateGasPriceBumpBasedOnRetry(previousTxGasPrice, 10, 0, gasBumpPercentageLimit, 0)

0 commit comments

Comments
 (0)