AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 20 Bitcoin

log: don't rate-limit "new peer" with -debug=net

Public commit record

What the developer wrote

Authored by 0xb10c

88/100 · Strong
log: don't rate-limit "new peer" with -debug=net

Previously, when `debug=net` is enabled, we log "New [..] peer connected"
for new inbound peers with `LogInfo`. However, `LogInfo` will get
rate-limited since https://github.com/bitcoin/bitcoin/pull/32604.
When we specifically turn on `debug=net`, we don't want these log
messages to be rate-limited.

To fix this, use `LogDebug(BCLog::NET, ...)` for potentially high-
rate inbound connections. Otherwise use `LogInfo`. This means we
don't rate-limit the messages for inbound peers when `debug=net`
is turned on but will rate-limit if we created outbound at a high
rate as these are logged via `LogInfo`.

--

I ran into this message getting rate-limited on one of my monitoring
nodes with `-logsourcelocations=1`: With logsourcelocations, one of
these lines is about 338 chars (or 338 bytes) long. We rate-limit
after more than 1048576 bytes per hour, which results in about
3100 in- and outbound connections per hour. With evicted and
instantly reconnecting connections from an entity like LinkingLion,
this can be reached fairly quickly.

Co-Authored-By: Eugene Siegel <elzeigel@gmail.com>
Co-Authored-By: Anthony Towns <aj@erisian.com.au>
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a logging issue in Bitcoin Core. Previously, 'new peer connected' log messages for inbound connections were written using the standard LogInfo path, which became rate-limited after a recent change. When a node operator turns on debug=net to monitor network activity, those messages could be suppressed. The fix moves inbound peer messages to LogDebug so they are not rate-limited when debug=net is enabled, while outbound peer messages remain as LogInfo and continue to be rate-limited. This is a usability/monitoring fix, not a security vulnerability fix.

Recommended action

No urgent action required. This is a minor logging improvement. Operators running monitoring nodes with debug=net and logsourcelocations=1 should benefit from restored visibility of inbound peer connections. Reviewers may confirm the lambda preserves the original log format and that no sensitive data is newly exposed.

Security signals we found

01

Rate-limited diagnostic logging could reduce visibility during network abuse or reconnaissance

02

No cryptographic, consensus, memory-safety, or authorization change

03

Change is purely in logging path and does not alter peer handling logic

Risk score

Why this scored 20/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 1/15
Affected reach 2/15
Confidence 9/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.