| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
An event above some heads has each of its dependencies among them or above them, not
only them all in its history. The store holds after its checkpoint only events whose
dependencies are its heads and the events after them, and so it holds every event above
them: one naming an event before them as well is refused by a node that moved, and never
taken by one starting from the checkpoint, which never held what it names. Tests show it
for an event offered after the move and one taken before it.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
`federation`, a feature of its own, builds what `docs/federation.md` and
`docs/store.md` design, stage by stage; without it continuum builds and behaves as it
does. The aliases build with it, and `docs/development.md` says so.
Its first part is the store's: an event's ID, the SHA-256 of its bytes written as 64
lower-case hex digits and read back only so, and the `Fold` trait as `docs/store.md`
gives it. The trait reads a checkpoint's parts too, the heads it was built at and the
events it keeps, which a node taking a pinned checkpoint needs; the design names it.
Nothing uses either yet, but a test.
|
| |
|
|
|
|
|
| |
As any member may decide a compaction, and the lower of two epochs for one is followed,
a member can grind a remake's ID until its epoch's is lower, and have every node on the
honest epoch rejoin, once a generation. No event is lost, as a node that rejoins puts
again what it held; the attack table says so.
|
| |
|
|
|
|
|
|
|
|
|
| |
An epoch's first change, and a fork's changes after it, carry no node's signature, so
the rule that a change carries one now sets them aside. Their writer, derived from the
root or from the remake, is one anyone can compute, so it writes exactly the changes
every node builds, and any other change under it is refused: nobody commits a change of
that writer and number before the one every node builds, and parts the nodes. The
genesis change writes the policy (a map, keys sorted), the swarm's ID (a string) and the
root, in that order; a fork's kept events fill its later changes in the order of their
IDs, each up to 1 MiB of events.
|
| |
|
|
|
|
|
|
|
|
| |
The fold makes a fork's root, from the states at heads of one store or several and
what makes the fork; a node checks a fork's root by it. The state carries what judging
needs of history, as the federation's carries the graph of its events, and the state is
the same for the set a node takes, which its own refusals may make depend on order. The
root is taken before the fold sees any event. A genesis change's writer is the first 16
bytes of the root's ID, and a fork's kept events follow its genesis change in changes
of up to 1 MiB, in the order of their IDs.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
A checkpoint's heads are events after the store's checkpoint, none in another's
history, and are held by their IDs after the move, so that what builds on them is
taken; "above" says so more plainly, and that no head is above its own heads. A node
drops only events after its checkpoint, as every later event builds on what the
checkpoint keeps, and undoes a move only by a pin. Until the next remake the document
holds what a node forgot, and a node away syncs it; after it, a node that can't build
the checkpoint pins it. A node joins from a pinned checkpoint, and from the root only a
store that never moved: from the root, what came before a checkpoint can be grown anew
by what the fold refuses since.
|
| |
|
|
|
|
|
|
|
|
|
| |
A remake changes no event, so of two epochs decided for one a node follows the lower
ID, and a node on the other rejoins it: no operator has to name one. A node follows a
decision whichever node coordinated it, as a decision reaches it only through a member.
Old epochs are no longer synced: a node that lacks the base rejoins, keeping its own
checkpoint and reading what is above its heads, and a later checkpoint it can't build it
takes where its operator pins it. After a switch a node puts again only what the new
document lacks, after a random wait. An epoch's first change writes the policy too, and
the snapshot leaves out events nobody takes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
A change of a swarm holding a store is judged by what it is alone: it puts new keys
under `_continuum/events` whose bytes hash to them, writes its node's own protocol data,
carries its node's signature and is one Automerge writes. The store reads the events
the document holds and takes them as it would from anywhere, each once it holds its
dependencies, judged at its history; the rest stays in the document until the next
remake. So a fold's verdict, a node's own refusal or a checkpoint refuses no change,
nodes no longer drop and rebuild their documents at a move, and honest nodes hold one
document whatever each reads from it. Membership is no longer judged at a change's
history; a node keeps its own refusals and drops in a file of its own. Events are put
again only where continuum refuses a change on its own, as of a writer's two changes of
one number.
|
| |
|
|
|
|
|
|
|
|
|
| |
A plan, the contract the code is built to: the fold and the store tested as pure code,
events in and verdicts and states out; a model written plainly from the design, which
the store is checked against; every rule by its smallest scenarios; every attack row a
test named by its table and number, and a test that every row has one; the promises as
properties over generated histories, every order for small ones and seeded ones beyond,
cut down before they are printed; the store on Automerge checked against the store in
memory; simulations with an adversary node; fixed vectors for every encoding; fuzzing
and mutants in longer runs. All of it behind the `federation` feature, by stage.
|
| |
|
|
|
|
|
|
|
| |
A node that moved to a checkpoint after a remake's base, and switches to it, would have
refused the snapshot for the events it forgot, and stayed apart from the nodes that
switched. It keeps its own checkpoint instead, and reads none of what the snapshot holds
that its checkpoint forgot, as it reads none of it in the old document; only its own
refusals and its operator's drops keep it where it is. A snapshot's checkpoint before
its own is one it takes.
|
| |
|
|
|
|
|
| |
A fork's root may be a checkpoint at heads of several stores, which merges them: it
keeps what its fold takes of each. A node holding the history up to all those heads
builds it and checks it, and one that doesn't takes it on its operator's word, as with
any fork; neither the fork nor the stores it came from take each other's events.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A store holds a checkpoint, the state at some heads written down (those heads, the
events before them its fold keeps, and what the fold says of the rest), and the events
after it. The fold says when a node moves to a later checkpoint: the node builds it
itself, forgets what it doesn't keep and every event whose history lacks its heads, and
refuses such events from then on, so that it holds what is relevant and nothing else. A
checkpoint a node can't build, as it was away too long or joins, it takes only where
its operator pins it.
A store's root is its first checkpoint, and a fork's root a checkpoint at the heads it
forks at, which nodes holding the history up to them check, and others take on their
operator's word. On Automerge, a remake's snapshot holds the store as it is at the
base, so what a checkpoint forgot leaves the document there.
|
|
|
A set of events that only grows, each named by the SHA-256 of its bytes and naming
those it builds on, judged at that history so that every node judges it alike, and read
together as one state. What the events are, how one is judged and what they read as is
a fold's, a trait the federation is the first to implement.
Its first home is a swarm's Automerge document: each event is bytes at
`_continuum/events/<ID>`, a change writes events and continuum's protocol data only,
and a node puts again every event it doesn't refuse of a change it refuses or drops, so
that which change carries an event changes nothing. A compaction's snapshot holds the
events at its base, and every event beyond it is put again: remakes, rejoins and a
writer's two changes of one number change no event a node holds, and the fold never sees
them.
It says what is promised, a node's own refusals and drops, forks carrying their root's
history, members by the fold, where Automerge sets limits, its attacks, and what its
tests check. Nothing of it is built; all of it is to be behind the `federation` feature.
|