aboutsummaryrefslogtreecommitdiffstats
path: root/src/document/changes.rs
Commit message (Collapse)AuthorAgeFilesLines
* changes: Context where it is usedtv3 days1-1/+2
| | | | | | Since load_delta is for tests (1190), nothing else in changes.rs uses anyhow's Context, and builds without tests warned of an unused import. load_delta imports it itself.
* document: tell whether a document holds a change without building ittv3 days1-6/+41
| | | | | | | | | | | | | | | 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.
* screen: what a node receives judged, policy or nottv3 days1-1/+3
| | | | | | | | | | | | | | | | | | | | | 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.
* access: screening received changestv4 days1-0/+27
| | | | | | | | | access::screen: a batch of received changes judged change by change, those that change what rules read applied before the next is judged; a refused change stays out with whatever builds on it, kept aside for operators; changes missing dependencies wait. Auth plan M6.
* refuse misplaced authorstv5 days1-0/+167
|
* one walk sincetv6 days1-21/+40
|
* waiting not twicetv6 days1-0/+7
|
* announce only to those behindtv6 days1-0/+43
|
* covered neighbours have ittv7 days1-9/+16
|
* delta from held headstv7 days1-10/+11
|
* add tree teststv8 days1-0/+35
|
* writers from authorstv8 days1-0/+22
|
* use Automerge as Document instead of AutoCommittv11 days1-13/+12
| | | | This allows a lot of operations to drop mut.
* tests write through document::testing helperstv11 days1-6/+5
|
* move all automerge references to documenttv11 days1-1/+21
|
* move changes as bytes to documenttv11 days1-0/+158