parent
972c0aada0
commit
d2dcb57e61
|
@ -2,11 +2,28 @@ package common
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
gossipv1 "github.com/certusone/wormhole/node/pkg/proto/gossip/v1"
|
gossipv1 "github.com/certusone/wormhole/node/pkg/proto/gossip/v1"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/libp2p/go-libp2p-core/peer"
|
"github.com/libp2p/go-libp2p-core/peer"
|
||||||
"sync"
|
|
||||||
"time"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
gsIndex = promauto.NewGauge(
|
||||||
|
prometheus.GaugeOpts{
|
||||||
|
Name: "wormhole_guardian_set_index",
|
||||||
|
Help: "The guardians set index",
|
||||||
|
})
|
||||||
|
gsSigners = promauto.NewGauge(
|
||||||
|
prometheus.GaugeOpts{
|
||||||
|
Name: "wormhole_guardian_set_signers",
|
||||||
|
Help: "Number of signers in the guardian set.",
|
||||||
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
// MaxGuardianCount specifies the maximum number of guardians supported by on-chain contracts.
|
// MaxGuardianCount specifies the maximum number of guardians supported by on-chain contracts.
|
||||||
|
@ -75,6 +92,8 @@ func NewGuardianSetState() *GuardianSetState {
|
||||||
|
|
||||||
func (st *GuardianSetState) Set(set *GuardianSet) {
|
func (st *GuardianSetState) Set(set *GuardianSet) {
|
||||||
st.mu.Lock()
|
st.mu.Lock()
|
||||||
|
gsIndex.Set(float64(set.Index))
|
||||||
|
gsSigners.Set(float64(len(set.Keys)))
|
||||||
defer st.mu.Unlock()
|
defer st.mu.Unlock()
|
||||||
|
|
||||||
st.current = set
|
st.current = set
|
||||||
|
|
Loading…
Reference in New Issue