Skip to content

fix(p2p): send the client version as the identify agent version - #675

Merged
ilitteri merged 1 commit into
lambdaclass:beacon-chain-integrationfrom
MysticRyuujin:identify-agent-version
Oct 8, 2026
Merged

ilitteri merged 1 commit into
lambdaclass:beacon-chain-integrationfrom
MysticRyuujin:identify-agent-version

Conversation

@MysticRyuujin

Copy link
Copy Markdown

🗒️ Description / Motivation

The libp2p identify reply does not contain the client name. build_swarm does not call identify::Config::with_agent_version, so rust-libp2p sends its default agent version: rust-libp2p/0.48.0.

Network crawlers read the identify agentVersion to identify the client of a consensus-layer peer. Because of this, ethlambda nodes show as rust-libp2p, and crawlers cannot tell them apart from other rust-libp2p peers.

What Changed

  • crates/net/p2p/src/lib.rs: add SwarmConfig::agent_version and give it to the identify config with with_agent_version.
  • bin/ethlambda/src/main.rs: set agent_version to version::CLIENT_VERSION. This is the same string as /eth/v1/node/version and engine_getClientVersionV1, for example ethlambda/v0.1.0-<branch>-<sha>/<target>/rustc-v<version>.
  • Test SwarmConfig literals: set agent_version: "ethlambda/test".
  • New test identify_reports_the_configured_agent_version: two lean swarms connect, and the dialer reads the agent version from the identify reply of the listener.

Correctness / Behavior Guarantees

  • The identify protocolVersion does not change (eth2/1.0.0 on beacon, /ipfs/0.1.0 on lean).
  • The only change on the wire is the agentVersion string. It applies to the lean and the beacon networks.

Tests Added / Run

  • identify_reports_the_configured_agent_version. Without the fix, it fails with left: "rust-libp2p/0.48.0".
  • cargo test --locked -p ethlambda-p2p --lib: 209 passed, 1 ignored.
  • cargo clippy --locked -p ethlambda-p2p -p ethlambda --all-targets -- -D warnings: clean.
  • cargo fmt --all --check: clean.

Related Issues / PRs

  • None.

✅ Verification Checklist

  • Ran make fmt — clean
  • Ran make lint (clippy with -D warnings) — clean (ran clippy on the two changed crates, not the full workspace)
  • Ran make test (test-consensus plus test-node, at release-fast) — all passing (ran the ethlambda-p2p unit tests only)

@MegaRedHand MegaRedHand left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@ilitteri
ilitteri merged commit 3385521 into lambdaclass:beacon-chain-integration Oct 8, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants