| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
As the document judges structure alone, the store on Automerge is also checked for
honest nodes holding one document, whatever each takes from it.
|
| |
|
|
|
|
|
|
|
|
| |
With each `true` it casts, a party's client keeps the votes that made its party's
earlier proposal dead, so that once a checkpoint left them out, nothing names its party
as voting twice; and a party votes from one client, as two backing two proposals at
once is voting twice. A node proposing a checkpoint by itself waits only for proposals
that can still pass, and one that nobody but its party backs is ended by the nays of the
party a node follows and its followers. Stage 3 builds the client: signing events,
keeping its votes and the nays that freed it, and signing again what a move refused.
|
| |
|
|
|
|
|
|
|
|
| |
Nothing in a fork's root says who started it, so its version is no longer held to
naming anew the node lists of the parties that start it; its founders name theirs, so
that their nodes are members. A merge's kept events are in none of each other's
histories, so a place its party wrote on two sides counts the lower ID, whatever either
side's history held, alike for nodes that check the root and nodes that take it on their
operator's word. What the federation asks of the store says forks of one store or
several, as the store does.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
A checkpoint keeps the events that count at its heads but version events, as it holds
the version itself, and a version event of it that comes later is one a node took. Its
heads are events after the current checkpoint, none in another's history, ascending, one
at least, and a proposer names heads it has held for a while. Once a checkpoint passed,
a node joins from a pinned one: from the root, keys long replaced could grow another
chain, and node lists naming only their own nodes would seal a joining node in it; a
node still joining that is shown two versions changing one takes neither. A node drops
only what it took after its checkpoint, and undoes a move only by a pin; a version named
again where it isn't above its checkpoint's heads isn't taken.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
`key` is `ssh-ed25519`, one space and the key's padded, canonical base64; `sig` the
SSHSIG blob of version 1, hashed with `sha512`, whose key is `key`, in padded,
canonical base64, checked strictly as continuum checks a user's signature. An event
whose `key` or `sig` doesn't read back to itself is none, so nobody but its signer
makes another event, under another ID, of what a party signed. Federation 1 allows
events of up to 256 KiB with up to 64 dependencies, 16 keys a party, node lists of up
to 64 nodes, paths of up to 32 segments of up to 255 bytes, and in values integers
within 2^53 and whole Unicode characters. A party's name is a user name, `@` among its
characters.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|