|
7 | 7 | "fmt"
|
8 | 8 | "math/big"
|
9 | 9 | "strconv"
|
| 10 | + "strings" |
10 | 11 | "time"
|
11 | 12 |
|
12 | 13 | dbtypes "github.com/skip-mev/go-fast-solver/db"
|
@@ -215,7 +216,7 @@ func (r *OrderSettler) verifyOrderSettlements(ctx context.Context) error {
|
215 | 216 |
|
216 | 217 | if err = r.verifyOrderSettlement(ctx, settlement); err != nil {
|
217 | 218 | lmt.Logger(ctx).Warn(
|
218 |
| - "error verifying order settlement", |
| 219 | + "failed to verify order settlement", |
219 | 220 | zap.Error(err),
|
220 | 221 | zap.String("orderID", settlement.OrderID),
|
221 | 222 | zap.String("sourceChainID", settlement.SourceChainID),
|
@@ -395,6 +396,11 @@ func (r *OrderSettler) verifyOrderSettlement(ctx context.Context, settlement db.
|
395 | 396 | if settlement.SettlementStatus == dbtypes.SettlementStatusPending {
|
396 | 397 | gasCost, failure, err := destinationBridgeClient.GetTxResult(ctx, settlement.InitiateSettlementTx.String)
|
397 | 398 | if err != nil {
|
| 399 | + // Check if the error is due to tx not found |
| 400 | + if strings.Contains(err.Error(), "tx") && strings.Contains(err.Error(), "not found") && strings.Contains(err.Error(), settlement.InitiateSettlementTx.String) { |
| 401 | + // Transaction not yet indexed, we'll check again later |
| 402 | + return fmt.Errorf("transaction not yet indexed. will retry fetching next interval") |
| 403 | + } |
398 | 404 | return fmt.Errorf("failed to fetch message received event: %w", err)
|
399 | 405 | } else if failure != nil {
|
400 | 406 | lmt.Logger(ctx).Error("tx failed", zap.String("failure", failure.String()))
|
|
0 commit comments