aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/sync.rs
Commit message (Collapse)AuthorAgeFilesLines
* sync: a message carries the signatures of its changestv2026-11-091-33/+15
| | | | | | | | | | | | | | | A sync message carried the signatures its peer wasn't sent yet, by a cursor per peer. Changes sent again, as after a message taken as delivered and lost on the way, went without them: the peer was past them. Under a policy requiring signatures they waited until the writer's next signed change, or the next session. A message now carries the signatures of the changes it carries (Signatures::for_changes), whatever the peer was sent before: changes sent again arrive vouched for as the first time. Past 256 (a message carrying the batches of many writers), each writer's latest instead, as a delta carries. The cursor goes, and with it resetting it after a failed send or a new session.
* sync: signatures sent again after a failed sendtv2026-11-091-6/+16
| | | | | | | | | | A sync message whose send fails gives back the changes it carried: the next message takes them again. The signatures it carried weren't given back: the peer's cursor stayed past them, so the changes went again without them, and under a policy requiring signatures waited for them until the next session; SIGNATURES no longer covers that. A failed send now sends the peer all signatures again with the next changes (each actor's latest, a few hundred at most).
* sync: signatures go with changes onlytv2026-11-081-2/+12
| | | | | | | | | | | A sync message took the signatures its peer wasn't sent yet whenever it had a body, an Automerge message saying only what we have included. A signature belongs with the changes it vouches for: they go along the trees, and a peer that got them elsewhere got the signatures with them. Signatures now go in a message that carries changes (pushed, offered as a delta, or in an Automerge message carrying some: SyncSession:: carrying), and in no other.
* signatures: sign what is senttv2026-11-081-0/+3
| | | | | | | | | | | | | | | | | | | A node signed its changes no rule signs a while after them (--sign-every 1s): the change left at once, unsigned, and its signature followed on its own a second later, to every neighbour, over every link. A few writes made a cascade of SIGNATURES. Under a policy requiring signatures it signed every change as it was made instead. A node now signs its latest change, if no signature vouches for it, as a sync message takes it (--sign-every sent, the default): the signature leaves in the same message, and goes where the change goes. One signature per message, however many changes it carries, each vouching for those before it: a slow writer's every change is signed, a fast writer's batches are, at no threshold to pick. A policy requiring signatures signs what is sent too, even with `none`. `all` still signs every change as it is made; changes to protocol data, listed paths and ?signed=true writes are signed as they are made, as before. The interval, and the task signing on it, go.
* screen: signatures required as the policy a change came under saystv2026-11-081-13/+9
| | | | | | | | | | | | | | | | | | | | | Review 3, R1: what a node received was vouched for only while its own document's policy required signatures. A joiner's first sync, and every node's message bringing `required`, went in by the rules alone: a malicious first peer could plant changes under other members' actors at their next seqs, their real ones then failing as duplicates for good. The signatures a message carries are always offered now, and the screen always has them: a change waits for one where the policy at the heads it is judged at requires it (rules::Reads::required, read once per heads), whatever the receiving document holds. Changes written under a policy not requiring signatures wait for none, as on every other node; the check for forged changes runs always. Changes waiting for a signature are judged again whenever signatures come. The test of signatures required now takes the history into an empty document; a new one takes changes written under a policy not requiring them without any.
* screen: what a node receives judged, policy or nottv2026-11-081-7/+7
| | | | | | | | | | | | | | | | | | | | | Review 2, N7: a node screened received changes only while its own document had a policy it enforces. A joiner's empty document has none, so its first sync, as much history as the node it joins through chose, was applied unjudged, and under signatures required unvouched; the same for any node while the policy's own change arrived with later ones. Sync messages, deltas and downloaded changes are now always screened, each change judged by the policy at its dependencies (1135), so the verdicts are the swarm's. While neither the document nor the changes hold a policy (none touches a "policy" key: inspect::touch_key), only an epoch's root is judged and nothing is placed: bench_screening, after 1188, measured placing everything at about as much again as applying (564 ms + 543 ms for 100 000 changes), judging by the rules at about five times (+2.5 s), which a document with a policy pays anyway. access.md no longer lists the joiner's first sync, nor nodes agreeing only as the policy reaches them (judged at the dependencies, they agree), as left to do; changes::load_delta is for tests now.
* screen: a signature vouches for its change and what it builds ontv2026-11-081-0/+3
| | | | | | | | | | | | | | | Review finding 5: vouching by (actor, seq) isn't bound to a hash. A member can make a change under another member's actor at a seq that member's signature covers. The change is then taken as vouched, and if it breaks a rule, the honest member is refused as a whole and logged as the one whose own change broke the rules. A signature now vouches for its change and the changes of its actor it builds on: in the document, as before; among received changes, those it reaches through the batch's dependencies. A received change under an actor at a seq whose change the document holds (a signature verified up to it) is a fork: refused as forged, never as its actor's node's, not told back in REFUSALS, and logged with the peer that brought it.
* sync: a member refused as a whole, synced with again once it changed documenttv2026-11-081-3/+21
| | | | | | | | | | | | A node refusing a member as a whole sent it nothing, and lifted that only when a change of the member's was taken again. But a member that dropped what was refused (REFUSALS) starts its sync sessions over, and a fresh session sends no changes until the other side answers: the two waited for each other, and the member stayed refused. The refusal now notes the member's run and epoch_seq when it began; a member with another document since (it dropped what was refused, or rejoined) is synced with again.
* swarm: changes taken unjudged, dropped (REFUSALS)tv2026-11-071-4/+15
| | | | | | | | | A node refusing changes a peer brought tells it which broke a rule; the peer judges them itself, and if its rules refuse them too, drops them with all built on them (its document forked without them, a fresh actor), quarantining its own writes among them. Wire version 42. Auth plan M6 (rejoin on taint).
* access: members refused as a wholetv2026-11-071-0/+8
| | | | | | | | | With signatures required, a member whose own change broke a rule is refused as a whole: sent nothing, shown in /peers (refused), in stats (sync.refusedPeers) and on the dashboard, until a change of its is taken again or the epoch changes. Auth plan M6 (diverged standing).
* access: refused oncetv2026-11-071-5/+28
| | | | | | | | A refused change is remembered by its hash: offered again it is refused without decoding, judging or logging, so is one built on it, and a peer offering nothing else is answered later each time, up to a minute. Auth plan M6 (re-sending).
* access: signatures requiredtv2026-11-071-5/+20
| | | | | | | | "signatures": "required": a change counts only once a signature by its committer vouches for it, and waits until then; every node then signs every change it makes. Auth plan M6.
* access: the policy enforcedtv2026-11-071-2/+31
| | | | | | | | _continuum/access/policy ({"version": 1}) has every node screen every change it receives, on every path changes come in. A policy a node doesn't know stops its writes through the API. GET /admin/refused. Auth plan M6.
* signatures: with sync messagestv2026-11-071-1/+40
| | | | | | | Sync messages carry, for each actor's writes, the latest signature the sender checked; the receiver checks it once it holds the change. Auth plan M5.
* HyParView (slim)tv2026-11-061-3/+6
|
* dissemination traittv2026-11-061-3/+6
|
* trees at runtimetv2026-11-061-0/+3
|
* delta end guardedtv2026-11-061-7/+23
|
* writers own treetv2026-11-061-1/+46
|
* asks by askertv2026-11-051-0/+1
|
* offerer asked firsttv2026-11-051-0/+1
|
* answering behind countedtv2026-11-051-2/+7
|
* one walk sincetv2026-11-051-11/+9
|
* no bloom bytestv2026-11-051-3/+3
|
* no epoch tag measuretv2026-11-051-3/+1
|
* waiting not twicetv2026-11-051-1/+8
|
* offer answerstv2026-11-051-0/+11
|
* push by defaulttv2026-11-051-5/+4
|
* broken pushes refusedtv2026-11-051-14/+7
|
* pushed have is the senders headstv2026-11-051-5/+1
|
* push only below deflatetv2026-11-051-2/+8
|
* push changes experimenttv2026-11-051-16/+78
|
* deflate blob chunkstv2026-11-051-5/+32
|
* epoch tag in synctv2026-11-051-6/+13
|
* no swarm ID in synctv2026-11-051-22/+7
|
* announce only to those behindtv2026-11-051-0/+3
|
* measure sync envelopestv2026-11-051-0/+10
|
* asked known elsewheretv2026-11-051-1/+4
|
* covered neighbours have ittv2026-11-051-8/+13
|
* new changes per messagetv2026-11-051-1/+2
|
* delta from held headstv2026-11-051-1/+4
|
* offer again ungeneratedtv2026-11-051-32/+53
|
* stale delta offerstv2026-11-051-0/+19
|
* delta known to sendertv2026-11-051-1/+7
|
* delta propagationtv2026-11-051-1/+17
|
* one delta at a timetv2026-11-041-2/+15
|
* log why a deltatv2026-11-041-0/+6
|
* offered deltas lapsetv2026-11-041-4/+14
|
* throughput from delivered messagetv2026-11-041-0/+9
|
* hop delaystv2026-11-041-1/+10
|