diff --git a/proto/xmtpv4/message_api/message_api.proto b/proto/xmtpv4/message_api/message_api.proto index 7c6db35..11e8bb0 100644 --- a/proto/xmtpv4/message_api/message_api.proto +++ b/proto/xmtpv4/message_api/message_api.proto @@ -56,6 +56,21 @@ message GatewayEnvelope { OriginatorEnvelope originator_envelope = 2; } +// Misbehavior types +enum Misbehavior { + MISBEHAVIOR_UNSPECIFIED = 0; + MISBEHAVIOR_UNAVAILABLE_NODE = 1; + MISBEHAVIOR_OUT_OF_ORDER_ORIGINATOR_SID = 2; + MISBEHAVIOR_DUPLICATE_ORIGINATOR_SID = 3; + MISBEHAVIOR_CYCLICAL_MESSAGE_ORDERING = 4; +} + +// Reports node misbehavior, submittable by nodes or by clients +message MisbehaviorReport { + Misbehavior type = 1; + repeated OriginatorEnvelope envelopes = 2; +} + // Query for envelopes, shared by query and subscribe endpoints message EnvelopesQuery { oneof last_seen { @@ -78,29 +93,11 @@ message BatchSubscribeEnvelopesRequest { repeated SubscribeEnvelopesRequest requests = 1; } +// Streamed response for batch subscribe - can be multiple envelopes at once message BatchSubscribeEnvelopesResponse { repeated GatewayEnvelope envelopes = 1; } -// Replication API -service ReplicationApi { - // Subscribe to envelopes - rpc BatchSubscribeEnvelopes(BatchSubscribeEnvelopesRequest) returns (stream BatchSubscribeEnvelopesResponse) { - option (google.api.http) = { - post: "/mls/v2/subscribe-envelopes" - body: "*" - }; - } - - // Query envelopes - rpc QueryEnvelopes(QueryEnvelopesRequest) returns (QueryEnvelopesResponse) { - option (google.api.http) = { - post: "/mls/v2/query-envelopes" - body: "*" - }; - } -} - // Pagination config for queries message PagingInfo { uint32 limit = 1; @@ -117,17 +114,21 @@ message QueryEnvelopesResponse { repeated GatewayEnvelope envelopes = 1; } -// Misbehavior types -enum Misbehavior { - MISBEHAVIOR_UNSPECIFIED = 0; - MISBEHAVIOR_UNAVAILABLE_NODE = 1; - MISBEHAVIOR_OUT_OF_ORDER_ORIGINATOR_SID = 2; - MISBEHAVIOR_DUPLICATE_ORIGINATOR_SID = 3; - MISBEHAVIOR_CYCLICAL_MESSAGE_ORDERING = 4; -} +// Replication API +service ReplicationApi { + // Subscribe to envelopes + rpc BatchSubscribeEnvelopes(BatchSubscribeEnvelopesRequest) returns (stream BatchSubscribeEnvelopesResponse) { + option (google.api.http) = { + post: "/mls/v2/subscribe-envelopes" + body: "*" + }; + } -// Reports node misbehavior, submittable by nodes or by clients -message MisbehaviorReport { - Misbehavior type = 1; - repeated OriginatorEnvelope envelopes = 2; + // Query envelopes + rpc QueryEnvelopes(QueryEnvelopesRequest) returns (QueryEnvelopesResponse) { + option (google.api.http) = { + post: "/mls/v2/query-envelopes" + body: "*" + }; + } }