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 eligible to be erased, never due (ADR-0028): while the disk has room it is kept and nobody is asked. Under disk pressure it is erased only once all but one of the current close group prove they hold that state or a newer one by returning a valid record, however far outside the group the node has moved. Each pass tries candidates farthest from this node first, then those whose proof failed, oldest failure first, and asks each one’s group at once, so candidates nobody can prove yet never keep the rest from a turn. A record whose group has too few capable members to prove it is kept until it has enough.
  • 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 — unless it holds a different final state, which is a fork its owner made and not a failure to store.
  • Finality. Before taking a final state it does not hold, from a client or a fresh offer, a node asks the close group whether a different final state is already held, and refuses if a peer proves one with the signed record (ADR-0018). See PointerReplication::check_final.

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.

Constants§

FINAL_STATE_CHECK_BUDGET
How long a node spends asking its close group for a conflicting final state before taking one (ADR-0018).
FINAL_STATE_CHECK_STRIPES
How many finality checks run at once.
FINAL_STATE_CHECK_WAIT
How long a finality check waits for its turn before it gives up and answers FinalityCheck::Busy.
FINAL_STATE_CLEAR_REUSE
How long a look that found no conflict answers again for the same final state without asking anyone.