| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
No event is above more heads than it may name dependencies (64): a version naming more
for its checkpoint is never written. A node voting by itself proposed one at whatever
heads it held for a while, however many; it now proposes none past 64, as what is
written merges them, and a party's client backs none such (`client::backable`).
A version event names the votes passing a proposal, two thirds of its version's
parties: past 96 parties, more than an event may name. A version names at most 96 now
(`version::PARTIES`).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Anyone could propose a checkpoint's version again, by an event beside its heads. A node
voting by itself, and a party's client, built a vote on every event proposing what it
voted on, so every vote was beside the heads, and no version event written on them was
taken: the checkpoint could never move the store. And the voters' rule refused it once
that event was held for a while, as the heads left it out.
They vote on the events proposing it that are above the heads it names
(`State::proposing`), which `GET /events/counts` lists as `proposals`; where there are
none, `none` says so, the node casts nothing and the client says why. The voters' rule
leaves proposals and votes aside, as they lapse with the move.
Row 70 is tested (`federation_attack_70`).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A key a version names, stolen, could write its party's node list at a history from
before the version that named the party's keys anew: written under the version before,
it counted, as naming keys anew leaves a list's `since` alone, and beside the list the
party wrote under the new version the lower ID won. The thief signed a few, kept the
lowest, and did so again after every list the party wrote.
Of a party's key sets, and of its node lists, those written under the latest version now
come first, then what no other has in its history, then the lowest ID; the model alike.
A list the party writes under the version that replaced the key stays, as `federation.md`
says. Key sets were safe already, by their `since`; one rule serves both.
This changes what counts where two of a party's lists, written under different
versions, are beside each other: nodes read them alike only once all run it.
Row 69 is tested (`federation_attack_69`).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A store that stopped can't tell which of what it holds back will be taken, nor which of
what waits: `Store::held_back` gives both, each after what it builds on. A node leaves
out none of it: it puts it again where its document lacks it (`Holding::lacking`), a
remake's snapshot holds it (`Holding::at_base`), and after a switch or a rejoin it puts
again what of it the document it left held (`Holding::left`). A remake while nodes are
stopped no longer drops what was put since the stop, nor the event they stopped at.
Tested: a node keeps what it holds back, what waited among it, through a snapshot, and a
store read anew from that stops there again; and a simulation: a swarm stopped at a
version compacts, a node away meanwhile rejoins and one started again with nothing reads
the new epoch, each stopping there, holding back what came after, until their operators
have them drop that event.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Of two versions changing the one it reads, a node takes the first it judges, joining or
not, and reports the other: its operator chooses, by dropping and allowing. No rule
holds a joining node back until it has synced with every seed: it learns of the other
members as it syncs, and its seeds may go away.
federation.md drops the joining rule from Changing the policy, and says so in what
isn't promised and in row 63; the guides say what a joining node takes. Row 63 is
tested (`federation_attack_63`): from the root, either side first, the operator
switching sides; and pinned at a later checkpoint, the chain old keys grew never taken.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A version event writing a proposal passed on the version a node reads, which doesn't
read as a version there (of a later federation, using what a later continuum takes, or
none at all), the node can't judge: `Fold::stops`. The store stops at it: it takes
nothing and refuses nothing from then on, holding back whatever comes, that event first
(`Offered::Stopped`), and keeps none of it across a restart, where it stops there again.
One beside the version the node reads is refused of its own, as any other.
Its operator has it drop that event (`POST /admin/events/drop`), or one it builds on:
it is refused as dropped, or as built on what was, any version event writing that
version with it, kept in the store file; the node judges what it held back and goes on
under the version before. Allowed again, it stops there once more.
The node logs the stop and its end; `GET /events` names the event, why, and how many it
holds back (`stopped`); a put answers `stopped`, written into the document all the same;
a node voting by itself casts nothing while stopped. The test fold's eras tagged `new`
stop a store.
Row 39 is tested (`federation_attack_39`); of rows 9, 10 and 48, a node stops at the
version event.
|
| |
|
|
|
|
|
|
| |
Where a document names a section of another after linking to it
("([`store.md`](store.md), Pinned checkpoints)"), the name links to that
section too, by the id both GitHub and cgit's about filter give its
heading; paragraphs that grew past the width are wrapped anew, links and
code kept on one line each.
|
| |
|
|
|
|
|
|
| |
Where a document names one of its own sections in parentheses ("(What
counts, 5)", "(Joining, below)"), the name links to the section by its
GitHub-style ID; paragraphs that grew past the width are wrapped anew,
links and code kept on one line each. References to another document's
sections stay as they are.
|
| |
|
|
|
|
|
| |
Row 62 names an ECDSA signature's twins, `s` high (the order less `s`)
and `r` or `s` with zeros more in front, each none. Its test offers the
ECDSA vector's write with each (`keys::respelled`) to a store whose root
names that key, and has it take the write as it was signed.
|
| |
|
|
|
|
|
|
| |
A change that only has the federation take what it refused, reading
nothing it took otherwise, as ecdsa-sha2-nistp256 keys, keeps the
federation's number: it is rolled out to every node first, and used
after. A node that doesn't take it refuses what uses it, a version naming
such a key among them.
|
| |
|
|
|
|
|
|
| |
signature low-S
A key is `ssh-ed25519` or `ecdsa-sha2-nistp256`, spelled alike; an ECDSA signature is
over SHA-256, its `s` low and `r` and `s` SSH's shortest mpints, so that it is spelled
one way. The vectors and the agent test, among the harness's.
|
| |
|
|
|
|
| |
What a federation is used for is read and written through a node's API: kartei's
entries are signed in by their parties and read from what counts there, with no stage
of their own.
|
| |
|
|
|
|
|
|
|
| |
The registry holds each kartei namespace in its party's, a place per file. What kartei's
consumers read as one for all (host and user names, the names hosts go by, addresses and
blocks in every net but `internet`) is shared, at places of its own, given by krebs's
rules: a party's by its name, and what kartei gives it beyond them by a rule each in the
first version. What kartei's consumers read is written out from what counts, but for
what names an identifier the current version doesn't give its party.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
The federation's design says that votes a node casts by itself are built: following
parties and proposing checkpoints, backing a checkpoint by the voters' rule, and its
party voting by hand through it.
|
| |
|
|
|
|
|
| |
The federation's design says what of it is built: the store in a swarm's document,
members by the federation and the store at a node's API, as the store's design says; and
a party's client, which signs its party's events, votes by its record, signs again what
a move refused, and names a party that voted twice.
|
| |
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Groups that parted come together by a fork at heads of several stores, which merges
them. Its version's `changes` lists the versions current at those heads and is
numbered one past the highest; it names every party's keys and node list anew, so that
no key set or list of any side counts; and its root keeps, of each side, the values
that count there at places the merge's version gives their party. A value counts in the
merge once the key that signed it is among its party's keys there, so a key one side
dropped brings back nothing unless the party lists it again. A party's place written on
two sides leaves the lower ID until it writes again; an identifier given to different
parties goes by the merge's rules. Merging in place, both stores voting to move to one
checkpoint, is a road not taken.
|
| |
|
|
|
|
|
|
|
|
| |
A party may have one of its nodes vote and propose for it, by rules its operator sets
and nowhere written in the swarm: following a party it names, backing what that party
proposed or backed and voting `false` where it did, by default on versions that only
move to a checkpoint; and proposing such a version once conditions its operator sets
are met, where nothing else is proposed. The node keeps to what a party's client keeps
to, one node a party votes by itself, and it holds a key the party's version names,
which a thief takes with it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A version may name heads for a checkpoint: what counts there written down, as those
heads, a version and the IDs of the events that count there. Once a node takes the
version, it moves to the checkpoint, forgets what came before but what it keeps, and
refuses every event not above the heads. The proposal, its votes and the version events
writing it must be above them, so that moving refuses nothing that decided it. Judging
after a checkpoint reads only what counts, which it keeps; what it loses is what counted
no more before it, and what isn't above its heads, which its party signs again.
A federation's root is its first checkpoint, and a fork's root a checkpoint at the
heads it forks at, which nodes holding that history check and others take on their
operator's word. A node checks everything back to its checkpoint, which it built itself
or its operator pinned. Checkpoints any member makes are a road not taken.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The federation is the store's fold. What a party signs is an event: a JCS object naming
its dependencies, signed with an SSH signature by one of its party's keys, or by nobody
for a federation's root, a fork's and a version. An event names no swarm, no version
and no place in the document: its history says which store it is in and which version
it is written under.
A place is a path a rule matches, its value the latest write its party signed there
that counts: one that no other counting write there has in its history, and of several
the one with the lowest ID. Key sets and node lists are read the same way. A vote,
proposal, key set and node list is an event of its own kind, a passed proposal takes
effect by a version event, and a node takes a version only where it changes the one it
reads, as before.
A fork is a store whose root builds on the heads it forks at, carrying their history,
so that any node checks it from its events alone. What carries the store, its document
and its remakes, the federation leaves to `docs/store.md`, with the promises and attacks
about them; the attacks left are numbered anew.
|