multi: registration complete MW interceptor msg

In this commit, we change the flow of the rpc middleware registration
a bit. In order to allow a client to add rpc middleware interceptors in
a deterministic order, we now make the server send a "registration
complete" message to the client after compeleting the registration
process so that the client knows when it can go ahead and register the
next client.
This commit is contained in:
Elle Mouton committed 2022-07-20 14:58:47 -05:00
1 parent 0ac421907a
commit 25acb51ba3
6 files changed
+566 -485

No files matched your search

+498 -476
View File
File diff suppressed because it is too large. Load diff
+8
View File
@@ -4379,6 +4379,14 @@ message RPCMiddlewareRequest {
the same type, or replaced by an error message.
*/
RPCMessage response = 6;
/*
This is used to indicate to the client that the server has successfully
registered the interceptor. This is only used in the very first message
that the server sends to the client after the client sends the server
the middleware registration message.
*/
bool reg_complete = 8;
}
/*
+4
View File
@@ -5995,6 +5995,10 @@
"$ref": "#/definitions/lnrpcRPCMessage",
"description": "Intercept outgoing gRPC response message: all outgoing messages, both on\nstreaming and unary RPCs, are forwarded to the middleware for inspection\nand amendment. The response in this message is the original response as\nit was generated by the main RPC server. It can either be accepted\n(=forwarded to the client), replaced/overwritten with a new message of\nthe same type, or replaced by an error message."
},
"reg_complete": {
"type": "boolean",
"description": "This is used to indicate to the client that the server has successfully\nregistered the interceptor. This is only used in the very first message\nthat the server sends to the client after the client sends the server\nthe middleware registration message."
},
"msg_id": {
"type": "string",
"format": "uint64",