| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
`the_store_judges_and_reads_as_the_model` asks that some history stop a store, where two
thirds pass a version this continuum doesn't read. Merge events in the generator shifted
every seeded history, and of the 64 cases with such versions none stopped; the corpus's
scan found stopping seeds only past them (279, 314, 330 and others).
Of the proposals a party knows, it now votes on, and writes the version event of, the
earliest on the version current where it writes more often than not, so that parties
vote alike and versions pass. And where none of the cases stopped a store, the test scans
later seeds of those kinds till one does, up to 1000, and checks it too: a stop is checked
whatever the generator's luck.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The corpora written from four seeds of each kind showed little: of 32 histories, 4
versions written, no move and no stop, and every merge event refused, as the generator
signed them with any of ten node keys, so the corpus of revision 1 judged as the base
revision's did.
A generated merge event is signed by a node its party lists there, more often than not.
Of each kind, the corpus keeps the histories of the first two seeds, and of the next 400
those showing what the ones kept don't (`shows`: of each kind of event, what became of
one; a version written, a move, a stop), eight at most. The check asks that together a
revision's cases show a version written, a move to a checkpoint, a stop, and a merge event
taken where the revision has merge events, else refused.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Nothing checked that judging under a revision stays what it was: a change to the fold
that alters what an earlier revision takes, refuses or reads parts nodes running it from
nodes that don't, and the tests regenerate their expectations with the code.
For each revision this continuum knows, a file in `src/federation/corpus/` holds
histories generated at that revision, of every kind the properties generate, each event's
bytes with what became of it, by kind and never by a refusal's words, and what the store
reads after; its first line names the revision by its ID. It is written once, as the
revision is made (`write_the_corpus`, an ignored test run by hand), and never edited
after; every later continuum judges it alike (`every_revision_judges_as_its_corpus_says`),
which fails where a revision has no corpus yet, saying how to write it.
The test plan describes it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
What builds on many heads merges them, but only an event a party writes: in a quiet
federation, heads beside each other stay so, and past 64 no event is above them all.
Revision 1 (`merge-events`) adds merge events: `{"merge": true}`, signed with a node's
own key, the `key` its Ed25519 key, for the party whose node list names it. One counts for
nothing, and only gathers what it builds on into the history of what builds on it. Under
the base revision, signed by a node its party doesn't list, or by a party's key, it is
refused; the model alike. Generated federations begin at either revision, and their nodes
merge.
A node voting by itself backs no version changing the revision, on any version neither:
its party's operators vote on that one, once their nodes run a continuum that knows it.
`federation.md` lists the revisions, says what a merge event is, and row 71 is tested
(`federation_attack_71`).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
other
A property over generated federations, honest ones: a fork at the heads of a history's
first half, by the version current there, numbered one past it and changing it. Its
root keeps what counts at those heads, the values at places and the members, with its
version current; it takes nothing else of the history; and the store it came from takes
nothing built on the fork's root (`docs/federation-tests.md`, Properties, Forks).
|
| |
|
|
|
|
|
|
|
|
|
| |
it keeps
A fork's root keeps events (`docs/store.md`, On Automerge): they follow its genesis
change in changes of the same writer, built the same way, filled in the order of their
IDs, events going into a change until their bytes there reach 1 MiB, the next event
beginning the next change (`events::founding`). A swarm holding a store starts from all
of them (`events::started`, given the events the root keeps; none for a federation's
root).
|
| |
|
|
|
| |
`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.
|
| |
|
|
|
|
|
|
|
|
| |
alone holds
A property over generated federations, honest ones with checkpoints: their events are
put into a document by two writers, in batches of a shuffled order, some by both at
once, the writers merging now and then; a node reads its store from each writer's
document as it grows, and once more after both merged. Each holds what a store given
the events alone holds: its checkpoint, the events it took after it, and what it reads.
|
|
|
Three to five parties write in their namespaces, change their key sets and node lists,
propose versions and checkpoints on what they last caught up with, vote, and write the
versions that pass; honest ones back one proposal on a version, an adversary votes as it
likes and signs as another party with its own key, or where it may not write. Over such
histories:
* the store judges every event, and reads, as the model does, offered the same events in
the same order, with an adversary and without;
* what builds on a refused event is refused;
* honest parties read the same whatever order the events come in, checkpoints and all;
* after a checkpoint, what the store took the model takes, reading the whole history but
for what the store refused as not above it, and the two read the same; the version
naming the checkpoint is taken;
* every version a store takes was backed by two thirds of the parties of the version it
changes, in its history;
* without a party voting twice, no two versions change one.
A failing history is cut down and printed.
|