| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
A `true` holds its party until its proposal passes or is dead, and only other parties'
nays make it dead: where the parties yet to vote are too few, one of them staying quiet
binds the party on that version for good. The client says so before it casts such a
`true` (`client::binding`): where ending the proposal would take every party yet to vote,
or more, and those are a third of the parties or fewer.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The votes cast before count at a history from before too: a proposal that died, or a
rival, needs there only the votes it lacked, and after a close vote one key voting twice
is enough, at any time until a checkpoint above the version that followed. Nodes that
took that version refuse it; one lagging behind, or joining from the root, may take it.
`federation.md` said it took the keys of two thirds of the parties.
A node voting by itself proposes a checkpoint once so many versions were written since
its store's (`--store-propose-versions`), as the design lists: with 1, after every
version, so that what keys voting twice grow beside a version ends at a checkpoint above
it. `federation.md` says how little a rival version takes, row 20 too, and the guides the
option.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A node voting by itself proposes no checkpoint beside a proposal that holds it back, as
the checkpoint would lapse it, and a follower backs none so. A proposal held one back
where someone but its proposer backed it: two parties, or one and a stolen key, kept a
junk proposal alive, and no automatic checkpoint came while it lived, ending it taking
nays from more than a third each round. And one new, its proposer alone backing it, was
lapsed at once by a checkpoint its writes brought about.
A proposal that can still pass holds back now where a third of the parties back it,
someone but its proposer among them; or where it is new, held for less than a while
(`--store-held-for`), and its proposer has none older on the version: so it is heard
before a checkpoint lapses it, once a version for each proposer. Row 67 says so, and a
test of nine parties checks it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A node following a party (`--store-follow`) handed it more than the text said:
* it copied the party's `false`: one party's nay freed bound followers, and its `true`
shown to some and its `false` to the rest passed a checkpoint at one history and made it
dead at another. It copies the `true` alone now, on any version too;
* a checkpoint lapses every other proposal: the followed party ended any proposal it
disliked by passing one. A node follows a checkpoint only where no proposal that changes
more can still pass that someone but its proposer backs;
* nothing bounded how often the store moved, so fresh events could be left out of every
checkpoint; and a node just started held nothing for a while, so the voters' rule kept
nothing. A node backs, and proposes, a checkpoint only once its store held its
checkpoint, or ran, for a while (`--store-back-after`, ten minutes unless set), by itself
or by hand.
`federation.md` says what following hands over, and row 58 what a follower on any
version copies; the guides and the example say the rest.
|
| |
|
|
|
|
|
|
|
|
|
| |
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`).
|
| |
|
|
|
|
|
|
|
|
|
| |
A party's client builds on the heads its node shows (`GET /events`), and a node on its
own heads; an event names at most 64 dependencies. With more heads than that, where many
write at once and nothing merges, every event built on them was none.
`Store::building_on` gives the heads, as many as an event may name
(`Fold::DEPENDENCIES`, the federation's 64), the earliest taken first, so that what is
written merges what stayed apart the longest; `GET /events` shows those, and a node
voting by itself builds on them.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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`).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The model stops where `federation.md` says a node does: at a version event whose
proposal passed at its history, isn't a version as this continuum reads it, and changes
the version the model reads, it takes and refuses nothing more (`Verdict::Stopped`);
beside that version, such an event is refused, as the node refuses it of its own.
The property checking the store against the model runs on histories where parties
propose such versions too (a field this continuum doesn't know): written in order,
events come after what they build on, so both must stop at the same event, having taken
the same before it, the adversary's two versions changing one among them. A check that
some history stopped keeps the property from passing vacuously.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
`GET /events/counts` gives each proposal on the current version `none`: why a party's
client backs it not (`client::backable`), where it is no version as this node reads it,
none changing the current one, or one naming the heads of the current one's checkpoint;
else `null`. So a node shows that a proposal is none, and why, before it passes: one that
passes all the same is never written, or, no version here, the node stops at its version
event. The dashboard shows it with the proposal, and `continuum-party proposals` says it
by the federation the client knows.
Row 48's test checks what a node shows of the proposal.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
`Version::read` names what makes a version none: the field it lacks, or the one more it
has, that this continuum doesn't know (of the version, a party's keys or node list, a
rule), the federation it names beside the one this continuum knows, how many keys or
nodes a party has against how many it may, the node ID that is none, and of a key why it
is none (`keys::spelled`): its type, its point, or its spelling. A node that stops at a
version says so in `stopped` (`GET /events`) and its log; a party's client in what it
won't propose or back.
The guide to a node that stopped says what `why` tells.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
A fold may say what an event writes that others may write alike
(`Fold::writes`): of the federation, a version event's version. A node
whose operator has it drop such an event drops the taken events writing
the same with it, and refuses any writing it from then on, whoever wrote
it anew: of a version, it takes no other version event naming it and
writes none itself, though it holds the votes that passed it. The node
keeps what each dropped event writes in its store file, across restarts;
allowing one of them takes them all back.
Row 51 of the federation's attacks has its test, and waits no more.
|
| |
|
|
|
|
|
|
|
|
|
| |
The check that every attack row of the federation has its test looks
beside the code a row is about too: a node's (`held`), a party's client's
(`client`), and a node voting by itself (`vote`). Rows 45 (a version
written on the side a node doesn't read, refused as its own and reported
apart, the change that put it taken), 58 (a node following on
checkpoints only, unless its operator chose any version) and 65 (a
client keeping the nays that freed its `true`) have their tests there,
and wait no more.
|
| |
|
|
|
|
|
|
|
| |
One check (`client::backable`) decides what a party's client proposes and
what it votes `true` on: a version, changing the current one as a version
must, whose checkpoint, where it names one, names none of the heads of
the current version's checkpoint, as a version naming those again is
never written. A proposal nobody may back is refused before it is
signed, saying why.
|
| |
|
|
|
|
|
|
|
|
| |
`keys` and `nodes` alone (`--list`) show the party's key set or node
list as it counts at the node, one a line, without a key. `--set` writes
it whole, none twice, in place of the arguments that did; `--add` and
`--remove` change it as it counts. A set or list left empty, whichever
way (`--set` with none, `--remove` of the last), is written with
`--force` only: none of the party's writes count without keys, nor its
nodes as members without a list.
|
| |
|
|
|
|
| |
A vote or a proposal is signed with a key the current version names for
the party, as a key set and a node list are: the client checks it before
it signs, and records nothing where the key isn't one.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
`keys` and `nodes` write the party's key set or node list whole, or, with
`--add` and `--remove`, the set or list as it counts at the node with
those added or taken off, each of which must change it; the client says
what it writes. Node IDs are checked as the federation spells them.
A set or list is signed with a key the current version names for the
party: the client checks that first, and where it isn't one, or the
party is none of the version, says that only a version naming the
party's keys or list anew changes them, which a party proposes and the
parties pass.
|
| |
|
|
|
| |
`propose` says the proposal's hash, the version's, which `vote` takes;
with `--yes`, it votes `true` on it too, by the record, as `vote` does.
|
| |
|
|
|
|
| |
The client proposes a version only where it changes the current one as a
version must (its number, the hash it names, each `since`), and says why
it doesn't otherwise: no other can pass.
|
| |
|
|
|
|
|
| |
`next` prints the current version numbered on, naming its hash as the
version it changes, and without the checkpoint it names, whose heads are
behind: what a party changes and proposes. The guides begin a version
with it.
|
| |
|
|
|
| |
The client signs one event at a time and does nothing else meanwhile,
and an agent may wait for its user as long as that takes.
|
| |
|
|
|
|
|
|
|
| |
`--key` gives a public key itself, an `authorized_keys` line, as well as
a file of them: of a file of several, the first signs, with a warning
naming it, and another is given itself to sign with it. An agent that
doesn't hold the key given signs nothing, and the client stops before it
records or puts what it would have signed, saying which key it asked
for.
|
| |
|
|
|
|
| |
The test fails without OpenSSH on the machine testing, rather than
passing without asking anything. Its directory is a scratch directory,
removed when the test ends, the agent stopped before it.
|
| |
|
|
|
|
|
| |
`scratch_dir` gives a guard (`Scratch`) that removes the directory with
all it holds when dropped, the test passing or failing. Each test keeps
it for as long as it uses the directory; the dashboard's browser check
writes its page into one.
|
| |
|
|
|
|
|
| |
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 key held in hardware is never a file: only an ssh-agent signs with it. Given a public
key as `--key` (a `.pub` file, `ssh-ed25519` or `ecdsa-sha2-nistp256`), the client asks
the agent at `SSH_AUTH_SOCK` to sign what SSHSIG signs (a sign request with the key's
blob, no flags) and writes the blob around the agent's signature as `ssh-keygen -Y sign`
does. An ECDSA signature the agent gives with a high `s` is made low, the other of its
two spellings, which the federation takes. What it makes is checked before it is used.
A private key file signs as it did.
A test starts `ssh-agent`, adds an ECDSA and an Ed25519 key to it and deletes their
files, signs through it, and has both continuum and `ssh-keygen -Y verify` check each
signature, one of an agent's high-S answers among them. Without OpenSSH it asks nothing.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A party's keys may be held where no file has them, in a Secure Enclave or a phone, and
those are ECDSA keys on NIST P-256. Everywhere a party's key counts (a version's keys, a
key set, the key an event is signed with) such a key is taken beside an Ed25519 one,
spelled as `ssh-keygen` writes it, without a comment: `ecdsa-sha2-nistp256`, a space,
and the base64 of its SSH encoding, its point uncompressed and on the curve.
Its signature is SSHSIG as an Ed25519 one is, hashed with `sha512`, its inner signature
over SHA-256 as SSH signs with such a key. ECDSA signatures are malleable: of `s` and
the curve's order less `s`, both check. So the federation takes one spelling alone: `s`
low, at most half the order, `r` and `s` each SSH's shortest mpint, and the blob reading
back to itself as an Ed25519 one does. What anyone makes of a party's signature is then
none, as before.
The vectors are a key `ssh-keygen -t ecdsa -b 256` made, a first version naming it, and
a write and a key set `ssh-keygen -Y sign` signed with it, each taken; the signature's
high-S twin, which checks as ECDSA, and its `r` spelled longer are none. Ed25519 keys and
signatures are spelled and checked as they were.
|
| |
|
|
|
|
| |
`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.
|
| |
|
|
|
|
|
|
|
| |
`continuum-party` takes its options (`node`, `token`, `key`, `record`:
`config::PARTY_OPTIONS`) on the command line and in configuration files of the node's
format: `--config`, repeatable, arguments winning, `--unset`, includes and imports. The
configuration's loader takes the options it reads as a table (`config::with_options`,
`config::merged`, `file::load_with`), the node's or the client's, and a key naming
none of them is an error in either; `node` and `token` are secrets, never logged.
|
| |
|
|
|
|
|
|
| |
`continuum-party proposals` lists the proposals on the current version at the node,
each with whether it passed or is dead and the parties voting `true` and `false`, as
`GET /events/counts` names them, and what its version changes of the current one, read
from an event proposing it, its signature checked: each field whose value differs, and
of `keys` and `nodes` each party's (`client::changes`).
|
| |
|
|
|
|
|
|
| |
`GET /events/counts` gives each proposal on the current version the parties voting
`true` and `false` (`yes`, `no`), whether it passed and whether it is dead (`passed`,
`dead`), as the node reads its votes (`State::tally`, which the fold judges by too), so
that reading where a vote stands takes no fetch of every vote. A party's client still
decides its votes by the votes it checks itself.
|
| |
|
|
|
|
| |
The federation spells a key without a comment, so a key set holding a line's comment is
none. `continuum-party keys` takes each key as an `authorized_keys` line, one argument
each, and writes it as the federation spells it.
|
| |
|
|
|
|
|
|
|
|
| |
A record casts nothing on the version current when it began, as a `true` sent before
may be held back somewhere. A federation's first version is current from its start, so
a record begun at a node casts nothing on it, and with every party's begun so, no
proposal on it can pass. `continuum-party init PARTY --root FILE` begins a record from
the file the store's swarm starts from, for a party that never voted in it
(`Record::before`): nothing was sent before it, and it casts on every version, the
first too. A node voting by itself takes such a record as its `--store-vote-record`.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
| |
The snapshot of a compaction after the store moved to a checkpoint, built
from a document every run builds alike: its change's hash and bytes, which a
run of this code prints, as no script apart encodes Automerge. Left empty
until a run prints them.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|