Page MenuHomePhabricator

Do not make it trivial for inbound peers to generate log entries
ClosedPublic

Authored by dagurval on Jan 16 2019, 08:46.

Details

Summary

https://github.com/bitcoin/bitcoin/pull/11583

We should generally avoid writing to debug.log unconditionally for
inbound peers which misbehave (the peer being about to be banned
being an exception, since they cannot do this twice).

To avoid removing logs for outbound peers, a new log is added to
notify users when a new outbound peer is connected which mimics
the version print.

This is a backport of Core PR11583

Test Plan

CI

Diff Detail

Repository
rABC Bitcoin ABC
Branch
logfix
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 4540
Build 7143: Bitcoin ABC Buildbot (legacy)
Build 7142: arc lint + arc unit

Event Timeline

dagurval retitled this revision from Do not make it trivial for inbound peers to generate log entries https://github.com/bitcoin/bitcoin/pull/11583 to Do not make it trivial for inbound peers to generate log entries.Jan 16 2019, 08:47
dagurval edited the summary of this revision. (Show Details)
deadalnix requested changes to this revision.Jan 17 2019, 02:11

Thanks, it is a great find.

Please also backport the added comment. In our codebase, it would be in logging.h instead of util.h .

This revision now requires changes to proceed.Jan 17 2019, 02:11

Port over missing comment

Fabien requested changes to this revision.Jan 17 2019, 13:41
Fabien added a subscriber: Fabien.

One nit, good otherwise

src/net_processing.cpp
2663 ↗(On Diff #6710)

There is a missing else here

This revision now requires changes to proceed.Jan 17 2019, 13:41
This revision is now accepted and ready to land.Jan 18 2019, 12:13
This revision was automatically updated to reflect the committed changes.