Skip to main content

Module pointer

Module pointer 

Source
Expand description

Pointer replication (ADR-0016).

Pointers ride the same replication machinery chunks do — the same close groups, the same neighbour-sync rounds and churn triggers, the same quorum, pruning and possession rules — but not the chunk pipeline itself. That pipeline assumes a record never changes and that its key is the hash of its bytes. A pointer’s address is stable while its state changes, and two honest replicas may hold different valid signatures over one state. So a pointer is replicated by state:

  • Fresh. A node that accepts a paid state from a client forwards the record, with the proof that paid for it, to the rest of the close group. Each receiver checks the signature, its own responsibility and the payment itself before storing it.
  • Repair. Every neighbour-sync round pushes hints: the states the sender holds that the receiver should hold. A receiver that lacks a hinted state, or holds an older one, asks the close group which state each holds, adopts the best state a quorum of them hold exactly, and fetches it from one of them. The record verifies itself; the quorum stands in for the payment proof, as presence quorum does for a chunk.
  • Pruning. A record this node has been out of range of for the hysteresis period is deleted — at once if the node is far outside the group, otherwise only once all but one of the current close group prove they hold that state or a newer one by returning a valid record.
  • Possession. Some minutes after offering a fresh state, the node asks each close-group member for the record. A member that is still responsible and cannot produce that state or a newer one is penalised.

Requests go only to peers that have sent a pointer message themselves (see PointerReplication::is_capable). A peer built before pointers cannot decode them, and saorsa-core counts an unanswered request against the peer it was sent to; asking only capable peers keeps older peers out of it. Every neighbour-sync round pushes hints, empty or not, so capability is learned within a cycle.

Structs§

PointerFreshWrite
A pointer state this node accepted from a paying client, to be offered to the rest of its close group.
PointerReplication
Pointer replication for one node. See the module documentation.