aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm
Commit message (Collapse)AuthorAgeFilesLines
* sync: ask for what changes waiting in screening lacktv19 hours1-0/+1
| | | | | | | | | | Screening keeps a change whose dependencies haven't come from Automerge, waiting, so Automerge never learns what it lacks: our next message asks for the peer's heads alone, and the peer, forgetting having sent those, sends them again, and what they build on only as far as it still counts it as sent. So the session asks for what changes waiting build on and the document lacks too (`Waiting::lacking`, `SyncSession::lacks`), as Automerge asks for what the changes it holds back lack.
* bootstrap: a node ready at once tries its seeds until they resolvetv20 hours1-2/+27
| | | | | | | | | A node starting from a document, or as a swarm's genesis node, is ready at once, and says HELLO to its seeds, members of its swarm that may be running. A seed that didn't resolve then (the node, or the seed, not reachable yet) was tried no more, and a node whose document names no member to reach, as one started from a store's root, stayed alone. Now such seeds are tried again in the background, backing off as a joining node does, until they resolve or the node stops.
* peer: a member's message before its handshake was taken asks for onetv20 hours1-5/+33
| | | | | | | | | | In a swarm holding a store, a node reads a peer's messages only by the party its handshake named. One whose handshake it hasn't taken (its reply lost, say) was cut off at its next message, as a non-member is, while the peer, which took ours, synced on, and neither said HELLO again. Now such a message goes unread, and the node says HELLO to the peer, as to any whose reply it waits for (`hello_again_now`): its reply names its party. What a peer refused as a non-member sends next is known to be a non-member's, its party kept, so that it asks for no HELLO. A simulation loses a's replies to b for a while.
* federation: a fork's root made, and checked by a node holding its historytv21 hours1-14/+3
| | | | | | | | | | `federation::fork`: a node holding a federation's history makes the root of a fork at heads it holds by a version, with the events the root keeps, as the file the fork's founders start its swarm from (`make`, `root_file`, which `--store-root` reads); and checks a fork's root it is given (`check`): whether it builds that root at its heads, byte for byte, what it holds that those heads lack, and, party by party, the keys the fork's version gives where they aren't those the party had there. The attack rows 35 and 36 have their tests.
* node: `--store-root` holding a fork's root and the events it keepstv21 hours1-11/+56
| | | | | | | The file `--store-root` names holds the store's root on its first line, and, for a fork, the events the root keeps, each on a line of its own (JCS writes no line break). The node checks that the federation takes them as a store's root with what it keeps, and starts from the changes founding the swarm, built from them.
* document: the changes founding a fork's swarm, built from its root and what ↵tv21 hours1-1/+1
| | | | | | | | | | | it keeps A fork's root keeps events (`docs/store.md`, On Automerge): they follow its genesis change in changes of the same writer, built the same way, filled in the order of their IDs, events going into a change until their bytes there reach 1 MiB, the next event beginning the next change (`events::founding`). A swarm holding a store starts from all of them (`events::started`, given the events the root keeps; none for a federation's root).
* topology: neighbours among the members of a node's own party, and of parties ↵tv24 hours1-0/+35
| | | | | | | | | | named A node of a swarm holding a store keeps some of its neighbours among the members of its own party and of the parties its operator names (`--store-neighbour-parties`), so that a party listing many nodes can't be all of them (`docs/store.md`, Members): its neighbours by the shared graph among those members alone, each as its entry names it, which every node of its party computes alike, with those among all members.
* topology: in a swarm holding a store, neighbours among its memberstv24 hours1-0/+25
| | | | | | | In a swarm holding a store, a node computes its neighbours, and the member list's graph writers' trees are built on, from the members its store names, each with the party its entry names (`docs/store.md`, Members): the other entries name nodes it doesn't sync with. While it holds no store, from every entry, as elsewhere.
* peer: in a swarm holding a store, its members onlytv24 hours3-0/+66
| | | | | | | | | | | | A node of a swarm holding a store syncs with its members only (`docs/store.md`, Members): the nodes its store names, each with the party its handshakes name, as the store reads now. A handshake from any other goes unanswered, and what the node had with it ends, as with a banned node; so does what it had with a member at its next message, once the store names it no more (`swarm::peer::members`). The party a handshake names is kept with the peer. While a node holds no store yet, joining, it can't tell, and takes everyone of its swarm: its seeds, which take it only where its party lists it. A node says whether it is a member itself, as its store reads, when that changes.
* handshake: the party its sender is oftv24 hours1-0/+14
| | | | | | | In a swarm holding a store, a node's handshakes name the party it is of (`docs/store.md`, Members), so that a peer tells whether it is a member before its entry reaches it: HELLO and HELLO_REPLY carry `party`, as `--store-party` says, None elsewhere and without the `federation` feature. Wire format version 52.
* members: a node's entry names its partytv24 hours1-1/+42
| | | | | | | In a swarm holding a store, a node's own entry names the party it is of (`docs/store.md`, Members): `party`, as `--store-party` says, written at registration and kept so when it changes over a restart, as the alias is; `members::party` reads it. Behind the `federation` feature.
* node: a swarm holding a store, started from its root or joined by its IDtv25 hours2-0/+131
| | | | | | | | | | | | | | | | | | | | Behind the `federation` feature, two options: * `--store-root PATH` starts a swarm holding a store, or goes on with one, from the store's root, as bytes in the file, which the federation must take as a root. With no document to start on, the node builds the genesis change from it, as every node given the root does, and is ready at once; a document to start on must be of the root's swarm. * `--store-id ID` joins one through seeds by its ID, the root's SHA-256 in hex. An empty document of the first epoch takes as its root only that store's genesis change, built again from the root it holds (`document::events::is_genesis`), whatever peers name: the root pin doesn't wait for seeds, nor is disputed. Either names the swarm the node joins, which a state file must remember too, and can't be combined with the other, nor with what makes a new swarm's first change (`--genesis`, `--bootstrap-users`, `--bootstrap-keys`, `--bootstrap-policy`, `--remake`, `--genesis-root`). The root is read as a file of its own kind (`store`), counted among the node's files.
* swarm: a new swarm's policy recorded in its genesis changetv2 days1-1/+6
| | | | | | | | | | | | | | | | A swarm strict from its start had its policy written by its first user in a later change. A change is judged by the policy at its history, so any member could always add a change whose history is from before the policy: judged by none, needing no signature, taken whenever it comes. Since signed values are read by `seq`, an envelope planted there with the highest `seq` there is can never be followed: a ban, a user, a declaration, for good. `--bootstrap-policy JSON`, with `--genesis`, records the policy in the genesis change, with the first users: then no change of the swarm is from before it. It must be a policy this node knows, and a strict one needs `--bootstrap-keys`, or nobody could sign what decides who may do what.
* relay: a STATUS's heads wait at least 50 ms before they are pulledtv4 days1-6/+10
| | | | | | | | | | | | | | A neighbour pulls heads a STATUS listed only if it still lacks them after a round trip to the sender, as they are usually on their way along a writer's tree. With no round trip known, or one measured long ago (busy pairs send no keepalives), it pulled at once; with a short one, a STATUS sent right after a change can overtake it by more than that round trip, delays varying per message. Either way the change came twice (`trees_hold_through_continuous_writes`: c pulled once while every write reached it along x's tree). The wait is the round trip, but 50 ms at least (and 1 s at most, as before).
* hyparview: a member with k takes one a neighbour shorttv4 days1-8/+19
| | | | | | | | | | | | | | | A member one neighbour short asks once per `ONE_SHORT_EVERY` (300 s), and a member with `k` refused it. When a member most others had as a neighbour went away, three members ended up each with the other two as neighbours, one short each; each asked once, was refused by a full member, and waited five minutes. Changes pass only between neighbours: the three got none of what was written meanwhile (`active_views_settle_and_heal`, timed out waiting for the same heads). NEIGHBOUR says now whether its sender is one short, and a member with `k` takes such an ask as its `k + 1`th, the most it keeps; one with `k + 1` still refuses. Asks stay as rare as they were, and one is enough but where those asked have `k + 1`. Wire version 50.
* sync: a delta's signatures as a blob of their owntv6 days2-12/+90
| | | | | | | | | | | | | | | | | | | | | | | | A sync message larger than the threshold for its peer (16 chunks, lower on a slow link or after a message to it failed whole) goes as a delta: the peer fetches its changes in chunks, from any node holding them. Its signatures, each writer's latest with changes in it, went in the envelope offering it: up to 65536 of them, 6 MiB, in one message, the size the delta exists to avoid. Nor did an Automerge message count its signatures (one per writer in a whole document pulled) towards the threshold. A delta's signatures are now a blob of their own: the offerer packs and keeps them (Blobs::keep, the latest 64), and the spec names them by BLAKE3 hash and size (DeltaSpec::signatures, None where no signature vouches for its changes). They are served as content (BlobId::Content), so their hash checks them. The receiver fetches them from the offerer alone, as another node holding the changes holds signatures of its own, before the changes, and offers them under the write lock just before judging the changes, so they wait for them as before. The envelope of a delta carries none. An Automerge message's signatures count towards its size: past the threshold, it goes as a delta. Wire version 49.
* screen: write as a fresh actor when another node writes as this onetv6 days1-1/+9
| | | | | | | | | | | | | | | | | | | With --keep-actor, a node on a document file that ends with a clean stop writes on as the actor the file names. Two nodes started on copies of one file (a copied data directory, a restored disk image while the original runs) both do, and both make that actor's next change number: peers holding one refuse the other as forged, and everything built on it. screen::apply_bytes, the way every received change comes in, now looks for a change of the actor the node writes as that the node doesn't hold: only another node can have made it. The node then writes on as a fresh actor at once, logs a warning, and its callers add the actor to the node's own (RemakeState::add_own_actor), which the document file's header follows. The change is judged as any other. lifecycle.md says not to start a copy of a node's data directory with --keep-actor, and what the switch leaves: what both wrote before stays refused where the other's came first.
* document file: write as a fresh actor once the file is marked closedtv6 days1-2/+15
| | | | | | | | | | | | | | | | With --keep-actor, a node on a file whose last record is Closed writes on as the actor the header names, which takes the file holding every change of that actor. At a clean stop, the node's own workers go on writing until it exits: its alive stamp in the member list, votes, a coordinator's commit. One committed after Closed was appended, and sent by the still-running sync, would be a change of that actor the file lacks, and the next start would make another change with its number. swarm::document_file::close now takes the document's write lock, marks the file at the heads it sees there, and sets a fresh actor before letting go: what the node writes after is no change of the marked actor. A record the file worker appends after Closed (such a write, flushed) leaves the file unmarked, which starts a fresh actor next time.
* stats: the writers of the documenttv8 days1-3/+11
| | | | | | | | | | | How many writers (Automerge actors) the document's changes have matters: a writer is a node's run (each start, rejoin or drop makes one, a start keeping the one of before with `--keep-actor` after a clean stop), and every transfer of the whole history carries a signature for each. `/admin/stats` now says it (`document.writers`, and `document_writers` for Prometheus), counted from the changes' metadata alongside the saved size's measurement in the background (at least a minute apart), as that takes time proportional to the document too; an export, which measures the size alone, keeps the count of before. The dashboard's figures show it with the rest.
* document file: a clean stop marked, and `--keep-actor` writes on as the same ↵tv8 days2-2/+22
| | | | | | | | | | | | | | | | | | | | | | actor A node writes as a fresh Automerge actor at each start, so no change number of an actor comes twice: one sent before a crash but not yet appended to the document file would otherwise be made again, differently. An epoch thus gathers a writer per start, and every transfer of its history carries a signature per writer. The document file now says when it holds everything the node wrote: * at a clean stop, after the last append, an empty `Closed` record, only where the file is up to the document's heads (ready, not rejoining); * as a node starts on the file, before anything is written, an empty `Opened` record, so a crash from then on leaves a file without the mark; * the header names the actor the node writes with (`current`). With `--keep-actor` (off by default; needs `--document-file`), a node starting on a file that ends with `Closed` writes on as that actor. A crash, a drop, a switch or a rejoin still starts a fresh one, so an epoch's writers come to one per node plus one per such event. lifecycle.md says so.
* docs: what is postponed or rejected stays in its own two filestv8 days3-6/+3
| | | | | | | | | Docs and comments outside future-work.md and review-rejections.md say what the code does, and point nowhere else for what it doesn't: the architecture page's map, the transports' forwarders, keys with `/`, a strict swarm's registry, trust.md's "Not yet" (now saying what isn't protected, in a sentence), the topology bench, and the comments of the change benchmarks, capabilities' grantor, tokens, dissemination, refusals and topology.
* signatures: a transfer carries one signature per writer in ittv8 days1-4/+8
| | | | | | | | | | | | | | | | | | | | | | Under a policy requiring signatures, a node takes a change only once a signature vouches for it: one of the change itself, or of a later change of the same writer. A writer is a node's run, each start, rejoin or drop making a fresh actor, so an epoch gathers writers for as long as it lasts, and a transfer of its whole history (a joiner pulling the document, a delta) must carry a signature for each of them, or the joiner waits for the rest for good. A message's signatures are now chosen by what it carries: * changes, up to 256 signed among them: each one's signature; * more (a whole document pulled): each writer's latest signed change among them, found by the document's change metadata (`Signatures::for_changes`), vouching for the rest; * a delta: each writer with changes in it (`get_changes_meta(from)`), its latest verified signature (`for_delta`). A message carries up to 65536 (6 MiB), and as many wait at the receiver for their changes (a delta's come after it). So a transfer leaves writers unvouched only in an epoch with more than 65536 runs writing since it began; a remake starts the count again. Wire version 48.
* sync: a write between signing and making a message signed tootv8 days1-3/+13
| | | | | | | | | | | Review 4, F10: a sync message signed the node's latest change under the document's write lock (`sign_sent`), then was made under its read lock: a write committed in between went in the message unsigned, and under a policy requiring signatures waited at the peer until the next signed change came with it, or a resend. Now the message is made under a read lock taken after signing, and if a write came in between (`AppState::sign_due` again under that lock), signed again: a few times at most, past them it goes as before, its signature with the next message.
* roots: only the seeds' roots end the wait for themtv8 days2-3/+22
| | | | | | | | | | | | | | Review 4, R2 partly (F8): a joining node waited for "each of its seeds" to name the swarm's root as a count, of every admitted peer that named one. Node identities are self-made and admission is the swarm key: a member answering a joiner under as many identities as it has seeds, naming its own root within the wait, made the joiner pin it before the real seeds answered, and refuse them after as another history. Now the seeds are the nodes proven at the seeds' addresses (`roots::seed_found`, as `bootstrap::resolve_seeds` finds them), and only their roots count toward the wait and start its clock. Another peer naming a root still disputes it (no root while they differ), so such a member can keep a joiner from joining, as any member can, but not hand it another root. access.md says so.
* sync: a message carries the signatures of its changestv9 days1-33/+15
| | | | | | | | | | | | | | | A sync message carried the signatures its peer wasn't sent yet, by a cursor per peer. Changes sent again, as after a message taken as delivered and lost on the way, went without them: the peer was past them. Under a policy requiring signatures they waited until the writer's next signed change, or the next session. A message now carries the signatures of the changes it carries (Signatures::for_changes), whatever the peer was sent before: changes sent again arrive vouched for as the first time. Past 256 (a message carrying the batches of many writers), each writer's latest instead, as a delta carries. The cursor goes, and with it resetting it after a failed send or a new session.
* sync: signatures sent again after a failed sendtv9 days1-6/+16
| | | | | | | | | | A sync message whose send fails gives back the changes it carried: the next message takes them again. The signatures it carried weren't given back: the peer's cursor stayed past them, so the changes went again without them, and under a policy requiring signatures waited for them until the next session; SIGNATURES no longer covers that. A failed send now sends the peer all signatures again with the next changes (each actor's latest, a few hundred at most).
* swarm: no SIGNATUREStv9 days3-120/+0
| | | | | | | | | | | | | | Signatures sent on their own (SIGNATURES, every second, to each peer not sent them yet) flooded every link: a signature made after its change left, or one that came with changes, went to every neighbour, whether or not it got the change along with its signature elsewhere. With every change of a node signed as it leaves (1217) and signatures going where their changes go (1218), none is left for them to carry: the message, its task and its traffic counter go (wire version 46). Signatures waiting for their changes are offered as before when sync messages bring them, and the changes waiting for signatures judged again with the next batch.
* sync: signatures go with changes onlytv9 days1-2/+12
| | | | | | | | | | | A sync message took the signatures its peer wasn't sent yet whenever it had a body, an Automerge message saying only what we have included. A signature belongs with the changes it vouches for: they go along the trees, and a peer that got them elsewhere got the signatures with them. Signatures now go in a message that carries changes (pushed, offered as a delta, or in an Automerge message carrying some: SyncSession:: carrying), and in no other.
* signatures: sign what is senttv9 days1-0/+3
| | | | | | | | | | | | | | | | | | | A node signed its changes no rule signs a while after them (--sign-every 1s): the change left at once, unsigned, and its signature followed on its own a second later, to every neighbour, over every link. A few writes made a cascade of SIGNATURES. Under a policy requiring signatures it signed every change as it was made instead. A node now signs its latest change, if no signature vouches for it, as a sync message takes it (--sign-every sent, the default): the signature leaves in the same message, and goes where the change goes. One signature per message, however many changes it carries, each vouching for those before it: a slow writer's every change is signed, a fast writer's batches are, at no threshold to pick. A policy requiring signatures signs what is sent too, even with `none`. `all` still signs every change as it is made; changes to protocol data, listed paths and ?signed=true writes are signed as they are made, as before. The interval, and the task signing on it, go.
* roots: a peer contradicting --genesis-root refused at the handshaketv9 days1-2/+18
| | | | | | | | | Review 3, R5: a node given its root (--genesis-root) refused a peer naming another only change by change while its document was empty, each with an entry among the refused; the handshake went through, as there was no root of its own yet to compare with. The root given is now compared too: a peer naming another is refused at the handshake, logged once, as one whose document starts from another root.
* screen: judged after the policy is gone, tootv9 days1-2/+12
| | | | | | | | | | | | | | Review 3, R4: whether a batch was judged followed the receiving document's policy now (and whether the batch writes one). After the policy was removed, or replaced by a version the node doesn't know, changes written under it and received late went in unjudged, while nodes that had them earlier judged them; REFUSALS gave up likewise. Screening now remembers that the document held a policy, known or not (Screening::policed), and judges what it receives while it does, each change by the policy at its dependencies; REFUSALS judges then too (not under a policy the node doesn't know, as before). Not across a restart, which access.md says.
* roots: a joiner takes a root once its seeds named ittv9 days2-29/+121
| | | | | | | | | | | | | | | | Review 3, R2: the root pin was set by the first HELLO_REPLY, and the first sync, a round trip later, took that root; a peer naming another afterwards was refused as another history. So the seed that answered first decided, not "none while they disagree", and a malicious seed makes itself fastest. A node joining with an empty document of the first epoch now takes no root (RootPin::Awaiting, roots left for later) until each of its seeds named one, or ROOT_WAIT (10 s) passed since the first did; then the one they name, none while they differ, as before. With --genesis-root it takes that one alone, at once. access.md, the option's help and example.toml say so; switching roots later, while the joiner holds nothing of its own, is postponed.
* screen: signatures required as the policy a change came under saystv9 days2-41/+32
| | | | | | | | | | | | | | | | | | | | | Review 3, R1: what a node received was vouched for only while its own document's policy required signatures. A joiner's first sync, and every node's message bringing `required`, went in by the rules alone: a malicious first peer could plant changes under other members' actors at their next seqs, their real ones then failing as duplicates for good. The signatures a message carries are always offered now, and the screen always has them: a change waits for one where the policy at the heads it is judged at requires it (rules::Reads::required, read once per heads), whatever the receiving document holds. Changes written under a policy not requiring signatures wait for none, as on every other node; the check for forged changes runs always. Changes waiting for a signature are judged again whenever signatures come. The test of signatures required now takes the history into an empty document; a new one takes changes written under a policy not requiring them without any.
* roots: an epoch's root pinned, and named in every handshaketv9 days5-3/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Review 2, N7, the care it raised: a joining node's empty document took as the first epoch's root whatever dependency-less change came first, from whichever peer it joined through; the first epoch's ID is all zeros, so nothing pinned it. A remake's epoch has its ID, the snapshot change's hash, which the rules hold its root to. * Every node names its epoch's root in HELLO and HELLO_REPLY (the epoch's ID for a remake's, its genesis change for the first; wire version 45). A node whose document starts from another root of the same epoch refuses the handshake, logging it: another history under the swarm's ID, a forged root or a genesis started again. * A joining node with an empty document takes as its root only the one it was given (--genesis-root, new), else the one its peers name, and none while they name different ones (access::screen::RootPin, kept in Screening across documents): one peer hands it another root only if it is all the joiner hears, or never, with --genesis-root. A root refused is listed with the refused, what builds on it with it. * The genesis node logs the root (`The swarm's root`); GET /admin/epochs shows it (`root`). A genesis started again under a remembered swarm ID used to merge with the nodes of it still running; they now refuse it (another root), and the docs say to join them with seeds instead. The epoch's identity stays as it is (generation 0 all zeros): records and epoch metadata name it so, and every comparison of epochs with them.
* screen: what a node receives judged, policy or nottv9 days1-7/+7
| | | | | | | | | | | | | | | | | | | | | Review 2, N7: a node screened received changes only while its own document had a policy it enforces. A joiner's empty document has none, so its first sync, as much history as the node it joins through chose, was applied unjudged, and under signatures required unvouched; the same for any node while the policy's own change arrived with later ones. Sync messages, deltas and downloaded changes are now always screened, each change judged by the policy at its dependencies (1135), so the verdicts are the swarm's. While neither the document nor the changes hold a policy (none touches a "policy" key: inspect::touch_key), only an epoch's root is judged and nothing is placed: bench_screening, after 1188, measured placing everything at about as much again as applying (564 ms + 543 ms for 100 000 changes), judging by the rules at about five times (+2.5 s), which a document with a policy pays anyway. access.md no longer lists the joiner's first sync, nor nodes agreeing only as the policy reaches them (judged at the dependencies, they agree), as left to do; changes::load_delta is for tests now.
* refusals: a drop taking much waits for a second member, and showstv9 days1-2/+3
| | | | | | | | | | | | | | | | | | A node told (REFUSALS) that it holds a change the swarm's rules refuse, and whose own rules refuse it too, dropped it and everything built on it on one peer's word, however much that was; its own writes among them went to the quarantine, the others' nowhere. * A drop taking more than 100 changes, or more than ten and a tenth of the document, now waits until a second member names the same change: the node's rules and one peer's word could both be off. Logged as an error, counted in /admin/stats (sync.dropsHeld). * The others' changes dropped are listed with the refused (GET /admin/refused, "taken unjudged, dropped"), for operators to see. The cheap half of asking the others (future-work.md, Telling a malicious change from a wrong policy).
* users: a user manages its own keystv9 days1-1/+1
| | | | | | | | | | | | | | | | | Only a user who may manage users could change a user's keys: a user couldn't add a new laptop's key, or remove a lost one. A user now manages its own keys, whatever else it may do: * GET /auth/keys: its keys, its entry, and the envelope holding it under a strict policy (`signed`), to sign against. * PUT /auth/keys/{id} with an authorized_keys line, DELETE /auth/keys/{id}: one change, as the user. The rules take a write of _continuum/users/<name>/keys/… from the user it names. * Under a strict policy, the user signs its entry with only its keys changed, with a key it holds already (envelope::check takes that from the user itself), PUT to its own entry even without write on the registry; continuum-signed key-add and key-remove do so.
* refusals: an import left unusedtv9 days1-1/+1
| | | | | Since judge_held moved to access::rules (1140), swarm::refusals uses ReadDoc no more; clippy warned.
* screen: a signature vouches for its change and what it builds ontv9 days1-0/+3
| | | | | | | | | | | | | | | Review finding 5: vouching by (actor, seq) isn't bound to a hash. A member can make a change under another member's actor at a seq that member's signature covers. The change is then taken as vouched, and if it breaks a rule, the honest member is refused as a whole and logged as the one whose own change broke the rules. A signature now vouches for its change and the changes of its actor it builds on: in the document, as before; among received changes, those it reaches through the batch's dependencies. A received change under an actor at a seq whose change the document holds (a signature verified up to it) is a fork: refused as forged, never as its actor's node's, not told back in REFUSALS, and logged with the peer that brought it.
* sync: a member refused as a whole, synced with again once it changed documenttv9 days1-3/+21
| | | | | | | | | | | | A node refusing a member as a whole sent it nothing, and lifted that only when a change of the member's was taken again. But a member that dropped what was refused (REFUSALS) starts its sync sessions over, and a fresh session sends no changes until the other side answers: the two waited for each other, and the member stayed refused. The refusal now notes the member's run and epoch_seq when it began; a member with another document since (it dropped what was refused, or rejoined) is synced with again.
* access: a node judges its own changes before they leavetv9 days1-52/+1
| | | | | | | | | | | | | | | | | | | | The API checks the path a request asks for; the rules judge everything the change does. Where they disagreed, the honest node's change was refused by every other node, and with signatures required the node was refused as a whole. The plan had both gates run the same judgement. Under a policy, each change a node makes (its own writes and those through the API) is now judged by rules::judge as receivers will judge it, before it is signed or sent; one every node would refuse is rolled back (the document forked at the heads before it, same actor: the change never left) and the request refused with 403 (StoreError:: Refused). rules::judge_held, judging a change the document holds, moves from swarm::refusals to access::rules for both. The simulations that play a member past its own checks write with a helper that bypasses them (forge). Review finding 3 (the same judgement at both gates).
* access: an epoch's root is never droppedtv9 days1-0/+4
| | | | | | | | | | | | | | | A REFUSALS naming the swarm's first change made the node receiving it judge that change again in a document that isn't empty, refuse it as "a change without dependencies that isn't the epoch's root", and drop it with everything built on it: its whole document. The first epoch's root is now the first change a document holds, as it comes to an empty one or as it is in one; a change judged again on a peer's word is never refused for having no dependencies; and drop_taken refuses to drop an epoch's root, or anything that would leave nothing kept, logging an error instead. Review finding 1 (critical).
* swarm: changes taken unjudged, dropped (REFUSALS)tv10 days4-4/+165
| | | | | | | | | A node refusing changes a peer brought tells it which broke a rule; the peer judges them itself, and if its rules refuse them too, drops them with all built on them (its document forked without them, a fresh actor), quarantining its own writes among them. Wire version 42. Auth plan M6 (rejoin on taint).
* access: members refused as a wholetv10 days1-0/+8
| | | | | | | | | With signatures required, a member whose own change broke a rule is refused as a whole: sent nothing, shown in /peers (refused), in stats (sync.refusedPeers) and on the dashboard, until a change of its is taken again or the epoch changes. Auth plan M6 (diverged standing).
* access: refused oncetv10 days2-6/+29
| | | | | | | | A refused change is remembered by its hash: offered again it is refused without decoding, judging or logging, so is one built on it, and a peer offering nothing else is answered later each time, up to a minute. Auth plan M6 (re-sending).
* access: --bootstrap-keystv10 days1-5/+6
| | | | | | | The first users' SSH keys, recorded at genesis with their entries, so a swarm can be strict from its start. Auth plan M7.
* access: a node registers before it writestv10 days1-18/+31
| | | | | | | | | Under a policy, a change by a node that isn't a member is refused with all built on it: a node's registration is written before any write of its own or through the API, not after (the registration itself exempt). Auth plan M6 (fix).
* access: banstv10 days1-0/+20
| | | | | | | | _continuum/banned/<node ID>: every node refuses the banned node's changes from then on (judged as the ban stood) and leaves its handshakes unanswered. Auth plan M6.
* access: signatures requiredtv10 days2-8/+58
| | | | | | | | "signatures": "required": a change counts only once a signature by its committer vouches for it, and waits until then; every node then signs every change it makes. Auth plan M6.
* access: the policy enforcedtv10 days1-2/+31
| | | | | | | | _continuum/access/policy ({"version": 1}) has every node screen every change it receives, on every path changes come in. A policy a node doesn't know stops its writes through the API. GET /admin/refused. Auth plan M6.