aboutsummaryrefslogtreecommitdiffstats
path: root/src/document/events.rs
Commit message (Collapse)AuthorAgeFilesLines
* events: the tests put events at time 0tv12 hours1-5/+7
| | | | | The same events put by the same writer make the same change, so that a document built of them in a test is the same bytes on every run.
* remake: a holding swarm's snapshot holds the store read at its basetv12 hours1-0/+24
| | | | | | | | | | | A compaction's snapshot in a swarm holding a store holds the store as the node reads it from the document at the base, by its own refusals and its operator's drops (`docs/store.md`, Remakes): the checkpoint it reaches there, where it isn't the root, at `_continuum/checkpoint`; the root, the events that checkpoint keeps and those after it, each at its ID; and of the entries, the members'. What the checkpoint forgot, events nobody takes, and the entries of nodes that aren't members stay behind (`Holding::at_base`, `events::snapshot`, `Host::holding`).
* held: a store starts from the checkpoint its document holdstv12 hours1-0/+16
| | | | | | | | A remake's snapshot holds the store's checkpoint at `_continuum/checkpoint` where it isn't the root (`docs/store.md`, What the document holds), and none of what came before it. A node reading its store anew from such a document starts there, with what the checkpoint keeps; one pinning a checkpoint finds it there too, where it can't build it from the events.
* access: the changes founding a fork's swarm taken, unsigned, as built byte ↵tv15 hours1-0/+73
| | | | | | | | | | | for byte A change of a swarm holding a store naming no node is taken where it is one of those founding the swarm (`events::is_founding`): built from the root its document holds and the events the root keeps, those at its history and those it puts, by the fold (`access::holding`). A change of the genesis change's writer waits for no signature, as every node builds it and nobody signs it (`screen::built_by_every_node`); judged, it is refused unless it is one of them.
* document: the changes founding a fork's swarm, built from its root and what ↵tv15 hours1-9/+88
| | | | | | | | | | | it keeps A fork's root keeps events (`docs/store.md`, On Automerge): they follow its genesis change in changes of the same writer, built the same way, filled in the order of their IDs, events going into a change until their bytes there reach 1 MiB, the next event beginning the next change (`events::founding`). A swarm holding a store starts from all of them (`events::started`, given the events the root keeps; none for a federation's root).
* store: a test per attack row marked unittv17 hours1-0/+16
| | | | | | | | | Each row of `docs/store.md`, Attacks, marked unit has its test, `store_attack_<row>`: where it is judged (`access::holding`, `access::token`), where the store held in memory meets it (`federation::store::memory`), and where a node reads its store from its document (`federation::held`). Tests that checked a row already take its name; a check reads the doc's rows and fails on a unit row without its test, but for rows 21 and 22, which the remakes bring.
* access: a put at an event's key held already, judged as made by handtv19 hours1-10/+0
| | | | | | Automerge writes no put of the value a key holds already, so the test can't have a node write one: it judges such a change made by hand, a put of the event's bytes at its key, at a history holding it.
* federation: events put againtv19 hours1-1/+18
| | | | | | | | | | | | A node puts again, in changes of its own, every event its store holds that its document lacks (`docs/store.md`, What the store takes from the document): one it took from the document it left, at a drop or a rejoin, or from a change it refused, whose events the store is offered as from anywhere (`Holding::look`, every few seconds, of the changes screening keeps). It puts each after its dependencies, what the checkpoint keeps first, then what the store took after it in the order taken, up to 1 MiB of events a change, once a wait of its own has passed: random, between one and ten seconds after the document first lacked them, so that not every node puts the same, and none another node put meanwhile, as it looks again when it writes.
* federation: the store read from the documenttv19 hours1-1/+0
| | | | | | | | | | | | | | | | A node of a swarm holding a store holds the store, read from its document (`docs/store.md`, What the store takes from the document): `federation::held`. Whenever the document changes, a worker reads the events it holds that the store wasn't offered from it, under the document's lock, and offers them to the store without it, each taken as from anywhere: once its dependencies are held, judged at its history. Another document (a drop, a rejoin) is read as it comes, the store going on. The node reads its store anew from its document whenever it starts, from the root, by what is its own of it: the events it refused by what it took before, and those its operator had it drop, which it keeps in a file (`--store-file`), written whenever that changes, so that a store read anew in another order refuses what it refused before. A file that doesn't read stops the node from starting; without one, a restart may take what it refused.
* access: what a change of a swarm holding a store writestv19 hours1-0/+10
| | | | | | | | | | | | | | | | | | Every node judges a change of a swarm holding a store by what it writes, at its history (`docs/store.md`, What a change writes), in place of rules by path: `access::holding`. It writes events, each at `_continuum/events/<ID>` the bytes whose SHA-256 that is, no larger than the fold allows (the federation's 256 KiB), at a key held nowhere at the change's history; and its node's entry, with the member list's map where there is none. Everything else is refused, as closed: values outside `_continuum`, the policy, the swarm's ID, users, bans, the topology, remakes and their acks. Nothing deletes or replaces an event. A change names its node; the genesis change's writer names none, so no change under it is taken but the genesis change. In a swarm not holding a store, a change writing a policy naming one is refused: a swarm holds a store from its genesis change, or not at all. The inspector tells a put of bytes apart (`Action::PutBytes`), with the bytes, for the events' check. All of it behind the `federation` feature.
* access: the policy of a swarm holding a storetv19 hours1-1/+1
| | | | | | | | | | | `{"version": 2, "store": "<fold>"}` at the policy's place is a swarm holding a store of that fold (`docs/store.md`, What the document holds). Behind the `federation` feature, a node reads it as `Policy::Store` where the fold is one it has (`federation`) and nothing else is written there: changes judged, and signed, as required; not strict. Its `store` reads so only where it is a string, as `values` of a strict policy. A swarm holds a store from its genesis change only, so `--bootstrap-policy` takes none. Without the feature, a policy of version 2 stays one the node doesn't know.
* document: a store swarm's genesis change, built byte for byte from its roottv19 hours1-0/+176
A swarm holding a store starts from its genesis change, which every node builds from the store's root alike, so that one root makes one swarm (`docs/store.md`, What the document holds). `document::events` builds it: it writes the policy naming the fold, the swarm's ID (the root's) and the root at its ID, as bytes, each making the maps on its way, under the writer made of the root ID's first 16 bytes, at time 0, without a message. `is_genesis` tells such a change by building it again from the root it holds; `started` is a document holding it, written to under a writer of its own; `ids` and `bytes` read the events a document holds at `_continuum/events`. All of it behind the `federation` feature.