From ea51966a949831b0809544d38bcefe9d540b9e93 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 13 Nov 2026 01:57:42 +0000 Subject: federation: what a cut brings back, what `prev` names The questions the design left: * A cut that takes back an unvouch brings its user in again. Its claims from before stood all along; what it signed while out comes to count later than it was signed, and gives way to what was claimed in sight of it. Gone stays gone. * A creation taken back by a cut is taken back as a vouch and as the claim of the user's name, not as the user: a vouch names a user by its ID, so with another vouch the user stays in, keys and claims, without a name. * `prev` names the value that shows where the envelope is signed; where several count there, any one of them, and the write replaces them all. * A carry record needs telling from no other change: it witnesses by what it names. A remake's proposal isn't carried over. --- docs/federation.md | 246 ++++++++++++++++++++++++++++------------------------- 1 file changed, 132 insertions(+), 114 deletions(-) diff --git a/docs/federation.md b/docs/federation.md index b1cadad..e4ab26d 100644 --- a/docs/federation.md +++ b/docs/federation.md @@ -257,7 +257,7 @@ grows. A statement is signed by one user and says one thing: | Statement | Signed by | Says | |---|---|---| | `create` | another user (the creator) | the name, its first keys | -| `vouch` | another user | "I vouch for this user too" (no keys) | +| `vouch` | another user | "I vouch for this user too", naming it by its ID (no keys) | | `unvouch` | the signer of a `create` or `vouch`; a root, for what is the seats' | that one taken back (Unvouching) | | `key` | the user | one more key | | `retire` | the user | a key, and the cut after which what it signed doesn't count | @@ -494,8 +494,11 @@ voters' cut too, where the first key was stolen. A user's namespace is the top-level key with its name. One rule: below ``, only envelopes signed by a user of that name, at the depths `userSigned` lists (for the registry, `["*", "hosts", "*"]`: a host is one signed value). A value there is -replaced as today, by an envelope naming the one it replaces (`prev`). Nothing plain -is written anywhere but a node's own member entry and its own records of proposals. +replaced as today, by an envelope naming the one it replaces (`prev`): the value that +shows there where it is signed. Where several count there (written at once), it names +any one of them, and replaces them all, as a write in the document does. Nothing plain +is written anywhere but a node's own member entry, its own records of proposals and +its carry record. Delegating (another user writing below `/shared`, say) would be a statement in the user's register granting a capability within its namespace: for later; the rule @@ -703,7 +706,17 @@ it is doesn't depend on who asks or when: a change's history is fixed by its has retired key signed. * **What a cut takes back.** Everything the key signed outside it: a claim, a vouch, a release, and also what that key cut off itself. The keys it retired and the nodes - it stopped count again, and a user it unvouched is in again. + it stopped count again, and a user it unvouched is in again. That user's claims + from before stood all along, its names waiting; what it signed while it was out + comes to count later than it was signed, so a claim of it gives way to what was + claimed in sight of it meanwhile. What became gone, and what a decision dealt + with, stays so. +* **A creation taken back.** A `create` outside a cut is taken back as the vouch it is + and as the claim of the user's name; not as the user. Its ID and first keys are + what the creation names, and a vouch names a user by its ID: with another vouch + standing, the user stays in, with its keys, its claims and the users it brought + in, and without a name, as a user that lost its name. Its namespace doesn't count + until it has one: it comes to one by being created anew. What stops counting stays in the document, and every node holds the same. It is left out when resolving. In a namespace, where a value that doesn't count replaced one @@ -957,18 +970,19 @@ which every node works out itself. the one before, the root change lists the digests of all the statements the base held, and of the values deleted there, and an envelope among them is refused. The 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/`: 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. A node that came - to carry after the base commits, with its record, the `node` statement that named - it (rule 2). +* **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/`: + 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 @@ -998,12 +1012,13 @@ which every node works out itself. signed within the cut since the root change counts on, and nothing else of that key that the snapshot doesn't hold. * **Decisions after the base** aren't in the snapshot. Their proposals and votes are - carried over, 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. Where the remake changed the voters so that its votes are - too few, it is proposed again. + carried over, 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. Where the remake changed the voters so that its votes are too few, it is + proposed again. A remake's own proposal and votes aren't carried over: they are of + 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 @@ -1242,9 +1257,9 @@ A change is valid if, in the document at its dependencies: the signer isn't past the kind's limit there, and no claim of that name stands there. One that doesn't count there doesn't stand there. 7. In a namespace: at a listed depth, an envelope by a user of that name, replacing - what is there (`prev`); nothing within one, nothing replacing what holds one. At - a place the policy no longer covers: only its user's envelope that puts nothing - there. + what is there (`prev` naming one of the values that count there, where several do); + nothing within one, nothing replacing what holds one. At a place the policy no + longer covers: only its user's envelope that puts nothing there. 8. `propose`, `vote`: by a voter, with a key the document has for it (a fork: proposed by any user that isn't gone there); a proposal not past its user's limit there (a fork: the only one of its user that is open); a vote where the user has none on @@ -1291,14 +1306,15 @@ the steps before: `unvouch` of that one leaves; what is the seats' is taken back once every root unvouched it. A statement counts if its user counts at it (a proposal and a vote: always, for a voter); its key was the user's (added by statements that count, up to - its creation, or given by a decision); it is within every cut set for that key (by - a `retire` that counts, or a decision); a node carrying for the user committed it - (any node, for what any node commits), within that node's cut if it has one; and it - isn't past its limit (Users), by the limit that holds. A `retire`, a stop and an - `unvouch` are never outside a cut they set themselves, nor left out with their - carrier. A user is **out** where no `create` or `vouch` for it counts any more, or - where it gave itself up. It is **gone** once seen out for `gone`, or where a - decision freed its name; and gone it stays, whatever is vouched or cut off after. + its creation, which gives its first keys whether or not it counts as a vouch, or + given by a decision); it is within every cut set for that key (by a `retire` that + counts, or a decision); a node carrying for the user committed it (any node, for + what any node commits), within that node's cut if it has one; and it isn't past its + limit (Users), by the limit that holds. A `retire`, a stop and an `unvouch` are + never outside a cut they set themselves, nor left out with their carrier. A user is + **out** where no `create` or `vouch` for it counts any more, or where it gave + itself up. It is **gone** once seen out for `gone`, or where a decision freed its + name; and gone it stays, whatever is vouched or cut off after. 3. **Users' names.** A creation stands while it counts, isn't released, its user isn't gone, and a rule of the kind `user` lets its signer. Of the creations of a name that stand: the one that remains (Two claims) has the name, or has it wait while @@ -1955,90 +1971,92 @@ Keys: | 52 | With a stolen device key, retires that key from long ago, to undo what its user signed | Refuse: a key retires itself from where it stands | 3 | unit: `a_key_retires_itself_forward` | | 53 | A key retires itself; a retirement is carried by a node that only the retired key named; a node commits its own stop | Each counts: a cut never leaves out its own statement, nor the node that carried it | 2 | unit: `a_cut_never_reaches_itself` | | 54 | With a stolen key, retires the keys below it, stops nodes, unvouches, releases names | A key above cuts it off from before: all of it is taken back, but what became final on it | 3 | unit: `a_cut_takes_back_what_the_key_cut` | -| 55 | With a device key, releases the user itself; with a stolen first key, does so before the voters can cut that key off | Refuse the first: it takes a first key. The second puts the user out, its names waiting, and a cut takes it back within `gone` | 3 | unit: `giving_up_takes_a_first_key`, `given_up_is_out_first` | -| 56 | Steals a user's first key | The name is the thief's too, until a decision gives the user first keys anew, with a cut for the stolen one | 7 | unit: `first_keys_by_a_decision` | -| 57 | Cuts its own key off early to take back a vouch or a release | It is taken back, but for what is final; a user with a second vouch stays | not promised | unit: `a_second_vouch_stands` | -| 58 | A key is retired on one side of a partition while it signs on the other | After healing, every node leaves out the same | 2 | sim: `a_cut_across_a_partition` | -| 59 | Steals a node's key: commits changes as a witness | They count until the node is stopped with a cut, then not | 5 | unit: `a_stopped_node_witnesses_nothing` | +| 55 | Is unvouched with a key that is then cut off from before, and claimed names while out | In again, its earlier claims having stood all along; what it claimed while out gives way to what was claimed in sight of it meanwhile. Gone stays gone | 5 | unit: `an_unvouch_cut_off` | +| 56 | Creates a user with a stolen key, under a name kept for its victim's creations, and has an accomplice vouch for it | Once the key is cut off, the creation no longer claims the name: the user stays in by the vouch, with its keys and claims, and without a name or a namespace | 3, 4 | unit: `a_creation_cut_off` | +| 57 | With a device key, releases the user itself; with a stolen first key, does so before the voters can cut that key off | Refuse the first: it takes a first key. The second puts the user out, its names waiting, and a cut takes it back within `gone` | 3 | unit: `giving_up_takes_a_first_key`, `given_up_is_out_first` | +| 58 | Steals a user's first key | The name is the thief's too, until a decision gives the user first keys anew, with a cut for the stolen one | 7 | unit: `first_keys_by_a_decision` | +| 59 | Cuts its own key off early to take back a vouch or a release | It is taken back, but for what is final; a user with a second vouch stays | not promised | unit: `a_second_vouch_stands` | +| 60 | A key is retired on one side of a partition while it signs on the other | After healing, every node leaves out the same | 2 | sim: `a_cut_across_a_partition` | +| 61 | Steals a node's key: commits changes as a witness | They count until the node is stopped with a cut, then not | 5 | unit: `a_stopped_node_witnesses_nothing` | Decisions and remakes: | # | The adversary | Honest nodes | Promise | Shown by | |---|---|---|---|---| -| 60 | Forges a vote; votes as a user that isn't a voter, or one that is gone | Refuse | 7 | unit, decisions: `a_vote_is_a_voters` | -| 61 | Brings in many users to vote, also while a remake's votes run | They vote only if a remake's list names them, which those who vote saw | 7 | unit: `who_votes` | -| 62 | A remake's list of voters with the many users one user brought in; users put out between the votes and the base, to shrink the list | The voters see the list, by IDs, before they vote for it, and propose one of their own instead. Nothing after the proposal changes it | 7 | unit: `voters_are_the_remakes`, `a_list_is_fixed_when_signed` | -| 63 | Records taking a proposal up without the votes, or with released ones | Refuse: every node judges a record against the votes in its history | 7 | unit: `a_record_needs_the_votes` | -| 64 | Carries for many voters that have no node, and records with votes that ran out | Taken: nobody but the recording node reads a vote's end. A voter without a node is the party that carries for it, for a record; what is seen for long counts that node once | not promised | unit: `a_record_counts_for_its_voters`; argued (Decisions) | -| 65 | Carries for a third of the voters, and keeps its records back: every decision waits, and comes on its day | The voters name another node, which records for them; their votes count meanwhile. A voter carried by nodes of two parties never waits for one. How many each node carries for shows | not promised | sim: `a_carrier_keeps_back` | -| 66 | Keeps votes back until they ran out, or crafts them to look old, then shows them | No honest node takes the proposal up, and fewer than a third decide nothing | 7 | unit: `taken_up_while_the_votes_run`; sim: `a_decision_from_the_past` | -| 67 | Keeps its node's record back, and shows it weeks later: a proposal decided late | It holds only where none of its matter with a higher number was decided since: a node takes up nothing lower than it took up. What hangs shows, and the voters end it with a later proposal | not promised | unit: `nothing_lower_is_taken_up`; sim: `decided_late` | -| 68 | Two proposals of one matter both decided: voters changed their minds, or a third voted both ways | Every node acts on the one with the higher number, the same from the same changes; the other shows as replaced | 7 | unit: `the_last_holds`; sim: `two_decided_one_holds` | -| 69 | Makes a proposal saying it saw little or much, for a number of its choosing; grinds its digest; commits another's a second time | A number brings nothing without the votes of two thirds and their nodes' records; who votes is the epoch's, wherever a proposal is made; a second carrier changes nothing | 7 | unit: `a_proposal_is_where_it_was_signed` | -| 70 | Stays away to hold decisions up | It counts on. A third staying away do hold them up: the rest go apart, naming who votes | 7 | unit: `two_thirds_of_all` | -| 71 | Asks the voters for another user's first keys, saying it is that user | It takes two thirds of them, and the days a vote takes, shown to all; the user signs on meanwhile | not promised | argued (Decisions) | -| 72 | Puts a voter's vote into a change of its own node; keeps one back; offers one again | Taken: the signature is the voter's. It counts while it runs; the register holds it once | 7 | unit: `a_vote_by_any_node` | -| 73 | Signs a vote that says it runs out in ten years | A node counts no vote for longer than `window` from when it first held it | 7 | unit: `a_vote_runs_a_window` | -| 74 | A decision lowers a limit; a user signs on saying it saw nothing of the decision. Or a decision lowers a limit for a day, and raises it again. Or it sets a number that makes no sense | Valid as written, and resolved by the limit that holds: what is past it doesn't count. Names claimed in sight of what fell past it are their claimants' for good. The number has the result it has | 6; not promised | unit: `a_lowered_limit_leaves_out_the_last` | -| 75 | Opens proposals without end | Refuse past `limits.proposals` | 6 | unit: `limits_on_proposals` | -| 76 | A proposal gives away the name of a user that is out; the user is gone and another claims the name before it is decided | The claim was made in sight of one that didn't stand: it doesn't give way to what the decision gives | 5 | unit: `given_too_late` | -| 77 | Contests a name, then asks the voters for it | It takes two thirds of them; the claim they name is final | not promised | unit: `whose_a_contested_name_is` | -| 78 | Claims `wiki.r`, which the rules leave to the voters; holds on to it against a later decision | Refuse the claim. The name is whose the decision that holds says | 4, 7 | unit: `a_name_by_the_voters` | -| 79 | A user is out and stays out: what of its names? | A decision frees them, or gives them to another, whatever `gone` says | 7 | unit: `a_decision_frees_or_gives` | -| 80 | The voters decide a policy that covers a user's names no more; another user writes over what is uncovered; a third of the voters stamp to drop it at once | It doesn't count where the policy holds, and shows aside. Only its user takes it away, nobody changes it; it is dropped once seen there for `uncovered` | not promised | unit: `what_a_policy_no_longer_covers`, `uncovered_is_only_taken_away` | -| 81 | The voters decide a policy that stops keeping names for their users | A kept name its user claimed stays its claim. One it didn't is the first comer's | not promised | unit: `a_kept_name_claimed` | -| 82 | Names a base for a remake that leaves out what the swarm holds | No honest voter's node takes it up | 7 | sim: `a_stale_base_is_not_taken_up` | -| 83 | A remake's coordinator names two bases, or none; a voter's nodes record two IDs | A node records one base for its epoch, and such a voter counts for neither: one is decided, or none, and then those left go apart | 7 | sim: `two_bases_no_remake` | -| 84 | Runs most of the nodes; serves a snapshot of its own | Nothing reads a count of nodes; every node builds the snapshot itself | 7 | sim: `every_node_builds_the_snapshot` | -| 85 | A name is claimed and settled after a remake's base; after the switch a pretender signs a claim of it "in the epoch before" | A root's node named the real claim in its carry record, before it took anything in the new epoch: the pretender's claim is late against it | 5 | unit: `a_carry_record_witnesses`; sim: `a_pretender_after_a_remake` | -| 86 | Hands in, weeks into an epoch, envelopes of the epoch before that no node carried: a value its user since replaced, a statement its user never sent | Refuse what no carry record names. A node that holds such an envelope can still name it in its own record: then a value carried over has no word against one its user signed in the new epoch, and a claim is late against what a root's node's record named | 3 | unit: `only_what_a_carry_record_names`, `the_new_epoch_has_the_last_word` | -| 87 | Signs after the switch, as of the epoch before, statements and a proposal with numbers of its choosing | Carried over comes after what the snapshot holds and before what the new epoch signs: such a number orders only its signer's statements among what is carried over, and the proposal outranks none of the new epoch | 6, 7 | unit: `carried_over_in_between` | -| 88 | Writes a carry record naming what it likes, or several, or one of its own after taking from peers | One a node and epoch. What it names is its node's word, as a change of that node would have been: a contest where it is a root's or the claimant's, no more | 5 | unit: `one_carry_record_a_node` | -| 89 | A node that held only the older of two values its user wrote since the base carries it beside the newer one | Of several carried over to one place, one that another replaces is left out | 3 | unit: `a_replaced_value_is_left_out` | -| 90 | Signs a claim "in the epoch before" of a name the snapshot holds | It gives way to what the snapshot holds | 5 | unit: `the_snapshot_comes_first` | -| 91 | Hands in again what a remake left out: a stolen laptop's `node` and `key` statements, retired since | Refuse: the root change lists the digests of the statements the base held | 3 | unit: `what_a_remake_dropped_stays_out` | -| 92 | Keeps the last record of a remake back, and shows it a month later | Every node goes to that base. Its carry record names what it holds and what it held of it (who saw what first, decisions since), and each envelope comes once. A key rotated since keeps what its retirement lists. What a third of the voters' nodes held as gone, final or dropped stays so; other lengths start anew | not promised | sim: `a_remake_decided_late`; unit: `a_retirement_lists_what_it_keeps` | -| 93 | Has a second remake of an epoch taken up beside one that hangs, and decides it after the swarm switched to the first | A node records one base for its epoch, and takes a later proposal up only for that base, those voters and roots: a second is decided only where the nodes of a third of the voters recorded both. No node that switched moves again by itself | 7 | sim: `one_base_an_epoch` | -| 94 | 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` | -| 95 | 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` | -| 96 | 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` | -| 97 | 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` | -| 98 | 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` | -| 99 | 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) | -| 100 | 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` | -| 101 | 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` | -| 102 | 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` | -| 103 | 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` | -| 104 | 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` | +| 62 | Forges a vote; votes as a user that isn't a voter, or one that is gone | Refuse | 7 | unit, decisions: `a_vote_is_a_voters` | +| 63 | Brings in many users to vote, also while a remake's votes run | They vote only if a remake's list names them, which those who vote saw | 7 | unit: `who_votes` | +| 64 | A remake's list of voters with the many users one user brought in; users put out between the votes and the base, to shrink the list | The voters see the list, by IDs, before they vote for it, and propose one of their own instead. Nothing after the proposal changes it | 7 | unit: `voters_are_the_remakes`, `a_list_is_fixed_when_signed` | +| 65 | Records taking a proposal up without the votes, or with released ones | Refuse: every node judges a record against the votes in its history | 7 | unit: `a_record_needs_the_votes` | +| 66 | Carries for many voters that have no node, and records with votes that ran out | Taken: nobody but the recording node reads a vote's end. A voter without a node is the party that carries for it, for a record; what is seen for long counts that node once | not promised | unit: `a_record_counts_for_its_voters`; argued (Decisions) | +| 67 | Carries for a third of the voters, and keeps its records back: every decision waits, and comes on its day | The voters name another node, which records for them; their votes count meanwhile. A voter carried by nodes of two parties never waits for one. How many each node carries for shows | not promised | sim: `a_carrier_keeps_back` | +| 68 | Keeps votes back until they ran out, or crafts them to look old, then shows them | No honest node takes the proposal up, and fewer than a third decide nothing | 7 | unit: `taken_up_while_the_votes_run`; sim: `a_decision_from_the_past` | +| 69 | Keeps its node's record back, and shows it weeks later: a proposal decided late | It holds only where none of its matter with a higher number was decided since: a node takes up nothing lower than it took up. What hangs shows, and the voters end it with a later proposal | not promised | unit: `nothing_lower_is_taken_up`; sim: `decided_late` | +| 70 | Two proposals of one matter both decided: voters changed their minds, or a third voted both ways | Every node acts on the one with the higher number, the same from the same changes; the other shows as replaced | 7 | unit: `the_last_holds`; sim: `two_decided_one_holds` | +| 71 | Makes a proposal saying it saw little or much, for a number of its choosing; grinds its digest; commits another's a second time | A number brings nothing without the votes of two thirds and their nodes' records; who votes is the epoch's, wherever a proposal is made; a second carrier changes nothing | 7 | unit: `a_proposal_is_where_it_was_signed` | +| 72 | Stays away to hold decisions up | It counts on. A third staying away do hold them up: the rest go apart, naming who votes | 7 | unit: `two_thirds_of_all` | +| 73 | Asks the voters for another user's first keys, saying it is that user | It takes two thirds of them, and the days a vote takes, shown to all; the user signs on meanwhile | not promised | argued (Decisions) | +| 74 | Puts a voter's vote into a change of its own node; keeps one back; offers one again | Taken: the signature is the voter's. It counts while it runs; the register holds it once | 7 | unit: `a_vote_by_any_node` | +| 75 | Signs a vote that says it runs out in ten years | A node counts no vote for longer than `window` from when it first held it | 7 | unit: `a_vote_runs_a_window` | +| 76 | A decision lowers a limit; a user signs on saying it saw nothing of the decision. Or a decision lowers a limit for a day, and raises it again. Or it sets a number that makes no sense | Valid as written, and resolved by the limit that holds: what is past it doesn't count. Names claimed in sight of what fell past it are their claimants' for good. The number has the result it has | 6; not promised | unit: `a_lowered_limit_leaves_out_the_last` | +| 77 | Opens proposals without end | Refuse past `limits.proposals` | 6 | unit: `limits_on_proposals` | +| 78 | A proposal gives away the name of a user that is out; the user is gone and another claims the name before it is decided | The claim was made in sight of one that didn't stand: it doesn't give way to what the decision gives | 5 | unit: `given_too_late` | +| 79 | Contests a name, then asks the voters for it | It takes two thirds of them; the claim they name is final | not promised | unit: `whose_a_contested_name_is` | +| 80 | Claims `wiki.r`, which the rules leave to the voters; holds on to it against a later decision | Refuse the claim. The name is whose the decision that holds says | 4, 7 | unit: `a_name_by_the_voters` | +| 81 | A user is out and stays out: what of its names? | A decision frees them, or gives them to another, whatever `gone` says | 7 | unit: `a_decision_frees_or_gives` | +| 82 | The voters decide a policy that covers a user's names no more; another user writes over what is uncovered; a third of the voters stamp to drop it at once | It doesn't count where the policy holds, and shows aside. Only its user takes it away, nobody changes it; it is dropped once seen there for `uncovered` | not promised | unit: `what_a_policy_no_longer_covers`, `uncovered_is_only_taken_away` | +| 83 | The voters decide a policy that stops keeping names for their users | A kept name its user claimed stays its claim. One it didn't is the first comer's | not promised | unit: `a_kept_name_claimed` | +| 84 | Names a base for a remake that leaves out what the swarm holds | No honest voter's node takes it up | 7 | sim: `a_stale_base_is_not_taken_up` | +| 85 | A remake's coordinator names two bases, or none; a voter's nodes record two IDs | A node records one base for its epoch, and such a voter counts for neither: one is decided, or none, and then those left go apart | 7 | sim: `two_bases_no_remake` | +| 86 | Runs most of the nodes; serves a snapshot of its own | Nothing reads a count of nodes; every node builds the snapshot itself | 7 | sim: `every_node_builds_the_snapshot` | +| 87 | A name is claimed and settled after a remake's base; after the switch a pretender signs a claim of it "in the epoch before" | A root's node named the real claim in its carry record, before it took anything in the new epoch: the pretender's claim is late against it | 5 | unit: `a_carry_record_witnesses`; sim: `a_pretender_after_a_remake` | +| 88 | Hands in, weeks into an epoch, envelopes of the epoch before that no node carried: a value its user since replaced, a statement its user never sent | Refuse what no carry record names. A node that holds such an envelope can still name it in its own record: then a value carried over has no word against one its user signed in the new epoch, and a claim is late against what a root's node's record named | 3 | unit: `only_what_a_carry_record_names`, `the_new_epoch_has_the_last_word` | +| 89 | Signs after the switch, as of the epoch before, statements and a proposal with numbers of its choosing | Carried over comes after what the snapshot holds and before what the new epoch signs: such a number orders only its signer's statements among what is carried over, and the proposal outranks none of the new epoch | 6, 7 | unit: `carried_over_in_between` | +| 90 | Writes a carry record naming what it likes, or several, or one of its own after taking from peers | One a node and epoch. What it names is its node's word, as a change of that node would have been: a contest where it is a root's or the claimant's, no more | 5 | unit: `one_carry_record_a_node` | +| 91 | A node that held only the older of two values its user wrote since the base carries it beside the newer one | Of several carried over to one place, one that another replaces is left out | 3 | unit: `a_replaced_value_is_left_out` | +| 92 | Signs a claim "in the epoch before" of a name the snapshot holds | It gives way to what the snapshot holds | 5 | unit: `the_snapshot_comes_first` | +| 93 | Hands in again what a remake left out: a stolen laptop's `node` and `key` statements, retired since | Refuse: the root change lists the digests of the statements the base held | 3 | unit: `what_a_remake_dropped_stays_out` | +| 94 | Keeps the last record of a remake back, and shows it a month later | Every node goes to that base. Its carry record names what it holds and what it held of it (who saw what first, decisions since), and each envelope comes once. A key rotated since keeps what its retirement lists. What a third of the voters' nodes held as gone, final or dropped stays so; other lengths start anew | not promised | sim: `a_remake_decided_late`; unit: `a_retirement_lists_what_it_keeps` | +| 95 | Has a second remake of an epoch taken up beside one that hangs, and decides it after the swarm switched to the first | A node records one base for its epoch, and takes a later proposal up only for that base, those voters and roots: a second is decided only where the nodes of a third of the voters recorded both. No node that switched moves again by itself | 7 | sim: `one_base_an_epoch` | +| 96 | 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` | +| 97 | 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` | +| 98 | 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` | +| 99 | 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` | +| 100 | 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` | +| 101 | 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) | +| 102 | 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` | +| 103 | 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` | +| 104 | 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` | +| 105 | 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` | +| 106 | 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 | |---|---|---|---|---| -| 105 | Sends different changes to different peers, each under its own number | Take all: changes made at once | 2 | sim: `two_histories_merge` | -| 106 | 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` | -| 107 | 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` | -| 108 | 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` | -| 109 | Hands a joining node another root, or changes from before the policy | Refuse the handshake; there is no before | 1 | sim: `a_joiner_takes_its_root_only` | -| 110 | 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` | -| 111 | 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` | -| 112 | 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) | -| 113 | 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` | -| 114 | Writes its own member entry 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` | -| 115 | Starts a writer with every change: each costs every node memory in proportion to the document's history | Past `limits.writers` a party and epoch, every node puts off the changes that start more, taking none from the party's own nodes. Nothing is refused; what reaches a node within others' histories is held, and a remake leaves it out | 6; not bounded | sim: `writers_past_a_budget_wait` | -| 116 | 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 | argued | -| 117 | 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` | -| 118 | 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 | 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` | +| 107 | Sends different changes to different peers, each under its own number | Take all: changes made at once | 2 | sim: `two_histories_merge` | +| 108 | 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` | +| 109 | 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` | +| 110 | 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` | +| 111 | Hands a joining node another root, or changes from before the policy | Refuse the handshake; there is no before | 1 | sim: `a_joiner_takes_its_root_only` | +| 112 | 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` | +| 113 | 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` | +| 114 | 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) | +| 115 | 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` | +| 116 | Writes its own member entry 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` | +| 117 | Starts a writer with every change: each costs every node memory in proportion to the document's history | Past `limits.writers` a party and epoch, every node puts off the changes that start more, taking none from the party's own nodes. Nothing is refused; what reaches a node within others' histories is held, and a remake leaves it out | 6; not bounded | sim: `writers_past_a_budget_wait` | +| 118 | 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 | argued | +| 119 | 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` | +| 120 | 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 | 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` | Rules, and the swarm as it is: | # | The adversary | Honest nodes | Promise | Shown by | |---|---|---|---|---| -| 119 | 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` | -| 120 | 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` | -| 121 | 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` | -| 122 | 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. A remake is taken up on one side only by a voter's honest nodes, which record one base | 7 | sim: `one_side_decides`; unit: `the_last_holds` | -| 123 | None: a swarm that isn't federated | Everything as today | Optional | the existing tests, untouched; `bench_screening` | +| 121 | 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` | +| 122 | 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` | +| 123 | 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` | +| 124 | 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. A remake is taken up on one side only by a voter's honest nodes, which record one base | 7 | sim: `one_side_decides`; unit: `the_last_holds` | +| 125 | None: a swarm that isn't federated | Everything as today | Optional | the existing tests, untouched; `bench_screening` | ## The registry on it ``` @@ -2095,7 +2113,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 (123). +their vectors. At every stage the existing tests pass untouched (125). 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 @@ -2103,7 +2121,7 @@ their vectors. At every stage the existing tests pass untouched (123). 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: 109 to 112, 121, 123, and the policy's existing tests under a policy + policy. Tests: 111 to 114, 123, 125, and the policy's existing tests under a policy from the root. 2. **Statements.** The users' registers (`create`, `key`, `node`, `vouch`, `release`); the user ID, the epoch and what its signer saw in an envelope; nodes carrying for @@ -2124,18 +2142,18 @@ their vectors. At every stage the existing tests pass untouched (123). 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: 10, 11, 25, 31, 33, 34, 38 to 41, 44, 47, 48, 105, 107, 108. + unsettled. Tests: 10, 11, 25, 31, 33, 34, 38 to 41, 44, 47, 48, 107, 109, 110. 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: 15, 42, 43, 46, 49 to - 53, 55, 57 to 59. + 53, 57, 59 to 61. 7. **Unvouching.** `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 user's nodes, what comes back with a vouch. - Tests: 17, 19 to 24, 26, 27, 54. + Tests: 17, 19 to 24, 26, 27, 54 to 56. 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 it - counts, a node keeping its writer over a clean stop. Tests: 106, 113 to 117. + counts, a node keeping its writer over a clean stop. Tests: 108, 115 to 119. 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. @@ -2147,10 +2165,10 @@ their vectors. At every stage the existing tests pass untouched (123). 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: 18, 56, 60, 63 to 79, 122. + voters, as a remake's does. Tests: 18, 58, 62, 65 to 81, 124. 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: 119, 120. + handshake that says which epochs its node keeps. Tests: 121, 122. 12. **Remakes.** The proposal with its list of voters, its roots and its coordinator; the base, one an epoch, taking a remake up by its result, the snapshot every node builds, what it leaves out and what can't be written again; carrying over: every @@ -2158,14 +2176,14 @@ their vectors. At every stage the existing tests pass untouched (123). word last on values; a retirement's list as its cut; decisions and what was seen 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: 61, 62, 82 to - 98. + by an ID its operator gave, and by none that peers advertise. Tests: 63, 64, 84 to + 100. 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: 80, 81, 121. + a time, moved at a remake. Tests: 82, 83, 123. 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: 99 to 104. From here + epoch without the decision, what a node takes along. Tests: 101 to 106. From here it can be relied on: the rules change by decisions. ## What was checked, and what is assumed -- cgit v1.3.1