aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* continuum-party: signing through an ssh-agentslopulus64 min.6-20/+251
| | | | | | | | | | | | | | 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.
* keys: a party's key may be ecdsa-sha2-nistp256, its signature low-S onlyslopulus64 min.5-38/+311
| | | | | | | | | | | | | | | | | | | | 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.
* dashboard: the federation, in a swarm holding a storeHEADmastertv5 hours3-9/+436
| | | | | | | | | | | | | | In a swarm holding a store, the snapshot names the node's party, and the document box shows what counts as the node reads it, read every 5 s: the current version, the parties with their keys and nodes, the rules, the values at places as a tree with who writes there, the proposals on the version with where each stands, who voted what and what its version changes, and what the node refused. `document` beside `remake…` shows the document underneath. Where the node votes for its party by itself, a proposal that can still pass has a vote of each kind, cast through the node on a second click. The page writes no values: a party signs its writes with its key.
* events: the store's summary names the node's party, and whether it votes for ittv5 hours2-2/+11
| | | | | | `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: options from configuration files, as the node'stv5 hours3-69/+192
| | | | | | | | | `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: where each proposal stands, and what it changestv5 hours2-0/+125
| | | | | | | | `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`).
* events: counts names who voted what, and whether a proposal passed or is deadtv5 hours2-16/+82
| | | | | | | | `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.
* continuum-party keys: a key set from authorized_keys lines, comments left outtv8 hours1-3/+11
| | | | | | 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.
* client: a record begun from the store's root casts on its first versiontv8 hours2-9/+42
| | | | | | | | | | 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`.
* held: the store's worker reads a document only while it is writabletv9 hours1-8/+8
| | | | | | | | | | | 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.
* simtest: row 15 with joiners handed an epoch they can't checktv9 hours1-40/+57
| | | | | | | | | | A node with an empty document can't tell an epoch made up from another it can't check: either way it takes the snapshot's checkpoint only where its operator named or pinned it. The others move to a checkpoint and compact; f, joining and pinning nothing, doesn't take their epoch, and g, pinning the checkpoint, takes it and reads what they read. A made-up epoch served by d, an honest node besides, is row 31's alone: d follows the others' epoch wherever it reaches them.
* simtest: d, serving a higher made-up epoch, is apart from the otherstv9 hours1-2/+9
| | | | | | Reaching the others, d rejoins their epoch, the lower, as any node holding a store does, and e, reaching only d, finds their epoch there, not d's. Cut off from them, d stays on the one it made up.
* simtest: row 15's made-up epoch is of a higher ID than the others'tv10 hours1-9/+13
| | | | | | | Of a lower one, the others try to rejoin it every so often, as in row 31, and f, rejoining their epoch, finds them away mid-sync and gives up for that, not for its checkpoint. Of a higher ID, they leave it alone; e, reaching only d, still takes it, as one joining takes the newer generation.
* remake: a failed simulation's dump shows each node's catch-uptv10 hours1-5/+15
| | | | | Its target, attempts, whether the node rejoins now, and why the last try failed, before the lines of the remake records.
* simtest: in row 15, the joiner reads as the node serving it doestv10 hours1-6/+9
| | | | | | d, serving the epoch it made up, puts again there what its store holds, as every node holding a store does: e, judging every event, reads what d reads, the checkpoint the others moved to among it, not the root alone.
* simtest: row 31's later write builds on what is above the checkpointtv10 hours1-2/+2
| | | | | It builds on tv's write, the checkpoint's head: one built on the root isn't above the heads of the checkpoint the nodes moved to, and they refuse it.
* held: nothing of a rejoin's document is read before the node follows ittv10 hours1-0/+6
| | | | | | | | | 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.
* simtest: made-up epochs handed to a node holding a store (rows 15, 31)tv16 hours2-1/+177
| | | | | | | | | | 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).
* remake: a test helper serving an epoch a node made uptv16 hours1-0/+15
| | | | | `testing::serve` switches a node to an epoch whose document is a snapshot it built itself, as a node serving a made-up epoch would.
* held: a checkpoint a node can't build, handed by peers, only pinned (row 22)tv16 hours1-1/+35
|
* simtest: the remake rows of a swarm holding a storetv16 hours2-6/+397
| | | | | | | | | | | | | 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).
* remake: test helpers proposing and committing against the protocoltv16 hours1-0/+66
| | | | | | | | For simulations of a coordinator that doesn't keep to the protocol: `testing::propose_again` proposes a remake's proposal again under a new ID, whatever is open, and `testing::commit_as` commits a remake at the node's heads now, whatever the votes and another decision, to a given epoch or to the epoch of the snapshot the node builds there.
* remake: holding a store, a node rejoins a lower epoch a peer servestv16 hours1-29/+17
| | | | | | | | Of two epochs decided for one, a node holding a store follows the lower ID, and a node on the other rejoins it, however many peers are on each (`docs/store.md`, Remakes): one peer on it is enough, so that two sides of unequal size come together. A made-up epoch keeps a node apart at worst, and makes it take nothing it wouldn't (`Holding::follows`).
* simtest: events written beyond a compaction's base go again (row 12)tv17 hours2-1/+93
| | | | | | 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.
* remake: holding a store, a node follows an epoch only from a checkpoint it ↵tv17 hours4-0/+149
| | | | | | | | | | | | | 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.
* remake: holding a store, of two epochs decided for one, the lower IDtv17 hours2-3/+108
| | | | | | | | | | In a swarm holding a store, of two epochs decided for one, by a coordinator that wrote two decisions or by remakes decided at once, a node follows the one with the lower ID, and a node on the other rejoins it, however many peers are on each (`docs/store.md`, Remakes): a node switches to the lower of two committed remakes of its epoch, follows the lowest of several newer epochs, and a ready node rejoins a lower one of its own generation that enough peers serve.
* remake: holding a store, a node puts again what the document it left holdstv17 hours4-36/+157
| | | | | | | | | | 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.
* vectors: the snapshot after a checkpoint, as a run printed ittv17 hours1-1/+4
|
* holding: the tests' other nodes write under writers of their owntv17 hours1-1/+18
| | | | | | | | A writer's changes are its first change's author's, so a node writing in a test after another under the same writer wrote as that one: a decision by another than the coordinator was taken as the coordinator's. Another node now writes under a fresh writer. The proposal written again differs, as one written the same makes no change.
* vectors: a snapshot after a checkpointtv18 hours1-0/+75
| | | | | | | 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.
* events: the tests put events at time 0tv18 hours1-5/+7
| | | | | The same events put by the same writer make the same change, so that a document built of them in a test is the same bytes on every run.
* remake: a holding swarm's electorate is the fold's memberstv18 hours1-1/+13
| | | | | | | The entry of a node that isn't a member counts for nothing where continuum reads entries (`docs/store.md`, Members): a remake proposed in a swarm holding a store counts, of the members alive recently enough, those the fold names with the party their entries name.
* remake: a swarm holding a store takes compactions onlytv18 hours1-0/+19
| | | | | | | Every node builds a compaction's snapshot itself from the base; another kind's is what someone gives (`docs/store.md`, Roads not taken). A node of a swarm holding a store refuses to propose one at its API, as every node refuses its proposal.
* remake: a holding swarm's snapshot holds the store read at its basetv18 hours9-0/+237
| | | | | | | | | | | 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`).
* held: a store starts from the checkpoint its document holdstv18 hours3-19/+98
| | | | | | | | 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.
* holding: a node writes its acks and the compactions it coordinatestv18 hours4-32/+203
| | | | | | | | | | | 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.
* federation: the test of a node voting above a checkpoint's heads holds for a ↵tv18 hours1-0/+2
| | | | | | | | | 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.
* federation: votes build on the events proposing what they vote ontv18 hours2-5/+82
| | | | | | | | | | 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.
* simtest: show a store's refusals and ballots in a failed simulation's dumptv18 hours1-10/+66
| | | | | | For a node holding a store, the dump shows each event it refused and why, the proposals on the current version with the parties proposing them and their votes, whether each passes there, and the version events it took.
* sync: keep what a message asks for, and the heads answered from, sortedtv19 hours1-5/+13
| | | | | | | Automerge encodes the hashes of a sync message sorted, and asserts so: the hashes asked for that changes waiting in screening lack were added after those Automerge asks for, unsorted, and the heads a peer last said that we hold were taken as the peer's `have` as they came. Both are sorted now.
* sync: send a peer all it lacks past what still counts as senttv19 hours1-0/+92
| | | | | | | | | | | Messages taken as delivered and lost, more of them than still count as sent, leave a peer lacking changes we take it to have. Asking for the first of them, it got that one alone, and asked for the next once that arrived, a change per round trip; or, asking for our heads alone, the last of them again and again. When a peer needs a change in the history of the heads we share that no longer counts as sent, the session answers as if it had said it has nothing since the latest heads it said that we hold (`lost_beyond_sent`): everything since goes in one message.
* sync: ask for what changes waiting in screening lacktv19 hours3-1/+60
| | | | | | | | | | Screening keeps a change whose dependencies haven't come from Automerge, waiting, so Automerge never learns what it lacks: our next message asks for the peer's heads alone, and the peer, forgetting having sent those, sends them again, and what they build on only as far as it still counts it as sent. So the session asks for what changes waiting build on and the document lacks too (`Waiting::lacking`, `SyncSession::lacks`), as Automerge asks for what the changes it holds back lack.
* simtest: show what screening holds back in a failed simulation's dumptv19 hours2-1/+59
| | | | | | | | A failed simulation prints, for each node, the writer it writes as, the changes its screening keeps waiting (the latest few: whose writer and seq, how many of their dependencies it holds, whether a signature vouches for them) and the latest changes it refused, and, holding a store, the store's checkpoint, current version and what it took and refused.
* federation: the changes founding a swarm, fixedtv20 hours1-29/+55
| | | | | | | | The changes founding the swarm of the vectors' first version's root, and those founding the fork whose root is the fork vector's, keeping tv's write, each by its hash and its bytes, as a run of this code printed them: Automerge encodes them, so no script apart computes them. Checked apart so far: each hash the SHA-256 of its change's chunk, each writer the first 16 bytes of its root's ID, the fork's second change built on its first.
* simtest: nodes started from a store's root synced before a test takes them aparttv20 hours1-1/+3
| | | | | | | The simulations of swarms holding a store start their nodes from the root and wait, besides each holding the store, until they synced: each took the others' handshakes and holds their entries. So a test taking nodes apart right after starts from nodes that know each other, as it means to.
* bootstrap: a node ready at once tries its seeds until they resolvetv20 hours1-2/+27
| | | | | | | | | A node starting from a document, or as a swarm's genesis node, is ready at once, and says HELLO to its seeds, members of its swarm that may be running. A seed that didn't resolve then (the node, or the seed, not reachable yet) was tried no more, and a node whose document names no member to reach, as one started from a store's root, stayed alone. Now such seeds are tried again in the background, backing off as a joining node does, until they resolve or the node stops.
* peer: a member's message before its handshake was taken asks for onetv20 hours2-6/+76
| | | | | | | | | | In a swarm holding a store, a node reads a peer's messages only by the party its handshake named. One whose handshake it hasn't taken (its reply lost, say) was cut off at its next message, as a non-member is, while the peer, which took ours, synced on, and neither said HELLO again. Now such a message goes unread, and the node says HELLO to the peer, as to any whose reply it waits for (`hello_again_now`): its reply names its party. What a peer refused as a non-member sends next is known to be a non-member's, its party kept, so that it asks for no HELLO. A simulation loses a's replies to b for a while.
* simtest: a fork whose root doesn't read as its heads do, found by who holds themtv20 hours2-4/+103
| | | | | | | | | `federation_attack_33`: beside the fork a node holding the history makes, one whose root leaves out tv's write, which counts at its heads. b, holding the history, builds the one and not the other (`fork::check`). Each fork's founder starts its swarm from its root and the events it keeps, and a node of lass joins each by its ID, taking it on its operator's word, and reads what the root keeps: tv's write in the one, carried by the changes founding its swarm, nothing in the other.
* federation: the changes founding a swarm printed, to be fixed as vectorstv20 hours1-0/+41
| | | | | | | An ignored test prints, each by its hash and its bytes, the changes founding the swarm of the vectors' first version's root, and those founding the fork whose root is the fork vector's, keeping tv's write: Automerge encodes them, so no script apart computes them, and they are fixed once printed by a run of this code.
* federation: a fork's root and its ID, fixedtv20 hours1-0/+21
| | | | | | A vector computed apart, as the others: the root of a fork of the vectors' first version at tv's write, keeping it, by the version after the first; its bytes, read back, and its ID.