aboutsummaryrefslogtreecommitdiffstats
path: root/src/document/sync.rs
Commit message (Collapse)AuthorAgeFilesLines
* sync: keep what a message asks for, and the heads answered from, sortedtv18 hours1-5/+13
| | | | | | | Automerge encodes the hashes of a sync message sorted, and asserts so: the hashes asked for that changes waiting in screening lack were added after those Automerge asks for, unsorted, and the heads a peer last said that we hold were taken as the peer's `have` as they came. Both are sorted now.
* sync: send a peer all it lacks past what still counts as senttv18 hours1-0/+92
| | | | | | | | | | | Messages taken as delivered and lost, more of them than still count as sent, leave a peer lacking changes we take it to have. Asking for the first of them, it got that one alone, and asked for the next once that arrived, a change per round trip; or, asking for our heads alone, the last of them again and again. When a peer needs a change in the history of the heads we share that no longer counts as sent, the session answers as if it had said it has nothing since the latest heads it said that we hold (`lost_beyond_sent`): everything since goes in one message.
* sync: ask for what changes waiting in screening lacktv18 hours1-1/+43
| | | | | | | | | | Screening keeps a change whose dependencies haven't come from Automerge, waiting, so Automerge never learns what it lacks: our next message asks for the peer's heads alone, and the peer, forgetting having sent those, sends them again, and what they build on only as far as it still counts it as sent. So the session asks for what changes waiting build on and the document lacks too (`Waiting::lacking`, `SyncSession::lacks`), as Automerge asks for what the changes it holds back lack.
* sync: a message carries the signatures of its changestv9 days1-3/+3
| | | | | | | | | | | | | | | 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: a test exchanging until level, not one answertv9 days1-0/+17
| | | | | | | | | delivered_messages_are_answered_with_changes_we_lack failed now and then: after the answer, the node still lacked the peer's change. Automerge's sync tells what each side has by a Bloom filter, whose false positives take more rounds. The test now exchanges up to four rounds more, each asking for what is still missing, until both are level.
* sync: signatures go with changes onlytv9 days1-0/+7
| | | | | | | | | | | 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.
* document: tell whether a document holds a change without building ittv9 days1-11/+12
| | | | | | | | | | | | | | | With the policy's reads kept, judging a change still costs about one read (some 3.5 µs), and so does judging without a policy: what is left is At::new, which asks get_change_by_hash for each head. Automerge builds the change again from the document's operations to answer, at a cost growing with its history. Screening asks it again for every candidate and every dependency, and sync for heads. Ask by the missing dependencies instead (changes::holds), which look the hash up: one the document holds is not among them. A change queued in the document, waiting for its dependencies, isn't either; but then some are missing, and only then is it asked the slow way. Every check of whether a document holds a change goes through it.
* swarm: changes taken unjudged, dropped (REFUSALS)tv10 days1-0/+16
| | | | | | | | | 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: refused oncetv10 days1-0/+23
| | | | | | | | 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: the policy enforcedtv10 days1-0/+10
| | | | | | | | _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.
* refuse misplaced authorstv11 days1-8/+41
|
* heads heard in announcementstv12 days1-6/+6
|
* heads heard in repliestv12 days1-3/+3
|
* heads heard forget senttv12 days1-0/+90
|
* sent hashes elsewhere measuredtv12 days1-0/+10
|
* known elsewhere prunedtv12 days1-0/+5
|
* sent hashes trimmedtv12 days1-5/+78
|
* sent hashes measuredtv12 days1-0/+8
|
* answering behind countedtv12 days1-0/+17
|
* late messages keep newer headstv12 days1-0/+73
|
* session model testtv12 days1-0/+3
|
* automerge pinnedtv12 days1-0/+103
|
* one walk sincetv12 days1-5/+12
|
* no bloom bytestv12 days1-14/+9
|
* handed over stays senttv12 days1-2/+35
|
* offer answerstv12 days1-0/+10
|
* add pushes match automerge testtv13 days1-0/+48
|
* broken pushes refusedtv13 days1-11/+31
|
* pushed have is the senders headstv13 days1-10/+39
|
* pushed heads as tipstv13 days1-6/+60
|
* push changes experimenttv13 days1-0/+123
|
* announce only to those behindtv13 days1-0/+5
|
* asked known elsewheretv13 days1-7/+36
|
* predecessors go alongtv13 days1-3/+60
|
* covered neighbours have ittv13 days1-0/+36
|
* new changes per messagetv13 days1-3/+5
|
* delta from held headstv13 days1-15/+68
|
* offer again ungeneratedtv13 days1-0/+86
|
* stale delta offerstv13 days1-0/+60
|
* delta known to sendertv13 days1-5/+7
|
* offered deltas lapsetv13 days1-3/+38
|
* fix: level means the peer has our headstv13 days1-6/+13
|
* tests count the changes senttv13 days1-5/+7
|
* no reset for heads still on their waytv13 days1-1/+44
|
* benchmark what sync bytes aretv13 days1-0/+12
|
* changes from a peer never go backtv13 days1-0/+48
|
* older delivered messages leave us leveltv13 days1-35/+73
|
* resend only what is neededtv13 days1-26/+61
|
* delivered means has all up to our headstv13 days1-13/+59
|
* any message taken as deliveredtv13 days1-26/+82
|