Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: recognize grandine from agentVersion #6808

Merged
merged 2 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/pages/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ In an effort to promote client diversity there are several beacon-nodes being de
- [Lighthouse](https://lighthouse.sigmaprime.io/)
- [Teku](https://consensys.net/knowledge-base/ethereum-2/teku/)
- [Nimbus](https://nimbus.team/)
- [Grandine](https://grandine.io)

## Why Client Diversity?

The Ethereum network's robustness is significantly enhanced by its client diversity, whereby multiple, independently-developed clients conforming to a common specification facilitate seamless interaction and function equivalently across nodes. This client variety not only fosters a rich ecosystem but also provides a buffer against network-wide issues stemming from bugs or malicious attacks targeted at particular clients. For instance, during the Shanghai denial-of-service attack in 2016, the diversified client structure enabled the network to withstand the assault, underscoring the resilience afforded by multiple client configurations.

On the consensus layer, client distribution is crucial for maintaining network integrity and finality, ensuring transactions are irreversible once validated. A balanced spread of nodes across various clients helps mitigate risks associated with potential bugs or attacks that could, in extreme cases, derail the consensus process or lead to incorrect chain splits, thereby jeopardizing the network's stability and trust. While the data suggests a dominance of Prysm client on the consensus layer, efforts are ongoing to promote a more even distribution among others like Lighthouse, Teku, and Nimbus. Encouraging the adoption of minority clients, bolstering their documentation, and leveraging real-time client diversity dashboards are among the strategies being employed to enhance client diversity, which in turn fortifies the Ethereum consensus layer against adversities and fosters a healthier decentralized network ecosystem.
On the consensus layer, client distribution is crucial for maintaining network integrity and finality, ensuring transactions are irreversible once validated. A balanced spread of nodes across various clients helps mitigate risks associated with potential bugs or attacks that could, in extreme cases, derail the consensus process or lead to incorrect chain splits, thereby jeopardizing the network's stability and trust. While the data suggests a dominance of Prysm client on the consensus layer, efforts are ongoing to promote a more even distribution among others like Lighthouse, Teku, Nimbus and Grandine. Encouraging the adoption of minority clients, bolstering their documentation, and leveraging real-time client diversity dashboards are among the strategies being employed to enhance client diversity, which in turn fortifies the Ethereum consensus layer against adversities and fosters a healthier decentralized network ecosystem.

The non-finality event in May 2023 on the Ethereum network posed a significant challenge. The issue arose from attestations for a fork, which necessitated state replays to validate the attestations, causing a notable strain on system resources. As a result, nodes fell out of sync, which deterred the accurate tracking of the actual head of the chain. This situation was exacerbated by a decline in attestations during specific epochs, further hampering the consensus mechanism. The Lodestar team noticed late attestations several weeks prior to the event and implemented a feature that attempted to address such challenges by not processing untimely attestations, and thus not requiring expensive state replays​. While it was done for slightly different reasons, the result was the same. Lodestar was able to follow the chain correctly and helped to stabilize the network. This example underscored the importance of client diversity and network resilience against potential forks and replay attacks. These are considered realistic threats, especially in the context of system complexity like in Ethereum's consensus mechanism.

Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/monitoring/clientStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function createProcessStats(process: ProcessType): ClientStats {
clientName: new StaticProperty({
jsonKey: "client_name",
value: CLIENT_NAME,
description: "Name of client, e.g. lodestar, prysm, lighthouse, teku, nimbus",
description: "Name of client, e.g. lodestar, prysm, lighthouse, teku, nimbus, grandine",
}),
clientVersion: new MetricProperty({
jsonKey: "client_version",
Expand Down
2 changes: 2 additions & 0 deletions packages/beacon-node/src/network/peers/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export enum ClientKind {
Teku = "Teku",
Prysm = "Prysm",
Lodestar = "Lodestar",
Grandine = "Grandine",
Unknown = "Unknown",
}

Expand All @@ -21,6 +22,7 @@ export function getKnownClientFromAgentVersion(agentVersion: string): ClientKind
if (agentLC === "teku") return ClientKind.Teku;
if (agentLC === "prysm") return ClientKind.Prysm;
if (agentLC === "nimbus") return ClientKind.Nimbus;
if (agentLC === "grandine") return ClientKind.Grandine;
if (agentLC === "lodestar" || agentLC === "js-libp2p") return ClientKind.Lodestar;

return null;
Expand Down
5 changes: 5 additions & 0 deletions packages/beacon-node/test/unit/network/peers/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ describe("clientFromAgentVersion", () => {
agentVersion: "js-libp2p/0.32.4",
client: ClientKind.Lodestar,
},
{
name: "grandine",
agentVersion: "Grandine/0.4.1-537713d/arm-linux",
client: ClientKind.Grandine,
},
{
name: "unknown client",
agentVersion: "strange-client-agent-version",
Expand Down
Loading