Skip to main content

Module registration

Module registration 

Source
Expand description

Node-layer DHT registration tasks.

A registration task is a built-in periodic node-side publisher. The shared publisher owns the heartbeat of the online-node, onion-exit and DNS-relay service registries.

Boundedness (#918): a registry carrier is a data topic, so each descriptor expires individually at its dot’s issue time plus the data element horizon H = EntryKind::Data.max_lifetime_ms() unless it is written again. A descriptor is a signed lease of length Λ (registry_lease) whose bytes are fixed, so a heartbeat re-appends the same bytes, which raises their dot and writes no remove, and reads nothing. A registrant therefore writes no remove at all, and leaves at most ⌈H / (Λ − 2I)⌉ + 1 descriptors within the horizon (13 at the defaults); the element cap keeps the newest dots, so superseded leases, which no heartbeat refreshes, are the first it drops. No publisher compacts; a reset floor stamped by one owner would erase every concurrent descriptor that owner never received (#867).

Ghost bound (removal-stability paper, Prop. 10): a registrant that stops at t_s is listed until at most t_s + T + σ while nobody re-appends its bytes, and until at most its signed lease end ℓ ≤ t_s + Λ against any writer or syncer.

Trigger (#855): a registration publishes at every heartbeat, and once more at its node’s first admitted edge after a heartbeat that began with none (republish_due). Such a heartbeat settled at the node alone, and the early publish routes the same lease through the edge to the registry’s owners. It is a heartbeat of the lease like any other, so the boundedness law and the ghost bound hold as stated.

Structs§

DhtRegistrationPublisher
Common publisher for DHT-backed registries: the heartbeat of a signed lease (#918; removal-stability paper, Law 8).
LeaseTerms
The terms of a registry lease: the signed lease end ℓ and freshness window T every descriptor of the lease carries (see the lease law of descriptor).
OnlineNodeRegistration
Online-node registry task.
RegistrationContext
Capability passed to registration tasks.
TimingKeys
The settings that schedule one registry, as its timing errors name them.

Traits§

LeaseDescriptors
The descriptors one registration publishes under a lease: one ([D; 1]) or one per service (Vec<D>), so a caller gets back exactly the shape it built.
RegistrationTask
Periodic node-layer registration.

Functions§

registry_refresh_bound
The heartbeat interval I below which a registry stays fresh: half the lease, Λ / 2.
validate_schedule
Validate a registry’s scheduling: the heartbeat interval is below the descriptor TTL and below registry_refresh_bound, and the TTL is at most the registry lease; an error names the settings in keys.