aboutsummaryrefslogtreecommitdiffstats
path: root/src/federation/attacks.rs
Commit message (Collapse)AuthorAgeFilesLines
* fold: of a party's lists, those written under the latest version firsttv18 hours1-0/+27
| | | | | | | | | | | | | | | | | | 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`).
* events: why no party's client backs a proposaltv24 hours1-0/+4
| | | | | | | | | | | | `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.
* federation: a joining node takes the first of two versions, as any nodetv25 hours1-1/+113
| | | | | | | | | | | | 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.
* federation: a node stops at a version it doesn't readtv25 hours1-4/+13
| | | | | | | | | | | | | | | | | | | | | | 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.
* store: a drop refuses whatever writes what a dropped event writestv27 hours1-1/+1
| | | | | | | | | | | | | 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.
* attacks: rows 45, 58 and 65 tested beside the code they testtv27 hours1-5/+11
| | | | | | | | | | | 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.
* attacks: row 62 with an ECDSA signature spelled otherwisetv33 hours1-0/+17
| | | | | | | 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.
* simtest: a fork whose root doesn't read as its heads do, found by who holds themtv3 days1-3/+2
| | | | | | | | | `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: a fork's root made, and checked by a node holding its historytv3 days1-3/+45
| | | | | | | | | | `federation::fork`: a node holding a federation's history makes the root of a fork at heads it holds by a version, with the events the root keeps, as the file the fork's founders start its swarm from (`make`, `root_file`, which `--store-root` reads); and checks a fork's root it is given (`check`): whether it builds that root at its heads, byte for byte, what it holds that those heads lack, and, party by party, the keys the fork's version gives where they aren't those the party had there. The attack rows 35 and 36 have their tests.
* simtest: two checkpoints proposed at once, the one not backed dying by the naystv3 days1-2/+2
| | | | | | | | `federation_attack_59`: a for tv and b for lass, apart, each propose a checkpoint once their stores took six events, and back it; c votes for makefu, following tv; each votes `false` on a checkpoint beside the one it backs (`--store-nay-beside`). a and b, together, vote `false` on each other's: the votes split. With c, tv's passes and every node moves there; lass's is dead by the nays of tv and makefu, which their records hold.
* federation: each attack table checked whole, its rows marked sim tootv3 days1-42/+14
| | | | | | | | | One check of an attack table (`harness::every_row_has_its_test`), for the federation's and the store's: every row has its test among the sources of its kind, unit tests or the simulations (`simtest::holding`), but for the rows whose tests wait for later; a row marked `—` has none; no test names a row that isn't there, nor two tests one row. The rows waiting: forks, the remakes, flooding, what a node, a client or a tool does that isn't built yet, and a rule for two checkpoints proposed at once.
* federation: the tests' harness builds a federation's roottv3 days1-16/+7
| | | | | `Spec::root`: the root whose first version a spec spells out, built in one place for the tests of the attacks, of the store read from a document, and the properties.
* federation: a test for each attack marked unittv3 days1-0/+1182
Each row of `docs/federation.md`'s attacks marked unit that the fold and the store in memory answer has its test, named by its row (`federation_attack_12`), with events made for it by the harness: keys that aren't their party's, bytes that are none, events of another federation or a fork, writes where a party held or holds no place, key sets and keys stolen or dropped, votes cast twice, at once, split, or at a history from before, versions that are none or written again late, two versions changing one in every order, forks and roots, checkpoints, events not above their heads, and heads a version may not name. `every_row_marked_unit_has_its_test` reads the table and this file, and checks that every row marked unit has its test, or waits for a later stage (what a node, a party's client or a tool does, and what a node tells of a fork), and that no test names a row that isn't there.