| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Two nodes on the Automerge document; each started again of both kinds
on its document, with a file for its set; each started again on its set
alone, from that file. What was put is held throughout, and what is put
at each step reaches the other.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With store-document, store-both has the node hold its store in the
Automerge document too, and sync with nodes of either kind:
* it says to each peer the kind that peer holds, and passes its set on
to those that hold sets (swarm::set::holds_a_set), the Automerge
document to the others;
* what its set takes of the document goes on to the peers on sets
(Holding::unpassed), and what its set takes of them is put into the
document, as events it lacks are (Holding::lacking);
* its entry in the document is put as its entry in the set
(swarm::set::mirror_entry), and it reads the members of both;
* without the set's file yet, its set is made of the store as it reads
it of its document, with what store-file kept of its own.
A simulation: two nodes on the Automerge document, one on a set, one
of both between them; an event put on either side reaches all four.
|
| |
|
|
|
|
|
|
|
| |
A node holds one kind of document, or, to come, its store in both
(Holding::kinds, of_both). The kind a peer's handshakes say is kept with
the peer, where the node holds it too, and is what the node says to it
in turn; to a peer that said none yet, a node of more than one kind
says each in turn, HELLO by HELLO, until one is answered. A node of one
kind says and takes that one, as before.
|
| |
|
|
|
|
| |
It gets what the others' checkpoint forgot, which their sets keep a
while, builds the checkpoint itself, and reads what they read; one with
nothing and the checkpoint pinned begins from it by its name.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Given store-id and store-document, no file yet and no root, or a
checkpoint pinned (store-checkpoint), a node starts with nothing of its
store (held::Begun::Start, passing::Start): it asks the members whose
handshake it took for the checkpoint named by the store's ID, its root,
or by the pin, then for the events that one keeps, each taken only as
what its name says; begins its set from them; and is ready, catching
up as any node behind. A set gives the checkpoint its store holds by
its name (passing::Unit::Checkpoint).
A simulation: a node given the ID alone joins two that hold a write.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With store-root or store-id, store-document names the file of the
store's own document, a set of events: the node holds its store there
and nothing in the Automerge document, syncs with nodes holding a set
and no others, and goes on from the file when started again. Without a
file yet it begins from the root (StoreStart::set); joining by the ID
alone needs a file. What a checkpoint forgot is kept for
store-keeps-forgotten (30 days). The file stands for store-file, and no
checkpoint is pinned.
The set is written to its file where it changed, every five seconds
with the store's worker and as the node stops (Holding::save), what a
checkpoint forgot longer ago let go of first.
Simulations: a node behind catches up; a node goes on from its file.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Such a node (Holding::carrying) holds an Automerge document with
nothing in it, which nothing passes on, and its set is its document:
* swarm::set passes the set on. Where it stands goes in the node's
STATUSes as another kind's stamp, and a peer's is given to the set;
what the set says besides goes as a SYNC's body; what the set took, of
a peer or of the node itself, goes on to the node's other neighbours.
What compares stamps for an Automerge document's sake is handed the
node's own, and finds nothing to do; the Automerge sync isn't begun.
* The node writes its own entry (AppState::mutate_set): what writes
protocol data through a view writes to the members' entries as a
tree, and what the node's own reads as after is put as its next
entry, signed and passed on. Anything else is refused, and so is a
write to an Automerge document as such.
* An event the node writes (held::write) is offered to the set and
passed on; a set lacks nothing of its store to put again.
* The node's swarm is its store's, said at its start.
A simulation: three such nodes of two parties register, and each
holds the others' entries; events put on two of them reach all three,
and they come to stand alike, the documents they hold beside empty.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A node following a party copies no false, so a followed key voting twice
finds nobody to end the first of its two checkpoints. With
--store-nay-beside its followers cast that false by rule: it showed each
checkpoint to some of them, voted false on one itself, had them end it
and move to the other, and passed the first with the rest. Two
checkpoint versions on one, by one key, in a federation of any size.
The rule was there for two checkpoints proposed at once, which a node's
wait before it proposes makes rare. Where they stay proposed, neither
with two thirds, their parties end one by hand: the checkpoints guide
says how (Two proposed at once). Row 59 says so, and its simulation has
the one two thirds back pass, with no false cast.
An option that is gone is named so, with what to do (config::GONE), on
the command line and in a configuration file, where "unknown option"
would leave an operator guessing.
|
| |
|
|
|
|
|
|
| |
b, started again with nothing, reads the new epoch's events by their IDs: what comes
before the version event and isn't built on it, it takes, as its history takes it, and
stops only there. The write put meanwhile a and c hold back, as b did before its
restart, all stopped before it came; b, started again, may take it: the simulation waits
for b to have it either way.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
`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.
|
| |
|
|
|
|
|
|
| |
`store_attack_24`: c is away while a and b take a version passing on tv's and lass's
votes that only moves to a checkpoint, move there, forget what came before, and take a
write after it. Back, c builds the checkpoint from the document, which holds what came
before, and reads what a and b read. What happens after a remake leaving it out comes
with the remakes.
|
| |
|
|
|
|
|
|
|
| |
`federation_attack_28`: tv, lass and makefu, a node each, apart while each is given its
own: two writes of tv's at one place, a write of lass's, and a proposal and the votes
that pass it, each on another node. Apart, each reads its own; together, they read the
same, the version that passed current, written by whichever node held it passed. The
simulations of swarms holding a store share their federation, their nodes started from
its root, and what they read of a node's store.
|
|
|
tv lists a and b, which start from the store's root; lass lists c, which joins by the
store's ID; d is of lass too, which doesn't list it. Events put on a and on c reach a,
b and c, which read them; d, which no member syncs with, gets nothing. A simulated node
started on a document expects its swarm, as `run` has it do.
|