From a29158ce72b0ea19ee9e6844d65b3cab6f5cd2ff Mon Sep 17 00:00:00 2001 From: John Saigle Date: Tue, 16 Jul 2024 16:14:01 -0400 Subject: [PATCH] node: Add additional metrics for Governor status Modify the monitoring code and protobuf files to make the status of the Governor more legible when flow-canceling is enabled. This can be consumed by Wormhole Dashboard to better reflect the effects of flow cancelling. On the level of the Governor: - whether the Guardian has enabled flow cancel or not On the level of the Governor's emitters, reports 24h metrics for: - net value that has moved across the chain - total outgoing amount - total incoming flow cancel amount Currently big transfers are not accounted for as they do not affect the Governor's capacity. (They are always queued.) --- node/pkg/governor/governor_monitoring.go | 169 +++++++++++++++-------- node/pkg/governor/governor_test.go | 4 +- node/pkg/proto/gossip/v1/gossip.pb.go | 129 +++++++++++------ proto/gossip/v1/gossip.proto | 4 + 4 files changed, 206 insertions(+), 100 deletions(-) diff --git a/node/pkg/governor/governor_monitoring.go b/node/pkg/governor/governor_monitoring.go index bcd84c874b..3c384f0f93 100644 --- a/node/pkg/governor/governor_monitoring.go +++ b/node/pkg/governor/governor_monitoring.go @@ -102,14 +102,14 @@ func (gov *ChainGovernor) Status() (resp string) { startTime := time.Now().Add(-time.Minute * time.Duration(gov.dayLengthInMinutes)) for _, ce := range gov.chains { - valueTrans, err := sumValue(ce.transfers, startTime) + netValue, _, _, err := sumValue(ce.transfers, startTime) if err != nil { // We don't want to actually return an error or otherwise stop // execution in this case. Instead of propagating the error here, print the contents of the // error message. return fmt.Sprintf("chain: %v, dailyLimit: OVERFLOW. error: %s", ce.emitterChainId, err) } - s1 := fmt.Sprintf("chain: %v, dailyLimit: %v, total: %v, numPending: %v", ce.emitterChainId, ce.dailyLimit, valueTrans, len(ce.pending)) + s1 := fmt.Sprintf("chain: %v, dailyLimit: %v, total: %v, numPending: %v", ce.emitterChainId, ce.dailyLimit, netValue, len(ce.pending)) resp += s1 + "\n" gov.logger.Info(s1) if len(ce.pending) != 0 { @@ -245,74 +245,112 @@ func (gov *ChainGovernor) resetReleaseTimerForTime(vaaId string, now time.Time) } return "", fmt.Errorf("vaa not found in the pending list") + } -// sumValue sums the value of all `transfers`. See also `TrimAndSumValue`. +// sumValue sums the value of all `transfers`, returning separate fields for: +// - the net sum of all outgoing small tranasfers minus flow cancel sum +// - the sum of all outgoing small tranasfers +// - the sum of all incoming flow-cancelling transfers +// NOTE these sums exclude "big transfers" as they are always queued for 24h and are never added to the chain entry's 'transfers' field. // Returns an error if the sum of all transfers would overflow the bounds of Int64. In this case, the function // returns a value of 0. -func sumValue(transfers []transfer, startTime time.Time) (uint64, error) { +func sumValue(transfers []transfer, startTime time.Time) (netNotional int64, smallTxOutgoingNotional uint64, flowCancelNotional uint64, err error) { if len(transfers) == 0 { - return 0, nil + return 0, 0, 0, nil } - var sum int64 + // Sum of all outgoing small tranasfers minus incoming flow cancel transfers. Big transfers are excluded + netNotional = int64(0) + smallTxOutgoingNotional = uint64(0) + flowCancelNotional = uint64(0) for _, t := range transfers { if t.dbTransfer.Timestamp.Before(startTime) { continue } - checkedSum, err := CheckedAddInt64(sum, t.value) + checkedSum, err := CheckedAddInt64(netNotional, t.value) if err != nil { // We have to stop and return an error here (rather than saturate, for example). The // transfers are not sorted by value so we can't make any guarantee on the final value // if we hit the upper or lower bound. We don't expect this to happen in any case. - return 0, err + return 0, 0, 0, err + } + netNotional = checkedSum + if t.value < 0 { + // If a transfer is negative then it is an incoming, flow-cancelling transfer. + // We can use the dbTransfer.Value for calculating the sum because it is the unsigned version + // of t.Value + flowCancelNotional += t.dbTransfer.Value + } else { + smallTxOutgoingNotional += t.dbTransfer.Value } - sum = checkedSum - } - - // Do not return negative values. Instead, saturate to zero. - if sum <= 0 { - return 0, nil } - return uint64(sum), nil + return netNotional, smallTxOutgoingNotional, flowCancelNotional, nil } // REST query to get the current available notional value per chain. This is defined as the sum of all transfers // subtracted from the chains's dailyLimit. +// The available notional limit by chain represents the remaining capacity of a chain. As a result, it should not be +// a negative number: we don't want to represent that there is "negative value" available. func (gov *ChainGovernor) GetAvailableNotionalByChain() (resp []*publicrpcv1.GovernorGetAvailableNotionalByChainResponse_Entry) { gov.mutex.Lock() defer gov.mutex.Unlock() startTime := time.Now().Add(-time.Minute * time.Duration(gov.dayLengthInMinutes)) + // Iterate deterministically by accessing keys from this slice instead of the chainEntry map directly for _, chainId := range gov.chainIds { ce := gov.chains[chainId] - value, err := sumValue(ce.transfers, startTime) + netUsage, _, incoming, err := sumValue(ce.transfers, startTime) if err != nil { - // Don't return an error here, just return 0. - gov.logger.Error("GetAvailableNotionalByChain: failed to compute sum of transfers for chain entry", zap.String("chainID", chainId.String()), zap.Error(err)) - return make([]*publicrpcv1.GovernorGetAvailableNotionalByChainResponse_Entry, 0) + // Report 0 available notional if we can't calculate the current usage + gov.logger.Error("GetAvailableNotionalByChain: failed to compute sum of transfers for chain entry", + zap.String("chainID", chainId.String()), + zap.Error(err)) + resp = append(resp, &publicrpcv1.GovernorGetAvailableNotionalByChainResponse_Entry{ + ChainId: uint32(ce.emitterChainId), + RemainingAvailableNotional: 0, + NotionalLimit: ce.dailyLimit, + BigTransactionSize: ce.bigTransactionSize, + }) + continue } - if value >= ce.dailyLimit { - value = 0 - } else { - value = ce.dailyLimit - value + + remaining := gov.availableNotionalValue(chainId, netUsage) + + if !gov.flowCancelEnabled { + // When flow cancel is disabled, we expect that both the netUsage and remaining notional should be + // within the range of [0, dailyLimit]. Flow cancel allows flexibility here. netUsage may be + // negative if there is a lot of incoming flow; conversely, it may exceed dailyLimit if incoming + // flow added space, allowed additional transfers through, and then expired after 24h. + if netUsage < 0 || incoming != 0 { + gov.logger.Warn("GetAvailableNotionalByChain: net value for chain is negative even though flow cancel is disabled", + zap.String("chainID", chainId.String()), + zap.Uint64("dailyLimit", ce.dailyLimit), + zap.Int64("netUsage", netUsage), + zap.Error(err)) + } else if uint64(netUsage) > ce.dailyLimit { + gov.logger.Warn("GetAvailableNotionalByChain: net value for chain exceeds daily limit even though flow cancel is disabled", + zap.String("chainID", chainId.String()), + zap.Uint64("dailyLimit", ce.dailyLimit), + zap.Error(err)) + } + + resp = append(resp, &publicrpcv1.GovernorGetAvailableNotionalByChainResponse_Entry{ + ChainId: uint32(ce.emitterChainId), + RemainingAvailableNotional: remaining, + NotionalLimit: ce.dailyLimit, + BigTransactionSize: ce.bigTransactionSize, + }) } - resp = append(resp, &publicrpcv1.GovernorGetAvailableNotionalByChainResponse_Entry{ - ChainId: uint32(ce.emitterChainId), - RemainingAvailableNotional: value, - NotionalLimit: ce.dailyLimit, - BigTransactionSize: ce.bigTransactionSize, + sort.SliceStable(resp, func(i, j int) bool { + return (resp[i].ChainId < resp[j].ChainId) }) } - sort.SliceStable(resp, func(i, j int) bool { - return (resp[i].ChainId < resp[j].ChainId) - }) - return resp } @@ -372,6 +410,25 @@ func (gov *ChainGovernor) IsVAAEnqueued(msgId *publicrpcv1.MessageID) (bool, err return false, nil } +// availableNotionalValue calculates the available notional USD value for a chain entry based on the net value +// of the chain. +func (gov *ChainGovernor) availableNotionalValue(id vaa.ChainID, netUsage int64) uint64 { + remaining := uint64(0) + ce := gov.chains[id] + + // Handle negative case here so we can safely cast to uint64 below + if netUsage < 0 { + // The full capacity is available for the chain. + remaining = ce.dailyLimit + } else if uint64(netUsage) > ce.dailyLimit { + remaining = 0 + } else { + remaining = ce.dailyLimit - uint64(netUsage) + } + + return remaining +} + // REST query to get the list of tokens being monitored by the governor. func (gov *ChainGovernor) GetTokenList() []*publicrpcv1.GovernorGetTokenListResponse_Entry { gov.mutex.Lock() @@ -448,22 +505,21 @@ func (gov *ChainGovernor) CollectMetrics(hb *gossipv1.Heartbeat, sendC chan<- [] if exists { enabled = "1" - value, err := sumValue(ce.transfers, startTime) + netUsage, _, _, err := sumValue(ce.transfers, startTime) + + remaining := uint64(0) if err != nil { // Error can occur if the sum overflows. Return 0 in this case rather than returning an // error. gov.logger.Error("CollectMetrics: failed to compute sum of transfers for chain entry", zap.String("chain", chain.String()), zap.Error(err)) - value = 0 - } - if value >= ce.dailyLimit { - value = 0 + remaining = 0 } else { - value = ce.dailyLimit - value + remaining = gov.availableNotionalValue(chain, netUsage) } pending := len(ce.pending) totalNotional = fmt.Sprint(ce.dailyLimit) - available = float64(value) + available = float64(remaining) numPending = float64(pending) totalPending += pending } @@ -523,11 +579,12 @@ func (gov *ChainGovernor) publishConfig(hb *gossipv1.Heartbeat, sendC chan<- []b gov.configPublishCounter += 1 payload := &gossipv1.ChainGovernorConfig{ - NodeName: hb.NodeName, - Counter: gov.configPublishCounter, - Timestamp: hb.Timestamp, - Chains: chains, - Tokens: tokens, + NodeName: hb.NodeName, + Counter: gov.configPublishCounter, + Timestamp: hb.Timestamp, + Chains: chains, + Tokens: tokens, + FlowCancelEnabled: gov.flowCancelEnabled, } b, err := proto.Marshal(payload) @@ -563,18 +620,13 @@ func (gov *ChainGovernor) publishStatus(hb *gossipv1.Heartbeat, sendC chan<- []b numEnqueued := 0 for chainId, ce := range gov.chains { // The capacity for the chain to emit further messages, denoted as USD value. - remainingAvailableNotional := uint64(0) - // A chain's governor usage is the sum of all outgoing transfers and incoming flow-cancelling transfers - governorUsage, err := sumValue(ce.transfers, startTime) + remaining := uint64(0) + netUsage, smallTxNotional, flowCancelNotional, err := sumValue(ce.transfers, startTime) if err != nil { - // In case of error, set remainingAvailableNotional to 0 rather than returning an error to the caller. An error - // here means sumValue has encountered an overflow and this should never happen. Even if it did - // we don't want to stop execution here. gov.logger.Error("publishStatus: failed to compute sum of transfers for chain entry", zap.String("chain", chainId.String()), zap.Error(err)) - } else if governorUsage < ce.dailyLimit { - // `remainingAvailableNotional` is 0 unless the current usage is strictly less than the limit. - remainingAvailableNotional = ce.dailyLimit - governorUsage + } else { + remaining = gov.availableNotionalValue(chainId, netUsage) } enqueuedVaas := make([]*gossipv1.ChainGovernorStatus_EnqueuedVAA, 0) @@ -597,14 +649,17 @@ func (gov *ChainGovernor) publishStatus(hb *gossipv1.Heartbeat, sendC chan<- []b } emitter := gossipv1.ChainGovernorStatus_Emitter{ - EmitterAddress: "0x" + ce.emitterAddr.String(), - TotalEnqueuedVaas: uint64(len(ce.pending)), - EnqueuedVaas: enqueuedVaas, + EmitterAddress: "0x" + ce.emitterAddr.String(), + TotalEnqueuedVaas: uint64(len(ce.pending)), + EnqueuedVaas: enqueuedVaas, + SmallTxNetNotionalValue: netUsage, + SmallTxOutgingNotionalValue: smallTxNotional, + FlowCancelNotionalValue: flowCancelNotional, } chains = append(chains, &gossipv1.ChainGovernorStatus_Chain{ ChainId: uint32(ce.emitterChainId), - RemainingAvailableNotional: remainingAvailableNotional, + RemainingAvailableNotional: remaining, Emitters: []*gossipv1.ChainGovernorStatus_Emitter{&emitter}, }) } diff --git a/node/pkg/governor/governor_test.go b/node/pkg/governor/governor_test.go index 30527408f4..7e43ddbdd1 100644 --- a/node/pkg/governor/governor_test.go +++ b/node/pkg/governor/governor_test.go @@ -2322,9 +2322,9 @@ func TestLargeTransactionGetsEnqueuedAndReleasedWhenTheTimerExpires(t *testing.T // But the big transaction should not affect the daily notional. ce, exists := gov.chains[vaa.ChainIDEthereum] require.Equal(t, true, exists) - valueTrans, err = sumValue(ce.transfers, now) + _, _, outgoing, err := sumValue(ce.transfers, now) require.NoError(t, err) - assert.Equal(t, uint64(0), valueTrans) + assert.Equal(t, uint64(0), outgoing) } func TestSmallTransactionsGetReleasedWhenTheTimerExpires(t *testing.T) { diff --git a/node/pkg/proto/gossip/v1/gossip.pb.go b/node/pkg/proto/gossip/v1/gossip.pb.go index 96ab3498eb..32e273c4cb 100644 --- a/node/pkg/proto/gossip/v1/gossip.pb.go +++ b/node/pkg/proto/gossip/v1/gossip.pb.go @@ -720,11 +720,12 @@ type ChainGovernorConfig struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - NodeName string `protobuf:"bytes,1,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - Counter int64 `protobuf:"varint,2,opt,name=counter,proto3" json:"counter,omitempty"` - Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Chains []*ChainGovernorConfig_Chain `protobuf:"bytes,4,rep,name=chains,proto3" json:"chains,omitempty"` - Tokens []*ChainGovernorConfig_Token `protobuf:"bytes,5,rep,name=tokens,proto3" json:"tokens,omitempty"` + NodeName string `protobuf:"bytes,1,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` + Counter int64 `protobuf:"varint,2,opt,name=counter,proto3" json:"counter,omitempty"` + Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Chains []*ChainGovernorConfig_Chain `protobuf:"bytes,4,rep,name=chains,proto3" json:"chains,omitempty"` + Tokens []*ChainGovernorConfig_Token `protobuf:"bytes,5,rep,name=tokens,proto3" json:"tokens,omitempty"` + FlowCancelEnabled bool `protobuf:"varint,6,opt,name=flow_cancel_enabled,json=flowCancelEnabled,proto3" json:"flow_cancel_enabled,omitempty"` } func (x *ChainGovernorConfig) Reset() { @@ -794,6 +795,13 @@ func (x *ChainGovernorConfig) GetTokens() []*ChainGovernorConfig_Token { return nil } +func (x *ChainGovernorConfig) GetFlowCancelEnabled() bool { + if x != nil { + return x.FlowCancelEnabled + } + return false +} + // This message is published every minute. type SignedChainGovernorStatus struct { state protoimpl.MessageState @@ -1341,9 +1349,12 @@ type ChainGovernorStatus_Emitter struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - EmitterAddress string `protobuf:"bytes,1,opt,name=emitter_address,json=emitterAddress,proto3" json:"emitter_address,omitempty"` // human-readable hex-encoded (leading 0x) - TotalEnqueuedVaas uint64 `protobuf:"varint,2,opt,name=total_enqueued_vaas,json=totalEnqueuedVaas,proto3" json:"total_enqueued_vaas,omitempty"` - EnqueuedVaas []*ChainGovernorStatus_EnqueuedVAA `protobuf:"bytes,3,rep,name=enqueued_vaas,json=enqueuedVaas,proto3" json:"enqueued_vaas,omitempty"` // Only the first 20 will be included. + EmitterAddress string `protobuf:"bytes,1,opt,name=emitter_address,json=emitterAddress,proto3" json:"emitter_address,omitempty"` // human-readable hex-encoded (leading 0x) + TotalEnqueuedVaas uint64 `protobuf:"varint,2,opt,name=total_enqueued_vaas,json=totalEnqueuedVaas,proto3" json:"total_enqueued_vaas,omitempty"` + EnqueuedVaas []*ChainGovernorStatus_EnqueuedVAA `protobuf:"bytes,3,rep,name=enqueued_vaas,json=enqueuedVaas,proto3" json:"enqueued_vaas,omitempty"` // Only the first 20 will be included. + SmallTxNetNotionalValue int64 `protobuf:"varint,4,opt,name=small_tx_net_notional_value,json=smallTxNetNotionalValue,proto3" json:"small_tx_net_notional_value,omitempty"` + SmallTxOutgingNotionalValue uint64 `protobuf:"varint,5,opt,name=small_tx_outging_notional_value,json=smallTxOutgingNotionalValue,proto3" json:"small_tx_outging_notional_value,omitempty"` + FlowCancelNotionalValue uint64 `protobuf:"varint,6,opt,name=flow_cancel_notional_value,json=flowCancelNotionalValue,proto3" json:"flow_cancel_notional_value,omitempty"` } func (x *ChainGovernorStatus_Emitter) Reset() { @@ -1399,6 +1410,27 @@ func (x *ChainGovernorStatus_Emitter) GetEnqueuedVaas() []*ChainGovernorStatus_E return nil } +func (x *ChainGovernorStatus_Emitter) GetSmallTxNetNotionalValue() int64 { + if x != nil { + return x.SmallTxNetNotionalValue + } + return 0 +} + +func (x *ChainGovernorStatus_Emitter) GetSmallTxOutgingNotionalValue() uint64 { + if x != nil { + return x.SmallTxOutgingNotionalValue + } + return 0 +} + +func (x *ChainGovernorStatus_Emitter) GetFlowCancelNotionalValue() uint64 { + if x != nil { + return x.FlowCancelNotionalValue + } + return 0 +} + type ChainGovernorStatus_Chain struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1586,8 +1618,8 @@ var file_gossip_v1_gossip_proto_rawDesc = []byte{ 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x67, 0x75, 0x61, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x0c, 0x67, 0x75, 0x61, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x22, 0xd1, - 0x03, 0x0a, 0x13, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, + 0x52, 0x0c, 0x67, 0x75, 0x61, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x22, 0x81, + 0x04, 0x0a, 0x13, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x02, @@ -1601,7 +1633,10 @@ var file_gossip_v1_gossip_proto_rawDesc = []byte{ 0x65, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, - 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x1a, 0x7b, 0x0a, 0x05, 0x43, 0x68, 0x61, 0x69, 0x6e, + 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x66, 0x6c, 0x6f, 0x77, 0x5f, + 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x66, 0x6c, 0x6f, 0x77, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x7b, 0x0a, 0x05, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, @@ -1623,7 +1658,7 @@ var file_gossip_v1_gossip_proto_rawDesc = []byte{ 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x67, 0x75, 0x61, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x67, 0x75, - 0x61, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x22, 0x98, 0x05, 0x0a, 0x13, 0x43, + 0x61, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x22, 0xd9, 0x06, 0x0a, 0x13, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, @@ -1643,7 +1678,7 @@ var file_gossip_v1_gossip_proto_rawDesc = []byte{ 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x6e, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x78, - 0x48, 0x61, 0x73, 0x68, 0x1a, 0xb3, 0x01, 0x0a, 0x07, 0x45, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, + 0x48, 0x61, 0x73, 0x68, 0x1a, 0xf4, 0x02, 0x0a, 0x07, 0x45, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x74, 0x6f, 0x74, @@ -1654,34 +1689,46 @@ var file_gossip_v1_gossip_proto_rawDesc = []byte{ 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x45, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x56, 0x41, 0x41, 0x52, 0x0c, 0x65, 0x6e, - 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x56, 0x61, 0x61, 0x73, 0x1a, 0xa8, 0x01, 0x0a, 0x05, 0x43, - 0x68, 0x61, 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, - 0x40, 0x0a, 0x1c, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x76, 0x61, - 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1a, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, - 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x61, - 0x6c, 0x12, 0x42, 0x0a, 0x08, 0x65, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x68, 0x61, 0x69, 0x6e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x2e, 0x45, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x52, 0x08, 0x65, 0x6d, 0x69, - 0x74, 0x74, 0x65, 0x72, 0x73, 0x22, 0x57, 0x0a, 0x12, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x5a, - 0x0a, 0x13, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x75, 0x73, 0x6f, - 0x6e, 0x65, 0x2f, 0x77, 0x6f, 0x72, 0x6d, 0x68, 0x6f, 0x6c, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, - 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x73, 0x73, 0x69, - 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x76, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x56, 0x61, 0x61, 0x73, 0x12, 0x3c, 0x0a, 0x1b, 0x73, 0x6d, + 0x61, 0x6c, 0x6c, 0x5f, 0x74, 0x78, 0x5f, 0x6e, 0x65, 0x74, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x17, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x54, 0x78, 0x4e, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x44, 0x0a, 0x1f, 0x73, 0x6d, 0x61, 0x6c, + 0x6c, 0x5f, 0x74, 0x78, 0x5f, 0x6f, 0x75, 0x74, 0x67, 0x69, 0x6e, 0x67, 0x5f, 0x6e, 0x6f, 0x74, + 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x1b, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x54, 0x78, 0x4f, 0x75, 0x74, 0x67, 0x69, 0x6e, + 0x67, 0x4e, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3b, + 0x0a, 0x1a, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x17, 0x66, 0x6c, 0x6f, 0x77, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4e, 0x6f, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0xa8, 0x01, 0x0a, 0x05, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, + 0x12, 0x40, 0x0a, 0x1c, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x76, + 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1a, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, + 0x67, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x74, 0x69, 0x6f, 0x6e, + 0x61, 0x6c, 0x12, 0x42, 0x0a, 0x08, 0x65, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x2e, 0x45, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x52, 0x08, 0x65, 0x6d, + 0x69, 0x74, 0x74, 0x65, 0x72, 0x73, 0x22, 0x57, 0x0a, 0x12, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, + 0x5a, 0x0a, 0x13, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x42, 0x41, 0x5a, 0x3f, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x75, 0x73, + 0x6f, 0x6e, 0x65, 0x2f, 0x77, 0x6f, 0x72, 0x6d, 0x68, 0x6f, 0x6c, 0x65, 0x2f, 0x6e, 0x6f, 0x64, + 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x73, 0x73, + 0x69, 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x76, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/gossip/v1/gossip.proto b/proto/gossip/v1/gossip.proto index 914d707f01..f2e5c6486c 100644 --- a/proto/gossip/v1/gossip.proto +++ b/proto/gossip/v1/gossip.proto @@ -156,6 +156,7 @@ message ChainGovernorConfig { int64 timestamp = 3; repeated Chain chains = 4; repeated Token tokens = 5; + bool flow_cancel_enabled = 6; } // This message is published every minute. @@ -182,6 +183,9 @@ message ChainGovernorStatus { string emitter_address = 1; // human-readable hex-encoded (leading 0x) uint64 total_enqueued_vaas = 2; repeated EnqueuedVAA enqueued_vaas = 3; // Only the first 20 will be included. + int64 small_tx_net_notional_value = 4; + uint64 small_tx_outging_notional_value = 5; + uint64 flow_cancel_notional_value = 6; } message Chain {