node/pkg/solana: log quorum and emitter chain on settled VAAs
Change-Id: I8162ed3bfb77d0708a9dd910eb1ba757d73bc246
This commit is contained in:
parent
3ebde5ded9
commit
92d3ee577c
|
@ -3,6 +3,7 @@ package processor
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/certusone/wormhole/node/pkg/common"
|
"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"
|
||||||
"github.com/prometheus/client_golang/prometheus/promauto"
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||||
"time"
|
"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,
|
// 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.
|
// because we submit right when we quorum rather than waiting for all observations to arrive.
|
||||||
s.settled = true
|
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.
|
// Use either the most recent (in case of a VAA we haven't seen) or stored gs, if available.
|
||||||
var gs *common.GuardianSet
|
var gs *common.GuardianSet
|
||||||
|
@ -67,6 +67,23 @@ func (p *Processor) handleCleanup(ctx context.Context) {
|
||||||
gs = p.gs
|
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 {
|
for _, k := range gs.Keys {
|
||||||
if _, ok := s.signatures[k]; ok {
|
if _, ok := s.signatures[k]; ok {
|
||||||
aggregationStateFulfillment.WithLabelValues(k.Hex(), s.source, "present").Inc()
|
aggregationStateFulfillment.WithLabelValues(k.Hex(), s.source, "present").Inc()
|
||||||
|
|
|
@ -81,6 +81,8 @@ func (a SignatureData) String() string {
|
||||||
|
|
||||||
func (c ChainID) String() string {
|
func (c ChainID) String() string {
|
||||||
switch c {
|
switch c {
|
||||||
|
case 0:
|
||||||
|
return "unset"
|
||||||
case ChainIDSolana:
|
case ChainIDSolana:
|
||||||
return "solana"
|
return "solana"
|
||||||
case ChainIDEthereum:
|
case ChainIDEthereum:
|
||||||
|
|
Loading…
Reference in New Issue