October 1, 2024

Hermes: a monitoring light node for Gossipsub-based networks

Meet Hermes - a light node for the Ethereum network and hopefully soon for several others

We are happy to announce Hermes: a GossipSub listener and tracer for libp2p-based networks. Read on to find out what you can do with Hermes, how it has helped our team, its primary components and our future development plans.

What is Hermes and what can you do with it

Hermes behaves like a light-node and connects to other participants in the network. It relies on a trusted local node that ensures we can reply to any incoming request and maintain stable connections.

Hermes-based experiments aim to measure the efficiency and performance of the GossipSub message broadcasting protocol in any libp2p-based network. Hermes can help developers tune their network’s protocols based on the message propagation latency and control message overhead.

The tool currently supports any Ethereum network (at the Consensus Layer), although there will be more networks supported in the future.

How does it work?

Components

Hermes operates as a single component, the light-node, for each network it is deployed in. However, it has two major requirements to work: 1) a trusted local node that will provide the right view of the chain’s state and 2) an event consumer that will receive all the libp2p traces and will store them. The light-node is responsible for discovering peers, maintain connections with them, and monitor the internal events at the libp2p host.

Light-node

Hermes operates like a standard libp2p node, discovering and connecting to the network while supporting all libp2p protocols to ensure reliable and secure communication. It connects to a trusted local, or remote node for certain RPCs that require chain state information, leveraging these trusted sources to enhance its capabilities.

Hermes subscribes to all available GossipSub topics, allowing it to comprehensively receive, unveil and trace all the interactions with the network. This enables the tool to keep track of network activity efficiently.

Additionally, Hermes can submit these traces to any defined consumer, with current support for AWS Kinesis and Xatu from the Ethereum Foundation (EF). This feature facilitates the integration of network data with analytics and monitoring tools, aiding in the overall security and functionality of the network.

Deployment

Hermes has been developed to run continuously. However, to increase the steadiness of the light-node’s connectivity, the node must successfully respond to chain-oriented RPC calls that remote peers might ask. Since Hermes has been designed to be chain-agnostic, we must rely on an external trusted node to serve that information.

Hermes must be paired with one chain client: in our case and for Ethereum’s Consensus Layer, we used Prysm. Giving Hermes the HTTP API and the gRPC host’s endpoints, Hermes can add itself as a “whitelisted” node, in order to later forward most of the chain- or state-related RPC calls. However, the same Prysm node could be connected to several Hermes instances as the following graph shows, which helps reduce the deployment requirements.

Hermes has been extended to support a different set of data consumers or data streams. Since all the event traces need to be persisted somewhere, the tool offers three different options:

  • AWS Kinesis (our deployment)
  • Xatu callbacks (used by the EF)
  • Trace logger to stdout (for local dev-testing)

If you are interested in using or upgrading the tool to support other networks or data streams, reach out to us through any of the channels listed in our contact page.

What data does Hermes gather

As Hermes maintains stable connections with the rest of the network nodes, it can emit debugging traces of how libp2p and GossipSub work in the wild.

Hermes gathers the following information out of the box from the libp2p host and the GossipSub protocol:

  • Connections and Disconnections from the libp2p host
  • Control GossipSub messages:
    • Subscriptions from other nodes to topics
    • GRAFT and PRUNE control messages
    • GossipSub peer scores
    • IHAVE and IWANT control messages
    • the recent IDONTWANT control messages
  • Sent and received messages
  • Protocol RPCs

This is obviously a very valuable set of data to have, as it covers a large footprint of the behaviour of Gossipsub in a given network. Relatively simple data analysis can reveal very important metrics and inform engineers of the healthy (or not) operation of the protocol. For cases where Gossipsub serves as the block propagation protocol of a blockchain network, having deep insights into these metrics is critical!

How have we used it so far

Hermes has helped the ProbeLab team carry out an extensive study on Gossipsub’s operation on the Ethereum network. We will publish a more comprehensive post with the findings of the study, but until then, here’s the links to our ethresear.ch posts. Happy reading!

Furthermore, the findings from analyzing Hermes’ generated data were a key component for some of the recent optimization upgrades, including the addition of IDONTWANT messages to reduce bandwidth usage caused by duplicate messages. This enhancement, along with improved interoperability between different libp2p implementations, ensures more efficient and reliable communication across the Ethereum network and its multiple implementations. These changes mark an important step forward in streamlining network performance and scalability.

Future plans & how to contribute

Hermes is open-source - its Github repository is: https://github.com/probe-lab/hermes. We welcome Github Issues to discuss with the community, receive feature requests and hear feedback. We also welcome Pull Requests to improve the tool and add features or support for other networks. If you are interested in data from other networks and would like Hermes to support those, reach out to us through any of the channels listed in our contact page.

We hope you’ll enjoy playing around with Hermes. We would love to hear how you’ve used it and any improvements you’ve made.

Recent blog