Skip to content

Commit 9eef24f

Browse files
committed
reafactor: receipt timeout constant
1 parent 959694b commit 9eef24f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/chainio/avs_writer.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ import (
2121
)
2222

2323
const (
24-
gasBumpPercentage int = 20
24+
GasBumpPercentage int = 20
25+
// wait as much as 3 blocks time for the receipt
26+
SendAggregateResponseReceiptTimeout time.Duration = time.Second * 36
2527
)
2628

2729
type AvsWriter struct {
@@ -119,7 +121,7 @@ func (w *AvsWriter) SendAggregatedResponse(batchIdentifierHash [32]byte, batchMe
119121
return nil, fmt.Errorf("transaction simulation failed: %v", err)
120122
}
121123
}
122-
txOpts.GasPrice = utils.CalculateGasPriceBumpBasedOnRetry(gasPrice, gasBumpPercentage, i)
124+
txOpts.GasPrice = utils.CalculateGasPriceBumpBasedOnRetry(gasPrice, GasBumpPercentage, i)
123125

124126
w.logger.Infof("Sending ResponseToTask transaction with a gas price of %v", txOpts.GasPrice)
125127
err = w.checkRespondToTaskFeeLimit(tx, txOpts, batchIdentifierHash, senderAddress)
@@ -137,7 +139,7 @@ func (w *AvsWriter) SendAggregatedResponse(batchIdentifierHash [32]byte, batchMe
137139
}
138140
}
139141

140-
ctx, cancel := context.WithTimeout(context.Background(), time.Second*36)
142+
ctx, cancel := context.WithTimeout(context.Background(), SendAggregateResponseReceiptTimeout)
141143
defer cancel()
142144
receipt, err := utils.WaitForTransactionReceipt(w.Client, ctx, tx.Hash())
143145

0 commit comments

Comments
 (0)