From e1781535934b2118bebabe97d1372e00da5f9b65 Mon Sep 17 00:00:00 2001 From: Cassandra Heart Date: Mon, 11 Nov 2024 03:32:14 -0600 Subject: [PATCH] initial testnet v2.0.3-p2 --- node/config/p2p.go | 1 + node/config/version.go | 4 +- .../data/data_clock_consensus_engine.go | 19 +- .../data/grpc_worker_rate_limiter.go | 101 +++++++ node/consensus/data/peer_messaging.go | 10 +- .../token/application/token_handle_mint.go | 3 +- .../token/token_execution_engine.go | 31 ++- .../intrinsics/token/token_genesis.go | 247 +++++++++++++++--- node/p2p/blossomsub.go | 4 + node/p2p/internal/peer_connector.go | 2 +- node/p2p/pubsub.go | 1 + node/protobufs/data.pb.go | 201 +++++++------- node/protobufs/data.proto | 1 + node/tries/proof_leaf.go | 6 + 14 files changed, 494 insertions(+), 137 deletions(-) create mode 100644 node/consensus/data/grpc_worker_rate_limiter.go diff --git a/node/config/p2p.go b/node/config/p2p.go index 95857dd..95384ec 100644 --- a/node/config/p2p.go +++ b/node/config/p2p.go @@ -40,4 +40,5 @@ type P2PConfig struct { LowWatermarkConnections uint `yaml:"lowWatermarkConnections"` HighWatermarkConnections uint `yaml:"highWatermarkConnections"` DirectPeers []string `yaml:"directPeers"` + GrpcServerRateLimit int `yaml:"grpcServerRateLimit"` } diff --git a/node/config/version.go b/node/config/version.go index 8eeb85f..1502f03 100644 --- a/node/config/version.go +++ b/node/config/version.go @@ -36,9 +36,9 @@ func FormatVersion(version []byte) string { } func GetPatchNumber() byte { - return 0x01 + return 0x02 } func GetRCNumber() byte { - return 0x07 + return 0x09 } diff --git a/node/consensus/data/data_clock_consensus_engine.go b/node/consensus/data/data_clock_consensus_engine.go index 27313c5..e196a16 100644 --- a/node/consensus/data/data_clock_consensus_engine.go +++ b/node/consensus/data/data_clock_consensus_engine.go @@ -123,6 +123,7 @@ type DataClockConsensusEngine struct { infoMessageProcessorCh chan *pb.Message report *protobufs.SelfTestReport clients []protobufs.DataIPCServiceClient + grpcRateLimiter *RateLimiter } var _ consensus.DataConsensusEngine = (*DataClockConsensusEngine)(nil) @@ -207,6 +208,14 @@ func NewDataClockConsensusEngine( difficulty = 160000 } + rateLimit := cfg.P2P.GrpcServerRateLimit + rateLimitTokens := 0 + if rateLimit == 0 { + rateLimit = 10 + } + + rateLimitTokens = rateLimit * rateLimit + e := &DataClockConsensusEngine{ difficulty: difficulty, logger: logger, @@ -244,6 +253,12 @@ func NewDataClockConsensusEngine( infoMessageProcessorCh: make(chan *pb.Message), config: cfg, preMidnightMint: map[string]struct{}{}, + grpcRateLimiter: NewRateLimiter( + rateLimitTokens, + rateLimit, + rateLimit, + time.Minute, + ), } logger.Info("constructing consensus engine") @@ -297,8 +312,8 @@ func (e *DataClockConsensusEngine) Start() <-chan error { e.pubSub.Subscribe(e.infoFilter, e.handleInfoMessage) go func() { server := grpc.NewServer( - grpc.MaxSendMsgSize(600*1024*1024), - grpc.MaxRecvMsgSize(600*1024*1024), + grpc.MaxSendMsgSize(20*1024*1024), + grpc.MaxRecvMsgSize(20*1024*1024), ) protobufs.RegisterDataServiceServer(server, e) if err := e.pubSub.StartDirectChannelListener( diff --git a/node/consensus/data/grpc_worker_rate_limiter.go b/node/consensus/data/grpc_worker_rate_limiter.go new file mode 100644 index 0000000..05f4786 --- /dev/null +++ b/node/consensus/data/grpc_worker_rate_limiter.go @@ -0,0 +1,101 @@ +package data + +import ( + "sync" + "time" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type RateLimiter struct { + mu sync.RWMutex + clients map[string]*bucket + maxTokens int + refillTokens int + refillTime time.Duration + maxCallers int + lastCleanup time.Time + cleanupPeriod time.Duration +} + +type bucket struct { + tokens int + lastSeen time.Time +} + +func NewRateLimiter( + maxTokens int, + maxCallers int, + refillTokens int, + refillDuration time.Duration, +) *RateLimiter { + return &RateLimiter{ + clients: make(map[string]*bucket), + maxTokens: maxTokens, + refillTokens: refillTokens, + refillTime: refillDuration, + maxCallers: maxCallers, + lastCleanup: time.Now(), + cleanupPeriod: time.Minute, + } +} + +func (rl *RateLimiter) Allow(peerId string) error { + rl.mu.Lock() + defer rl.mu.Unlock() + + now := time.Now() + + if now.Sub(rl.lastCleanup) >= rl.cleanupPeriod { + rl.cleanup(now) + rl.lastCleanup = now + } + + b, exists := rl.clients[peerId] + if !exists { + if len(rl.clients) >= rl.maxCallers { + return status.Errorf(codes.ResourceExhausted, + "maximum number of unique callers (%d) reached", rl.maxCallers) + } + + b = &bucket{ + tokens: rl.maxTokens - 1, + lastSeen: now, + } + rl.clients[peerId] = b + return nil + } + + elapsed := now.Sub(b.lastSeen) + refillCycles := int(elapsed / rl.refillTime) + b.tokens += refillCycles * rl.refillTokens + if b.tokens > rl.maxTokens { + b.tokens = rl.maxTokens + } + + if b.tokens <= 0 { + return status.Errorf(codes.ResourceExhausted, + "rate limit exceeded, try again in %v", + rl.refillTime-elapsed%rl.refillTime) + } + + b.tokens-- + b.lastSeen = now + return nil +} + +func (rl *RateLimiter) cleanup(now time.Time) { + threshold := now.Add(-rl.cleanupPeriod * 2) + for clientID, bucket := range rl.clients { + if bucket.lastSeen.Before(threshold) { + delete(rl.clients, clientID) + } + } +} + +func (rl *RateLimiter) GetActiveCallers() int { + rl.mu.RLock() + defer rl.mu.RUnlock() + return len(rl.clients) +} diff --git a/node/consensus/data/peer_messaging.go b/node/consensus/data/peer_messaging.go index f99b08a..c27dea6 100644 --- a/node/consensus/data/peer_messaging.go +++ b/node/consensus/data/peer_messaging.go @@ -28,6 +28,14 @@ func (e *DataClockConsensusEngine) GetDataFrame( ctx context.Context, request *protobufs.GetDataFrameRequest, ) (*protobufs.DataFrameResponse, error) { + if request.PeerId == "" || len(request.PeerId) > 64 { + return nil, errors.Wrap(errors.New("invalid request"), "get data frame") + } + + if err := e.grpcRateLimiter.Allow(request.PeerId); err != nil { + return nil, errors.Wrap(err, "get data frame") + } + e.logger.Debug( "received frame request", zap.Uint64("frame_number", request.FrameNumber), @@ -51,7 +59,7 @@ func (e *DataClockConsensusEngine) GetDataFrame( } if err != nil { - e.logger.Error( + e.logger.Debug( "received error while fetching time reel head", zap.Error(err), ) diff --git a/node/execution/intrinsics/token/application/token_handle_mint.go b/node/execution/intrinsics/token/application/token_handle_mint.go index 0e4af67..51abfae 100644 --- a/node/execution/intrinsics/token/application/token_handle_mint.go +++ b/node/execution/intrinsics/token/application/token_handle_mint.go @@ -18,7 +18,8 @@ import ( "source.quilibrium.com/quilibrium/monorepo/node/tries" ) -const PROOF_FRAME_CUTOFF = 46500 +const PROOF_FRAME_CUTOFF = 1 +const PROOF_FRAME_RING_RESET = 5650 func (a *TokenApplication) handleMint( currentFrameNumber uint64, diff --git a/node/execution/intrinsics/token/token_execution_engine.go b/node/execution/intrinsics/token/token_execution_engine.go index 16e3a9c..72ce03d 100644 --- a/node/execution/intrinsics/token/token_execution_engine.go +++ b/node/execution/intrinsics/token/token_execution_engine.go @@ -5,6 +5,7 @@ import ( "crypto" "encoding/binary" "encoding/hex" + "fmt" "math/big" "slices" "strconv" @@ -193,7 +194,7 @@ func NewTokenExecutionEngine( } } } else { - LoadAggregatedSeniorityMap() + LoadAggregatedSeniorityMap(uint(cfg.P2P.Network)) } e := &TokenExecutionEngine{ @@ -586,7 +587,7 @@ func (e *TokenExecutionEngine) ProcessFrame( txn.Abort() return nil, errors.Wrap(err, "process frame") } - + fmt.Println(hex.EncodeToString(addr)) sen, ok := (*e.peerSeniority)[string(addr)] if !ok { e.logger.Debug( @@ -661,6 +662,7 @@ func (e *TokenExecutionEngine) ProcessFrame( txn.Abort() return nil, errors.Wrap(err, "process frame") } + fmt.Println(hex.EncodeToString(addr)) if _, ok := (*e.peerSeniority)[string(addr)]; !ok { (*e.peerSeniority)[string(addr)] = PeerSeniorityItem{ seniority: 20, @@ -774,6 +776,31 @@ func (e *TokenExecutionEngine) ProcessFrame( return nil, errors.Wrap(err, "process frame") } + if frame.FrameNumber == application.PROOF_FRAME_RING_RESET { + e.logger.Info("performing ring reset") + seniorityMap, err := RebuildPeerSeniority(e.pubSub.GetNetwork()) + if err != nil { + return nil, errors.Wrap(err, "process frame") + } + e.peerSeniority = newFromMap(seniorityMap) + + app.Tries = []*tries.RollingFrecencyCritbitTrie{ + app.Tries[0], + &tries.RollingFrecencyCritbitTrie{}, + } + + err = e.clockStore.PutPeerSeniorityMap( + txn, + e.intrinsicFilter, + toSerializedMap(e.peerSeniority), + ) + if err != nil { + txn.Abort() + return nil, errors.Wrap(err, "process frame") + } + + } + return app.Tries, nil } diff --git a/node/execution/intrinsics/token/token_genesis.go b/node/execution/intrinsics/token/token_genesis.go index 5c2279d..f7f14be 100644 --- a/node/execution/intrinsics/token/token_genesis.go +++ b/node/execution/intrinsics/token/token_genesis.go @@ -80,7 +80,100 @@ var secondRetro []*SecondRetroJson var thirdRetro []*ThirdRetroJson var fourthRetro []*FourthRetroJson -func LoadAggregatedSeniorityMap() { +func LoadAggregatedSeniorityMap(network uint) { + if network != 0 { + // testnet values are fixed to confirm test behaviors + firstRetro = []*FirstRetroJson{ + { + PeerId: "QmTG8UAmrYBdLi76CEkXK7equRcoRRKBjbkK44oT6TcEGU", + Reward: "157208", + }, + { + PeerId: "QmRZMVG1VbBWMEensjqBS7XqBzNfCoA5HxdDwCuouUeY16", + Reward: "157208", + }, + { + PeerId: "QmWwqsH3vwPkRufqtdS1sgxgWwg8i4sgsfpeDy9BbX259p", + Reward: "78604", + }, + { + PeerId: "QmNtGTnGLpi35sLmrgwd2EaUJFNz99WBd7ZzzRaw8GYo9e", + Reward: "78604", + }, + { + PeerId: "QmNPx7PKUS6bz9MbJciWPDDRi6ufJ6vBgVqGrSXaUyUgb6", + Reward: "39302", + }, + { + PeerId: "QmSdBumdhuWwMvb38XkExqGoGQ2jjjaFaVWKejEynFZJ8L", + Reward: "39302", + }, + { + PeerId: "Qma3bMDgVjCNgvSd3uomekF4v7Pq4VkTyT5R31FfdrqSan", + Reward: "39302", + }, + } + secondRetro = []*SecondRetroJson{ + { + PeerId: "QmeafLbKKfmRKQdF7LK1Z3ayNbzwRLmRpZCtjBXrGKZzht", + Reward: "1000", + JanPresence: true, + FebPresence: true, + MarPresence: false, + AprPresence: false, + MayPresence: false, + }, + { + PeerId: "QmUbgmwR3Z8Vp9zHHeuGRxRrfh4YzLF5CbW48Ur8Kx9jAP", + Reward: "1000", + JanPresence: true, + FebPresence: true, + MarPresence: false, + AprPresence: false, + MayPresence: false, + }, + { + PeerId: "QmYM47WUWSz8X13rXpcR2RPagSVAnjkwRw9V5Ps7X6quit", + Reward: "1000", + JanPresence: true, + FebPresence: true, + MarPresence: false, + AprPresence: false, + MayPresence: false, + }, + { + PeerId: "QmUVZVDBRusH8wh8qfVoveTp9PwZTb2PxMXSLdbcznUVEo", + Reward: "1000", + JanPresence: true, + FebPresence: true, + MarPresence: false, + AprPresence: false, + MayPresence: false, + }, + { + PeerId: "QmZCMe29zbGkqceyzjjmzND9nDUMcWyMBUZSzMhns1sejH", + Reward: "1000", + JanPresence: true, + FebPresence: true, + MarPresence: false, + AprPresence: false, + MayPresence: false, + }, + } + thirdRetro = []*ThirdRetroJson{ + { + PeerId: "QmZ36PUzJYMM7Mz319cXwDZNtYuhtuFChcWep2ZY25ZGMN", + Reward: "1000", + }, + { + PeerId: "QmaQuJGk6fGrYYTQiBFFasKLxSKkEkPaywEKoVbnXULEEG", + Reward: "1000", + }, + } + fourthRetro = []*FourthRetroJson{} + return + } + firstRetro = []*FirstRetroJson{} secondRetro = []*SecondRetroJson{} thirdRetro = []*ThirdRetroJson{} @@ -109,32 +202,120 @@ func LoadAggregatedSeniorityMap() { func RebuildPeerSeniority(network uint) (map[string]uint64, error) { if network != 0 { - return map[string]uint64{}, nil - } + // testnet values are fixed to confirm test behaviors + firstRetro = []*FirstRetroJson{ + { + PeerId: "QmTG8UAmrYBdLi76CEkXK7equRcoRRKBjbkK44oT6TcEGU", + Reward: "157208", + }, + { + PeerId: "QmRZMVG1VbBWMEensjqBS7XqBzNfCoA5HxdDwCuouUeY16", + Reward: "157208", + }, + { + PeerId: "QmWwqsH3vwPkRufqtdS1sgxgWwg8i4sgsfpeDy9BbX259p", + Reward: "78604", + }, + { + PeerId: "QmNtGTnGLpi35sLmrgwd2EaUJFNz99WBd7ZzzRaw8GYo9e", + Reward: "78604", + }, + { + PeerId: "QmNPx7PKUS6bz9MbJciWPDDRi6ufJ6vBgVqGrSXaUyUgb6", + Reward: "39302", + }, + { + PeerId: "QmSdBumdhuWwMvb38XkExqGoGQ2jjjaFaVWKejEynFZJ8L", + Reward: "39302", + }, + { + PeerId: "Qma3bMDgVjCNgvSd3uomekF4v7Pq4VkTyT5R31FfdrqSan", + Reward: "39302", + }, + } + secondRetro = []*SecondRetroJson{ + { + PeerId: "QmeafLbKKfmRKQdF7LK1Z3ayNbzwRLmRpZCtjBXrGKZzht", + Reward: "1000", + JanPresence: true, + FebPresence: true, + MarPresence: false, + AprPresence: false, + MayPresence: false, + }, + { + PeerId: "QmUbgmwR3Z8Vp9zHHeuGRxRrfh4YzLF5CbW48Ur8Kx9jAP", + Reward: "1000", + JanPresence: true, + FebPresence: true, + MarPresence: false, + AprPresence: false, + MayPresence: false, + }, + { + PeerId: "QmYM47WUWSz8X13rXpcR2RPagSVAnjkwRw9V5Ps7X6quit", + Reward: "1000", + JanPresence: true, + FebPresence: true, + MarPresence: false, + AprPresence: false, + MayPresence: false, + }, + { + PeerId: "QmUVZVDBRusH8wh8qfVoveTp9PwZTb2PxMXSLdbcznUVEo", + Reward: "1000", + JanPresence: true, + FebPresence: true, + MarPresence: false, + AprPresence: false, + MayPresence: false, + }, + { + PeerId: "QmZCMe29zbGkqceyzjjmzND9nDUMcWyMBUZSzMhns1sejH", + Reward: "1000", + JanPresence: true, + FebPresence: true, + MarPresence: false, + AprPresence: false, + MayPresence: false, + }, + } + thirdRetro = []*ThirdRetroJson{ + { + PeerId: "QmZ36PUzJYMM7Mz319cXwDZNtYuhtuFChcWep2ZY25ZGMN", + Reward: "1000", + }, + { + PeerId: "QmaQuJGk6fGrYYTQiBFFasKLxSKkEkPaywEKoVbnXULEEG", + Reward: "1000", + }, + } + fourthRetro = []*FourthRetroJson{} + } else { + firstRetro = []*FirstRetroJson{} + secondRetro = []*SecondRetroJson{} + thirdRetro = []*ThirdRetroJson{} + fourthRetro = []*FourthRetroJson{} - firstRetro = []*FirstRetroJson{} - secondRetro = []*SecondRetroJson{} - thirdRetro = []*ThirdRetroJson{} - fourthRetro = []*FourthRetroJson{} + err := json.Unmarshal(firstRetroJsonBinary, &firstRetro) + if err != nil { + return nil, err + } - err := json.Unmarshal(firstRetroJsonBinary, &firstRetro) - if err != nil { - return nil, err - } + err = json.Unmarshal(secondRetroJsonBinary, &secondRetro) + if err != nil { + return nil, err + } - err = json.Unmarshal(secondRetroJsonBinary, &secondRetro) - if err != nil { - return nil, err - } + err = json.Unmarshal(thirdRetroJsonBinary, &thirdRetro) + if err != nil { + return nil, err + } - err = json.Unmarshal(thirdRetroJsonBinary, &thirdRetro) - if err != nil { - return nil, err - } - - err = json.Unmarshal(fourthRetroJsonBinary, &fourthRetro) - if err != nil { - return nil, err + err = json.Unmarshal(fourthRetroJsonBinary, &fourthRetro) + if err != nil { + return nil, err + } } peerSeniority := map[string]uint64{} @@ -146,7 +327,7 @@ func RebuildPeerSeniority(network uint) (map[string]uint64, error) { return nil, err } - p := []byte(f.PeerId) + p, _ := base58.Decode(f.PeerId) addr, _ := poseidon.HashBytes(p) peerSeniority[string( @@ -155,7 +336,7 @@ func RebuildPeerSeniority(network uint) (map[string]uint64, error) { } for _, f := range secondRetro { - p := []byte(f.PeerId) + p, _ := base58.Decode(f.PeerId) addr, _ := poseidon.HashBytes(p) addrBytes := string(addr.FillBytes(make([]byte, 32))) @@ -185,7 +366,7 @@ func RebuildPeerSeniority(network uint) (map[string]uint64, error) { } for _, f := range thirdRetro { - p := []byte(f.PeerId) + p, _ := base58.Decode(f.PeerId) addr, _ := poseidon.HashBytes(p) addrBytes := string(addr.FillBytes(make([]byte, 32))) @@ -197,7 +378,7 @@ func RebuildPeerSeniority(network uint) (map[string]uint64, error) { } for _, f := range fourthRetro { - p := []byte(f.PeerId) + p, _ := base58.Decode(f.PeerId) addr, _ := poseidon.HashBytes(p) addrBytes := string(addr.FillBytes(make([]byte, 32))) @@ -315,7 +496,7 @@ func CreateGenesisState( peerSeniority := map[string]uint64{} logger.Info("encoding first retro state") for _, f := range firstRetro { - p := []byte(f.PeerId) + p, _ := base58.Decode(f.PeerId) addr, _ := poseidon.HashBytes(p) addrBytes := string(addr.FillBytes(make([]byte, 32))) if _, ok := bridgedAddrs[f.PeerId]; !ok { @@ -344,7 +525,7 @@ func CreateGenesisState( logger.Info("encoding second retro state") for _, f := range secondRetro { - p := []byte(f.PeerId) + p, _ := base58.Decode(f.PeerId) addr, _ := poseidon.HashBytes(p) addrBytes := string(addr.FillBytes(make([]byte, 32))) @@ -390,7 +571,7 @@ func CreateGenesisState( logger.Info("encoding third retro state") for _, f := range thirdRetro { - p := []byte(f.PeerId) + p, _ := base58.Decode(f.PeerId) addr, _ := poseidon.HashBytes(p) addrBytes := string(addr.FillBytes(make([]byte, 32))) @@ -416,7 +597,7 @@ func CreateGenesisState( logger.Info("encoding fourth retro state") for _, f := range fourthRetro { - p := []byte(f.PeerId) + p, _ := base58.Decode(f.PeerId) addr, _ := poseidon.HashBytes(p) addrBytes := string(addr.FillBytes(make([]byte, 32))) @@ -782,6 +963,8 @@ func CreateGenesisState( logger.Info("finalizing execution proof") + m, _ := RebuildPeerSeniority(network) + return inputMessage, &qcrypto.InclusionAggregateProof{ InclusionCommitments: []*qcrypto.InclusionCommitment{ &qcrypto.InclusionCommitment{ @@ -792,6 +975,6 @@ func CreateGenesisState( }, AggregateCommitment: commitment, Proof: proof, - }, [][]byte{genesis.Beacon}, map[string]uint64{} + }, [][]byte{genesis.Beacon}, m } } diff --git a/node/p2p/blossomsub.go b/node/p2p/blossomsub.go index d3c8c44..7a3a708 100644 --- a/node/p2p/blossomsub.go +++ b/node/p2p/blossomsub.go @@ -843,6 +843,10 @@ func (b *BlossomSub) GetMultiaddrOfPeer(peerId []byte) string { return addrs[0].String() } +func (b *BlossomSub) GetNetwork() uint { + return uint(b.network) +} + func (b *BlossomSub) StartDirectChannelListener( key []byte, purpose string, diff --git a/node/p2p/internal/peer_connector.go b/node/p2p/internal/peer_connector.go index 1908f72..7823ad1 100644 --- a/node/p2p/internal/peer_connector.go +++ b/node/p2p/internal/peer_connector.go @@ -139,7 +139,7 @@ func (pc *peerConnector) connect() { logger.Info("initiating peer connections") var success, failure, duplicate uint32 defer func() { - logger.Info( + logger.Debug( "completed peer connections", zap.Uint32("success", success), zap.Uint32("failure", failure), diff --git a/node/p2p/pubsub.go b/node/p2p/pubsub.go index f0b7f1c..fe70d34 100644 --- a/node/p2p/pubsub.go +++ b/node/p2p/pubsub.go @@ -38,4 +38,5 @@ type PubSub interface { AddPeerScore(peerId []byte, scoreDelta int64) Reconnect(peerId []byte) error DiscoverPeers() error + GetNetwork() uint } diff --git a/node/protobufs/data.pb.go b/node/protobufs/data.pb.go index 47aecca..18adf1e 100644 --- a/node/protobufs/data.pb.go +++ b/node/protobufs/data.pb.go @@ -678,6 +678,7 @@ type GetDataFrameRequest struct { unknownFields protoimpl.UnknownFields FrameNumber uint64 `protobuf:"varint,1,opt,name=frame_number,json=frameNumber,proto3" json:"frame_number,omitempty"` + PeerId string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` } func (x *GetDataFrameRequest) Reset() { @@ -719,6 +720,13 @@ func (x *GetDataFrameRequest) GetFrameNumber() uint64 { return 0 } +func (x *GetDataFrameRequest) GetPeerId() string { + if x != nil { + return x.PeerId + } + return "" +} + type DataFrameResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1171,110 +1179,111 @@ var file_data_proto_rawDesc = []byte{ 0x74, 0x79, 0x70, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x79, 0x70, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, - 0x0d, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x22, 0x38, + 0x0d, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x22, 0x51, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x66, 0x72, 0x61, - 0x6d, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x70, 0x0a, 0x11, 0x44, 0x61, 0x74, 0x61, - 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, - 0x0b, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x6d, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, + 0x64, 0x22, 0x70, 0x0a, 0x11, 0x44, 0x61, 0x74, 0x61, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0b, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x66, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x71, 0x75, + 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x52, 0x0a, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x22, 0x51, 0x0a, 0x17, 0x50, 0x72, 0x65, 0x4d, 0x69, 0x64, 0x6e, 0x69, 0x67, + 0x68, 0x74, 0x4d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x63, 0x72, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x69, 0x6e, 0x63, + 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x34, 0x0a, 0x1c, 0x50, 0x72, 0x65, 0x4d, 0x69, 0x64, + 0x6e, 0x69, 0x67, 0x68, 0x74, 0x4d, 0x69, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0x97, 0x01, 0x0a, + 0x10, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x62, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x47, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x66, + 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x71, 0x75, + 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x52, 0x0b, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x16, + 0x0a, 0x06, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, + 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x22, 0x8b, 0x01, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6c, 0x6c, + 0x65, 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x72, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x45, 0x0a, + 0x0b, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x0a, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x46, - 0x72, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x51, 0x0a, 0x17, 0x50, 0x72, - 0x65, 0x4d, 0x69, 0x64, 0x6e, 0x69, 0x67, 0x68, 0x74, 0x4d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x09, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x34, 0x0a, - 0x1c, 0x50, 0x72, 0x65, 0x4d, 0x69, 0x64, 0x6e, 0x69, 0x67, 0x68, 0x74, 0x4d, 0x69, 0x6e, 0x74, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, - 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x22, 0x97, 0x01, 0x0a, 0x10, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x62, - 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, - 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x47, 0x0a, 0x0c, - 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, - 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6c, - 0x6f, 0x63, 0x6b, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x0b, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x46, - 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x22, 0x8b, 0x01, - 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, - 0x63, 0x6f, 0x72, 0x65, 0x12, 0x45, 0x0a, 0x0b, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x66, 0x72, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x71, 0x75, 0x69, 0x6c, - 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x63, - 0x6b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, - 0x0a, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x22, 0x30, 0x0a, 0x16, 0x43, - 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x32, 0xff, 0x05, - 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, - 0x17, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x53, 0x79, - 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, - 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x63, 0x6b, - 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, - 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x62, - 0x2e, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x53, - 0x79, 0x6e, 0x63, 0x30, 0x01, 0x12, 0x9a, 0x01, 0x0a, 0x1d, 0x4e, 0x65, 0x67, 0x6f, 0x74, 0x69, - 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x53, 0x79, 0x6e, - 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x39, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, - 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, - 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, - 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x1a, 0x3a, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, - 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, - 0x61, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x53, 0x79, 0x6e, 0x63, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x28, 0x01, - 0x30, 0x01, 0x12, 0x76, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x43, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x2e, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, - 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x32, 0x50, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x45, 0x6e, - 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x1a, 0x2e, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, - 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x32, 0x50, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x45, 0x6e, - 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x68, 0x0a, 0x0c, 0x47, 0x65, - 0x74, 0x44, 0x61, 0x74, 0x61, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x2e, 0x71, 0x75, 0x69, - 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x64, 0x61, 0x74, - 0x61, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x46, 0x72, 0x61, 0x6d, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, - 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x73, 0x0a, 0x15, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x50, 0x72, - 0x65, 0x4d, 0x69, 0x64, 0x6e, 0x69, 0x67, 0x68, 0x74, 0x4d, 0x69, 0x6e, 0x74, 0x12, 0x28, 0x2e, - 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, - 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x43, 0x6f, 0x69, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, - 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, - 0x62, 0x2e, 0x50, 0x72, 0x65, 0x4d, 0x69, 0x64, 0x6e, 0x69, 0x67, 0x68, 0x74, 0x4d, 0x69, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x83, 0x01, 0x0a, 0x18, 0x47, 0x65, - 0x74, 0x50, 0x72, 0x65, 0x4d, 0x69, 0x64, 0x6e, 0x69, 0x67, 0x68, 0x74, 0x4d, 0x69, 0x6e, 0x74, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x35, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, + 0x72, 0x61, 0x6d, 0x65, 0x22, 0x30, 0x0a, 0x16, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, + 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, + 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x32, 0xff, 0x05, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, + 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x53, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, + 0x73, 0x12, 0x2c, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, + 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x6f, + 0x63, 0x6b, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2b, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, + 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, + 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x53, 0x79, 0x6e, 0x63, 0x30, 0x01, 0x12, 0x9a, + 0x01, 0x0a, 0x1d, 0x4e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x70, + 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x53, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, + 0x12, 0x39, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, + 0x64, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x43, + 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x3a, 0x2e, 0x71, 0x75, + 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, + 0x73, 0x73, 0x65, 0x64, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x76, 0x0a, 0x10, 0x47, + 0x65, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, + 0x2e, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, + 0x65, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x32, 0x50, + 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x1a, + 0x2e, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, + 0x65, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x32, 0x50, + 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x28, + 0x01, 0x30, 0x01, 0x12, 0x68, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x46, 0x72, + 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, + 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, + 0x74, 0x44, 0x61, 0x74, 0x61, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2a, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, + 0x6f, 0x64, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, + 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x73, 0x0a, + 0x15, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x50, 0x72, 0x65, 0x4d, 0x69, 0x64, 0x6e, 0x69, 0x67, + 0x68, 0x74, 0x4d, 0x69, 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, + 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x62, + 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x30, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, + 0x64, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x65, 0x4d, 0x69, + 0x64, 0x6e, 0x69, 0x67, 0x68, 0x74, 0x4d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x83, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x4d, 0x69, 0x64, + 0x6e, 0x69, 0x67, 0x68, 0x74, 0x4d, 0x69, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x35, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, + 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x65, 0x4d, 0x69, 0x64, + 0x6e, 0x69, 0x67, 0x68, 0x74, 0x4d, 0x69, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x65, 0x4d, 0x69, 0x64, 0x6e, 0x69, 0x67, 0x68, 0x74, 0x4d, 0x69, 0x6e, 0x74, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, - 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, - 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x65, 0x4d, 0x69, 0x64, 0x6e, 0x69, - 0x67, 0x68, 0x74, 0x4d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, - 0x8c, 0x01, 0x0a, 0x0e, 0x44, 0x61, 0x74, 0x61, 0x49, 0x50, 0x43, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x7a, 0x0a, 0x17, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x43, - 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x2e, 0x2e, - 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, - 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, - 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, - 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, - 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, - 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3a, - 0x5a, 0x38, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, - 0x69, 0x75, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, - 0x75, 0x6d, 0x2f, 0x6d, 0x6f, 0x6e, 0x6f, 0x72, 0x65, 0x70, 0x6f, 0x2f, 0x6e, 0x6f, 0x64, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x8c, 0x01, 0x0a, 0x0e, 0x44, 0x61, 0x74, + 0x61, 0x49, 0x50, 0x43, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7a, 0x0a, 0x17, 0x43, + 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, + 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x2e, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, + 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x62, + 0x2e, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, + 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x62, + 0x2e, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3a, 0x5a, 0x38, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2f, 0x6d, 0x6f, 0x6e, 0x6f, + 0x72, 0x65, 0x70, 0x6f, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/node/protobufs/data.proto b/node/protobufs/data.proto index 6af93d1..b735f26 100644 --- a/node/protobufs/data.proto +++ b/node/protobufs/data.proto @@ -72,6 +72,7 @@ message InclusionCommitmentsMap { message GetDataFrameRequest { uint64 frame_number = 1; + string peer_id = 2; } message DataFrameResponse { diff --git a/node/tries/proof_leaf.go b/node/tries/proof_leaf.go index 6ee6181..aba68b5 100644 --- a/node/tries/proof_leaf.go +++ b/node/tries/proof_leaf.go @@ -32,6 +32,12 @@ func PackOutputIntoPayloadAndProof( frame *protobufs.ClockFrame, previousTree *mt.MerkleTree, ) (*mt.MerkleTree, []byte, [][]byte, error) { + if modulo != len(outputs) { + return nil, nil, nil, errors.Wrap( + errors.New("mismatch of outputs and prover size"), + "pack output into payload and proof", + ) + } tree, err := mt.New( &mt.Config{ HashFunc: func(data []byte) ([]byte, error) {