Skip to main content

MAX_HINT_SOURCES_PER_KEY

Constant MAX_HINT_SOURCES_PER_KEY 

Source
pub const MAX_HINT_SOURCES_PER_KEY: usize = 8;
Expand description

Maximum distinct hint sources retained per pending key.

MAX_PENDING_VERIFY bounds unique keys, not the peers remembered against each one. Duplicate advertisements take the AlreadyPresent path, which merges the advertiser into two per-key sets plus the reverse index at no capacity cost — and re-advertising an already-pending key is the cheapest path through admission, since is_relevant short-circuits on it without even a routing-table lookup. Left unbounded, N routing-table peers re-advertising a full queue costs N * MAX_PENDING_VERIFY associations against a cap that only ever counted keys.

Sized at the close-group width: source diversity is only useful as fetch candidates and corroboration weight, and both saturate well before this. See ReplicationQueues::add_pending_verify for the retention policy that decides which sources survive the cap.