This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
Replies: 1 comment 2 replies
-
Nice write-up 👌 I just see one non-critical question: on whether we want to refuse the handshake in case that one element in I guess we'll prefer at first to accept the stream even in case that some positions are incorrect for some source subnet (e.g, mismatch between given cert id and position, or the position is way too far in the future, etc) So that we avoid stalling the entire testing system in case of issue with the history of one subnet |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This proposal is here to define a starting point on how to handle the different kind of input that can be sent to the TCE gRPC server from any client.
We will try to define a unique API for any clients using this gRPC entrypoint. The goal is to allow anyone to define a context to drive what certificates are pushing to the stream.
For simplicity, I’ll only talk about
target stream
, meaning that only certificate which targets a particular subnet are going to be pushed.Opening the stream
After negotiating and handshake between the client and the server, the stream needs to know what certificates send. To do so, the client needs to use the
OpenStream
message in order to define a context that can be used by the server.The
OpenStream
message is defining aTargetCheckpoint
that contains various information:target_subnet_ids
: A list of targeted subnet ids that the client is interested in receiving the certificates. This field can't be empty and need at least one subnet_id.positions
: A list ofTargetSubnetPosition
that define the local state of the client.In the next sections, I’m going to use a state representing the state of a TCE node internally, such as:
The
subnet_A
is having 7 certificates targeting it, it produced 2 certificates.The
subnet_B
is having 2 certificates targeting it, it produced 3 certificates.The
subnet_C
is having 1 certificate targeting it.The
subnet_D
is having 0 certificate targeting it, it produced 3 certificates.The certificate
0x07
is targeting bothsubnet_A
andsubnet_C
.In this example, the
certificate_id
represent some kind of "ordering" across certificates. Meaning that0x03
is coming before0x04
and after0x02
.OpenStream without position
When a client sends this
OpenStream
the server will translate it that way:subnet_A
The server needs to respond with a
StreamOpened
and will start pushing certificates.The response for the current query will be:
OpenStream with position
When a client sends this
OpenStream
the TCE will translate it that way:subnet_A
subnet_B
subnet_D
The server needs to respond with a
StreamOpened
and will start pushing certificates.The response for the current query will be:
OpenStream with multiple subnet_id
Requesting an
OpenStream
with multipletarget_subnet_ids
will return certificates targeting every subnet defined. Duplication will be removed. In our example, the certificate0x07
is both targetingsubnet_A
andsubnet_C
but the TCE is going to push the certificate only one time.CertificatePushed
The pushed certificate message is containing only the certificate. In order to allow the client to track the progress, we have two options:
CertificatePushed
message, containing a list ofTargetStreamPosition
CertificatePushed
it needs to infer the positionI would prefer the first option.
Beta Was this translation helpful? Give feedback.
All reactions