Repository navigation
fix: cap gossipsub's log output at ERROR unless RUST_LOG raises it - #719
pablodeymo wants to merge 1 commit into
Conversation
A beacon node logs `WARN libp2p_gossipsub::behaviour: Send Queue full. Could not send Rpc.` once per heartbeat for every slow peer, each line listing every IHAVE id dropped on an attestation subnet. The drop is already counted in the peer's failed-message tally and charged to its score, and gossipsub's other warnings are per-peer protocol violations the scoring handles too, so the node's default filter now reads `info,libp2p_gossipsub=error`. `RUST_LOG=libp2p_gossipsub=warn` lifts the cap: the env directive on the same target replaces the built-in one, while directives on other targets add to it and keep replacing the `info` floor the way `from_env_lossy` always let them. The floor is spelled out rather than passed as the default directive because `EnvFilter` only falls back to that default when it was given no directive at all. Three tests drive events through the filter for each of those cases.
🤖 Kimi Code ReviewI'll review this PR focusing on logging filter changes and test additions. Overall AssessmentThis is a well-crafted, focused PR that addresses operational noise from gossipsub warnings. The code is generally correct, well-tested, and follows Rust idioms. I have a few minor concerns. Issues Found1. Potential deadlock in test helper (
|
| Location | Change | Priority |
|---|---|---|
main.rs:2324 |
Improve expect message to "test sink mutex poisoned" |
Low |
main.rs:2284–2292 |
Add inline comment about asymmetric directive ordering | Low |
main.rs:2360+ |
Add test for RUST_LOG="warn" broad level with cap |
Low |
docs/beacon_wire.md:851 |
Clarify that errors still appear | Very low |
Security Assessment
No security issues identified. This change does not affect:
- Signature verification
- State transition logic
- Network message handling (only log filtering)
- Cryptographic operations
The EnvFilter::parse_lossy usage correctly prevents DoS via malformed RUST_LOG values.
Automated review by Kimi (Moonshot AI) · kimi-k2.6 · custom prompt
🤖 Codex Code ReviewLooks good overall. The change is narrowly scoped to logging behavior and docs/tests; I don’t see any consensus, state-transition, SSZ, attestation, or signature-path risk in this diff.
Minor note:
Validation note:
Automated review by OpenAI Codex · gpt-5.4 · custom prompt |
🤖 Claude Code ReviewReview of PR 719: cap
|
🗒️ Description / Motivation
WARN libp2p_gossipsub::behaviour: Send Queue full. Could not send Rpc.once per heartbeat for every slow peer, each line listing every IHAVE id dropped on an attestation subnet. The drop is already counted in the peer'sfailed_messagesand charged to its score, so the line adds noise, not information.libp2p_gossipsubanddiscv5output to separate files.What Changed
bin/ethlambda/src/main.rs:init_node_loggingbuilds its filter fromnode_log_filter(RUST_LOG). With noRUST_LOGthe directives areinfo,libp2p_gossipsub=error; with one they arelibp2p_gossipsub=error,<RUST_LOG>. ARUST_LOGdirective onlibp2p_gossipsubreplaces the cap, one on any other target adds to it, andRUST_LOGkeeps replacing theinfofloor the wayfrom_env_lossyalways did. The floor is spelled out becauseEnvFilteronly applies a default directive when it was given no directive at all.docs/beacon_wire.md: one sentence next to the existingRUST_LOGexample, saying how to see gossipsub's warnings.Correctness / Behavior Guarantees
libp2p_gossipsubtarget: WARN and below are dropped, ERROR stays.RUST_LOGsemantics are preserved, including the pre-existing quirk that aRUST_LOGwithout its owninfosilences other targets. Verified against tracing-subscriber 0.3.23: an equal-specificity directive added later replaces the earlier one, andOrdering::Equalimplies the same target, so no other directive is clobbered.RUST_LOG=debugkeeps the cap, since the more specific directive wins; the doc comment says to name the crate.Tests Added / Run
main.rsdrive real events through the filter: default behaviour (INFO floor, gossipsub WARN dropped, gossipsub ERROR kept), the lift viaRUST_LOG=…,libp2p_gossipsub=warn,…alongside another directive, and the floor-replacement quirk.cargo test --locked --profile release-fast -p ethlambda --bin ethlambda -- tests::node_logging tests::rust_log: 3 passed.cargo clippy --locked -p ethlambda --all-targets -- -D warnings: clean.cargo fmt --all -- --check: clean.Related Issues / PRs
Event::SlowPeer. Lighthouse reports a peer after more than 10 priority or 10 non-priority drops, so the peer producing these lines gets disconnected instead of staying in the mesh.✅ Verification Checklist
make fmt— cleanmake lint(clippy with-D warnings) — run ascargo clippy -p ethlambda --all-targets -- -D warnings, the only crate changed; CI runs the workspacemake test(test-consensusplustest-node, atrelease-fast) — the three new tests run atrelease-fast; CI runs the rest