| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
`GET /events` names the party the node is of (`party`, `--store-party`) and whether it
votes for it by itself (`votesByItself`, `--store-vote-key`), and so casts a vote by
hand (`POST /admin/events/vote`): what a page offering votes through the node asks.
|
| |
|
|
|
|
|
|
|
|
|
| |
A rejoin makes the node's document writable again only as it ends, in the
lock of the swap, once the node checked the epoch (`Holding::follows`) and
follows it or gives it up. The store's worker reads nothing, and writes
nothing, while the document isn't writable, checked in the lock it reads
under. Whether a rejoin runs isn't enough: its state is taken up for its
last checks, while the epoch's document is still the node's, and a store
started from that document would keep the checkpoint it read there, and put
again what it took into the document the node goes back to.
|
| |
|
|
|
|
|
|
|
| |
While a node rejoins, its document is that of the epoch it tries, which it
follows only once it checks it (`Holding::follows`). The store's worker
reads nothing of it, and writes nothing, while the node rejoins: else the
store, starting there from the snapshot's checkpoint, would take one the
node neither builds nor has pinned, and keep it should the node give up
the rejoin.
|
| |
|
|
|
|
|
|
|
|
| |
d serves an epoch of the next generation it made up, of a lower ID than the
others', its snapshot holding the root as the document stood before the
checkpoint they moved to. A node joining with nothing that reaches only d
takes it, the root being what its operator named, and reads only what it
holds (15); one reaching only the others takes not their epoch, whose
checkpoint it neither builds nor has pinned (15); the others try d's, find
its root before their document's checkpoint, and stay on theirs (31).
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Simulations of the store's attack rows on remakes (`docs/store.md`,
Attacks): a snapshot other than its base's isn't followed (11); one
coordinator's two decisions for an epoch, shown to different nodes, end on
the lower epoch (13); a node away while the others switch rejoins and puts
again what it wrote meanwhile (16); after a compaction whose snapshot holds
a checkpoint, a node away all along follows only once its operator pins it
(24); a compaction whose base comes before a checkpoint, switched after
nodes moved to it, leaves them there, and a node starting with nothing
reads the new document to it (28); a member deciding many compactions at
once moves every node to the lowest epoch, losing no event (30).
|
| |
|
|
|
|
| |
A swarm holding a store compacts: events written beyond the base, on nodes
that switch later, are put again in the new epoch, and every node holds
every event, reads the same, and refused no change.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
builds
A node of a swarm holding a store rejoining an epoch (`docs/store.md`,
Remakes) follows it only where its snapshot has the swarm's policy and
store, and holds the node's document's checkpoint, one it builds from that
document, or one its operator pinned; with an empty document, the root of
its store too (`Holding::follows`). A made-up epoch holding another, the
root after the store moved on, say, would leave it holding events whose
history nobody puts again: it stays on its own, as when a rejoin's check
fails, and tries again later.
|
| |
|
|
|
|
|
|
|
|
| |
After a switch or a rejoin, a node of a swarm holding a store puts again
what the document it left holds that a store starting at the new document's
checkpoint takes, by its own refusals and drops, and the new one lacks
(`docs/store.md`, Remakes, `Holding::left`): what it held beyond the base,
and, where it moved to a later checkpoint since, what a store starting at
the snapshot's takes to reach it. Its events aren't replayed into the new
document, so none nobody takes go along.
|
| |
|
|
|
|
|
|
|
|
|
| |
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`).
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
A change of a swarm holding a store may write its node's own protocol data
a remake needs (`docs/store.md`, What a change writes): its acks, a
remake's record and proposal, where there is none, of a compaction it
coordinates, and, as the coordinator, its decision, or the record of the
remake that made the epoch, carried into it whole; and the maps holding
them, where there are none. An abort asked for by another than the
coordinator stays closed, as does any other kind of remake. Rows 14 and 21
are judged here.
|
| |
|
|
|
|
|
|
|
| |
while
With no time to hold an event for a while, lass's write, taken just before
the proposal, counted as held for a while before it was proposed, and the
node backed no heads leaving it out. The test's node now holds an event for
an hour before it holds it for a while.
|
| |
|
|
|
|
|
|
|
|
| |
A node voting by itself, and a party's client, signed a vote on the heads
the node held: where those held what is beside a checkpoint's heads (a
party's writes made while the swarm was parted, say), the vote wasn't above
them, and a version event written on it was refused, so the checkpoint
never moved, though it passed. Both now vote on the events proposing what
they vote on, and a node proposes a checkpoint on the heads it names: so
their votes are above those heads wherever the proposal is.
|
| |
|
|
|
|
|
|
|
| |
keeps
A node reads its store from a fork's root and the events the root keeps, which follow
it in the document, once they are all there; until then it holds no store. Its store
takes what builds on the fork's root, and nothing the store it came from took after
the heads it forked at.
|
| |
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
| |
One check of an attack table (`harness::every_row_has_its_test`), for the federation's
and the store's: every row has its test among the sources of its kind, unit tests or
the simulations (`simtest::holding`), but for the rows whose tests wait for later; a row
marked `—` has none; no test names a row that isn't there, nor two tests one row. The
rows waiting: forks, the remakes, flooding, what a node, a client or a tool does that
isn't built yet, and a rule for two checkpoints proposed at once.
|
| |
|
|
|
|
|
|
|
| |
Once a proposal passed on the current version, as the node's store reads, the node
writes it by a version event (`State::version_event`): on the `true` votes of the first
parties by name that pass it, each party's of the lowest ID, so that nodes holding
those votes write the same bytes, one event. It offers the event to its store first and
puts it only where it is taken: of two passing at once, it writes the one it takes, and
refuses the other as its own (`Holding::passed`, run by the store's worker).
|
| |
|
|
|
| |
`Spec::root`: the root whose first version a spec spells out, built in one place for
the tests of the attacks, of the store read from a document, and the properties.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A node may vote and propose for its party by itself, by its operator's rules
(`docs/federation.md`, Votes a node casts by itself; `federation::vote`):
* `--store-vote-key`: the party's key it signs with, an OpenSSH private key file, one
the party's version names, kept on the node;
* `--store-vote-record`: its party's one record of its votes, which it votes by, written
before each vote is sent, begun where there is none on the version current then;
* `--store-follow`, `--store-follow-any`: the parties it follows, by default only on a
version that only moves to a checkpoint;
* `--store-propose-events`, `--store-propose-every`: when it proposes a checkpoint, once
it holds so many events beyond its checkpoint, or so long after its store moved there;
* `--store-held-for` (10 minutes): how long it holds an event before it holds it for a
while, for the heads it proposes and the voters' rule.
Its store keeps when, by the node's own clock, it took each event, and when it moved to
its checkpoint. Whenever the worker reads the store, the node decides what to sign
(`Holding::act`), records it, writes the record, offers it to its store, and puts it
into the document (`held::write`). A vote by hand through the node, by the record and
the voters' rule, is `Holding::vote_by_hand`.
|
| |
|
|
|
|
|
|
|
|
| |
A node's store takes events from elsewhere than its document too: one put at its API is
offered to it first (`Holding::offer`), to say what became of it. Its operator has it
drop events it took after its checkpoint, with everything built on them
(`Holding::drop_taken`), and takes them back (`Holding::allow`), the document's events
then offered again (`docs/store.md`, A node's own). After each, what the node keeps of
its own is written to its file where it changed, and the members are as the store reads
now.
|
| |
|
|
|
|
|
|
|
|
| |
named
A node of a swarm holding a store keeps some of its neighbours among the members of its
own party and of the parties its operator names (`--store-neighbour-parties`), so that a
party listing many nodes can't be all of them (`docs/store.md`, Members): its neighbours
by the shared graph among those members alone, each as its entry names it, which every
node of its party computes alike, with those among all members.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
A node of a swarm holding a store syncs with its members only (`docs/store.md`,
Members): the nodes its store names, each with the party its handshakes name, as the
store reads now. A handshake from any other goes unanswered, and what the node had with
it ends, as with a banned node; so does what it had with a member at its next message,
once the store names it no more (`swarm::peer::members`). The party a handshake names is
kept with the peer. While a node holds no store yet, joining, it can't tell, and takes
everyone of its swarm: its seeds, which take it only where its party lists it.
A node says whether it is a member itself, as its store reads, when that changes.
|
| |
|
|
|
|
|
|
| |
The fold names the members, each with its group: for the federation, the nodes each
party lists, each as its party's (`docs/store.md`, Members). A node keeps them as its
store reads now, apart from the store, so that whoever asks doesn't wait while the store
takes events: `Holding::member` tells whether a node, of a party, is one, or that the
node holds no store and can't tell; `Holding::members` lists them.
|
| |
|
|
|
|
|
|
|
| |
A node's group is its operator's, in its configuration (`docs/store.md`, Members):
`--store-party NAME`, which `--store-root` and `--store-id` need, a party's name as the
federation spells one. The node keeps it with its store (`Holding::party`), to name it
in its entry and its handshakes. The options of a node of a swarm holding a store
(`--store-file`, `--store-checkpoint`, `--store-party`) set without either are refused
together.
|
| |
|
|
|
|
|
|
|
|
|
| |
Once a store moved to a checkpoint, a node reading it from the root could take what was
grown anew from the root since, by keys of versions long replaced: so its operator pins
the checkpoint (`--store-checkpoint`, by its ID), and the node reads its store from
there whenever it starts (`docs/store.md`, Pinned checkpoints). It finds it in its
document: at heads a proposal's version names, built from their history read from the
root, as any node builds the checkpoint it moves to (`Store::checkpoint_at`), the one
whose ID is pinned. Until the document holds it, the node holds no store, and says so
once.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
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.
|