Skip to content

Commit 3d7b134

Browse files
authored
Add more detailed error logging (#504)
1 parent cfc6520 commit 3d7b134

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

pkg/ccip/chainaccessor/event.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ func (a *TONAccessor) bindContractEvent(ctx context.Context, contractName string
4343
consts.EventNameExecutionStateChanged,
4444
}
4545
default:
46+
a.lggr.Warnw("No event filters registered for unknown contract type",
47+
"contractName", contractName,
48+
"address", address.String())
4649
return nil // No events to bind for unknown contract types
4750
}
4851

pkg/logpoller/loader/loader.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,15 @@ func (l *rawTxLoader) listTransactionsWithBlock(ctx context.Context, addr *addre
230230
TxHash: txHash,
231231
}, &resp)
232232
if err != nil {
233-
return nil, nil, err
233+
return nil, nil, fmt.Errorf("failed to query liteserver for transactions (addr=%s, lt=%d, limit=%d): %w",
234+
addr.String(), lt, limit, err)
234235
}
235236

236237
switch t := resp.(type) {
237238
case ton.TransactionList:
238239
if len(t.Transactions) == 0 {
239-
return nil, nil, ton.ErrNoTransactionsWereFound
240+
return nil, nil, fmt.Errorf("no transactions found for address %s (lt=%d, limit=%d): %w",
241+
addr.String(), lt, limit, ton.ErrNoTransactionsWereFound)
240242
}
241243

242244
txList, err := cell.FromBOCMultiRoot(t.Transactions)
@@ -286,9 +288,11 @@ func (l *rawTxLoader) listTransactionsWithBlock(ctx context.Context, addr *addre
286288
return resTxs, resBlocks, nil
287289
case ton.LSError:
288290
if t.Code == 0 {
289-
return nil, nil, ton.ErrNoTransactionsWereFound
291+
return nil, nil, fmt.Errorf("liteserver returned empty transaction list for address %s (lt=%d, limit=%d): %w",
292+
addr.String(), lt, limit, ton.ErrNoTransactionsWereFound)
290293
}
291-
return nil, nil, t
294+
return nil, nil, fmt.Errorf("liteserver error for address %s (lt=%d, limit=%d, code=%d): %w",
295+
addr.String(), lt, limit, t.Code, t)
292296
}
293297

294298
return nil, nil, errors.New("unknown response type")

pkg/logpoller/service.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ func (lp *service) Replay(ctx context.Context, fromBlock uint32) error {
338338
if lp.replay.status != models.ReplayStatusPending {
339339
lp.replay.status = models.ReplayStatusRequested
340340
}
341+
lp.lggr.Infow("Replay requested", "fromBlock", fromBlock)
341342
return nil
342343
}
343344

0 commit comments

Comments
 (0)