node/pkg/solana: log quorum and emitter chain on settled VAAs

Change-Id: I8162ed3bfb77d0708a9dd910eb1ba757d73bc246
This commit is contained in:
Leo 2021-10-01 15:38:44 +02:00
parent 3ebde5ded9
commit 92d3ee577c
2 changed files with 20 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package processor
import (
"context"
"github.com/certusone/wormhole/node/pkg/common"
"github.com/certusone/wormhole/node/pkg/vaa"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"time"
@ -57,7 +58,6 @@ func (p *Processor) handleCleanup(ctx context.Context) {
// arrive, barring special circumstances. This is a better time to count misses than submission,
// because we submit right when we quorum rather than waiting for all observations to arrive.
s.settled = true
p.logger.Info("VAA considered settled", zap.String("digest", hash))
// Use either the most recent (in case of a VAA we haven't seen) or stored gs, if available.
var gs *common.GuardianSet
@ -67,6 +67,23 @@ func (p *Processor) handleCleanup(ctx context.Context) {
gs = p.gs
}
hasSigs := len(s.signatures)
wantSigs := CalculateQuorum(len(gs.Keys))
var chain vaa.ChainID
if s.ourVAA != nil {
chain = s.ourVAA.EmitterChain
}
p.logger.Info("VAA considered settled",
zap.String("digest", hash),
zap.Duration("delta", delta),
zap.Int("have_sigs", hasSigs),
zap.Int("required_sigs", wantSigs),
zap.Bool("quorum", hasSigs >= wantSigs),
zap.Stringer("emitter_chain", chain),
)
for _, k := range gs.Keys {
if _, ok := s.signatures[k]; ok {
aggregationStateFulfillment.WithLabelValues(k.Hex(), s.source, "present").Inc()

View File

@ -81,6 +81,8 @@ func (a SignatureData) String() string {
func (c ChainID) String() string {
switch c {
case 0:
return "unset"
case ChainIDSolana:
return "solana"
case ChainIDEthereum: