node: add MessageID to observation messages

This allows us to associate an observation from the log
for messages that the local node did not observe.

Change-Id: I6ece7bfe3e6b878bdb7ee4ac03c81cb424a329b3
This commit is contained in:
Leo 2021-10-04 17:43:19 +02:00
parent c253f769fa
commit b577b70b2e
3 changed files with 6 additions and 1 deletions

View File

@ -33,6 +33,7 @@ func (p *Processor) broadcastSignature(v *vaa.VAA, signature []byte, txhash []by
Hash: digest.Bytes(),
Signature: signature,
TxHash: txhash,
MessageId: v.MessageID(),
}
w := gossipv1.GossipMessage{Message: &gossipv1.GossipMessage_SignedObservation{SignedObservation: &obsv}}

View File

@ -59,6 +59,7 @@ func (p *Processor) handleObservation(ctx context.Context, m *gossipv1.SignedObs
zap.String("addr", hex.EncodeToString(m.Addr)),
zap.String("txhash", hex.EncodeToString(m.TxHash)),
zap.String("txhash_b58", base58.Encode(m.TxHash)),
zap.String("message_id", m.MessageId),
)
observationsReceivedTotal.Inc()

View File

@ -81,6 +81,9 @@ message SignedObservation {
// Transaction hash this observation was made from.
// Optional, included for observability.
bytes tx_hash = 4;
// Message ID (chain/emitter/seq) for this observation.
// Optional, included for observability.
string message_id = 5;
}
// A SignedVAAWithQuorum message is sent by nodes whenever one of the VAAs they observed