| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
`GET /events/refused` says of each refusal its kind (`none`, `judged`, `builtOn`, with
the event it builds on, or `notAbove`), apart from why: a party's client signs again
what a move refused, which it tells so.
|
| |
|
|
|
|
|
| |
A party's client votes by the record it keeps, and keeps the votes that made its party's
earlier proposal dead; it reads them from a node, and checks them itself, as each is
signed. `GET /events/counts` names the proposals on the current version, by their hash,
each with the events proposing it and the votes on it, by ID (`State::ballots`).
|
| |
|
|
|
|
|
|
| |
Everything the node is moves from the binary into a library (`src/lib.rs`), so that
other binaries can use it: a party's client of a federation next. The node's binary
(`src/main.rs`) runs it (`continuum::run`), which wires things together as `main` did.
The library's doc comments are prose, not examples to test (`doctest = false`); its
tests are the library's, as `cargo quick` and `cargo sim` run them.
|
| |
|
|
|
| |
The store's design says that the store at a node's API is built: putting events, and
showing what counts, what it refused, and its operator's drops.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Behind the `federation` feature, a node of a swarm holding a store has, at its API
(`docs/store.md`, Members; `docs/openapi.yaml`, Events):
* `GET /events`: its store's ID, its checkpoint's, its heads, and how many events it took
after its checkpoint;
* `POST /events`: an event put, whoever signed it, offered to the store and written into
the document at its ID unless the store refuses it (`422`, with why): taken, held, or
waiting for what it builds on;
* `GET /events/{id}`: an event the store holds, or its checkpoint, as its bytes;
* `GET /events/counts`: what counts as the store reads now: the current version, each
party's keys and nodes, the values at places, the members;
* `GET /events/refused`: what the store refused, its own refusals apart, its operator's
drops, and the rest with why;
* `POST /admin/events/drop` and `/admin/events/allow`: its operator has it drop what it
took, and take it back.
The events' endpoints are anyone's this node lets in, as the store's are; dropping and
taking back need `write` on `_continuum`, as what operators do. While a node holds no
store, they answer `404`.
|
| |
|
|
|
|
| |
The store's design says that members by the fold are built: each node of the party its
operator names, syncing with members only, its neighbours among them and some among its
own party's and those its operator names, and taking no token another node issued.
|
| |
|
|
|
|
|
|
| |
At its API, a node of a swarm holding a store takes no token another node issued
(`docs/store.md`, Members): whoever its operator lets in may use it, and its operator
lets in nobody through another node. A token every node of a swarm takes would let
whoever another operator let in in here too. `token::issued_here` refuses such a token
(`ElsewhereIssued`), behind the `federation` feature.
|
| |
|
|
|
|
|
|
|
|
| |
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'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.
|
| |
|
|
|
|
|
|
| |
The store's design says what of it is built: on Automerge, a swarm holding a store,
started from its root or joined by its ID, each change judged by what it writes, and
the store a node reads from its document, by what is its own, putting again what the
document lacks, from a pinned checkpoint where there is one; not yet members by the fold,
the store at the API, and remakes, of which such a swarm takes no records or acks.
|
| |
|
|
|
|
|
|
|
|
|
| |
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 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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Behind the `federation` feature, two options:
* `--store-root PATH` starts a swarm holding a store, or goes on with one, from the
store's root, as bytes in the file, which the federation must take as a root. With no
document to start on, the node builds the genesis change from it, as every node given
the root does, and is ready at once; a document to start on must be of the root's
swarm.
* `--store-id ID` joins one through seeds by its ID, the root's SHA-256 in hex. An empty
document of the first epoch takes as its root only that store's genesis change, built
again from the root it holds (`document::events::is_genesis`), whatever peers name:
the root pin doesn't wait for seeds, nor is disputed.
Either names the swarm the node joins, which a state file must remember too, and can't
be combined with the other, nor with what makes a new swarm's first change (`--genesis`,
`--bootstrap-users`, `--bootstrap-keys`, `--bootstrap-policy`, `--remake`,
`--genesis-root`). The root is read as a file of its own kind (`store`), counted among
the node's files.
|
| |
|
|
|
| |
store.md, federation.md and federation-tests.md say what of them is built: beside the
store held in memory, the federation as its fold, with its byte formats, and their tests.
|
| |
|
|
|
|
|
|
| |
JCS sorts an object's names by their UTF-16 units, not by their bytes or code points;
the two differ for a name from U+E000 to U+FFFF beside one beyond U+FFFF. Names in
events and versions are ASCII, but a value is any JSON: a vector with two such names
catches a builder sorting strings as Rust does. And vectors at federation 1's sizes and
just past them.
|
| |
|
|
|
|
|
|
|
| |
An event went into the change being filled unless it would take the events there past
1 MiB: whether a change was full hung on the next event. A node taking the root on its
operator's word couldn't tell a change cut short, sent first, from the one every node
builds, and by then held a change of that writer and number. Events now go into a change
until their bytes there reach 1 MiB, and the next event begins the next change: each
change is judged whole by itself.
|
| |
|
|
|
|
|
|
| |
remake
The text said such documents "remake apart". By its own rules they come together at the
next remake: one side decides, and the other rejoins its epoch; both decide, and of the
two, the lower ID.
|
| |
|
|
|
|
|
| |
The row said nodes rejoin the lower epoch once a generation. Each lower ID found moves
them again: of N tries, about ln N are lower than all before, so a billion hashes of a
small snapshot make some twenty rejoins of the whole swarm, each node putting again what
the new document lacks. Still slow, not wrong.
|
| |
|
|
|
|
|
|
|
| |
in one
An epoch's first change, which a rejoining node can't build, holds a snapshot: a made-up
one may hold another policy, or what is closed in a swarm holding a store (users, bans,
the topology). A node follows no epoch whose policy isn't its swarm's, and reads
nothing closed in one it follows.
|
| |
|
|
|
|
|
|
| |
The document took any bytes that hash to their key, while the fold bounds events (the
federation: 256 KiB): one change of any size filled every node until the next remake.
How large an event may be is a question of the change alone, so the fold says it
(`Fold::LARGEST`), the document refuses a change putting a larger one, and the store
takes such bytes as none.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
restart
A pin is an ID, and the document holds a checkpoint only at `_continuum/checkpoint`,
which only an epoch's first change writes: a swarm that moved once, and never remade,
held its checkpoint nowhere, and a node told to join from a pinned one had nothing to
start from. It finds it in its document: the document's checkpoint, or one the fold
moves to at the history of an event the document holds, built at those heads from what
the document holds, as the ID fixes its bytes whoever builds them. The document holds
what that takes, as no remake leaves it out.
And across a restart, a node reads its store from its document anew, from the
document's checkpoint or the one its operator pinned, by its own refusals and drops,
which it keeps in its file; it keeps nothing else of the store.
|
| |
|
|
|
|
|
|
|
| |
Two listed nodes advertising a newer epoch make a ready node rejoin it, and a made-up
epoch's snapshot may hold the root and nothing else. A node keeping its own checkpoint
reads what is above it, but the new document then holds events whose history nobody
puts again, and no node joining or restarting from it reaches the checkpoint the swarm
holds. A node follows an epoch only where the snapshot's checkpoint is its document's,
one it builds from that document, or one its operator pins; a row for the attack table.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Events were put again by three rules: of a change continuum refused, every event of it
and of what was built on it; after a switch, what a node held beyond the base that the
new document lacked; after a rejoin, what it held. Between them an event could go: at a
remake whose base came before a checkpoint, switched after nodes moved to it, the
events between the base and its heads that the checkpoint didn't keep were in no node's
store and left the document, and a store starting at the snapshot's checkpoint could
reach the nodes' no more, pinned or not.
One rule now: a node puts again every event its document lacks that a store starting at
the document's checkpoint would take, but for its own refusals and drops, and that it
has: one it holds, one in a change it refused, or one the document it left held. So no
remake leaves out what a store starting at the new document's checkpoint takes, and the
document holds what a node forgot until a remake whose snapshot holds that checkpoint or
a later one.
|
| |
|
|
|
|
|
|
|
|
| |
The snapshot held the store "as the node reads it at the base". A node that moved to a
later checkpoint since the base forgot what came before it, and reads the store at the
base no more; one that didn't move yet still does: the two built different snapshots
from one base, and the checkpoint the swarm held could leave the document with no node
able to give it back. The snapshot is the store a node reads from the document up to
the base, starting at the document's checkpoint, by its own refusals and drops: every
node holding the base builds the same, whenever it moved.
|
| |
|
|
|
|
|
| |
A party's client votes by what it keeps, never by what a node shows, but nothing said
what one that lost its record does. It can't go by a node: a `true` it sent through one
may be held back there. So it writes its record before it sends a vote, and one that
lost its record casts nothing on the current version.
|
| |
|
|
|
|
| |
No node takes such a history, as each refuses one of the two, but judging, and a model
reading every history anew, are given it, and must say the same of it: it is refused,
as no version is current there.
|
| |
|
|
|
|
|
|
| |
An event doesn't name the version it was written under, and a node starting from a
checkpoint holds none of the kept events' histories. It works out, but `start` has to
assume it, and the text didn't say: a node reads what a checkpoint keeps as written
under its version, as each was written under that one or an earlier and counts there,
a kept proposal is on it, and a later `since` that leaves one out is past it.
|
| |
|
|
|
|
|
|
|
| |
Of two versions changing one, a node still joining takes neither. Continuum's lifecycle
has a node `Joining` only until its first sync, with one peer, its catch-up source: one
node of the adversary's answering first showed it one chain alone, which it took, and
refused the other from everyone else. For this, a node is still joining, from its start
or a rejoin, until it has synced with every seed its operator named; and what isn't
promised is a node joining whose seeds are all the adversary's.
|
| |
|
|
|
|
| |
Once a checkpoint passed, a node joins from a pinned one; but a node started from the
root can't tell that one passed, as a chain old keys grew need name none. It is its
operator's to know, not the node's to refuse.
|
| |
|
|
|
|
|
|
| |
`keys`, `nodes` and `proposal` events had no shape written, a vote's was written as if
it were the event, and the fold had no name, though the genesis change is built byte for
byte from the policy naming it. Each field an event may have is written with what it
holds, a version's hash as an ID is, and the fold is named `federation`:
`{"version": 2, "store": "federation"}`.
|
| |
|
|
|
|
|
|
|
|
| |
An event's `key` was spelled out; the keys a version and a key set name, and node IDs,
weren't, and whether a version is one hung on it: a key's base64 not canonical, a
comment, 32 bytes that are no Ed25519 key, a key twice in a set, a node ID in capitals
or twice. Keys are spelled as `key` is, with no comment, their 32 bytes an Ed25519
public key; node IDs as continuum spells them, `continuum:` and 64 lower-case hex
digits; and none of either twice in a list. The example version loses its keys'
comments.
|
| |
|
|
|
|
|
|
| |
The design named the blob's hash and key, and said a signature is checked as continuum
checks a user's, which takes `sha256` beside `sha512`, and any reserved field. Only the
signer can vary that field, as it is signed, but one builder asked it empty and another
didn't. It is empty, as `ssh-keygen` writes it, and the hash `sha512`, beyond what
continuum's check asks.
|
| |
|
|
|
|
| |
256 KiB hold arrays some hundred thousand deep. A JSON reader stops at a depth of its
own, or none, or falls over: two builders' nodes parted on such an event. An event
nests objects and arrays up to 32 deep, its own object the first.
|
| |
|
|
|
|
|
|
| |
Integers were asked of values alone. A proposal holding `1.5` or `1e21` is good JCS, so
to judge it a builder needed all of ECMAScript's number printing, for this alone, and
one reading integers only took it for no event. Numbers anywhere in an event are
integers from −2⁵³ to 2⁵³, and strings anywhere are whole Unicode characters: floats,
and the hardest part of JCS with them, go.
|
| |
|
|
|
|
|
|
|
|
|
| |
The sizes federation 1 allows listed a party's keys "in its version or its set" among
what makes an event none, while a proposal is taken whatever version it holds: a
proposal giving a party 17 keys was no event to one builder, and a proposal that is no
version to another, who parted at the first event with it in its history. The list now
says what of an event makes it none (its size and dependencies, a key set's keys, a node
list's nodes, a write's path, its values), and a version is none where it gives a party
more keys than a key set may hold, more nodes than a node list, or a rule a longer path
than a write's.
|
| |
|
|
|
|
|
|
|
|
| |
A vote on a version naming a checkpoint was taken only where it was above the heads. It
follows from the version event's being above them: the version event is taken only
there, and with it every vote it is written on, as everything in the history of an
event above some heads that isn't in theirs is above them. Two rules are left: the
proposal is a version only where it is above the heads, and a version event writing it
is taken only where it is above them. A vote cast beside them binds its party as any
yes does, until the move refuses it; an honest client builds only on what is above them.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`true`
By default a node followed a party's `false` on any proposal. Where that party and its
followers are more than a third of the parties, one key, the one kept on a node, ended
every proposal, the one naming that key anew among them. By default a node now follows
only on a version that only moves to a checkpoint, both ways, and following on any
version, `false` among it, is its operator's choice.
The follower's `false` was also how a proposal nobody else backs stopped holding back
automatic checkpoints. Instead, a node proposing a checkpoint goes ahead beside a
proposal it wouldn't back that nobody backs but its proposer; it still waits for any it
would back, or that others back.
|
| |
|
|
|
|
|
| |
A node following a party backed a proposal that party proposed, but a proposal binds its
proposer to nothing: its followers were bound by their yes, and the party it followed
was free to back another. A node follows a `true` only, and one proposing a checkpoint
backs it, so that the nodes following its party back it too.
|
| |
|
|
|
|
|
|
| |
A party votes from one client, and may have one node vote by itself, but nothing put the
two together: a node following a party's `false` on a proposal, and its operator backing
the same proposal from a client, is a party voting twice, honestly. So such a party
votes by hand only through that node, which keeps the party's one record of its votes
and refuses a vote the record forbids.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
for a while
A version that only moves the store on refuses what isn't above its heads, which its
proposer chooses: heads built on little, just after the latest version event, would
take back what was written since, a key set dropping a stolen key among it, and the
stolen key would count again; a node following a `true` on checkpoints, or a voter
checking only the version's fields, would back it unseen.
So a party's client and a node voting by itself back a checkpoint only where everything
they held for a while before it was proposed is among its heads, in their history, or
above them, and a node shows what the heads lack, as for a fork. It is the voter's rule,
by its own clock; nothing more is judged. A row for the attack table, and the property
of votes a node casts by itself, say so.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
A merge, a fork at heads of several stores, named every party's keys anew, so that a
party wrote its key set again before anything a key of its set signed counted there;
and kept each side's values side by side, so that a value a party replaced on one side
came back where the other side's write had the lower ID. Letting the other side's
parties in, by a version or a fork naming them, who sign again what they keep as a
party's client signs again what a move refused, does the same with nothing new.
So a fork is at heads of one store: the fold makes its root from that store's state,
and the store from its own heads (`Store::fork`). Merges' rows go, those after them
move up, and Roads not taken says why, with merging in place.
|
| |
|
|
|
| |
store.md, federation.md and federation-tests.md said none of them was built; the store
held in memory is, with a fold made for its tests and their properties.
|
| |
|
|
|
|
|
| |
A node starting from a checkpoint its operator pins holds neither the checkpoint before
it nor the events between, so it can't check that the version naming its checkpoint
names heads after the one current at that version, at which that one is current too. It
takes that on its operator's word, and so takes the version, as every node did.
|
| |
|
|
|
|
|
|
| |
A version names checkpoint heads after the current checkpoint, and now heads at which
that checkpoint is current too: the version naming it is among them or in their history.
Without that, the version naming the current checkpoint could be after the next one's
heads: every node that moved there holds it, and one starting from that checkpoint,
which can't check heads before its own, couldn't judge it as they did.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
A checkpoint holds its version itself, the object, as a root without heads needs. The
current checkpoint at a history, which a version's checkpoint heads are judged against,
is the one named by the last version of that history's chain that names one, or else
the root: a question of the history alone. A node still joining is one continuum's
lifecycle has as `Joining`, until its first sync is done.
|
| |
|
|
|
|
|
|
| |
A proposal kept alive to hold back automatic checkpoints is seldom a version that only
moves to one, so followers who followed only such versions stayed silent when the party
they follow voted it `false`. By default a node now follows a `false` on any proposal,
which can only end one, and a `true` only on a version that only moves to a
checkpoint; following a `true` on any version stays its operator's choice.
|
| |
|
|
|
|
|
| |
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.
|