| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
| |
`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.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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`).
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
`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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
| |
`root FILE`: the root of the federation whose first version the file holds, as the
file its founders start its swarm from (`--store-root`). `fork FILE HEAD...`: the root
of the fork at those heads by the version the file holds, with the events it keeps, as
a node holding the federation builds it (`POST /admin/events/fork`). `check FILE`: what
a node finds of the fork whose root the file holds (`POST /events/fork`).
|
| |
|
|
|
|
|
|
|
| |
`POST /admin/events/fork`: the root of the fork at the heads named by the version
given, as the node's store builds it, with the events it keeps, as the file the fork's
founders start its swarm from (`--store-root`). `POST /events/fork`: what the node finds
of the fork whose root the body holds: whether it builds that root at its heads, and
why not; what it holds that those heads lack; and the parties whose keys the fork's
version gives otherwise than they had there (`federation::fork`).
|
| |
|
|
|
|
|
|
|
|
| |
`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.
|
| |
|
|
|
|
|
| |
The file `--store-root` names holds the store's root on its first line, and, for a
fork, the events the root keeps, each on a line of its own (JCS writes no line break).
The node checks that the federation takes them as a store's root with what it keeps,
and starts from the changes founding the swarm, built from them.
|
| |
|
|
|
|
|
|
|
| |
keeps
A node reads its store from a fork's root and the events the root keeps, which follow
it in the document, once they are all there; until then it holds no store. Its store
takes what builds on the fork's root, and nothing the store it came from took after
the heads it forked at.
|
| |
|
|
|
|
|
|
|
|
|
| |
for byte
A change of a swarm holding a store naming no node is taken where it is one of those
founding the swarm (`events::is_founding`): built from the root its document holds and
the events the root keeps, those at its history and those it puts, by the fold
(`access::holding`). A change of the genesis change's writer waits for no signature,
as every node builds it and nobody signs it (`screen::built_by_every_node`); judged, it
is refused unless it is one of them.
|
| |
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
| |
`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.
|
| |
|
|
|
|
|
|
|
|
| |
backs
`--store-nay-beside`, for a node voting by itself: where its party backs a proposal on
the current version that can still pass, by its record or by what it votes now, it
votes `false` on every other proposal there that only moves to a checkpoint and can
still pass, once. So, of two checkpoints proposed at once, the one it doesn't back
dies, and its backers are free (`docs/federation.md`, Votes a node casts by itself).
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
`store_attack_10`: x1 and x2, tv's, start apart from one document under one writer,
and each puts an event: changes of one writer at one number. Together, the documents
part, each refusing the other's changes for good; the events reach every node, put
again from the changes refused, and every node reads the same.
|
| |
|
|
|
|
|
| |
`store_attack_19`: makefu lists five nodes, tv two, and lass one, whose operator names
tv's too (`--store-neighbour-parties`); each node keeps two neighbours by the graph
among all members. a and b keep each other, and c one of them, whatever makefu's nodes
are. The simulations' nodes started from the root may have their configuration adjusted.
|
| |
|
|
|
|
|
|
| |
`federation_attack_67`: makefu proposes a version and backs it alone. a votes for tv by
itself, proposing a checkpoint once its store took five events; b votes for lass,
following tv; each with its party's record, begun before the federation. a proposes a
checkpoint beside makefu's proposal, b backs it, a node writes it as it passed, and
every node moves there.
|
| |
|
|
|
|
|
|
| |
`federation_attack_49`: tv backs a proposal of its own with lass, and one of lass's
with makefu; b, apart, takes the other version than a and c. Together, they stay
parted, each keeping the version it took. b's operator has it drop what it took and
take the other side's (`Holding::drop_taken`, `allow`); or, where the versions named
checkpoints, starts it again from the checkpoint the others moved to, pinned. No fork.
|