Skip to content

Commit bf7dad5

Browse files
committed
fix: unrecoverable errs
1 parent cc9b765 commit bf7dad5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

core/chainio/avs_writer.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"github.com/ethereum/go-ethereum/common"
1616
"github.com/ethereum/go-ethereum/core/types"
1717
servicemanager "github.com/yetanotherco/aligned_layer/contracts/bindings/AlignedLayerServiceManager"
18+
connection "github.com/yetanotherco/aligned_layer/core"
1819
"github.com/yetanotherco/aligned_layer/core/config"
1920
"github.com/yetanotherco/aligned_layer/core/utils"
2021
)
@@ -100,16 +101,19 @@ func (w *AvsWriter) SendAggregatedResponse(batchIdentifierHash [32]byte, batchMe
100101
err = w.checkRespondToTaskFeeLimit(tx, txOpts, batchIdentifierHash, senderAddress)
101102

102103
if err != nil {
103-
return nil, err
104+
return nil, connection.PermanentError{Inner: err}
104105
}
105106

106107
tx, err = w.AvsContractBindings.ServiceManager.RespondToTaskV2(&txOpts, batchMerkleRoot, senderAddress, nonSignerStakesAndSignature)
107108
if err != nil {
108109
// Retry with fallback
109110
tx, err = w.AvsContractBindings.ServiceManagerFallback.RespondToTaskV2(&txOpts, batchMerkleRoot, senderAddress, nonSignerStakesAndSignature)
110-
return tx, err
111+
if err != nil {
112+
return nil, connection.PermanentError{Inner: err}
113+
}
114+
return tx, nil
111115
}
112-
return tx, err
116+
return tx, nil
113117
}
114118

115119
return utils.SendTransactionWithInfiniteRetryAndBumpingGasPrice(executeTransaction, w.Client, tx.GasPrice())

core/utils/eth_client_utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func CalculateGasPriceBumpBasedOnRetry(currentGasPrice *big.Int, iteration int)
6161

6262
// Sends a transaction and waits for the receipt for three blocks, if not received
6363
// it will try again bumping the gas price based on `CalculateGasPriceBumpBasedOnRetry`
64-
// and pass it to beforeTransaction and executeTransaction (make sure you update the txOpts with the new price)
64+
// and pass it to executeTransaction (make sure you update the txOpts with the new gasPrice)
6565
// This process happens indefinitely until we get the receipt or the receipt status is an err.
6666
func SendTransactionWithInfiniteRetryAndBumpingGasPrice(executeTransaction func(*big.Int) (*types.Transaction, error), client eth.InstrumentedClient, baseGasPrice *big.Int) (*types.Receipt, error) {
6767
i := 0

0 commit comments

Comments
 (0)