refactor(p2p): move node name registry into P2PServer#342
Draft
conache wants to merge 2 commits intolambdaclass:mainfrom
Draft
refactor(p2p): move node name registry into P2PServer#342conache wants to merge 2 commits intolambdaclass:mainfrom
conache wants to merge 2 commits intolambdaclass:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗒️ Description / Motivation
The
PeerId -> node_namelookup lived in a globalRwLock<HashMap<PeerId, &'static str>>populated once at startup. This PR moves it intoP2PServerso the actor owns its own state.What Changed
crates/net/p2p/src/lib.rs: the registry is now a field on the P2P actor's state struct, with a small helper to resolve a peer's name.crates/net/p2p/src/metrics.rs: no longer owns the registry — its peer-event helpers take the resolved name directly.bin/ethlambda/src/main.rs: the loader now returns the map and hands it off toP2P::spawnat startup; it also logs how many entries it loaded.Correctness / Behavior Guarantees
lean_connected_peers{client="..."}) are unchanged for valid configs.validator-config.yaml(unparseable secp256k1 privkeys) used to be silently dropped; they now emit awarn!per drop and are still skipped. No new panics, no new failure paths.Tests Added / Run
make fmtmake lintmake testRelated Issues / PRs