diff --git a/pkg/api/publish_test.go b/pkg/api/publish_test.go index c8dfc957..c709ad1f 100644 --- a/pkg/api/publish_test.go +++ b/pkg/api/publish_test.go @@ -17,10 +17,10 @@ func TestPublishEnvelope(t *testing.T) { api, db, cleanup := apiTestUtils.NewTestAPIClient(t) defer cleanup() - resp, err := api.PublishEnvelope( + resp, err := api.PublishEnvelopes( context.Background(), - &message_api.PublishEnvelopeRequest{ - PayerEnvelope: testutils.CreatePayerEnvelope(t), + &message_api.PublishEnvelopesRequest{ + PayerEnvelopes: []*message_api.PayerEnvelope{testutils.CreatePayerEnvelope(t)}, }, ) require.NoError(t, err) @@ -29,7 +29,10 @@ func TestPublishEnvelope(t *testing.T) { unsignedEnv := &message_api.UnsignedOriginatorEnvelope{} require.NoError( t, - proto.Unmarshal(resp.GetOriginatorEnvelope().GetUnsignedOriginatorEnvelope(), unsignedEnv), + proto.Unmarshal( + resp.GetOriginatorEnvelopes()[0].GetUnsignedOriginatorEnvelope(), + unsignedEnv, + ), ) clientEnv := &message_api.ClientEnvelope{} require.NoError( @@ -50,7 +53,7 @@ func TestPublishEnvelope(t *testing.T) { originatorEnv := &message_api.OriginatorEnvelope{} require.NoError(t, proto.Unmarshal(envs[0].OriginatorEnvelope, originatorEnv)) - return proto.Equal(originatorEnv, resp.GetOriginatorEnvelope()) + return proto.Equal(originatorEnv, resp.GetOriginatorEnvelopes()[0]) }, 500*time.Millisecond, 50*time.Millisecond) } @@ -60,10 +63,10 @@ func TestUnmarshalErrorOnPublish(t *testing.T) { envelope := testutils.CreatePayerEnvelope(t) envelope.UnsignedClientEnvelope = []byte("invalidbytes") - _, err := api.PublishEnvelope( + _, err := api.PublishEnvelopes( context.Background(), - &message_api.PublishEnvelopeRequest{ - PayerEnvelope: envelope, + &message_api.PublishEnvelopesRequest{ + PayerEnvelopes: []*message_api.PayerEnvelope{envelope}, }, ) require.ErrorContains(t, err, "unmarshal") @@ -75,10 +78,12 @@ func TestMismatchingOriginatorOnPublish(t *testing.T) { clientEnv := testutils.CreateClientEnvelope() clientEnv.Aad.TargetOriginator = 2 - _, err := api.PublishEnvelope( + _, err := api.PublishEnvelopes( context.Background(), - &message_api.PublishEnvelopeRequest{ - PayerEnvelope: testutils.CreatePayerEnvelope(t, clientEnv), + &message_api.PublishEnvelopesRequest{ + PayerEnvelopes: []*message_api.PayerEnvelope{ + testutils.CreatePayerEnvelope(t, clientEnv), + }, }, ) require.ErrorContains(t, err, "originator") @@ -90,10 +95,12 @@ func TestMissingTopicOnPublish(t *testing.T) { clientEnv := testutils.CreateClientEnvelope() clientEnv.Aad.TargetTopic = nil - _, err := api.PublishEnvelope( + _, err := api.PublishEnvelopes( context.Background(), - &message_api.PublishEnvelopeRequest{ - PayerEnvelope: testutils.CreatePayerEnvelope(t, clientEnv), + &message_api.PublishEnvelopesRequest{ + PayerEnvelopes: []*message_api.PayerEnvelope{ + testutils.CreatePayerEnvelope(t, clientEnv), + }, }, ) require.ErrorContains(t, err, "topic") diff --git a/pkg/api/query_test.go b/pkg/api/query_test.go index cf0ef496..55cf6a1c 100644 --- a/pkg/api/query_test.go +++ b/pkg/api/query_test.go @@ -105,10 +105,8 @@ func TestQueryEnvelopesByOriginator(t *testing.T) { context.Background(), &message_api.QueryEnvelopesRequest{ Query: &message_api.EnvelopesQuery{ - Filter: &message_api.EnvelopesQuery_OriginatorNodeId{ - OriginatorNodeId: 2, - }, - LastSeen: nil, + OriginatorNodeIds: []uint32{2}, + LastSeen: nil, }, Limit: 0, }, @@ -126,7 +124,7 @@ func TestQueryEnvelopesByTopic(t *testing.T) { context.Background(), &message_api.QueryEnvelopesRequest{ Query: &message_api.EnvelopesQuery{ - Filter: &message_api.EnvelopesQuery_Topic{Topic: []byte("topicA")}, + Topics: [][]byte{[]byte("topicA")}, LastSeen: nil, }, Limit: 0, @@ -145,7 +143,6 @@ func TestQueryEnvelopesFromLastSeen(t *testing.T) { context.Background(), &message_api.QueryEnvelopesRequest{ Query: &message_api.EnvelopesQuery{ - Filter: nil, LastSeen: &message_api.VectorClock{NodeIdToSequenceId: map[uint32]uint64{1: 2}}, }, Limit: 0, @@ -164,9 +161,7 @@ func TestQueryEnvelopesWithEmptyResult(t *testing.T) { context.Background(), &message_api.QueryEnvelopesRequest{ Query: &message_api.EnvelopesQuery{ - Filter: &message_api.EnvelopesQuery_Topic{ - Topic: []byte("topicC"), - }, + Topics: [][]byte{[]byte("topicC")}, }, Limit: 0, }, diff --git a/pkg/api/service.go b/pkg/api/service.go index 6fab4c56..cd343afc 100644 --- a/pkg/api/service.go +++ b/pkg/api/service.go @@ -3,6 +3,7 @@ package api import ( "context" "database/sql" + "fmt" "github.com/xmtp/xmtpd/pkg/blockchain" "github.com/xmtp/xmtpd/pkg/db" @@ -21,6 +22,8 @@ import ( const ( maxRequestedRows uint32 = 1000 + maxQueriesPerRequest int = 10000 + maxTopicLength int = 128 maxVectorClockLength int = 100 ) @@ -68,11 +71,11 @@ func (s *Service) Close() { s.log.Info("closed") } -func (s *Service) BatchSubscribeEnvelopes( - req *message_api.BatchSubscribeEnvelopesRequest, - stream message_api.ReplicationApi_BatchSubscribeEnvelopesServer, +func (s *Service) SubscribeEnvelopes( + req *message_api.SubscribeEnvelopesRequest, + stream message_api.ReplicationApi_SubscribeEnvelopesServer, ) error { - log := s.log.With(zap.String("method", "batchSubscribe")) + log := s.log.With(zap.String("method", "subscribe")) // Send a header (any header) to fix an issue with Tonic based GRPC clients. // See: https://github.com/xmtp/libxmtp/pull/58 @@ -81,21 +84,17 @@ func (s *Service) BatchSubscribeEnvelopes( return status.Errorf(codes.Internal, "could not send header: %v", err) } - requests := req.GetRequests() - if len(requests) == 0 { - return status.Errorf(codes.InvalidArgument, "missing requests") - } - - ch, err := s.subscribeWorker.listen(stream.Context(), requests) - if err != nil { + query := req.GetQuery() + if err := s.validateQuery(query); err != nil { return status.Errorf(codes.InvalidArgument, "invalid subscription request: %v", err) } + ch := s.subscribeWorker.listen(stream.Context(), query) for { select { case envs, open := <-ch: if open { - err := stream.Send(&message_api.BatchSubscribeEnvelopesResponse{ + err := stream.Send(&message_api.SubscribeEnvelopesResponse{ Envelopes: envs, }) if err != nil { @@ -148,6 +147,38 @@ func (s *Service) QueryEnvelopes( }, nil } +func (s *Service) validateQuery( + query *message_api.EnvelopesQuery, +) error { + if query == nil { + return fmt.Errorf("missing query") + } + + topics := query.GetTopics() + originators := query.GetOriginatorNodeIds() + if len(topics) != 0 && len(originators) != 0 { + return fmt.Errorf( + "cannot filter by both topic and originator in same subscription request", + ) + } + + numQueries := len(topics) + len(originators) + if numQueries > maxQueriesPerRequest { + return fmt.Errorf( + "too many subscriptions: %d, consider subscribing to fewer topics or subscribing without a filter", + numQueries, + ) + } + + for _, topic := range topics { + if len(topic) == 0 || len(topic) > maxTopicLength { + return fmt.Errorf("invalid topic: %s", topic) + } + } + + return nil +} + func (s *Service) queryReqToDBParams( req *message_api.QueryEnvelopesRequest, ) (*queries.SelectGatewayEnvelopesParams, error) { @@ -160,19 +191,15 @@ func (s *Service) queryReqToDBParams( } query := req.GetQuery() - if query == nil { - return nil, status.Errorf(codes.InvalidArgument, "missing query") + if err := s.validateQuery(query); err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid query: %v", err) } - switch filter := query.GetFilter().(type) { - case *message_api.EnvelopesQuery_Topic: - if len(filter.Topic) == 0 { - return nil, status.Errorf(codes.InvalidArgument, "missing topic") - } - params.Topic = filter.Topic - case *message_api.EnvelopesQuery_OriginatorNodeId: - params.OriginatorNodeID = db.NullInt32(int32(filter.OriginatorNodeId)) - default: + // TODO(rich): Properly support batch queries + if len(query.GetTopics()) > 0 { + params.Topic = query.GetTopics()[0] + } else if len(query.GetOriginatorNodeIds()) > 0 { + params.OriginatorNodeID = db.NullInt32(int32(query.GetOriginatorNodeIds()[0])) } vc := query.GetLastSeen().GetNodeIdToSequenceId() @@ -193,11 +220,14 @@ func (s *Service) queryReqToDBParams( return ¶ms, nil } -func (s *Service) PublishEnvelope( +func (s *Service) PublishEnvelopes( ctx context.Context, - req *message_api.PublishEnvelopeRequest, -) (*message_api.PublishEnvelopeResponse, error) { - clientEnv, err := s.validatePayerInfo(req.GetPayerEnvelope()) + req *message_api.PublishEnvelopesRequest, +) (*message_api.PublishEnvelopesResponse, error) { + if len(req.GetPayerEnvelopes()) == 0 { + return nil, status.Errorf(codes.InvalidArgument, "missing payer envelope") + } + clientEnv, err := s.validatePayerInfo(req.GetPayerEnvelopes()[0]) if err != nil { return nil, err } @@ -212,10 +242,11 @@ func (s *Service) PublishEnvelope( return nil, err } if didPublish { - return &message_api.PublishEnvelopeResponse{}, nil + return &message_api.PublishEnvelopesResponse{}, nil } - payerBytes, err := proto.Marshal(req.GetPayerEnvelope()) + // TODO(rich): Properly support batch publishing + payerBytes, err := proto.Marshal(req.GetPayerEnvelopes()[0]) if err != nil { return nil, status.Errorf(codes.Internal, "could not marshal envelope: %v", err) } @@ -235,7 +266,9 @@ func (s *Service) PublishEnvelope( return nil, status.Errorf(codes.Internal, "could not sign envelope: %v", err) } - return &message_api.PublishEnvelopeResponse{OriginatorEnvelope: originatorEnv}, nil + return &message_api.PublishEnvelopesResponse{ + OriginatorEnvelopes: []*message_api.OriginatorEnvelope{originatorEnv}, + }, nil } func (s *Service) maybePublishToBlockchain( diff --git a/pkg/api/subscribeWorker.go b/pkg/api/subscribeWorker.go index 32ca4e24..a3802fd5 100644 --- a/pkg/api/subscribeWorker.go +++ b/pkg/api/subscribeWorker.go @@ -4,7 +4,6 @@ import ( "context" "database/sql" "encoding/hex" - "fmt" "sync" "time" @@ -16,11 +15,9 @@ import ( ) const ( - subscriptionBufferSize = 1024 - maxSubscriptionsPerClient = 10000 - SubscribeWorkerPollTime = 100 * time.Millisecond - subscribeWorkerPollRows = 10000 - maxTopicLength = 128 + subscriptionBufferSize = 1024 + SubscribeWorkerPollTime = 100 * time.Millisecond + subscribeWorkerPollRows = 10000 ) type listener struct { @@ -32,6 +29,38 @@ type listener struct { isGlobal bool } +func newListener( + ctx context.Context, + query *message_api.EnvelopesQuery, + ch chan<- []*message_api.OriginatorEnvelope, +) *listener { + l := &listener{ + ctx: ctx, + ch: ch, + topics: make(map[string]struct{}), + originators: make(map[uint32]struct{}), + isGlobal: false, + } + topics := query.GetTopics() + originators := query.GetOriginatorNodeIds() + + if len(topics) == 0 && len(originators) == 0 { + l.isGlobal = true + return l + } + + for _, topic := range topics { + topicStr := hex.EncodeToString(topic) + l.topics[topicStr] = struct{}{} + } + + for _, originator := range originators { + l.originators[originator] = struct{}{} + } + + return l +} + type listenerSet struct { sync.Map // map[*listener]struct{} } @@ -238,63 +267,18 @@ func (s *subscribeWorker) closeListener(l *listener) { func (s *subscribeWorker) listen( ctx context.Context, - requests []*message_api.BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest, -) (<-chan []*message_api.OriginatorEnvelope, error) { + query *message_api.EnvelopesQuery, +) <-chan []*message_api.OriginatorEnvelope { ch := make(chan []*message_api.OriginatorEnvelope, subscriptionBufferSize) - l := &listener{ - ctx: ctx, - ch: ch, - topics: make(map[string]struct{}), - originators: make(map[uint32]struct{}), - isGlobal: false, - } - - if len(requests) > maxSubscriptionsPerClient { - return nil, fmt.Errorf( - "too many subscriptions: %d, consider subscribing to fewer topics or subscribing without a filter", - len(requests), - ) - } - for _, req := range requests { - enum := req.GetQuery().GetFilter() - if enum == nil { - l.isGlobal = true - } - switch filter := enum.(type) { - case *message_api.EnvelopesQuery_Topic: - topic := hex.EncodeToString(filter.Topic) - if len(filter.Topic) == 0 || len(filter.Topic) > maxTopicLength { - return nil, fmt.Errorf("invalid topic: %s", topic) - } - if _, exists := l.topics[topic]; exists { - return nil, fmt.Errorf("multiple requests for same topic: %s", topic) - } - l.topics[topic] = struct{}{} - case *message_api.EnvelopesQuery_OriginatorNodeId: - if _, exists := l.originators[filter.OriginatorNodeId]; exists { - return nil, fmt.Errorf("multiple requests for same originator: %d", filter.OriginatorNodeId) - } - l.originators[filter.OriginatorNodeId] = struct{}{} - default: - l.isGlobal = true - } - } + l := newListener(ctx, query, ch) if l.isGlobal { - if len(l.topics) > 0 || len(l.originators) > 0 { - return nil, fmt.Errorf( - "cannot filter by topic or originator when subscribing to all", - ) - } s.globalListeners.Store(l, struct{}{}) } else if len(l.topics) > 0 { - if len(l.originators) > 0 { - return nil, fmt.Errorf("cannot filter by both topic and originator in same subscription request") - } s.topicListeners.addListener(l.topics, l) } else if len(l.originators) > 0 { s.originatorListeners.addListener(l.originators, l) } - return ch, nil + return ch } diff --git a/pkg/api/subscribe_test.go b/pkg/api/subscribe_test.go index f5f8a8bb..851eed6b 100644 --- a/pkg/api/subscribe_test.go +++ b/pkg/api/subscribe_test.go @@ -85,7 +85,7 @@ func insertAdditionalRows(t *testing.T, store *sql.DB, notifyChan ...chan bool) func validateUpdates( t *testing.T, - stream message_api.ReplicationApi_BatchSubscribeEnvelopesClient, + stream message_api.ReplicationApi_SubscribeEnvelopesClient, expectedIndices []int, ) { for i := 0; i < len(expectedIndices); { @@ -112,16 +112,11 @@ func TestSubscribeEnvelopesAll(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - stream, err := client.BatchSubscribeEnvelopes( + stream, err := client.SubscribeEnvelopes( ctx, - &message_api.BatchSubscribeEnvelopesRequest{ - Requests: []*message_api.BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest{ - { - Query: &message_api.EnvelopesQuery{ - Filter: nil, - LastSeen: nil, - }, - }, + &message_api.SubscribeEnvelopesRequest{ + Query: &message_api.EnvelopesQuery{ + LastSeen: nil, }, }, ) @@ -138,22 +133,12 @@ func TestSubscribeEnvelopesByTopic(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - stream, err := client.BatchSubscribeEnvelopes( + stream, err := client.SubscribeEnvelopes( ctx, - &message_api.BatchSubscribeEnvelopesRequest{ - Requests: []*message_api.BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest{ - { - Query: &message_api.EnvelopesQuery{ - Filter: &message_api.EnvelopesQuery_Topic{Topic: []byte("topicA")}, - LastSeen: nil, - }, - }, - { - Query: &message_api.EnvelopesQuery{ - Filter: &message_api.EnvelopesQuery_Topic{Topic: []byte("topicC")}, - LastSeen: nil, - }, - }, + &message_api.SubscribeEnvelopesRequest{ + Query: &message_api.EnvelopesQuery{ + Topics: [][]byte{[]byte("topicA"), []byte("topicC")}, + LastSeen: nil, }, }, ) @@ -170,22 +155,12 @@ func TestSubscribeEnvelopesByOriginator(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - stream, err := client.BatchSubscribeEnvelopes( + stream, err := client.SubscribeEnvelopes( ctx, - &message_api.BatchSubscribeEnvelopesRequest{ - Requests: []*message_api.BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest{ - { - Query: &message_api.EnvelopesQuery{ - Filter: &message_api.EnvelopesQuery_OriginatorNodeId{OriginatorNodeId: 1}, - LastSeen: nil, - }, - }, - { - Query: &message_api.EnvelopesQuery{ - Filter: &message_api.EnvelopesQuery_OriginatorNodeId{OriginatorNodeId: 3}, - LastSeen: nil, - }, - }, + &message_api.SubscribeEnvelopesRequest{ + Query: &message_api.EnvelopesQuery{ + OriginatorNodeIds: []uint32{1, 3}, + LastSeen: nil, }, }, ) @@ -202,46 +177,31 @@ func TestSimultaneousSubscriptions(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - stream1, err := client.BatchSubscribeEnvelopes( + stream1, err := client.SubscribeEnvelopes( ctx, - &message_api.BatchSubscribeEnvelopesRequest{ - Requests: []*message_api.BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest{ - { - Query: &message_api.EnvelopesQuery{ - Filter: nil, - LastSeen: nil, - }, - }, - }, + &message_api.SubscribeEnvelopesRequest{ + Query: &message_api.EnvelopesQuery{}, }, ) require.NoError(t, err) - stream2, err := client.BatchSubscribeEnvelopes( + stream2, err := client.SubscribeEnvelopes( ctx, - &message_api.BatchSubscribeEnvelopesRequest{ - Requests: []*message_api.BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest{ - { - Query: &message_api.EnvelopesQuery{ - Filter: &message_api.EnvelopesQuery_Topic{Topic: []byte("topicB")}, - LastSeen: nil, - }, - }, + &message_api.SubscribeEnvelopesRequest{ + Query: &message_api.EnvelopesQuery{ + Topics: [][]byte{[]byte("topicB")}, + LastSeen: nil, }, }, ) require.NoError(t, err) - stream3, err := client.BatchSubscribeEnvelopes( + stream3, err := client.SubscribeEnvelopes( ctx, - &message_api.BatchSubscribeEnvelopesRequest{ - Requests: []*message_api.BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest{ - { - Query: &message_api.EnvelopesQuery{ - Filter: &message_api.EnvelopesQuery_OriginatorNodeId{OriginatorNodeId: 2}, - LastSeen: nil, - }, - }, + &message_api.SubscribeEnvelopesRequest{ + Query: &message_api.EnvelopesQuery{ + OriginatorNodeIds: []uint32{2}, + LastSeen: nil, }, }, ) @@ -257,68 +217,13 @@ func TestSubscribeEnvelopesInvalidRequest(t *testing.T) { client, _, cleanup := setupTest(t) defer cleanup() - stream, err := client.BatchSubscribeEnvelopes( - context.Background(), - &message_api.BatchSubscribeEnvelopesRequest{ - Requests: []*message_api.BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest{ - { - Query: &message_api.EnvelopesQuery{ - Filter: &message_api.EnvelopesQuery_OriginatorNodeId{OriginatorNodeId: 1}, - LastSeen: nil, - }, - }, - { - Query: &message_api.EnvelopesQuery{ - Filter: nil, - LastSeen: nil, - }, - }, - }, - }, - ) - require.NoError(t, err) - _, err = stream.Recv() - require.Error(t, err) - - stream, err = client.BatchSubscribeEnvelopes( - context.Background(), - &message_api.BatchSubscribeEnvelopesRequest{ - Requests: []*message_api.BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest{ - { - Query: &message_api.EnvelopesQuery{ - Filter: nil, - LastSeen: nil, - }, - }, - { - Query: &message_api.EnvelopesQuery{ - Filter: &message_api.EnvelopesQuery_Topic{Topic: []byte("topicA")}, - LastSeen: nil, - }, - }, - }, - }, - ) - require.NoError(t, err) - _, err = stream.Recv() - require.Error(t, err) - - stream, err = client.BatchSubscribeEnvelopes( + stream, err := client.SubscribeEnvelopes( context.Background(), - &message_api.BatchSubscribeEnvelopesRequest{ - Requests: []*message_api.BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest{ - { - Query: &message_api.EnvelopesQuery{ - Filter: &message_api.EnvelopesQuery_OriginatorNodeId{OriginatorNodeId: 1}, - LastSeen: nil, - }, - }, - { - Query: &message_api.EnvelopesQuery{ - Filter: &message_api.EnvelopesQuery_Topic{Topic: []byte("topicA")}, - LastSeen: nil, - }, - }, + &message_api.SubscribeEnvelopesRequest{ + Query: &message_api.EnvelopesQuery{ + Topics: [][]byte{[]byte("topicA")}, + OriginatorNodeIds: []uint32{1}, + LastSeen: nil, }, }, ) diff --git a/pkg/proto/openapi/xmtpv4/message_api/message_api.swagger.json b/pkg/proto/openapi/xmtpv4/message_api/message_api.swagger.json index 581c8285..c630fe0b 100644 --- a/pkg/proto/openapi/xmtpv4/message_api/message_api.swagger.json +++ b/pkg/proto/openapi/xmtpv4/message_api/message_api.swagger.json @@ -49,15 +49,15 @@ ] } }, - "/mls/v2/publish-envelope": { + "/mls/v2/publish-envelopes": { "post": { "summary": "Publish envelope", - "operationId": "ReplicationApi_PublishEnvelope", + "operationId": "ReplicationApi_PublishEnvelopes", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/xmtpv4PublishEnvelopeResponse" + "$ref": "#/definitions/xmtpv4PublishEnvelopesResponse" } }, "default": { @@ -73,7 +73,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/xmtpv4PublishEnvelopeRequest" + "$ref": "#/definitions/xmtpv4PublishEnvelopesRequest" } } ], @@ -118,7 +118,7 @@ "/mls/v2/subscribe-envelopes": { "post": { "summary": "Subscribe to envelopes", - "operationId": "ReplicationApi_BatchSubscribeEnvelopes", + "operationId": "ReplicationApi_SubscribeEnvelopes", "responses": { "200": { "description": "A successful response.(streaming responses)", @@ -126,13 +126,13 @@ "type": "object", "properties": { "result": { - "$ref": "#/definitions/xmtpv4BatchSubscribeEnvelopesResponse" + "$ref": "#/definitions/xmtpv4SubscribeEnvelopesResponse" }, "error": { "$ref": "#/definitions/rpcStatus" } }, - "title": "Stream result of xmtpv4BatchSubscribeEnvelopesResponse" + "title": "Stream result of xmtpv4SubscribeEnvelopesResponse" } }, "default": { @@ -148,7 +148,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/xmtpv4BatchSubscribeEnvelopesRequest" + "$ref": "#/definitions/xmtpv4SubscribeEnvelopesRequest" } } ], @@ -159,15 +159,6 @@ } }, "definitions": { - "BatchSubscribeEnvelopesRequestSubscribeEnvelopesRequest": { - "type": "object", - "properties": { - "query": { - "$ref": "#/definitions/xmtpv4EnvelopesQuery" - } - }, - "title": "Single subscription request for envelopes" - }, "associationsRecoverableEcdsaSignature": { "type": "object", "properties": { @@ -207,32 +198,6 @@ } } }, - "xmtpv4BatchSubscribeEnvelopesRequest": { - "type": "object", - "properties": { - "requests": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/BatchSubscribeEnvelopesRequestSubscribeEnvelopesRequest" - } - } - }, - "title": "Batch subscribe to envelopes" - }, - "xmtpv4BatchSubscribeEnvelopesResponse": { - "type": "object", - "properties": { - "envelopes": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/xmtpv4OriginatorEnvelope" - } - } - }, - "title": "Streamed response for batch subscribe - can be multiple envelopes at once" - }, "xmtpv4BlockchainProof": { "type": "object", "properties": { @@ -250,21 +215,27 @@ "xmtpv4EnvelopesQuery": { "type": "object", "properties": { - "topic": { - "type": "string", - "format": "byte", + "topics": { + "type": "array", + "items": { + "type": "string", + "format": "byte" + }, "title": "Client queries" }, - "originatorNodeId": { - "type": "integer", - "format": "int64", + "originatorNodeIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, "title": "Node queries" }, "lastSeen": { "$ref": "#/definitions/xmtpv4VectorClock" } }, - "title": "Query for envelopes, shared by query and subscribe endpoints" + "title": "Query for envelopes, shared by query and subscribe endpoints\nEither topics or originator_node_ids may be set, but not both" }, "xmtpv4OriginatorEnvelope": { "type": "object", @@ -297,19 +268,27 @@ }, "title": "Wraps client envelope with payer signature" }, - "xmtpv4PublishEnvelopeRequest": { + "xmtpv4PublishEnvelopesRequest": { "type": "object", "properties": { - "payerEnvelope": { - "$ref": "#/definitions/xmtpv4PayerEnvelope" + "payerEnvelopes": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/xmtpv4PayerEnvelope" + } } } }, - "xmtpv4PublishEnvelopeResponse": { + "xmtpv4PublishEnvelopesResponse": { "type": "object", "properties": { - "originatorEnvelope": { - "$ref": "#/definitions/xmtpv4OriginatorEnvelope" + "originatorEnvelopes": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/xmtpv4OriginatorEnvelope" + } } } }, @@ -339,6 +318,28 @@ }, "title": "Query envelopes response" }, + "xmtpv4SubscribeEnvelopesRequest": { + "type": "object", + "properties": { + "query": { + "$ref": "#/definitions/xmtpv4EnvelopesQuery" + } + }, + "title": "Batch subscribe to envelopes" + }, + "xmtpv4SubscribeEnvelopesResponse": { + "type": "object", + "properties": { + "envelopes": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/xmtpv4OriginatorEnvelope" + } + } + }, + "title": "Streamed response for batch subscribe - can be multiple envelopes at once" + }, "xmtpv4VectorClock": { "type": "object", "properties": { diff --git a/pkg/proto/xmtpv4/message_api/message_api.pb.go b/pkg/proto/xmtpv4/message_api/message_api.pb.go index 2fde3be0..9e4ce21e 100644 --- a/pkg/proto/xmtpv4/message_api/message_api.pb.go +++ b/pkg/proto/xmtpv4/message_api/message_api.pb.go @@ -655,17 +655,17 @@ func (x *MisbehaviorReport) GetEnvelopes() []*OriginatorEnvelope { } // Query for envelopes, shared by query and subscribe endpoints +// Either topics or originator_node_ids may be set, but not both type EnvelopesQuery struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Types that are assignable to Filter: - // - // *EnvelopesQuery_Topic - // *EnvelopesQuery_OriginatorNodeId - Filter isEnvelopesQuery_Filter `protobuf_oneof:"filter"` - LastSeen *VectorClock `protobuf:"bytes,3,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"` + // Client queries + Topics [][]byte `protobuf:"bytes,1,rep,name=topics,proto3" json:"topics,omitempty"` + // Node queries + OriginatorNodeIds []uint32 `protobuf:"varint,2,rep,packed,name=originator_node_ids,json=originatorNodeIds,proto3" json:"originator_node_ids,omitempty"` + LastSeen *VectorClock `protobuf:"bytes,3,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"` } func (x *EnvelopesQuery) Reset() { @@ -698,27 +698,20 @@ func (*EnvelopesQuery) Descriptor() ([]byte, []int) { return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{8} } -func (m *EnvelopesQuery) GetFilter() isEnvelopesQuery_Filter { - if m != nil { - return m.Filter +func (x *EnvelopesQuery) GetTopics() [][]byte { + if x != nil { + return x.Topics } return nil } -func (x *EnvelopesQuery) GetTopic() []byte { - if x, ok := x.GetFilter().(*EnvelopesQuery_Topic); ok { - return x.Topic +func (x *EnvelopesQuery) GetOriginatorNodeIds() []uint32 { + if x != nil { + return x.OriginatorNodeIds } return nil } -func (x *EnvelopesQuery) GetOriginatorNodeId() uint32 { - if x, ok := x.GetFilter().(*EnvelopesQuery_OriginatorNodeId); ok { - return x.OriginatorNodeId - } - return 0 -} - func (x *EnvelopesQuery) GetLastSeen() *VectorClock { if x != nil { return x.LastSeen @@ -726,47 +719,29 @@ func (x *EnvelopesQuery) GetLastSeen() *VectorClock { return nil } -type isEnvelopesQuery_Filter interface { - isEnvelopesQuery_Filter() -} - -type EnvelopesQuery_Topic struct { - // Client queries - Topic []byte `protobuf:"bytes,1,opt,name=topic,proto3,oneof"` -} - -type EnvelopesQuery_OriginatorNodeId struct { - // Node queries - OriginatorNodeId uint32 `protobuf:"varint,2,opt,name=originator_node_id,json=originatorNodeId,proto3,oneof"` -} - -func (*EnvelopesQuery_Topic) isEnvelopesQuery_Filter() {} - -func (*EnvelopesQuery_OriginatorNodeId) isEnvelopesQuery_Filter() {} - // Batch subscribe to envelopes -type BatchSubscribeEnvelopesRequest struct { +type SubscribeEnvelopesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Requests []*BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"` + Query *EnvelopesQuery `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` } -func (x *BatchSubscribeEnvelopesRequest) Reset() { - *x = BatchSubscribeEnvelopesRequest{} +func (x *SubscribeEnvelopesRequest) Reset() { + *x = SubscribeEnvelopesRequest{} mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *BatchSubscribeEnvelopesRequest) String() string { +func (x *SubscribeEnvelopesRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BatchSubscribeEnvelopesRequest) ProtoMessage() {} +func (*SubscribeEnvelopesRequest) ProtoMessage() {} -func (x *BatchSubscribeEnvelopesRequest) ProtoReflect() protoreflect.Message { +func (x *SubscribeEnvelopesRequest) ProtoReflect() protoreflect.Message { mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -778,20 +753,20 @@ func (x *BatchSubscribeEnvelopesRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use BatchSubscribeEnvelopesRequest.ProtoReflect.Descriptor instead. -func (*BatchSubscribeEnvelopesRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use SubscribeEnvelopesRequest.ProtoReflect.Descriptor instead. +func (*SubscribeEnvelopesRequest) Descriptor() ([]byte, []int) { return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{9} } -func (x *BatchSubscribeEnvelopesRequest) GetRequests() []*BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest { +func (x *SubscribeEnvelopesRequest) GetQuery() *EnvelopesQuery { if x != nil { - return x.Requests + return x.Query } return nil } // Streamed response for batch subscribe - can be multiple envelopes at once -type BatchSubscribeEnvelopesResponse struct { +type SubscribeEnvelopesResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -799,20 +774,20 @@ type BatchSubscribeEnvelopesResponse struct { Envelopes []*OriginatorEnvelope `protobuf:"bytes,1,rep,name=envelopes,proto3" json:"envelopes,omitempty"` } -func (x *BatchSubscribeEnvelopesResponse) Reset() { - *x = BatchSubscribeEnvelopesResponse{} +func (x *SubscribeEnvelopesResponse) Reset() { + *x = SubscribeEnvelopesResponse{} mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *BatchSubscribeEnvelopesResponse) String() string { +func (x *SubscribeEnvelopesResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BatchSubscribeEnvelopesResponse) ProtoMessage() {} +func (*SubscribeEnvelopesResponse) ProtoMessage() {} -func (x *BatchSubscribeEnvelopesResponse) ProtoReflect() protoreflect.Message { +func (x *SubscribeEnvelopesResponse) ProtoReflect() protoreflect.Message { mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -824,12 +799,12 @@ func (x *BatchSubscribeEnvelopesResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use BatchSubscribeEnvelopesResponse.ProtoReflect.Descriptor instead. -func (*BatchSubscribeEnvelopesResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use SubscribeEnvelopesResponse.ProtoReflect.Descriptor instead. +func (*SubscribeEnvelopesResponse) Descriptor() ([]byte, []int) { return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{10} } -func (x *BatchSubscribeEnvelopesResponse) GetEnvelopes() []*OriginatorEnvelope { +func (x *SubscribeEnvelopesResponse) GetEnvelopes() []*OriginatorEnvelope { if x != nil { return x.Envelopes } @@ -936,28 +911,28 @@ func (x *QueryEnvelopesResponse) GetEnvelopes() []*OriginatorEnvelope { return nil } -type PublishEnvelopeRequest struct { +type PublishEnvelopesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - PayerEnvelope *PayerEnvelope `protobuf:"bytes,1,opt,name=payer_envelope,json=payerEnvelope,proto3" json:"payer_envelope,omitempty"` + PayerEnvelopes []*PayerEnvelope `protobuf:"bytes,1,rep,name=payer_envelopes,json=payerEnvelopes,proto3" json:"payer_envelopes,omitempty"` } -func (x *PublishEnvelopeRequest) Reset() { - *x = PublishEnvelopeRequest{} +func (x *PublishEnvelopesRequest) Reset() { + *x = PublishEnvelopesRequest{} mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *PublishEnvelopeRequest) String() string { +func (x *PublishEnvelopesRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PublishEnvelopeRequest) ProtoMessage() {} +func (*PublishEnvelopesRequest) ProtoMessage() {} -func (x *PublishEnvelopeRequest) ProtoReflect() protoreflect.Message { +func (x *PublishEnvelopesRequest) ProtoReflect() protoreflect.Message { mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -969,40 +944,40 @@ func (x *PublishEnvelopeRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PublishEnvelopeRequest.ProtoReflect.Descriptor instead. -func (*PublishEnvelopeRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use PublishEnvelopesRequest.ProtoReflect.Descriptor instead. +func (*PublishEnvelopesRequest) Descriptor() ([]byte, []int) { return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{13} } -func (x *PublishEnvelopeRequest) GetPayerEnvelope() *PayerEnvelope { +func (x *PublishEnvelopesRequest) GetPayerEnvelopes() []*PayerEnvelope { if x != nil { - return x.PayerEnvelope + return x.PayerEnvelopes } return nil } -type PublishEnvelopeResponse struct { +type PublishEnvelopesResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - OriginatorEnvelope *OriginatorEnvelope `protobuf:"bytes,1,opt,name=originator_envelope,json=originatorEnvelope,proto3" json:"originator_envelope,omitempty"` + OriginatorEnvelopes []*OriginatorEnvelope `protobuf:"bytes,1,rep,name=originator_envelopes,json=originatorEnvelopes,proto3" json:"originator_envelopes,omitempty"` } -func (x *PublishEnvelopeResponse) Reset() { - *x = PublishEnvelopeResponse{} +func (x *PublishEnvelopesResponse) Reset() { + *x = PublishEnvelopesResponse{} mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *PublishEnvelopeResponse) String() string { +func (x *PublishEnvelopesResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PublishEnvelopeResponse) ProtoMessage() {} +func (*PublishEnvelopesResponse) ProtoMessage() {} -func (x *PublishEnvelopeResponse) ProtoReflect() protoreflect.Message { +func (x *PublishEnvelopesResponse) ProtoReflect() protoreflect.Message { mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1014,14 +989,14 @@ func (x *PublishEnvelopeResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PublishEnvelopeResponse.ProtoReflect.Descriptor instead. -func (*PublishEnvelopeResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use PublishEnvelopesResponse.ProtoReflect.Descriptor instead. +func (*PublishEnvelopesResponse) Descriptor() ([]byte, []int) { return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{14} } -func (x *PublishEnvelopeResponse) GetOriginatorEnvelope() *OriginatorEnvelope { +func (x *PublishEnvelopesResponse) GetOriginatorEnvelopes() []*OriginatorEnvelope { if x != nil { - return x.OriginatorEnvelope + return x.OriginatorEnvelopes } return nil } @@ -1118,52 +1093,6 @@ func (x *GetInboxIdsResponse) GetResponses() []*GetInboxIdsResponse_Response { return nil } -// Single subscription request for envelopes -type BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Query *EnvelopesQuery `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` -} - -func (x *BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest) Reset() { - *x = BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest) ProtoMessage() {} - -func (x *BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[18] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest.ProtoReflect.Descriptor instead. -func (*BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{9, 0} -} - -func (x *BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest) GetQuery() *EnvelopesQuery { - if x != nil { - return x.Query - } - return nil -} - // A single request for a given address type GetInboxIdsRequest_Request struct { state protoimpl.MessageState @@ -1175,7 +1104,7 @@ type GetInboxIdsRequest_Request struct { func (x *GetInboxIdsRequest_Request) Reset() { *x = GetInboxIdsRequest_Request{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[19] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1187,7 +1116,7 @@ func (x *GetInboxIdsRequest_Request) String() string { func (*GetInboxIdsRequest_Request) ProtoMessage() {} func (x *GetInboxIdsRequest_Request) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[19] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1222,7 +1151,7 @@ type GetInboxIdsResponse_Response struct { func (x *GetInboxIdsResponse_Response) Reset() { *x = GetInboxIdsResponse_Response{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[20] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1234,7 +1163,7 @@ func (x *GetInboxIdsResponse_Response) String() string { func (*GetInboxIdsResponse_Response) ProtoMessage() {} func (x *GetInboxIdsResponse_Response) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[20] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1395,138 +1324,129 @@ var file_xmtpv4_message_api_message_api_proto_rawDesc = []byte{ 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x09, 0x65, 0x6e, - 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x22, 0x99, 0x01, 0x0a, 0x0e, 0x45, 0x6e, 0x76, 0x65, - 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x05, 0x74, 0x6f, - 0x70, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x74, 0x6f, 0x70, - 0x69, 0x63, 0x12, 0x2e, 0x0a, 0x12, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, - 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, - 0x52, 0x10, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x4e, 0x6f, 0x64, 0x65, - 0x49, 0x64, 0x12, 0x35, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x65, 0x6e, 0x18, + 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x0e, 0x45, 0x6e, 0x76, 0x65, + 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x6f, + 0x70, 0x69, 0x63, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x74, 0x6f, 0x70, 0x69, + 0x63, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, + 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, + 0x11, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x49, + 0x64, 0x73, 0x12, 0x35, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x52, - 0x08, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x65, 0x6e, 0x42, 0x08, 0x0a, 0x06, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x22, 0xd3, 0x01, 0x0a, 0x1e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x53, 0x75, 0x62, - 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x61, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x45, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, - 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x53, 0x75, 0x62, 0x73, - 0x63, 0x72, 0x69, 0x62, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x45, - 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, - 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x1a, 0x4e, 0x0a, 0x19, 0x53, 0x75, 0x62, + 0x08, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x65, 0x6e, 0x22, 0x4e, 0x0a, 0x19, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x60, 0x0a, 0x1f, 0x42, 0x61, 0x74, - 0x63, 0x68, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, - 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x09, - 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1f, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x4f, 0x72, - 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, - 0x52, 0x09, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x22, 0x60, 0x0a, 0x15, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, - 0x34, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x57, 0x0a, - 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, + 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x5b, 0x0a, 0x1a, 0x53, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x09, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x09, 0x65, 0x6e, 0x76, - 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x22, 0x5b, 0x0a, 0x16, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, - 0x68, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x41, 0x0a, 0x0e, 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, - 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, - 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x50, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, 0x76, 0x65, - 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, - 0x6f, 0x70, 0x65, 0x22, 0x6b, 0x0a, 0x17, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x45, 0x6e, - 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, - 0x0a, 0x13, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x65, 0x6e, 0x76, - 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x6d, + 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x22, 0x60, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, + 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x31, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x45, 0x6e, 0x76, + 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x57, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x09, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, + 0x70, 0x76, 0x34, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, + 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x09, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, + 0x73, 0x22, 0x5e, 0x0a, 0x17, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x45, 0x6e, 0x76, 0x65, + 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x0f, + 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, + 0x70, 0x76, 0x34, 0x2e, 0x50, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, + 0x65, 0x52, 0x0e, 0x70, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, + 0x73, 0x22, 0x6e, 0x0a, 0x18, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x45, 0x6e, 0x76, 0x65, + 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, + 0x14, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x65, 0x6e, 0x76, 0x65, + 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x12, 0x6f, 0x72, + 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x13, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, - 0x22, 0x7e, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, - 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x49, - 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x1a, 0x23, 0x0a, 0x07, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x22, 0xb1, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x78, 0x6d, - 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, - 0x6f, 0x78, 0x49, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x73, 0x1a, 0x51, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1e, 0x0a, 0x08, 0x69, 0x6e, 0x62, 0x6f, 0x78, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x69, 0x6e, 0x62, - 0x6f, 0x78, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x69, 0x6e, 0x62, 0x6f, - 0x78, 0x5f, 0x69, 0x64, 0x2a, 0xce, 0x01, 0x0a, 0x0b, 0x4d, 0x69, 0x73, 0x62, 0x65, 0x68, 0x61, - 0x76, 0x69, 0x6f, 0x72, 0x12, 0x1b, 0x0a, 0x17, 0x4d, 0x49, 0x53, 0x42, 0x45, 0x48, 0x41, 0x56, - 0x49, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x20, 0x0a, 0x1c, 0x4d, 0x49, 0x53, 0x42, 0x45, 0x48, 0x41, 0x56, 0x49, 0x4f, 0x52, - 0x5f, 0x55, 0x4e, 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, 0x4c, 0x45, 0x5f, 0x4e, 0x4f, 0x44, - 0x45, 0x10, 0x01, 0x12, 0x2b, 0x0a, 0x27, 0x4d, 0x49, 0x53, 0x42, 0x45, 0x48, 0x41, 0x56, 0x49, - 0x4f, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, - 0x4f, 0x52, 0x49, 0x47, 0x49, 0x4e, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x53, 0x49, 0x44, 0x10, 0x02, - 0x12, 0x28, 0x0a, 0x24, 0x4d, 0x49, 0x53, 0x42, 0x45, 0x48, 0x41, 0x56, 0x49, 0x4f, 0x52, 0x5f, - 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x4f, 0x52, 0x49, 0x47, 0x49, 0x4e, - 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x53, 0x49, 0x44, 0x10, 0x03, 0x12, 0x29, 0x0a, 0x25, 0x4d, 0x49, - 0x53, 0x42, 0x45, 0x48, 0x41, 0x56, 0x49, 0x4f, 0x52, 0x5f, 0x43, 0x59, 0x43, 0x4c, 0x49, 0x43, - 0x41, 0x4c, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, 0x4f, 0x52, 0x44, 0x45, 0x52, - 0x49, 0x4e, 0x47, 0x10, 0x04, 0x32, 0xa8, 0x04, 0x0a, 0x0e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x70, 0x69, 0x12, 0x9e, 0x01, 0x0a, 0x17, 0x42, 0x61, 0x74, - 0x63, 0x68, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, - 0x6f, 0x70, 0x65, 0x73, 0x12, 0x2b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, - 0x76, 0x34, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, - 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2c, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, - 0x42, 0x61, 0x74, 0x63, 0x68, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x45, 0x6e, - 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x6d, 0x6c, 0x73, - 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2d, 0x65, 0x6e, - 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x30, 0x01, 0x12, 0x7d, 0x0a, 0x0e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x22, 0x2e, 0x78, 0x6d, - 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, - 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x23, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, - 0x17, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2d, 0x65, - 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x81, 0x01, 0x0a, 0x0f, 0x50, 0x75, 0x62, - 0x6c, 0x69, 0x73, 0x68, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x23, 0x2e, 0x78, - 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, - 0x73, 0x68, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x24, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, - 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, - 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x73, 0x68, 0x2d, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x72, 0x0a, 0x0b, - 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x73, 0x12, 0x1f, 0x2e, 0x78, 0x6d, - 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, - 0x6f, 0x78, 0x49, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x78, + 0x73, 0x22, 0x7e, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, + 0x49, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x1a, 0x23, 0x0a, 0x07, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x22, 0xb1, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x49, 0x64, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x09, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, - 0x62, 0x6f, 0x78, 0x49, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x3a, 0x01, 0x2a, 0x22, 0x15, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, - 0x76, 0x32, 0x2f, 0x67, 0x65, 0x74, 0x2d, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x2d, 0x69, 0x64, 0x73, - 0x42, 0xa3, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, - 0x74, 0x70, 0x76, 0x34, 0x42, 0x0f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x70, 0x69, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x64, 0x2f, 0x70, - 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2f, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0xa2, 0x02, 0x03, 0x58, 0x58, - 0x58, 0xaa, 0x02, 0x0b, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x58, 0x6d, 0x74, 0x70, 0x76, 0x34, 0xca, - 0x02, 0x0b, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x58, 0x6d, 0x74, 0x70, 0x76, 0x34, 0xe2, 0x02, 0x17, - 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x58, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, - 0x58, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x62, 0x6f, 0x78, 0x49, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x73, 0x1a, 0x51, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1e, 0x0a, 0x08, 0x69, 0x6e, 0x62, 0x6f, + 0x78, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x69, 0x6e, + 0x62, 0x6f, 0x78, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x69, 0x6e, 0x62, + 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x2a, 0xce, 0x01, 0x0a, 0x0b, 0x4d, 0x69, 0x73, 0x62, 0x65, 0x68, + 0x61, 0x76, 0x69, 0x6f, 0x72, 0x12, 0x1b, 0x0a, 0x17, 0x4d, 0x49, 0x53, 0x42, 0x45, 0x48, 0x41, + 0x56, 0x49, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x20, 0x0a, 0x1c, 0x4d, 0x49, 0x53, 0x42, 0x45, 0x48, 0x41, 0x56, 0x49, 0x4f, + 0x52, 0x5f, 0x55, 0x4e, 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, 0x4c, 0x45, 0x5f, 0x4e, 0x4f, + 0x44, 0x45, 0x10, 0x01, 0x12, 0x2b, 0x0a, 0x27, 0x4d, 0x49, 0x53, 0x42, 0x45, 0x48, 0x41, 0x56, + 0x49, 0x4f, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x4f, 0x52, 0x44, 0x45, 0x52, + 0x5f, 0x4f, 0x52, 0x49, 0x47, 0x49, 0x4e, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x53, 0x49, 0x44, 0x10, + 0x02, 0x12, 0x28, 0x0a, 0x24, 0x4d, 0x49, 0x53, 0x42, 0x45, 0x48, 0x41, 0x56, 0x49, 0x4f, 0x52, + 0x5f, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x4f, 0x52, 0x49, 0x47, 0x49, + 0x4e, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x53, 0x49, 0x44, 0x10, 0x03, 0x12, 0x29, 0x0a, 0x25, 0x4d, + 0x49, 0x53, 0x42, 0x45, 0x48, 0x41, 0x56, 0x49, 0x4f, 0x52, 0x5f, 0x43, 0x59, 0x43, 0x4c, 0x49, + 0x43, 0x41, 0x4c, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, 0x4f, 0x52, 0x44, 0x45, + 0x52, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x32, 0x9d, 0x04, 0x0a, 0x0e, 0x52, 0x65, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x70, 0x69, 0x12, 0x8f, 0x01, 0x0a, 0x12, 0x53, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, + 0x12, 0x26, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x53, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, + 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x6d, + 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2d, + 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x30, 0x01, 0x12, 0x7d, 0x0a, 0x0e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x22, 0x2e, + 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x23, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, + 0x2a, 0x22, 0x17, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2d, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x85, 0x01, 0x0a, 0x10, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x12, + 0x24, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, + 0x70, 0x76, 0x34, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x45, 0x6e, 0x76, 0x65, 0x6c, + 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x32, + 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2d, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, + 0x65, 0x73, 0x12, 0x72, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x49, 0x64, + 0x73, 0x12, 0x1f, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, + 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, + 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x3a, 0x01, 0x2a, 0x22, + 0x15, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x67, 0x65, 0x74, 0x2d, 0x69, 0x6e, 0x62, + 0x6f, 0x78, 0x2d, 0x69, 0x64, 0x73, 0x42, 0xa3, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, + 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x42, 0x0f, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x41, 0x70, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, + 0x6d, 0x74, 0x70, 0x64, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x78, + 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, + 0x69, 0xa2, 0x02, 0x03, 0x58, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x58, + 0x6d, 0x74, 0x70, 0x76, 0x34, 0xca, 0x02, 0x0b, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x58, 0x6d, 0x74, + 0x70, 0x76, 0x34, 0xe2, 0x02, 0x17, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x58, 0x6d, 0x74, 0x70, 0x76, + 0x34, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, + 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x58, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1542,77 +1462,75 @@ func file_xmtpv4_message_api_message_api_proto_rawDescGZIP() []byte { } var file_xmtpv4_message_api_message_api_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_xmtpv4_message_api_message_api_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_xmtpv4_message_api_message_api_proto_msgTypes = make([]protoimpl.MessageInfo, 20) var file_xmtpv4_message_api_message_api_proto_goTypes = []any{ - (Misbehavior)(0), // 0: xmtp.xmtpv4.Misbehavior - (*VectorClock)(nil), // 1: xmtp.xmtpv4.VectorClock - (*AuthenticatedData)(nil), // 2: xmtp.xmtpv4.AuthenticatedData - (*ClientEnvelope)(nil), // 3: xmtp.xmtpv4.ClientEnvelope - (*PayerEnvelope)(nil), // 4: xmtp.xmtpv4.PayerEnvelope - (*UnsignedOriginatorEnvelope)(nil), // 5: xmtp.xmtpv4.UnsignedOriginatorEnvelope - (*BlockchainProof)(nil), // 6: xmtp.xmtpv4.BlockchainProof - (*OriginatorEnvelope)(nil), // 7: xmtp.xmtpv4.OriginatorEnvelope - (*MisbehaviorReport)(nil), // 8: xmtp.xmtpv4.MisbehaviorReport - (*EnvelopesQuery)(nil), // 9: xmtp.xmtpv4.EnvelopesQuery - (*BatchSubscribeEnvelopesRequest)(nil), // 10: xmtp.xmtpv4.BatchSubscribeEnvelopesRequest - (*BatchSubscribeEnvelopesResponse)(nil), // 11: xmtp.xmtpv4.BatchSubscribeEnvelopesResponse - (*QueryEnvelopesRequest)(nil), // 12: xmtp.xmtpv4.QueryEnvelopesRequest - (*QueryEnvelopesResponse)(nil), // 13: xmtp.xmtpv4.QueryEnvelopesResponse - (*PublishEnvelopeRequest)(nil), // 14: xmtp.xmtpv4.PublishEnvelopeRequest - (*PublishEnvelopeResponse)(nil), // 15: xmtp.xmtpv4.PublishEnvelopeResponse - (*GetInboxIdsRequest)(nil), // 16: xmtp.xmtpv4.GetInboxIdsRequest - (*GetInboxIdsResponse)(nil), // 17: xmtp.xmtpv4.GetInboxIdsResponse - nil, // 18: xmtp.xmtpv4.VectorClock.NodeIdToSequenceIdEntry - (*BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest)(nil), // 19: xmtp.xmtpv4.BatchSubscribeEnvelopesRequest.SubscribeEnvelopesRequest - (*GetInboxIdsRequest_Request)(nil), // 20: xmtp.xmtpv4.GetInboxIdsRequest.Request - (*GetInboxIdsResponse_Response)(nil), // 21: xmtp.xmtpv4.GetInboxIdsResponse.Response - (*v1.GroupMessageInput)(nil), // 22: xmtp.mls.api.v1.GroupMessageInput - (*v1.WelcomeMessageInput)(nil), // 23: xmtp.mls.api.v1.WelcomeMessageInput - (*v1.RegisterInstallationRequest)(nil), // 24: xmtp.mls.api.v1.RegisterInstallationRequest - (*v1.UploadKeyPackageRequest)(nil), // 25: xmtp.mls.api.v1.UploadKeyPackageRequest - (*v1.RevokeInstallationRequest)(nil), // 26: xmtp.mls.api.v1.RevokeInstallationRequest - (*associations.IdentityUpdate)(nil), // 27: xmtp.identity.associations.IdentityUpdate - (*associations.RecoverableEcdsaSignature)(nil), // 28: xmtp.identity.associations.RecoverableEcdsaSignature + (Misbehavior)(0), // 0: xmtp.xmtpv4.Misbehavior + (*VectorClock)(nil), // 1: xmtp.xmtpv4.VectorClock + (*AuthenticatedData)(nil), // 2: xmtp.xmtpv4.AuthenticatedData + (*ClientEnvelope)(nil), // 3: xmtp.xmtpv4.ClientEnvelope + (*PayerEnvelope)(nil), // 4: xmtp.xmtpv4.PayerEnvelope + (*UnsignedOriginatorEnvelope)(nil), // 5: xmtp.xmtpv4.UnsignedOriginatorEnvelope + (*BlockchainProof)(nil), // 6: xmtp.xmtpv4.BlockchainProof + (*OriginatorEnvelope)(nil), // 7: xmtp.xmtpv4.OriginatorEnvelope + (*MisbehaviorReport)(nil), // 8: xmtp.xmtpv4.MisbehaviorReport + (*EnvelopesQuery)(nil), // 9: xmtp.xmtpv4.EnvelopesQuery + (*SubscribeEnvelopesRequest)(nil), // 10: xmtp.xmtpv4.SubscribeEnvelopesRequest + (*SubscribeEnvelopesResponse)(nil), // 11: xmtp.xmtpv4.SubscribeEnvelopesResponse + (*QueryEnvelopesRequest)(nil), // 12: xmtp.xmtpv4.QueryEnvelopesRequest + (*QueryEnvelopesResponse)(nil), // 13: xmtp.xmtpv4.QueryEnvelopesResponse + (*PublishEnvelopesRequest)(nil), // 14: xmtp.xmtpv4.PublishEnvelopesRequest + (*PublishEnvelopesResponse)(nil), // 15: xmtp.xmtpv4.PublishEnvelopesResponse + (*GetInboxIdsRequest)(nil), // 16: xmtp.xmtpv4.GetInboxIdsRequest + (*GetInboxIdsResponse)(nil), // 17: xmtp.xmtpv4.GetInboxIdsResponse + nil, // 18: xmtp.xmtpv4.VectorClock.NodeIdToSequenceIdEntry + (*GetInboxIdsRequest_Request)(nil), // 19: xmtp.xmtpv4.GetInboxIdsRequest.Request + (*GetInboxIdsResponse_Response)(nil), // 20: xmtp.xmtpv4.GetInboxIdsResponse.Response + (*v1.GroupMessageInput)(nil), // 21: xmtp.mls.api.v1.GroupMessageInput + (*v1.WelcomeMessageInput)(nil), // 22: xmtp.mls.api.v1.WelcomeMessageInput + (*v1.RegisterInstallationRequest)(nil), // 23: xmtp.mls.api.v1.RegisterInstallationRequest + (*v1.UploadKeyPackageRequest)(nil), // 24: xmtp.mls.api.v1.UploadKeyPackageRequest + (*v1.RevokeInstallationRequest)(nil), // 25: xmtp.mls.api.v1.RevokeInstallationRequest + (*associations.IdentityUpdate)(nil), // 26: xmtp.identity.associations.IdentityUpdate + (*associations.RecoverableEcdsaSignature)(nil), // 27: xmtp.identity.associations.RecoverableEcdsaSignature } var file_xmtpv4_message_api_message_api_proto_depIdxs = []int32{ 18, // 0: xmtp.xmtpv4.VectorClock.node_id_to_sequence_id:type_name -> xmtp.xmtpv4.VectorClock.NodeIdToSequenceIdEntry 1, // 1: xmtp.xmtpv4.AuthenticatedData.last_seen:type_name -> xmtp.xmtpv4.VectorClock - 22, // 2: xmtp.xmtpv4.ClientEnvelope.group_message:type_name -> xmtp.mls.api.v1.GroupMessageInput - 23, // 3: xmtp.xmtpv4.ClientEnvelope.welcome_message:type_name -> xmtp.mls.api.v1.WelcomeMessageInput - 24, // 4: xmtp.xmtpv4.ClientEnvelope.register_installation:type_name -> xmtp.mls.api.v1.RegisterInstallationRequest - 25, // 5: xmtp.xmtpv4.ClientEnvelope.upload_key_package:type_name -> xmtp.mls.api.v1.UploadKeyPackageRequest - 26, // 6: xmtp.xmtpv4.ClientEnvelope.revoke_installation:type_name -> xmtp.mls.api.v1.RevokeInstallationRequest - 27, // 7: xmtp.xmtpv4.ClientEnvelope.identity_update:type_name -> xmtp.identity.associations.IdentityUpdate + 21, // 2: xmtp.xmtpv4.ClientEnvelope.group_message:type_name -> xmtp.mls.api.v1.GroupMessageInput + 22, // 3: xmtp.xmtpv4.ClientEnvelope.welcome_message:type_name -> xmtp.mls.api.v1.WelcomeMessageInput + 23, // 4: xmtp.xmtpv4.ClientEnvelope.register_installation:type_name -> xmtp.mls.api.v1.RegisterInstallationRequest + 24, // 5: xmtp.xmtpv4.ClientEnvelope.upload_key_package:type_name -> xmtp.mls.api.v1.UploadKeyPackageRequest + 25, // 6: xmtp.xmtpv4.ClientEnvelope.revoke_installation:type_name -> xmtp.mls.api.v1.RevokeInstallationRequest + 26, // 7: xmtp.xmtpv4.ClientEnvelope.identity_update:type_name -> xmtp.identity.associations.IdentityUpdate 2, // 8: xmtp.xmtpv4.ClientEnvelope.aad:type_name -> xmtp.xmtpv4.AuthenticatedData - 28, // 9: xmtp.xmtpv4.PayerEnvelope.payer_signature:type_name -> xmtp.identity.associations.RecoverableEcdsaSignature + 27, // 9: xmtp.xmtpv4.PayerEnvelope.payer_signature:type_name -> xmtp.identity.associations.RecoverableEcdsaSignature 4, // 10: xmtp.xmtpv4.UnsignedOriginatorEnvelope.payer_envelope:type_name -> xmtp.xmtpv4.PayerEnvelope - 28, // 11: xmtp.xmtpv4.OriginatorEnvelope.originator_signature:type_name -> xmtp.identity.associations.RecoverableEcdsaSignature + 27, // 11: xmtp.xmtpv4.OriginatorEnvelope.originator_signature:type_name -> xmtp.identity.associations.RecoverableEcdsaSignature 6, // 12: xmtp.xmtpv4.OriginatorEnvelope.blockchain_proof:type_name -> xmtp.xmtpv4.BlockchainProof 0, // 13: xmtp.xmtpv4.MisbehaviorReport.type:type_name -> xmtp.xmtpv4.Misbehavior 7, // 14: xmtp.xmtpv4.MisbehaviorReport.envelopes:type_name -> xmtp.xmtpv4.OriginatorEnvelope 1, // 15: xmtp.xmtpv4.EnvelopesQuery.last_seen:type_name -> xmtp.xmtpv4.VectorClock - 19, // 16: xmtp.xmtpv4.BatchSubscribeEnvelopesRequest.requests:type_name -> xmtp.xmtpv4.BatchSubscribeEnvelopesRequest.SubscribeEnvelopesRequest - 7, // 17: xmtp.xmtpv4.BatchSubscribeEnvelopesResponse.envelopes:type_name -> xmtp.xmtpv4.OriginatorEnvelope + 9, // 16: xmtp.xmtpv4.SubscribeEnvelopesRequest.query:type_name -> xmtp.xmtpv4.EnvelopesQuery + 7, // 17: xmtp.xmtpv4.SubscribeEnvelopesResponse.envelopes:type_name -> xmtp.xmtpv4.OriginatorEnvelope 9, // 18: xmtp.xmtpv4.QueryEnvelopesRequest.query:type_name -> xmtp.xmtpv4.EnvelopesQuery 7, // 19: xmtp.xmtpv4.QueryEnvelopesResponse.envelopes:type_name -> xmtp.xmtpv4.OriginatorEnvelope - 4, // 20: xmtp.xmtpv4.PublishEnvelopeRequest.payer_envelope:type_name -> xmtp.xmtpv4.PayerEnvelope - 7, // 21: xmtp.xmtpv4.PublishEnvelopeResponse.originator_envelope:type_name -> xmtp.xmtpv4.OriginatorEnvelope - 20, // 22: xmtp.xmtpv4.GetInboxIdsRequest.requests:type_name -> xmtp.xmtpv4.GetInboxIdsRequest.Request - 21, // 23: xmtp.xmtpv4.GetInboxIdsResponse.responses:type_name -> xmtp.xmtpv4.GetInboxIdsResponse.Response - 9, // 24: xmtp.xmtpv4.BatchSubscribeEnvelopesRequest.SubscribeEnvelopesRequest.query:type_name -> xmtp.xmtpv4.EnvelopesQuery - 10, // 25: xmtp.xmtpv4.ReplicationApi.BatchSubscribeEnvelopes:input_type -> xmtp.xmtpv4.BatchSubscribeEnvelopesRequest - 12, // 26: xmtp.xmtpv4.ReplicationApi.QueryEnvelopes:input_type -> xmtp.xmtpv4.QueryEnvelopesRequest - 14, // 27: xmtp.xmtpv4.ReplicationApi.PublishEnvelope:input_type -> xmtp.xmtpv4.PublishEnvelopeRequest - 16, // 28: xmtp.xmtpv4.ReplicationApi.GetInboxIds:input_type -> xmtp.xmtpv4.GetInboxIdsRequest - 11, // 29: xmtp.xmtpv4.ReplicationApi.BatchSubscribeEnvelopes:output_type -> xmtp.xmtpv4.BatchSubscribeEnvelopesResponse - 13, // 30: xmtp.xmtpv4.ReplicationApi.QueryEnvelopes:output_type -> xmtp.xmtpv4.QueryEnvelopesResponse - 15, // 31: xmtp.xmtpv4.ReplicationApi.PublishEnvelope:output_type -> xmtp.xmtpv4.PublishEnvelopeResponse - 17, // 32: xmtp.xmtpv4.ReplicationApi.GetInboxIds:output_type -> xmtp.xmtpv4.GetInboxIdsResponse - 29, // [29:33] is the sub-list for method output_type - 25, // [25:29] is the sub-list for method input_type - 25, // [25:25] is the sub-list for extension type_name - 25, // [25:25] is the sub-list for extension extendee - 0, // [0:25] is the sub-list for field type_name + 4, // 20: xmtp.xmtpv4.PublishEnvelopesRequest.payer_envelopes:type_name -> xmtp.xmtpv4.PayerEnvelope + 7, // 21: xmtp.xmtpv4.PublishEnvelopesResponse.originator_envelopes:type_name -> xmtp.xmtpv4.OriginatorEnvelope + 19, // 22: xmtp.xmtpv4.GetInboxIdsRequest.requests:type_name -> xmtp.xmtpv4.GetInboxIdsRequest.Request + 20, // 23: xmtp.xmtpv4.GetInboxIdsResponse.responses:type_name -> xmtp.xmtpv4.GetInboxIdsResponse.Response + 10, // 24: xmtp.xmtpv4.ReplicationApi.SubscribeEnvelopes:input_type -> xmtp.xmtpv4.SubscribeEnvelopesRequest + 12, // 25: xmtp.xmtpv4.ReplicationApi.QueryEnvelopes:input_type -> xmtp.xmtpv4.QueryEnvelopesRequest + 14, // 26: xmtp.xmtpv4.ReplicationApi.PublishEnvelopes:input_type -> xmtp.xmtpv4.PublishEnvelopesRequest + 16, // 27: xmtp.xmtpv4.ReplicationApi.GetInboxIds:input_type -> xmtp.xmtpv4.GetInboxIdsRequest + 11, // 28: xmtp.xmtpv4.ReplicationApi.SubscribeEnvelopes:output_type -> xmtp.xmtpv4.SubscribeEnvelopesResponse + 13, // 29: xmtp.xmtpv4.ReplicationApi.QueryEnvelopes:output_type -> xmtp.xmtpv4.QueryEnvelopesResponse + 15, // 30: xmtp.xmtpv4.ReplicationApi.PublishEnvelopes:output_type -> xmtp.xmtpv4.PublishEnvelopesResponse + 17, // 31: xmtp.xmtpv4.ReplicationApi.GetInboxIds:output_type -> xmtp.xmtpv4.GetInboxIdsResponse + 28, // [28:32] is the sub-list for method output_type + 24, // [24:28] is the sub-list for method input_type + 24, // [24:24] is the sub-list for extension type_name + 24, // [24:24] is the sub-list for extension extendee + 0, // [0:24] is the sub-list for field type_name } func init() { file_xmtpv4_message_api_message_api_proto_init() } @@ -1632,18 +1550,14 @@ func file_xmtpv4_message_api_message_api_proto_init() { (*OriginatorEnvelope_OriginatorSignature)(nil), (*OriginatorEnvelope_BlockchainProof)(nil), } - file_xmtpv4_message_api_message_api_proto_msgTypes[8].OneofWrappers = []any{ - (*EnvelopesQuery_Topic)(nil), - (*EnvelopesQuery_OriginatorNodeId)(nil), - } - file_xmtpv4_message_api_message_api_proto_msgTypes[20].OneofWrappers = []any{} + file_xmtpv4_message_api_message_api_proto_msgTypes[19].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_xmtpv4_message_api_message_api_proto_rawDesc, NumEnums: 1, - NumMessages: 21, + NumMessages: 20, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/proto/xmtpv4/message_api/message_api.pb.gw.go b/pkg/proto/xmtpv4/message_api/message_api.pb.gw.go index 83467689..d13a4214 100644 --- a/pkg/proto/xmtpv4/message_api/message_api.pb.gw.go +++ b/pkg/proto/xmtpv4/message_api/message_api.pb.gw.go @@ -31,15 +31,15 @@ var _ = runtime.String var _ = utilities.NewDoubleArray var _ = metadata.Join -func request_ReplicationApi_BatchSubscribeEnvelopes_0(ctx context.Context, marshaler runtime.Marshaler, client ReplicationApiClient, req *http.Request, pathParams map[string]string) (ReplicationApi_BatchSubscribeEnvelopesClient, runtime.ServerMetadata, error) { - var protoReq BatchSubscribeEnvelopesRequest +func request_ReplicationApi_SubscribeEnvelopes_0(ctx context.Context, marshaler runtime.Marshaler, client ReplicationApiClient, req *http.Request, pathParams map[string]string) (ReplicationApi_SubscribeEnvelopesClient, runtime.ServerMetadata, error) { + var protoReq SubscribeEnvelopesRequest var metadata runtime.ServerMetadata if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - stream, err := client.BatchSubscribeEnvelopes(ctx, &protoReq) + stream, err := client.SubscribeEnvelopes(ctx, &protoReq) if err != nil { return nil, metadata, err } @@ -78,28 +78,28 @@ func local_request_ReplicationApi_QueryEnvelopes_0(ctx context.Context, marshale } -func request_ReplicationApi_PublishEnvelope_0(ctx context.Context, marshaler runtime.Marshaler, client ReplicationApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PublishEnvelopeRequest +func request_ReplicationApi_PublishEnvelopes_0(ctx context.Context, marshaler runtime.Marshaler, client ReplicationApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PublishEnvelopesRequest var metadata runtime.ServerMetadata if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.PublishEnvelope(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.PublishEnvelopes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_ReplicationApi_PublishEnvelope_0(ctx context.Context, marshaler runtime.Marshaler, server ReplicationApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PublishEnvelopeRequest +func local_request_ReplicationApi_PublishEnvelopes_0(ctx context.Context, marshaler runtime.Marshaler, server ReplicationApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PublishEnvelopesRequest var metadata runtime.ServerMetadata if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.PublishEnvelope(ctx, &protoReq) + msg, err := server.PublishEnvelopes(ctx, &protoReq) return msg, metadata, err } @@ -136,7 +136,7 @@ func local_request_ReplicationApi_GetInboxIds_0(ctx context.Context, marshaler r // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterReplicationApiHandlerFromEndpoint instead. func RegisterReplicationApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ReplicationApiServer) error { - mux.Handle("POST", pattern_ReplicationApi_BatchSubscribeEnvelopes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_ReplicationApi_SubscribeEnvelopes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -168,7 +168,7 @@ func RegisterReplicationApiHandlerServer(ctx context.Context, mux *runtime.Serve }) - mux.Handle("POST", pattern_ReplicationApi_PublishEnvelope_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_ReplicationApi_PublishEnvelopes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -176,12 +176,12 @@ func RegisterReplicationApiHandlerServer(ctx context.Context, mux *runtime.Serve inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.xmtpv4.ReplicationApi/PublishEnvelope", runtime.WithHTTPPathPattern("/mls/v2/publish-envelope")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.xmtpv4.ReplicationApi/PublishEnvelopes", runtime.WithHTTPPathPattern("/mls/v2/publish-envelopes")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_ReplicationApi_PublishEnvelope_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_ReplicationApi_PublishEnvelopes_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -189,7 +189,7 @@ func RegisterReplicationApiHandlerServer(ctx context.Context, mux *runtime.Serve return } - forward_ReplicationApi_PublishEnvelope_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_ReplicationApi_PublishEnvelopes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -259,25 +259,25 @@ func RegisterReplicationApiHandler(ctx context.Context, mux *runtime.ServeMux, c // "ReplicationApiClient" to call the correct interceptors. func RegisterReplicationApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ReplicationApiClient) error { - mux.Handle("POST", pattern_ReplicationApi_BatchSubscribeEnvelopes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_ReplicationApi_SubscribeEnvelopes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.xmtpv4.ReplicationApi/BatchSubscribeEnvelopes", runtime.WithHTTPPathPattern("/mls/v2/subscribe-envelopes")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.xmtpv4.ReplicationApi/SubscribeEnvelopes", runtime.WithHTTPPathPattern("/mls/v2/subscribe-envelopes")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_ReplicationApi_BatchSubscribeEnvelopes_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_ReplicationApi_SubscribeEnvelopes_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ReplicationApi_BatchSubscribeEnvelopes_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + forward_ReplicationApi_SubscribeEnvelopes_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) }) @@ -303,25 +303,25 @@ func RegisterReplicationApiHandlerClient(ctx context.Context, mux *runtime.Serve }) - mux.Handle("POST", pattern_ReplicationApi_PublishEnvelope_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_ReplicationApi_PublishEnvelopes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.xmtpv4.ReplicationApi/PublishEnvelope", runtime.WithHTTPPathPattern("/mls/v2/publish-envelope")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.xmtpv4.ReplicationApi/PublishEnvelopes", runtime.WithHTTPPathPattern("/mls/v2/publish-envelopes")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_ReplicationApi_PublishEnvelope_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_ReplicationApi_PublishEnvelopes_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ReplicationApi_PublishEnvelope_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_ReplicationApi_PublishEnvelopes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -351,21 +351,21 @@ func RegisterReplicationApiHandlerClient(ctx context.Context, mux *runtime.Serve } var ( - pattern_ReplicationApi_BatchSubscribeEnvelopes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v2", "subscribe-envelopes"}, "")) + pattern_ReplicationApi_SubscribeEnvelopes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v2", "subscribe-envelopes"}, "")) pattern_ReplicationApi_QueryEnvelopes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v2", "query-envelopes"}, "")) - pattern_ReplicationApi_PublishEnvelope_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v2", "publish-envelope"}, "")) + pattern_ReplicationApi_PublishEnvelopes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v2", "publish-envelopes"}, "")) pattern_ReplicationApi_GetInboxIds_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v2", "get-inbox-ids"}, "")) ) var ( - forward_ReplicationApi_BatchSubscribeEnvelopes_0 = runtime.ForwardResponseStream + forward_ReplicationApi_SubscribeEnvelopes_0 = runtime.ForwardResponseStream forward_ReplicationApi_QueryEnvelopes_0 = runtime.ForwardResponseMessage - forward_ReplicationApi_PublishEnvelope_0 = runtime.ForwardResponseMessage + forward_ReplicationApi_PublishEnvelopes_0 = runtime.ForwardResponseMessage forward_ReplicationApi_GetInboxIds_0 = runtime.ForwardResponseMessage ) diff --git a/pkg/proto/xmtpv4/message_api/message_api_grpc.pb.go b/pkg/proto/xmtpv4/message_api/message_api_grpc.pb.go index 4b0de312..456f22d8 100644 --- a/pkg/proto/xmtpv4/message_api/message_api_grpc.pb.go +++ b/pkg/proto/xmtpv4/message_api/message_api_grpc.pb.go @@ -21,10 +21,10 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - ReplicationApi_BatchSubscribeEnvelopes_FullMethodName = "/xmtp.xmtpv4.ReplicationApi/BatchSubscribeEnvelopes" - ReplicationApi_QueryEnvelopes_FullMethodName = "/xmtp.xmtpv4.ReplicationApi/QueryEnvelopes" - ReplicationApi_PublishEnvelope_FullMethodName = "/xmtp.xmtpv4.ReplicationApi/PublishEnvelope" - ReplicationApi_GetInboxIds_FullMethodName = "/xmtp.xmtpv4.ReplicationApi/GetInboxIds" + ReplicationApi_SubscribeEnvelopes_FullMethodName = "/xmtp.xmtpv4.ReplicationApi/SubscribeEnvelopes" + ReplicationApi_QueryEnvelopes_FullMethodName = "/xmtp.xmtpv4.ReplicationApi/QueryEnvelopes" + ReplicationApi_PublishEnvelopes_FullMethodName = "/xmtp.xmtpv4.ReplicationApi/PublishEnvelopes" + ReplicationApi_GetInboxIds_FullMethodName = "/xmtp.xmtpv4.ReplicationApi/GetInboxIds" ) // ReplicationApiClient is the client API for ReplicationApi service. @@ -32,11 +32,11 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type ReplicationApiClient interface { // Subscribe to envelopes - BatchSubscribeEnvelopes(ctx context.Context, in *BatchSubscribeEnvelopesRequest, opts ...grpc.CallOption) (ReplicationApi_BatchSubscribeEnvelopesClient, error) + SubscribeEnvelopes(ctx context.Context, in *SubscribeEnvelopesRequest, opts ...grpc.CallOption) (ReplicationApi_SubscribeEnvelopesClient, error) // Query envelopes QueryEnvelopes(ctx context.Context, in *QueryEnvelopesRequest, opts ...grpc.CallOption) (*QueryEnvelopesResponse, error) // Publish envelope - PublishEnvelope(ctx context.Context, in *PublishEnvelopeRequest, opts ...grpc.CallOption) (*PublishEnvelopeResponse, error) + PublishEnvelopes(ctx context.Context, in *PublishEnvelopesRequest, opts ...grpc.CallOption) (*PublishEnvelopesResponse, error) // Get inbox ids GetInboxIds(ctx context.Context, in *GetInboxIdsRequest, opts ...grpc.CallOption) (*GetInboxIdsResponse, error) } @@ -49,12 +49,12 @@ func NewReplicationApiClient(cc grpc.ClientConnInterface) ReplicationApiClient { return &replicationApiClient{cc} } -func (c *replicationApiClient) BatchSubscribeEnvelopes(ctx context.Context, in *BatchSubscribeEnvelopesRequest, opts ...grpc.CallOption) (ReplicationApi_BatchSubscribeEnvelopesClient, error) { - stream, err := c.cc.NewStream(ctx, &ReplicationApi_ServiceDesc.Streams[0], ReplicationApi_BatchSubscribeEnvelopes_FullMethodName, opts...) +func (c *replicationApiClient) SubscribeEnvelopes(ctx context.Context, in *SubscribeEnvelopesRequest, opts ...grpc.CallOption) (ReplicationApi_SubscribeEnvelopesClient, error) { + stream, err := c.cc.NewStream(ctx, &ReplicationApi_ServiceDesc.Streams[0], ReplicationApi_SubscribeEnvelopes_FullMethodName, opts...) if err != nil { return nil, err } - x := &replicationApiBatchSubscribeEnvelopesClient{stream} + x := &replicationApiSubscribeEnvelopesClient{stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -64,17 +64,17 @@ func (c *replicationApiClient) BatchSubscribeEnvelopes(ctx context.Context, in * return x, nil } -type ReplicationApi_BatchSubscribeEnvelopesClient interface { - Recv() (*BatchSubscribeEnvelopesResponse, error) +type ReplicationApi_SubscribeEnvelopesClient interface { + Recv() (*SubscribeEnvelopesResponse, error) grpc.ClientStream } -type replicationApiBatchSubscribeEnvelopesClient struct { +type replicationApiSubscribeEnvelopesClient struct { grpc.ClientStream } -func (x *replicationApiBatchSubscribeEnvelopesClient) Recv() (*BatchSubscribeEnvelopesResponse, error) { - m := new(BatchSubscribeEnvelopesResponse) +func (x *replicationApiSubscribeEnvelopesClient) Recv() (*SubscribeEnvelopesResponse, error) { + m := new(SubscribeEnvelopesResponse) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } @@ -90,9 +90,9 @@ func (c *replicationApiClient) QueryEnvelopes(ctx context.Context, in *QueryEnve return out, nil } -func (c *replicationApiClient) PublishEnvelope(ctx context.Context, in *PublishEnvelopeRequest, opts ...grpc.CallOption) (*PublishEnvelopeResponse, error) { - out := new(PublishEnvelopeResponse) - err := c.cc.Invoke(ctx, ReplicationApi_PublishEnvelope_FullMethodName, in, out, opts...) +func (c *replicationApiClient) PublishEnvelopes(ctx context.Context, in *PublishEnvelopesRequest, opts ...grpc.CallOption) (*PublishEnvelopesResponse, error) { + out := new(PublishEnvelopesResponse) + err := c.cc.Invoke(ctx, ReplicationApi_PublishEnvelopes_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -113,11 +113,11 @@ func (c *replicationApiClient) GetInboxIds(ctx context.Context, in *GetInboxIdsR // for forward compatibility type ReplicationApiServer interface { // Subscribe to envelopes - BatchSubscribeEnvelopes(*BatchSubscribeEnvelopesRequest, ReplicationApi_BatchSubscribeEnvelopesServer) error + SubscribeEnvelopes(*SubscribeEnvelopesRequest, ReplicationApi_SubscribeEnvelopesServer) error // Query envelopes QueryEnvelopes(context.Context, *QueryEnvelopesRequest) (*QueryEnvelopesResponse, error) // Publish envelope - PublishEnvelope(context.Context, *PublishEnvelopeRequest) (*PublishEnvelopeResponse, error) + PublishEnvelopes(context.Context, *PublishEnvelopesRequest) (*PublishEnvelopesResponse, error) // Get inbox ids GetInboxIds(context.Context, *GetInboxIdsRequest) (*GetInboxIdsResponse, error) mustEmbedUnimplementedReplicationApiServer() @@ -127,14 +127,14 @@ type ReplicationApiServer interface { type UnimplementedReplicationApiServer struct { } -func (UnimplementedReplicationApiServer) BatchSubscribeEnvelopes(*BatchSubscribeEnvelopesRequest, ReplicationApi_BatchSubscribeEnvelopesServer) error { - return status.Errorf(codes.Unimplemented, "method BatchSubscribeEnvelopes not implemented") +func (UnimplementedReplicationApiServer) SubscribeEnvelopes(*SubscribeEnvelopesRequest, ReplicationApi_SubscribeEnvelopesServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeEnvelopes not implemented") } func (UnimplementedReplicationApiServer) QueryEnvelopes(context.Context, *QueryEnvelopesRequest) (*QueryEnvelopesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryEnvelopes not implemented") } -func (UnimplementedReplicationApiServer) PublishEnvelope(context.Context, *PublishEnvelopeRequest) (*PublishEnvelopeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PublishEnvelope not implemented") +func (UnimplementedReplicationApiServer) PublishEnvelopes(context.Context, *PublishEnvelopesRequest) (*PublishEnvelopesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PublishEnvelopes not implemented") } func (UnimplementedReplicationApiServer) GetInboxIds(context.Context, *GetInboxIdsRequest) (*GetInboxIdsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetInboxIds not implemented") @@ -152,24 +152,24 @@ func RegisterReplicationApiServer(s grpc.ServiceRegistrar, srv ReplicationApiSer s.RegisterService(&ReplicationApi_ServiceDesc, srv) } -func _ReplicationApi_BatchSubscribeEnvelopes_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(BatchSubscribeEnvelopesRequest) +func _ReplicationApi_SubscribeEnvelopes_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SubscribeEnvelopesRequest) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(ReplicationApiServer).BatchSubscribeEnvelopes(m, &replicationApiBatchSubscribeEnvelopesServer{stream}) + return srv.(ReplicationApiServer).SubscribeEnvelopes(m, &replicationApiSubscribeEnvelopesServer{stream}) } -type ReplicationApi_BatchSubscribeEnvelopesServer interface { - Send(*BatchSubscribeEnvelopesResponse) error +type ReplicationApi_SubscribeEnvelopesServer interface { + Send(*SubscribeEnvelopesResponse) error grpc.ServerStream } -type replicationApiBatchSubscribeEnvelopesServer struct { +type replicationApiSubscribeEnvelopesServer struct { grpc.ServerStream } -func (x *replicationApiBatchSubscribeEnvelopesServer) Send(m *BatchSubscribeEnvelopesResponse) error { +func (x *replicationApiSubscribeEnvelopesServer) Send(m *SubscribeEnvelopesResponse) error { return x.ServerStream.SendMsg(m) } @@ -191,20 +191,20 @@ func _ReplicationApi_QueryEnvelopes_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } -func _ReplicationApi_PublishEnvelope_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PublishEnvelopeRequest) +func _ReplicationApi_PublishEnvelopes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PublishEnvelopesRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ReplicationApiServer).PublishEnvelope(ctx, in) + return srv.(ReplicationApiServer).PublishEnvelopes(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ReplicationApi_PublishEnvelope_FullMethodName, + FullMethod: ReplicationApi_PublishEnvelopes_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReplicationApiServer).PublishEnvelope(ctx, req.(*PublishEnvelopeRequest)) + return srv.(ReplicationApiServer).PublishEnvelopes(ctx, req.(*PublishEnvelopesRequest)) } return interceptor(ctx, in, info, handler) } @@ -239,8 +239,8 @@ var ReplicationApi_ServiceDesc = grpc.ServiceDesc{ Handler: _ReplicationApi_QueryEnvelopes_Handler, }, { - MethodName: "PublishEnvelope", - Handler: _ReplicationApi_PublishEnvelope_Handler, + MethodName: "PublishEnvelopes", + Handler: _ReplicationApi_PublishEnvelopes_Handler, }, { MethodName: "GetInboxIds", @@ -249,8 +249,8 @@ var ReplicationApi_ServiceDesc = grpc.ServiceDesc{ }, Streams: []grpc.StreamDesc{ { - StreamName: "BatchSubscribeEnvelopes", - Handler: _ReplicationApi_BatchSubscribeEnvelopes_Handler, + StreamName: "SubscribeEnvelopes", + Handler: _ReplicationApi_SubscribeEnvelopes_Handler, ServerStreams: true, }, }, diff --git a/pkg/server/server_test.go b/pkg/server/server_test.go index 4a01e500..6a8f4456 100644 --- a/pkg/server/server_test.go +++ b/pkg/server/server_test.go @@ -93,26 +93,26 @@ func TestCreateServer(t *testing.T) { client2, cleanup2 := apiTestUtils.NewAPIClient(t, ctx, server2.Addr().String()) defer cleanup2() - p1, err := client1.PublishEnvelope(ctx, &message_api.PublishEnvelopeRequest{ - PayerEnvelope: testutils.CreatePayerEnvelope( + p1, err := client1.PublishEnvelopes(ctx, &message_api.PublishEnvelopesRequest{ + PayerEnvelopes: []*message_api.PayerEnvelope{testutils.CreatePayerEnvelope( t, testutils.CreateClientEnvelope(&message_api.AuthenticatedData{ TargetOriginator: server1NodeID, TargetTopic: []byte{0x5}, LastSeen: &message_api.VectorClock{}, }), - ), + )}, }) require.NoError(t, err) - p2, err := client2.PublishEnvelope(ctx, &message_api.PublishEnvelopeRequest{ - PayerEnvelope: testutils.CreatePayerEnvelope( + p2, err := client2.PublishEnvelopes(ctx, &message_api.PublishEnvelopesRequest{ + PayerEnvelopes: []*message_api.PayerEnvelope{testutils.CreatePayerEnvelope( t, testutils.CreateClientEnvelope(&message_api.AuthenticatedData{ TargetOriginator: server2NodeID, TargetTopic: []byte{0x5}, LastSeen: &message_api.VectorClock{}, }), - ), + )}, }) utils.Unused(p2) require.NoError(t, err) @@ -125,9 +125,7 @@ func TestCreateServer(t *testing.T) { // require.Eventually(t, func() bool { // q1, err := client1.QueryEnvelopes(ctx, &message_api.QueryEnvelopesRequest{ // Query: &message_api.EnvelopesQuery{ - // Filter: &message_api.EnvelopesQuery_OriginatorNodeId{ - // OriginatorNodeId: server2NodeID, - // }, + // OriginatorNodeIds: []uint32{server2NodeID}, // LastSeen: &message_api.VectorClock{}, // }, // Limit: 10, @@ -137,17 +135,15 @@ func TestCreateServer(t *testing.T) { // return false // } // require.Len(t, q1.Envelopes, 1) - // require.Equal(t, q1.Envelopes[0], p2.OriginatorEnvelope) + // require.Equal(t, q1.Envelopes[0], p2.OriginatorEnvelopes[0]) // return true // }, 500*time.Millisecond, 50*time.Millisecond) require.Eventually(t, func() bool { q2, err := client1.QueryEnvelopes(ctx, &message_api.QueryEnvelopesRequest{ Query: &message_api.EnvelopesQuery{ - Filter: &message_api.EnvelopesQuery_OriginatorNodeId{ - OriginatorNodeId: server1NodeID, - }, - LastSeen: &message_api.VectorClock{}, + OriginatorNodeIds: []uint32{server1NodeID}, + LastSeen: &message_api.VectorClock{}, }, Limit: 10, }) @@ -156,7 +152,7 @@ func TestCreateServer(t *testing.T) { return false } require.Len(t, q2.Envelopes, 1) - require.Equal(t, q2.Envelopes[0], p1.OriginatorEnvelope) + require.Equal(t, q2.Envelopes[0], p1.OriginatorEnvelopes[0]) return true }, 500*time.Millisecond, 50*time.Millisecond) } diff --git a/pkg/sync/syncWorker.go b/pkg/sync/syncWorker.go index 01fd27e3..6f712e86 100644 --- a/pkg/sync/syncWorker.go +++ b/pkg/sync/syncWorker.go @@ -75,7 +75,7 @@ func (s *syncWorker) subscribeToNode(node registry.Node) { func(ctx context.Context) { var err error var conn *grpc.ClientConn - var stream message_api.ReplicationApi_BatchSubscribeEnvelopesClient + var stream message_api.ReplicationApi_SubscribeEnvelopesClient for { if err != nil { log.Error(fmt.Sprintf("Error: %v, retrying...", err)) @@ -117,20 +117,14 @@ func (s *syncWorker) connectToNode(node registry.Node) (*grpc.ClientConn, error) func (s *syncWorker) setupStream( node registry.Node, conn *grpc.ClientConn, -) (message_api.ReplicationApi_BatchSubscribeEnvelopesClient, error) { +) (message_api.ReplicationApi_SubscribeEnvelopesClient, error) { client := message_api.NewReplicationApiClient(conn) - stream, err := client.BatchSubscribeEnvelopes( + stream, err := client.SubscribeEnvelopes( s.ctx, - &message_api.BatchSubscribeEnvelopesRequest{ - Requests: []*message_api.BatchSubscribeEnvelopesRequest_SubscribeEnvelopesRequest{ - { - Query: &message_api.EnvelopesQuery{ - Filter: &message_api.EnvelopesQuery_OriginatorNodeId{ - OriginatorNodeId: node.NodeID, - }, - LastSeen: nil, - }, - }, + &message_api.SubscribeEnvelopesRequest{ + Query: &message_api.EnvelopesQuery{ + OriginatorNodeIds: []uint32{node.NodeID}, + LastSeen: nil, }, }, ) @@ -144,7 +138,7 @@ func (s *syncWorker) setupStream( } func (s *syncWorker) listenToStream( - stream message_api.ReplicationApi_BatchSubscribeEnvelopesClient, + stream message_api.ReplicationApi_SubscribeEnvelopesClient, ) error { for { envs, err := stream.Recv()