Skip to content

Commit

Permalink
chore: reorder types logically
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhuaaa committed Jul 30, 2024
1 parent c2ed711 commit 66cec7a
Showing 1 changed file with 32 additions and 31 deletions.
63 changes: 32 additions & 31 deletions proto/xmtpv4/message_api/message_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Expand All @@ -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: "*"
};
}
}

0 comments on commit 66cec7a

Please sign in to comment.