Skip to main content

DISPLACED_PUSH_LOG_SAMPLE

Constant DISPLACED_PUSH_LOG_SAMPLE 

Source
const DISPLACED_PUSH_LOG_SAMPLE: u64 = 100;
Expand description

How often log_displaced_push actually emits a log line, rather than only counting one.

The account whose bound was hit is already known to be at it, so an attacker who has pushed it there once can trigger this branch again for free, from as many caller addresses as it likes — logging every one would make the log itself the thing a flood amplifies. This is one process-wide counter rather than one per account: a per-account count would be the same unbounded-growth shape this fix exists to close, just moved one field over.