-
Notifications
You must be signed in to change notification settings - Fork 149
Description
tl;dr: Implement the equivalent of Beacon API Eventstream
There is an issue in Glados to measure content propagation latency in the portal network, this is particularly relevant to the goal of serving tip data on Portal.
Using https://lab.ethpandaops.io/beacon/slot/live?network=mainnet as inspiration on how this could look down the line a similar approach can be used.
EthPandaops uses Xatu to collect and process the data from their own nodes and also nodes from the community. The data flow looks something like this:
graph LR;
nodeA[Beacon Node] --> sentryA[Xatu Sentry*];
nodeB[Beacon Node] --> sentryB[Xatu Sentry*];
sentryA --> pandas[EthPandaOps];
sentryB --> pandas;
pandas --> pipeline[Data Pipeline];
pipeline --> viz[The Lab Visualization];
- Fun fact: most of the complexity (it is relatively simple) of Xatu Sentry is logic to measure and fix clock offsets
A possible future approach can be to add Portal support to Xatu, and also collecting data from community nodes, but for the time being the proposed data flow is the following:
graph LR;
trinA[Trin Node] --> glados[Glados];
trinB[Trin Node] --> glados;
Currently Glados calls Portal nodes when making audits and census. Since measuring content propagation latency is out of scope for Trin (and all Portal clients), gossip events should not be stored in Trin, but just sent to Glados which can store them and do the computations to measure latency. Given this a Push approach makes more sense than a polling one
Xatu gets data from Beacon Nodes using the Beacon API Eventstream which uses Server-Sent Events (SSE). It appears that there were no strong opinions when selecting this technology for the Beacon Streaming API protocol.
Using SSE will make it easier to eventually add Portal support to Xatu and make it easier for other Beacon API clients to use Portal. The downside for Trin is that jsonrpsee
does not support SSE, which means having to break the jsonrpsee
abstraction and using hyper
directly.
For the first iteration only the OFFER events would be available in the Eventstream API