From ef4ecf5cf9c3d6a3050833deddb3c1fe48518e15 Mon Sep 17 00:00:00 2001 From: wwestgarth Date: Thu, 12 Oct 2023 17:08:17 +0100 Subject: [PATCH] feat: add referral set spam stats to core API --- CHANGELOG.md | 1 + core/api/core.go | 3 + core/protocol/all_services.go | 2 +- core/spam/engine.go | 6 + protos/sources/vega/api/v1/core.proto | 22 +- protos/vega/api/v1/core.pb.go | 266 +++++++++++++---------- wallet/api/node/adapters/grpc_adapter.go | 3 + wallet/api/node/types/types.go | 3 + wallet/api/spam/spam.go | 9 + wallet/service/service_v1_test.go | 28 +++ wallet/service/v1/endpoints.go | 4 + 11 files changed, 227 insertions(+), 120 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8715434ff64..a9ecc5cb922 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -139,6 +139,7 @@ - [9664](https://github.com/vegaprotocol/vega/issues/9664) - Handle pagination of release request with github. - [9681](https://github.com/vegaprotocol/vega/issues/9681) - Move referral set reward factor to the referral set stats events - [9708](https://github.com/vegaprotocol/vega/issues/9708) - Use the correct transaction hash when submitting orders through the `nullblockchain` +- [9755](https://github.com/vegaprotocol/vega/issues/9755) - Add referral program spam statistics to `GetSpamStatistics` core API. - [409](https://github.com/vegaprotocol/OctoberACs/issues/409) - Add integration test for team rewards `0056-REWA-106` - [410](https://github.com/vegaprotocol/OctoberACs/issues/410) - Add integration test for team rewards `0056-REWA-107` - [411](https://github.com/vegaprotocol/OctoberACs/issues/411) - Add integration test for team rewards `0056-REWA-108` diff --git a/core/api/core.go b/core/api/core.go index ce839bc8e06..d29f9d4f4ce 100644 --- a/core/api/core.go +++ b/core/api/core.go @@ -702,6 +702,9 @@ func (s *coreService) GetSpamStatistics(ctx context.Context, req *protoapi.GetSp spamStats.Proposals = defaultStats spamStats.IssueSignatures = defaultStats spamStats.Transfers = defaultStats + spamStats.CreateReferralSet = defaultStats + spamStats.UpdateReferralSet = defaultStats + spamStats.ApplyReferralCode = defaultStats spamStats.Votes = &protoapi.VoteSpamStatistics{ Statistics: []*protoapi.VoteSpamStatistic{}, MaxForEpoch: math.MaxUint64, diff --git a/core/protocol/all_services.go b/core/protocol/all_services.go index 3228ca21809..6b8067571f2 100644 --- a/core/protocol/all_services.go +++ b/core/protocol/all_services.go @@ -383,7 +383,7 @@ func newServices( svcs.snapshotEngine.AddProviders(svcs.spam) pow := pow.New(svcs.log, svcs.conf.PoW, svcs.timeService) - if svcs.conf.Blockchain.ChainProvider == blockchain.ProviderNullChain && !svcs.conf.Blockchain.Null.SpamProtection { + if svcs.conf.Blockchain.ChainProvider == blockchain.ProviderNullChain { pow.DisableVerification() } svcs.pow = pow diff --git a/core/spam/engine.go b/core/spam/engine.go index b8b73f5eb55..3a7108431f2 100644 --- a/core/spam/engine.go +++ b/core/spam/engine.go @@ -356,6 +356,12 @@ func (e *Engine) GetSpamStatistics(partyID string) *protoapi.SpamStatistics { stats.IssueSignatures = policy.GetSpamStats(partyID) case txn.VoteCommand: stats.Votes = policy.GetVoteSpamStats(partyID) + case txn.CreateReferralSetCommand: + stats.CreateReferralSet = policy.GetSpamStats(partyID) + case txn.UpdateReferralSetCommand: + stats.UpdateReferralSet = policy.GetSpamStats(partyID) + case txn.ApplyReferralCodeCommand: + stats.ApplyReferralCode = policy.GetSpamStats(partyID) default: continue } diff --git a/protos/sources/vega/api/v1/core.proto b/protos/sources/vega/api/v1/core.proto index 3dc6f2a0832..1358e3ed681 100644 --- a/protos/sources/vega/api/v1/core.proto +++ b/protos/sources/vega/api/v1/core.proto @@ -434,22 +434,28 @@ message PoWStatistic { // Complete spam statistics captured for a given party message SpamStatistics { - // Statistics for proposal transactions made by the party + // Statistics for proposal transactions made by the party. SpamStatistic proposals = 1; - // Statistics for delegation transactions made by the party + // Statistics for delegation transactions made by the party. SpamStatistic delegations = 2; - // Statistics for transfer transactions made by the party + // Statistics for transfer transactions made by the party. SpamStatistic transfers = 3; - // Statistics for node announcement transactions made by the party + // Statistics for node announcement transactions made by the party. SpamStatistic node_announcements = 4; - // Statistics for proposal votes made by the party + // Statistics for proposal votes made by the party. VoteSpamStatistics votes = 5; - // Statistics for proof of work difficulty observed per block for the party + // Statistics for proof of work difficulty observed per block for the party. PoWStatistic pow = 6; - // Statistics for multisig signatures issued for the party + // Statistics for multisig signatures issued for the party. SpamStatistic issue_signatures = 7; - // Epoch in which these statistics apply to + // Epoch in which these statistics apply to. uint64 epoch_seq = 8; + // Statistics for transactions made by the party to create referral sets. + SpamStatistic create_referral_set = 9; + // Statistics for transactions made by the party to update referral sets. + SpamStatistic update_referral_set = 10; + // Statistics for transactions made by the party to apply referral codes. + SpamStatistic apply_referral_code = 11; } // Response containing all the spam statistics of a party for the current epoch diff --git a/protos/vega/api/v1/core.pb.go b/protos/vega/api/v1/core.pb.go index 1f8e69837f8..8ebb60008aa 100644 --- a/protos/vega/api/v1/core.pb.go +++ b/protos/vega/api/v1/core.pb.go @@ -2156,22 +2156,28 @@ type SpamStatistics struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Statistics for proposal transactions made by the party + // Statistics for proposal transactions made by the party. Proposals *SpamStatistic `protobuf:"bytes,1,opt,name=proposals,proto3" json:"proposals,omitempty"` - // Statistics for delegation transactions made by the party + // Statistics for delegation transactions made by the party. Delegations *SpamStatistic `protobuf:"bytes,2,opt,name=delegations,proto3" json:"delegations,omitempty"` - // Statistics for transfer transactions made by the party + // Statistics for transfer transactions made by the party. Transfers *SpamStatistic `protobuf:"bytes,3,opt,name=transfers,proto3" json:"transfers,omitempty"` - // Statistics for node announcement transactions made by the party + // Statistics for node announcement transactions made by the party. NodeAnnouncements *SpamStatistic `protobuf:"bytes,4,opt,name=node_announcements,json=nodeAnnouncements,proto3" json:"node_announcements,omitempty"` - // Statistics for proposal votes made by the party + // Statistics for proposal votes made by the party. Votes *VoteSpamStatistics `protobuf:"bytes,5,opt,name=votes,proto3" json:"votes,omitempty"` - // Statistics for proof of work difficulty observed per block for the party + // Statistics for proof of work difficulty observed per block for the party. Pow *PoWStatistic `protobuf:"bytes,6,opt,name=pow,proto3" json:"pow,omitempty"` - // Statistics for multisig signatures issued for the party + // Statistics for multisig signatures issued for the party. IssueSignatures *SpamStatistic `protobuf:"bytes,7,opt,name=issue_signatures,json=issueSignatures,proto3" json:"issue_signatures,omitempty"` - // Epoch in which these statistics apply to + // Epoch in which these statistics apply to. EpochSeq uint64 `protobuf:"varint,8,opt,name=epoch_seq,json=epochSeq,proto3" json:"epoch_seq,omitempty"` + // Statistics for transactions made by the party to create referral sets. + CreateReferralSet *SpamStatistic `protobuf:"bytes,9,opt,name=create_referral_set,json=createReferralSet,proto3" json:"create_referral_set,omitempty"` + // Statistics for transactions made by the party to update referral sets. + UpdateReferralSet *SpamStatistic `protobuf:"bytes,10,opt,name=update_referral_set,json=updateReferralSet,proto3" json:"update_referral_set,omitempty"` + // Statistics for transactions made by the party to apply referral codes. + ApplyReferralCode *SpamStatistic `protobuf:"bytes,11,opt,name=apply_referral_code,json=applyReferralCode,proto3" json:"apply_referral_code,omitempty"` } func (x *SpamStatistics) Reset() { @@ -2262,6 +2268,27 @@ func (x *SpamStatistics) GetEpochSeq() uint64 { return 0 } +func (x *SpamStatistics) GetCreateReferralSet() *SpamStatistic { + if x != nil { + return x.CreateReferralSet + } + return nil +} + +func (x *SpamStatistics) GetUpdateReferralSet() *SpamStatistic { + if x != nil { + return x.UpdateReferralSet + } + return nil +} + +func (x *SpamStatistics) GetApplyReferralCode() *SpamStatistic { + if x != nil { + return x.ApplyReferralCode + } + return nil +} + // Response containing all the spam statistics of a party for the current epoch type GetSpamStatisticsResponse struct { state protoimpl.MessageState @@ -2651,7 +2678,7 @@ var file_vega_api_v1_core_proto_rawDesc = []byte{ 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x50, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x5f, 0x75, 0x6e, 0x74, 0x69, - 0x6c, 0x22, 0xd5, 0x03, 0x0a, 0x0e, 0x53, 0x70, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, + 0x6c, 0x22, 0xb9, 0x05, 0x0a, 0x0e, 0x53, 0x70, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, @@ -2680,83 +2707,97 @@ var file_vega_api_v1_core_proto_rawDesc = []byte{ 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x52, 0x0f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x73, 0x65, 0x71, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x08, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x53, 0x65, 0x71, 0x22, 0x73, 0x0a, 0x19, 0x47, 0x65, 0x74, - 0x53, 0x70, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, - 0x64, 0x12, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, - 0x63, 0x73, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x32, 0xd8, - 0x07, 0x0a, 0x0b, 0x43, 0x6f, 0x72, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x62, - 0x0a, 0x11, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x76, 0x65, 0x67, - 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x68, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x65, 0x43, - 0x68, 0x61, 0x69, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x76, 0x65, 0x67, 0x61, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, - 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0a, - 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x1e, 0x2e, 0x76, 0x65, 0x67, - 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, - 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x76, 0x65, 0x67, - 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, - 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x0f, 0x4c, - 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x23, - 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x73, - 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x4c, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0b, 0x47, 0x65, 0x74, - 0x56, 0x65, 0x67, 0x61, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1f, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x67, 0x61, 0x54, 0x69, - 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x76, 0x65, 0x67, 0x61, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x67, 0x61, 0x54, - 0x69, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x0f, 0x4f, - 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x23, - 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x6b, 0x0a, - 0x14, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x61, 0x77, 0x54, 0x72, 0x61, + 0x08, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x53, 0x65, 0x71, 0x12, 0x4a, 0x0a, 0x13, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x61, 0x6c, 0x5f, 0x73, 0x65, 0x74, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, + 0x69, 0x63, 0x52, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x72, + 0x61, 0x6c, 0x53, 0x65, 0x74, 0x12, 0x4a, 0x0a, 0x13, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, + 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x61, 0x6c, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x70, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x52, 0x11, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x72, 0x61, 0x6c, 0x53, 0x65, + 0x74, 0x12, 0x4a, 0x0a, 0x13, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, + 0x72, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, + 0x6d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x52, 0x11, 0x61, 0x70, 0x70, 0x6c, + 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x72, 0x61, 0x6c, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x73, 0x0a, + 0x19, 0x47, 0x65, 0x74, 0x53, 0x70, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, + 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, + 0x69, 0x63, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x76, 0x65, 0x67, 0x61, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, + 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, + 0x63, 0x73, 0x32, 0xd8, 0x07, 0x0a, 0x0b, 0x43, 0x6f, 0x72, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x62, 0x0a, 0x11, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, + 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, + 0x6d, 0x69, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x70, 0x61, 0x67, + 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x2e, + 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, + 0x61, 0x67, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x65, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x4d, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x1e, + 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, + 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x5c, 0x0a, 0x0f, 0x4c, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x12, 0x23, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, + 0x0b, 0x47, 0x65, 0x74, 0x56, 0x65, 0x67, 0x61, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1f, 0x2e, 0x76, + 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, + 0x67, 0x61, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, + 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, + 0x65, 0x67, 0x61, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x60, 0x0a, 0x0f, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, + 0x75, 0x73, 0x12, 0x23, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x42, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, + 0x01, 0x12, 0x6b, 0x0a, 0x14, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x61, 0x77, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x2e, 0x76, 0x65, 0x67, 0x61, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x61, + 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, + 0x0a, 0x10, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x68, 0x0a, 0x13, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x29, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, - 0x62, 0x6d, 0x69, 0x74, 0x52, 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x10, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, - 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x13, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x52, 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x76, 0x65, - 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, - 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x70, 0x61, 0x6d, - 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x25, 0x2e, 0x76, 0x65, 0x67, - 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x70, 0x61, 0x6d, - 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x26, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x53, 0x70, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x65, 0x5a, 0x2c, 0x63, 0x6f, 0x64, - 0x65, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x69, - 0x6f, 0x2f, 0x76, 0x65, 0x67, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x76, 0x65, - 0x67, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x92, 0x41, 0x34, 0x12, 0x19, 0x0a, 0x0e, - 0x56, 0x65, 0x67, 0x61, 0x20, 0x63, 0x6f, 0x72, 0x65, 0x20, 0x41, 0x50, 0x49, 0x73, 0x32, 0x07, - 0x76, 0x30, 0x2e, 0x37, 0x32, 0x2e, 0x31, 0x1a, 0x13, 0x6c, 0x62, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x6e, 0x65, 0x74, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x78, 0x79, 0x7a, 0x2a, 0x02, 0x01, 0x02, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x28, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x52, 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x11, 0x47, 0x65, 0x74, + 0x53, 0x70, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x25, + 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x53, 0x70, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x70, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x69, + 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x65, 0x5a, + 0x2c, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x65, 0x67, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x2f, 0x76, 0x65, 0x67, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x92, 0x41, 0x34, + 0x12, 0x19, 0x0a, 0x0e, 0x56, 0x65, 0x67, 0x61, 0x20, 0x63, 0x6f, 0x72, 0x65, 0x20, 0x41, 0x50, + 0x49, 0x73, 0x32, 0x07, 0x76, 0x30, 0x2e, 0x37, 0x32, 0x2e, 0x31, 0x1a, 0x13, 0x6c, 0x62, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x6e, 0x65, 0x74, 0x2e, 0x76, 0x65, 0x67, 0x61, 0x2e, 0x78, 0x79, 0x7a, + 0x2a, 0x02, 0x01, 0x02, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2826,32 +2867,35 @@ var file_vega_api_v1_core_proto_depIdxs = []int32{ 23, // 14: vega.api.v1.SpamStatistics.votes:type_name -> vega.api.v1.VoteSpamStatistics 26, // 15: vega.api.v1.SpamStatistics.pow:type_name -> vega.api.v1.PoWStatistic 22, // 16: vega.api.v1.SpamStatistics.issue_signatures:type_name -> vega.api.v1.SpamStatistic - 27, // 17: vega.api.v1.GetSpamStatisticsResponse.statistics:type_name -> vega.api.v1.SpamStatistics - 4, // 18: vega.api.v1.CoreService.SubmitTransaction:input_type -> vega.api.v1.SubmitTransactionRequest - 2, // 19: vega.api.v1.CoreService.PropagateChainEvent:input_type -> vega.api.v1.PropagateChainEventRequest - 16, // 20: vega.api.v1.CoreService.Statistics:input_type -> vega.api.v1.StatisticsRequest - 19, // 21: vega.api.v1.CoreService.LastBlockHeight:input_type -> vega.api.v1.LastBlockHeightRequest - 12, // 22: vega.api.v1.CoreService.GetVegaTime:input_type -> vega.api.v1.GetVegaTimeRequest - 14, // 23: vega.api.v1.CoreService.ObserveEventBus:input_type -> vega.api.v1.ObserveEventBusRequest - 8, // 24: vega.api.v1.CoreService.SubmitRawTransaction:input_type -> vega.api.v1.SubmitRawTransactionRequest - 6, // 25: vega.api.v1.CoreService.CheckTransaction:input_type -> vega.api.v1.CheckTransactionRequest - 10, // 26: vega.api.v1.CoreService.CheckRawTransaction:input_type -> vega.api.v1.CheckRawTransactionRequest - 21, // 27: vega.api.v1.CoreService.GetSpamStatistics:input_type -> vega.api.v1.GetSpamStatisticsRequest - 5, // 28: vega.api.v1.CoreService.SubmitTransaction:output_type -> vega.api.v1.SubmitTransactionResponse - 3, // 29: vega.api.v1.CoreService.PropagateChainEvent:output_type -> vega.api.v1.PropagateChainEventResponse - 17, // 30: vega.api.v1.CoreService.Statistics:output_type -> vega.api.v1.StatisticsResponse - 20, // 31: vega.api.v1.CoreService.LastBlockHeight:output_type -> vega.api.v1.LastBlockHeightResponse - 13, // 32: vega.api.v1.CoreService.GetVegaTime:output_type -> vega.api.v1.GetVegaTimeResponse - 15, // 33: vega.api.v1.CoreService.ObserveEventBus:output_type -> vega.api.v1.ObserveEventBusResponse - 9, // 34: vega.api.v1.CoreService.SubmitRawTransaction:output_type -> vega.api.v1.SubmitRawTransactionResponse - 7, // 35: vega.api.v1.CoreService.CheckTransaction:output_type -> vega.api.v1.CheckTransactionResponse - 11, // 36: vega.api.v1.CoreService.CheckRawTransaction:output_type -> vega.api.v1.CheckRawTransactionResponse - 28, // 37: vega.api.v1.CoreService.GetSpamStatistics:output_type -> vega.api.v1.GetSpamStatisticsResponse - 28, // [28:38] is the sub-list for method output_type - 18, // [18:28] is the sub-list for method input_type - 18, // [18:18] is the sub-list for extension type_name - 18, // [18:18] is the sub-list for extension extendee - 0, // [0:18] is the sub-list for field type_name + 22, // 17: vega.api.v1.SpamStatistics.create_referral_set:type_name -> vega.api.v1.SpamStatistic + 22, // 18: vega.api.v1.SpamStatistics.update_referral_set:type_name -> vega.api.v1.SpamStatistic + 22, // 19: vega.api.v1.SpamStatistics.apply_referral_code:type_name -> vega.api.v1.SpamStatistic + 27, // 20: vega.api.v1.GetSpamStatisticsResponse.statistics:type_name -> vega.api.v1.SpamStatistics + 4, // 21: vega.api.v1.CoreService.SubmitTransaction:input_type -> vega.api.v1.SubmitTransactionRequest + 2, // 22: vega.api.v1.CoreService.PropagateChainEvent:input_type -> vega.api.v1.PropagateChainEventRequest + 16, // 23: vega.api.v1.CoreService.Statistics:input_type -> vega.api.v1.StatisticsRequest + 19, // 24: vega.api.v1.CoreService.LastBlockHeight:input_type -> vega.api.v1.LastBlockHeightRequest + 12, // 25: vega.api.v1.CoreService.GetVegaTime:input_type -> vega.api.v1.GetVegaTimeRequest + 14, // 26: vega.api.v1.CoreService.ObserveEventBus:input_type -> vega.api.v1.ObserveEventBusRequest + 8, // 27: vega.api.v1.CoreService.SubmitRawTransaction:input_type -> vega.api.v1.SubmitRawTransactionRequest + 6, // 28: vega.api.v1.CoreService.CheckTransaction:input_type -> vega.api.v1.CheckTransactionRequest + 10, // 29: vega.api.v1.CoreService.CheckRawTransaction:input_type -> vega.api.v1.CheckRawTransactionRequest + 21, // 30: vega.api.v1.CoreService.GetSpamStatistics:input_type -> vega.api.v1.GetSpamStatisticsRequest + 5, // 31: vega.api.v1.CoreService.SubmitTransaction:output_type -> vega.api.v1.SubmitTransactionResponse + 3, // 32: vega.api.v1.CoreService.PropagateChainEvent:output_type -> vega.api.v1.PropagateChainEventResponse + 17, // 33: vega.api.v1.CoreService.Statistics:output_type -> vega.api.v1.StatisticsResponse + 20, // 34: vega.api.v1.CoreService.LastBlockHeight:output_type -> vega.api.v1.LastBlockHeightResponse + 13, // 35: vega.api.v1.CoreService.GetVegaTime:output_type -> vega.api.v1.GetVegaTimeResponse + 15, // 36: vega.api.v1.CoreService.ObserveEventBus:output_type -> vega.api.v1.ObserveEventBusResponse + 9, // 37: vega.api.v1.CoreService.SubmitRawTransaction:output_type -> vega.api.v1.SubmitRawTransactionResponse + 7, // 38: vega.api.v1.CoreService.CheckTransaction:output_type -> vega.api.v1.CheckTransactionResponse + 11, // 39: vega.api.v1.CoreService.CheckRawTransaction:output_type -> vega.api.v1.CheckRawTransactionResponse + 28, // 40: vega.api.v1.CoreService.GetSpamStatistics:output_type -> vega.api.v1.GetSpamStatisticsResponse + 31, // [31:41] is the sub-list for method output_type + 21, // [21:31] is the sub-list for method input_type + 21, // [21:21] is the sub-list for extension type_name + 21, // [21:21] is the sub-list for extension extendee + 0, // [0:21] is the sub-list for field type_name } func init() { file_vega_api_v1_core_proto_init() } diff --git a/wallet/api/node/adapters/grpc_adapter.go b/wallet/api/node/adapters/grpc_adapter.go index 9121eeabd1c..fc561d6a10c 100644 --- a/wallet/api/node/adapters/grpc_adapter.go +++ b/wallet/api/node/adapters/grpc_adapter.go @@ -82,6 +82,9 @@ func (c *GRPCAdapter) SpamStatistics(ctx context.Context, party string) (nodetyp Transfers: toSpamStatistic(r.Statistics.Transfers), NodeAnnouncements: toSpamStatistic(r.Statistics.NodeAnnouncements), IssuesSignatures: toSpamStatistic(r.Statistics.IssueSignatures), + CreateReferralSet: toSpamStatistic(r.Statistics.CreateReferralSet), + UpdateReferralSet: toSpamStatistic(r.Statistics.UpdateReferralSet), + ApplyReferralCode: toSpamStatistic(r.Statistics.ApplyReferralCode), Votes: &nodetypes.VoteSpamStatistics{ Proposals: proposals, MaxForEpoch: r.Statistics.Votes.MaxForEpoch, diff --git a/wallet/api/node/types/types.go b/wallet/api/node/types/types.go index 7682f546aca..0592cedbdab 100644 --- a/wallet/api/node/types/types.go +++ b/wallet/api/node/types/types.go @@ -47,6 +47,9 @@ type SpamStatistics struct { Transfers *SpamStatistic NodeAnnouncements *SpamStatistic IssuesSignatures *SpamStatistic + CreateReferralSet *SpamStatistic + UpdateReferralSet *SpamStatistic + ApplyReferralCode *SpamStatistic Votes *VoteSpamStatistics PoW *PoWStatistics } diff --git a/wallet/api/spam/spam.go b/wallet/api/spam/spam.go index f0a5c9cb3e4..fdd2d72368c 100644 --- a/wallet/api/spam/spam.go +++ b/wallet/api/spam/spam.go @@ -143,6 +143,15 @@ func (s *Handler) CheckSubmission(req *walletpb.SubmitTransactionRequest, newSta case *walletpb.SubmitTransactionRequest_IssueSignatures: s.merge(stats.IssuesSignatures, newStats.IssuesSignatures) return s.checkTxn(stats.IssuesSignatures) + case *walletpb.SubmitTransactionRequest_CreateReferralSet: + s.merge(stats.CreateReferralSet, newStats.CreateReferralSet) + return s.checkTxn(stats.CreateReferralSet) + case *walletpb.SubmitTransactionRequest_UpdateReferralSet: + s.merge(stats.UpdateReferralSet, newStats.UpdateReferralSet) + return s.checkTxn(stats.UpdateReferralSet) + case *walletpb.SubmitTransactionRequest_ApplyReferralCode: + s.merge(stats.ApplyReferralCode, newStats.ApplyReferralCode) + return s.checkTxn(stats.ApplyReferralCode) case *walletpb.SubmitTransactionRequest_VoteSubmission: s.mergeVotes(stats.Votes, newStats.Votes) return s.checkVote(cmd.VoteSubmission.ProposalId, stats.Votes) diff --git a/wallet/service/service_v1_test.go b/wallet/service/service_v1_test.go index b8824884b99..d9ee4fc5428 100644 --- a/wallet/service/service_v1_test.go +++ b/wallet/service/service_v1_test.go @@ -624,6 +624,10 @@ func testCheckTransactionSucceeds(t *testing.T) { Transfers: &api.SpamStatistic{}, Delegations: &api.SpamStatistic{}, NodeAnnouncements: &api.SpamStatistic{}, + IssueSignatures: &api.SpamStatistic{}, + CreateReferralSet: &api.SpamStatistic{}, + UpdateReferralSet: &api.SpamStatistic{}, + ApplyReferralCode: &api.SpamStatistic{}, Votes: &api.VoteSpamStatistics{}, Pow: &api.PoWStatistic{ BlockStates: []*api.PoWBlockState{}, @@ -676,6 +680,10 @@ func testCheckTransactionWithRejectedTransactionSucceeds(t *testing.T) { Transfers: &api.SpamStatistic{}, Delegations: &api.SpamStatistic{}, NodeAnnouncements: &api.SpamStatistic{}, + IssueSignatures: &api.SpamStatistic{}, + CreateReferralSet: &api.SpamStatistic{}, + UpdateReferralSet: &api.SpamStatistic{}, + ApplyReferralCode: &api.SpamStatistic{}, Votes: &api.VoteSpamStatistics{}, Pow: &api.PoWStatistic{ BlockStates: []*api.PoWBlockState{}, @@ -726,6 +734,10 @@ func testCheckTransactionWithFailedTransactionFails(t *testing.T) { Transfers: &api.SpamStatistic{}, Delegations: &api.SpamStatistic{}, NodeAnnouncements: &api.SpamStatistic{}, + IssueSignatures: &api.SpamStatistic{}, + CreateReferralSet: &api.SpamStatistic{}, + UpdateReferralSet: &api.SpamStatistic{}, + ApplyReferralCode: &api.SpamStatistic{}, Votes: &api.VoteSpamStatistics{}, Pow: &api.PoWStatistic{ BlockStates: []*api.PoWBlockState{}, @@ -767,6 +779,10 @@ func testAcceptSigningTransactionSucceeds(t *testing.T) { Transfers: &api.SpamStatistic{}, Delegations: &api.SpamStatistic{}, NodeAnnouncements: &api.SpamStatistic{}, + IssueSignatures: &api.SpamStatistic{}, + CreateReferralSet: &api.SpamStatistic{}, + UpdateReferralSet: &api.SpamStatistic{}, + ApplyReferralCode: &api.SpamStatistic{}, Votes: &api.VoteSpamStatistics{}, Pow: &api.PoWStatistic{ BlockStates: []*api.PoWBlockState{}, @@ -843,6 +859,10 @@ func testFailedTransactionSigningFails(t *testing.T) { Transfers: &api.SpamStatistic{}, Delegations: &api.SpamStatistic{}, NodeAnnouncements: &api.SpamStatistic{}, + IssueSignatures: &api.SpamStatistic{}, + CreateReferralSet: &api.SpamStatistic{}, + UpdateReferralSet: &api.SpamStatistic{}, + ApplyReferralCode: &api.SpamStatistic{}, Votes: &api.VoteSpamStatistics{}, Pow: &api.PoWStatistic{ BlockStates: []*api.PoWBlockState{}, @@ -929,6 +949,10 @@ func testAcceptSigningTransactionFailsSpam(t *testing.T) { Transfers: &api.SpamStatistic{}, Delegations: &api.SpamStatistic{}, NodeAnnouncements: &api.SpamStatistic{}, + IssueSignatures: &api.SpamStatistic{}, + CreateReferralSet: &api.SpamStatistic{}, + UpdateReferralSet: &api.SpamStatistic{}, + ApplyReferralCode: &api.SpamStatistic{}, Votes: &api.VoteSpamStatistics{}, Pow: &api.PoWStatistic{ BlockStates: []*api.PoWBlockState{}, @@ -1135,6 +1159,10 @@ func TestEmptyChainIDFromNetworkFails(t *testing.T) { Transfers: &api.SpamStatistic{}, Delegations: &api.SpamStatistic{}, NodeAnnouncements: &api.SpamStatistic{}, + IssueSignatures: &api.SpamStatistic{}, + CreateReferralSet: &api.SpamStatistic{}, + UpdateReferralSet: &api.SpamStatistic{}, + ApplyReferralCode: &api.SpamStatistic{}, Votes: &api.VoteSpamStatistics{}, Pow: &api.PoWStatistic{ BlockStates: []*api.PoWBlockState{}, diff --git a/wallet/service/v1/endpoints.go b/wallet/service/v1/endpoints.go index d8d222cc8a4..e068956ca0b 100644 --- a/wallet/service/v1/endpoints.go +++ b/wallet/service/v1/endpoints.go @@ -1097,6 +1097,10 @@ func convertSpamStatistics(r *api.GetSpamStatisticsResponse) *nodetypes.SpamStat Delegations: toSpamStatistic(r.Statistics.Delegations), Transfers: toSpamStatistic(r.Statistics.Transfers), NodeAnnouncements: toSpamStatistic(r.Statistics.NodeAnnouncements), + IssuesSignatures: toSpamStatistic(r.Statistics.IssueSignatures), + CreateReferralSet: toSpamStatistic(r.Statistics.CreateReferralSet), + UpdateReferralSet: toSpamStatistic(r.Statistics.UpdateReferralSet), + ApplyReferralCode: toSpamStatistic(r.Statistics.ApplyReferralCode), Votes: &nodetypes.VoteSpamStatistics{ Proposals: proposals, MaxForEpoch: r.Statistics.Votes.MaxForEpoch,