From 05f1bf94fea7524d6faa5d8764e7882f3f2629fc Mon Sep 17 00:00:00 2001 From: petricadaipegsp <155911522+petricadaipegsp@users.noreply.github.com> Date: Sun, 10 Nov 2024 13:03:38 +0100 Subject: [PATCH 01/14] Remove additional signatures from data peer list announcements (#335) * Do not verify data peer announcement signatures * Do not sign data peer announcements explicitly * Implement single peer data peer list announcement --- node/consensus/data/broadcast_messaging.go | 33 +- .../data/data_clock_consensus_engine.go | 42 +- node/consensus/data/message_handler.go | 165 +++---- node/protobufs/data.pb.go | 420 +++++++++--------- node/protobufs/data.proto | 10 +- 5 files changed, 282 insertions(+), 388 deletions(-) diff --git a/node/consensus/data/broadcast_messaging.go b/node/consensus/data/broadcast_messaging.go index 3a726a8..0397f1d 100644 --- a/node/consensus/data/broadcast_messaging.go +++ b/node/consensus/data/broadcast_messaging.go @@ -1,7 +1,6 @@ package data import ( - "encoding/binary" "strings" "time" @@ -54,13 +53,6 @@ func (e *DataClockConsensusEngine) publishProof( ) timestamp := time.Now().UnixMilli() - msg := binary.BigEndian.AppendUint64([]byte{}, frame.FrameNumber) - msg = append(msg, config.GetVersion()...) - msg = binary.BigEndian.AppendUint64(msg, uint64(timestamp)) - sig, err := e.pubSub.SignMessage(msg) - if err != nil { - panic(err) - } e.peerMapMx.Lock() e.peerMap[string(e.pubSub.GetPeerID())] = &peerInfo{ @@ -68,28 +60,23 @@ func (e *DataClockConsensusEngine) publishProof( multiaddr: "", maxFrame: frame.FrameNumber, version: config.GetVersion(), - signature: sig, - publicKey: e.pubSub.GetPublicKey(), timestamp: timestamp, totalDistance: e.dataTimeReel.GetTotalDistance().FillBytes( make([]byte, 256), ), } list := &protobufs.DataPeerListAnnounce{ - PeerList: []*protobufs.DataPeer{}, + Peer: &protobufs.DataPeer{ + PeerId: nil, + Multiaddr: "", + MaxFrame: frame.FrameNumber, + Version: config.GetVersion(), + Timestamp: timestamp, + TotalDistance: e.dataTimeReel.GetTotalDistance().FillBytes( + make([]byte, 256), + ), + }, } - list.PeerList = append(list.PeerList, &protobufs.DataPeer{ - PeerId: e.pubSub.GetPeerID(), - Multiaddr: "", - MaxFrame: frame.FrameNumber, - Version: config.GetVersion(), - Signature: sig, - PublicKey: e.pubSub.GetPublicKey(), - Timestamp: timestamp, - TotalDistance: e.dataTimeReel.GetTotalDistance().FillBytes( - make([]byte, 256), - ), - }) e.peerMapMx.Unlock() if err := e.publishMessage(e.infoFilter, list); err != nil { e.logger.Debug("error publishing message", zap.Error(err)) diff --git a/node/consensus/data/data_clock_consensus_engine.go b/node/consensus/data/data_clock_consensus_engine.go index 6aa9565..513d203 100644 --- a/node/consensus/data/data_clock_consensus_engine.go +++ b/node/consensus/data/data_clock_consensus_engine.go @@ -56,9 +56,6 @@ type peerInfo struct { timestamp int64 lastSeen int64 version []byte - signature []byte - publicKey []byte - direct bool totalDistance []byte } @@ -415,8 +412,18 @@ func (e *DataClockConsensusEngine) Start() <-chan error { frame = nextFrame + timestamp := time.Now().UnixMilli() list := &protobufs.DataPeerListAnnounce{ - PeerList: []*protobufs.DataPeer{}, + Peer: &protobufs.DataPeer{ + PeerId: nil, + Multiaddr: "", + MaxFrame: frame.FrameNumber, + Version: config.GetVersion(), + Timestamp: timestamp, + TotalDistance: e.dataTimeReel.GetTotalDistance().FillBytes( + make([]byte, 256), + ), + }, } e.latestFrameReceived = frame.FrameNumber @@ -425,41 +432,18 @@ func (e *DataClockConsensusEngine) Start() <-chan error { zap.Uint64("frame_number", frame.FrameNumber), ) - timestamp := time.Now().UnixMilli() - msg := binary.BigEndian.AppendUint64([]byte{}, frame.FrameNumber) - msg = append(msg, config.GetVersion()...) - msg = binary.BigEndian.AppendUint64(msg, uint64(timestamp)) - sig, err := e.pubSub.SignMessage(msg) - if err != nil { - panic(err) - } - e.peerMapMx.Lock() e.peerMap[string(e.pubSub.GetPeerID())] = &peerInfo{ peerId: e.pubSub.GetPeerID(), multiaddr: "", maxFrame: frame.FrameNumber, version: config.GetVersion(), - signature: sig, - publicKey: e.pubSub.GetPublicKey(), timestamp: timestamp, totalDistance: e.dataTimeReel.GetTotalDistance().FillBytes( make([]byte, 256), ), } deletes := []*peerInfo{} - list.PeerList = append(list.PeerList, &protobufs.DataPeer{ - PeerId: e.pubSub.GetPeerID(), - Multiaddr: "", - MaxFrame: frame.FrameNumber, - Version: config.GetVersion(), - Signature: sig, - PublicKey: e.pubSub.GetPublicKey(), - Timestamp: timestamp, - TotalDistance: e.dataTimeReel.GetTotalDistance().FillBytes( - make([]byte, 256), - ), - }) for _, v := range e.peerMap { if v == nil { continue @@ -875,8 +859,6 @@ func ( MaxFrame: v.maxFrame, Timestamp: v.timestamp, Version: v.version, - Signature: v.signature, - PublicKey: v.publicKey, TotalDistance: v.totalDistance, }) } @@ -889,8 +871,6 @@ func ( MaxFrame: v.maxFrame, Timestamp: v.timestamp, Version: v.version, - Signature: v.signature, - PublicKey: v.publicKey, TotalDistance: v.totalDistance, }, ) diff --git a/node/consensus/data/message_handler.go b/node/consensus/data/message_handler.go index a7e5cf0..ed3c4a3 100644 --- a/node/consensus/data/message_handler.go +++ b/node/consensus/data/message_handler.go @@ -2,11 +2,9 @@ package data import ( "bytes" - "encoding/binary" "time" "github.com/iden3/go-iden3-crypto/poseidon" - pcrypto "github.com/libp2p/go-libp2p/core/crypto" "github.com/libp2p/go-libp2p/core/peer" "github.com/pkg/errors" "go.uber.org/zap" @@ -278,123 +276,66 @@ func (e *DataClockConsensusEngine) handleDataPeerListAnnounce( address []byte, any *anypb.Any, ) error { + if bytes.Equal(peerID, e.pubSub.GetPeerID()) { + return nil + } + announce := &protobufs.DataPeerListAnnounce{} if err := any.UnmarshalTo(announce); err != nil { return errors.Wrap(err, "handle data peer list announce") } - for _, p := range announce.PeerList { - if bytes.Equal(p.PeerId, e.pubSub.GetPeerID()) { - continue - } + p := announce.Peer - if !bytes.Equal(p.PeerId, peerID) { - continue - } - - if p.PublicKey == nil || p.Signature == nil || p.Version == nil { - continue - } - - head, err := e.dataTimeReel.Head() - if err == nil { - if p.MaxFrame < head.FrameNumber { - continue - } - } - - if p.PublicKey != nil && p.Signature != nil && p.Version != nil { - key, err := pcrypto.UnmarshalEd448PublicKey(p.PublicKey) - if err != nil { - e.logger.Warn( - "peer announcement contained invalid pubkey", - zap.Binary("public_key", p.PublicKey), - ) - continue - } - - if !(peer.ID(p.PeerId)).MatchesPublicKey(key) { - e.logger.Warn( - "peer announcement peer id does not match pubkey", - zap.Binary("peer_id", p.PeerId), - zap.Binary("public_key", p.PublicKey), - ) - continue - } - - msg := binary.BigEndian.AppendUint64([]byte{}, p.MaxFrame) - msg = append(msg, p.Version...) - msg = binary.BigEndian.AppendUint64(msg, uint64(p.Timestamp)) - b, err := key.Verify(msg, p.Signature) - if err != nil || !b { - e.logger.Warn( - "peer provided invalid signature", - zap.Binary("msg", msg), - zap.Binary("public_key", p.PublicKey), - zap.Binary("signature", p.Signature), - ) - continue - } - - if bytes.Compare(p.Version, config.GetMinimumVersion()) < 0 && - p.Timestamp > config.GetMinimumVersionCutoff().UnixMilli() { - e.logger.Debug( - "peer provided outdated version, penalizing app score", - zap.Binary("peer_id", p.PeerId), - ) - e.pubSub.SetPeerScore(p.PeerId, -1000000) - continue - } - } - - e.peerMapMx.RLock() - if _, ok := e.uncooperativePeersMap[string(p.PeerId)]; ok { - e.peerMapMx.RUnlock() - continue - } - e.peerMapMx.RUnlock() - - multiaddr := e.pubSub.GetMultiaddrOfPeer(p.PeerId) - - e.pubSub.SetPeerScore(p.PeerId, 10) - - e.peerMapMx.RLock() - existing, ok := e.peerMap[string(p.PeerId)] - e.peerMapMx.RUnlock() - - if ok { - if existing.signature != nil && p.Signature == nil { - continue - } - - if existing.publicKey != nil && p.PublicKey == nil { - continue - } - - if existing.version != nil && p.Version == nil { - continue - } - - if existing.timestamp > p.Timestamp { - continue - } - } - - e.peerMapMx.Lock() - e.peerMap[string(p.PeerId)] = &peerInfo{ - peerId: p.PeerId, - multiaddr: multiaddr, - maxFrame: p.MaxFrame, - direct: bytes.Equal(p.PeerId, peerID), - lastSeen: time.Now().Unix(), - timestamp: p.Timestamp, - version: p.Version, - signature: p.Signature, - publicKey: p.PublicKey, - totalDistance: p.TotalDistance, - } - e.peerMapMx.Unlock() + head, err := e.dataTimeReel.Head() + if err != nil { + return errors.Wrap(err, "handle data peer list announce") } + if p.MaxFrame <= head.FrameNumber { + return nil + } + + if p.Version != nil && + bytes.Compare(p.Version, config.GetMinimumVersion()) < 0 && + p.Timestamp > config.GetMinimumVersionCutoff().UnixMilli() { + e.logger.Debug( + "peer provided outdated version, penalizing app score", + zap.String("peer_id", peer.ID(peerID).String()), + ) + e.pubSub.SetPeerScore(peerID, -1000000) + return nil + } + + e.peerMapMx.RLock() + if _, ok := e.uncooperativePeersMap[string(peerID)]; ok { + e.peerMapMx.RUnlock() + return nil + } + e.peerMapMx.RUnlock() + + e.pubSub.SetPeerScore(peerID, 10) + + e.peerMapMx.RLock() + existing, ok := e.peerMap[string(peerID)] + e.peerMapMx.RUnlock() + + if ok && existing.timestamp > p.Timestamp { + return nil + } + + multiaddr := e.pubSub.GetMultiaddrOfPeer(peerID) + e.peerMapMx.Lock() + e.peerMap[string(peerID)] = &peerInfo{ + peerId: peerID, + multiaddr: multiaddr, + maxFrame: p.MaxFrame, + lastSeen: time.Now().Unix(), + timestamp: p.Timestamp, + version: p.Version, + totalDistance: p.TotalDistance, + } + e.peerMapMx.Unlock() + return nil } diff --git a/node/protobufs/data.pb.go b/node/protobufs/data.pb.go index 47aecca..01594d5 100644 --- a/node/protobufs/data.pb.go +++ b/node/protobufs/data.pb.go @@ -25,7 +25,7 @@ type DataPeerListAnnounce struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - PeerList []*DataPeer `protobuf:"bytes,1,rep,name=peer_list,json=peerList,proto3" json:"peer_list,omitempty"` + Peer *DataPeer `protobuf:"bytes,2,opt,name=peer,proto3" json:"peer,omitempty"` } func (x *DataPeerListAnnounce) Reset() { @@ -60,9 +60,9 @@ func (*DataPeerListAnnounce) Descriptor() ([]byte, []int) { return file_data_proto_rawDescGZIP(), []int{0} } -func (x *DataPeerListAnnounce) GetPeerList() []*DataPeer { +func (x *DataPeerListAnnounce) GetPeer() *DataPeer { if x != nil { - return x.PeerList + return x.Peer } return nil } @@ -77,8 +77,6 @@ type DataPeer struct { MaxFrame uint64 `protobuf:"varint,3,opt,name=max_frame,json=maxFrame,proto3" json:"max_frame,omitempty"` Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Version []byte `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"` - Signature []byte `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"` - PublicKey []byte `protobuf:"bytes,7,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` TotalDistance []byte `protobuf:"bytes,8,opt,name=total_distance,json=totalDistance,proto3" json:"total_distance,omitempty"` } @@ -149,20 +147,6 @@ func (x *DataPeer) GetVersion() []byte { return nil } -func (x *DataPeer) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -func (x *DataPeer) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - func (x *DataPeer) GetTotalDistance() []byte { if x != nil { return x.TotalDistance @@ -1065,216 +1049,214 @@ var file_data_proto_rawDesc = []byte{ 0x74, 0x61, 0x2e, 0x70, 0x62, 0x1a, 0x0d, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0b, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x6b, 0x65, 0x79, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x6e, - 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x56, 0x0a, 0x14, 0x44, 0x61, 0x74, + 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5e, 0x0a, 0x14, 0x44, 0x61, 0x74, 0x61, 0x50, 0x65, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, - 0x65, 0x12, 0x3e, 0x0a, 0x09, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 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, 0x50, 0x65, 0x65, 0x72, 0x52, 0x08, 0x70, 0x65, 0x65, 0x72, 0x4c, 0x69, 0x73, - 0x74, 0x22, 0xfa, 0x01, 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, 0x50, 0x65, 0x65, 0x72, 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, 0x1c, 0x0a, 0x09, 0x6d, 0x75, 0x6c, 0x74, 0x69, - 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x75, 0x6c, 0x74, - 0x69, 0x61, 0x64, 0x64, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x72, 0x61, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x46, 0x72, 0x61, - 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x5f, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xd4, - 0x02, 0x0a, 0x12, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, - 0x64, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x2a, 0x0a, 0x11, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x66, 0x72, - 0x61, 0x6d, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0f, 0x66, 0x72, 0x6f, 0x6d, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x6f, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x5f, 0x6e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x74, 0x6f, 0x46, 0x72, - 0x61, 0x6d, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x5a, 0x0a, 0x16, 0x74, 0x72, 0x75, - 0x6e, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 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, - 0x14, 0x74, 0x72, 0x75, 0x6e, 0x63, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x46, - 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x43, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 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, - 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x4d, - 0x61, 0x70, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x49, 0x0a, 0x08, 0x73, 0x65, - 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 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, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, - 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4d, 0x61, 0x70, 0x52, 0x08, 0x73, 0x65, 0x67, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x97, 0x01, 0x0a, 0x19, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 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, 0x1c, 0x0a, 0x09, - 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x09, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x12, 0x43, 0x0a, 0x08, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x71, - 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x6b, - 0x65, 0x79, 0x73, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x64, 0x34, 0x34, 0x38, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0xaa, 0x02, 0x0a, 0x20, 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, 0x12, 0x4e, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x66, 0x6c, 0x69, 0x67, 0x68, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, + 0x65, 0x12, 0x35, 0x0a, 0x04, 0x70, 0x65, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 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, 0x50, 0x65, + 0x65, 0x72, 0x52, 0x04, 0x70, 0x65, 0x65, 0x72, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x52, 0x09, + 0x70, 0x65, 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x22, 0xe0, 0x01, 0x0a, 0x08, 0x44, 0x61, + 0x74, 0x61, 0x50, 0x65, 0x65, 0x72, 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, + 0x1c, 0x0a, 0x09, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x61, 0x64, 0x64, 0x72, 0x12, 0x1b, 0x0a, + 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x08, 0x6d, 0x61, 0x78, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x69, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x4a, + 0x04, 0x08, 0x07, 0x10, 0x08, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x22, 0xd4, 0x02, 0x0a, + 0x12, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x53, + 0x79, 0x6e, 0x63, 0x12, 0x2a, 0x0a, 0x11, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x66, 0x72, 0x61, 0x6d, + 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, + 0x66, 0x72, 0x6f, 0x6d, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x26, 0x0a, 0x0f, 0x74, 0x6f, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x74, 0x6f, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x5a, 0x0a, 0x16, 0x74, 0x72, 0x75, 0x6e, 0x63, + 0x61, 0x74, 0x65, 0x64, 0x5f, 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, 0x73, 0x50, 0x72, - 0x65, 0x66, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x48, 0x00, 0x52, 0x09, 0x70, 0x72, 0x65, 0x66, 0x6c, - 0x69, 0x67, 0x68, 0x74, 0x12, 0x48, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 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, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5c, - 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 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, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, - 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0e, 0x61, 0x75, - 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0e, 0x0a, 0x0c, - 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xce, 0x01, 0x0a, - 0x21, 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, + 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x14, 0x74, + 0x72, 0x75, 0x6e, 0x63, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x46, 0x72, 0x61, + 0x6d, 0x65, 0x73, 0x12, 0x43, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 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, 0x49, 0x6e, + 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x4d, 0x61, 0x70, + 0x52, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x49, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 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, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, + 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4d, 0x61, 0x70, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x22, 0x97, 0x01, 0x0a, 0x19, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 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, 0x1c, 0x0a, 0x09, 0x63, 0x68, + 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, + 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x12, 0x43, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x71, 0x75, 0x69, + 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x6b, 0x65, 0x79, + 0x73, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x64, 0x34, 0x34, 0x38, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xaa, 0x02, + 0x0a, 0x20, 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, 0x12, 0x4e, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x66, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 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, 0x50, 0x72, 0x65, 0x66, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x48, 0x00, 0x52, 0x09, 0x70, 0x72, 0x65, 0x66, 0x6c, 0x69, 0x67, - 0x68, 0x74, 0x12, 0x49, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, + 0x68, 0x74, 0x12, 0x48, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 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, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5c, 0x0a, 0x0e, + 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 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, 0x53, + 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, + 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x68, + 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0e, 0x0a, 0x0c, 0x73, 0x79, + 0x6e, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xce, 0x01, 0x0a, 0x21, 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, + 0x12, 0x4e, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x66, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2e, 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, 0x50, 0x72, 0x65, 0x66, 0x6c, 0x69, + 0x67, 0x68, 0x74, 0x48, 0x00, 0x52, 0x09, 0x70, 0x72, 0x65, 0x66, 0x6c, 0x69, 0x67, 0x68, 0x74, + 0x12, 0x49, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 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, 0x48, + 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x73, + 0x79, 0x6e, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xa1, 0x01, 0x0a, 0x12, + 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x4d, + 0x61, 0x70, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x52, 0x0a, 0x0b, 0x63, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 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, 0x49, 0x6e, 0x63, 0x6c, 0x75, + 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4d, + 0x61, 0x70, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, + 0x3e, 0x0a, 0x14, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x4d, 0x61, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, + 0x7b, 0x0a, 0x17, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4d, 0x61, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 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, 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, 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, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0e, 0x0a, - 0x0c, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xa1, 0x01, - 0x0a, 0x12, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x73, 0x4d, 0x61, 0x70, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x5f, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x66, 0x72, 0x61, 0x6d, - 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x52, 0x0a, - 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 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, 0x49, 0x6e, 0x63, - 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x4d, 0x61, 0x70, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x22, 0x3e, 0x0a, 0x14, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, - 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4d, 0x61, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, - 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x12, 0x0a, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x22, 0x7b, 0x0a, 0x17, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4d, 0x61, 0x70, 0x12, 0x1e, 0x0a, 0x0a, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, - 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, - 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, - 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, + 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, 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, + 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, 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, + 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, 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 ( @@ -1315,7 +1297,7 @@ var file_data_proto_goTypes = []interface{}{ (*MintCoinRequest)(nil), // 21: quilibrium.node.node.pb.MintCoinRequest } var file_data_proto_depIdxs = []int32{ - 1, // 0: quilibrium.node.data.pb.DataPeerListAnnounce.peer_list:type_name -> quilibrium.node.data.pb.DataPeer + 1, // 0: quilibrium.node.data.pb.DataPeerListAnnounce.peer:type_name -> quilibrium.node.data.pb.DataPeer 16, // 1: quilibrium.node.data.pb.DataCompressedSync.truncated_clock_frames:type_name -> quilibrium.node.clock.pb.ClockFrame 6, // 2: quilibrium.node.data.pb.DataCompressedSync.proofs:type_name -> quilibrium.node.data.pb.InclusionProofsMap 7, // 3: quilibrium.node.data.pb.DataCompressedSync.segments:type_name -> quilibrium.node.data.pb.InclusionSegmentsMap diff --git a/node/protobufs/data.proto b/node/protobufs/data.proto index 6af93d1..0856d5d 100644 --- a/node/protobufs/data.proto +++ b/node/protobufs/data.proto @@ -10,7 +10,9 @@ import "keys.proto"; import "node.proto"; message DataPeerListAnnounce { - repeated DataPeer peer_list = 1; + reserved 1; + reserved "peer_list"; + DataPeer peer = 2; } message DataPeer { @@ -19,8 +21,10 @@ message DataPeer { uint64 max_frame = 3; int64 timestamp = 4; bytes version = 5; - bytes signature = 6; - bytes public_key = 7; + reserved 6; + reserved "signature"; + reserved 7; + reserved "public_key"; bytes total_distance = 8; } From 77c036b94bfa56f590e33e9974fb0fd68aed5d3c Mon Sep 17 00:00:00 2001 From: Cassandra Heart Date: Sun, 10 Nov 2024 01:15:15 -0600 Subject: [PATCH 02/14] v2.0.3-p0 --- node/consensus/data/consensus_frames.go | 9 +- .../data/data_clock_consensus_engine.go | 56 -- node/consensus/data/main_data_loop.go | 9 +- node/execution/execution_engine.go | 2 + .../token/application/token_application.go | 43 +- .../token/application/token_handle_mint.go | 73 +- .../token_handle_prover_announce.go | 12 +- .../application/token_handle_prover_join.go | 4 + .../token_handle_prover_join_test.go | 6 +- .../application/token_handle_prover_leave.go | 4 + .../application/token_handle_prover_pause.go | 4 + .../application/token_handle_prover_resume.go | 4 + .../token/token_execution_engine.go | 645 +++++++++++++----- .../token/token_execution_engine_test.go | 52 ++ .../intrinsics/token/token_genesis.go | 184 ++++- node/protobufs/node.go | 49 +- node/store/coin.go | 13 + node/tries/proof_leaf_test.go | 3 +- node/tries/rolling_frecency_critbit_trie.go | 2 +- 19 files changed, 899 insertions(+), 275 deletions(-) create mode 100644 node/execution/intrinsics/token/token_execution_engine_test.go diff --git a/node/consensus/data/consensus_frames.go b/node/consensus/data/consensus_frames.go index 1a195dd..1688702 100644 --- a/node/consensus/data/consensus_frames.go +++ b/node/consensus/data/consensus_frames.go @@ -202,6 +202,7 @@ func (e *DataClockConsensusEngine) prove( if err != nil { return nil, errors.Wrap(err, "prove") } + e.lastProven = previousFrame.FrameNumber e.logger.Info( "returning new proven frame", @@ -233,12 +234,6 @@ func (e *DataClockConsensusEngine) GetMostAheadPeer( max := frameNumber var peer []byte = nil e.peerMapMx.RLock() - beaconInfo, ok := e.peerMap[string(e.beaconPeerId)] - if !ok { - e.peerMapMx.RUnlock() - return nil, 0, p2p.ErrNoPeersAvailable - } - for _, v := range e.peerMap { e.logger.Debug( "checking peer info", @@ -248,7 +243,7 @@ func (e *DataClockConsensusEngine) GetMostAheadPeer( zap.Binary("version", v.version), ) _, ok := e.uncooperativePeersMap[string(v.peerId)] - if v.maxFrame <= beaconInfo.maxFrame && v.maxFrame > max && + if v.maxFrame > max && v.timestamp > config.GetMinimumVersionCutoff().UnixMilli() && bytes.Compare(v.version, config.GetMinimumVersion()) >= 0 && !ok { peer = v.peerId diff --git a/node/consensus/data/data_clock_consensus_engine.go b/node/consensus/data/data_clock_consensus_engine.go index 513d203..3b4fc48 100644 --- a/node/consensus/data/data_clock_consensus_engine.go +++ b/node/consensus/data/data_clock_consensus_engine.go @@ -1,7 +1,6 @@ package data import ( - "bytes" "context" "crypto" "encoding/binary" @@ -11,8 +10,6 @@ import ( "time" "github.com/iden3/go-iden3-crypto/poseidon" - pcrypto "github.com/libp2p/go-libp2p/core/crypto" - "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/p2p/discovery/backoff" "github.com/multiformats/go-multiaddr" mn "github.com/multiformats/go-multiaddr/net" @@ -98,7 +95,6 @@ type DataClockConsensusEngine struct { currentReceivingSyncPeersMx sync.Mutex currentReceivingSyncPeers int announcedJoin int - beaconPeerId []byte frameChan chan *protobufs.ClockFrame executionEngines map[string]execution.ExecutionEngine @@ -198,17 +194,6 @@ func NewDataClockConsensusEngine( panic(errors.New("peer info manager is nil")) } - genesis := config.GetGenesis() - beaconPubKey, err := pcrypto.UnmarshalEd448PublicKey(genesis.Beacon) - if err != nil { - panic(err) - } - - beaconPeerId, err := peer.IDFromPublicKey(beaconPubKey) - if err != nil { - panic(err) - } - minimumPeersRequired := cfg.Engine.MinimumPeersRequired if minimumPeersRequired == 0 { minimumPeersRequired = 3 @@ -256,7 +241,6 @@ func NewDataClockConsensusEngine( infoMessageProcessorCh: make(chan *pb.Message), config: cfg, preMidnightMint: map[string]struct{}{}, - beaconPeerId: []byte(beaconPeerId), } logger.Info("constructing consensus engine") @@ -396,20 +380,6 @@ func (e *DataClockConsensusEngine) Start() <-chan error { continue } - e.peerMapMx.RLock() - beaconInfo, ok := e.peerMap[string(e.beaconPeerId)] - if !ok { - e.peerMapMx.RUnlock() - time.Sleep(120 * time.Second) - continue - } - e.peerMapMx.RUnlock() - - if nextFrame.FrameNumber < beaconInfo.maxFrame-100 { - time.Sleep(120 * time.Second) - continue - } - frame = nextFrame timestamp := time.Now().UnixMilli() @@ -1135,29 +1105,3 @@ func (e *DataClockConsensusEngine) createParallelDataClientsFromBaseMultiaddr( ) return clients, nil } - -func (e *DataClockConsensusEngine) announceProverJoin() { - msg := []byte("join") - head, _ := e.dataTimeReel.Head() - msg = binary.BigEndian.AppendUint64(msg, head.FrameNumber) - msg = append(msg, bytes.Repeat([]byte{0xff}, 32)...) - sig, err := e.pubSub.SignMessage(msg) - if err != nil { - panic(err) - } - - e.publishMessage(e.txFilter, &protobufs.TokenRequest{ - Request: &protobufs.TokenRequest_Join{ - Join: &protobufs.AnnounceProverJoin{ - Filter: bytes.Repeat([]byte{0xff}, 32), - FrameNumber: head.FrameNumber, - PublicKeySignatureEd448: &protobufs.Ed448Signature{ - Signature: sig, - PublicKey: &protobufs.Ed448PublicKey{ - KeyValue: e.pubSub.GetPublicKey(), - }, - }, - }, - }, - }) -} diff --git a/node/consensus/data/main_data_loop.go b/node/consensus/data/main_data_loop.go index 13f2132..9e7d524 100644 --- a/node/consensus/data/main_data_loop.go +++ b/node/consensus/data/main_data_loop.go @@ -83,8 +83,7 @@ func (e *DataClockConsensusEngine) processFrame( } } - if latestFrame != nil && - dataFrame.FrameNumber > latestFrame.FrameNumber { + if latestFrame != nil && dataFrame.FrameNumber > latestFrame.FrameNumber { latestFrame = dataFrame } @@ -131,7 +130,11 @@ func (e *DataClockConsensusEngine) processFrame( if !e.IsInProverTrie(e.pubSub.GetPeerID()) && dataFrame.Timestamp > time.Now().UnixMilli()-30000 { e.logger.Info("announcing prover join") - e.announceProverJoin() + for _, eng := range e.executionEngines { + eng.AnnounceProverMerge() + eng.AnnounceProverJoin() + break + } } return latestFrame } diff --git a/node/execution/execution_engine.go b/node/execution/execution_engine.go index 6b08130..806d73a 100644 --- a/node/execution/execution_engine.go +++ b/node/execution/execution_engine.go @@ -19,4 +19,6 @@ type ExecutionEngine interface { GetFrame() *protobufs.ClockFrame GetSeniority() *big.Int GetRingPosition() int + AnnounceProverMerge() + AnnounceProverJoin() } diff --git a/node/execution/intrinsics/token/application/token_application.go b/node/execution/intrinsics/token/application/token_application.go index 0f8f7b0..832734c 100644 --- a/node/execution/intrinsics/token/application/token_application.go +++ b/node/execution/intrinsics/token/application/token_application.go @@ -139,6 +139,41 @@ func (a *TokenApplication) ApplyTransitions( requests = transitions.Requests } + parallelismMap := map[int]uint64{} + for i := range a.Tries[1:] { + parallelismMap[i] = 0 + } + + seen := map[string]struct{}{} + + for _, transition := range requests { + switch t := transition.Request.(type) { + case *protobufs.TokenRequest_Mint: + ring, parallelism, err := t.Mint.RingAndParallelism( + func(addr []byte) int { + if _, ok := seen[string(addr)]; ok { + return -1 + } + + ring := -1 + for i, t := range a.Tries[1:] { + if t.Contains(addr) { + ring = i + seen[string(addr)] = struct{}{} + } + } + + return ring + }, + ) + if err != nil { + continue + } + + parallelismMap[ring] = parallelismMap[ring] + uint64(parallelism) + } + } + for _, transition := range requests { req: switch t := transition.Request.(type) { @@ -319,7 +354,13 @@ func (a *TokenApplication) ApplyTransitions( transition, ) case *protobufs.TokenRequest_Mint: - success, err := a.handleMint(currentFrameNumber, lockMap, t.Mint, frame) + success, err := a.handleMint( + currentFrameNumber, + lockMap, + t.Mint, + frame, + parallelismMap, + ) if err != nil { if !skipFailures { return nil, nil, nil, errors.Wrap( diff --git a/node/execution/intrinsics/token/application/token_handle_mint.go b/node/execution/intrinsics/token/application/token_handle_mint.go index 905b74b..0e4af67 100644 --- a/node/execution/intrinsics/token/application/token_handle_mint.go +++ b/node/execution/intrinsics/token/application/token_handle_mint.go @@ -18,11 +18,14 @@ import ( "source.quilibrium.com/quilibrium/monorepo/node/tries" ) +const PROOF_FRAME_CUTOFF = 46500 + func (a *TokenApplication) handleMint( currentFrameNumber uint64, lockMap map[string]struct{}, t *protobufs.MintCoinRequest, frame *protobufs.ClockFrame, + parallelismMap map[int]uint64, ) ([]*protobufs.TokenOutput, error) { if t == nil || t.Proofs == nil || t.Signature == nil { return nil, errors.Wrap(ErrInvalidStateTransition, "handle mint") @@ -119,7 +122,7 @@ func (a *TokenApplication) handleMint( }, } return outputs, nil - } else if len(t.Proofs) > 0 && currentFrameNumber > 0 { + } else if len(t.Proofs) > 0 && currentFrameNumber > PROOF_FRAME_CUTOFF { a.Logger.Debug( "got mint from peer", zap.String("peer_id", base58.Encode([]byte(peerId))), @@ -134,7 +137,6 @@ func (a *TokenApplication) handleMint( return nil, errors.Wrap(ErrInvalidStateTransition, "handle mint") } ring := -1 - proverSet := int64((len(a.Tries) - 1) * 1024) for i, t := range a.Tries[1:] { if t.Contains(altAddr.FillBytes(make([]byte, 32))) { ring = i @@ -232,8 +234,12 @@ func (a *TokenApplication) handleMint( ) } + // Current frame - 2 is because the current frame is the newly created frame, + // and the provers are submitting proofs on the frame preceding the one they + // last saw. This enforces liveness and creates a punishment for being + // late. if (previousFrame != nil && newFrameNumber <= previousFrame.FrameNumber) || - newFrameNumber < currentFrameNumber-10 { + newFrameNumber < currentFrameNumber-2 { previousFrameNumber := uint64(0) if previousFrame != nil { previousFrameNumber = previousFrame.FrameNumber @@ -349,15 +355,9 @@ func (a *TokenApplication) handleMint( ) } if verified && delete != nil && len(t.Proofs) > 3 { - ringFactor := big.NewInt(2) - ringFactor.Exp(ringFactor, big.NewInt(int64(ring)), nil) - - // const for testnet - storage := big.NewInt(int64(256 * parallelism)) - unitFactor := big.NewInt(8000000000) - storage.Mul(storage, unitFactor) - storage.Quo(storage, big.NewInt(proverSet)) - storage.Quo(storage, ringFactor) + storage := PomwBasis(1, ring, currentFrameNumber) + storage.Quo(storage, big.NewInt(int64(parallelismMap[ring]))) + storage.Mul(storage, big.NewInt(int64(parallelism))) a.Logger.Debug( "issued reward", @@ -458,3 +458,52 @@ func (a *TokenApplication) handleMint( ) return nil, errors.Wrap(ErrInvalidStateTransition, "handle mint") } + +func PomwBasis(generation uint64, ring int, currentFrameNumber uint64) *big.Int { + prec := uint(53) + + one := new(big.Float).SetPrec(prec).SetInt64(1) + divisor := new(big.Float).SetPrec(prec).SetInt64(1048576) + + normalized := new(big.Float).SetPrec(prec) + // A simple hack for estimating state growth in terms of frames, based on + // linear relationship of state growth: + normalized.SetInt64(int64((737280 + currentFrameNumber) / 184320)) + normalized.Quo(normalized, divisor) + + // 1/2^n + exp := new(big.Float).SetPrec(prec).SetInt64(1) + if generation > 0 { + powerOfTwo := new(big.Float).SetPrec(prec).SetInt64(2) + powerOfTwo.SetInt64(1) + for i := uint64(0); i < generation; i++ { + powerOfTwo.Mul(powerOfTwo, big.NewFloat(2)) + } + exp.Quo(one, powerOfTwo) + } + + // (d/1048576)^(1/2^n) + result := new(big.Float).Copy(normalized) + if generation > 0 { + for i := uint64(0); i < generation; i++ { + result.Sqrt(result) + } + } + + // Calculate 1/result + result.Quo(one, result) + + // Divide by 2^s + if ring > 0 { + divisor := new(big.Float).SetPrec(prec).SetInt64(1) + for i := 0; i < ring; i++ { + divisor.Mul(divisor, big.NewFloat(2)) + } + result.Quo(result, divisor) + } + + result.Mul(result, new(big.Float).SetPrec(prec).SetInt64(8000000000)) + + out, _ := result.Int(new(big.Int)) + return out +} diff --git a/node/execution/intrinsics/token/application/token_handle_prover_announce.go b/node/execution/intrinsics/token/application/token_handle_prover_announce.go index 28dfc03..518f0ce 100644 --- a/node/execution/intrinsics/token/application/token_handle_prover_announce.go +++ b/node/execution/intrinsics/token/application/token_handle_prover_announce.go @@ -16,7 +16,8 @@ func (a *TokenApplication) handleAnnounce( var primary *protobufs.Ed448Signature payload := []byte{} - if t == nil || t.PublicKeySignaturesEd448 == nil { + if t == nil || t.PublicKeySignaturesEd448 == nil || + len(t.PublicKeySignaturesEd448) == 0 { return nil, errors.Wrap(ErrInvalidStateTransition, "handle announce") } for i, p := range t.PublicKeySignaturesEd448 { @@ -44,11 +45,18 @@ func (a *TokenApplication) handleAnnounce( return nil, errors.Wrap(ErrInvalidStateTransition, "handle announce") } - for _, p := range t.PublicKeySignaturesEd448 { + for _, p := range t.PublicKeySignaturesEd448[1:] { lockMap[string(p.PublicKey.KeyValue)] = struct{}{} } outputs := []*protobufs.TokenOutput{} + if currentFrameNumber >= PROOF_FRAME_CUTOFF { + outputs = append(outputs, &protobufs.TokenOutput{ + Output: &protobufs.TokenOutput_Announce{ + Announce: t, + }, + }) + } return outputs, nil } diff --git a/node/execution/intrinsics/token/application/token_handle_prover_join.go b/node/execution/intrinsics/token/application/token_handle_prover_join.go index c723ef5..7ec14a1 100644 --- a/node/execution/intrinsics/token/application/token_handle_prover_join.go +++ b/node/execution/intrinsics/token/application/token_handle_prover_join.go @@ -46,6 +46,10 @@ func (a *TokenApplication) handleDataAnnounceProverJoin( []*protobufs.TokenOutput, error, ) { + if currentFrameNumber < PROOF_FRAME_CUTOFF { + return nil, errors.Wrap(ErrInvalidStateTransition, "handle join") + } + payload := []byte("join") if t == nil || t.PublicKeySignatureEd448 == nil { diff --git a/node/execution/intrinsics/token/application/token_handle_prover_join_test.go b/node/execution/intrinsics/token/application/token_handle_prover_join_test.go index 2d0b2ab..4306b3e 100644 --- a/node/execution/intrinsics/token/application/token_handle_prover_join_test.go +++ b/node/execution/intrinsics/token/application/token_handle_prover_join_test.go @@ -176,12 +176,13 @@ func TestHandleProverJoin(t *testing.T) { fmt.Printf("%x\n", individualChallenge) out2, _ := wprover.CalculateChallengeProof(individualChallenge, 10000) - proofTree, payload, output := tries.PackOutputIntoPayloadAndProof( + proofTree, payload, output, err := tries.PackOutputIntoPayloadAndProof( []merkletree.DataBlock{tries.NewProofLeaf(out1), tries.NewProofLeaf(out2)}, 2, frame2, nil, ) + assert.NoError(t, err) sig, _ = privKey.Sign(payload) app, success, _, err = app.ApplyTransitions(2, &protobufs.TokenRequests{ @@ -240,12 +241,13 @@ func TestHandleProverJoin(t *testing.T) { app.ClockStore.CommitDataClockFrame(frame3.Filter, 3, selbi.FillBytes(make([]byte, 32)), app.Tries, txn, false) txn.Commit() - proofTree, payload, output = tries.PackOutputIntoPayloadAndProof( + proofTree, payload, output, err = tries.PackOutputIntoPayloadAndProof( []merkletree.DataBlock{tries.NewProofLeaf(out1), tries.NewProofLeaf(out2)}, 2, frame3, proofTree, ) + assert.NoError(t, err) sig, _ = privKey.Sign(payload) app, success, _, err = app.ApplyTransitions(3, &protobufs.TokenRequests{ diff --git a/node/execution/intrinsics/token/application/token_handle_prover_leave.go b/node/execution/intrinsics/token/application/token_handle_prover_leave.go index c49f0ce..f39afe6 100644 --- a/node/execution/intrinsics/token/application/token_handle_prover_leave.go +++ b/node/execution/intrinsics/token/application/token_handle_prover_leave.go @@ -15,6 +15,10 @@ func (a *TokenApplication) handleDataAnnounceProverLeave( []*protobufs.TokenOutput, error, ) { + if currentFrameNumber < PROOF_FRAME_CUTOFF { + return nil, errors.Wrap(ErrInvalidStateTransition, "handle leave") + } + payload := []byte("leave") if t == nil || t.PublicKeySignatureEd448 == nil { diff --git a/node/execution/intrinsics/token/application/token_handle_prover_pause.go b/node/execution/intrinsics/token/application/token_handle_prover_pause.go index b504cc6..859fd14 100644 --- a/node/execution/intrinsics/token/application/token_handle_prover_pause.go +++ b/node/execution/intrinsics/token/application/token_handle_prover_pause.go @@ -15,6 +15,10 @@ func (a *TokenApplication) handleDataAnnounceProverPause( []*protobufs.TokenOutput, error, ) { + if currentFrameNumber < PROOF_FRAME_CUTOFF { + return nil, errors.Wrap(ErrInvalidStateTransition, "handle pause") + } + payload := []byte("pause") if t == nil || t.PublicKeySignatureEd448 == nil { diff --git a/node/execution/intrinsics/token/application/token_handle_prover_resume.go b/node/execution/intrinsics/token/application/token_handle_prover_resume.go index af070a0..0b7003c 100644 --- a/node/execution/intrinsics/token/application/token_handle_prover_resume.go +++ b/node/execution/intrinsics/token/application/token_handle_prover_resume.go @@ -15,6 +15,10 @@ func (a *TokenApplication) handleDataAnnounceProverResume( []*protobufs.TokenOutput, error, ) { + if currentFrameNumber < PROOF_FRAME_CUTOFF { + return nil, errors.Wrap(ErrInvalidStateTransition, "handle resume") + } + payload := []byte("resume") if t == nil || t.PublicKeySignatureEd448 == nil { diff --git a/node/execution/intrinsics/token/token_execution_engine.go b/node/execution/intrinsics/token/token_execution_engine.go index 9a2f7c4..51be47d 100644 --- a/node/execution/intrinsics/token/token_execution_engine.go +++ b/node/execution/intrinsics/token/token_execution_engine.go @@ -7,6 +7,7 @@ import ( "encoding/hex" "math/big" "slices" + "strconv" "strings" "sync" gotime "time" @@ -32,17 +33,24 @@ import ( "source.quilibrium.com/quilibrium/monorepo/node/tries" ) -type peerSeniorityItem struct { +type PeerSeniorityItem struct { seniority uint64 addr string } -type peerSeniority map[string]peerSeniorityItem +func NewPeerSeniorityItem(seniority uint64, addr string) PeerSeniorityItem { + return PeerSeniorityItem{ + seniority: seniority, + addr: addr, + } +} -func newFromMap(m map[string]uint64) *peerSeniority { - s := &peerSeniority{} +type PeerSeniority map[string]PeerSeniorityItem + +func newFromMap(m map[string]uint64) *PeerSeniority { + s := &PeerSeniority{} for k, v := range m { - (*s)[k] = peerSeniorityItem{ + (*s)[k] = PeerSeniorityItem{ seniority: v, addr: k, } @@ -50,7 +58,7 @@ func newFromMap(m map[string]uint64) *peerSeniority { return s } -func toSerializedMap(m *peerSeniority) map[string]uint64 { +func toSerializedMap(m *PeerSeniority) map[string]uint64 { s := map[string]uint64{} for k, v := range *m { s[k] = v.seniority @@ -58,7 +66,7 @@ func toSerializedMap(m *peerSeniority) map[string]uint64 { return s } -func (p peerSeniorityItem) Priority() *big.Int { +func (p PeerSeniorityItem) Priority() *big.Int { return big.NewInt(int64(p.seniority)) } @@ -82,7 +90,7 @@ type TokenExecutionEngine struct { alreadyPublishedShare bool intrinsicFilter []byte frameProver qcrypto.FrameProver - peerSeniority *peerSeniority + peerSeniority *PeerSeniority } func NewTokenExecutionEngine( @@ -116,7 +124,6 @@ func NewTokenExecutionEngine( var inclusionProof *qcrypto.InclusionAggregateProof var proverKeys [][]byte var peerSeniority map[string]uint64 - genesisCreated := false if err != nil && errors.Is(err, store.ErrNotFound) { origin, inclusionProof, proverKeys, peerSeniority = CreateGenesisState( @@ -133,7 +140,6 @@ func NewTokenExecutionEngine( ); err != nil { panic(err) } - genesisCreated = true } else if err != nil { panic(err) } else { @@ -155,7 +161,6 @@ func NewTokenExecutionEngine( coinStore, uint(cfg.P2P.Network), ) - genesisCreated = true } } @@ -165,8 +170,29 @@ func NewTokenExecutionEngine( panic(err) } if peerSeniority == nil { - RebuildPeerSeniority(clockStore) + peerSeniority, err = RebuildPeerSeniority(uint(cfg.P2P.Network)) + if err != nil { + panic(err) + } + + txn, err := clockStore.NewTransaction() + if err != nil { + panic(err) + } + + err = clockStore.PutPeerSeniorityMap(txn, intrinsicFilter, peerSeniority) + if err != nil { + txn.Abort() + panic(err) + } + + if err = txn.Commit(); err != nil { + txn.Abort() + panic(err) + } } + } else { + LoadAggregatedSeniorityMap() } e := &TokenExecutionEngine{ @@ -251,126 +277,26 @@ func NewTokenExecutionEngine( e.proverPublicKey = publicKeyBytes e.provingKeyAddress = provingKeyAddress - if genesisCreated { - go func() { - keys := [][]byte{} - ksigs := [][]byte{} - if len(e.engineConfig.MultisigProverEnrollmentPaths) != 0 { - for _, conf := range e.engineConfig.MultisigProverEnrollmentPaths { - extraConf, err := config.LoadConfig(conf, "", false) - if err != nil { - panic(err) - } - - peerPrivKey, err := hex.DecodeString(extraConf.P2P.PeerPrivKey) - if err != nil { - panic(errors.Wrap(err, "error unmarshaling peerkey")) - } - - privKey, err := pcrypto.UnmarshalEd448PrivateKey(peerPrivKey) - if err != nil { - panic(errors.Wrap(err, "error unmarshaling peerkey")) - } - - pub := privKey.GetPublic() - pubBytes, err := pub.Raw() - if err != nil { - panic(errors.Wrap(err, "error unmarshaling peerkey")) - } - - keys = append(keys, pubBytes) - sig, err := privKey.Sign(e.pubSub.GetPublicKey()) - if err != nil { - panic(errors.Wrap(err, "error unmarshaling peerkey")) - } - ksigs = append(ksigs, sig) - } - } - - keyjoin := []byte{} - for _, k := range keys { - keyjoin = append(keyjoin, k...) - } - - mainsig, err := e.pubSub.SignMessage(keyjoin) - if err != nil { - panic(err) - } - - announce := &protobufs.TokenRequest_Announce{ - Announce: &protobufs.AnnounceProverRequest{ - PublicKeySignaturesEd448: []*protobufs.Ed448Signature{}, - }, - } - - announce.Announce.PublicKeySignaturesEd448 = append( - announce.Announce.PublicKeySignaturesEd448, - &protobufs.Ed448Signature{ - PublicKey: &protobufs.Ed448PublicKey{ - KeyValue: e.pubSub.GetPublicKey(), - }, - Signature: mainsig, - }, - ) - - for i := range keys { - announce.Announce.PublicKeySignaturesEd448 = append( - announce.Announce.PublicKeySignaturesEd448, - &protobufs.Ed448Signature{ - PublicKey: &protobufs.Ed448PublicKey{ - KeyValue: keys[i], - }, - Signature: ksigs[i], - }, - ) - } - - req := &protobufs.TokenRequest{ - Request: announce, - } - - // need to wait for peering - gotime.Sleep(30 * gotime.Second) - e.publishMessage(append([]byte{0x00}, intrinsicFilter...), req) - }() - } else { + go func() { f, tries, err := e.clockStore.GetLatestDataClockFrame(e.intrinsicFilter) - fn, err := coinStore.GetLatestFrameProcessed() if err != nil { - panic(err) + return } - if f.FrameNumber != fn && fn == 0 { - txn, err := coinStore.NewTransaction() + shouldResume := false + for _, trie := range tries[1:] { + altAddr, err := poseidon.HashBytes(e.pubSub.GetPeerID()) if err != nil { - panic(err) + break } - err = coinStore.SetLatestFrameProcessed(txn, f.FrameNumber) - if err != nil { - txn.Abort() - panic(err) - } - - if err = txn.Commit(); err != nil { - panic(err) - } - } else if f.FrameNumber-fn == 1 && f.FrameNumber > fn { - txn, err := coinStore.NewTransaction() - if err != nil { - panic(err) - } - e.logger.Info( - "replaying last data frame", - zap.Uint64("frame_number", f.FrameNumber), - ) - e.ProcessFrame(txn, f, tries) - if err = txn.Commit(); err != nil { - panic(err) + if trie.Contains(altAddr.FillBytes(make([]byte, 32))) { + shouldResume = true + break } } - if err == nil { + if shouldResume { msg := []byte("resume") msg = binary.BigEndian.AppendUint64(msg, f.FrameNumber) msg = append(msg, e.intrinsicFilter...) @@ -380,7 +306,17 @@ func NewTokenExecutionEngine( } // need to wait for peering - gotime.Sleep(30 * gotime.Second) + for { + gotime.Sleep(30 * gotime.Second) + peerMap := e.pubSub.GetBitmaskPeers() + if peers, ok := peerMap[string( + append([]byte{0x00}, e.intrinsicFilter...), + )]; ok { + if len(peers) >= 3 { + break + } + } + } e.publishMessage( append([]byte{0x00}, e.intrinsicFilter...), &protobufs.TokenRequest{ @@ -399,7 +335,7 @@ func NewTokenExecutionEngine( }, ) } - } + }() return e } @@ -591,17 +527,23 @@ func (e *TokenExecutionEngine) ProcessFrame( txn.Abort() return nil, errors.Wrap(err, "process frame") } - // testnet: if len(o.Proof.Amount) == 32 && - !bytes.Equal(o.Proof.Amount, make([]byte, 32)) { + !bytes.Equal(o.Proof.Amount, make([]byte, 32)) && + o.Proof.Commitment != nil { addr := string(o.Proof.Owner.GetImplicitAccount().Address) + for _, t := range app.Tries { + if t.Contains([]byte(addr)) { + t.Add([]byte(addr), frame.FrameNumber) + break + } + } if _, ok := (*e.peerSeniority)[addr]; !ok { - (*e.peerSeniority)[addr] = peerSeniorityItem{ + (*e.peerSeniority)[addr] = PeerSeniorityItem{ seniority: 10, addr: addr, } } else { - (*e.peerSeniority)[addr] = peerSeniorityItem{ + (*e.peerSeniority)[addr] = PeerSeniorityItem{ seniority: (*e.peerSeniority)[addr].seniority + 10, addr: addr, } @@ -622,6 +564,96 @@ func (e *TokenExecutionEngine) ProcessFrame( txn.Abort() return nil, errors.Wrap(err, "process frame") } + case *protobufs.TokenOutput_Announce: + peerIds := []string{} + for _, sig := range o.Announce.PublicKeySignaturesEd448 { + peerId, err := e.getPeerIdFromSignature(sig) + if err != nil { + txn.Abort() + return nil, errors.Wrap(err, "process frame") + } + + peerIds = append(peerIds, peerId.String()) + } + + mergeable := true + for i, peerId := range peerIds { + addr, err := e.getAddressFromSignature( + o.Announce.PublicKeySignaturesEd448[i], + ) + if err != nil { + txn.Abort() + return nil, errors.Wrap(err, "process frame") + } + + sen, ok := (*e.peerSeniority)[string(addr)] + if !ok { + e.logger.Debug( + "peer announced with no seniority", + zap.String("peer_id", peerId), + ) + continue + } + + peer := new(big.Int).SetUint64(sen.seniority) + if peer.Cmp(e.GetAggregatedSeniority([]string{peerId})) != 0 { + e.logger.Debug( + "peer announced but is already different seniority", + zap.String("peer_id", peerIds[0]), + ) + mergeable = false + break + } + } + + if mergeable { + addr, err := e.getAddressFromSignature( + o.Announce.PublicKeySignaturesEd448[0], + ) + if err != nil { + txn.Abort() + return nil, errors.Wrap(err, "process frame") + } + + additional := uint64(0) + _, prfs, err := e.coinStore.GetPreCoinProofsForOwner(addr) + if err != nil && !errors.Is(err, store.ErrNotFound) { + txn.Abort() + return nil, errors.Wrap(err, "process frame") + } + + for _, pr := range prfs { + if pr.IndexProof == nil && pr.Difficulty == 0 && pr.Commitment == nil { + // approximate average per interval: + add := new(big.Int).SetBytes(pr.Amount) + add.Quo(add, big.NewInt(58800000)) + if add.Cmp(big.NewInt(4000000)) > 0 { + add = big.NewInt(4000000) + } + additional = add.Uint64() + } + } + + (*e.peerSeniority)[string(addr)] = PeerSeniorityItem{ + seniority: e.GetAggregatedSeniority(peerIds).Uint64() + additional, + addr: string(addr), + } + + for _, sig := range o.Announce.PublicKeySignaturesEd448[1:] { + addr, err := e.getAddressFromSignature( + sig, + ) + if err != nil { + txn.Abort() + return nil, errors.Wrap(err, "process frame") + } + + (*e.peerSeniority)[string(addr)] = PeerSeniorityItem{ + seniority: 0, + addr: string(addr), + } + } + } case *protobufs.TokenOutput_Join: addr, err := e.getAddressFromSignature(o.Join.PublicKeySignatureEd448) if err != nil { @@ -629,12 +661,12 @@ func (e *TokenExecutionEngine) ProcessFrame( return nil, errors.Wrap(err, "process frame") } if _, ok := (*e.peerSeniority)[string(addr)]; !ok { - (*e.peerSeniority)[string(addr)] = peerSeniorityItem{ + (*e.peerSeniority)[string(addr)] = PeerSeniorityItem{ seniority: 20, addr: string(addr), } } else { - (*e.peerSeniority)[string(addr)] = peerSeniorityItem{ + (*e.peerSeniority)[string(addr)] = PeerSeniorityItem{ seniority: (*e.peerSeniority)[string(addr)].seniority + 20, addr: string(addr), } @@ -662,19 +694,28 @@ func (e *TokenExecutionEngine) ProcessFrame( case *protobufs.TokenOutput_Penalty: addr := string(o.Penalty.Account.GetImplicitAccount().Address) if _, ok := (*e.peerSeniority)[addr]; !ok { - (*e.peerSeniority)[addr] = peerSeniorityItem{ + (*e.peerSeniority)[addr] = PeerSeniorityItem{ seniority: 0, addr: addr, } proverTrieLeaveRequests = append(proverTrieLeaveRequests, []byte(addr)) } else { if (*e.peerSeniority)[addr].seniority > o.Penalty.Quantity { - (*e.peerSeniority)[addr] = peerSeniorityItem{ + for _, t := range app.Tries { + if t.Contains([]byte(addr)) { + _, latest, _ := t.Get([]byte(addr)) + if frame.FrameNumber-latest > 100 { + proverTrieLeaveRequests = append(proverTrieLeaveRequests, []byte(addr)) + } + break + } + } + (*e.peerSeniority)[addr] = PeerSeniorityItem{ seniority: (*e.peerSeniority)[addr].seniority - o.Penalty.Quantity, addr: addr, } } else { - (*e.peerSeniority)[addr] = peerSeniorityItem{ + (*e.peerSeniority)[addr] = PeerSeniorityItem{ seniority: 0, addr: addr, } @@ -684,11 +725,11 @@ func (e *TokenExecutionEngine) ProcessFrame( } } - joinAddrs := tries.NewMinHeap[peerSeniorityItem]() - leaveAddrs := tries.NewMinHeap[peerSeniorityItem]() + joinAddrs := tries.NewMinHeap[PeerSeniorityItem]() + leaveAddrs := tries.NewMinHeap[PeerSeniorityItem]() for _, addr := range proverTrieJoinRequests { if _, ok := (*e.peerSeniority)[string(addr)]; !ok { - joinAddrs.Push(peerSeniorityItem{ + joinAddrs.Push(PeerSeniorityItem{ addr: string(addr), seniority: 0, }) @@ -698,7 +739,7 @@ func (e *TokenExecutionEngine) ProcessFrame( } for _, addr := range proverTrieLeaveRequests { if _, ok := (*e.peerSeniority)[string(addr)]; !ok { - leaveAddrs.Push(peerSeniorityItem{ + leaveAddrs.Push(PeerSeniorityItem{ addr: string(addr), seniority: 0, }) @@ -707,36 +748,14 @@ func (e *TokenExecutionEngine) ProcessFrame( } } - joinReqs := make([]peerSeniorityItem, len(joinAddrs.All())) + joinReqs := make([]PeerSeniorityItem, len(joinAddrs.All())) copy(joinReqs, joinAddrs.All()) slices.Reverse(joinReqs) - leaveReqs := make([]peerSeniorityItem, len(leaveAddrs.All())) + leaveReqs := make([]PeerSeniorityItem, len(leaveAddrs.All())) copy(leaveReqs, leaveAddrs.All()) slices.Reverse(leaveReqs) - for _, addr := range joinReqs { - rings := len(app.Tries) - last := app.Tries[rings-1] - set := last.FindNearestAndApproximateNeighbors(make([]byte, 32)) - if len(set) == 1024 || rings == 1 { - app.Tries = append( - app.Tries, - &tries.RollingFrecencyCritbitTrie{}, - ) - last = app.Tries[rings] - } - if !last.Contains([]byte(addr.addr)) { - last.Add([]byte(addr.addr), frame.FrameNumber) - } - } - for _, addr := range leaveReqs { - for _, t := range app.Tries { - if t.Contains([]byte(addr.addr)) { - t.Remove([]byte(addr.addr)) - break - } - } - } + ProcessJoinsAndLeaves(joinReqs, leaveReqs, app, e.peerSeniority, frame) err = e.clockStore.PutPeerSeniorityMap( txn, @@ -757,6 +776,57 @@ func (e *TokenExecutionEngine) ProcessFrame( return app.Tries, nil } +func ProcessJoinsAndLeaves( + joinReqs []PeerSeniorityItem, + leaveReqs []PeerSeniorityItem, + app *application.TokenApplication, + seniority *PeerSeniority, + frame *protobufs.ClockFrame, +) { + for _, addr := range joinReqs { + rings := len(app.Tries) + last := app.Tries[rings-1] + set := last.FindNearestAndApproximateNeighbors(make([]byte, 32)) + if len(set) == 2048 || rings == 1 { + app.Tries = append( + app.Tries, + &tries.RollingFrecencyCritbitTrie{}, + ) + last = app.Tries[rings] + } + if !last.Contains([]byte(addr.addr)) { + last.Add([]byte(addr.addr), frame.FrameNumber) + } + } + for _, addr := range leaveReqs { + for _, t := range app.Tries[1:] { + if t.Contains([]byte(addr.addr)) { + t.Remove([]byte(addr.addr)) + break + } + } + } + + if len(app.Tries) > 2 { + for i, t := range app.Tries[2:] { + setSize := len(app.Tries[1+i].FindNearestAndApproximateNeighbors(make([]byte, 32))) + if setSize < 2048 { + nextSet := t.FindNearestAndApproximateNeighbors(make([]byte, 32)) + eligibilityOrder := tries.NewMinHeap[PeerSeniorityItem]() + for _, n := range nextSet { + eligibilityOrder.Push((*seniority)[string(n.External.Key)]) + } + process := eligibilityOrder.All() + slices.Reverse(process) + for s := 0; s+setSize < 2048; s++ { + app.Tries[1+i].Add([]byte(process[s].addr), frame.FrameNumber) + app.Tries[2+i].Remove([]byte(process[s].addr)) + } + } + } + } +} + func (e *TokenExecutionEngine) publishMessage( filter []byte, message proto.Message, @@ -913,6 +983,235 @@ func (e *TokenExecutionEngine) GetSeniority() *big.Int { return sen.Priority() } +func (e *TokenExecutionEngine) GetAggregatedSeniority(peerIds []string) *big.Int { + highestFirst := uint64(0) + highestSecond := uint64(0) + highestThird := uint64(0) + highestFourth := uint64(0) + + for _, f := range firstRetro { + found := false + for _, p := range peerIds { + if p != f.PeerId { + continue + } + found = true + } + if !found { + continue + } + // these don't have decimals so we can shortcut + max := 157208 + actual, err := strconv.Atoi(f.Reward) + if err != nil { + panic(err) + } + + s := uint64(10 * 6 * 60 * 24 * 92 / (max / actual)) + if s > uint64(highestFirst) { + highestFirst = s + } + } + + for _, f := range secondRetro { + found := false + for _, p := range peerIds { + if p != f.PeerId { + continue + } + found = true + } + if !found { + continue + } + + amt := uint64(0) + if f.JanPresence { + amt += (10 * 6 * 60 * 24 * 31) + } + + if f.FebPresence { + amt += (10 * 6 * 60 * 24 * 29) + } + + if f.MarPresence { + amt += (10 * 6 * 60 * 24 * 31) + } + + if f.AprPresence { + amt += (10 * 6 * 60 * 24 * 30) + } + + if f.MayPresence { + amt += (10 * 6 * 60 * 24 * 31) + } + + if amt > uint64(highestSecond) { + highestSecond = amt + } + } + + for _, f := range thirdRetro { + found := false + for _, p := range peerIds { + if p != f.PeerId { + continue + } + found = true + } + if !found { + continue + } + + s := uint64(10 * 6 * 60 * 24 * 30) + if s > uint64(highestThird) { + highestThird = s + } + } + + for _, f := range fourthRetro { + found := false + for _, p := range peerIds { + if p != f.PeerId { + continue + } + found = true + } + if !found { + continue + } + + s := uint64(10 * 6 * 60 * 24 * 31) + if s > uint64(highestFourth) { + highestFourth = s + } + } + return new(big.Int).SetUint64( + highestFirst + highestSecond + highestThird + highestFourth, + ) +} + +func (e *TokenExecutionEngine) AnnounceProverMerge() { + currentHead := e.GetFrame() + if currentHead == nil || + currentHead.FrameNumber < application.PROOF_FRAME_CUTOFF { + return + } + keys := [][]byte{} + ksigs := [][]byte{} + if len(e.engineConfig.MultisigProverEnrollmentPaths) != 0 && + e.GetSeniority().Cmp(e.GetAggregatedSeniority( + []string{peer.ID(e.pubSub.GetPeerID()).String()}, + )) == 0 { + for _, conf := range e.engineConfig.MultisigProverEnrollmentPaths { + extraConf, err := config.LoadConfig(conf, "", false) + if err != nil { + panic(err) + } + + peerPrivKey, err := hex.DecodeString(extraConf.P2P.PeerPrivKey) + if err != nil { + panic(errors.Wrap(err, "error unmarshaling peerkey")) + } + + privKey, err := pcrypto.UnmarshalEd448PrivateKey(peerPrivKey) + if err != nil { + panic(errors.Wrap(err, "error unmarshaling peerkey")) + } + + pub := privKey.GetPublic() + pubBytes, err := pub.Raw() + if err != nil { + panic(errors.Wrap(err, "error unmarshaling peerkey")) + } + + keys = append(keys, pubBytes) + sig, err := privKey.Sign(e.pubSub.GetPublicKey()) + if err != nil { + panic(errors.Wrap(err, "error unmarshaling peerkey")) + } + ksigs = append(ksigs, sig) + } + } + + keyjoin := []byte{} + for _, k := range keys { + keyjoin = append(keyjoin, k...) + } + + mainsig, err := e.pubSub.SignMessage(keyjoin) + if err != nil { + panic(err) + } + + announce := &protobufs.TokenRequest_Announce{ + Announce: &protobufs.AnnounceProverRequest{ + PublicKeySignaturesEd448: []*protobufs.Ed448Signature{}, + }, + } + + announce.Announce.PublicKeySignaturesEd448 = append( + announce.Announce.PublicKeySignaturesEd448, + &protobufs.Ed448Signature{ + PublicKey: &protobufs.Ed448PublicKey{ + KeyValue: e.pubSub.GetPublicKey(), + }, + Signature: mainsig, + }, + ) + + for i := range keys { + announce.Announce.PublicKeySignaturesEd448 = append( + announce.Announce.PublicKeySignaturesEd448, + &protobufs.Ed448Signature{ + PublicKey: &protobufs.Ed448PublicKey{ + KeyValue: keys[i], + }, + Signature: ksigs[i], + }, + ) + } + + req := &protobufs.TokenRequest{ + Request: announce, + } + + e.publishMessage(append([]byte{0x00}, e.intrinsicFilter...), req) +} + +func (e *TokenExecutionEngine) AnnounceProverJoin() { + msg := []byte("join") + head := e.GetFrame() + if head == nil || + head.FrameNumber < application.PROOF_FRAME_CUTOFF { + return + } + msg = binary.BigEndian.AppendUint64(msg, head.FrameNumber) + msg = append(msg, bytes.Repeat([]byte{0xff}, 32)...) + sig, err := e.pubSub.SignMessage(msg) + if err != nil { + panic(err) + } + + e.publishMessage( + append([]byte{0x00}, e.intrinsicFilter...), + &protobufs.TokenRequest{ + Request: &protobufs.TokenRequest_Join{ + Join: &protobufs.AnnounceProverJoin{ + Filter: bytes.Repeat([]byte{0xff}, 32), + FrameNumber: head.FrameNumber, + PublicKeySignatureEd448: &protobufs.Ed448Signature{ + Signature: sig, + PublicKey: &protobufs.Ed448PublicKey{ + KeyValue: e.pubSub.GetPublicKey(), + }, + }, + }, + }, + }, + ) +} + func (e *TokenExecutionEngine) GetRingPosition() int { altAddr, err := poseidon.HashBytes(e.pubSub.GetPeerID()) if err != nil { @@ -933,6 +1232,28 @@ func (e *TokenExecutionEngine) GetRingPosition() int { return -1 } +func (e *TokenExecutionEngine) getPeerIdFromSignature( + sig *protobufs.Ed448Signature, +) (peer.ID, error) { + if sig.PublicKey == nil || sig.PublicKey.KeyValue == nil { + return "", errors.New("invalid data") + } + + pk, err := pcrypto.UnmarshalEd448PublicKey( + sig.PublicKey.KeyValue, + ) + if err != nil { + return "", errors.Wrap(err, "get address from signature") + } + + peerId, err := peer.IDFromPublicKey(pk) + if err != nil { + return "", errors.Wrap(err, "get address from signature") + } + + return peerId, nil +} + func (e *TokenExecutionEngine) getAddressFromSignature( sig *protobufs.Ed448Signature, ) ([]byte, error) { diff --git a/node/execution/intrinsics/token/token_execution_engine_test.go b/node/execution/intrinsics/token/token_execution_engine_test.go new file mode 100644 index 0000000..68fcfdf --- /dev/null +++ b/node/execution/intrinsics/token/token_execution_engine_test.go @@ -0,0 +1,52 @@ +package token_test + +import ( + "crypto/rand" + "testing" + + "github.com/stretchr/testify/assert" + "source.quilibrium.com/quilibrium/monorepo/node/execution/intrinsics/token" + "source.quilibrium.com/quilibrium/monorepo/node/execution/intrinsics/token/application" + "source.quilibrium.com/quilibrium/monorepo/node/protobufs" + "source.quilibrium.com/quilibrium/monorepo/node/tries" +) + +func TestProcessJoinsAndLeaves(t *testing.T) { + set := [][]byte{} + for i := 0; i < 6000; i++ { + b := make([]byte, 32) + rand.Read(b) + set = append(set, b) + } + + joins := []token.PeerSeniorityItem{} + seniority := &token.PeerSeniority{} + for i, s := range set { + joins = append(joins, token.NewPeerSeniorityItem(uint64(i), string(s))) + (*seniority)[string(s)] = token.NewPeerSeniorityItem(uint64(i), string(s)) + } + tr := []*tries.RollingFrecencyCritbitTrie{ + &tries.RollingFrecencyCritbitTrie{}, + &tries.RollingFrecencyCritbitTrie{}, + } + app := &application.TokenApplication{ + Tries: tr, + } + token.ProcessJoinsAndLeaves(joins, []token.PeerSeniorityItem{}, app, seniority, &protobufs.ClockFrame{FrameNumber: 20}) + + assert.Equal(t, len(app.Tries), 4) + assert.Equal(t, len(app.Tries[1].FindNearestAndApproximateNeighbors(make([]byte, 32))), 2048) + assert.Equal(t, len(app.Tries[2].FindNearestAndApproximateNeighbors(make([]byte, 32))), 2048) + assert.Equal(t, len(app.Tries[3].FindNearestAndApproximateNeighbors(make([]byte, 32))), 1904) + + leaves := []token.PeerSeniorityItem{} + leaves = append(leaves, joins[30]) + leaves = append(leaves, joins[2047]) + leaves = append(leaves, joins[4095]) + token.ProcessJoinsAndLeaves([]token.PeerSeniorityItem{}, leaves, app, seniority, &protobufs.ClockFrame{FrameNumber: 20}) + + assert.Equal(t, len(app.Tries), 4) + assert.Equal(t, len(app.Tries[1].FindNearestAndApproximateNeighbors(make([]byte, 32))), 2048) + assert.Equal(t, len(app.Tries[2].FindNearestAndApproximateNeighbors(make([]byte, 32))), 2048) + assert.Equal(t, len(app.Tries[3].FindNearestAndApproximateNeighbors(make([]byte, 32))), 1901) +} diff --git a/node/execution/intrinsics/token/token_genesis.go b/node/execution/intrinsics/token/token_genesis.go index d415678..5c2279d 100644 --- a/node/execution/intrinsics/token/token_genesis.go +++ b/node/execution/intrinsics/token/token_genesis.go @@ -75,25 +75,140 @@ var thirdRetroJsonBinary []byte //go:embed fourth_retro.json var fourthRetroJsonBinary []byte -func RebuildPeerSeniority(clockStore store.ClockStore) { - // testnet: - txn, err := clockStore.NewTransaction() +var firstRetro []*FirstRetroJson +var secondRetro []*SecondRetroJson +var thirdRetro []*ThirdRetroJson +var fourthRetro []*FourthRetroJson + +func LoadAggregatedSeniorityMap() { + firstRetro = []*FirstRetroJson{} + secondRetro = []*SecondRetroJson{} + thirdRetro = []*ThirdRetroJson{} + fourthRetro = []*FourthRetroJson{} + + err := json.Unmarshal(firstRetroJsonBinary, &firstRetro) if err != nil { panic(err) } - err = clockStore.PutPeerSeniorityMap( - txn, - p2p.GetBloomFilter(application.TOKEN_ADDRESS, 256, 3), - map[string]uint64{}, - ) + err = json.Unmarshal(secondRetroJsonBinary, &secondRetro) if err != nil { panic(err) } - if err = txn.Commit(); err != nil { + err = json.Unmarshal(thirdRetroJsonBinary, &thirdRetro) + if err != nil { panic(err) } + + err = json.Unmarshal(fourthRetroJsonBinary, &fourthRetro) + if err != nil { + panic(err) + } +} + +func RebuildPeerSeniority(network uint) (map[string]uint64, error) { + if network != 0 { + return map[string]uint64{}, nil + } + + firstRetro = []*FirstRetroJson{} + secondRetro = []*SecondRetroJson{} + thirdRetro = []*ThirdRetroJson{} + fourthRetro = []*FourthRetroJson{} + + 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(thirdRetroJsonBinary, &thirdRetro) + if err != nil { + return nil, err + } + + err = json.Unmarshal(fourthRetroJsonBinary, &fourthRetro) + if err != nil { + return nil, err + } + + peerSeniority := map[string]uint64{} + for _, f := range firstRetro { + // these don't have decimals so we can shortcut + max := 157208 + actual, err := strconv.Atoi(f.Reward) + if err != nil { + return nil, err + } + + p := []byte(f.PeerId) + addr, _ := poseidon.HashBytes(p) + + peerSeniority[string( + addr.FillBytes(make([]byte, 32)), + )] = uint64(10 * 6 * 60 * 24 * 92 / (max / actual)) + } + + for _, f := range secondRetro { + p := []byte(f.PeerId) + addr, _ := poseidon.HashBytes(p) + addrBytes := string(addr.FillBytes(make([]byte, 32))) + + if _, ok := peerSeniority[addrBytes]; !ok { + peerSeniority[addrBytes] = 0 + } + + if f.JanPresence { + peerSeniority[addrBytes] = peerSeniority[addrBytes] + (10 * 6 * 60 * 24 * 31) + } + + if f.FebPresence { + peerSeniority[addrBytes] = peerSeniority[addrBytes] + (10 * 6 * 60 * 24 * 29) + } + + if f.MarPresence { + peerSeniority[addrBytes] = peerSeniority[addrBytes] + (10 * 6 * 60 * 24 * 31) + } + + if f.AprPresence { + peerSeniority[addrBytes] = peerSeniority[addrBytes] + (10 * 6 * 60 * 24 * 30) + } + + if f.MayPresence { + peerSeniority[addrBytes] = peerSeniority[addrBytes] + (10 * 6 * 60 * 24 * 31) + } + } + + for _, f := range thirdRetro { + p := []byte(f.PeerId) + addr, _ := poseidon.HashBytes(p) + addrBytes := string(addr.FillBytes(make([]byte, 32))) + + if _, ok := peerSeniority[addrBytes]; !ok { + peerSeniority[addrBytes] = 0 + } + + peerSeniority[addrBytes] = peerSeniority[addrBytes] + (10 * 6 * 60 * 24 * 30) + } + + for _, f := range fourthRetro { + p := []byte(f.PeerId) + addr, _ := poseidon.HashBytes(p) + addrBytes := string(addr.FillBytes(make([]byte, 32))) + + if _, ok := peerSeniority[addrBytes]; !ok { + peerSeniority[addrBytes] = 0 + } + + peerSeniority[addrBytes] = peerSeniority[addrBytes] + (10 * 6 * 60 * 24 * 31) + } + + return peerSeniority, nil } // Creates a genesis state for the intrinsic @@ -147,10 +262,10 @@ func CreateGenesisState( if network == 0 { bridged := []*BridgedPeerJson{} vouchers := []string{} - firstRetro := []*FirstRetroJson{} - secondRetro := []*SecondRetroJson{} - thirdRetro := []*ThirdRetroJson{} - fourthRetro := []*FourthRetroJson{} + firstRetro = []*FirstRetroJson{} + secondRetro = []*SecondRetroJson{} + thirdRetro = []*ThirdRetroJson{} + fourthRetro = []*FourthRetroJson{} err = json.Unmarshal(bridgedPeersJsonBinary, &bridged) if err != nil { @@ -200,6 +315,9 @@ func CreateGenesisState( peerSeniority := map[string]uint64{} logger.Info("encoding first retro state") for _, f := range firstRetro { + p := []byte(f.PeerId) + addr, _ := poseidon.HashBytes(p) + addrBytes := string(addr.FillBytes(make([]byte, 32))) if _, ok := bridgedAddrs[f.PeerId]; !ok { peerIdTotals[f.PeerId], err = decimal.NewFromString(f.Reward) if err != nil { @@ -214,7 +332,7 @@ func CreateGenesisState( panic(err) } - peerSeniority[f.PeerId] = uint64(10 * 6 * 60 * 24 * 92 / (max / actual)) + peerSeniority[addrBytes] = uint64(10 * 6 * 60 * 24 * 92 / (max / actual)) } logger.Info("encoding voucher state") @@ -226,6 +344,10 @@ func CreateGenesisState( logger.Info("encoding second retro state") for _, f := range secondRetro { + p := []byte(f.PeerId) + addr, _ := poseidon.HashBytes(p) + addrBytes := string(addr.FillBytes(make([]byte, 32))) + if _, ok := bridgedAddrs[f.PeerId]; !ok { existing, ok := peerIdTotals[f.PeerId] @@ -241,33 +363,37 @@ func CreateGenesisState( } } - if _, ok := peerSeniority[f.PeerId]; !ok { - peerSeniority[f.PeerId] = 0 + if _, ok := peerSeniority[addrBytes]; !ok { + peerSeniority[addrBytes] = 0 } if f.JanPresence { - peerSeniority[f.PeerId] = peerSeniority[f.PeerId] + (10 * 6 * 60 * 24 * 31) + peerSeniority[addrBytes] = peerSeniority[addrBytes] + (10 * 6 * 60 * 24 * 31) } if f.FebPresence { - peerSeniority[f.PeerId] = peerSeniority[f.PeerId] + (10 * 6 * 60 * 24 * 29) + peerSeniority[addrBytes] = peerSeniority[addrBytes] + (10 * 6 * 60 * 24 * 29) } if f.MarPresence { - peerSeniority[f.PeerId] = peerSeniority[f.PeerId] + (10 * 6 * 60 * 24 * 31) + peerSeniority[addrBytes] = peerSeniority[addrBytes] + (10 * 6 * 60 * 24 * 31) } if f.AprPresence { - peerSeniority[f.PeerId] = peerSeniority[f.PeerId] + (10 * 6 * 60 * 24 * 30) + peerSeniority[addrBytes] = peerSeniority[addrBytes] + (10 * 6 * 60 * 24 * 30) } if f.MayPresence { - peerSeniority[f.PeerId] = peerSeniority[f.PeerId] + (10 * 6 * 60 * 24 * 31) + peerSeniority[addrBytes] = peerSeniority[addrBytes] + (10 * 6 * 60 * 24 * 31) } } logger.Info("encoding third retro state") for _, f := range thirdRetro { + p := []byte(f.PeerId) + addr, _ := poseidon.HashBytes(p) + addrBytes := string(addr.FillBytes(make([]byte, 32))) + existing, ok := peerIdTotals[f.PeerId] amount, err := decimal.NewFromString(f.Reward) @@ -281,15 +407,19 @@ func CreateGenesisState( peerIdTotals[f.PeerId] = existing.Add(amount) } - if _, ok := peerSeniority[f.PeerId]; !ok { - peerSeniority[f.PeerId] = 0 + if _, ok := peerSeniority[addrBytes]; !ok { + peerSeniority[addrBytes] = 0 } - peerSeniority[f.PeerId] = peerSeniority[f.PeerId] + (10 * 6 * 60 * 24 * 30) + peerSeniority[addrBytes] = peerSeniority[addrBytes] + (10 * 6 * 60 * 24 * 30) } logger.Info("encoding fourth retro state") for _, f := range fourthRetro { + p := []byte(f.PeerId) + addr, _ := poseidon.HashBytes(p) + addrBytes := string(addr.FillBytes(make([]byte, 32))) + existing, ok := peerIdTotals[f.PeerId] amount, err := decimal.NewFromString(f.Reward) @@ -303,11 +433,11 @@ func CreateGenesisState( peerIdTotals[f.PeerId] = existing.Add(amount) } - if _, ok := peerSeniority[f.PeerId]; !ok { - peerSeniority[f.PeerId] = 0 + if _, ok := peerSeniority[addrBytes]; !ok { + peerSeniority[addrBytes] = 0 } - peerSeniority[f.PeerId] = peerSeniority[f.PeerId] + (10 * 6 * 60 * 24 * 31) + peerSeniority[addrBytes] = peerSeniority[addrBytes] + (10 * 6 * 60 * 24 * 31) } genesisState := &protobufs.TokenOutputs{ diff --git a/node/protobufs/node.go b/node/protobufs/node.go index 1742958..0ece2a6 100644 --- a/node/protobufs/node.go +++ b/node/protobufs/node.go @@ -1,6 +1,14 @@ package protobufs -import "math/big" +import ( + "encoding/binary" + "math/big" + + "github.com/iden3/go-iden3-crypto/poseidon" + pcrypto "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/pkg/errors" +) func (t *TokenRequest) Priority() *big.Int { switch p := t.Request.(type) { @@ -11,3 +19,42 @@ func (t *TokenRequest) Priority() *big.Int { } return big.NewInt(0) } + +func (t *MintCoinRequest) RingAndParallelism( + ringCalc func(addr []byte) int, +) (int, uint32, error) { + payload := []byte("mint") + for _, p := range t.Proofs { + payload = append(payload, p...) + } + if err := t.Signature.Verify(payload); err != nil { + return -1, 0, errors.New("invalid") + } + pk, err := pcrypto.UnmarshalEd448PublicKey( + t.Signature.PublicKey.KeyValue, + ) + if err != nil { + return -1, 0, errors.New("invalid") + } + + peerId, err := peer.IDFromPublicKey(pk) + if err != nil { + return -1, 0, errors.New("invalid") + } + + altAddr, err := poseidon.HashBytes([]byte(peerId)) + if err != nil { + return -1, 0, errors.New("invalid") + } + + ring := ringCalc(altAddr.FillBytes(make([]byte, 32))) + if ring == -1 { + return -1, 0, errors.New("invalid") + } + + if t.Proofs != nil && len(t.Proofs) >= 3 && len(t.Proofs[1]) == 4 { + return ring, binary.BigEndian.Uint32(t.Proofs[1]), nil + } + + return -1, 0, errors.New("invalid") +} diff --git a/node/store/coin.go b/node/store/coin.go index 83d785f..a5da8c7 100644 --- a/node/store/coin.go +++ b/node/store/coin.go @@ -23,6 +23,7 @@ type CoinStore interface { ) GetCoinByAddress(txn Transaction, address []byte) (*protobufs.Coin, error) GetPreCoinProofByAddress(address []byte) (*protobufs.PreCoinProof, error) + RangePreCoinProofs() (Iterator, error) PutCoin( txn Transaction, frameNumber uint64, @@ -251,6 +252,18 @@ func (p *PebbleCoinStore) GetPreCoinProofByAddress(address []byte) ( return proof, nil } +func (p *PebbleCoinStore) RangePreCoinProofs() (Iterator, error) { + iter, err := p.db.NewIter( + proofKey(bytes.Repeat([]byte{0x00}, 32)), + proofKey(bytes.Repeat([]byte{0xff}, 32)), + ) + if err != nil { + return nil, errors.Wrap(err, "range pre coin proofs") + } + + return iter, nil +} + func (p *PebbleCoinStore) PutCoin( txn Transaction, frameNumber uint64, diff --git a/node/tries/proof_leaf_test.go b/node/tries/proof_leaf_test.go index 378391b..70af86c 100644 --- a/node/tries/proof_leaf_test.go +++ b/node/tries/proof_leaf_test.go @@ -89,12 +89,13 @@ func TestPackAndVerifyOutput(t *testing.T) { require.NoError(t, err) } - tree, payload, output := tries.PackOutputIntoPayloadAndProof( + tree, payload, output, err := tries.PackOutputIntoPayloadAndProof( outputs, tc.modulo, frame, previousTree, ) + require.NoError(t, err) require.NotNil(t, tree) require.NotEmpty(t, payload) require.NotEmpty(t, output) diff --git a/node/tries/rolling_frecency_critbit_trie.go b/node/tries/rolling_frecency_critbit_trie.go index 20354e3..7049b26 100644 --- a/node/tries/rolling_frecency_critbit_trie.go +++ b/node/tries/rolling_frecency_critbit_trie.go @@ -134,7 +134,7 @@ func (t *RollingFrecencyCritbitTrie) FindNearestAndApproximateNeighbors( var traverse func(p *Node, address []byte) bool traverse = func(p *Node, address []byte) bool { - if len(ret) > 1024 { + if len(ret) > 2048 { return true } From 2b9c5afd54280da87bb3d77d4dbe88c1bd5999e1 Mon Sep 17 00:00:00 2001 From: Cassandra Heart Date: Sun, 10 Nov 2024 21:20:22 -0600 Subject: [PATCH 03/14] fix nil deref --- node/config/version.go | 2 +- node/execution/intrinsics/token/token_execution_engine.go | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/node/config/version.go b/node/config/version.go index 1d8c3c4..8eeb85f 100644 --- a/node/config/version.go +++ b/node/config/version.go @@ -36,7 +36,7 @@ func FormatVersion(version []byte) string { } func GetPatchNumber() byte { - return 0x00 + return 0x01 } func GetRCNumber() byte { diff --git a/node/execution/intrinsics/token/token_execution_engine.go b/node/execution/intrinsics/token/token_execution_engine.go index 51be47d..16e3a9c 100644 --- a/node/execution/intrinsics/token/token_execution_engine.go +++ b/node/execution/intrinsics/token/token_execution_engine.go @@ -164,12 +164,13 @@ func NewTokenExecutionEngine( } } - if peerSeniority == nil { + if len(peerSeniority) == 0 { peerSeniority, err = clockStore.GetPeerSeniorityMap(intrinsicFilter) if err != nil && !errors.Is(err, store.ErrNotFound) { panic(err) } - if peerSeniority == nil { + + if len(peerSeniority) == 0 { peerSeniority, err = RebuildPeerSeniority(uint(cfg.P2P.Network)) if err != nil { panic(err) @@ -977,7 +978,7 @@ func (e *TokenExecutionEngine) GetSeniority() *big.Int { )] if !ok { - return nil + return big.NewInt(0) } return sen.Priority() From 4238b3ff5accee58b0561c40ebd6f128a9bc9326 Mon Sep 17 00:00:00 2001 From: Cassandra Heart Date: Mon, 11 Nov 2024 03:32:14 -0600 Subject: [PATCH 04/14] 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 | 202 +++++++------- node/protobufs/data.proto | 1 + node/tries/proof_leaf.go | 6 + 14 files changed, 495 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 3b4fc48..3d56f35 100644 --- a/node/consensus/data/data_clock_consensus_engine.go +++ b/node/consensus/data/data_clock_consensus_engine.go @@ -120,6 +120,7 @@ type DataClockConsensusEngine struct { infoMessageProcessorCh chan *pb.Message report *protobufs.SelfTestReport clients []protobufs.DataIPCServiceClient + grpcRateLimiter *RateLimiter } var _ consensus.DataConsensusEngine = (*DataClockConsensusEngine)(nil) @@ -204,6 +205,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, @@ -241,6 +250,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") @@ -294,8 +309,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 01594d5..7765e13 100644 --- a/node/protobufs/data.pb.go +++ b/node/protobufs/data.pb.go @@ -662,6 +662,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() { @@ -703,6 +704,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 @@ -1154,109 +1162,111 @@ var file_data_proto_rawDesc = []byte{ 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, 0x0a, 0x13, + 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, 0x28, 0x0b, + 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, 0x69, 0x75, + 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, + 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, } var ( diff --git a/node/protobufs/data.proto b/node/protobufs/data.proto index 0856d5d..9e1c057 100644 --- a/node/protobufs/data.proto +++ b/node/protobufs/data.proto @@ -76,6 +76,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) { From 1d262794cb30aea810856aa12ac4e7dd208feeab Mon Sep 17 00:00:00 2001 From: Cassandra Heart Date: Mon, 11 Nov 2024 03:50:13 -0600 Subject: [PATCH 05/14] nil check --- node/consensus/data/message_handler.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node/consensus/data/message_handler.go b/node/consensus/data/message_handler.go index ed3c4a3..c6dd9a3 100644 --- a/node/consensus/data/message_handler.go +++ b/node/consensus/data/message_handler.go @@ -286,6 +286,9 @@ func (e *DataClockConsensusEngine) handleDataPeerListAnnounce( } p := announce.Peer + if p == nil { + return nil + } head, err := e.dataTimeReel.Head() if err != nil { From 2ce7eb26d42249782ef4c5e4e7e51e303bc7d311 Mon Sep 17 00:00:00 2001 From: Cassandra Heart Date: Mon, 11 Nov 2024 04:39:52 -0600 Subject: [PATCH 06/14] change order of operations, don't commit an empty tree? --- .../data/data_clock_consensus_engine.go | 167 +----------------- node/consensus/data/main_data_loop.go | 158 ++++++++++++++++- .../token/application/token_handle_mint.go | 2 +- .../token/token_execution_engine.go | 1 - 4 files changed, 154 insertions(+), 174 deletions(-) diff --git a/node/consensus/data/data_clock_consensus_engine.go b/node/consensus/data/data_clock_consensus_engine.go index 3d56f35..4d89bd8 100644 --- a/node/consensus/data/data_clock_consensus_engine.go +++ b/node/consensus/data/data_clock_consensus_engine.go @@ -9,7 +9,6 @@ import ( "sync" "time" - "github.com/iden3/go-iden3-crypto/poseidon" "github.com/libp2p/go-libp2p/p2p/discovery/backoff" "github.com/multiformats/go-multiaddr" mn "github.com/multiformats/go-multiaddr/net" @@ -121,6 +120,8 @@ type DataClockConsensusEngine struct { report *protobufs.SelfTestReport clients []protobufs.DataIPCServiceClient grpcRateLimiter *RateLimiter + previousTree *mt.MerkleTree + clientReconnectTest int } var _ consensus.DataConsensusEngine = (*DataClockConsensusEngine)(nil) @@ -490,19 +491,6 @@ func (e *DataClockConsensusEngine) Start() <-chan error { go e.runPreMidnightProofWorker() go func() { - h, err := poseidon.HashBytes(e.pubSub.GetPeerID()) - if err != nil { - panic(err) - } - peerProvingKeyAddress := h.FillBytes(make([]byte, 32)) - - frame, err := e.dataTimeReel.Head() - if err != nil { - panic(err) - } - - // Let it sit until we at least have a few more peers inbound - time.Sleep(30 * time.Second) parallelism := e.report.Cores - 1 if parallelism < 3 { @@ -522,157 +510,6 @@ func (e *DataClockConsensusEngine) Start() <-chan error { panic(err) } } - - var previousTree *mt.MerkleTree - - clientReconnectTest := 0 - - for e.GetState() < consensus.EngineStateStopping { - nextFrame, err := e.dataTimeReel.Head() - if err != nil { - panic(err) - } - - if frame.FrameNumber == nextFrame.FrameNumber { - time.Sleep(1 * time.Second) - continue - } - - frame = nextFrame - - clientReconnectTest++ - if clientReconnectTest >= 10 { - wg := sync.WaitGroup{} - wg.Add(len(e.clients)) - for i, client := range e.clients { - i := i - client := client - go func() { - for j := 3; j >= 0; j-- { - var err error - if client == nil { - if len(e.config.Engine.DataWorkerMultiaddrs) != 0 { - e.logger.Error( - "client failed, reconnecting after 50ms", - zap.Uint32("client", uint32(i)), - ) - time.Sleep(50 * time.Millisecond) - client, err = e.createParallelDataClientsFromListAndIndex(uint32(i)) - if err != nil { - e.logger.Error("failed to reconnect", zap.Error(err)) - } - } else if len(e.config.Engine.DataWorkerMultiaddrs) == 0 { - e.logger.Error( - "client failed, reconnecting after 50ms", - ) - time.Sleep(50 * time.Millisecond) - client, err = - e.createParallelDataClientsFromBaseMultiaddrAndIndex(uint32(i)) - if err != nil { - e.logger.Error("failed to reconnect", zap.Error(err)) - } - } - e.clients[i] = client - continue - } - } - wg.Done() - }() - } - wg.Wait() - clientReconnectTest = 0 - } - - for i, trie := range e.GetFrameProverTries()[1:] { - if trie.Contains(peerProvingKeyAddress) { - outputs := e.PerformTimeProof(frame, frame.Difficulty, i) - if outputs == nil || len(outputs) < 3 { - e.logger.Error("could not successfully build proof, reattempting") - break - } - modulo := len(outputs) - proofTree, payload, output, err := tries.PackOutputIntoPayloadAndProof( - outputs, - modulo, - frame, - previousTree, - ) - if err != nil { - e.logger.Error( - "could not successfully pack proof, reattempting", - zap.Error(err), - ) - break - } - previousTree = proofTree - - sig, err := e.pubSub.SignMessage( - payload, - ) - if err != nil { - panic(err) - } - - e.publishMessage(e.txFilter, &protobufs.TokenRequest{ - Request: &protobufs.TokenRequest_Mint{ - Mint: &protobufs.MintCoinRequest{ - Proofs: output, - Signature: &protobufs.Ed448Signature{ - PublicKey: &protobufs.Ed448PublicKey{ - KeyValue: e.pubSub.GetPublicKey(), - }, - Signature: sig, - }, - }, - }, - }) - - if e.config.Engine.AutoMergeCoins { - _, addrs, _, err := e.coinStore.GetCoinsForOwner( - peerProvingKeyAddress, - ) - if err != nil { - e.logger.Error( - "received error while iterating coins", - zap.Error(err), - ) - break - } - - if len(addrs) > 25 { - message := []byte("merge") - refs := []*protobufs.CoinRef{} - for _, addr := range addrs { - message = append(message, addr...) - refs = append(refs, &protobufs.CoinRef{ - Address: addr, - }) - } - - sig, _ := e.pubSub.SignMessage( - message, - ) - - e.publishMessage(e.txFilter, &protobufs.TokenRequest{ - Request: &protobufs.TokenRequest_Merge{ - Merge: &protobufs.MergeCoinRequest{ - Coins: refs, - Signature: &protobufs.Ed448Signature{ - PublicKey: &protobufs.Ed448PublicKey{ - KeyValue: e.pubSub.GetPublicKey(), - }, - Signature: sig, - }, - }, - }, - }) - } - } - - break - } - } - } }() return errChan diff --git a/node/consensus/data/main_data_loop.go b/node/consensus/data/main_data_loop.go index 9e7d524..853194b 100644 --- a/node/consensus/data/main_data_loop.go +++ b/node/consensus/data/main_data_loop.go @@ -2,8 +2,10 @@ package data import ( "bytes" + "sync" "time" + "github.com/iden3/go-iden3-crypto/poseidon" "go.uber.org/zap" "source.quilibrium.com/quilibrium/monorepo/node/consensus" "source.quilibrium.com/quilibrium/monorepo/node/protobufs" @@ -127,13 +129,155 @@ func (e *DataClockConsensusEngine) processFrame( return nextFrame } else { - if !e.IsInProverTrie(e.pubSub.GetPeerID()) && - dataFrame.Timestamp > time.Now().UnixMilli()-30000 { - e.logger.Info("announcing prover join") - for _, eng := range e.executionEngines { - eng.AnnounceProverMerge() - eng.AnnounceProverJoin() - break + if latestFrame.Timestamp > time.Now().UnixMilli()-30000 { + if !e.IsInProverTrie(e.pubSub.GetPeerID()) { + e.logger.Info("announcing prover join") + for _, eng := range e.executionEngines { + eng.AnnounceProverMerge() + eng.AnnounceProverJoin() + break + } + } else { + h, err := poseidon.HashBytes(e.pubSub.GetPeerID()) + if err != nil { + panic(err) + } + peerProvingKeyAddress := h.FillBytes(make([]byte, 32)) + + ring := -1 + for i, tries := range e.GetFrameProverTries()[1:] { + i := i + if tries.Contains(peerProvingKeyAddress) { + ring = i + } + } + + e.clientReconnectTest++ + if e.clientReconnectTest >= 10 { + wg := sync.WaitGroup{} + wg.Add(len(e.clients)) + for i, client := range e.clients { + i := i + client := client + go func() { + for j := 3; j >= 0; j-- { + var err error + if client == nil { + if len(e.config.Engine.DataWorkerMultiaddrs) != 0 { + e.logger.Error( + "client failed, reconnecting after 50ms", + zap.Uint32("client", uint32(i)), + ) + time.Sleep(50 * time.Millisecond) + client, err = e.createParallelDataClientsFromListAndIndex(uint32(i)) + if err != nil { + e.logger.Error("failed to reconnect", zap.Error(err)) + } + } else if len(e.config.Engine.DataWorkerMultiaddrs) == 0 { + e.logger.Error( + "client failed, reconnecting after 50ms", + ) + time.Sleep(50 * time.Millisecond) + client, err = + e.createParallelDataClientsFromBaseMultiaddrAndIndex(uint32(i)) + if err != nil { + e.logger.Error("failed to reconnect", zap.Error(err)) + } + } + e.clients[i] = client + continue + } + } + wg.Done() + }() + } + wg.Wait() + e.clientReconnectTest = 0 + } + + outputs := e.PerformTimeProof(latestFrame, latestFrame.Difficulty, ring) + if outputs == nil || len(outputs) < 3 { + e.logger.Error("could not successfully build proof, reattempting") + return latestFrame + } + modulo := len(outputs) + proofTree, payload, output, err := tries.PackOutputIntoPayloadAndProof( + outputs, + modulo, + latestFrame, + e.previousTree, + ) + if err != nil { + e.logger.Error( + "could not successfully pack proof, reattempting", + zap.Error(err), + ) + return latestFrame + } + e.previousTree = proofTree + + sig, err := e.pubSub.SignMessage( + payload, + ) + if err != nil { + panic(err) + } + + e.publishMessage(e.txFilter, &protobufs.TokenRequest{ + Request: &protobufs.TokenRequest_Mint{ + Mint: &protobufs.MintCoinRequest{ + Proofs: output, + Signature: &protobufs.Ed448Signature{ + PublicKey: &protobufs.Ed448PublicKey{ + KeyValue: e.pubSub.GetPublicKey(), + }, + Signature: sig, + }, + }, + }, + }) + + if e.config.Engine.AutoMergeCoins { + _, addrs, _, err := e.coinStore.GetCoinsForOwner( + peerProvingKeyAddress, + ) + if err != nil { + e.logger.Error( + "received error while iterating coins", + zap.Error(err), + ) + return latestFrame + } + + if len(addrs) > 25 { + message := []byte("merge") + refs := []*protobufs.CoinRef{} + for _, addr := range addrs { + message = append(message, addr...) + refs = append(refs, &protobufs.CoinRef{ + Address: addr, + }) + } + + sig, _ := e.pubSub.SignMessage( + message, + ) + + e.publishMessage(e.txFilter, &protobufs.TokenRequest{ + Request: &protobufs.TokenRequest_Merge{ + Merge: &protobufs.MergeCoinRequest{ + Coins: refs, + Signature: &protobufs.Ed448Signature{ + PublicKey: &protobufs.Ed448PublicKey{ + KeyValue: e.pubSub.GetPublicKey(), + }, + Signature: sig, + }, + }, + }, + }) + } + } } } return latestFrame diff --git a/node/execution/intrinsics/token/application/token_handle_mint.go b/node/execution/intrinsics/token/application/token_handle_mint.go index 51abfae..c111043 100644 --- a/node/execution/intrinsics/token/application/token_handle_mint.go +++ b/node/execution/intrinsics/token/application/token_handle_mint.go @@ -19,7 +19,7 @@ import ( ) const PROOF_FRAME_CUTOFF = 1 -const PROOF_FRAME_RING_RESET = 5650 +const PROOF_FRAME_RING_RESET = 5750 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 72ce03d..bbe32d8 100644 --- a/node/execution/intrinsics/token/token_execution_engine.go +++ b/node/execution/intrinsics/token/token_execution_engine.go @@ -786,7 +786,6 @@ func (e *TokenExecutionEngine) ProcessFrame( app.Tries = []*tries.RollingFrecencyCritbitTrie{ app.Tries[0], - &tries.RollingFrecencyCritbitTrie{}, } err = e.clockStore.PutPeerSeniorityMap( From 4e108bff07aa13642ebf6c73734d2c8583e88bd6 Mon Sep 17 00:00:00 2001 From: petricadaipegsp <155911522+petricadaipegsp@users.noreply.github.com> Date: Mon, 11 Nov 2024 18:10:53 +0100 Subject: [PATCH 07/14] Safe peer ID lookup from gostream (#344) --- go-libp2p/p2p/net/gostream/addr.go | 15 ++++++++- .../data/grpc_worker_rate_limiter.go | 7 ++-- node/consensus/data/peer_messaging.go | 10 ++++-- node/internal/grpc/peer_id.go | 33 +++++++++++++++++++ 4 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 node/internal/grpc/peer_id.go diff --git a/go-libp2p/p2p/net/gostream/addr.go b/go-libp2p/p2p/net/gostream/addr.go index 49d844f..2ca2bb7 100644 --- a/go-libp2p/p2p/net/gostream/addr.go +++ b/go-libp2p/p2p/net/gostream/addr.go @@ -1,6 +1,10 @@ package gostream -import "github.com/libp2p/go-libp2p/core/peer" +import ( + "net" + + "github.com/libp2p/go-libp2p/core/peer" +) // addr implements net.Addr and holds a libp2p peer ID. type addr struct{ id peer.ID } @@ -12,3 +16,12 @@ func (a *addr) Network() string { return Network } // String returns the peer ID of this address in string form // (B58-encoded). func (a *addr) String() string { return a.id.String() } + +// PeerIDFromAddr extracts a peer ID from a net.Addr. +func PeerIDFromAddr(a net.Addr) (peer.ID, bool) { + addr, ok := a.(*addr) + if !ok { + return "", false + } + return addr.id, true +} diff --git a/node/consensus/data/grpc_worker_rate_limiter.go b/node/consensus/data/grpc_worker_rate_limiter.go index 05f4786..824de53 100644 --- a/node/consensus/data/grpc_worker_rate_limiter.go +++ b/node/consensus/data/grpc_worker_rate_limiter.go @@ -4,13 +4,14 @@ import ( "sync" "time" + "github.com/libp2p/go-libp2p/core/peer" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) type RateLimiter struct { mu sync.RWMutex - clients map[string]*bucket + clients map[peer.ID]*bucket maxTokens int refillTokens int refillTime time.Duration @@ -31,7 +32,7 @@ func NewRateLimiter( refillDuration time.Duration, ) *RateLimiter { return &RateLimiter{ - clients: make(map[string]*bucket), + clients: make(map[peer.ID]*bucket), maxTokens: maxTokens, refillTokens: refillTokens, refillTime: refillDuration, @@ -41,7 +42,7 @@ func NewRateLimiter( } } -func (rl *RateLimiter) Allow(peerId string) error { +func (rl *RateLimiter) Allow(peerId peer.ID) error { rl.mu.Lock() defer rl.mu.Unlock() diff --git a/node/consensus/data/peer_messaging.go b/node/consensus/data/peer_messaging.go index c27dea6..59d3c3a 100644 --- a/node/consensus/data/peer_messaging.go +++ b/node/consensus/data/peer_messaging.go @@ -15,8 +15,11 @@ import ( "go.uber.org/zap" "golang.org/x/crypto/sha3" "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "source.quilibrium.com/quilibrium/monorepo/node/crypto" "source.quilibrium.com/quilibrium/monorepo/node/execution/intrinsics/token/application" + grpc_internal "source.quilibrium.com/quilibrium/monorepo/node/internal/grpc" "source.quilibrium.com/quilibrium/monorepo/node/p2p" "source.quilibrium.com/quilibrium/monorepo/node/protobufs" "source.quilibrium.com/quilibrium/monorepo/node/store" @@ -28,11 +31,12 @@ 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") + peerID, ok := grpc_internal.PeerIDFromContext(ctx) + if !ok { + return nil, status.Error(codes.Internal, "remote peer ID not found") } - if err := e.grpcRateLimiter.Allow(request.PeerId); err != nil { + if err := e.grpcRateLimiter.Allow(peerID); err != nil { return nil, errors.Wrap(err, "get data frame") } diff --git a/node/internal/grpc/peer_id.go b/node/internal/grpc/peer_id.go new file mode 100644 index 0000000..83c4c88 --- /dev/null +++ b/node/internal/grpc/peer_id.go @@ -0,0 +1,33 @@ +package grpc + +import ( + "context" + + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/p2p/net/gostream" + grpc_peer "google.golang.org/grpc/peer" +) + +type peerIDKeyType struct{} + +var peerIDKey peerIDKeyType + +// PeerIDFromContext returns the peer.ID of the remote peer from the given context. +// It assumes that the context is a gRPC request context, and the connection was established +// by gostream.Listen. +func PeerIDFromContext(ctx context.Context) (peer.ID, bool) { + if peerID, ok := ctx.Value(peerIDKey).(peer.ID); ok { + return peerID, true + } + remotePeer, ok := grpc_peer.FromContext(ctx) + if !ok { + return "", false + } + return gostream.PeerIDFromAddr(remotePeer.Addr) +} + +// NewContextWithPeerID returns a new context with the given peer.ID. +// This method is meant to be used only in unit testing contexts. +func NewContextWithPeerID(ctx context.Context, peerID peer.ID) context.Context { + return context.WithValue(ctx, peerIDKey, peerID) +} From de87f3f81b89ead692a87d41073296c4c705ac0b Mon Sep 17 00:00:00 2001 From: petricadaipegsp <155911522+petricadaipegsp@users.noreply.github.com> Date: Mon, 11 Nov 2024 18:11:28 +0100 Subject: [PATCH 08/14] Change frame delivery filter (#345) --- node/consensus/data/broadcast_messaging.go | 2 +- node/consensus/data/data_clock_consensus_engine.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/node/consensus/data/broadcast_messaging.go b/node/consensus/data/broadcast_messaging.go index 0397f1d..78b1b0a 100644 --- a/node/consensus/data/broadcast_messaging.go +++ b/node/consensus/data/broadcast_messaging.go @@ -82,7 +82,7 @@ func (e *DataClockConsensusEngine) publishProof( e.logger.Debug("error publishing message", zap.Error(err)) } - e.publishMessage(e.filter, frame) + e.publishMessage(e.frameFilter, frame) return nil } diff --git a/node/consensus/data/data_clock_consensus_engine.go b/node/consensus/data/data_clock_consensus_engine.go index 4d89bd8..5b68b07 100644 --- a/node/consensus/data/data_clock_consensus_engine.go +++ b/node/consensus/data/data_clock_consensus_engine.go @@ -100,6 +100,7 @@ type DataClockConsensusEngine struct { filter []byte txFilter []byte infoFilter []byte + frameFilter []byte input []byte parentSelector []byte syncingStatus SyncStatusType @@ -268,6 +269,7 @@ func NewDataClockConsensusEngine( e.filter = filter e.txFilter = append([]byte{0x00}, e.filter...) e.infoFilter = append([]byte{0x00, 0x00}, e.filter...) + e.frameFilter = append([]byte{0x00, 0x00, 0x00}, e.filter...) e.input = seed e.provingKey = signer e.provingKeyType = keyType @@ -305,7 +307,7 @@ func (e *DataClockConsensusEngine) Start() <-chan error { go e.runInfoMessageHandler() e.logger.Info("subscribing to pubsub messages") - e.pubSub.Subscribe(e.filter, e.handleFrameMessage) + e.pubSub.Subscribe(e.frameFilter, e.handleFrameMessage) e.pubSub.Subscribe(e.txFilter, e.handleTxMessage) e.pubSub.Subscribe(e.infoFilter, e.handleInfoMessage) go func() { From b9694ddc99b41ea9011128057ae2e6d32c1166c6 Mon Sep 17 00:00:00 2001 From: Cassandra Heart Date: Mon, 11 Nov 2024 11:32:11 -0600 Subject: [PATCH 09/14] fix rate limit --- .../data/data_clock_consensus_engine.go | 5 - .../data/grpc_worker_rate_limiter.go | 78 ++----- node/consensus/data/peer_messaging.go | 14 +- node/protobufs/data.pb.go | 202 +++++++++--------- node/protobufs/data.proto | 1 - 5 files changed, 122 insertions(+), 178 deletions(-) diff --git a/node/consensus/data/data_clock_consensus_engine.go b/node/consensus/data/data_clock_consensus_engine.go index 5b68b07..515636a 100644 --- a/node/consensus/data/data_clock_consensus_engine.go +++ b/node/consensus/data/data_clock_consensus_engine.go @@ -208,13 +208,10 @@ func NewDataClockConsensusEngine( } rateLimit := cfg.P2P.GrpcServerRateLimit - rateLimitTokens := 0 if rateLimit == 0 { rateLimit = 10 } - rateLimitTokens = rateLimit * rateLimit - e := &DataClockConsensusEngine{ difficulty: difficulty, logger: logger, @@ -253,8 +250,6 @@ func NewDataClockConsensusEngine( config: cfg, preMidnightMint: map[string]struct{}{}, grpcRateLimiter: NewRateLimiter( - rateLimitTokens, - rateLimit, rateLimit, time.Minute, ), diff --git a/node/consensus/data/grpc_worker_rate_limiter.go b/node/consensus/data/grpc_worker_rate_limiter.go index 824de53..d190591 100644 --- a/node/consensus/data/grpc_worker_rate_limiter.go +++ b/node/consensus/data/grpc_worker_rate_limiter.go @@ -10,14 +10,10 @@ import ( ) type RateLimiter struct { - mu sync.RWMutex - clients map[peer.ID]*bucket - maxTokens int - refillTokens int - refillTime time.Duration - maxCallers int - lastCleanup time.Time - cleanupPeriod time.Duration + mu sync.RWMutex + clients map[peer.ID]time.Time + maxTokens int + windowSize time.Duration } type bucket struct { @@ -27,18 +23,12 @@ type bucket struct { func NewRateLimiter( maxTokens int, - maxCallers int, - refillTokens int, - refillDuration time.Duration, + windowSize time.Duration, ) *RateLimiter { return &RateLimiter{ - clients: make(map[peer.ID]*bucket), - maxTokens: maxTokens, - refillTokens: refillTokens, - refillTime: refillDuration, - maxCallers: maxCallers, - lastCleanup: time.Now(), - cleanupPeriod: time.Minute, + clients: make(map[peer.ID]time.Time), + maxTokens: maxTokens, + windowSize: windowSize, } } @@ -48,55 +38,23 @@ func (rl *RateLimiter) Allow(peerId peer.ID) error { now := time.Now() - if now.Sub(rl.lastCleanup) >= rl.cleanupPeriod { - rl.cleanup(now) - rl.lastCleanup = now + windowStart := now.Add(-rl.windowSize) + + for peerId, time := range rl.clients { + if time.Before(windowStart) { + delete(rl.clients, peerId) + } } - b, exists := rl.clients[peerId] - if !exists { - if len(rl.clients) >= rl.maxCallers { + if _, exists := rl.clients[peerId]; !exists { + if len(rl.clients) >= rl.maxTokens { return status.Errorf(codes.ResourceExhausted, - "maximum number of unique callers (%d) reached", rl.maxCallers) + "maximum number of unique callers (%d) reached", rl.maxTokens) } - - 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 - } + rl.clients[peerId] = now - 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 59d3c3a..0bcbf7c 100644 --- a/node/consensus/data/peer_messaging.go +++ b/node/consensus/data/peer_messaging.go @@ -31,13 +31,15 @@ func (e *DataClockConsensusEngine) GetDataFrame( ctx context.Context, request *protobufs.GetDataFrameRequest, ) (*protobufs.DataFrameResponse, error) { - peerID, ok := grpc_internal.PeerIDFromContext(ctx) - if !ok { - return nil, status.Error(codes.Internal, "remote peer ID not found") - } + if e.config.P2P.GrpcServerRateLimit != -1 { + peerID, ok := grpc_internal.PeerIDFromContext(ctx) + if !ok { + return nil, status.Error(codes.Internal, "remote peer ID not found") + } - if err := e.grpcRateLimiter.Allow(peerID); err != nil { - return nil, errors.Wrap(err, "get data frame") + if err := e.grpcRateLimiter.Allow(peerID); err != nil { + return nil, errors.Wrap(err, "get data frame") + } } e.logger.Debug( diff --git a/node/protobufs/data.pb.go b/node/protobufs/data.pb.go index 7765e13..01594d5 100644 --- a/node/protobufs/data.pb.go +++ b/node/protobufs/data.pb.go @@ -662,7 +662,6 @@ 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() { @@ -704,13 +703,6 @@ 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 @@ -1162,111 +1154,109 @@ var file_data_proto_rawDesc = []byte{ 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, 0x51, 0x0a, 0x13, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x22, 0x38, 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, 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, + 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, 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, 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, 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, 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, + 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, } var ( diff --git a/node/protobufs/data.proto b/node/protobufs/data.proto index 9e1c057..0856d5d 100644 --- a/node/protobufs/data.proto +++ b/node/protobufs/data.proto @@ -76,7 +76,6 @@ message InclusionCommitmentsMap { message GetDataFrameRequest { uint64 frame_number = 1; - string peer_id = 2; } message DataFrameResponse { From ea5ed70aeb48962685ace395384a3be810b19be6 Mon Sep 17 00:00:00 2001 From: Cassandra Heart Date: Mon, 11 Nov 2024 11:47:26 -0600 Subject: [PATCH 10/14] don't penalize for tree mismatch --- .../intrinsics/token/application/token_handle_mint.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/node/execution/intrinsics/token/application/token_handle_mint.go b/node/execution/intrinsics/token/application/token_handle_mint.go index c111043..d66a2b7 100644 --- a/node/execution/intrinsics/token/application/token_handle_mint.go +++ b/node/execution/intrinsics/token/application/token_handle_mint.go @@ -256,6 +256,7 @@ func (a *TokenApplication) handleMint( return nil, errors.Wrap(ErrInvalidStateTransition, "handle mint") } + wesoVerified := true if verified && delete != nil && len(t.Proofs) > 3 { newFrame, _, err := a.ClockStore.GetDataClockFrame( frame.Filter, @@ -339,7 +340,7 @@ func (a *TokenApplication) handleMint( zap.Uint64("frame_number", currentFrameNumber), ) // we want this to still apply the next commit even if this proof failed - verified = false + wesoVerified = false } } @@ -355,7 +356,7 @@ func (a *TokenApplication) handleMint( }, ) } - if verified && delete != nil && len(t.Proofs) > 3 { + if verified && delete != nil && len(t.Proofs) > 3 && wesoVerified { storage := PomwBasis(1, ring, currentFrameNumber) storage.Quo(storage, big.NewInt(int64(parallelismMap[ring]))) storage.Mul(storage, big.NewInt(int64(parallelism))) @@ -431,7 +432,7 @@ func (a *TokenApplication) handleMint( }, }, ) - if !verified { + if !wesoVerified { outputs = append(outputs, &protobufs.TokenOutput{ Output: &protobufs.TokenOutput_Penalty{ Penalty: &protobufs.ProverPenalty{ From d5ebd54be6c66610340774b8db83cb312ff5dbc4 Mon Sep 17 00:00:00 2001 From: Cassandra Heart Date: Mon, 11 Nov 2024 11:52:23 -0600 Subject: [PATCH 11/14] reset 2 --- .../token/application/token_handle_mint.go | 1 + .../intrinsics/token/token_execution_engine.go | 3 ++- node/execution/intrinsics/token/token_genesis.go | 13 +++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/node/execution/intrinsics/token/application/token_handle_mint.go b/node/execution/intrinsics/token/application/token_handle_mint.go index d66a2b7..687bcf2 100644 --- a/node/execution/intrinsics/token/application/token_handle_mint.go +++ b/node/execution/intrinsics/token/application/token_handle_mint.go @@ -20,6 +20,7 @@ import ( const PROOF_FRAME_CUTOFF = 1 const PROOF_FRAME_RING_RESET = 5750 +const PROOF_FRAME_RING_RESET_2 = 7650 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 bbe32d8..eae7945 100644 --- a/node/execution/intrinsics/token/token_execution_engine.go +++ b/node/execution/intrinsics/token/token_execution_engine.go @@ -776,7 +776,8 @@ func (e *TokenExecutionEngine) ProcessFrame( return nil, errors.Wrap(err, "process frame") } - if frame.FrameNumber == application.PROOF_FRAME_RING_RESET { + if frame.FrameNumber == application.PROOF_FRAME_RING_RESET || + frame.FrameNumber == application.PROOF_FRAME_RING_RESET_2 { e.logger.Info("performing ring reset") seniorityMap, err := RebuildPeerSeniority(e.pubSub.GetNetwork()) if err != nil { diff --git a/node/execution/intrinsics/token/token_genesis.go b/node/execution/intrinsics/token/token_genesis.go index f7f14be..90a5509 100644 --- a/node/execution/intrinsics/token/token_genesis.go +++ b/node/execution/intrinsics/token/token_genesis.go @@ -232,6 +232,10 @@ func RebuildPeerSeniority(network uint) (map[string]uint64, error) { PeerId: "Qma3bMDgVjCNgvSd3uomekF4v7Pq4VkTyT5R31FfdrqSan", Reward: "39302", }, + { + PeerId: "QmUDWLhZMRoCoqkJAqvi815EJwjQAZoTm2oa9LkRwqeeAW", + Reward: "78604", + }, } secondRetro = []*SecondRetroJson{ { @@ -279,6 +283,15 @@ func RebuildPeerSeniority(network uint) (map[string]uint64, error) { AprPresence: false, MayPresence: false, }, + { + PeerId: "QmYSwFqgVKUFGkNM8Ae4DrarCjGKPJ4u7oJvRhrmx3YPpB", + Reward: "1000", + JanPresence: true, + FebPresence: true, + MarPresence: false, + AprPresence: false, + MayPresence: false, + }, } thirdRetro = []*ThirdRetroJson{ { From 26cbb2092e0b7c2851d9145281aaddf683b50da4 Mon Sep 17 00:00:00 2001 From: Cassandra Heart Date: Mon, 11 Nov 2024 13:13:20 -0600 Subject: [PATCH 12/14] rate limiter logic --- .../data/data_clock_consensus_engine.go | 2 +- .../data/grpc_worker_rate_limiter.go | 1 - .../data/grpc_worker_rate_limiter_test.go | 38 +++++++++++++++++++ node/consensus/data/main_data_loop.go | 13 ++++++- node/consensus/data/token_handle_mint_test.go | 1 + 5 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 node/consensus/data/grpc_worker_rate_limiter_test.go diff --git a/node/consensus/data/data_clock_consensus_engine.go b/node/consensus/data/data_clock_consensus_engine.go index 515636a..b4c65b0 100644 --- a/node/consensus/data/data_clock_consensus_engine.go +++ b/node/consensus/data/data_clock_consensus_engine.go @@ -541,11 +541,11 @@ func (e *DataClockConsensusEngine) PerformTimeProof( wg := sync.WaitGroup{} wg.Add(len(actives)) + for i, client := range actives { i := i client := client go func() { - e.logger.Info("performing data proof") resp, err := client.client.CalculateChallengeProof( context.Background(), diff --git a/node/consensus/data/grpc_worker_rate_limiter.go b/node/consensus/data/grpc_worker_rate_limiter.go index d190591..7f56d33 100644 --- a/node/consensus/data/grpc_worker_rate_limiter.go +++ b/node/consensus/data/grpc_worker_rate_limiter.go @@ -51,7 +51,6 @@ func (rl *RateLimiter) Allow(peerId peer.ID) error { return status.Errorf(codes.ResourceExhausted, "maximum number of unique callers (%d) reached", rl.maxTokens) } - return nil } rl.clients[peerId] = now diff --git a/node/consensus/data/grpc_worker_rate_limiter_test.go b/node/consensus/data/grpc_worker_rate_limiter_test.go new file mode 100644 index 0000000..85cf2a2 --- /dev/null +++ b/node/consensus/data/grpc_worker_rate_limiter_test.go @@ -0,0 +1,38 @@ +package data_test + +import ( + "crypto/rand" + "testing" + "time" + + "github.com/cloudflare/circl/sign/ed448" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/stretchr/testify/assert" + "source.quilibrium.com/quilibrium/monorepo/node/consensus/data" +) + +func TestRateLimiter(t *testing.T) { + limiter := data.NewRateLimiter(5, 10*time.Second) + + for i := 0; i < 7; i++ { + _, priv, _ := ed448.GenerateKey(rand.Reader) + privKey, err := crypto.UnmarshalEd448PrivateKey(priv) + if err != nil { + t.FailNow() + } + + pub := privKey.GetPublic() + + peer, _ := peer.IDFromPublicKey(pub) + err = limiter.Allow(peer) + if i < 5 { + assert.NoError(t, err) + } else { + assert.Error(t, err) + } + + time.Sleep(time.Second) + } + +} diff --git a/node/consensus/data/main_data_loop.go b/node/consensus/data/main_data_loop.go index 853194b..2a7b7f6 100644 --- a/node/consensus/data/main_data_loop.go +++ b/node/consensus/data/main_data_loop.go @@ -176,12 +176,17 @@ func (e *DataClockConsensusEngine) processFrame( } else if len(e.config.Engine.DataWorkerMultiaddrs) == 0 { e.logger.Error( "client failed, reconnecting after 50ms", + zap.Uint32("client", uint32(i)), ) time.Sleep(50 * time.Millisecond) client, err = e.createParallelDataClientsFromBaseMultiaddrAndIndex(uint32(i)) if err != nil { - e.logger.Error("failed to reconnect", zap.Error(err)) + e.logger.Error( + "failed to reconnect", + zap.Uint32("client", uint32(i)), + zap.Error(err), + ) } } e.clients[i] = client @@ -223,6 +228,12 @@ func (e *DataClockConsensusEngine) processFrame( panic(err) } + e.logger.Info( + "submitting data proof", + zap.Int("ring", ring), + zap.Int("active_workers", len(outputs)), + ) + e.publishMessage(e.txFilter, &protobufs.TokenRequest{ Request: &protobufs.TokenRequest_Mint{ Mint: &protobufs.MintCoinRequest{ diff --git a/node/consensus/data/token_handle_mint_test.go b/node/consensus/data/token_handle_mint_test.go index 269c389..ac2d39f 100644 --- a/node/consensus/data/token_handle_mint_test.go +++ b/node/consensus/data/token_handle_mint_test.go @@ -52,6 +52,7 @@ func (pubsub) GetMultiaddrOfPeerStream(ctx context.Context, peerId []byte) <-cha return nil } func (pubsub) GetMultiaddrOfPeer(peerId []byte) string { return "" } +func (pubsub) GetNetwork() uint { return 1 } func (pubsub) StartDirectChannelListener( key []byte, purpose string, From 3dbe0723bd00e592bdb3432fedc84ef574b19e60 Mon Sep 17 00:00:00 2001 From: petricadaipegsp <155911522+petricadaipegsp@users.noreply.github.com> Date: Mon, 11 Nov 2024 21:10:00 +0100 Subject: [PATCH 13/14] Add message validators (#346) --- .../data/data_clock_consensus_engine.go | 10 ++ node/consensus/data/message_validators.go | 101 ++++++++++++++++++ node/consensus/data/token_handle_mint_test.go | 13 ++- node/p2p/blossomsub.go | 25 +++++ node/p2p/pubsub.go | 14 +++ 5 files changed, 159 insertions(+), 4 deletions(-) create mode 100644 node/consensus/data/message_validators.go diff --git a/node/consensus/data/data_clock_consensus_engine.go b/node/consensus/data/data_clock_consensus_engine.go index b4c65b0..8f5cdcc 100644 --- a/node/consensus/data/data_clock_consensus_engine.go +++ b/node/consensus/data/data_clock_consensus_engine.go @@ -302,6 +302,9 @@ func (e *DataClockConsensusEngine) Start() <-chan error { go e.runInfoMessageHandler() e.logger.Info("subscribing to pubsub messages") + e.pubSub.RegisterValidator(e.frameFilter, e.validateFrameMessage) + e.pubSub.RegisterValidator(e.txFilter, e.validateTxMessage) + e.pubSub.RegisterValidator(e.infoFilter, e.validateInfoMessage) e.pubSub.Subscribe(e.frameFilter, e.handleFrameMessage) e.pubSub.Subscribe(e.txFilter, e.handleTxMessage) e.pubSub.Subscribe(e.infoFilter, e.handleInfoMessage) @@ -630,6 +633,13 @@ func (e *DataClockConsensusEngine) Stop(force bool) <-chan error { }(name) } + e.pubSub.Unsubscribe(e.frameFilter, false) + e.pubSub.Unsubscribe(e.txFilter, false) + e.pubSub.Unsubscribe(e.infoFilter, false) + e.pubSub.UnregisterValidator(e.frameFilter) + e.pubSub.UnregisterValidator(e.txFilter) + e.pubSub.UnregisterValidator(e.infoFilter) + e.logger.Info("waiting for execution engines to stop") wg.Wait() e.logger.Info("execution engines stopped") diff --git a/node/consensus/data/message_validators.go b/node/consensus/data/message_validators.go new file mode 100644 index 0000000..7b1eac6 --- /dev/null +++ b/node/consensus/data/message_validators.go @@ -0,0 +1,101 @@ +package data + +import ( + "time" + + "github.com/libp2p/go-libp2p/core/peer" + "go.uber.org/zap" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" + "source.quilibrium.com/quilibrium/monorepo/go-libp2p-blossomsub/pb" + "source.quilibrium.com/quilibrium/monorepo/node/p2p" + "source.quilibrium.com/quilibrium/monorepo/node/protobufs" +) + +func (e *DataClockConsensusEngine) validateFrameMessage(peerID peer.ID, message *pb.Message) p2p.ValidationResult { + msg := &protobufs.Message{} + if err := proto.Unmarshal(message.Data, msg); err != nil { + e.logger.Debug("could not unmarshal message", zap.Error(err)) + return p2p.ValidationResultReject + } + a := &anypb.Any{} + if err := proto.Unmarshal(msg.Payload, a); err != nil { + e.logger.Debug("could not unmarshal payload", zap.Error(err)) + return p2p.ValidationResultReject + } + switch a.TypeUrl { + case protobufs.ClockFrameType: + frame := &protobufs.ClockFrame{} + if err := proto.Unmarshal(a.Value, frame); err != nil { + e.logger.Debug("could not unmarshal frame", zap.Error(err)) + return p2p.ValidationResultReject + } + if ts := time.UnixMilli(frame.Timestamp); time.Since(ts) > time.Hour { + e.logger.Debug("frame is too old", zap.Time("timestamp", ts)) + return p2p.ValidationResultIgnore + } + return p2p.ValidationResultAccept + default: + e.logger.Debug("unknown message type", zap.String("type_url", a.TypeUrl)) + return p2p.ValidationResultReject + } +} + +func (e *DataClockConsensusEngine) validateTxMessage(peerID peer.ID, message *pb.Message) p2p.ValidationResult { + msg := &protobufs.Message{} + if err := proto.Unmarshal(message.Data, msg); err != nil { + e.logger.Debug("could not unmarshal message", zap.Error(err)) + return p2p.ValidationResultReject + } + a := &anypb.Any{} + if err := proto.Unmarshal(msg.Payload, a); err != nil { + e.logger.Debug("could not unmarshal payload", zap.Error(err)) + return p2p.ValidationResultReject + } + switch a.TypeUrl { + case protobufs.TokenRequestType: + tx := &protobufs.TokenRequest{} + if err := proto.Unmarshal(a.Value, tx); err != nil { + e.logger.Debug("could not unmarshal token request", zap.Error(err)) + return p2p.ValidationResultReject + } + // NOTE: There are no timestamps to be validated for token requests. + return p2p.ValidationResultAccept + default: + e.logger.Debug("unknown message type", zap.String("type_url", a.TypeUrl)) + return p2p.ValidationResultReject + } +} + +func (e *DataClockConsensusEngine) validateInfoMessage(peerID peer.ID, message *pb.Message) p2p.ValidationResult { + msg := &protobufs.Message{} + if err := proto.Unmarshal(message.Data, msg); err != nil { + e.logger.Debug("could not unmarshal message", zap.Error(err)) + return p2p.ValidationResultReject + } + a := &anypb.Any{} + if err := proto.Unmarshal(msg.Payload, a); err != nil { + e.logger.Debug("could not unmarshal payload", zap.Error(err)) + return p2p.ValidationResultReject + } + switch a.TypeUrl { + case protobufs.DataPeerListAnnounceType: + announce := &protobufs.DataPeerListAnnounce{} + if err := proto.Unmarshal(a.Value, announce); err != nil { + e.logger.Debug("could not unmarshal network info request", zap.Error(err)) + return p2p.ValidationResultReject + } + if announce.Peer == nil { + e.logger.Debug("peer list announce is missing peer") + return p2p.ValidationResultIgnore + } + if ts := time.UnixMilli(announce.Peer.Timestamp); time.Since(ts) > 10*time.Minute { + e.logger.Debug("peer list announce is too old", zap.Time("timestamp", ts)) + return p2p.ValidationResultIgnore + } + return p2p.ValidationResultAccept + default: + e.logger.Debug("unknown message type", zap.String("type_url", a.TypeUrl)) + return p2p.ValidationResultReject + } +} diff --git a/node/consensus/data/token_handle_mint_test.go b/node/consensus/data/token_handle_mint_test.go index ac2d39f..033221f 100644 --- a/node/consensus/data/token_handle_mint_test.go +++ b/node/consensus/data/token_handle_mint_test.go @@ -44,10 +44,14 @@ func (pubsub) Publish(address []byte, data []byte) error func (pubsub) PublishToBitmask(bitmask []byte, data []byte) error { return nil } func (pubsub) Subscribe(bitmask []byte, handler func(message *pb.Message) error) error { return nil } func (pubsub) Unsubscribe(bitmask []byte, raw bool) {} -func (pubsub) GetPeerID() []byte { return nil } -func (pubsub) GetPeerstoreCount() int { return 0 } -func (pubsub) GetNetworkPeersCount() int { return 0 } -func (pubsub) GetRandomPeer(bitmask []byte) ([]byte, error) { return nil, nil } +func (pubsub) RegisterValidator(bitmask []byte, validator func(peerID peer.ID, message *pb.Message) p2p.ValidationResult) error { + return nil +} +func (pubsub) UnregisterValidator(bitmask []byte) error { return nil } +func (pubsub) GetPeerID() []byte { return nil } +func (pubsub) GetPeerstoreCount() int { return 0 } +func (pubsub) GetNetworkPeersCount() int { return 0 } +func (pubsub) GetRandomPeer(bitmask []byte) ([]byte, error) { return nil, nil } func (pubsub) GetMultiaddrOfPeerStream(ctx context.Context, peerId []byte) <-chan multiaddr.Multiaddr { return nil } @@ -75,6 +79,7 @@ func (pubsub) SetPeerScore(peerId []byte, score int64) {} func (pubsub) AddPeerScore(peerId []byte, scoreDelta int64) {} func (pubsub) Reconnect(peerId []byte) error { return nil } func (pubsub) DiscoverPeers() error { return nil } +func (pubsub) GetNetwork() uint { return 0 } type outputs struct { difficulty uint32 diff --git a/node/p2p/blossomsub.go b/node/p2p/blossomsub.go index 7a3a708..c4c74f8 100644 --- a/node/p2p/blossomsub.go +++ b/node/p2p/blossomsub.go @@ -623,6 +623,31 @@ func (b *BlossomSub) Unsubscribe(bitmask []byte, raw bool) { bm.Close() } +func (b *BlossomSub) RegisterValidator( + bitmask []byte, validator func(peerID peer.ID, message *pb.Message) ValidationResult, +) error { + validatorEx := func( + ctx context.Context, peerID peer.ID, message *blossomsub.Message, + ) blossomsub.ValidationResult { + switch v := validator(peerID, message.Message); v { + case ValidationResultAccept: + return blossomsub.ValidationAccept + case ValidationResultReject: + return blossomsub.ValidationReject + case ValidationResultIgnore: + return blossomsub.ValidationIgnore + default: + panic("unreachable") + } + } + var _ blossomsub.ValidatorEx = validatorEx + return b.ps.RegisterBitmaskValidator(bitmask, validatorEx) +} + +func (b *BlossomSub) UnregisterValidator(bitmask []byte) error { + return b.ps.UnregisterBitmaskValidator(bitmask) +} + func (b *BlossomSub) GetPeerID() []byte { return []byte(b.peerID) } diff --git a/node/p2p/pubsub.go b/node/p2p/pubsub.go index fe70d34..939153d 100644 --- a/node/p2p/pubsub.go +++ b/node/p2p/pubsub.go @@ -3,17 +3,31 @@ package p2p import ( "context" + "github.com/libp2p/go-libp2p/core/peer" "github.com/multiformats/go-multiaddr" "google.golang.org/grpc" "source.quilibrium.com/quilibrium/monorepo/go-libp2p-blossomsub/pb" "source.quilibrium.com/quilibrium/monorepo/node/protobufs" ) +type ValidationResult int + +const ( + ValidationResultAccept ValidationResult = iota + ValidationResultReject + ValidationResultIgnore +) + type PubSub interface { PublishToBitmask(bitmask []byte, data []byte) error Publish(address []byte, data []byte) error Subscribe(bitmask []byte, handler func(message *pb.Message) error) error Unsubscribe(bitmask []byte, raw bool) + RegisterValidator( + bitmask []byte, + validator func(peerID peer.ID, message *pb.Message) ValidationResult, + ) error + UnregisterValidator(bitmask []byte) error GetPeerID() []byte GetBitmaskPeers() map[string][]string GetPeerstoreCount() int From db28f1b81e342252c614c75a22a1be0e867c4271 Mon Sep 17 00:00:00 2001 From: petricadaipegsp <155911522+petricadaipegsp@users.noreply.github.com> Date: Mon, 11 Nov 2024 22:05:45 +0100 Subject: [PATCH 14/14] Remove vendored gostream (#347) * Remove vendored go-libp2p-gostream * Remove error wrapping --- .../.github/workflows/go-check.yml | 19 - .../.github/workflows/go-test.yml | 19 - .../.github/workflows/release-check.yml | 19 - .../.github/workflows/releaser.yml | 17 - .../.github/workflows/stale.yml | 13 - .../.github/workflows/tagpush.yml | 18 - go-libp2p-gostream/.gitignore | 24 - go-libp2p-gostream/LICENSE | 21 - go-libp2p-gostream/README.md | 66 --- go-libp2p-gostream/addr.go | 14 - go-libp2p-gostream/conn.go | 43 -- go-libp2p-gostream/go.mod | 93 ---- go-libp2p-gostream/go.sum | 448 ------------------ go-libp2p-gostream/gostream.go | 19 - go-libp2p-gostream/gostream_test.go | 141 ------ go-libp2p-gostream/listener.go | 71 --- go-libp2p-gostream/version.json | 3 - node/consensus/data/peer_messaging.go | 14 +- node/consensus/data/token_handle_mint_test.go | 1 - node/go.mod | 3 - node/p2p/blossomsub.go | 2 +- 21 files changed, 9 insertions(+), 1059 deletions(-) delete mode 100644 go-libp2p-gostream/.github/workflows/go-check.yml delete mode 100644 go-libp2p-gostream/.github/workflows/go-test.yml delete mode 100644 go-libp2p-gostream/.github/workflows/release-check.yml delete mode 100644 go-libp2p-gostream/.github/workflows/releaser.yml delete mode 100644 go-libp2p-gostream/.github/workflows/stale.yml delete mode 100644 go-libp2p-gostream/.github/workflows/tagpush.yml delete mode 100644 go-libp2p-gostream/.gitignore delete mode 100644 go-libp2p-gostream/LICENSE delete mode 100644 go-libp2p-gostream/README.md delete mode 100644 go-libp2p-gostream/addr.go delete mode 100644 go-libp2p-gostream/conn.go delete mode 100644 go-libp2p-gostream/go.mod delete mode 100644 go-libp2p-gostream/go.sum delete mode 100644 go-libp2p-gostream/gostream.go delete mode 100644 go-libp2p-gostream/gostream_test.go delete mode 100644 go-libp2p-gostream/listener.go delete mode 100644 go-libp2p-gostream/version.json diff --git a/go-libp2p-gostream/.github/workflows/go-check.yml b/go-libp2p-gostream/.github/workflows/go-check.yml deleted file mode 100644 index 4aabd69..0000000 --- a/go-libp2p-gostream/.github/workflows/go-check.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Go Checks - -on: - pull_request: - merge_group: - push: - branches: ["master"] - workflow_dispatch: - -permissions: - contents: read - -concurrency: - group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }} - cancel-in-progress: true - -jobs: - go-check: - uses: pl-strflt/uci/.github/workflows/go-check.yml@v0.0 diff --git a/go-libp2p-gostream/.github/workflows/go-test.yml b/go-libp2p-gostream/.github/workflows/go-test.yml deleted file mode 100644 index 2f6423b..0000000 --- a/go-libp2p-gostream/.github/workflows/go-test.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Go Test - -on: - pull_request: - merge_group: - push: - branches: ["master"] - workflow_dispatch: - -permissions: - contents: read - -concurrency: - group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }} - cancel-in-progress: true - -jobs: - go-test: - uses: pl-strflt/uci/.github/workflows/go-test.yml@v0.0 diff --git a/go-libp2p-gostream/.github/workflows/release-check.yml b/go-libp2p-gostream/.github/workflows/release-check.yml deleted file mode 100644 index bda6160..0000000 --- a/go-libp2p-gostream/.github/workflows/release-check.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Release Checker - -on: - pull_request_target: - paths: [ 'version.json' ] - types: [ opened, synchronize, reopened, labeled, unlabeled ] - workflow_dispatch: - -permissions: - contents: write - pull-requests: write - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - release-check: - uses: pl-strflt/uci/.github/workflows/release-check.yml@v0.0 diff --git a/go-libp2p-gostream/.github/workflows/releaser.yml b/go-libp2p-gostream/.github/workflows/releaser.yml deleted file mode 100644 index dd8081b..0000000 --- a/go-libp2p-gostream/.github/workflows/releaser.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Releaser - -on: - push: - paths: [ 'version.json' ] - workflow_dispatch: - -permissions: - contents: write - -concurrency: - group: ${{ github.workflow }}-${{ github.sha }} - cancel-in-progress: true - -jobs: - releaser: - uses: pl-strflt/uci/.github/workflows/releaser.yml@v0.0 diff --git a/go-libp2p-gostream/.github/workflows/stale.yml b/go-libp2p-gostream/.github/workflows/stale.yml deleted file mode 100644 index 16d65d7..0000000 --- a/go-libp2p-gostream/.github/workflows/stale.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Close and mark stale issue - -on: - schedule: - - cron: '0 0 * * *' - -permissions: - issues: write - pull-requests: write - -jobs: - stale: - uses: pl-strflt/.github/.github/workflows/reusable-stale-issue.yml@v0.3 diff --git a/go-libp2p-gostream/.github/workflows/tagpush.yml b/go-libp2p-gostream/.github/workflows/tagpush.yml deleted file mode 100644 index 59de8cb..0000000 --- a/go-libp2p-gostream/.github/workflows/tagpush.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Tag Push Checker - -on: - push: - tags: - - v* - -permissions: - contents: read - issues: write - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - releaser: - uses: pl-strflt/uci/.github/workflows/tagpush.yml@v0.0 diff --git a/go-libp2p-gostream/.gitignore b/go-libp2p-gostream/.gitignore deleted file mode 100644 index daf913b..0000000 --- a/go-libp2p-gostream/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/go-libp2p-gostream/LICENSE b/go-libp2p-gostream/LICENSE deleted file mode 100644 index cea85a4..0000000 --- a/go-libp2p-gostream/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Hector Sanjuan - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/go-libp2p-gostream/README.md b/go-libp2p-gostream/README.md deleted file mode 100644 index 402078d..0000000 --- a/go-libp2p-gostream/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# go-libp2p-gostream - -[![Build Status](https://travis-ci.org/libp2p/go-libp2p-gostream.svg?branch=master)](https://travis-ci.org/libp2p/go-libp2p-gostream) -[![codecov](https://codecov.io/gh/libp2p/go-libp2p-gostream/branch/master/graph/badge.svg)](https://codecov.io/gh/libp2p/go-libp2p-gostream) -[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg)](https://github.com/RichardLitt/standard-readme) - - -> Go "net" wrappers for libp2p - -Package `gostream` allows to replace the standard net stack in Go with -[LibP2P](https://github.com/libp2p/libp2p) streams. - -Given a libp2p.Host, `gostream` provides Dial() and Listen() methods which -return implementations of net.Conn and net.Listener. - -Instead of the regular "host:port" addressing, `gostream` uses a Peer ID, and -rather than a raw TCP connection, gostream will use libp2p's net.Stream. This -means your connections will take advantage of libp2p's multi-routes, NAT -traversal, and stream multiplexing. - -## Table of Contents - -- [Install](#install) -- [Usage](#usage) -- [Contribute](#contribute) -- [License](#license) - -## Install - -This package is a library that uses Go modules for depedency management. - -## Usage - -Documentation can be read at -[Godoc](https://godoc.org/github.com/libp2p/go-libp2p-gostream). The -important bits follow. - -A simple communication between peers -one acting as server and the other as -client- would work like: - -```go -go func() { - listener, _ := Listen(srvHost, tag) - defer listener.Close() - servConn, _ := listener.Accept() - defer servConn.Close() - reader := bufio.NewReader(servConn) - msg, _ := reader.ReadString('\n') - fmt.Println(msg) - servConn.Write([]byte("answer!\n")) -}() -clientConn, _ := Dial(context.Background(), clientHost, srvHost.ID(), tag) -clientConn.Write([]byte("question?\n")) -resp, _ := ioutil.ReadAll(clientConn) -fmt.Println(resp) -``` - -Note error handling above is ommited. - -## Contribute - -PRs accepted. - -## License - -MIT © Protocol Labs, Inc. diff --git a/go-libp2p-gostream/addr.go b/go-libp2p-gostream/addr.go deleted file mode 100644 index 49d844f..0000000 --- a/go-libp2p-gostream/addr.go +++ /dev/null @@ -1,14 +0,0 @@ -package gostream - -import "github.com/libp2p/go-libp2p/core/peer" - -// addr implements net.Addr and holds a libp2p peer ID. -type addr struct{ id peer.ID } - -// Network returns the name of the network that this address belongs to -// (libp2p). -func (a *addr) Network() string { return Network } - -// String returns the peer ID of this address in string form -// (B58-encoded). -func (a *addr) String() string { return a.id.String() } diff --git a/go-libp2p-gostream/conn.go b/go-libp2p-gostream/conn.go deleted file mode 100644 index 991dd2f..0000000 --- a/go-libp2p-gostream/conn.go +++ /dev/null @@ -1,43 +0,0 @@ -package gostream - -import ( - "context" - "net" - - "github.com/libp2p/go-libp2p/core/host" - "github.com/libp2p/go-libp2p/core/network" - "github.com/libp2p/go-libp2p/core/peer" - "github.com/libp2p/go-libp2p/core/protocol" -) - -// conn is an implementation of net.Conn which wraps -// libp2p streams. -type conn struct { - network.Stream -} - -// newConn creates a conn given a libp2p stream -func newConn(s network.Stream) net.Conn { - return &conn{s} -} - -// LocalAddr returns the local network address. -func (c *conn) LocalAddr() net.Addr { - return &addr{c.Stream.Conn().LocalPeer()} -} - -// RemoteAddr returns the remote network address. -func (c *conn) RemoteAddr() net.Addr { - return &addr{c.Stream.Conn().RemotePeer()} -} - -// Dial opens a stream to the destination address -// (which should parseable to a peer ID) using the given -// host and returns it as a standard net.Conn. -func Dial(ctx context.Context, h host.Host, pid peer.ID, tag protocol.ID) (net.Conn, error) { - s, err := h.NewStream(ctx, pid, tag) - if err != nil { - return nil, err - } - return newConn(s), nil -} diff --git a/go-libp2p-gostream/go.mod b/go-libp2p-gostream/go.mod deleted file mode 100644 index b7c96bb..0000000 --- a/go-libp2p-gostream/go.mod +++ /dev/null @@ -1,93 +0,0 @@ -module github.com/libp2p/go-libp2p-gostream - -go 1.20 - -replace github.com/libp2p/go-libp2p => ../go-libp2p - -require ( - github.com/libp2p/go-libp2p v0.31.0 - github.com/multiformats/go-multiaddr v0.11.0 -) - -require ( - github.com/benbjohnson/clock v1.3.5 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/containerd/cgroups v1.1.0 // indirect - github.com/coreos/go-systemd/v22 v22.5.0 // indirect - github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect - github.com/docker/go-units v0.5.0 // indirect - github.com/elastic/gosigar v0.14.2 // indirect - github.com/flynn/noise v1.0.0 // indirect - github.com/francoispqt/gojay v1.2.13 // indirect - github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect - github.com/godbus/dbus/v5 v5.1.0 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/mock v1.6.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/google/gopacket v1.1.19 // indirect - github.com/google/pprof v0.0.0-20230821062121-407c9e7a662f // indirect - github.com/gorilla/websocket v1.5.0 // indirect - github.com/huin/goupnp v1.2.0 // indirect - github.com/ipfs/go-cid v0.4.1 // indirect - github.com/ipfs/go-log/v2 v2.5.1 // indirect - github.com/jackpal/go-nat-pmp v1.0.2 // indirect - github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect - github.com/klauspost/compress v1.16.7 // indirect - github.com/klauspost/cpuid/v2 v2.2.5 // indirect - github.com/koron/go-ssdp v0.0.4 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/libp2p/go-cidranger v1.1.0 // indirect - github.com/libp2p/go-flow-metrics v0.1.0 // indirect - github.com/libp2p/go-libp2p-asn-util v0.3.0 // indirect - github.com/libp2p/go-msgio v0.3.0 // indirect - github.com/libp2p/go-nat v0.2.0 // indirect - github.com/libp2p/go-netroute v0.2.1 // indirect - github.com/libp2p/go-reuseport v0.4.0 // indirect - github.com/libp2p/go-yamux/v4 v4.0.1 // indirect - github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/miekg/dns v1.1.55 // indirect - github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect - github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect - github.com/minio/sha256-simd v1.0.1 // indirect - github.com/mr-tron/base58 v1.2.0 // indirect - github.com/multiformats/go-base32 v0.1.0 // indirect - github.com/multiformats/go-base36 v0.2.0 // indirect - github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect - github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect - github.com/multiformats/go-multibase v0.2.0 // indirect - github.com/multiformats/go-multicodec v0.9.0 // indirect - github.com/multiformats/go-multihash v0.2.3 // indirect - github.com/multiformats/go-multistream v0.4.1 // indirect - github.com/multiformats/go-varint v0.0.7 // indirect - github.com/onsi/ginkgo/v2 v2.11.0 // indirect - github.com/opencontainers/runtime-spec v1.1.0 // indirect - github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.16.0 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.11.1 // indirect - github.com/quic-go/qpack v0.4.0 // indirect - github.com/quic-go/quic-go v0.37.5 // indirect - github.com/quic-go/webtransport-go v0.5.3 // indirect - github.com/raulk/go-watchdog v1.3.0 // indirect - github.com/spaolacci/murmur3 v1.1.0 // indirect - go.uber.org/dig v1.17.0 // indirect - go.uber.org/fx v1.20.0 // indirect - go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.25.0 // indirect - golang.org/x/crypto v0.12.0 // indirect - golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect - golang.org/x/mod v0.12.0 // indirect - golang.org/x/net v0.14.0 // indirect - golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.11.0 // indirect - golang.org/x/text v0.12.0 // indirect - golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 // indirect - google.golang.org/protobuf v1.31.0 // indirect - lukechampine.com/blake3 v1.2.1 // indirect -) diff --git a/go-libp2p-gostream/go.sum b/go-libp2p-gostream/go.sum deleted file mode 100644 index 806aeaa..0000000 --- a/go-libp2p-gostream/go.sum +++ /dev/null @@ -1,448 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgoo= -dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= -dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= -dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= -dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= -git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= -github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= -github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= -github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= -github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= -github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= -github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR6AkioZ1ySsx5yxlDQZ8stG2b88gTPxgJU= -github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= -github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= -github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/elastic/gosigar v0.12.0/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= -github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4= -github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/flynn/noise v1.0.0 h1:DlTHqmzmvcEiKj+4RYo/imoswx/4r6iBlCMfVtrMXpQ= -github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= -github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= -github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= -github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= -github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= -github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20230821062121-407c9e7a662f h1:pDhu5sgp8yJlEF/g6osliIIpF9K4F5jvkULXa4daRDQ= -github.com/google/pprof v0.0.0-20230821062121-407c9e7a662f/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= -github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= -github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/huin/goupnp v1.2.0 h1:uOKW26NG1hsSSbXIZ1IR7XP9Gjd1U8pnLaCMgntmkmY= -github.com/huin/goupnp v1.2.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= -github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= -github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= -github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= -github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= -github.com/ipfs/go-log/v2 v2.5.1 h1:1XdUzF7048prq4aBjDQQ4SL5RxftpRGdXhNRwKSAlcY= -github.com/ipfs/go-log/v2 v2.5.1/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= -github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= -github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jbenet/go-temp-err-catcher v0.1.0 h1:zpb3ZH6wIE8Shj2sKS+khgRvf7T7RABoLk/+KKHggpk= -github.com/jbenet/go-temp-err-catcher v0.1.0/go.mod h1:0kJRvmDZXNMIiJirNPEYfhpPwbGVtZVWC34vc5WLsDk= -github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= -github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= -github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= -github.com/koron/go-ssdp v0.0.4 h1:1IDwrghSKYM7yLf7XCzbByg2sJ/JcNOZRXS2jczTwz0= -github.com/koron/go-ssdp v0.0.4/go.mod h1:oDXq+E5IL5q0U8uSBcoAXzTzInwy5lEgC91HoKtbmZk= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= -github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38yPW7c= -github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0dXIXt15Okic= -github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM= -github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnFNsMtpsYUClFtro= -github.com/libp2p/go-libp2p v0.30.0 h1:9EZwFtJPFBcs/yJTnP90TpN1hgrT/EsFfM+OZuwV87U= -github.com/libp2p/go-libp2p v0.30.0/go.mod h1:nr2g5V7lfftwgiJ78/HrID+pwvayLyqKCEirT2Y3Byg= -github.com/libp2p/go-libp2p-asn-util v0.3.0 h1:gMDcMyYiZKkocGXDQ5nsUQyquC9+H+iLEQHwOCZ7s8s= -github.com/libp2p/go-libp2p-asn-util v0.3.0/go.mod h1:B1mcOrKUE35Xq/ASTmQ4tN3LNzVVaMNmq2NACuqyB9w= -github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA= -github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0= -github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM= -github.com/libp2p/go-nat v0.2.0 h1:Tyz+bUFAYqGyJ/ppPPymMGbIgNRH+WqC5QrT5fKrrGk= -github.com/libp2p/go-nat v0.2.0/go.mod h1:3MJr+GRpRkyT65EpVPBstXLvOlAPzUVlG6Pwg9ohLJk= -github.com/libp2p/go-netroute v0.2.1 h1:V8kVrpD8GK0Riv15/7VN6RbUQ3URNZVosw7H2v9tksU= -github.com/libp2p/go-netroute v0.2.1/go.mod h1:hraioZr0fhBjG0ZRXJJ6Zj2IVEVNx6tDTFQfSmcq7mQ= -github.com/libp2p/go-reuseport v0.4.0 h1:nR5KU7hD0WxXCJbmw7r2rhRYruNRl2koHw8fQscQm2s= -github.com/libp2p/go-reuseport v0.4.0/go.mod h1:ZtI03j/wO5hZVDFo2jKywN6bYKWLOy8Se6DrI2E1cLU= -github.com/libp2p/go-yamux/v4 v4.0.1 h1:FfDR4S1wj6Bw2Pqbc8Uz7pCxeRBPbwsBbEdfwiCypkQ= -github.com/libp2p/go-yamux/v4 v4.0.1/go.mod h1:NWjl8ZTLOGlozrXSOZ/HlfG++39iKNnM5wwmtQP1YB4= -github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk= -github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= -github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/miekg/dns v1.1.55 h1:GoQ4hpsj0nFLYe+bWiCToyrBEJXkQfOOIvFGFy0lEgo= -github.com/miekg/dns v1.1.55/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= -github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c h1:bzE/A84HN25pxAuk9Eej1Kz9OUelF97nAc82bDquQI8= -github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c/go.mod h1:0SQS9kMwD2VsyFEB++InYyBJroV/FRmBgcydeSUcJms= -github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b h1:z78hV3sbSMAUoyUMM0I83AUIT6Hu17AWfgjzIbtrYFc= -github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b/go.mod h1:lxPUiZwKoFL8DUUmalo2yJJUCxbPKtm8OKfqr2/FTNU= -github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc h1:PTfri+PuQmWDqERdnNMiD9ZejrlswWrCpBEZgWOiTrc= -github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc/go.mod h1:cGKTAVKx4SxOuR/czcZ/E2RSJ3sfHs8FpHhQ5CWMf9s= -github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= -github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= -github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= -github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= -github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE= -github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= -github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= -github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= -github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo= -github.com/multiformats/go-multiaddr v0.2.0/go.mod h1:0nO36NvPpyV4QzvTLi/lafl2y95ncPj0vFwVF6k6wJ4= -github.com/multiformats/go-multiaddr v0.11.0 h1:XqGyJ8ufbCE0HmTDwx2kPdsrQ36AGPZNZX6s6xfJH10= -github.com/multiformats/go-multiaddr v0.11.0/go.mod h1:gWUm0QLR4thQ6+ZF6SXUw8YjtwQSPapICM+NmCkxHSM= -github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A= -github.com/multiformats/go-multiaddr-dns v0.3.1/go.mod h1:G/245BRQ6FJGmryJCrOuTdB37AMA5AMOVuO6NY3JwTk= -github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= -github.com/multiformats/go-multiaddr-fmt v0.1.0/go.mod h1:hGtDIW4PU4BqJ50gW2quDuPVjyWNZxToGUh/HwTZYJo= -github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= -github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= -github.com/multiformats/go-multicodec v0.9.0 h1:pb/dlPnzee/Sxv/j4PmkDRxCOi3hXTz3IbPKOXWJkmg= -github.com/multiformats/go-multicodec v0.9.0/go.mod h1:L3QTQvMIaVBkXOXXtVmYE+LI16i14xuaojr/H7Ai54k= -github.com/multiformats/go-multihash v0.0.8/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= -github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U= -github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM= -github.com/multiformats/go-multistream v0.4.1 h1:rFy0Iiyn3YT0asivDUIR05leAdwZq3de4741sbiSdfo= -github.com/multiformats/go-multistream v0.4.1/go.mod h1:Mz5eykRVAjJWckE2U78c6xqdtyNUEhKSM0Lwar2p77Q= -github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= -github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= -github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= -github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= -github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= -github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= -github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= -github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc= -github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg= -github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= -github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= -github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= -github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= -github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= -github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= -github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= -github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= -github.com/quic-go/qtls-go1-20 v0.3.2 h1:rRgN3WfnKbyik4dBV8A6girlJVxGand/d+jVKbQq5GI= -github.com/quic-go/qtls-go1-20 v0.3.2/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k= -github.com/quic-go/quic-go v0.38.0 h1:T45lASr5q/TrVwt+jrVccmqHhPL2XuSyoCLVCpfOSLc= -github.com/quic-go/quic-go v0.38.0/go.mod h1:MPCuRq7KBK2hNcfKj/1iD1BGuN3eAYMeNxp3T42LRUg= -github.com/quic-go/webtransport-go v0.5.3 h1:5XMlzemqB4qmOlgIus5zB45AcZ2kCgCy2EptUrfOPWU= -github.com/quic-go/webtransport-go v0.5.3/go.mod h1:OhmmgJIzTTqXK5xvtuX0oBpLV2GkLWNDA+UeTGJXErU= -github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk= -github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= -github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= -github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= -github.com/shurcooL/gofontwoff v0.0.0-20180329035133-29b52fc0a18d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw= -github.com/shurcooL/gopherjslib v0.0.0-20160914041154-feb6d3990c2c/go.mod h1:8d3azKNyqcHP1GaQE/c6dDgjkgSx2BZ4IoEi4F1reUI= -github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU= -github.com/shurcooL/highlight_go v0.0.0-20181028180052-98c3abbbae20/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag= -github.com/shurcooL/home v0.0.0-20181020052607-80b7ffcb30f9/go.mod h1:+rgNQw2P9ARFAs37qieuu7ohDNQ3gds9msbT2yn85sg= -github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50/go.mod h1:zPn1wHpTIePGnXSHpsVPWEktKXHr6+SS6x/IKRb7cpw= -github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc/go.mod h1:aYMfkZ6DWSJPJ6c4Wwz3QtW22G7mf/PEgaB9k/ik5+Y= -github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= -github.com/shurcooL/httpgzip v0.0.0-20180522190206-b1c53ac65af9/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q= -github.com/shurcooL/issues v0.0.0-20181008053335-6292fdc1e191/go.mod h1:e2qWDig5bLteJ4fwvDAc2NHzqFEthkqn7aOZAOpj+PQ= -github.com/shurcooL/issuesapp v0.0.0-20180602232740-048589ce2241/go.mod h1:NPpHK2TI7iSaM0buivtFUc9offApnI0Alt/K8hcHy0I= -github.com/shurcooL/notifications v0.0.0-20181007000457-627ab5aea122/go.mod h1:b5uSkrEVM1jQUspwbixRBhaIjIzL2xazXp6kntxYle0= -github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ= -github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lToEk4d2s07G3XGfz2QrgHXg4RJBvjrOozvoWfk= -github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4= -github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= -github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= -github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= -github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= -go.uber.org/dig v1.17.0 h1:5Chju+tUvcC+N7N6EV08BJz41UZuO3BmHcN4A287ZLI= -go.uber.org/dig v1.17.0/go.mod h1:rTxpf7l5I0eBTlE6/9RL+lDybC7WFwY2QH55ZSjy1mU= -go.uber.org/fx v1.20.0 h1:ZMC/pnRvhsthOZh9MZjMq5U8Or3mA9zBSPaLnzs3ihQ= -go.uber.org/fx v1.20.0/go.mod h1:qCUj0btiR3/JnanEr1TYEePfSw6o/4qYJscgvzQ5Ub0= -go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= -go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= -go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= -go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= -go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= -golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= -golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ= -golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8= -golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 h1:Vve/L0v7CXXuxUmaMGIEK/dEeq7uiqb5qBgQrZzIE7E= -golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= -google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= -lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= -sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= -sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= diff --git a/go-libp2p-gostream/gostream.go b/go-libp2p-gostream/gostream.go deleted file mode 100644 index a15125b..0000000 --- a/go-libp2p-gostream/gostream.go +++ /dev/null @@ -1,19 +0,0 @@ -// Package gostream allows to replace the standard net stack in Go -// with [LibP2P](https://github.com/libp2p/libp2p) streams. -// -// Given a libp2p.Host, gostream provides Dial() and Listen() methods which -// return implementations of net.Conn and net.Listener. -// -// Instead of the regular "host:port" addressing, `gostream` uses a Peer ID, -// and rather than a raw TCP connection, gostream will use libp2p's net.Stream. -// This means your connections will take advantage of LibP2P's multi-routes, -// NAT transversal and stream multiplexing. -// -// Note that LibP2P hosts cannot dial to themselves, so there is no possibility -// of using the same Host as server and as client. -package gostream - -// Network is the "net.Addr.Network()" name returned by -// addresses used by gostream connections. In turn, the "net.Addr.String()" will -// be a peer ID. -var Network = "libp2p" diff --git a/go-libp2p-gostream/gostream_test.go b/go-libp2p-gostream/gostream_test.go deleted file mode 100644 index e961546..0000000 --- a/go-libp2p-gostream/gostream_test.go +++ /dev/null @@ -1,141 +0,0 @@ -package gostream - -import ( - "bufio" - "context" - "io" - "testing" - "time" - - "github.com/libp2p/go-libp2p" - "github.com/libp2p/go-libp2p/core/host" - "github.com/libp2p/go-libp2p/core/peerstore" - "github.com/libp2p/go-libp2p/core/protocol" - "github.com/multiformats/go-multiaddr" -) - -// newHost illustrates how to build a libp2p host with secio using -// a randomly generated key-pair -func newHost(t *testing.T, listen multiaddr.Multiaddr) host.Host { - h, err := libp2p.New( - libp2p.ListenAddrs(listen), - ) - if err != nil { - t.Fatal(err) - } - return h -} - -func TestServerClient(t *testing.T) { - m1, _ := multiaddr.NewMultiaddr("/ip4/127.0.0.1/tcp/10000") - m2, _ := multiaddr.NewMultiaddr("/ip4/127.0.0.1/tcp/10001") - srvHost := newHost(t, m1) - clientHost := newHost(t, m2) - defer srvHost.Close() - defer clientHost.Close() - - srvHost.Peerstore().AddAddrs(clientHost.ID(), clientHost.Addrs(), peerstore.PermanentAddrTTL) - clientHost.Peerstore().AddAddrs(srvHost.ID(), srvHost.Addrs(), peerstore.PermanentAddrTTL) - - var tag protocol.ID = "/testitytest" - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - done := make(chan struct{}) - go func() { - defer close(done) - listener, err := Listen(srvHost, tag) - if err != nil { - t.Error(err) - return - } - defer listener.Close() - - if listener.Addr().String() != srvHost.ID().Pretty() { - t.Error("bad listener address") - return - } - - servConn, err := listener.Accept() - if err != nil { - t.Error(err) - return - } - defer servConn.Close() - - reader := bufio.NewReader(servConn) - for { - msg, err := reader.ReadString('\n') - if err == io.EOF { - break - } - if err != nil { - t.Error(err) - return - } - if msg != "is libp2p awesome?\n" { - t.Errorf("Bad incoming message: %s", msg) - return - } - - _, err = servConn.Write([]byte("yes it is\n")) - if err != nil { - t.Error(err) - return - } - } - }() - - clientConn, err := Dial(ctx, clientHost, srvHost.ID(), tag) - if err != nil { - t.Fatal(err) - } - - if clientConn.LocalAddr().String() != clientHost.ID().Pretty() { - t.Fatal("Bad LocalAddr") - } - - if clientConn.RemoteAddr().String() != srvHost.ID().Pretty() { - t.Fatal("Bad RemoteAddr") - } - - if clientConn.LocalAddr().Network() != Network { - t.Fatal("Bad Network()") - } - - err = clientConn.SetDeadline(time.Now().Add(time.Second)) - if err != nil { - t.Fatal(err) - } - - err = clientConn.SetReadDeadline(time.Now().Add(time.Second)) - if err != nil { - t.Fatal(err) - } - - err = clientConn.SetWriteDeadline(time.Now().Add(time.Second)) - if err != nil { - t.Fatal(err) - } - - _, err = clientConn.Write([]byte("is libp2p awesome?\n")) - if err != nil { - t.Fatal(err) - } - - reader := bufio.NewReader(clientConn) - resp, err := reader.ReadString('\n') - if err != nil { - t.Fatal(err) - } - - if string(resp) != "yes it is\n" { - t.Errorf("Bad response: %s", resp) - } - - err = clientConn.Close() - if err != nil { - t.Fatal(err) - } - <-done -} diff --git a/go-libp2p-gostream/listener.go b/go-libp2p-gostream/listener.go deleted file mode 100644 index 250e688..0000000 --- a/go-libp2p-gostream/listener.go +++ /dev/null @@ -1,71 +0,0 @@ -package gostream - -import ( - "context" - "net" - - "github.com/libp2p/go-libp2p/core/host" - "github.com/libp2p/go-libp2p/core/network" - "github.com/libp2p/go-libp2p/core/protocol" -) - -// listener is an implementation of net.Listener which handles -// http-tagged streams from a libp2p connection. -// A listener can be built with Listen() -type listener struct { - host host.Host - ctx context.Context - tag protocol.ID - cancel func() - streamCh chan network.Stream -} - -// Accept returns the next a connection to this listener. -// It blocks if there are no connections. Under the hood, -// connections are libp2p streams. -func (l *listener) Accept() (net.Conn, error) { - select { - case s := <-l.streamCh: - return newConn(s), nil - case <-l.ctx.Done(): - return nil, l.ctx.Err() - } -} - -// Close terminates this listener. It will no longer handle any -// incoming streams -func (l *listener) Close() error { - l.cancel() - l.host.RemoveStreamHandler(l.tag) - return nil -} - -// Addr returns the address for this listener, which is its libp2p Peer ID. -func (l *listener) Addr() net.Addr { - return &addr{l.host.ID()} -} - -// Listen provides a standard net.Listener ready to accept "connections". -// Under the hood, these connections are libp2p streams tagged with the -// given protocol.ID. -func Listen(h host.Host, tag protocol.ID) (net.Listener, error) { - ctx, cancel := context.WithCancel(context.Background()) - - l := &listener{ - host: h, - ctx: ctx, - cancel: cancel, - tag: tag, - streamCh: make(chan network.Stream), - } - - h.SetStreamHandler(tag, func(s network.Stream) { - select { - case l.streamCh <- s: - case <-ctx.Done(): - s.Reset() - } - }) - - return l, nil -} diff --git a/go-libp2p-gostream/version.json b/go-libp2p-gostream/version.json deleted file mode 100644 index 42c14d1..0000000 --- a/go-libp2p-gostream/version.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "version": "v0.6.0" -} diff --git a/node/consensus/data/peer_messaging.go b/node/consensus/data/peer_messaging.go index 0bcbf7c..9f6e2b6 100644 --- a/node/consensus/data/peer_messaging.go +++ b/node/consensus/data/peer_messaging.go @@ -31,20 +31,20 @@ func (e *DataClockConsensusEngine) GetDataFrame( ctx context.Context, request *protobufs.GetDataFrameRequest, ) (*protobufs.DataFrameResponse, error) { + peerID, ok := grpc_internal.PeerIDFromContext(ctx) + if !ok { + return nil, status.Error(codes.Internal, "remote peer ID not found") + } if e.config.P2P.GrpcServerRateLimit != -1 { - peerID, ok := grpc_internal.PeerIDFromContext(ctx) - if !ok { - return nil, status.Error(codes.Internal, "remote peer ID not found") - } - if err := e.grpcRateLimiter.Allow(peerID); err != nil { - return nil, errors.Wrap(err, "get data frame") + return nil, err } } e.logger.Debug( "received frame request", zap.Uint64("frame_number", request.FrameNumber), + zap.String("peer_id", peerID.String()), ) var frame *protobufs.ClockFrame var err error @@ -67,6 +67,8 @@ func (e *DataClockConsensusEngine) GetDataFrame( if err != nil { e.logger.Debug( "received error while fetching time reel head", + zap.String("peer_id", peerID.String()), + zap.Uint64("frame_number", request.FrameNumber), zap.Error(err), ) return nil, errors.Wrap(err, "get data frame") diff --git a/node/consensus/data/token_handle_mint_test.go b/node/consensus/data/token_handle_mint_test.go index 033221f..8a12ee4 100644 --- a/node/consensus/data/token_handle_mint_test.go +++ b/node/consensus/data/token_handle_mint_test.go @@ -79,7 +79,6 @@ func (pubsub) SetPeerScore(peerId []byte, score int64) {} func (pubsub) AddPeerScore(peerId []byte, scoreDelta int64) {} func (pubsub) Reconnect(peerId []byte) error { return nil } func (pubsub) DiscoverPeers() error { return nil } -func (pubsub) GetNetwork() uint { return 0 } type outputs struct { difficulty uint32 diff --git a/node/go.mod b/node/go.mod index cc1f5e9..ff89d92 100644 --- a/node/go.mod +++ b/node/go.mod @@ -19,8 +19,6 @@ replace github.com/libp2p/go-libp2p => ../go-libp2p replace github.com/libp2p/go-libp2p-kad-dht => ../go-libp2p-kad-dht -replace github.com/libp2p/go-libp2p-gostream => ../go-libp2p-gostream - replace source.quilibrium.com/quilibrium/monorepo/go-libp2p-blossomsub => ../go-libp2p-blossomsub replace github.com/cockroachdb/pebble => ../pebble @@ -29,7 +27,6 @@ require ( github.com/cockroachdb/pebble v0.0.0-20231210175920-b4d301aeb46a github.com/deiu/rdf2go v0.0.0-20240619132609-81222e324bb9 github.com/libp2p/go-libp2p v0.35.4 - github.com/libp2p/go-libp2p-gostream v0.6.0 github.com/libp2p/go-libp2p-kad-dht v0.23.0 github.com/shopspring/decimal v1.4.0 github.com/txaty/go-merkletree v0.2.2 diff --git a/node/p2p/blossomsub.go b/node/p2p/blossomsub.go index c4c74f8..081f833 100644 --- a/node/p2p/blossomsub.go +++ b/node/p2p/blossomsub.go @@ -18,7 +18,6 @@ import ( "time" "github.com/libp2p/go-libp2p" - gostream "github.com/libp2p/go-libp2p-gostream" dht "github.com/libp2p/go-libp2p-kad-dht" libp2pconfig "github.com/libp2p/go-libp2p/config" "github.com/libp2p/go-libp2p/core/crypto" @@ -31,6 +30,7 @@ import ( rcmgr "github.com/libp2p/go-libp2p/p2p/host/resource-manager" routedhost "github.com/libp2p/go-libp2p/p2p/host/routed" "github.com/libp2p/go-libp2p/p2p/net/connmgr" + "github.com/libp2p/go-libp2p/p2p/net/gostream" "github.com/libp2p/go-libp2p/p2p/net/swarm" "github.com/libp2p/go-libp2p/p2p/protocol/ping" "github.com/mr-tron/base58"