diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/federation.md | 218 |
1 files changed, 119 insertions, 99 deletions
diff --git a/docs/federation.md b/docs/federation.md index 70d9e32..9c39a22 100644 --- a/docs/federation.md +++ b/docs/federation.md @@ -1010,18 +1010,22 @@ which every node works out itself. * **The proposal** lists the voters of the next epoch by their IDs, names its roots (those there are, unless it names others; and for a root it leaves out, which root - has each name a rule gives a root), and names the node of its proposer that is to be - its **coordinator**. + has each name a rule gives a root), names the node of its proposer that is to be its + **coordinator**, and the switch delay. One that names no root is no proposal: nobody + would be in. * **The base.** The coordinator names the base in its record of the proposal, by its heads, at once. -* **Taking the base up.** A voter's node takes the base up (records it, with the ID of - the epoch it built from it: Continuum changing under a swarm) where the base holds - all that the node held `baseAge` before the base reached it, so that a remake can't - leave out what the swarm has; or, however old, where records of that base count for - a third of the voters, of whom one at least is honest, votes or none. It takes up - every base that passes, one record a proposal: two proposals that name one base have - a record each. Each costs the node a snapshot of the document; a voter has - `limits.proposals` open at once, and its budget paces them. +* **Taking the base up.** Every node takes the base up where the base holds all that + the node held `baseAge` before the base reached it, so that a remake can't leave out + what the swarm has; or, however old, where records of that base count for a third of + the voters, of whom one at least is honest, votes or none. A voter's node records + it, with the ID of the epoch it built from it (Continuum changing under a swarm); + any other node notes when it took it up, which `remakeAge` counts from, and builds + the snapshot only once the remake is decided. Taking a base up chooses nothing: a + node takes up every base that passes, one record a proposal (two proposals that name + one base have a record each), and switches only to the one decided. Each costs a + voter's node a snapshot of the document; a voter has `limits.proposals` open at + once, and its budget paces them. * **The votes name the base.** A voter votes for a remake once a node of its took the base up, and its vote names the base. It has one such vote an epoch, never released. A record counts for a voter only where that voter's vote names the record's base. So @@ -1050,16 +1054,18 @@ which every node works out itself. where it finds another remake of the epoch it left decided, it shows it, and its operator says. * **Every node builds the snapshot** itself once the remake is decided, from the base - as it holds it, and switches after the switch delay, as today. The snapshot holds - the registry as it resolves at the base: + as it holds it, and switches after the switch delay its proposal names. The snapshot + holds the registry as it resolves at the base: * the policy that holds, with its numbers; * the voters and the roots, as the proposal says; * the users that count, and those out and not gone, each with its name (or that it is contested, and with which), ID, keys, nodes, and who created and who vouches for it, or that it is in by the seats; * the claims that stand, the names decisions gave, and what the order among the - claims of a name rests on: which gives way to which, which is late against - which, which is settled, which final; + claims of a name rests on: which gives way to which, which is late against which, + which is settled, which final; and of a user the root change holds, roots' + creations that contest each other, with what their order rests on, until the + voters give it first keys; * the values in the namespaces that count, as the envelopes they are; * what is uncovered and not dropped; * the proposals that are open, with their votes; @@ -1083,17 +1089,18 @@ which every node works out itself. epoch after drops the list. * **Carried over.** A node that switches first catches up with the peers it keeps in the epoch it leaves, as a node that comes back does. Then, before it takes anything - in the new epoch, it commits its **carry record**, `_continuum/carried/<node ID>`: - the digests of the envelopes it holds that the base lacks, whoever signed them - (statements, values, proposals, votes and their releases), and what it held of them, - as the snapshot states it for the base: which claim it held as late against which, - or as giving way to which; which statements of a user since unvouched count through - the unvouch; which users it held as gone, which claims as final and what as dropped, - beyond the snapshot. One record a node and epoch, of digests and of what the node - held. Nothing tells it from a later change of the node, and nothing has to: it - witnesses by what it names, not by when it was committed. A node that came to carry - after the base commits, with its record, the `node` statement that named it (rule - 2). + in the new epoch, it commits its **carry record**, every node that switches, whoever + it carries for (out voters too: the heal counts their nodes), + `_continuum/carried/<node ID>`: the digests of the envelopes it holds that the base + lacks, whoever signed them (statements, values, proposals, votes and their + releases), and what it held of them, as the snapshot states it for the base: which + claim it held as late against which, or as giving way to which; which statements of + a user since unvouched count through the unvouch; which users it held as gone, which + claims as final and what as dropped, beyond the snapshot. One record a node and + epoch, of digests and of what the node held. Nothing tells it from a later change of + the node, and nothing has to: it witnesses by what it names, not by when it was + committed. A node that came to carry after the base commits, with its record, the + `node` statement that named it (rule 2). * **Then the envelopes, once.** After its record the node takes from its peers, and writes again, as they are, the envelopes its record names that the epoch doesn't hold yet. Any node commits such an envelope (a `node` statement only the node it @@ -1105,10 +1112,11 @@ which every node works out itself. * **A carry record witnesses** as the node's changes did in the epoch before: as a change with what it names in its history, standing or not as it says. Against a claim, where a node of that claim's side committed it; for an unvouch, or a vouch or - a creation cut off, where a node of its signer or of a root did. So a claim that - turns up later as signed in the epoch before is late against what a root's node's - record names, and nothing rests on the order a node writes in. Against a claim the - snapshot holds, what is carried over gives way. + a creation cut off, where a node of its signer or of a root did: the epoch's it + leaves, whose roots and voters the record speaks for. So a claim that turns up later + as signed in the epoch before is late against what a root's node's record names, and + nothing rests on the order a node writes in. Against a claim the snapshot holds, + what is carried over gives way. * **Its order and its numbers.** Of a user's statements of one kind, and of the proposals of a matter, those the snapshot holds come first, then those carried over, by the numbers they state, then those signed in the new epoch. So a number @@ -1132,8 +1140,8 @@ which every node works out itself. their epoch, which has its one remake. * **Seen for long, over a remake.** What was gone, final or dropped at the base is so in the snapshot. What came to be so after the base, each node that carries for a - voter says in its carry record. What the nodes of a third of the voters say, a node - counted for one voter, is so. Every other length starts anew. + voter says in its carry record. What the nodes of a third of the voters of the epoch + it leaves say, a node counted for one voter, is so. Every other length starts anew. * **A remake decided late** sends every node to a base that old. What was signed since comes along, about once: every node's carry record names what it holds and what it held of it, decisions among it. What it costs is the lengths of time that had begun, @@ -1346,7 +1354,8 @@ A change is valid if, in the document at its dependencies: which a node comes to carry: it holds a `node` statement naming its committer, by a user that isn't out there, the committer's member entry and, after a remake, its carry record, and nothing else. Or it holds nothing but the committer's own record - of a proposal, and the committer carries for a voter that is out. + of a proposal, or its carry record, and the committer carries for a voter that is + out. 3. Apart from the node's own member entry (of the shape the policy's version gives it, within `limits.entry`), its own records of proposals and its carry record, it writes only envelopes, each naming the swarm, its epoch, its path, its user and @@ -1518,25 +1527,29 @@ see peers in the old one, the decision in their history (`GET /peers`, the dashb It heals by the new epoch's carry records, counted as what was seen for long is: a node for one voter, of the voters of the epoch that decided the remake, each record as it stood where it was written (a stop with a cut after it takes nothing back). A node -that waits fetches them from peers in the new epoch and judges them against the -snapshot it builds from the base it holds. Read so, alike by every node, they only -grow: +that waits asks a peer in the new epoch for them once, when the two connect (their +handshakes name their epochs), and the peer pushes it each one it takes after, as it +takes it: nothing is polled. It judges them against the snapshot it builds from the +base it holds. Read so, alike by every node, they only grow: * Once they count for more than a third of the voters, every node that waits follows: a node of an honest voter took it up in time, and the malicious alone count for - less. A node whose operator refused the remake, by hand or by its bounds, doesn't: - the heal moves only those that wait by `remakeAge`. + less. A node whose operator refused the remake, by hand or by sending it back, + doesn't: the heal moves only those that wait by `remakeAge`. * While they count for no more, the split stays, shown on both sides. A node that - followed goes back only by its operator's word, as to any older epoch: it drops the - new epoch, as a node comes back from changes the others refuse (below), and what its - users signed there goes to the quarantine, to be signed again in the epoch it is - back in. Should the count cross a third later, it follows again, its carry record - there the one it wrote before. + followed goes back only by its operator's word (`POST /admin/epochs/back`), as to + any older epoch, and that refuses the remake: it drops the new epoch, as a node + comes back from changes the others refuse (below), what its users signed there goes + to the quarantine, to be signed again in the epoch it is back in, and the heal + doesn't move it again. Meanwhile neither epoch decides what takes nodes of more than + two thirds of the voters: each side's proposals wait, and a node moves on by word + (`POST /admin/epochs/follow`, or back). -The malicious choose when a split starts, by when they show the last record; not that -the honest go back and forth, nor whether they follow, which takes nodes of honest -voters. An epoch the honest nodes stay in, its voters' remake votes spent, moves on by -word, not by votes. +The malicious choose when a split starts, by when they show the last record, and when +the count crosses, by when they write their own carry records; not that the honest go +back and forth, nor whether they follow, which takes nodes of honest voters. An epoch +the honest nodes stay in, its voters' remake votes spent, moves on by word, not by +votes. **Changes one side refuses** are a partition nobody chose. A node is cut off from the others when it holds a change they refuse, as everything it writes after builds on @@ -1760,12 +1773,13 @@ a write is refused only by what its own history holds, and counts from the start base, once an epoch: two bases are both decided only where more than a third of the voters signed for both. * *Nobody is moved.* A node refuses any decision by its operator's word or bounds, and - follows a fork by its operator's word alone. A node that waits by `remakeAge` - follows once the new epoch's carry records count for more than a third of V, a node - for one voter, as each stood where written: one at least an honest voter's node that - took the remake up in time. Fewer than a third, writing records as they like, move - nobody, and nobody goes back but by its operator's word: so every honest node that - waits ends where the honest that followed are, once they are enough. + follows a fork by its operator's word alone; going back refuses the remake. A node + that waits by `remakeAge` follows once the new epoch's carry records count for more + than a third of V, a node for one voter, as each stood where written: one at least + an honest voter's node that took the remake up in time. Fewer than a third, writing + records as they like, move nobody, and nobody goes back but by its operator's word: + so every honest node that waits ends where the honest that followed are, once they + are enough. * *With other fractions.* Write d for `fractions.decide` and s for `fractions.seen`. A decision no honest voter voted for takes d of the voters malicious. Two proposals of one matter both decided, with nobody changing their mind, take more @@ -1775,8 +1789,11 @@ a write is refused only by what its own history holds, and counts from the start **Unvouching** takes away no more than its signer could have kept from seeing: what the unvouched user signed stays if a node of the unvoucher or of a root committed a -change that has it in its history and not the unvouch. Those changes can't be taken -back, so the point only moves forward as more of them show up. +change that has it in its history and not the unvouch. Those changes are taken back +only with their node's witness, where the node is stopped with a cut from before them: +an unvoucher that stops its own nodes so undoes what they had seen, never what a +root's node had. So the point moves forward as more of them show up, and back only as +far as the roots' nodes' witness. ## Roads not taken @@ -2214,50 +2231,52 @@ Decisions and remakes: | 111 | Votes for a remake with the others, keeps its node's record back once they changed their minds, and shows it when it likes | Those who voted for the remake vote for no other in the epoch: it comes on the day its last record does. A node follows a remake at once only within `remakeAge` of taking its base up; past it, once the new epoch's carry records count for more than a third of the voters. Voters who split between two remakes end the epoch's remakes, and those left go apart | not promised | sim: `a_remake_held_by_its_last_record` | | 112 | Holds its node's record of a remake back, and shows it when some honest nodes are past `remakeAge` from taking the base up and some aren't | Those within it follow, those past it wait, and both sides see it. Once the new epoch's carry records count for more than a third of the voters every node that waits follows; until then those that followed stay, or go back by their operators' word, their users' writes there quarantined to be signed again. A remake shown long after its time is followed by the malicious alone | not promised; healed | sim: `a_remake_between_the_bounds_heals`, `a_remake_long_past_its_time` | | 113 | Holds its own carry records back, or takes them back by stopping its node with a cut, or carries for honest voters without nodes, to steer whether a split heals forward or back, and when | The heal counts a node for one voter, each record as it stood where written; nobody goes back but by its operator's word. The malicious choose when a split starts, not whether the honest follow nor that they go back and forth | not promised; 7 | sim: `a_heal_the_malicious_cant_steer` | -| 114 | A thief's statements are in the base of a remake | They stand: a remake makes final. The vote's days are the time to cut the key off | not promised | unit: `a_cut_reaches_to_the_snapshot` | -| 115 | Tells a node that was away of an epoch that isn't the swarm's | The node rejoins no epoch that peers advertise: it finishes the old one from archives and builds the next itself, or takes the ID its operator gave | 1 | sim: `away_over_a_remake`, `back_by_an_id` | -| 116 | A node back after several remakes offers what its user signed epochs ago | Refuse: an envelope is taken in its epoch and the next. Quarantined, for the user to sign again | 3 | unit: `carried_over_one_epoch_only` | -| 117 | A version builds another snapshot from a remake's base | Its node records another ID. The remake is decided for the ID two thirds got; the node stays, and says so | 7 | sim: `a_remake_by_its_result` | -| 118 | A remake names its proposer the only root, or leaves a root out; the root left out signs on as one | The voters see whom a remake names before they vote for it. A root is one in the epoch that names it: what it signs after is an ordinary user's, and it is out unless someone vouches for it | 7 | unit: `roots_are_the_remakes`, `a_root_for_its_epoch` | -| 119 | Two thirds of the voters turn on the rest | They remake, name the roots and who votes, set any number (a share of the voters that lets one decide for all), change the policy, give a user's first keys to another, deal with the names of a user that is out, and say whose a contested name is: a name taken, in the open. They forge no signature and move nobody to other rules; the rest refuse, or fork | not promised | argued (Going apart, Refusing a decision) | -| 120 | Offers a statement signed on the other side of a fork | Refuse: it names its epoch | 3 | unit: `signed_for_its_user_id_and_epoch` | -| 121 | A fork naming its proposer the only voter and root | A node follows only by its operator's word, which names the proposal; what that says shows | 7 | sim: `a_fork_by_choice` | -| 122 | A decision breaks a node's bounds: the voters let one of them decide for all | The node refuses it and moves to the epoch built without it, the same for every node that refuses, with what it held: they go on together | 7 | unit: `bounds_on_the_numbers`; sim: `those_who_refuse_meet` | -| 123 | Proposes saying it saw only the epoch's root, so that those who refuse carry the whole epoch over | No honest node takes up a proposal that says it saw less than the node held a window before: it isn't decided | 7 | unit: `a_proposal_says_it_saw_enough` | -| 124 | Says it refuses a decision, or hands out the ID of an epoch without it, to draw nodes there | A node goes there by its own bounds or its operator's word only | 1 | unit: `refusing_is_ones_own` | +| 114 | Shows a remake long after its time, to sweep the nodes that carry for no voter into an epoch with the malicious voters' nodes alone | Every node takes a base up and counts `remakeAge` from then; past it, a node of no voter waits for the heal as any node does | 7 | sim: `a_late_remake_takes_no_node_of_no_voter` | +| 115 | Lets a split stay, the honest that followed sent back by their operators, then writes its own carry records so the count crosses, for what the users signed again to come along twice | Going back refuses the remake: the heal doesn't move such a node again, and what its users signed again stays in the epoch it went back to | 4, 7 | sim: `going_back_refuses_the_remake` | +| 116 | A thief's statements are in the base of a remake | They stand: a remake makes final. The vote's days are the time to cut the key off | not promised | unit: `a_cut_reaches_to_the_snapshot` | +| 117 | Tells a node that was away of an epoch that isn't the swarm's | The node rejoins no epoch that peers advertise: it finishes the old one from archives and builds the next itself, or takes the ID its operator gave | 1 | sim: `away_over_a_remake`, `back_by_an_id` | +| 118 | A node back after several remakes offers what its user signed epochs ago | Refuse: an envelope is taken in its epoch and the next. Quarantined, for the user to sign again | 3 | unit: `carried_over_one_epoch_only` | +| 119 | A version builds another snapshot from a remake's base | Its node records another ID. The remake is decided for the ID two thirds got; the node stays, and says so | 7 | sim: `a_remake_by_its_result` | +| 120 | A remake names its proposer the only root, or leaves a root out; the root left out signs on as one | The voters see whom a remake names before they vote for it. A root is one in the epoch that names it: what it signs after is an ordinary user's, and it is out unless someone vouches for it | 7 | unit: `roots_are_the_remakes`, `a_root_for_its_epoch` | +| 121 | Two thirds of the voters turn on the rest | They remake, name the roots and who votes, set any number (a share of the voters that lets one decide for all), change the policy, give a user's first keys to another, deal with the names of a user that is out, and say whose a contested name is: a name taken, in the open. They forge no signature and move nobody to other rules; the rest refuse, or fork | not promised | argued (Going apart, Refusing a decision) | +| 122 | Offers a statement signed on the other side of a fork | Refuse: it names its epoch | 3 | unit: `signed_for_its_user_id_and_epoch` | +| 123 | A fork naming its proposer the only voter and root | A node follows only by its operator's word, which names the proposal; what that says shows | 7 | sim: `a_fork_by_choice` | +| 124 | A decision breaks a node's bounds: the voters let one of them decide for all | The node refuses it and moves to the epoch built without it, the same for every node that refuses, with what it held: they go on together | 7 | unit: `bounds_on_the_numbers`; sim: `those_who_refuse_meet` | +| 125 | Proposes saying it saw only the epoch's root, so that those who refuse carry the whole epoch over | No honest node takes up a proposal that says it saw less than the node held a window before: it isn't decided | 7 | unit: `a_proposal_says_it_saw_enough` | +| 126 | Says it refuses a decision, or hands out the ID of an epoch without it, to draw nodes there | A node goes there by its own bounds or its operator's word only | 1 | unit: `refusing_is_ones_own` | Nodes and syncing: | # | The adversary | Honest nodes | Promise | Shown by | |---|---|---|---|---| -| 125 | Sends different changes to different peers, each under its own number | Take all: changes made at once | 2 | sim: `two_histories_merge` | -| 126 | Forks its node's actor | The nodes that took each split; one offered both holds proof and refuses the node; a side drops by its operator's choice | not promised | sim: `a_forked_actor_is_proven`, `a_side_drops_a_fork` | -| 127 | Holds changes back, or passes on some | They come by other nodes; a joiner caught up with it syncs on | 6 | sim: `withheld_changes_arrive` | -| 128 | Places its nodes around a victim by choosing their keys | The victim's node keeps its seeds and its user's other nodes as neighbours; a claim not settled for long shows. It costs time, not names | 5, 6 | sim: `around_a_victim` | -| 129 | Hands a joining node another root change, or changes from before the policy | Refuse the handshake; there is no before | 1 | sim: `a_joiner_takes_its_root_only` | -| 130 | Signs a token for any user with its node's key | Taken only by a node whose operator named the signing node | 3 | unit: `a_token_of_ones_party` | -| 131 | Logs in on another party's node with a key of the registry; has a name in the registry that the node's own users have | Keys in the registry give nothing on anyone's node by themselves: whom a node lets in is its operator's, and what a user may write is in its signature | 3 | unit: `registry_keys_open_no_node` | -| 132 | Lies in its member entry (ready, reached, stable); publishes a short window there to make every node stamp hourly; writes an entry of any size | Sync and trees bend; nothing gets in that way. How often nodes stamp is the policy's; an entry has a shape and a size, or the change is refused | 6 | unit: `an_entry_has_a_shape`, `stamps_by_the_policy`; argued (Reaching the others) | -| 133 | Sends envelopes that don't check, without end | Refuse each (a signature costs about 30 µs to check *(docs)*); the node is refused as a whole after the first of its own | 6 | sim: `a_refused_node_costs_little` | -| 134 | Writes its own member entry without end; signs and gives up without end; fills the waiting changes; sends changes that say they saw little, each to be judged far back | Take them no faster than a budget per party: put off, never refused; a share of the waiting each | 6 | sim: `a_party_past_its_budget_waits` | -| 135 | Starts a writer with every change: each costs every node memory in proportion to the document's history | Past `limits.writers` a user and epoch, every node puts off the changes that start more of the nodes whose writers count for it: a node's, for the user its member entry names. Nothing is refused; what reaches a node within others' histories is held, and a remake leaves it out. A user below a root costs the root nothing, and one beside others on a node costs them nothing, but where the node's entry names it | 6; not bounded | sim: `writers_past_their_limit_wait` | -| 136 | One of the users a node carries for, besides the node's own, starts writers past its limit, from nodes of its own | The node's writers count for the user its member entry names, over a remake too, and nothing of it is put off for the others: the users beside it write on | 6 | sim: `writers_count_for_the_user_an_entry_names_beside_others` | -| 137 | Signs its `node` statement naming another party's node again and again until its digest is the lowest, so that the node's writers count for it after a remake, then starts writers past its limit | A node's writers count for the user its member entry names, the node's own word, carried over a remake; the digest decides only where the entry names none | 6 | unit: `writers_count_for_the_user_an_entry_names` | -| 138 | Sends a node a change of the node's own writer, another value, to make it start a writer | Refused as forged; the node switches only where its own key signed it (a copy of its files) | 6 | unit, exists: `another_writing_as_this_node` | -| 139 | Crafts a first change of another node's writer, authored as a third node, to sort before the writer's own in a batch, so that screening judges the writer's changes as the third node's | Screening names a change's node by its own author, or that of its actor's first change in its own history, never by another change of the batch: the writer's changes are vouched for by their own node's signature, and the crafted one, a second first change of the writer, is refused as forged | 1, 2 | unit, exists: `a_committer_from_its_own_history` | -| 140 | Sends a change of a few bytes that holds a million operations | Taken, at the cost of applying it: nothing bounds a change's operations | not promised (a bound on what an epoch's document costs) | argued | -| 141 | Crafts a change Automerge won't take, or that writes in an object nowhere to be found | Refuse *(checked: the rules refuse the second today)*; only the message that brought it fails | 1 | unit: `a_change_writing_nowhere` | -| 142 | Crafts a change Automerge takes and shouldn't: bytes it wouldn't encode itself, operations numbered against its dependencies', a gap in its actor's changes, an operation named that is elsewhere or outside its history, an operation Automerge's transactions never write (an element written over naming the one inserted after it, an insert that replaces, a deletion or an increment inserted, a deletion named as replaced), a table written into, a value written at a mark's begin | Refuse before Automerge sees it, by the change and its own history alone: applied, such a change makes a node panic, save a document that doesn't load, or part from nodes it reached in another order | 1, 2 | unit, exist: `bytes_automerge_wouldnt_encode_are_refused`, `operations_numbered_against_their_dependencies_are_refused`, `a_gap_in_an_actors_changes_is_refused`, `operations_named_at_the_wrong_place_are_refused`, `operations_outside_a_changes_history_are_refused`, `only_what_transactions_write_passes`, `only_what_holds_a_value_is_replaced`, `no_table`, `no_mark`, `what_passes_leaves_automerge_sound`, `a_batch_is_checked_against_itself`, `a_change_refused_after_its_check_stands_in_for_nothing` | +| 127 | Sends different changes to different peers, each under its own number | Take all: changes made at once | 2 | sim: `two_histories_merge` | +| 128 | Forks its node's actor | The nodes that took each split; one offered both holds proof and refuses the node; a side drops by its operator's choice | not promised | sim: `a_forked_actor_is_proven`, `a_side_drops_a_fork` | +| 129 | Holds changes back, or passes on some | They come by other nodes; a joiner caught up with it syncs on | 6 | sim: `withheld_changes_arrive` | +| 130 | Places its nodes around a victim by choosing their keys | The victim's node keeps its seeds and its user's other nodes as neighbours; a claim not settled for long shows. It costs time, not names | 5, 6 | sim: `around_a_victim` | +| 131 | Hands a joining node another root change, or changes from before the policy | Refuse the handshake; there is no before | 1 | sim: `a_joiner_takes_its_root_only` | +| 132 | Signs a token for any user with its node's key | Taken only by a node whose operator named the signing node | 3 | unit: `a_token_of_ones_party` | +| 133 | Logs in on another party's node with a key of the registry; has a name in the registry that the node's own users have | Keys in the registry give nothing on anyone's node by themselves: whom a node lets in is its operator's, and what a user may write is in its signature | 3 | unit: `registry_keys_open_no_node` | +| 134 | Lies in its member entry (ready, reached, stable); publishes a short window there to make every node stamp hourly; writes an entry of any size | Sync and trees bend; nothing gets in that way. How often nodes stamp is the policy's; an entry has a shape and a size, or the change is refused | 6 | unit: `an_entry_has_a_shape`, `stamps_by_the_policy`; argued (Reaching the others) | +| 135 | Sends envelopes that don't check, without end | Refuse each (a signature costs about 30 µs to check *(docs)*); the node is refused as a whole after the first of its own | 6 | sim: `a_refused_node_costs_little` | +| 136 | Writes its own member entry without end; signs and gives up without end; fills the waiting changes; sends changes that say they saw little, each to be judged far back | Take them no faster than a budget per party: put off, never refused; a share of the waiting each | 6 | sim: `a_party_past_its_budget_waits` | +| 137 | Starts a writer with every change: each costs every node memory in proportion to the document's history | Past `limits.writers` a user and epoch, every node puts off the changes that start more of the nodes whose writers count for it: a node's, for the user its member entry names. Nothing is refused; what reaches a node within others' histories is held, and a remake leaves it out. A user below a root costs the root nothing, and one beside others on a node costs them nothing, but where the node's entry names it | 6; not bounded | sim: `writers_past_their_limit_wait` | +| 138 | One of the users a node carries for, besides the node's own, starts writers past its limit, from nodes of its own | The node's writers count for the user its member entry names, over a remake too, and nothing of it is put off for the others: the users beside it write on | 6 | sim: `writers_count_for_the_user_an_entry_names_beside_others` | +| 139 | Signs its `node` statement naming another party's node again and again until its digest is the lowest, so that the node's writers count for it after a remake, then starts writers past its limit | A node's writers count for the user its member entry names, the node's own word, carried over a remake; the digest decides only where the entry names none | 6 | unit: `writers_count_for_the_user_an_entry_names` | +| 140 | Sends a node a change of the node's own writer, another value, to make it start a writer | Refused as forged; the node switches only where its own key signed it (a copy of its files) | 6 | unit, exists: `another_writing_as_this_node` | +| 141 | Crafts a first change of another node's writer, authored as a third node, to sort before the writer's own in a batch, so that screening judges the writer's changes as the third node's | Screening names a change's node by its own author, or that of its actor's first change in its own history, never by another change of the batch: the writer's changes are vouched for by their own node's signature, and the crafted one, a second first change of the writer, is refused as forged | 1, 2 | unit, exists: `a_committer_from_its_own_history` | +| 142 | Sends a change of a few bytes that holds a million operations | Taken, at the cost of applying it: nothing bounds a change's operations | not promised (a bound on what an epoch's document costs) | argued | +| 143 | Crafts a change Automerge won't take, or that writes in an object nowhere to be found | Refuse *(checked: the rules refuse the second today)*; only the message that brought it fails | 1 | unit: `a_change_writing_nowhere` | +| 144 | Crafts a change Automerge takes and shouldn't: bytes it wouldn't encode itself, operations numbered against its dependencies', a gap in its actor's changes, an operation named that is elsewhere or outside its history, an operation Automerge's transactions never write (an element written over naming the one inserted after it, an insert that replaces, a deletion or an increment inserted, a deletion named as replaced), a table written into, a value written at a mark's begin | Refuse before Automerge sees it, by the change and its own history alone: applied, such a change makes a node panic, save a document that doesn't load, or part from nodes it reached in another order | 1, 2 | unit, exist: `bytes_automerge_wouldnt_encode_are_refused`, `operations_numbered_against_their_dependencies_are_refused`, `a_gap_in_an_actors_changes_is_refused`, `operations_named_at_the_wrong_place_are_refused`, `operations_outside_a_changes_history_are_refused`, `only_what_transactions_write_passes`, `only_what_holds_a_value_is_replaced`, `no_table`, `no_mark`, `what_passes_leaves_automerge_sound`, `a_batch_is_checked_against_itself`, `a_change_refused_after_its_check_stands_in_for_nothing` | Rules, and the swarm as it is: | # | The adversary | Honest nodes | Promise | Shown by | |---|---|---|---|---| -| 143 | A rule differs between versions (a bug) | Each side refuses what the other takes, or their stamps name two digests for the same changes: each logs and shows it. A node that finds itself apart from the nodes of more than two thirds of the other voters at its first start with a version writes nothing. One side upgrades and drops | not promised | sim: `a_side_drops_and_comes_back`, `two_digests_one_history`; unit: `a_node_checks_itself` | -| 144 | Stamps a wrong digest, to keep the nodes that upgrade from writing; one of three voters does | A node stops only where it differs from the nodes of more than two thirds of the other voters; from fewer it shows it and goes on | 6 | unit: `one_wrong_digest_stops_nobody`, `of_three_voters` | -| 145 | A policy version a node doesn't know: in the root, or decided | It doesn't sync, and takes no such proposal up: a policy is decided only with two thirds of the voters' nodes knowing it | 1 | unit: `no_sync_under_an_unknown_policy`, `an_unknown_policy_isnt_taken_up` | -| 146 | A partition, for any length of time | A side decides only with nodes of two thirds of all the voters on it. Where a third of them have nodes and votes on both sides, both may: every node then acts on the higher number | 7 | sim: `one_side_decides`; unit: `the_last_holds` | -| 147 | None: a swarm that isn't federated | Everything as today | Optional | the existing tests, untouched; `bench_screening` | +| 145 | A rule differs between versions (a bug) | Each side refuses what the other takes, or their stamps name two digests for the same changes: each logs and shows it. A node that finds itself apart from the nodes of more than two thirds of the other voters at its first start with a version writes nothing. One side upgrades and drops | not promised | sim: `a_side_drops_and_comes_back`, `two_digests_one_history`; unit: `a_node_checks_itself` | +| 146 | Stamps a wrong digest, to keep the nodes that upgrade from writing; one of three voters does | A node stops only where it differs from the nodes of more than two thirds of the other voters; from fewer it shows it and goes on | 6 | unit: `one_wrong_digest_stops_nobody`, `of_three_voters` | +| 147 | A policy version a node doesn't know: in the root, or decided | It doesn't sync, and takes no such proposal up: a policy is decided only with two thirds of the voters' nodes knowing it | 1 | unit: `no_sync_under_an_unknown_policy`, `an_unknown_policy_isnt_taken_up` | +| 148 | A partition, for any length of time | A side decides only with nodes of two thirds of all the voters on it. Where a third of them have nodes and votes on both sides, both may: every node then acts on the higher number | 7 | sim: `one_side_decides`; unit: `the_last_holds` | +| 149 | None: a swarm that isn't federated | Everything as today | Optional | the existing tests, untouched; `bench_screening` | ## The registry on it ``` @@ -2314,7 +2333,7 @@ it trusts for that. ## Stages Each leaves the system working, and is a few patches with its tests, which leave -their vectors. At every stage the existing tests pass untouched (147). +their vectors. At every stage the existing tests pass untouched (149). 1. **A federated swarm's frame.** `--genesis-policy` (a file, written into the genesis change with the roots, the voters and the users it starts with); a federated node @@ -2322,7 +2341,7 @@ their vectors. At every stage the existing tests pass untouched (147). yet, takes tokens and logins by key as its operator says, keeps ended sessions to itself, stamps as the policy says, and writes a member entry of the policy's shape and size. What the genesis change sets for the swarm as a whole is read from the - policy. Tests: 129 to 132, 139, 142, 145, 147, and the policy's existing tests + policy. Tests: 131 to 134, 141, 144, 147, 149, and the policy's existing tests under a policy from the genesis change. Those of a crafted change, and of a crafted committer, exist already: screening refuses those in every swarm. 2. **Statements.** The users' registers (`create`, `key`, `node`, `vouch`, `release`); @@ -2344,8 +2363,8 @@ their vectors. At every stage the existing tests pass untouched (147). read from the stamps; final. `GET /registry/claims` with what makes a claim late; values marked in `GET /store`. A node keeps its seeds and its user's other nodes as neighbours, leaves out members that name another epoch, and shows a claim long - unsettled. Tests: 7, 9, 10, 13, 15, 16, 30, 36, 38, 39, 43 to 46, 49, 52, 53, 125, - 127, 128. + unsettled. Tests: 7, 9, 10, 13, 15, 16, 30, 36, 38, 39, 43 to 46, 49, 52, 53, 127, + 129, 130. 6. **Cuts.** `retire` and the keys above, a node that stops, a cut never reaching its own statement, what a cut takes back, what doesn't count left out, the value before read again, the client listing what stopped counting. Tests: 14, 20, 47, 48, 51, 54 @@ -2358,7 +2377,7 @@ their vectors. At every stage the existing tests pass untouched (147). 8. **Coming back.** The drop an operator asks for, a forked actor proven and shown with what the roots' nodes hold, the budget and the share per party, the writers counted per user, for the one a node's member entry names, a node keeping its - writer over a clean stop. Tests: 126, 133 to 138, 140, 141. + writer over a clean stop. Tests: 128, 135 to 140, 142, 143. 9. **The registry.** Import, export, and a federated swarm of the simulations with the registry's kinds and a few hundred hosts. From here it can be tried: users, hosts, names, a root that settles, names that become final. It isn't to be relied on yet. @@ -2370,10 +2389,10 @@ their vectors. At every stage the existing tests pass untouched (147). holds, what hangs; `GET /registry/decisions`. What is decided: a number, a user's first keys, the names of a user that is out, whose a contested name is, a name the rules leave to the voters. The simulations start from a root change naming several - voters, as a remake's does. Tests: 23, 50, 63, 67, 70 to 86, 146. + voters, as a remake's does. Tests: 23, 50, 63, 67, 70 to 86, 148. 11. **Versions.** The digest with every stamp, a node checking itself before it writes; for every swarm, a node that speaks the wire version before its own, and a - handshake that says which epochs its node keeps. Tests: 143, 144. + handshake that says which epochs its node keeps. Tests: 145, 146. 12. **Remakes.** The proposal with its list of voters, its roots and its coordinator; the base, every one a node finds holding what it held `baseAge` before, however old where records count for a third, one record a proposal, judged without votes; @@ -2385,14 +2404,15 @@ their vectors. At every stage the existing tests pass untouched (147). for long, over a remake; what becomes final. A node keeping the epochs it left on disk, peers answering for them and saying which; a node walking them, or rejoining by an ID its operator gave, and by none that peers advertise. Tests: 68, 69, 89 to - 95, 103 to 110, 114 to 118. + 95, 103 to 110, 116 to 120. 13. **The policy by a decision.** The policy as a matter, a node that doesn't know it, what it no longer covers: shown aside, taken away by its user only, dropped after - a time, moved at a remake. Tests: 87, 88, 145. + a time, moved at a remake. Tests: 87, 88, 147. 14. **Going apart, and refusing.** A fork followed by an operator's word, with who votes and who the roots are on its side. Refusing a decision: a node's bounds, how - late a remake it follows at once (`remakeAge`) and how the split heals, the epoch - without the decision, what a node takes along. Tests: 111 to 113, 119 to 124. From + late a remake it follows at once (`remakeAge`) and how the split heals, a waiting + node's fetch of the new epoch's carry records, going back as refusing, the epoch + without the decision, what a node takes along. Tests: 111 to 115, 121 to 126. From here it can be relied on: the rules change by decisions. ## What was checked, and what is assumed |
