Skip to main content

Module surb_store

Module surb_store 

Source

StructsΒ§

AdmittedRing πŸ”’
An admitted ring together with the number naming the admission that installed it.
EvictionCounts πŸ”’
Evictions from one cache in one report interval, by cause.
EvictionReport πŸ”’
The counts of one closed report interval, ready to be logged.
EvictionStats πŸ”’
Eviction counts per cache and cause, reported once per interval (GNO-793: per-entry lines flooded the log).
GenerationalBuffer πŸ”’
The mutex-protected state of a SurbRingBuffer: the SURBs, in their two tiers, and the highest generation seen.
IntervalState πŸ”’
The interval being counted right now.
MemorySurbStore
Basic SurbStore implementation based on an in-memory cache.
PoppedSurb
Represents a single SURB along with its ID popped from the SurbRingBuffer.
SurbRingBuffer
Ring buffer of SURBs and their IDs, all belonging to one pseudonym and therefore identified only by [HoprSurbId].
SurbStoreConfig
Configuration for the SURB cache.

EnumsΒ§

EvictedCache πŸ”’
Which of the store’s caches shed an entry. Doubles as the cache label on metrics and log lines.
MadeRoom πŸ”’
What GenerationalBuffer::make_room_for did to a full buffer.
SurbPopOrder
Which end of the per-pseudonym buffer a pop consumes from. Replying side only.

ConstantsΒ§

DEFAULT_PENDING_SURB_MAX_BYTES
Default byte budget for each of the two Entry-side SURB maps.
MAXIMUM_PENDING_SURB_MAX_BYTES
Ceiling on SurbStoreConfig::pending_surb_max_bytes: 4 GiB per map.
MINIMUM_EVICTION_REPORT_INTERVAL
Lower bound on SurbStoreConfig::eviction_report_interval, enforced by the config validator.
MINIMUM_OPENERS_PER_PSEUDONYM πŸ”’
MINIMUM_OPENER_LIFETIME πŸ”’
MINIMUM_OPENER_PSEUDONYMS πŸ”’
MINIMUM_PENDING_SURB_MAX_BYTES
Floor on the byte budget of each Entry-side SURB map: 85 MB, about what the fixed 100 000-record cap of the pending map used, measured at roughly 840 B per record in the cache it was built on (hoprnet#8624).
MINIMUM_QUARANTINE_PSEUDONYMS πŸ”’
Lower bound on SurbStoreConfig::quarantine_max_pseudonyms, enforced by the config validator.
MINIMUM_QUARANTINE_RB_CAPACITY πŸ”’
Lower bound on SurbStoreConfig::quarantine_rb_capacity, enforced by the config validator.
MINIMUM_SURB_LIFETIME
Lower bound on SurbStoreConfig::pseudonyms_lifetime, enforced by the config validator.
MIN_SURB_RB_CAPACITY πŸ”’

StaticsΒ§

ADMISSION_EPOCHS πŸ”’
Mints the number naming each admission of a pseudonym, process-wide.

TraitsΒ§

SurbShareInfo
Which SSA the PIX share sealed in a SURB belongs to.

FunctionsΒ§

default_admitted_headroom_percent πŸ”’
default_admitted_max_pseudonyms πŸ”’
default_distress_threshold πŸ”’
default_eviction_report_interval πŸ”’
default_eviction_report_threshold πŸ”’
default_max_openers_per_pseudonym πŸ”’
default_max_pseudonyms πŸ”’
default_pending_surb_max_bytes πŸ”’
default_pseudonyms_lifetime πŸ”’
default_quarantine_lifetime πŸ”’
default_quarantine_max_pseudonyms πŸ”’
default_quarantine_rb_capacity πŸ”’
default_quarantine_surb_budget πŸ”’
default_rb_capacity πŸ”’
default_reply_opener_lifetime πŸ”’
generation_is_newer πŸ”’
RFC-1982 serial-number comparison over a u8 generation: is a strictly newer than b?
next_admission_epoch πŸ”’
Takes the next admission number. Never zero β€” see ADMISSION_EPOCHS.
refund_quarantine_budget πŸ”’
Subtracts n from the quarantine SURB budget, clamping at zero instead of wrapping.
validate_eviction_report_interval πŸ”’
validate_pseudonyms_lifetime πŸ”’
validate_quarantine_lifetime πŸ”’
validate_reply_opener_lifetime πŸ”’