You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(p2p): move node name registry into P2PServer (lambdaclass#342)
## 🗒️ Description / Motivation
The `PeerId -> node_name` lookup lived in a global
`RwLock<HashMap<PeerId, &'static str>>` populated once at startup. This
PR moves it into `P2PServer` so 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 to `P2P::spawn` at startup; it also logs how many entries
it loaded.
## Correctness / Behavior Guarantees
- Metric label values (`lean_connected_peers{client="..."}`) are
unchanged for valid configs.
- Bad rows in `validator-config.yaml` (unparseable secp256k1 privkeys)
used to be silently dropped; they now emit a `warn!` per drop and are
still skipped. No new panics, no new failure paths.
- No consensus-layer impact (fork choice, attestations, STF, signatures
untouched).
## Tests Added / Run
- [x] `make fmt`
- [x] `make lint`
- [x] `make test`
## Related Issues / PRs
- Closeslambdaclass#106
---------
Co-authored-by: Tomás Grüner <47506558+MegaRedHand@users.noreply.github.com>
0 commit comments