Skip to content

Commit b977b42

Browse files
committed
improve log output
1 parent ee48bba commit b977b42

6 files changed

Lines changed: 25 additions & 6 deletions

File tree

node/pkg/watchers/algorand/watcher.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,14 @@ func lookAtTxn(e *Watcher, t types.SignedTxnInBlock, b types.Block, logger *zap.
181181
for _, obs := range observations {
182182
timestamp, err := vaa.TimeFromUnix(b.TimeStamp)
183183
if err != nil {
184-
logger.Error("invalid block timestamp", zap.Error(err), zap.Int64("timestamp", b.TimeStamp))
184+
logger.Error("invalid block timestamp",
185+
zap.Error(err),
186+
zap.Int64("timestamp", b.TimeStamp),
187+
zap.String("txHash", hex.EncodeToString(txHash.Bytes())),
188+
zap.Uint64("nonce", uint64(obs.nonce)),
189+
zap.Uint64("sequence", obs.sequence),
190+
zap.String("emitter", hex.EncodeToString(obs.emitterAddress[:])),
191+
)
185192
return
186193
}
187194

node/pkg/watchers/aptos/watcher.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,15 @@ func (e *Watcher) observeData(logger *zap.Logger, data gjson.Result, nativeSeq u
556556
}
557557
timestamp, err := vaa.TimeFromUnix(ts.Uint())
558558
if err != nil {
559-
logger.Error("invalid timestamp", zap.Error(err), zap.Uint64("timestamp", ts.Uint()))
559+
logger.Error("invalid timestamp",
560+
zap.Error(err),
561+
zap.Uint64("timestamp", ts.Uint()),
562+
zap.String("txHash", txHash.Hex()),
563+
zap.Uint64("nonce", nonce.Uint()),
564+
zap.Uint64("sequence", sequence.Uint()),
565+
zap.Stringer("emitter", a),
566+
zap.Stringer("chainID", e.chainID),
567+
)
560568
return
561569
}
562570

node/pkg/watchers/evm/by_transaction.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ func MessageEventsForTransaction(
9494
}
9595
timestamp, err := vaa.TimeFromUnix(blockTime)
9696
if err != nil {
97-
return nil, 0, nil, fmt.Errorf("invalid block timestamp: %w", err)
97+
return nil, 0, nil, fmt.Errorf("invalid block timestamp for tx %s at block %d (time %d): %w",
98+
tx.Hex(), ev.Raw.BlockNumber, blockTime, err)
9899
}
99100

100101
message := &common.MessagePublication{

node/pkg/watchers/near/tx_processing.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ func (e *Watcher) processWormholeLog(logger *zap.Logger, _ context.Context, job
236236
ts := outcomeBlockHeader.Timestamp
237237
timestamp, err := vaa.TimeFromUnix(ts)
238238
if err != nil {
239-
return fmt.Errorf("invalid block timestamp: %w", err)
239+
return fmt.Errorf("invalid block timestamp for tx %s (block %d, time %d, seq %d): %w",
240+
job.txHash, outcomeBlockHeader.Height, ts, pubEvent.Seq, err)
240241
}
241242

242243
observation := &common.MessagePublication{

node/pkg/watchers/solana/shim.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,8 @@ func (s *SolanaWatcher) shimProcessRest(
359359
}
360360
timestamp, err := vaa.TimeFromUnix(messageEvent.Timestamp)
361361
if err != nil {
362-
return fmt.Errorf("invalid shim message timestamp: %w", err)
362+
return fmt.Errorf("invalid shim message timestamp for tx %s shim idx %d (seq %d, time %d): %w",
363+
tx.Signatures[0].String(), outerIdx, messageEvent.Sequence, messageEvent.Timestamp, err)
363364
}
364365

365366
observation := &common.MessagePublication{

node/pkg/watchers/sui/watcher.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ func (e *Watcher) processEvent(ctx context.Context, logger *zap.Logger, event su
190190
txHashEthFormat := eth_common.BytesToHash(txHashBytes)
191191
timestamp, err := vaa.TimeFromUnix(msg.Timestamp)
192192
if err != nil {
193-
return fmt.Errorf("processEvent failed to parse timestamp: %w", err)
193+
return fmt.Errorf("processEvent failed to parse timestamp for tx %s (nonce %d, seq %d, time %d): %w",
194+
txDigest, msg.Nonce, msg.Sequence, msg.Timestamp, err)
194195
}
195196

196197
observation := &common.MessagePublication{

0 commit comments

Comments
 (0)