@@ -76,7 +76,10 @@ func NewAvsWriterFromConfig(baseConfig *config.BaseConfig, ecdsaConfig *config.E
7676 }, nil
7777}
7878
79- func (w * AvsWriter ) SendAggregatedResponse (batchIdentifierHash [32 ]byte , batchMerkleRoot [32 ]byte , senderAddress [20 ]byte , nonSignerStakesAndSignature servicemanager.IBLSSignatureCheckerNonSignerStakesAndSignature ) (* types.Receipt , error ) {
79+ // Sends AggregatedResponse and waits for the receipt for three blocks, if not received
80+ // it will try again bumping the last tx gas price based on `CalculateGasPriceBump`
81+ // This process happens indefinitely until the transaction is included.
82+ func (w * AvsWriter ) SendAggregatedResponse (batchIdentifierHash [32 ]byte , batchMerkleRoot [32 ]byte , senderAddress [20 ]byte , nonSignerStakesAndSignature servicemanager.IBLSSignatureCheckerNonSignerStakesAndSignature , onRetry func ()) (* types.Receipt , error ) {
8083 txOpts := * w .Signer .GetTxOpts ()
8184 txOpts .NoSend = true // simulate the transaction
8285 tx , err := w .AvsContractBindings .ServiceManager .RespondToTaskV2 (& txOpts , batchMerkleRoot , senderAddress , nonSignerStakesAndSignature )
@@ -99,9 +102,6 @@ func (w *AvsWriter) SendAggregatedResponse(batchIdentifierHash [32]byte, batchMe
99102 txOpts .NoSend = false
100103 txOpts .Nonce = txNonce
101104
102- // Sends a transaction and waits for the receipt for three blocks, if not received
103- // it will try again bumping the gas price based on `CalculateGasPriceBumpBasedOnRetry`
104- // This process happens indefinitely until we sendTransaction does not return err.
105105 lastTxGasPrice := tx .GasPrice ()
106106 sendTransaction := func () (* types.Receipt , error ) {
107107 bumpedGasPrice := utils .CalculateGasPriceBump (lastTxGasPrice , gasBumpPercentage )
0 commit comments