aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-14 12:18:28 +0000
committertv <tv@krebsco.de>2026-11-14 12:18:28 +0000
commit966e3e43f77c976a66d0f4afad0cad05aab0d9b3 (patch)
treeef9f11a035738172d37a3f63f277d5a9dd5c88e7 /docs
parentef9a4d5cdd46024285c8c510cf6767344199ab3e (diff)
federation: a switch record says what began after the base
A length that began after a remake's base had nothing in the snapshot, so it started anew in the next epoch: a claim final after the base was contestable again, a user gone after it waited again. A decision decided after the base waited for the nodes of two thirds of the voters to take it up again, who may be gone by then. And a node's change written between its switch record and the envelopes it named witnessed against them. A switch record now also names each length that began for its node after the base, from the stamp it began at; the claims it held standing with no rival there; and the proposals it took up after the base, which are its records in the new epoch, judged against the votes brought along. Every change a node commits after its switch record reads what the record names as in its history. The length by which something stops counting for good is among the lengths the snapshot and the switch records list.
Diffstat (limited to 'docs')
-rw-r--r--docs/federation.md175
1 files changed, 93 insertions, 82 deletions
diff --git a/docs/federation.md b/docs/federation.md
index 678e1c0..aa30ad3 100644
--- a/docs/federation.md
+++ b/docs/federation.md
@@ -1119,9 +1119,9 @@ envelopes are brought along as they were signed (below).
or a cut; and for each claim not yet settled, the users whose nodes had it
standing in a change they committed;
* how far each length of time has run: for each thing being seen (a user out, a
- claim holding its name, a decision holding, a thing uncovered), each node of a
- voter with its first stamp, and that stamp's time, from which it has held the
- thing so without a break;
+ claim holding its name, a decision holding, a thing uncovered, a statement or
+ value not counting), each node of a voter with its first stamp, and that stamp's
+ time, from which it has held the thing so without a break;
* what is uncovered and not dropped;
* the proposals that are open, with their votes;
* the member entries of the nodes that carry for a user it holds, and the epochs'
@@ -1145,18 +1145,21 @@ envelopes are brought along as they were signed (below).
doesn't name, and is refused for that (rule 7).
* **Brought along.** 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 **switch record**, every node that switches, whoever
- it carries for (out voters too), `_continuum/switched/<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 and of what the
- snapshot holds: which claim it held as late against which, or as giving way to
- which; which statements of a user since unvouched, or whose creation or vouch was
- cut off, count through the unvouch or the cut; and which lengths of time, of those
- the snapshot lists for the node, it saw broken after the base. 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 **switch record**, every node that switches,
+ whoever it carries for (out voters too), `_continuum/switched/<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
+ and of what the snapshot holds: which claim it held as late against which, or as
+ giving way to which; which statements of a user since unvouched, or whose creation
+ or vouch was cut off, count through the unvouch or the cut; which lengths of time,
+ of those the snapshot lists for the node, it saw broken after the base; each length
+ that began for it after the base, from the stamp it began at, with that stamp's
+ time; the claims it held standing while no other of their names was there; and the
+ proposals it took up after the base. 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 an envelope brought along, as it commits any (a `node`
@@ -1168,9 +1171,10 @@ envelopes are brought along as they were signed (below).
* **A switch 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.
+ a creation cut off, where a node of its signer or of a root did. Every change the
+ node commits after its record reads what the record names as in its history. 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.
* **Brought along, and held by the snapshot.** What a claim brought along says its
signer saw isn't there to look at, so it and a claim the snapshot holds are ordered
as two claims out of each other's sight: by the switch records, and by what the
@@ -1189,16 +1193,18 @@ envelopes are brought along as they were signed (below).
one that another replaces is left out (Resolving).
* **A cut brought along** is the list its statement carries (Cuts).
* **Decisions after the base** aren't in the snapshot. Their proposals and votes are
- brought along, and a node that held one decided takes it up again in the new epoch,
- whether its votes still run or not: it is decided there once the nodes of two thirds
- of the voters switched. Until then the registry resolves without it, and what is
- signed meanwhile with a key the decision cut off is outside that cut once it holds
- again.
+ brought along, and the nodes' records come in their switch records: a proposal a
+ node took up after the base is its record in the new epoch, judged against the votes
+ brought along, wherever they are in the epoch, whether they still run or not. So a
+ decision comes along as it was, once the switch records and the votes are there.
+ Until then the registry resolves without it, and what is signed meanwhile with a key
+ the decision cut off is outside that cut once it holds.
* **Lengths of time go on.** A node's stamps in the new epoch continue the one the
snapshot lists for it: a thing it held so there and at a stamp in the new epoch has
been so all the while, unless its switch record says it saw the thing broken after
- the base. What its stamps in the epoch before showed after the base is read no other
- way.
+ the base. A length that began for the node after the base runs from the stamp its
+ switch record names. What its stamps in the epoch before showed after the base is
+ read no other way: it is the node's word, as each of its stamps is.
* **A node that was away** comes back as said below (Coming back after remakes).
* **A node that joins** is given a root change to start from, by whoever brings its
user in: the genesis change, or the ID of a later epoch.
@@ -1206,10 +1212,9 @@ envelopes are brought along as they were signed (below).
**What a remake changes**, then, is nothing that counts, but for what it can't carry:
a statement a floor refuses comes no more; what only a node witnessed after the base,
and named in no switch record because it never switched and doesn't come back, is lost
-with it; a decision decided after the base waits in the new epoch for the nodes of two
-thirds of the voters to take it up again. Who remakes, when, and from what base
-changes none of it: that is why the alive peers decide it, of whom a party running
-many nodes can be most.
+with it; a decision decided after the base waits for the switch records that hold its
+records. Who remakes, when, and from what base changes none of it: that is why the
+alive peers decide it, of whom a party running many nodes can be most.
What a remake bounds, and what everything costs, is said below (What it costs).
@@ -1436,6 +1441,9 @@ is:
and of what the snapshot holds: `late` and `givesWay` (pairs of claims' digests),
`through` (statements that count through an unvouch or a cut: their digests),
`broken` (lengths of time the snapshot lists for the node that it saw broken after
+ the base), `begun` (each length that began for the node after the base: the thing,
+ the stamp it began at and that stamp's time), `standing` (claims it held standing
+ while no other of their names was there), `records` (the proposals it took up after
the base).
* **A member entry**, of the shape its policy's version gives it, within
`limits.entry`: what it is today (its addresses, what it reaches, whether it is
@@ -1747,7 +1755,7 @@ with the epoch (Automerge: writers, history).
| a claim | its statement; while it has a rival, what each witness had seen, kept as the node goes; until it is final, a length watched for each voter's node |
| a cut | 32 B for each statement and value it keeps |
| a root's node | a change a `witness` at most while claims reach it |
-| a remake | the snapshot built by every node, the registry gone over once; a floor for each user and kind it left something out of; a switch record a node, 32 B for each envelope beyond the base it holds; each such envelope written once more; the epoch left, on disk for `archiveRetention` |
+| a remake | the snapshot built by every node, the registry gone over once; a floor for each user and kind it left something out of; the lengths it lists, one a thing being seen and voter's node; a switch record a node, 32 B for each envelope beyond the base it holds; each such envelope written once more; the epoch left, on disk for `archiveRetention` |
| a signature | some 30 µs to check *(docs)* |
What bounds it:
@@ -2459,55 +2467,58 @@ Decisions and remakes:
| 107 | A node that held only the older of two values its user wrote since the base carries it beside the newer one | Of several brought along to one place, one that another replaces is left out | 3 | unit: `a_replaced_value_is_left_out` |
| 108 | Signs a claim "in the epoch before" of a name the snapshot holds | It is late against the snapshot's claim where that was settled at the base, or where a node of its side had that standing; else the two contest, as claims out of each other's sight do | 5 | unit: `brought_along_against_the_snapshot` |
| 109 | Hands in again what a remake left out: a stolen laptop's `node` and `key` statements, retired since | Refuse: its user's floor for its kind is at its number or above; a value names in its `prev` one that is gone | 3 | unit: `what_a_remake_dropped_stays_out` |
-| 110 | Commits a remake from a base a month old | Every node goes there, and its switch record names what it holds beyond the base and what it held of it (who saw what first, decisions since); each envelope comes once. A key retired since keeps what its list names. Lengths of time go on from the stamps the snapshot lists, each node's record saying what it saw broken | 2 | sim: `a_remake_from_an_old_base`; unit: `a_retirement_lists_what_it_keeps` |
-| 111 | Commits a second remake of an epoch beside another, its ID ground lower; or many | Every node goes to the one with the lower ID that it builds, bringing along what it holds, envelopes of the other among them: nothing is lost, and no count of nodes decides. Each costs every node a snapshot, lowest ID first, until one comes out | 2; not promised (how often) | sim: `two_remakes_go_to_the_lower` |
-| 112 | A thief's statements are in the base of a remake | They are as they were: the snapshot holds them with their signatures, and a cut set after takes them back as it would have. A remake makes nothing final | 3 | unit: `a_cut_reaches_across_a_remake` |
-| 113 | Releases a user's claim with a stolen key, and an accomplice claims; the user cuts the key off two months later | What was seen given up for `final` has stopped counting for good: the release stands, as the accomplice's claim does, final by then. A remake or none changes nothing of it | not promised (protection from a stolen key) | unit: `stopped_counting_for_good` |
-| 114 | 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` |
-| 115 | A node back after several remakes offers what its user signed epochs ago | Taken, from however many remakes back, unless its user's floor for its kind refuses it: then quarantined, for the user to sign again | 3 | unit: `brought_along_any_number_of_remakes` |
-| 116 | A version builds another snapshot from a remake's base | Its node gets another ID than the remake was committed for, stays, and says so: two IDs for one base show | 2 | sim: `a_remake_by_its_result` |
-| 117 | A decision on the roots names its proposer the only root, or leaves a root out; the root left out signs on as one, and its node witnesses on | The voters see whom a proposal names before they vote for it. A root is one where the decision naming it holds, read where each thing it did was done: what it signs after it is left out is an ordinary user's, its node's changes after witness as no root's, and it is out unless someone vouches for it | 7 | unit: `roots_by_a_decision`, `a_root_where_it_is_one` |
-| 118 | With the keys of two thirds of voters since replaced, stolen later, makes up a decision of then; or a list of voters of its own, with the number of the one that replaced them and a lower digest | What voters that others replaced decide counts only in sight of the proposal that replaced them: the first decides nothing. The second holds only until the list it would replace is final: no decision of its matter proposed out of sight of a final one holds | 7; not promised before final | unit: `the_voters_before`, `a_final_decision` |
-| 119 | Two thirds of the voters turn on the rest | They 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 branch | 3 | unit: `signed_for_its_user_id_and_branch` |
-| 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` |
+| 110 | Commits a remake from a base a month old | Every node goes there, and its switch record names what it holds beyond the base and what it held of it (who saw what first, decisions since); each envelope comes once. A key retired since keeps what its list names. Lengths of time go on from the stamps the snapshot lists, each node's record saying what it saw broken and what began after the base | 2 | sim: `a_remake_from_an_old_base`; unit: `a_retirement_lists_what_it_keeps` |
+| 111 | Has a remake committed from a base before a claim became final, a user gone, a decision final, a thing dropped | Each voter's node's switch record names the lengths that began for it after the base, from the stamp they began at: final, gone, dropped and stopped counting for good stay so | 5 | unit: `lengths_begun_after_the_base` |
+| 112 | Hands a root's node a claim at the switch, so that it writes before it holds the envelopes its switch record names, with the snapshot's rival standing and the claim not there | Every change a node commits after its switch record reads what the record names as in its history: the claim it named was there, and what it held standing with no rival stays so | 5 | unit: `after_a_switch_record` |
+| 113 | A decision is decided after a remake's base, and the nodes that took it up are gone before they could take it up again | Their switch records hold their records, judged against the votes brought along: the decision comes along as it was | 7 | unit: `records_in_switch_records` |
+| 114 | Commits a second remake of an epoch beside another, its ID ground lower; or many | Every node goes to the one with the lower ID that it builds, bringing along what it holds, envelopes of the other among them: nothing is lost, and no count of nodes decides. Each costs every node a snapshot, lowest ID first, until one comes out | 2; not promised (how often) | sim: `two_remakes_go_to_the_lower` |
+| 115 | A thief's statements are in the base of a remake | They are as they were: the snapshot holds them with their signatures, and a cut set after takes them back as it would have. A remake makes nothing final | 3 | unit: `a_cut_reaches_across_a_remake` |
+| 116 | Releases a user's claim with a stolen key, and an accomplice claims; the user cuts the key off two months later | What was seen given up for `final` has stopped counting for good: the release stands, as the accomplice's claim does, final by then. A remake or none changes nothing of it | not promised (protection from a stolen key) | unit: `stopped_counting_for_good` |
+| 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 | Taken, from however many remakes back, unless its user's floor for its kind refuses it: then quarantined, for the user to sign again | 3 | unit: `brought_along_any_number_of_remakes` |
+| 119 | A version builds another snapshot from a remake's base | Its node gets another ID than the remake was committed for, stays, and says so: two IDs for one base show | 2 | sim: `a_remake_by_its_result` |
+| 120 | A decision on the roots names its proposer the only root, or leaves a root out; the root left out signs on as one, and its node witnesses on | The voters see whom a proposal names before they vote for it. A root is one where the decision naming it holds, read where each thing it did was done: what it signs after it is left out is an ordinary user's, its node's changes after witness as no root's, and it is out unless someone vouches for it | 7 | unit: `roots_by_a_decision`, `a_root_where_it_is_one` |
+| 121 | With the keys of two thirds of voters since replaced, stolen later, makes up a decision of then; or a list of voters of its own, with the number of the one that replaced them and a lower digest | What voters that others replaced decide counts only in sight of the proposal that replaced them: the first decides nothing. The second holds only until the list it would replace is final: no decision of its matter proposed out of sight of a final one holds | 7; not promised before final | unit: `the_voters_before`, `a_final_decision` |
+| 122 | Two thirds of the voters turn on the rest | They 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) |
+| 123 | Offers a statement signed on the other side of a fork | Refuse: it names its branch | 3 | unit: `signed_for_its_user_id_and_branch` |
+| 124 | 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` |
+| 125 | 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` |
+| 126 | 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` |
+| 127 | 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 writer | 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 (changes, bytes and operations an hour): 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, brought along across 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, against its party's budget, which counts operations: the party's next changes wait until it is paid | 6; not promised (a bound on what an epoch's document costs) | argued; sim: `a_party_past_its_budget_waits` |
-| 141 | Claims and releases a name a minute, by many users, to have every root's node write for each | A root's node writes once a `witness` at most, for all claims that reached it meanwhile, and takes the party's claims at its budget's pace | 6 | unit: `a_root_witnesses_once_a_witness` |
-| 142 | 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` |
-| 143 | 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` |
+| 128 | Sends different changes to different peers, each under its own number | Take all: changes made at once | 2 | sim: `two_histories_merge` |
+| 129 | Forks its node's writer | 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` |
+| 130 | 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` |
+| 131 | 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` |
+| 132 | 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` |
+| 133 | 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` |
+| 134 | 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` |
+| 135 | 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) |
+| 136 | 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` |
+| 137 | 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 (changes, bytes and operations an hour): put off, never refused; a share of the waiting each | 6 | sim: `a_party_past_its_budget_waits` |
+| 138 | 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` |
+| 139 | 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` |
+| 140 | 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, brought along across a remake; the digest decides only where the entry names none | 6 | unit: `writers_count_for_the_user_an_entry_names` |
+| 141 | 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` |
+| 142 | 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` |
+| 143 | Sends a change of a few bytes that holds a million operations | Taken, at the cost of applying it, against its party's budget, which counts operations: the party's next changes wait until it is paid | 6; not promised (a bound on what an epoch's document costs) | argued; sim: `a_party_past_its_budget_waits` |
+| 144 | Claims and releases a name a minute, by many users, to have every root's node write for each | A root's node writes once a `witness` at most, for all claims that reached it meanwhile, and takes the party's claims at its budget's pace | 6 | unit: `a_root_witnesses_once_a_witness` |
+| 145 | 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` |
+| 146 | 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 |
|---|---|---|---|---|
-| 144 | 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` |
-| 145 | 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` |
-| 146 | 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` |
-| 147 | 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` |
-| 148 | None: a swarm that isn't federated | Everything as today | Optional | the existing tests, untouched; `bench_screening` |
+| 147 | 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` |
+| 148 | 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` |
+| 149 | 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` |
+| 150 | 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` |
+| 151 | None: a swarm that isn't federated | Everything as today | Optional | the existing tests, untouched; `bench_screening` |
## The registry on it
```
@@ -2564,7 +2575,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 (148).
+their vectors. At every stage the existing tests pass untouched (151).
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
@@ -2572,7 +2583,7 @@ their vectors. At every stage the existing tests pass untouched (148).
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, 143, 146, 148, and the policy's existing tests
+ policy. Tests: 132 to 135, 142, 146, 149, 151, 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`);
@@ -2594,12 +2605,12 @@ their vectors. At every stage the existing tests pass untouched (148).
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: 8, 10, 11, 14, 15, 17, 18, 38, 40, 41, 45 to 48, 51, 54, 55, 125,
- 127, 128.
+ unsettled. Tests: 8, 10, 11, 14, 15, 17, 18, 38, 40, 41, 45 to 48, 51, 54, 55, 128,
+ 130, 131.
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, what stopped counting for good, the client listing what stopped
- counting. Tests: 16, 22, 49, 50, 53, 56 to 60, 67, 68, 113.
+ counting. Tests: 16, 22, 49, 50, 53, 56 to 60, 67, 68, 116.
7. **Unvouching.** `unvouch`, a vouch or a creation cut off as by an unvouch, a user
giving itself up, one that another vouched for staying, those brought in going with
it, the names of a user that is out waiting, gone, nothing taken from an unvouched
@@ -2608,7 +2619,7 @@ their vectors. At every stage the existing tests pass untouched (148).
8. **Coming back.** The drop an operator asks for, a forked writer 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 to 142.
+ writer over a clean stop. Tests: 129, 136 to 141, 143 to 145.
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.
@@ -2622,10 +2633,10 @@ their vectors. At every stage the existing tests pass untouched (148).
contested name is, a name the rules leave to the voters; a decision of the voters
before counted only in sight of the list that replaced them; a final decision. The
simulations start from a root change naming several voters. Tests: 25, 65, 69 to
- 88, 117, 118, 147.
+ 88, 120, 121, 150.
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: 144, 145.
+ handshake that says which epochs its node keeps. Tests: 147, 148.
12. **Remakes.** Compaction only; a node proposing and acking by `remakeChanges` and
`remakeWriters`, and following such a remake only, by its result; the snapshot
every node builds, with whatever can still count and how far each length of time
@@ -2636,13 +2647,13 @@ their vectors. At every stage the existing tests pass untouched (148).
two remakes of an epoch, to the lower ID. 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: 91 to 98, 107
- to 112, 114 to 116.
+ to 115, 117 to 119.
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: 32, 52, 89, 90, 146.
+ a time, moved at a remake. Tests: 32, 52, 89, 90, 149.
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, the
- epoch without the decision, what a node takes along. Tests: 119 to 124. From here
+ epoch without the decision, what a node takes along. Tests: 122 to 127. From here
it can be relied on: the rules change by decisions.
## What was checked, and what is assumed
@@ -2753,8 +2764,8 @@ Assumed, to be shown as it is built:
what it held of it) before it takes anything from a peer, at a registry's size.
* What was seen for long is kept as the node goes, per voter's node and per thing
watched (a user out, a claim holding its name, a decision holding, a thing
- uncovered), costs little, and is built again from the changes and the snapshot at
- a start; the snapshot holds it at a registry's size.
+ uncovered, a thing not counting), costs little, and is built again from the changes
+ and the snapshot at a start; the snapshot holds it at a registry's size.
* The digest of the registry as it resolves is cheap enough to make with every stamp
at a registry's size, and to make at another node's stamp now and then.
* A version can speak the wire version before its own.