Skip to main content

Module paid_list

Module paid_list 

Source
Expand description

Persistent PaidForList backed by LMDB.

Tracks keys this node believes are paid-authorized. Survives restarts (Invariant 15). A retained record keeps the entry that authorises its repair, so entries stay until the list nears its store’s capacity (ADR-0028). Then entries far outside this node’s range go first, and those of records it still stores stay.

§Storage layout

{root}/paid_list.mdb/           -- LMDB environment directory
{root}/record_out_of_range.bin  -- saved `RecordOutOfRangeFirstSeen` clocks

One unnamed database stores set membership: key = 32-byte XorName, value = empty byte slice. Keys sort by their bytes, so the keys sharing a prefix with a given key are one contiguous range.

Structs§

PaidList
Persistent paid-for-list backed by LMDB.

Constants§

XORNAME_BITS
Bits in a key. A key is near any other within this many low bits.

Functions§

near_bits_for_radius
How many low bits of a key may differ from this node’s for the key to count as near it, given the distance to its farthest paid-close-group peer.