From 6ab0fe385584a10485861f6a88282f6794777673 Mon Sep 17 00:00:00 2001 From: Leo Date: Fri, 1 Oct 2021 08:48:36 +0200 Subject: [PATCH] node/pkg/processor: add more log fields to message observations Change-Id: I19d804b6668623943f798356a7ed81c1000fa377 --- node/pkg/processor/message.go | 9 +++++++++ node/pkg/vaa/structs.go | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/node/pkg/processor/message.go b/node/pkg/processor/message.go index 4cc7b052..bce33328 100644 --- a/node/pkg/processor/message.go +++ b/node/pkg/processor/message.go @@ -3,6 +3,7 @@ package processor import ( "context" "encoding/hex" + "github.com/mr-tron/base58" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" @@ -81,7 +82,15 @@ func (p *Processor) handleMessage(ctx context.Context, k *common.MessagePublicat p.logger.Info("observed and signed confirmed message publication", zap.Stringer("source_chain", k.EmitterChain), zap.Stringer("txhash", k.TxHash), + zap.String("txhash_b58", base58.Encode(k.TxHash.Bytes())), zap.String("digest", hex.EncodeToString(digest.Bytes())), + zap.Uint32("nonce", k.Nonce), + zap.Uint64("sequence", k.Sequence), + zap.Stringer("emitter_chain", k.EmitterChain), + zap.Stringer("emitter_address", k.EmitterAddress), + zap.String("emitter_address_b58", base58.Encode(k.EmitterAddress.Bytes())), + zap.Uint8("consistency_level", k.ConsistencyLevel), + zap.String("message_id", v.MessageID()), zap.String("signature", hex.EncodeToString(s))) messagesSignedTotal.With(prometheus.Labels{ diff --git a/node/pkg/vaa/structs.go b/node/pkg/vaa/structs.go index 86f25453..4bb36be3 100644 --- a/node/pkg/vaa/structs.go +++ b/node/pkg/vaa/structs.go @@ -67,6 +67,10 @@ func (a Address) String() string { return hex.EncodeToString(a[:]) } +func (a Address) Bytes() []byte { + return a[:] +} + func (a SignatureData) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, a)), nil }