HomePhabricator

log: Mitigate disk filling attacks by rate limiting LogPrintf, LogInfo…

Description

log: Mitigate disk filling attacks by rate limiting LogPrintf, LogInfo, LogWarning, LogError

Summary:

Each source code location is given an hourly logging quota of 1MiB of logging per hour. Logging is only dropped from source locations that exceed the quota.

 - Only logging to disk is rate limited. Logging to console is not rate limited.
 - Printing with the category argument is not rate limited.
 - UpdateTip: new best=[…] is logged without rate limiting. High log volume is expected for that source location during IBD.
 - When logging is restarted a tally of how many bytes were dropped is printed.
 - All logs will be prefixed with [*] if there is at least one source location that is currently being suppressed.

Backport of core#32604.

Depends on D18875.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: PiRK

Differential Revision: https://reviews.bitcoinabc.org/D18881

Details

Provenance
Eugene Siegel <elzeigel@gmail.com>Authored on Jun 5 2025, 17:47
FabienCommitted on Wed, Nov 5, 19:49
FabienPushed on Wed, Nov 5, 19:49
Reviewer
Restricted Project
Differential Revision
D18881: log: Mitigate disk filling attacks by rate limiting LogPrintf, LogInfo, LogWarning, LogError
Parents
rABC3fb2ed2ceb27: Add std::optional support to Boost's equality check
Branches
Unknown
Tags
Unknown