Skip to content

Add an Eventsream endpoint #1805

@Ktl-XV

Description

@Ktl-XV

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];
Loading
  • 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;
Loading

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions