Replies: 6 comments 9 replies
-
An immediate question from me that comes from the Twitter debate sparked by @abailly-iohk is: would it be possible to reconcile gRPC & CBOR? As in, use CBOR/CDDL instead of protobufs 🤔. Surely the CBOR/CDDL couple is harder to handle because it isn't necessarily canonical and can lead to different serialization outcomes. |
Beta Was this translation helpful? Give feedback.
-
Another data point: Not being a gRPC expert at all (last time I have considered using them was probably a decade ago) I have asked around me for more experts advice, eg. from people having concrete experience with gRPC. Some verbatim (translated from French):
|
Beta Was this translation helpful? Give feedback.
-
Having a detailed and unambiguous schema of all the messages exchanged is definitely a must for any kind of distributed system vying for interoperability, but in the case of Cardano gRPC won't really solve this problem because we already have a schema we cannot move away easily from, eg. CDDL. I reckon CDDL is ambiguous, but why not work towards making CDDL unambiguous and complete the schemas we already have. After all, this is just another standard that can evolve. At the end of the day, if most of interactions of interest are full-duplex asynchronous, the benefit of RPC protocol also kind of fades away because AFAICT you cannot express the kind of state machine like behaviour mini-protocols provide, which BTW is not specified either. |
Beta Was this translation helpful? Give feedback.
-
Also, when it comes to performance measures., I would like understand better what kind of throughput and latency we are talking about, what are the requirements or expectations. for what needs, etc. |
Beta Was this translation helpful? Give feedback.
-
As a side note, I would be interested in pointers on ambiguity problems with CDDL/CBOR. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the thorough replies @scarmuega, I will need some time to unpack this but definitely working on it. |
Beta Was this translation helpful? Give feedback.
-
The current approach for node-to-client communication requires to go through custom binary mini-protocols with limited tooling through a unix-socket transport. This is, in my opinion, an huge pain point and entry barrier for devs.
gRPC is a protocol for message passing. It can be put in the same category as Json-RPC, WebSockets and even REST (which is just message passing with opinionated semantics). gRPC is (almost always) coupled with its native serialization format called protobuf: a compact binary codec that requieres and IDL file on both ends to understand the messages.
In the context of Amaru, the proposal is to include a side-by-side gRPC port for the node-to-client interface. It's aimed at clients that need to exchange large payloads with the node with high-throughput and low-latency (think of chain-sync, ledger queries, tx submission, etc)
I open this discussion to go over a trade-off analysis of using gRPC as alternative interface. In particular:
Beta Was this translation helpful? Give feedback.
All reactions