diff --git a/go-libp2p-blossomsub/blossomsub.go b/go-libp2p-blossomsub/blossomsub.go index 04606c6..b7c280a 100644 --- a/go-libp2p-blossomsub/blossomsub.go +++ b/go-libp2p-blossomsub/blossomsub.go @@ -18,9 +18,8 @@ import ( ) const ( - // BlossomSubID_v11 is the protocol ID for version 1.1.0 of the BlossomSub protocol. - // It retains versioning matching to GossipSub 1.1.0 to indicate point of fork - BlossomSubID_v11 = protocol.ID("/blossomsub/1.1.0") + // BlossomSubID_v12 is the protocol ID for version 1.2.0 of the BlossomSub protocol. + BlossomSubID_v12 = protocol.ID("/blossomsub/1.2.0") ) // Defines the default BlossomSub parameters. diff --git a/go-libp2p-blossomsub/blossomsub_connmgr_test.go b/go-libp2p-blossomsub/blossomsub_connmgr_test.go index f3bb81e..d49a96b 100644 --- a/go-libp2p-blossomsub/blossomsub_connmgr_test.go +++ b/go-libp2p-blossomsub/blossomsub_connmgr_test.go @@ -86,7 +86,7 @@ func TestBlossomSubConnTagMessageDeliveries(t *testing.T) { sybilHosts := getNetHosts(t, ctx, nSquatter) for _, h := range sybilHosts { squatter := &sybilSquatter{h: h} - h.SetStreamHandler(BlossomSubID_v11, squatter.handleStream) + h.SetStreamHandler(BlossomSubID_v12, squatter.handleStream) } // connect the honest hosts diff --git a/go-libp2p-blossomsub/blossomsub_feat.go b/go-libp2p-blossomsub/blossomsub_feat.go index d9c7b2d..396f72d 100644 --- a/go-libp2p-blossomsub/blossomsub_feat.go +++ b/go-libp2p-blossomsub/blossomsub_feat.go @@ -14,22 +14,22 @@ type BlossomSubFeatureTest = func(BlossomSubFeature, protocol.ID) bool type BlossomSubFeature int const ( - // Protocol supports basic BlossomSub Mesh -- BlossomSub-v1.1 compatible + // Protocol supports basic BlossomSub Mesh -- BlossomSub-v1.2 compatible BlossomSubFeatureMesh = iota - // Protocol supports Peer eXchange on prune -- BlossomSub-v1.1 compatible + // Protocol supports Peer eXchange on prune -- BlossomSub-v1.2 compatible BlossomSubFeaturePX ) // BlossomSubDefaultProtocols is the default BlossomSub router protocol list -var BlossomSubDefaultProtocols = []protocol.ID{BlossomSubID_v11, FloodSubID} +var BlossomSubDefaultProtocols = []protocol.ID{BlossomSubID_v12, FloodSubID} // BlossomSubDefaultFeatures is the feature test function for the default BlossomSub protocols func BlossomSubDefaultFeatures(feat BlossomSubFeature, proto protocol.ID) bool { switch feat { case BlossomSubFeatureMesh: - return proto == BlossomSubID_v11 + return proto == BlossomSubID_v12 case BlossomSubFeaturePX: - return proto == BlossomSubID_v11 + return proto == BlossomSubID_v12 default: return false } diff --git a/go-libp2p-blossomsub/blossomsub_feat_test.go b/go-libp2p-blossomsub/blossomsub_feat_test.go index ac58508..b3a5104 100644 --- a/go-libp2p-blossomsub/blossomsub_feat_test.go +++ b/go-libp2p-blossomsub/blossomsub_feat_test.go @@ -15,15 +15,15 @@ func TestDefaultBlossomSubFeatures(t *testing.T) { if BlossomSubDefaultFeatures(BlossomSubFeatureMesh, FloodSubID) { t.Fatal("floodsub should not support Mesh") } - if !BlossomSubDefaultFeatures(BlossomSubFeatureMesh, BlossomSubID_v11) { - t.Fatal("BlossomSub-v1.1 should support Mesh") + if !BlossomSubDefaultFeatures(BlossomSubFeatureMesh, BlossomSubID_v12) { + t.Fatal("BlossomSub-v1.2 should support Mesh") } if BlossomSubDefaultFeatures(BlossomSubFeaturePX, FloodSubID) { t.Fatal("floodsub should not support PX") } - if !BlossomSubDefaultFeatures(BlossomSubFeatureMesh, BlossomSubID_v11) { - t.Fatal("BlossomSub-v1.1 should support PX") + if !BlossomSubDefaultFeatures(BlossomSubFeatureMesh, BlossomSubID_v12) { + t.Fatal("BlossomSub-v1.2 should support PX") } } diff --git a/go-libp2p-blossomsub/blossomsub_matchfn_test.go b/go-libp2p-blossomsub/blossomsub_matchfn_test.go index c45598b..fb0ade2 100644 --- a/go-libp2p-blossomsub/blossomsub_matchfn_test.go +++ b/go-libp2p-blossomsub/blossomsub_matchfn_test.go @@ -19,9 +19,9 @@ func TestBlossomSubMatchingFn(t *testing.T) { h := getNetHosts(t, ctx, 4) psubs := []*PubSub{ - getBlossomSub(ctx, h[0], WithProtocolMatchFn(protocolNameMatch), WithBlossomSubProtocols([]protocol.ID{customsubA100, BlossomSubID_v11}, BlossomSubDefaultFeatures)), + getBlossomSub(ctx, h[0], WithProtocolMatchFn(protocolNameMatch), WithBlossomSubProtocols([]protocol.ID{customsubA100, BlossomSubID_v12}, BlossomSubDefaultFeatures)), getBlossomSub(ctx, h[1], WithProtocolMatchFn(protocolNameMatch), WithBlossomSubProtocols([]protocol.ID{customsubA101Beta}, BlossomSubDefaultFeatures)), - getBlossomSub(ctx, h[2], WithProtocolMatchFn(protocolNameMatch), WithBlossomSubProtocols([]protocol.ID{BlossomSubID_v11}, BlossomSubDefaultFeatures)), + getBlossomSub(ctx, h[2], WithProtocolMatchFn(protocolNameMatch), WithBlossomSubProtocols([]protocol.ID{BlossomSubID_v12}, BlossomSubDefaultFeatures)), getBlossomSub(ctx, h[3], WithProtocolMatchFn(protocolNameMatch), WithBlossomSubProtocols([]protocol.ID{customsubB100}, BlossomSubDefaultFeatures)), } diff --git a/go-libp2p-blossomsub/blossomsub_test.go b/go-libp2p-blossomsub/blossomsub_test.go index e8dc5c3..96a0e50 100644 --- a/go-libp2p-blossomsub/blossomsub_test.go +++ b/go-libp2p-blossomsub/blossomsub_test.go @@ -1039,7 +1039,7 @@ func TestBlossomSubTreeTopology(t *testing.T) { checkMessageRouting(t, []byte{0xf1, 0x22, 0xb0, 0x22}, []*PubSub{psubs[9], psubs[3]}, chs) } -// this tests overlay bootstrapping through px in BlossomSub v1.1 +// this tests overlay bootstrapping through px in BlossomSub v1.2 // we start with a star topology and rely on px through prune to build the mesh func TestBlossomSubStarTopology(t *testing.T) { originalBlossomSubD := BlossomSubD @@ -1122,7 +1122,7 @@ func TestBlossomSubStarTopology(t *testing.T) { } } -// this tests overlay bootstrapping through px in BlossomSub v1.1, with addresses +// this tests overlay bootstrapping through px in BlossomSub v1.2, with addresses // exchanged in signed peer records. // we start with a star topology and rely on px through prune to build the mesh func TestBlossomSubStarTopologyWithSignedPeerRecords(t *testing.T) { @@ -1853,7 +1853,7 @@ func TestBlossomSubOpportunisticGrafting(t *testing.T) { // sybil squatters for the remaining 40 hosts for _, h := range hosts[10:] { squatter := &sybilSquatter{h: h} - h.SetStreamHandler(BlossomSubID_v11, squatter.handleStream) + h.SetStreamHandler(BlossomSubID_v12, squatter.handleStream) } // connect all squatters to every real host @@ -2037,7 +2037,7 @@ type sybilSquatter struct { func (sq *sybilSquatter) handleStream(s network.Stream) { defer s.Close() - os, err := sq.h.NewStream(context.Background(), s.Conn().RemotePeer(), BlossomSubID_v11) + os, err := sq.h.NewStream(context.Background(), s.Conn().RemotePeer(), BlossomSubID_v12) if err != nil { panic(err) } @@ -2203,7 +2203,7 @@ func TestBlossomSubRPCFragmentation(t *testing.T) { // make a fake peer that requests everything through IWANT gossip iwe := iwantEverything{h: hosts[1]} - iwe.h.SetStreamHandler(BlossomSubID_v11, iwe.handleStream) + iwe.h.SetStreamHandler(BlossomSubID_v12, iwe.handleStream) connect(t, hosts[0], hosts[1]) @@ -2265,7 +2265,7 @@ type iwantEverything struct { func (iwe *iwantEverything) handleStream(s network.Stream) { defer s.Close() - os, err := iwe.h.NewStream(context.Background(), s.Conn().RemotePeer(), BlossomSubID_v11) + os, err := iwe.h.NewStream(context.Background(), s.Conn().RemotePeer(), BlossomSubID_v12) if err != nil { panic(err) } diff --git a/node/app/wire.go b/node/app/wire.go index 0c6a75a..13371e1 100644 --- a/node/app/wire.go +++ b/node/app/wire.go @@ -51,8 +51,10 @@ var storeSet = wire.NewSet( var pubSubSet = wire.NewSet( wire.FieldsOf(new(*config.Config), "P2P"), + p2p.NewInMemoryPeerInfoManager, p2p.NewBlossomSub, wire.Bind(new(p2p.PubSub), new(*p2p.BlossomSub)), + wire.Bind(new(p2p.PeerInfoManager), new(*p2p.InMemoryPeerInfoManager)), ) var engineSet = wire.NewSet( diff --git a/node/app/wire_gen.go b/node/app/wire_gen.go index 301ad1f..d06f173 100644 --- a/node/app/wire_gen.go +++ b/node/app/wire_gen.go @@ -36,9 +36,10 @@ func NewNode(configConfig *config.Config, selfTestReport *protobufs.SelfTestRepo wesolowskiFrameProver := crypto.NewWesolowskiFrameProver(zapLogger) kzgInclusionProver := crypto.NewKZGInclusionProver(zapLogger) masterTimeReel := time.NewMasterTimeReel(zapLogger, pebbleClockStore, engineConfig, wesolowskiFrameProver) + inMemoryPeerInfoManager := p2p.NewInMemoryPeerInfoManager(zapLogger) pebbleKeyStore := store.NewPebbleKeyStore(pebbleDB, zapLogger) - ceremonyExecutionEngine := ceremony.NewCeremonyExecutionEngine(zapLogger, engineConfig, fileKeyManager, blossomSub, wesolowskiFrameProver, kzgInclusionProver, pebbleClockStore, masterTimeReel, pebbleKeyStore) - masterClockConsensusEngine := master.NewMasterClockConsensusEngine(engineConfig, zapLogger, pebbleClockStore, fileKeyManager, blossomSub, wesolowskiFrameProver, masterTimeReel, selfTestReport) + ceremonyExecutionEngine := ceremony.NewCeremonyExecutionEngine(zapLogger, engineConfig, fileKeyManager, blossomSub, wesolowskiFrameProver, kzgInclusionProver, pebbleClockStore, masterTimeReel, inMemoryPeerInfoManager, pebbleKeyStore) + masterClockConsensusEngine := master.NewMasterClockConsensusEngine(engineConfig, zapLogger, pebbleClockStore, fileKeyManager, blossomSub, wesolowskiFrameProver, masterTimeReel, inMemoryPeerInfoManager, selfTestReport) node, err := newNode(zapLogger, pebbleClockStore, fileKeyManager, blossomSub, ceremonyExecutionEngine, masterClockConsensusEngine) if err != nil { return nil, err @@ -81,7 +82,7 @@ var keyManagerSet = wire.NewSet(wire.FieldsOf(new(*config.Config), "Key"), keys. var storeSet = wire.NewSet(wire.FieldsOf(new(*config.Config), "DB"), store.NewPebbleDB, wire.Bind(new(store.KVDB), new(*store.PebbleDB)), store.NewPebbleClockStore, store.NewPebbleKeyStore, store.NewPebbleDataProofStore, wire.Bind(new(store.ClockStore), new(*store.PebbleClockStore)), wire.Bind(new(store.KeyStore), new(*store.PebbleKeyStore)), wire.Bind(new(store.DataProofStore), new(*store.PebbleDataProofStore))) -var pubSubSet = wire.NewSet(wire.FieldsOf(new(*config.Config), "P2P"), p2p.NewBlossomSub, wire.Bind(new(p2p.PubSub), new(*p2p.BlossomSub))) +var pubSubSet = wire.NewSet(wire.FieldsOf(new(*config.Config), "P2P"), p2p.NewInMemoryPeerInfoManager, p2p.NewBlossomSub, wire.Bind(new(p2p.PubSub), new(*p2p.BlossomSub)), wire.Bind(new(p2p.PeerInfoManager), new(*p2p.InMemoryPeerInfoManager))) var engineSet = wire.NewSet(wire.FieldsOf(new(*config.Config), "Engine"), crypto.NewWesolowskiFrameProver, wire.Bind(new(crypto.FrameProver), new(*crypto.WesolowskiFrameProver)), crypto.NewKZGInclusionProver, wire.Bind(new(crypto.InclusionProver), new(*crypto.KZGInclusionProver)), time.NewMasterTimeReel, ceremony.NewCeremonyExecutionEngine) diff --git a/node/config/version.go b/node/config/version.go index 9ce506e..dbbbcff 100644 --- a/node/config/version.go +++ b/node/config/version.go @@ -6,15 +6,15 @@ import ( ) func GetMinimumVersionCutoff() time.Time { - return time.Date(2024, time.March, 15, 4, 20, 0, 0, time.UTC) + return time.Date(2024, time.March, 21, 5, 00, 0, 0, time.UTC) } func GetMinimumVersion() []byte { - return []byte{0x01, 0x04, 0x08} + return []byte{0x01, 0x04, 0x0B} } func GetVersion() []byte { - return []byte{0x01, 0x04, 0x0A} + return []byte{0x01, 0x04, 0x0B} } func GetVersionString() string { diff --git a/node/consensus/ceremony/ceremony_data_clock_consensus_engine.go b/node/consensus/ceremony/ceremony_data_clock_consensus_engine.go index 070a042..ead4442 100644 --- a/node/consensus/ceremony/ceremony_data_clock_consensus_engine.go +++ b/node/consensus/ceremony/ceremony_data_clock_consensus_engine.go @@ -70,6 +70,7 @@ type CeremonyDataClockConsensusEngine struct { keyManager keys.KeyManager masterTimeReel *qtime.MasterTimeReel dataTimeReel *qtime.DataTimeReel + peerInfoManager p2p.PeerInfoManager provingKey crypto.Signer provingKeyBytes []byte provingKeyType keys.KeyType @@ -124,6 +125,7 @@ func NewCeremonyDataClockConsensusEngine( inclusionProver qcrypto.InclusionProver, masterTimeReel *qtime.MasterTimeReel, dataTimeReel *qtime.DataTimeReel, + peerInfoManager p2p.PeerInfoManager, filter []byte, seed []byte, ) *CeremonyDataClockConsensusEngine { @@ -167,6 +169,10 @@ func NewCeremonyDataClockConsensusEngine( panic(errors.New("data time reel is nil")) } + if peerInfoManager == nil { + panic(errors.New("peer info manager is nil")) + } + minimumPeersRequired := engineConfig.MinimumPeersRequired if minimumPeersRequired == 0 { minimumPeersRequired = 3 @@ -234,6 +240,7 @@ func NewCeremonyDataClockConsensusEngine( frameProver: frameProver, masterTimeReel: masterTimeReel, dataTimeReel: dataTimeReel, + peerInfoManager: peerInfoManager, statsClient: statsClient, messageProcessorCh: make(chan *pb.Message, 128), } diff --git a/node/consensus/ceremony/consensus_frames.go b/node/consensus/ceremony/consensus_frames.go index b742edc..cd0c76e 100644 --- a/node/consensus/ceremony/consensus_frames.go +++ b/node/consensus/ceremony/consensus_frames.go @@ -3,6 +3,7 @@ package ceremony import ( "bytes" "context" + "encoding/binary" "io" "time" @@ -263,6 +264,40 @@ func (e *CeremonyDataClockConsensusEngine) sync( return latest, errors.Wrap(err, "sync") } + challenge := binary.BigEndian.AppendUint64( + append([]byte{}, peerId...), + uint64(time.Now().UnixMilli()), + ) + signature, err := e.pubSub.SignMessage(challenge) + if err != nil { + panic(err) + } + + err = s.Send(&protobufs.CeremonyCompressedSyncRequestMessage{ + SyncMessage: &protobufs.CeremonyCompressedSyncRequestMessage_Authentication{ + Authentication: &protobufs.SyncRequestAuthentication{ + PeerId: e.pubSub.GetPeerID(), + Challenge: challenge, + Response: &protobufs.Ed448Signature{ + Signature: signature, + PublicKey: &protobufs.Ed448PublicKey{ + KeyValue: e.pubSub.GetPublicKey(), + }, + }, + }, + }, + }) + if err != nil { + e.peerMapMx.Lock() + if _, ok := e.peerMap[string(peerId)]; ok { + e.uncooperativePeersMap[string(peerId)] = e.peerMap[string(peerId)] + e.uncooperativePeersMap[string(peerId)].timestamp = time.Now().UnixMilli() + delete(e.peerMap, string(peerId)) + } + e.peerMapMx.Unlock() + return latest, errors.Wrap(err, "sync") + } + err = s.Send(&protobufs.CeremonyCompressedSyncRequestMessage{ SyncMessage: &protobufs.CeremonyCompressedSyncRequestMessage_Preflight{ Preflight: &protobufs.ClockFramesPreflight{ diff --git a/node/consensus/ceremony/peer_messaging.go b/node/consensus/ceremony/peer_messaging.go index c90b4ec..1366a27 100644 --- a/node/consensus/ceremony/peer_messaging.go +++ b/node/consensus/ceremony/peer_messaging.go @@ -3,9 +3,12 @@ package ceremony import ( "bytes" "context" + "encoding/binary" "io" "time" + pcrypto "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" "github.com/mr-tron/base58" "github.com/pbnjay/memory" "github.com/pkg/errors" @@ -60,6 +63,128 @@ func (e *CeremonyDataClockConsensusEngine) NegotiateCompressedSyncFrames( return nil } + + request, err := server.Recv() + if err == io.EOF { + return nil + } + + if err != nil { + return errors.Wrap(err, "negotiate compressed sync frames") + } + + authentication, ok := request. + SyncMessage.(*protobufs.CeremonyCompressedSyncRequestMessage_Authentication) + if !ok { + return nil + } + + if authentication.Authentication == nil || + authentication.Authentication.Challenge == nil || + authentication.Authentication.PeerId == nil || + authentication.Authentication.Response == nil || + authentication.Authentication.Response.PublicKey == nil || + authentication.Authentication.Response.PublicKey.KeyValue == nil || + authentication.Authentication.Response.Signature == nil || + len(authentication.Authentication.Challenge) < 8 { + return nil + } + + if !bytes.Equal( + authentication.Authentication.Challenge[:len( + authentication.Authentication.Challenge, + )-8], + e.pubSub.GetPeerID(), + ) { + e.logger.Warn( + "peer provided invalid challenge", + ) + return nil + } + + // probably some remark to make about chronometers here, whether one or three + challenge := int64( + binary.BigEndian.Uint64( + authentication.Authentication.Challenge[len( + authentication.Authentication.Challenge, + )-8:], + ), + ) + dist := time.Now().UnixMilli() - challenge + if dist < 0 { + dist *= -1 + } + + // account for skew + if dist > 30000 { + e.logger.Warn( + "peer provided challenge with too great of a distance", + zap.Int64("distance", dist), + ) + return nil + } + + key, err := pcrypto.UnmarshalEd448PublicKey( + authentication.Authentication.Response.PublicKey.KeyValue, + ) + if err != nil { + e.logger.Warn( + "peer provided invalid pubkey", + zap.Binary( + "public_key", + authentication.Authentication.Response.PublicKey.KeyValue, + ), + ) + return errors.Wrap(err, "negotiate compressed sync frames") + } + + if !(peer.ID(authentication.Authentication.PeerId)).MatchesPublicKey(key) { + e.logger.Warn( + "peer id does not match pubkey", + zap.Binary("peer_id", authentication.Authentication.PeerId), + zap.Binary( + "public_key", + authentication.Authentication.Response.PublicKey.KeyValue, + ), + ) + return nil + } + + b, err := key.Verify( + authentication.Authentication.Challenge, + authentication.Authentication.Response.Signature, + ) + if err != nil || !b { + e.logger.Warn( + "peer provided invalid signature", + zap.Binary("peer_id", authentication.Authentication.PeerId), + zap.Binary( + "public_key", + authentication.Authentication.Response.PublicKey.KeyValue, + ), + zap.Binary( + "signature", + authentication.Authentication.Response.Signature, + ), + ) + return nil + } + + manifest := e.peerInfoManager.GetPeerInfo( + authentication.Authentication.PeerId, + ) + if manifest == nil || manifest.Bandwidth <= 1048576 { + e.logger.Warn( + "peer manifest was null or bandwidth was low", + zap.Binary("peer_id", authentication.Authentication.PeerId), + zap.Uint64("bandwidth", manifest.Bandwidth), + ) + return nil + } + + // TODO: should give this more tlc, but should remap into blossomsub + // heuristics + e.currentReceivingSyncPeers++ e.currentReceivingSyncPeersMx.Unlock() diff --git a/node/consensus/master/broadcast_messaging.go b/node/consensus/master/broadcast_messaging.go index 015a078..be2fe90 100644 --- a/node/consensus/master/broadcast_messaging.go +++ b/node/consensus/master/broadcast_messaging.go @@ -2,8 +2,10 @@ package master import ( "bytes" + "context" "encoding/binary" "strings" + "time" "github.com/iden3/go-iden3-crypto/poseidon" "github.com/mr-tron/base58" @@ -122,14 +124,13 @@ func (e *MasterClockConsensusEngine) handleSelfTestReport( return errors.Wrap(err, "handle self test report") } - e.peerMapMx.Lock() - if _, ok := e.peerMap[string(peerID)]; ok { - e.peerMap[string(peerID)].MasterHeadFrame = report.MasterHeadFrame - e.peerMapMx.Unlock() + info := e.peerInfoManager.GetPeerInfo(peerID) + if info != nil { + info.MasterHeadFrame = report.MasterHeadFrame return nil } - e.peerMap[string(peerID)] = report - e.peerMapMx.Unlock() + + e.addPeerManifestReport(peerID, report) memory := binary.BigEndian.Uint64(report.Memory) e.logger.Debug( @@ -175,7 +176,16 @@ func (e *MasterClockConsensusEngine) handleSelfTestReport( } go func() { - e.bandwidthTestCh <- peerID + ctx, cancel := context.WithTimeout(context.TODO(), 5*time.Minute) + defer cancel() + ch := e.pubSub.GetMultiaddrOfPeerStream(ctx, peerID) + select { + case <-ch: + go func() { + e.bandwidthTestCh <- peerID + }() + case <-ctx.Done(): + } }() return nil diff --git a/node/consensus/master/consensus_frames.go b/node/consensus/master/consensus_frames.go index 7f2926b..c0d127d 100644 --- a/node/consensus/master/consensus_frames.go +++ b/node/consensus/master/consensus_frames.go @@ -44,8 +44,8 @@ func (e *MasterClockConsensusEngine) GetMostAheadPeers() ( max := frame.FrameNumber + 10 var peers [][]byte = [][]byte{} - e.peerMapMx.Lock() - for peerId, v := range e.peerMap { + peerMap := e.peerInfoManager.GetPeerMap() + for peerId, v := range peerMap { if v.MasterHeadFrame > max { peers = append(peers, []byte(peerId)) } @@ -54,7 +54,6 @@ func (e *MasterClockConsensusEngine) GetMostAheadPeers() ( break } } - e.peerMapMx.Unlock() if len(peers) == 0 { return nil, p2p.ErrNoPeersAvailable diff --git a/node/consensus/master/master_clock_consensus_engine.go b/node/consensus/master/master_clock_consensus_engine.go index 5bd6c7a..1d49306 100644 --- a/node/consensus/master/master_clock_consensus_engine.go +++ b/node/consensus/master/master_clock_consensus_engine.go @@ -57,9 +57,8 @@ type MasterClockConsensusEngine struct { historicFrames []*protobufs.ClockFrame clockStore store.ClockStore masterTimeReel *qtime.MasterTimeReel + peerInfoManager p2p.PeerInfoManager report *protobufs.SelfTestReport - peerMapMx sync.RWMutex - peerMap map[string]*protobufs.SelfTestReport frameValidationCh chan *protobufs.ClockFrame bandwidthTestCh chan []byte currentReceivingSyncPeers int @@ -76,6 +75,7 @@ func NewMasterClockConsensusEngine( pubSub p2p.PubSub, frameProver crypto.FrameProver, masterTimeReel *qtime.MasterTimeReel, + peerInfoManager p2p.PeerInfoManager, report *protobufs.SelfTestReport, ) *MasterClockConsensusEngine { if logger == nil { @@ -121,13 +121,13 @@ func NewMasterClockConsensusEngine( clockStore: clockStore, frameProver: frameProver, masterTimeReel: masterTimeReel, + peerInfoManager: peerInfoManager, report: report, - peerMap: map[string]*protobufs.SelfTestReport{}, frameValidationCh: make(chan *protobufs.ClockFrame, 10), bandwidthTestCh: make(chan []byte), } - e.peerMap[string(e.pubSub.GetPeerID())] = report + e.addPeerManifestReport(e.pubSub.GetPeerID(), report) if e.filter, err = hex.DecodeString(engineConfig.Filter); err != nil { panic(errors.Wrap(err, "could not parse filter value")) @@ -143,6 +143,8 @@ func (e *MasterClockConsensusEngine) Start() <-chan error { e.state = consensus.EngineStateStarting errChan := make(chan error) + e.peerInfoManager.Start() + e.state = consensus.EngineStateLoading e.logger.Info("syncing last seen state") @@ -222,7 +224,7 @@ func (e *MasterClockConsensusEngine) Start() <-chan error { if err := e.publishMessage(e.filter, e.report); err != nil { e.logger.Debug("error publishing message", zap.Error(err)) } - time.Sleep(30 * time.Minute) + time.Sleep(5 * time.Minute) } }() @@ -306,6 +308,7 @@ func (e *MasterClockConsensusEngine) Stop(force bool) <-chan error { wg.Wait() e.logger.Info("execution engines stopped") e.masterTimeReel.Stop() + e.peerInfoManager.Stop() e.state = consensus.EngineStateStopped go func() { @@ -317,9 +320,6 @@ func (e *MasterClockConsensusEngine) Stop(force bool) <-chan error { func (e *MasterClockConsensusEngine) performBandwidthTest(peerID []byte) { result := e.pubSub.GetMultiaddrOfPeer(peerID) if result == "" { - go func() { - e.bandwidthTestCh <- peerID - }() return } @@ -377,6 +377,47 @@ func (e *MasterClockConsensusEngine) performBandwidthTest(peerID []byte) { e.pubSub.SetPeerScore(peerID, -1000) return } + + duration := end - start + bandwidth := uint64(1048576*1000) / uint64(duration) + manifest := e.peerInfoManager.GetPeerInfo(peerID) + if manifest == nil { + return + } + + peerManifest := &p2p.PeerManifest{ + PeerId: peerID, + Difficulty: manifest.Difficulty, + DifficultyMetric: manifest.DifficultyMetric, + Commit_16Metric: manifest.Commit_16Metric, + Commit_128Metric: manifest.Commit_128Metric, + Commit_1024Metric: manifest.Commit_1024Metric, + Commit_65536Metric: manifest.Commit_65536Metric, + Proof_16Metric: manifest.Proof_16Metric, + Proof_128Metric: manifest.Proof_128Metric, + Proof_1024Metric: manifest.Proof_1024Metric, + Proof_65536Metric: manifest.Proof_65536Metric, + Cores: manifest.Cores, + Memory: manifest.Memory, + Storage: manifest.Storage, + Capabilities: []p2p.Capability{}, + MasterHeadFrame: manifest.MasterHeadFrame, + Bandwidth: bandwidth, + } + + for _, capability := range manifest.Capabilities { + metadata := make([]byte, len(capability.AdditionalMetadata)) + copy(metadata[:], capability.AdditionalMetadata[:]) + peerManifest.Capabilities = append( + peerManifest.Capabilities, + p2p.Capability{ + ProtocolIdentifier: capability.ProtocolIdentifier, + AdditionalMetadata: metadata, + }, + ) + } + + e.peerInfoManager.AddPeerInfo(manifest) } func ( @@ -385,8 +426,8 @@ func ( response := &protobufs.PeerManifestsResponse{ PeerManifests: []*protobufs.PeerManifest{}, } - e.peerMapMx.Lock() - for peerId, peerManifest := range e.peerMap { + peerMap := e.peerInfoManager.GetPeerMap() + for peerId, peerManifest := range peerMap { peerId := peerId peerManifest := peerManifest manifest := &protobufs.PeerManifest{ @@ -424,7 +465,6 @@ func ( manifest, ) } - e.peerMapMx.Unlock() return response } @@ -487,3 +527,41 @@ func (e *MasterClockConsensusEngine) buildHistoricFrameCache( e.historicFrames = append(e.historicFrames, latestFrame) } + +func (e *MasterClockConsensusEngine) addPeerManifestReport( + peerId []byte, + report *protobufs.SelfTestReport, +) { + manifest := &p2p.PeerManifest{ + PeerId: peerId, + Difficulty: report.Difficulty, + DifficultyMetric: report.DifficultyMetric, + Commit_16Metric: report.Commit_16Metric, + Commit_128Metric: report.Commit_128Metric, + Commit_1024Metric: report.Commit_1024Metric, + Commit_65536Metric: report.Commit_65536Metric, + Proof_16Metric: report.Proof_16Metric, + Proof_128Metric: report.Proof_128Metric, + Proof_1024Metric: report.Proof_1024Metric, + Proof_65536Metric: report.Proof_65536Metric, + Cores: report.Cores, + Memory: report.Memory, + Storage: report.Storage, + Capabilities: []p2p.Capability{}, + MasterHeadFrame: report.MasterHeadFrame, + } + + for _, capability := range manifest.Capabilities { + metadata := make([]byte, len(capability.AdditionalMetadata)) + copy(metadata[:], capability.AdditionalMetadata[:]) + manifest.Capabilities = append( + manifest.Capabilities, + p2p.Capability{ + ProtocolIdentifier: capability.ProtocolIdentifier, + AdditionalMetadata: metadata, + }, + ) + } + + e.peerInfoManager.AddPeerInfo(manifest) +} diff --git a/node/execution/intrinsics/ceremony/ceremony_execution_engine.go b/node/execution/intrinsics/ceremony/ceremony_execution_engine.go index 2fa14f7..e656d49 100644 --- a/node/execution/intrinsics/ceremony/ceremony_execution_engine.go +++ b/node/execution/intrinsics/ceremony/ceremony_execution_engine.go @@ -73,6 +73,7 @@ func NewCeremonyExecutionEngine( inclusionProver qcrypto.InclusionProver, clockStore store.ClockStore, masterTimeReel *time.MasterTimeReel, + peerInfoManager p2p.PeerInfoManager, keyStore store.KeyStore, ) *CeremonyExecutionEngine { if logger == nil { @@ -144,6 +145,7 @@ func NewCeremonyExecutionEngine( inclusionProver, masterTimeReel, dataTimeReel, + peerInfoManager, intrinsicFilter, seed, ) diff --git a/node/p2p/blossomsub.go b/node/p2p/blossomsub.go index 697c89f..5776575 100644 --- a/node/p2p/blossomsub.go +++ b/node/p2p/blossomsub.go @@ -23,6 +23,7 @@ import ( "github.com/libp2p/go-libp2p/p2p/discovery/routing" "github.com/libp2p/go-libp2p/p2p/discovery/util" "github.com/mr-tron/base58" + "github.com/multiformats/go-multiaddr" "github.com/pkg/errors" "go.uber.org/zap" "google.golang.org/grpc" @@ -451,6 +452,13 @@ func (b *BlossomSub) GetNetworkPeersCount() int { return len(b.h.Network().Peers()) } +func (b *BlossomSub) GetMultiaddrOfPeerStream( + ctx context.Context, + peerId []byte, +) <-chan multiaddr.Multiaddr { + return b.h.Peerstore().AddrStream(ctx, peer.ID(peerId)) +} + func (b *BlossomSub) GetMultiaddrOfPeer(peerId []byte) string { addrs := b.h.Peerstore().Addrs(peer.ID(peerId)) if len(addrs) == 0 { diff --git a/node/p2p/peer_info_manager.go b/node/p2p/peer_info_manager.go new file mode 100644 index 0000000..3b2dde3 --- /dev/null +++ b/node/p2p/peer_info_manager.go @@ -0,0 +1,146 @@ +package p2p + +import ( + "bytes" + "sync" + + "go.uber.org/zap" +) + +type PeerInfoManager interface { + Start() + Stop() + AddPeerInfo(manifest *PeerManifest) + GetPeerInfo(peerId []byte) *PeerManifest + GetPeerMap() map[string]*PeerManifest + GetPeersBySpeed() [][]byte +} + +type Capability struct { + ProtocolIdentifier uint32 + AdditionalMetadata []byte +} + +type PeerManifest struct { + PeerId []byte + Difficulty uint32 + DifficultyMetric int64 + Commit_16Metric int64 + Commit_128Metric int64 + Commit_1024Metric int64 + Commit_65536Metric int64 + Proof_16Metric int64 + Proof_128Metric int64 + Proof_1024Metric int64 + Proof_65536Metric int64 + Cores uint32 + Memory []byte + Storage []byte + Capabilities []Capability + MasterHeadFrame uint64 + Bandwidth uint64 +} + +type InMemoryPeerInfoManager struct { + logger *zap.Logger + peerInfoCh chan *PeerManifest + quitCh chan struct{} + peerInfoMx sync.RWMutex + + peerMap map[string]*PeerManifest + fastestPeers []*PeerManifest +} + +var _ PeerInfoManager = (*InMemoryPeerInfoManager)(nil) + +func NewInMemoryPeerInfoManager(logger *zap.Logger) *InMemoryPeerInfoManager { + return &InMemoryPeerInfoManager{ + logger: logger, + peerInfoCh: make(chan *PeerManifest), + fastestPeers: []*PeerManifest{}, + peerMap: make(map[string]*PeerManifest), + } +} + +func (m *InMemoryPeerInfoManager) Start() { + go func() { + for { + select { + case manifest := <-m.peerInfoCh: + m.peerInfoMx.Lock() + m.peerMap[string(manifest.PeerId)] = manifest + m.searchAndInsertPeer(manifest) + m.peerInfoMx.Unlock() + case <-m.quitCh: + return + } + } + }() +} + +func (m *InMemoryPeerInfoManager) Stop() { + go func() { + m.quitCh <- struct{}{} + }() +} + +func (m *InMemoryPeerInfoManager) AddPeerInfo(manifest *PeerManifest) { + go func() { + m.peerInfoCh <- manifest + }() +} + +func (m *InMemoryPeerInfoManager) GetPeerInfo(peerId []byte) *PeerManifest { + m.peerInfoMx.RLock() + manifest, ok := m.peerMap[string(peerId)] + m.peerInfoMx.RUnlock() + if !ok { + return nil + } + return manifest +} + +func (m *InMemoryPeerInfoManager) GetPeerMap() map[string]*PeerManifest { + data := make(map[string]*PeerManifest) + m.peerInfoMx.RLock() + for k, v := range m.peerMap { + data[k] = v + } + m.peerInfoMx.RUnlock() + + return data +} + +func (m *InMemoryPeerInfoManager) GetPeersBySpeed() [][]byte { + result := [][]byte{} + m.peerInfoMx.RLock() + for _, info := range m.fastestPeers { + result = append(result, info.PeerId) + } + m.peerInfoMx.RUnlock() + return result +} + +// blatantly lifted from slices.BinarySearchFunc, optimized for direct insertion +// and uint64 comparison without overflow +func (m *InMemoryPeerInfoManager) searchAndInsertPeer(manifest *PeerManifest) { + n := len(m.fastestPeers) + i, j := 0, n + for i < j { + h := int(uint(i+j) >> 1) + if m.fastestPeers[h].Bandwidth > manifest.Bandwidth { + i = h + 1 + } else { + j = h + } + } + + if i < n && m.fastestPeers[i].Bandwidth == manifest.Bandwidth && + bytes.Equal(m.fastestPeers[i].PeerId, manifest.PeerId) { + m.fastestPeers[i] = manifest + } else { + m.fastestPeers = append(m.fastestPeers, new(PeerManifest)) + copy(m.fastestPeers[i+1:], m.fastestPeers[i:]) + m.fastestPeers[i] = manifest + } +} diff --git a/node/p2p/pubsub.go b/node/p2p/pubsub.go index d3b79e0..f86ffb8 100644 --- a/node/p2p/pubsub.go +++ b/node/p2p/pubsub.go @@ -1,6 +1,9 @@ package p2p import ( + "context" + + "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" @@ -16,6 +19,10 @@ type PubSub interface { GetPeerstoreCount() int GetNetworkPeersCount() int GetRandomPeer(bitmask []byte) ([]byte, error) + GetMultiaddrOfPeerStream( + ctx context.Context, + peerId []byte, + ) <-chan multiaddr.Multiaddr GetMultiaddrOfPeer(peerId []byte) string StartDirectChannelListener( key []byte, diff --git a/node/protobufs/ceremony.pb.go b/node/protobufs/ceremony.pb.go index c2d4c06..e1f9a8b 100644 --- a/node/protobufs/ceremony.pb.go +++ b/node/protobufs/ceremony.pb.go @@ -1209,6 +1209,69 @@ func (x *CeremonyCompressedSync) GetSegments() []*InclusionSegmentsMap { return nil } +type SyncRequestAuthentication struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PeerId []byte `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` + Challenge []byte `protobuf:"bytes,2,opt,name=challenge,proto3" json:"challenge,omitempty"` + Response *Ed448Signature `protobuf:"bytes,3,opt,name=response,proto3" json:"response,omitempty"` +} + +func (x *SyncRequestAuthentication) Reset() { + *x = SyncRequestAuthentication{} + if protoimpl.UnsafeEnabled { + mi := &file_ceremony_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncRequestAuthentication) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncRequestAuthentication) ProtoMessage() {} + +func (x *SyncRequestAuthentication) ProtoReflect() protoreflect.Message { + mi := &file_ceremony_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncRequestAuthentication.ProtoReflect.Descriptor instead. +func (*SyncRequestAuthentication) Descriptor() ([]byte, []int) { + return file_ceremony_proto_rawDescGZIP(), []int{16} +} + +func (x *SyncRequestAuthentication) GetPeerId() []byte { + if x != nil { + return x.PeerId + } + return nil +} + +func (x *SyncRequestAuthentication) GetChallenge() []byte { + if x != nil { + return x.Challenge + } + return nil +} + +func (x *SyncRequestAuthentication) GetResponse() *Ed448Signature { + if x != nil { + return x.Response + } + return nil +} + type CeremonyCompressedSyncRequestMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1218,13 +1281,14 @@ type CeremonyCompressedSyncRequestMessage struct { // // *CeremonyCompressedSyncRequestMessage_Preflight // *CeremonyCompressedSyncRequestMessage_Request + // *CeremonyCompressedSyncRequestMessage_Authentication SyncMessage isCeremonyCompressedSyncRequestMessage_SyncMessage `protobuf_oneof:"sync_message"` } func (x *CeremonyCompressedSyncRequestMessage) Reset() { *x = CeremonyCompressedSyncRequestMessage{} if protoimpl.UnsafeEnabled { - mi := &file_ceremony_proto_msgTypes[16] + mi := &file_ceremony_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1237,7 +1301,7 @@ func (x *CeremonyCompressedSyncRequestMessage) String() string { func (*CeremonyCompressedSyncRequestMessage) ProtoMessage() {} func (x *CeremonyCompressedSyncRequestMessage) ProtoReflect() protoreflect.Message { - mi := &file_ceremony_proto_msgTypes[16] + mi := &file_ceremony_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1250,7 +1314,7 @@ func (x *CeremonyCompressedSyncRequestMessage) ProtoReflect() protoreflect.Messa // Deprecated: Use CeremonyCompressedSyncRequestMessage.ProtoReflect.Descriptor instead. func (*CeremonyCompressedSyncRequestMessage) Descriptor() ([]byte, []int) { - return file_ceremony_proto_rawDescGZIP(), []int{16} + return file_ceremony_proto_rawDescGZIP(), []int{17} } func (m *CeremonyCompressedSyncRequestMessage) GetSyncMessage() isCeremonyCompressedSyncRequestMessage_SyncMessage { @@ -1274,6 +1338,13 @@ func (x *CeremonyCompressedSyncRequestMessage) GetRequest() *ClockFramesRequest return nil } +func (x *CeremonyCompressedSyncRequestMessage) GetAuthentication() *SyncRequestAuthentication { + if x, ok := x.GetSyncMessage().(*CeremonyCompressedSyncRequestMessage_Authentication); ok { + return x.Authentication + } + return nil +} + type isCeremonyCompressedSyncRequestMessage_SyncMessage interface { isCeremonyCompressedSyncRequestMessage_SyncMessage() } @@ -1286,12 +1357,19 @@ type CeremonyCompressedSyncRequestMessage_Request struct { Request *ClockFramesRequest `protobuf:"bytes,2,opt,name=request,proto3,oneof"` } +type CeremonyCompressedSyncRequestMessage_Authentication struct { + Authentication *SyncRequestAuthentication `protobuf:"bytes,3,opt,name=authentication,proto3,oneof"` +} + func (*CeremonyCompressedSyncRequestMessage_Preflight) isCeremonyCompressedSyncRequestMessage_SyncMessage() { } func (*CeremonyCompressedSyncRequestMessage_Request) isCeremonyCompressedSyncRequestMessage_SyncMessage() { } +func (*CeremonyCompressedSyncRequestMessage_Authentication) isCeremonyCompressedSyncRequestMessage_SyncMessage() { +} + type CeremonyCompressedSyncResponseMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1307,7 +1385,7 @@ type CeremonyCompressedSyncResponseMessage struct { func (x *CeremonyCompressedSyncResponseMessage) Reset() { *x = CeremonyCompressedSyncResponseMessage{} if protoimpl.UnsafeEnabled { - mi := &file_ceremony_proto_msgTypes[17] + mi := &file_ceremony_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1320,7 +1398,7 @@ func (x *CeremonyCompressedSyncResponseMessage) String() string { func (*CeremonyCompressedSyncResponseMessage) ProtoMessage() {} func (x *CeremonyCompressedSyncResponseMessage) ProtoReflect() protoreflect.Message { - mi := &file_ceremony_proto_msgTypes[17] + mi := &file_ceremony_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1333,7 +1411,7 @@ func (x *CeremonyCompressedSyncResponseMessage) ProtoReflect() protoreflect.Mess // Deprecated: Use CeremonyCompressedSyncResponseMessage.ProtoReflect.Descriptor instead. func (*CeremonyCompressedSyncResponseMessage) Descriptor() ([]byte, []int) { - return file_ceremony_proto_rawDescGZIP(), []int{17} + return file_ceremony_proto_rawDescGZIP(), []int{18} } func (m *CeremonyCompressedSyncResponseMessage) GetSyncMessage() isCeremonyCompressedSyncResponseMessage_SyncMessage { @@ -1388,7 +1466,7 @@ type InclusionProofsMap struct { func (x *InclusionProofsMap) Reset() { *x = InclusionProofsMap{} if protoimpl.UnsafeEnabled { - mi := &file_ceremony_proto_msgTypes[18] + mi := &file_ceremony_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1401,7 +1479,7 @@ func (x *InclusionProofsMap) String() string { func (*InclusionProofsMap) ProtoMessage() {} func (x *InclusionProofsMap) ProtoReflect() protoreflect.Message { - mi := &file_ceremony_proto_msgTypes[18] + mi := &file_ceremony_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1414,7 +1492,7 @@ func (x *InclusionProofsMap) ProtoReflect() protoreflect.Message { // Deprecated: Use InclusionProofsMap.ProtoReflect.Descriptor instead. func (*InclusionProofsMap) Descriptor() ([]byte, []int) { - return file_ceremony_proto_rawDescGZIP(), []int{18} + return file_ceremony_proto_rawDescGZIP(), []int{19} } func (x *InclusionProofsMap) GetFrameCommit() []byte { @@ -1450,7 +1528,7 @@ type InclusionSegmentsMap struct { func (x *InclusionSegmentsMap) Reset() { *x = InclusionSegmentsMap{} if protoimpl.UnsafeEnabled { - mi := &file_ceremony_proto_msgTypes[19] + mi := &file_ceremony_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1463,7 +1541,7 @@ func (x *InclusionSegmentsMap) String() string { func (*InclusionSegmentsMap) ProtoMessage() {} func (x *InclusionSegmentsMap) ProtoReflect() protoreflect.Message { - mi := &file_ceremony_proto_msgTypes[19] + mi := &file_ceremony_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1476,7 +1554,7 @@ func (x *InclusionSegmentsMap) ProtoReflect() protoreflect.Message { // Deprecated: Use InclusionSegmentsMap.ProtoReflect.Descriptor instead. func (*InclusionSegmentsMap) Descriptor() ([]byte, []int) { - return file_ceremony_proto_rawDescGZIP(), []int{19} + return file_ceremony_proto_rawDescGZIP(), []int{20} } func (x *InclusionSegmentsMap) GetHash() []byte { @@ -1506,7 +1584,7 @@ type InclusionCommitmentsMap struct { func (x *InclusionCommitmentsMap) Reset() { *x = InclusionCommitmentsMap{} if protoimpl.UnsafeEnabled { - mi := &file_ceremony_proto_msgTypes[20] + mi := &file_ceremony_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1519,7 +1597,7 @@ func (x *InclusionCommitmentsMap) String() string { func (*InclusionCommitmentsMap) ProtoMessage() {} func (x *InclusionCommitmentsMap) ProtoReflect() protoreflect.Message { - mi := &file_ceremony_proto_msgTypes[20] + mi := &file_ceremony_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1532,7 +1610,7 @@ func (x *InclusionCommitmentsMap) ProtoReflect() protoreflect.Message { // Deprecated: Use InclusionCommitmentsMap.ProtoReflect.Descriptor instead. func (*InclusionCommitmentsMap) Descriptor() ([]byte, []int) { - return file_ceremony_proto_rawDescGZIP(), []int{20} + return file_ceremony_proto_rawDescGZIP(), []int{21} } func (x *InclusionCommitmentsMap) GetCommitment() []byte { @@ -1893,88 +1971,104 @@ var file_ceremony_proto_rawDesc = []byte{ 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x79, 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, 0xd0, 0x01, 0x0a, 0x24, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x79, - 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, + 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, 0xb2, 0x02, + 0x0a, 0x24, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x79, 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, 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, 0x60, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, + 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x65, 0x72, 0x65, 0x6d, + 0x6f, 0x6e, 0x79, 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, 0xda, 0x01, 0x0a, 0x25, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x79, 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, 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, 0x42, 0x0e, 0x0a, 0x0c, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xda, 0x01, 0x0a, 0x25, 0x43, 0x65, 0x72, 0x65, 0x6d, - 0x6f, 0x6e, 0x79, 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, 0x51, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, - 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x79, 0x2e, 0x70, 0x62, - 0x2e, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x79, 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, 0xa5, 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, 0x56, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, - 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x65, 0x72, 0x65, 0x6d, - 0x6f, 0x6e, 0x79, 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, 0x32, 0xb6, 0x03, 0x0a, 0x0f, 0x43, 0x65, 0x72, - 0x65, 0x6d, 0x6f, 0x6e, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7e, 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, 0x33, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, - 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x79, - 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x79, 0x43, 0x6f, 0x6d, 0x70, - 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x53, 0x79, 0x6e, 0x63, 0x30, 0x01, 0x12, 0xaa, 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, 0x41, + 0x00, 0x52, 0x09, 0x70, 0x72, 0x65, 0x66, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x12, 0x51, 0x0a, 0x08, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x79, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x79, 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, 0x42, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, + 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, + 0xa5, 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, + 0x56, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, + 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x79, 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, 0x32, 0xb6, 0x03, 0x0a, 0x0f, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, + 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7e, 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, 0x33, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x79, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x79, 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, + 0x65, 0x64, 0x53, 0x79, 0x6e, 0x63, 0x30, 0x01, 0x12, 0xaa, 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, 0x41, 0x2e, 0x71, 0x75, 0x69, + 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x65, 0x72, + 0x65, 0x6d, 0x6f, 0x6e, 0x79, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, + 0x79, 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, 0x42, 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, 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, + 0x63, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x79, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x65, 0x72, 0x65, + 0x6d, 0x6f, 0x6e, 0x79, 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, 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 ( @@ -1989,7 +2083,7 @@ func file_ceremony_proto_rawDescGZIP() []byte { return file_ceremony_proto_rawDescData } -var file_ceremony_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_ceremony_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_ceremony_proto_goTypes = []interface{}{ (*CeremonyTranscript)(nil), // 0: quilibrium.node.ceremony.pb.CeremonyTranscript (*CeremonyLobbyState)(nil), // 1: quilibrium.node.ceremony.pb.CeremonyLobbyState @@ -2007,83 +2101,86 @@ var file_ceremony_proto_goTypes = []interface{}{ (*CeremonyPeerListAnnounce)(nil), // 13: quilibrium.node.ceremony.pb.CeremonyPeerListAnnounce (*CeremonyPeer)(nil), // 14: quilibrium.node.ceremony.pb.CeremonyPeer (*CeremonyCompressedSync)(nil), // 15: quilibrium.node.ceremony.pb.CeremonyCompressedSync - (*CeremonyCompressedSyncRequestMessage)(nil), // 16: quilibrium.node.ceremony.pb.CeremonyCompressedSyncRequestMessage - (*CeremonyCompressedSyncResponseMessage)(nil), // 17: quilibrium.node.ceremony.pb.CeremonyCompressedSyncResponseMessage - (*InclusionProofsMap)(nil), // 18: quilibrium.node.ceremony.pb.InclusionProofsMap - (*InclusionSegmentsMap)(nil), // 19: quilibrium.node.ceremony.pb.InclusionSegmentsMap - (*InclusionCommitmentsMap)(nil), // 20: quilibrium.node.ceremony.pb.InclusionCommitmentsMap - (*BLS48581G1PublicKey)(nil), // 21: quilibrium.node.keys.pb.BLS48581G1PublicKey - (*BLS48581G2PublicKey)(nil), // 22: quilibrium.node.keys.pb.BLS48581G2PublicKey - (*Ed448PublicKey)(nil), // 23: quilibrium.node.keys.pb.Ed448PublicKey - (*Ed448Signature)(nil), // 24: quilibrium.node.keys.pb.Ed448Signature - (*BLS48581Signature)(nil), // 25: quilibrium.node.keys.pb.BLS48581Signature - (*X448PublicKey)(nil), // 26: quilibrium.node.keys.pb.X448PublicKey - (*ClockFrame)(nil), // 27: quilibrium.node.clock.pb.ClockFrame - (*ClockFramesPreflight)(nil), // 28: quilibrium.node.clock.pb.ClockFramesPreflight - (*ClockFramesRequest)(nil), // 29: quilibrium.node.clock.pb.ClockFramesRequest - (*P2PChannelEnvelope)(nil), // 30: quilibrium.node.channel.pb.P2PChannelEnvelope + (*SyncRequestAuthentication)(nil), // 16: quilibrium.node.ceremony.pb.SyncRequestAuthentication + (*CeremonyCompressedSyncRequestMessage)(nil), // 17: quilibrium.node.ceremony.pb.CeremonyCompressedSyncRequestMessage + (*CeremonyCompressedSyncResponseMessage)(nil), // 18: quilibrium.node.ceremony.pb.CeremonyCompressedSyncResponseMessage + (*InclusionProofsMap)(nil), // 19: quilibrium.node.ceremony.pb.InclusionProofsMap + (*InclusionSegmentsMap)(nil), // 20: quilibrium.node.ceremony.pb.InclusionSegmentsMap + (*InclusionCommitmentsMap)(nil), // 21: quilibrium.node.ceremony.pb.InclusionCommitmentsMap + (*BLS48581G1PublicKey)(nil), // 22: quilibrium.node.keys.pb.BLS48581G1PublicKey + (*BLS48581G2PublicKey)(nil), // 23: quilibrium.node.keys.pb.BLS48581G2PublicKey + (*Ed448PublicKey)(nil), // 24: quilibrium.node.keys.pb.Ed448PublicKey + (*Ed448Signature)(nil), // 25: quilibrium.node.keys.pb.Ed448Signature + (*BLS48581Signature)(nil), // 26: quilibrium.node.keys.pb.BLS48581Signature + (*X448PublicKey)(nil), // 27: quilibrium.node.keys.pb.X448PublicKey + (*ClockFrame)(nil), // 28: quilibrium.node.clock.pb.ClockFrame + (*ClockFramesPreflight)(nil), // 29: quilibrium.node.clock.pb.ClockFramesPreflight + (*ClockFramesRequest)(nil), // 30: quilibrium.node.clock.pb.ClockFramesRequest + (*P2PChannelEnvelope)(nil), // 31: quilibrium.node.channel.pb.P2PChannelEnvelope } var file_ceremony_proto_depIdxs = []int32{ - 21, // 0: quilibrium.node.ceremony.pb.CeremonyTranscript.g1_powers:type_name -> quilibrium.node.keys.pb.BLS48581G1PublicKey - 22, // 1: quilibrium.node.ceremony.pb.CeremonyTranscript.g2_powers:type_name -> quilibrium.node.keys.pb.BLS48581G2PublicKey - 21, // 2: quilibrium.node.ceremony.pb.CeremonyTranscript.running_g1_256_witnesses:type_name -> quilibrium.node.keys.pb.BLS48581G1PublicKey - 22, // 3: quilibrium.node.ceremony.pb.CeremonyTranscript.running_g2_256_powers:type_name -> quilibrium.node.keys.pb.BLS48581G2PublicKey + 22, // 0: quilibrium.node.ceremony.pb.CeremonyTranscript.g1_powers:type_name -> quilibrium.node.keys.pb.BLS48581G1PublicKey + 23, // 1: quilibrium.node.ceremony.pb.CeremonyTranscript.g2_powers:type_name -> quilibrium.node.keys.pb.BLS48581G2PublicKey + 22, // 2: quilibrium.node.ceremony.pb.CeremonyTranscript.running_g1_256_witnesses:type_name -> quilibrium.node.keys.pb.BLS48581G1PublicKey + 23, // 3: quilibrium.node.ceremony.pb.CeremonyTranscript.running_g2_256_powers:type_name -> quilibrium.node.keys.pb.BLS48581G2PublicKey 9, // 4: quilibrium.node.ceremony.pb.CeremonyLobbyState.ceremony_open_state:type_name -> quilibrium.node.ceremony.pb.CeremonyOpenState 10, // 5: quilibrium.node.ceremony.pb.CeremonyLobbyState.ceremony_in_progress_state:type_name -> quilibrium.node.ceremony.pb.CeremonyInProgressState 11, // 6: quilibrium.node.ceremony.pb.CeremonyLobbyState.ceremony_finalizing_state:type_name -> quilibrium.node.ceremony.pb.CeremonyFinalizingState 12, // 7: quilibrium.node.ceremony.pb.CeremonyLobbyState.ceremony_validating_state:type_name -> quilibrium.node.ceremony.pb.CeremonyValidatingState 0, // 8: quilibrium.node.ceremony.pb.CeremonyLobbyState.latest_transcript:type_name -> quilibrium.node.ceremony.pb.CeremonyTranscript - 23, // 9: quilibrium.node.ceremony.pb.CeremonySeenProverAttestation.seen_prover_key:type_name -> quilibrium.node.keys.pb.Ed448PublicKey - 24, // 10: quilibrium.node.ceremony.pb.CeremonySeenProverAttestation.prover_signature:type_name -> quilibrium.node.keys.pb.Ed448Signature - 23, // 11: quilibrium.node.ceremony.pb.CeremonyDroppedProverAttestation.dropped_prover_key:type_name -> quilibrium.node.keys.pb.Ed448PublicKey - 24, // 12: quilibrium.node.ceremony.pb.CeremonyDroppedProverAttestation.prover_signature:type_name -> quilibrium.node.keys.pb.Ed448Signature - 21, // 13: quilibrium.node.ceremony.pb.CeremonyTranscriptShare.additive_g1_powers:type_name -> quilibrium.node.keys.pb.BLS48581G1PublicKey - 22, // 14: quilibrium.node.ceremony.pb.CeremonyTranscriptShare.additive_g2_powers:type_name -> quilibrium.node.keys.pb.BLS48581G2PublicKey - 21, // 15: quilibrium.node.ceremony.pb.CeremonyTranscriptShare.additive_g1_256_witness:type_name -> quilibrium.node.keys.pb.BLS48581G1PublicKey - 22, // 16: quilibrium.node.ceremony.pb.CeremonyTranscriptShare.additive_g2_256_witness:type_name -> quilibrium.node.keys.pb.BLS48581G2PublicKey - 24, // 17: quilibrium.node.ceremony.pb.CeremonyTranscriptShare.prover_signature:type_name -> quilibrium.node.keys.pb.Ed448Signature - 24, // 18: quilibrium.node.ceremony.pb.CeremonyTranscriptCommit.prover_signature:type_name -> quilibrium.node.keys.pb.Ed448Signature - 25, // 19: quilibrium.node.ceremony.pb.CeremonyTranscriptCommit.contribution_signature:type_name -> quilibrium.node.keys.pb.BLS48581Signature + 24, // 9: quilibrium.node.ceremony.pb.CeremonySeenProverAttestation.seen_prover_key:type_name -> quilibrium.node.keys.pb.Ed448PublicKey + 25, // 10: quilibrium.node.ceremony.pb.CeremonySeenProverAttestation.prover_signature:type_name -> quilibrium.node.keys.pb.Ed448Signature + 24, // 11: quilibrium.node.ceremony.pb.CeremonyDroppedProverAttestation.dropped_prover_key:type_name -> quilibrium.node.keys.pb.Ed448PublicKey + 25, // 12: quilibrium.node.ceremony.pb.CeremonyDroppedProverAttestation.prover_signature:type_name -> quilibrium.node.keys.pb.Ed448Signature + 22, // 13: quilibrium.node.ceremony.pb.CeremonyTranscriptShare.additive_g1_powers:type_name -> quilibrium.node.keys.pb.BLS48581G1PublicKey + 23, // 14: quilibrium.node.ceremony.pb.CeremonyTranscriptShare.additive_g2_powers:type_name -> quilibrium.node.keys.pb.BLS48581G2PublicKey + 22, // 15: quilibrium.node.ceremony.pb.CeremonyTranscriptShare.additive_g1_256_witness:type_name -> quilibrium.node.keys.pb.BLS48581G1PublicKey + 23, // 16: quilibrium.node.ceremony.pb.CeremonyTranscriptShare.additive_g2_256_witness:type_name -> quilibrium.node.keys.pb.BLS48581G2PublicKey + 25, // 17: quilibrium.node.ceremony.pb.CeremonyTranscriptShare.prover_signature:type_name -> quilibrium.node.keys.pb.Ed448Signature + 25, // 18: quilibrium.node.ceremony.pb.CeremonyTranscriptCommit.prover_signature:type_name -> quilibrium.node.keys.pb.Ed448Signature + 26, // 19: quilibrium.node.ceremony.pb.CeremonyTranscriptCommit.contribution_signature:type_name -> quilibrium.node.keys.pb.BLS48581Signature 5, // 20: quilibrium.node.ceremony.pb.CeremonyAdvanceRound.commits:type_name -> quilibrium.node.ceremony.pb.CeremonyTranscriptCommit - 26, // 21: quilibrium.node.ceremony.pb.CeremonyLobbyJoin.identity_key:type_name -> quilibrium.node.keys.pb.X448PublicKey - 26, // 22: quilibrium.node.ceremony.pb.CeremonyLobbyJoin.signed_pre_key:type_name -> quilibrium.node.keys.pb.X448PublicKey - 24, // 23: quilibrium.node.ceremony.pb.CeremonyLobbyJoin.public_key_signature_ed448:type_name -> quilibrium.node.keys.pb.Ed448Signature + 27, // 21: quilibrium.node.ceremony.pb.CeremonyLobbyJoin.identity_key:type_name -> quilibrium.node.keys.pb.X448PublicKey + 27, // 22: quilibrium.node.ceremony.pb.CeremonyLobbyJoin.signed_pre_key:type_name -> quilibrium.node.keys.pb.X448PublicKey + 25, // 23: quilibrium.node.ceremony.pb.CeremonyLobbyJoin.public_key_signature_ed448:type_name -> quilibrium.node.keys.pb.Ed448Signature 7, // 24: quilibrium.node.ceremony.pb.CeremonyOpenState.joined_participants:type_name -> quilibrium.node.ceremony.pb.CeremonyLobbyJoin - 23, // 25: quilibrium.node.ceremony.pb.CeremonyOpenState.preferred_participants:type_name -> quilibrium.node.keys.pb.Ed448PublicKey + 24, // 25: quilibrium.node.ceremony.pb.CeremonyOpenState.preferred_participants:type_name -> quilibrium.node.keys.pb.Ed448PublicKey 7, // 26: quilibrium.node.ceremony.pb.CeremonyInProgressState.active_participants:type_name -> quilibrium.node.ceremony.pb.CeremonyLobbyJoin 2, // 27: quilibrium.node.ceremony.pb.CeremonyInProgressState.latest_seen_prover_attestations:type_name -> quilibrium.node.ceremony.pb.CeremonySeenProverAttestation 3, // 28: quilibrium.node.ceremony.pb.CeremonyInProgressState.dropped_participant_attestations:type_name -> quilibrium.node.ceremony.pb.CeremonyDroppedProverAttestation 6, // 29: quilibrium.node.ceremony.pb.CeremonyInProgressState.transcript_round_advance_commits:type_name -> quilibrium.node.ceremony.pb.CeremonyAdvanceRound - 23, // 30: quilibrium.node.ceremony.pb.CeremonyInProgressState.next_round_participants:type_name -> quilibrium.node.keys.pb.Ed448PublicKey + 24, // 30: quilibrium.node.ceremony.pb.CeremonyInProgressState.next_round_participants:type_name -> quilibrium.node.keys.pb.Ed448PublicKey 7, // 31: quilibrium.node.ceremony.pb.CeremonyFinalizingState.active_participants:type_name -> quilibrium.node.ceremony.pb.CeremonyLobbyJoin 2, // 32: quilibrium.node.ceremony.pb.CeremonyFinalizingState.latest_seen_prover_attestations:type_name -> quilibrium.node.ceremony.pb.CeremonySeenProverAttestation 3, // 33: quilibrium.node.ceremony.pb.CeremonyFinalizingState.dropped_participant_attestations:type_name -> quilibrium.node.ceremony.pb.CeremonyDroppedProverAttestation 5, // 34: quilibrium.node.ceremony.pb.CeremonyFinalizingState.commits:type_name -> quilibrium.node.ceremony.pb.CeremonyTranscriptCommit 4, // 35: quilibrium.node.ceremony.pb.CeremonyFinalizingState.shares:type_name -> quilibrium.node.ceremony.pb.CeremonyTranscriptShare - 23, // 36: quilibrium.node.ceremony.pb.CeremonyFinalizingState.next_round_participants:type_name -> quilibrium.node.keys.pb.Ed448PublicKey + 24, // 36: quilibrium.node.ceremony.pb.CeremonyFinalizingState.next_round_participants:type_name -> quilibrium.node.keys.pb.Ed448PublicKey 5, // 37: quilibrium.node.ceremony.pb.CeremonyValidatingState.commits:type_name -> quilibrium.node.ceremony.pb.CeremonyTranscriptCommit 0, // 38: quilibrium.node.ceremony.pb.CeremonyValidatingState.updated_transcript:type_name -> quilibrium.node.ceremony.pb.CeremonyTranscript - 23, // 39: quilibrium.node.ceremony.pb.CeremonyValidatingState.next_round_participants:type_name -> quilibrium.node.keys.pb.Ed448PublicKey + 24, // 39: quilibrium.node.ceremony.pb.CeremonyValidatingState.next_round_participants:type_name -> quilibrium.node.keys.pb.Ed448PublicKey 14, // 40: quilibrium.node.ceremony.pb.CeremonyPeerListAnnounce.peer_list:type_name -> quilibrium.node.ceremony.pb.CeremonyPeer - 27, // 41: quilibrium.node.ceremony.pb.CeremonyCompressedSync.truncated_clock_frames:type_name -> quilibrium.node.clock.pb.ClockFrame - 18, // 42: quilibrium.node.ceremony.pb.CeremonyCompressedSync.proofs:type_name -> quilibrium.node.ceremony.pb.InclusionProofsMap - 19, // 43: quilibrium.node.ceremony.pb.CeremonyCompressedSync.segments:type_name -> quilibrium.node.ceremony.pb.InclusionSegmentsMap - 28, // 44: quilibrium.node.ceremony.pb.CeremonyCompressedSyncRequestMessage.preflight:type_name -> quilibrium.node.clock.pb.ClockFramesPreflight - 29, // 45: quilibrium.node.ceremony.pb.CeremonyCompressedSyncRequestMessage.request:type_name -> quilibrium.node.clock.pb.ClockFramesRequest - 28, // 46: quilibrium.node.ceremony.pb.CeremonyCompressedSyncResponseMessage.preflight:type_name -> quilibrium.node.clock.pb.ClockFramesPreflight - 15, // 47: quilibrium.node.ceremony.pb.CeremonyCompressedSyncResponseMessage.response:type_name -> quilibrium.node.ceremony.pb.CeremonyCompressedSync - 20, // 48: quilibrium.node.ceremony.pb.InclusionProofsMap.commitments:type_name -> quilibrium.node.ceremony.pb.InclusionCommitmentsMap - 29, // 49: quilibrium.node.ceremony.pb.CeremonyService.GetCompressedSyncFrames:input_type -> quilibrium.node.clock.pb.ClockFramesRequest - 16, // 50: quilibrium.node.ceremony.pb.CeremonyService.NegotiateCompressedSyncFrames:input_type -> quilibrium.node.ceremony.pb.CeremonyCompressedSyncRequestMessage - 30, // 51: quilibrium.node.ceremony.pb.CeremonyService.GetPublicChannel:input_type -> quilibrium.node.channel.pb.P2PChannelEnvelope - 15, // 52: quilibrium.node.ceremony.pb.CeremonyService.GetCompressedSyncFrames:output_type -> quilibrium.node.ceremony.pb.CeremonyCompressedSync - 17, // 53: quilibrium.node.ceremony.pb.CeremonyService.NegotiateCompressedSyncFrames:output_type -> quilibrium.node.ceremony.pb.CeremonyCompressedSyncResponseMessage - 30, // 54: quilibrium.node.ceremony.pb.CeremonyService.GetPublicChannel:output_type -> quilibrium.node.channel.pb.P2PChannelEnvelope - 52, // [52:55] is the sub-list for method output_type - 49, // [49:52] is the sub-list for method input_type - 49, // [49:49] is the sub-list for extension type_name - 49, // [49:49] is the sub-list for extension extendee - 0, // [0:49] is the sub-list for field type_name + 28, // 41: quilibrium.node.ceremony.pb.CeremonyCompressedSync.truncated_clock_frames:type_name -> quilibrium.node.clock.pb.ClockFrame + 19, // 42: quilibrium.node.ceremony.pb.CeremonyCompressedSync.proofs:type_name -> quilibrium.node.ceremony.pb.InclusionProofsMap + 20, // 43: quilibrium.node.ceremony.pb.CeremonyCompressedSync.segments:type_name -> quilibrium.node.ceremony.pb.InclusionSegmentsMap + 25, // 44: quilibrium.node.ceremony.pb.SyncRequestAuthentication.response:type_name -> quilibrium.node.keys.pb.Ed448Signature + 29, // 45: quilibrium.node.ceremony.pb.CeremonyCompressedSyncRequestMessage.preflight:type_name -> quilibrium.node.clock.pb.ClockFramesPreflight + 30, // 46: quilibrium.node.ceremony.pb.CeremonyCompressedSyncRequestMessage.request:type_name -> quilibrium.node.clock.pb.ClockFramesRequest + 16, // 47: quilibrium.node.ceremony.pb.CeremonyCompressedSyncRequestMessage.authentication:type_name -> quilibrium.node.ceremony.pb.SyncRequestAuthentication + 29, // 48: quilibrium.node.ceremony.pb.CeremonyCompressedSyncResponseMessage.preflight:type_name -> quilibrium.node.clock.pb.ClockFramesPreflight + 15, // 49: quilibrium.node.ceremony.pb.CeremonyCompressedSyncResponseMessage.response:type_name -> quilibrium.node.ceremony.pb.CeremonyCompressedSync + 21, // 50: quilibrium.node.ceremony.pb.InclusionProofsMap.commitments:type_name -> quilibrium.node.ceremony.pb.InclusionCommitmentsMap + 30, // 51: quilibrium.node.ceremony.pb.CeremonyService.GetCompressedSyncFrames:input_type -> quilibrium.node.clock.pb.ClockFramesRequest + 17, // 52: quilibrium.node.ceremony.pb.CeremonyService.NegotiateCompressedSyncFrames:input_type -> quilibrium.node.ceremony.pb.CeremonyCompressedSyncRequestMessage + 31, // 53: quilibrium.node.ceremony.pb.CeremonyService.GetPublicChannel:input_type -> quilibrium.node.channel.pb.P2PChannelEnvelope + 15, // 54: quilibrium.node.ceremony.pb.CeremonyService.GetCompressedSyncFrames:output_type -> quilibrium.node.ceremony.pb.CeremonyCompressedSync + 18, // 55: quilibrium.node.ceremony.pb.CeremonyService.NegotiateCompressedSyncFrames:output_type -> quilibrium.node.ceremony.pb.CeremonyCompressedSyncResponseMessage + 31, // 56: quilibrium.node.ceremony.pb.CeremonyService.GetPublicChannel:output_type -> quilibrium.node.channel.pb.P2PChannelEnvelope + 54, // [54:57] is the sub-list for method output_type + 51, // [51:54] is the sub-list for method input_type + 51, // [51:51] is the sub-list for extension type_name + 51, // [51:51] is the sub-list for extension extendee + 0, // [0:51] is the sub-list for field type_name } func init() { file_ceremony_proto_init() } @@ -2288,7 +2385,7 @@ func file_ceremony_proto_init() { } } file_ceremony_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CeremonyCompressedSyncRequestMessage); i { + switch v := v.(*SyncRequestAuthentication); i { case 0: return &v.state case 1: @@ -2300,7 +2397,7 @@ func file_ceremony_proto_init() { } } file_ceremony_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CeremonyCompressedSyncResponseMessage); i { + switch v := v.(*CeremonyCompressedSyncRequestMessage); i { case 0: return &v.state case 1: @@ -2312,7 +2409,7 @@ func file_ceremony_proto_init() { } } file_ceremony_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InclusionProofsMap); i { + switch v := v.(*CeremonyCompressedSyncResponseMessage); i { case 0: return &v.state case 1: @@ -2324,7 +2421,7 @@ func file_ceremony_proto_init() { } } file_ceremony_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InclusionSegmentsMap); i { + switch v := v.(*InclusionProofsMap); i { case 0: return &v.state case 1: @@ -2336,6 +2433,18 @@ func file_ceremony_proto_init() { } } file_ceremony_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InclusionSegmentsMap); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ceremony_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InclusionCommitmentsMap); i { case 0: return &v.state @@ -2354,11 +2463,12 @@ func file_ceremony_proto_init() { (*CeremonyLobbyState_CeremonyFinalizingState)(nil), (*CeremonyLobbyState_CeremonyValidatingState)(nil), } - file_ceremony_proto_msgTypes[16].OneofWrappers = []interface{}{ + file_ceremony_proto_msgTypes[17].OneofWrappers = []interface{}{ (*CeremonyCompressedSyncRequestMessage_Preflight)(nil), (*CeremonyCompressedSyncRequestMessage_Request)(nil), + (*CeremonyCompressedSyncRequestMessage_Authentication)(nil), } - file_ceremony_proto_msgTypes[17].OneofWrappers = []interface{}{ + file_ceremony_proto_msgTypes[18].OneofWrappers = []interface{}{ (*CeremonyCompressedSyncResponseMessage_Preflight)(nil), (*CeremonyCompressedSyncResponseMessage_Response)(nil), } @@ -2368,7 +2478,7 @@ func file_ceremony_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_ceremony_proto_rawDesc, NumEnums: 0, - NumMessages: 21, + NumMessages: 22, NumExtensions: 0, NumServices: 1, }, diff --git a/node/protobufs/ceremony.proto b/node/protobufs/ceremony.proto index 1f445e2..8b657f7 100644 --- a/node/protobufs/ceremony.proto +++ b/node/protobufs/ceremony.proto @@ -151,10 +151,17 @@ message CeremonyCompressedSync { repeated InclusionSegmentsMap segments = 5; } +message SyncRequestAuthentication { + bytes peer_id = 1; + bytes challenge = 2; + quilibrium.node.keys.pb.Ed448Signature response = 3; +} + message CeremonyCompressedSyncRequestMessage { oneof sync_message { quilibrium.node.clock.pb.ClockFramesPreflight preflight = 1; quilibrium.node.clock.pb.ClockFramesRequest request = 2; + SyncRequestAuthentication authentication = 3; } } diff --git a/node/store/clock.go b/node/store/clock.go index 6902068..1e4d0a5 100644 --- a/node/store/clock.go +++ b/node/store/clock.go @@ -1250,6 +1250,36 @@ func (p *PebbleClockStore) Compact( } if dataFilter != nil { + if err := p.db.Compact( + dataProofMetadataKey( + dataFilter, + make([]byte, 74), + ), + dataProofMetadataKey( + dataFilter, + bytes.Repeat([]byte{0xff}, 74), + ), + true, + ); err != nil { + return errors.Wrap(err, "compact") + } + + if err := p.db.Compact( + dataProofInclusionKey( + dataFilter, + make([]byte, 74), + 0, + ), + dataProofInclusionKey( + dataFilter, + bytes.Repeat([]byte{0xff}, 74), + 20000, + ), + true, + ); err != nil { + return errors.Wrap(err, "compact") + } + if err := p.db.DeleteRange( clockDataCandidateFrameKey( dataFilter, diff --git a/node/store/data_proof.go b/node/store/data_proof.go index ec3722c..5d855c8 100644 --- a/node/store/data_proof.go +++ b/node/store/data_proof.go @@ -25,10 +25,11 @@ type DataProofStore interface { txn Transaction, aggregateProof *protobufs.InclusionAggregateProof, commitment []byte, - inclusionSplitter func(typeUrl string, data []byte) ([][]byte, error), ) error } +var _ DataProofStore = (*PebbleDataProofStore)(nil) + type PebbleDataProofStore struct { db KVDB logger *zap.Logger