| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
Screening refuses them in every swarm, so the design builds on it and
no stage adds it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
An actor that is the hash of its change with the actor left out makes
a fork of an actor two changes that every node holds: it can be made
with Automerge 0.12's API and is checked with one hash. But Automerge
keeps a slot per actor in every clock it caches and moves its indices
for every actor that comes, so with an actor per change heap and time
grow with the square of the changes: 32 to 257 MB and 2 to 20 ms per
change applied at 10^4 changes, 2.7 GB and 0.16 s at 10^5 (measured
with Automerge alone). A hundred nodes stamping daily write 10^4
changes in a hundred days.
So a fork of an actor stays proven and named, not prevented.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A writer (an Automerge actor) costs every node heap in proportion to
the document's history: about 4 bytes per change, a slot in each
clock Automerge 0.12 caches. A document of 10^5 changes takes 42 MB
with 10 writers and 435 MB with 1000 (measured with Automerge alone).
Screening counts no actors, so a party starting a writer with every
change adds gigabytes to every node.
`limits.writers` (256 recommended) bounds what a user's nodes start
in an epoch, judged as a change's history shows, and a federated node
keeps its writer over a clean stop. Out of each other's sight such
writers are valid and held: the nodes that made them are refused as
peers, a party's budget bounds how fast they came, a remake leaves
them out. Not promised: a bound on what an epoch's document costs.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Automerge 0.12.0 applies changes no honest node writes: one that
lists an actor none of its operations names, one whose first
operation is numbered below its dependencies' or at 2^32 - 1. It then
gives back another change than the one it was given, saves a document
that doesn't load, or panics (measured with Automerge alone). A party
that crafts one stops the honest nodes, where a forked actor only
parts them.
So a change is refused before Automerge sees it unless its bytes are
the ones Automerge encodes for it, every other actor it names has
changes in its history, and its first operation is numbered one after
the highest of its dependencies. An attack with its test, in the
first stage.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The design as it stands after being read against itself and the code:
* A statement says where it was signed: its payload names the changes
its signer saw. "In sight of", the order past a limit and a
proposal's number are read from that, so carrying a statement a
second time moves nothing. A statement that is counted states its
number.
* A node carries for a user once it committed the statement naming it
itself. Tokens and logins by key are taken as a node's operator
says.
* Lines say who is in and nothing else. A claim's witnesses are its
user's nodes and the roots'.
* The roots are several, named by an epoch's root change like the
voters: by the genesis change, then by each remake. What a root
signed for another is the seats' once its signer holds none, and
the roots take that back only together.
* A claim seen holding its name for `final` by a third of the voters
is final: no rival holds or contests the name after, whatever a
root says and whatever is cut off. It takes no root.
* A claim made in sight of one that didn't stand doesn't give way to
it when it comes back (its user vouched for again, a limit raised);
only a release or a cut that a cut takes back does that, until the
later claim is final. Late is witnessed by a change that saw the
other stand while the claim didn't.
* A cut never leaves out its own statement, and takes back what the
key it cuts retired, stopped and unvouched. Giving a user up takes
a first key.
* Every voter counts toward a decision: more than two thirds of all.
Nobody is absent; a remake names those who take part, and a voter
votes while it isn't gone. Any node of a voter takes a proposal up;
every node judges a record against the votes in its history; a
proposal is decided at a record that has two thirds of them in its
history. A node takes up nothing lower than it took up, the highest
number holds, and what hangs short of records shows and is ended by
a later decision. A change is judged by what is decided in its
history; the registry is resolved by what holds.
* What is decided: numbers, the policy, first keys, the names of a
user that is out, whose a contested name is, the voters' names, and
a remake with the voters and the roots it names.
* A remake: every node carries over what it holds beyond the base,
whoever signed it, in its first changes and in order; the root
change lists the digests of the base's statements, so nothing it
left out is written again; decisions after the base are taken up
again, and what a third of the voters' nodes held as gone, final or
dropped stays so. An epoch's remakes are one matter.
* A kind may name the characters of its names (lower case
recommended); a kept name may be claimed, to stay through a change
of policy.
* The genesis change may hold users, without keys too, so a registry
moved in has its users from the first change.
* How often nodes stamp, a member entry's size, and what the genesis
change sets for the swarm as a whole are numbers of the policy.
* A node compares what it resolves with the stamps of the voters'
nodes, and stops writing only where a third of them differ. Two
wire versions spoken at once is a change for every swarm.
* Stages: versions before remakes; the registry stage is for trying,
the last for relying on it. 110 attacks.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A remake that names all users names those that count in its
proposal's history, and still do at its base: the list is fixed with
the proposal, so those who vote see it, and a user brought in while
the votes run isn't on it. A fork's voters go the same way.
And what reading the design from end to end found:
* a remake does two things, not one: it throws history away and names
who votes next;
* nothing plain is written but a node's member entry and its records
of proposals, said where namespaces are, too;
* a node doesn't sync under a policy it doesn't know, whatever its
version says;
* two sides that only resolve differently show by their stamps;
* on the wire a federated swarm's handshake says which epochs a node
keeps, and a version speaks the one before its own: "no message
changes" holds for a swarm that isn't federated;
* three more things assumed: what was seen for long kept as the node
goes, the cost of a digest with every stamp, two wire versions
spoken at once.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
What the maintainer asked of the design:
* Who votes is named by the remake's proposal: all users at its base,
as recommended, or a list. So those who vote say who votes next,
and nobody votes by a rule of who created it. What that costs is
said with it: every voter named counts toward what a decision
takes, and all users is whoever brought users in.
* What a policy no longer covers is uncovered at once where the
decision holds: shown aside by every node, taken away by its user
only, changed by nobody, and dropped once it has been seen there
for `uncovered` (a number; 0: at once). Within an epoch a rule
moves nothing in the document; the remake moves it.
* Being seen takes nothing but a node that is up: its stamp is
renewed about daily whatever else is written. A node left running
keeps its voter present; naming the voters deals with that.
* A release of a vote is best effort.
* Continuum changing under a swarm: versions agree by what they
compute, not by a number. Every stamp carries the digest of the
snapshot its node would build there; a remake is taken up by the
ID each node built; a node checks itself against the swarm before
it writes with a new version; a change of the rules is a change of
policy, and a node knows a policy by everything in it; recorded
vectors every version passes. What can't change, what changes
freely, and when it is a fork.
* Who may connect is outside the design; the swarm key is a note.
The attacks are 84.
future-work.md: several roots, present by the user's own signature, a
guide to moving to another swarm.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
What the maintainer asked of the design, and what it changed:
* Lines. A user is in while it has a line: a chain of creations and
vouches from the root. When its creator goes, one that another
vouched for stays without doing anything. The witnesses of its
claims are the users on the lines it stands on: its creation's, and
those of vouches it accepted (`accept`), so nobody gets a say about
a user's names by vouching for it unasked. Why only its signer
takes a vouch back is said where unvouching is.
* Lengths of time are read between two stamps of one node, with what
that node had seen at each: a voter is absent once a third of the
voters saw it silent for long, a user gone once they saw it out. No
clock is set against another, and why a third.
* Decisions. A proposal is decided as soon as the nodes of two thirds
of the voters hold its votes: at once, not at the end of a window.
Any number are open at a time, within a limit a voter. Of the
decisions of one matter the last holds, by which proposal was made
in sight of which, so two decided at once stop nothing. A remake's
base is named by its coordinator, a node of the proposer.
* The policy changes by a decision, as a whole, with no remake: a
remake throws history away and does nothing else. What a policy no
longer covers doesn't count, and a remake keeps it aside for an
epoch or drops it, as the policy says. Going apart by a fork stays
for those a decision leaves behind.
* What a remake leaves out, so that the document's size goes by what
stands: a release is a statement in its epoch, the remake deletes.
* Names are written as they are used, in the document and in the
rules alike, and compared by their segments: structure, not
meaning. A rule may leave a name to the voters to give.
* Who vouched for whom changes nothing in who connects to whom: a
node keeps its seeds and its user's other nodes as neighbours.
The attacks are 83, the stages fifteen.
future-work.md: guides to write (keys, the root, starting a swarm,
voting, a registry), policies merged.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
What the maintainer answered to the design's last two questions, and
what follows from it:
* The fractions are numbers of the policy like the others, changed by
a decision to any value: the share of the voters present a decision
takes (two thirds recommended), the share of all of them (half), and
the share whose stamps make the swarm's time and a user gone (a
third). What is promised of decisions is argued for the recommended
ones; Why it holds says what other values carry.
* Refusing a decision: a node follows every decision that counts
unless its operator has it refuse, by bounds on the policy's numbers
or by hand. It then moves to the epoch built at the decision's
history without it, which is the same for every node that refuses
the same decision: those who think alike go on together without
arranging it. While a proposal's votes run, a node whose bounds it
breaks says so. A remake or a change of policy is refused by
staying.
* A decision gives a user name with its namespace, as designed.
* No open question is left. The options not taken that the questions
listed are among the roads not taken: first users voting as soon as
created, voters let in without a remake, other reaches of an
unvouch, a gone user coming back, first keys by those who vouch,
a registry of only what is signed, numbers the design fixes.
The attacks are 78; the stages name them by their numbers.
future-work.md: bounds on more than numbers.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
What the maintainer answered to the questions the design had left:
* Every quantity of the design is a number of the policy, in one
table with what the design recommends (the times, the limits, how
much a remake's base may lack, how long the root's node lets a claim
wait). The genesis policy sets each, and a decision changes any to
any value: nothing constrains them. The fractions aren't numbers.
* While a user is out, the voters free its names or give them to
another by a decision, whatever `gone` says; a policy without `gone`
has the names wait until a vouch or a decision.
* Nobody is put out by a vote, said where unvouching is, with what
there is against a user that harms within the rules.
* A node keeps the epochs it left for as long as its operator says,
`archiveRetention` at least, and says which; so a node coming back,
or one joining from the genesis root, walks every epoch where an
archive is within reach, and shows where the walk doesn't end at its
peers' epoch.
* Settled, and listed so: who votes, from where an unvouch undoes,
gone for good, first keys by a decision, what the root holds
unsigned. Two questions remain: whether the fractions are numbers
too, and whether a decision gives a user name with its namespace.
future-work.md: an archive of every epoch.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
What the maintainer answered to the design's open questions, in the
design:
* The numbers. The limits and the times are the policy's numbers, set
in the genesis policy and changed by a decision: 64 keys, 64 nodes
and 256 addresses a user for a start; `window`, `absent`, `gone`,
`archiveRetention`. A lowered limit takes nothing away.
* A user nobody vouches for is out, and its names wait for it: nobody
else claims them. Out for 30 days, as the stamps of a third of the
voters show, it is gone: its names are free, and no vouch brings it
back. So whoever relied on a vouch that an unvouch or a cut took
back has that long to find another, and loses nothing meanwhile.
* First keys by a decision. The voters are above every user's first
keys: they give a user that lost them new ones, with a cut for the
old. The promises say so, and what isn't promised: a name against
two thirds of the voters.
* What a decision is made of (a proposal, a vote, its release, the
decision) is taken in any node's change, so a user without a node
votes at whatever node it reaches, or by a vote carried to one. Such
a user names another party's node to carry for it.
* Coming back after remakes: by the archives on nobody's word, epoch
by epoch, as far as peers keep them; else by an ID the operator
gives, never because peers advertise an epoch. A statement is
carried over from the epoch before only; older ones are quarantined
for the user to sign again.
* Resolving reads the decisions first: nothing below changes them.
* The questions that remain are put with their options: who has a
vote and from when, whether the voters put a user out against those
who vouch for it, from where an unvouch undoes, whether gone is for
good, the price of first keys by a decision, and what the root
holds unsigned.
The attacks are 76; the stages name them by their numbers.
future-work.md: barring a user by a decision, and voting made easy for
a user without a node.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
federation.md designs what the krebs registry needs of continuum: a
swarm several parties keep, any of them possibly malicious. Nothing of
it is built. It is a mode a swarm is started in: one that isn't
federated stays as it is.
* The parties, what an adversary can do, and what is promised to an
honest node: only valid changes; the same document and the same
resolved registry for the same changes; values signed by their users;
one holder per name; a claim nobody takes once the root's node saw
it; no waiting for anyone to write; and, with fewer than a third of
the voters present malicious, decisions by two thirds of them. And
what isn't: one history under a partition, a name never contested,
decisions against a third, against keys stolen later, against a
malicious voter on both sides of a long partition, or with half the
voters gone; a swarm no forked actor splits.
* The design, on the strict policy. The policy is in the root. Users
come by statements that only add; a user is its creation, its keys a
tree, its nodes those it names. Vouching and the line; unvouching,
with what exactly it takes back. A namespace per user. Names of
declared kinds claimed, with rules and limits as data, some kept for
a user without a claim. Of two claims out of each other's sight, one
is late where its own side can be shown to have seen the other
first; where that leaves not exactly one, the name is contested, and
a release gives it up. Cuts: what a key signed outside a set of
changes stops counting, whenever it shows up; a key is cut off by one
above it only. Bans change what those who follow read, not what
anyone takes.
* Decisions: votes signed by the voters, over days, by numbers the
document holds and a decision changes. Who votes is in an epoch's
root change: the root alone at first, then, with each remake, the
users a root created, so nobody fills the votes without two thirds
of those there agreeing. A time read from the document, by which
those away for long don't count; a decision taken up by the voters'
nodes while its votes run, and counting with two thirds of those
present and more than half of all, so that honest voters never make
two however long a partition lasts. The
root's seat given anew by a decision, and what a root finds when it
comes back. Remakes: the base is the decision's history, every node
builds the snapshot from the registry as it resolves, statements are
carried over, and what counted at the base is final. A change of
policy as a fork each operator follows or not, as Bitcoin changes
its rules; it may name who votes on its side, and is the way out
for those a decision leaves behind.
* What every node judges and how the registry resolves, how a partition
shows and how a side comes back, links along the line, tokens of
one's own party only. Why the promises hold, the roads not taken,
what members are trusted with then, what is continuum's and what the
application's, 69 attacks with the tests that show them, the
registry's layout with moving in and writing out, fourteen stages,
and ten open questions with a choice for each.
future-work.md gets what the design leaves.
|
| |
|
|
|
|
| |
The glossary and the `kind` row of `remakes.md` named three kinds of
remake; `strict` is the fourth, and takes `baseHeads` as `replace` and
`import` do.
|
| |
|
|
|
|
|
| |
The example of a strict policy wrote it through the API, which every
node refuses where the policy isn't strict: a swarm turns strict only
at its start or through a strict remake. It shows the genesis node
given the policy, with its first user and their key.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The policy was read in typed JSON, so that an Automerge text spelling
"signed" at its `values`, which no operation `rules::turns_strict` asks
of writes, turns no swarm strict. But that read every policy anew: a
setting that wasn't a string, or a text at `signatures`, made a policy
no node knows in swarms that aren't strict, which read it as before.
The policy is read in plain JSON again, as it was, and only its
strictness asks more (`policy::of`): it reads strict only where its
`values` is a string in typed JSON, an envelope read as its payload.
A policy that would read strict only through a text, at `values` or
holding the policy, is one no node knows. Every policy that doesn't read
strict reads as it did.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A swarm turns strict only at its start or through a strict remake, and
a change writing a strict policy where the policy isn't strict is
refused, found by its operations: `"signed"` put at the policy's
`values`, or an envelope asking for it put at its place. But the policy
was read in plain JSON, where an Automerge text reads as a string, and
writing a text is no such operation: `{"$text": "signed"}` at `values`,
through the typed API, turned a swarm strict that nothing refused, with
a time before it nothing closes.
The policy is read in typed JSON now (`store::read_plain_as`): what
continuum writes there reads as it is, plain JSON or an envelope, and a
text, a counter or bytes as itself, tagged; a setting that isn't a
string makes a policy no node knows (`policy::read`), as a version it
doesn't know does. So no text turns a swarm strict, and the operations
`rules::turns_strict` asks of are the only ways to. A policy holding none of these reads
as before.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Under a strict policy, links and other writes go by where their change
is among those replayed, and of one change the links went first. Both
were judged at that change's history, without the other; a link can
only take away there what the other writes relied on (a capability
revoked), never give what they needed, so they go first now.
A group of other writes was placed by its last change by history but
named the user of its newest by clock; it names the user of the last
by history now, as it goes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A strict policy written into a running swarm left a time before it:
changes written there, beside the turn, were refused by the nodes that
took the turn first and taken by the others where they came first (a
signed policy that isn't strict, among them, unseated the turn there);
and a remake whose base preceded the turn had every switching node
replay the turn as one of its own, each refusing the others'.
A change writing a strict policy where the policy at its history isn't
strict (`"signed"` at its `values`, or an envelope there asking for
signed values) is now refused, in every swarm. A swarm turns strict at
its start (`--bootstrap-policy`) or through a strict remake, each its
epoch's first change: no change of a strict epoch is from before its
policy, and the rule for the time before goes, with the walk that found
the changes that turned a swarm strict and what kept them
(`before_strict`, `turned_strict`, `Reads::strict_now`,
`Reads::turned_now`, `store::writers`, `store::made`,
`changes::in_history`). The strict swarm's simulation starts strict.
access.md says so, and that a strict swarm can't move to a policy its
nodes don't know by writing it.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
`--genesis --remake` writes the content as a change of its own before
the one recording the first users and `--bootstrap-policy`. With a
strict policy, that content change was a time before the policy, on
which any member could build a change judged by none.
A strict `--bootstrap-policy` with `--remake` is now refused: a swarm
strict from its start starts empty, and one started from content turns
strict through a strict remake, which keeps only what an operator
looked over. A policy that isn't strict starts from content as before.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under a strict policy, the links of the chains to signed values went in
the order their changes were made, but the other writes were grouped by
time, and a link went before a group only where its time wasn't later.
A write built on what a link grants (a capability in an entry its
manager signed, a ban lifted, a declaration) went first wherever its
clock was behind the link's, was judged where it wasn't granted yet,
and was quarantined, though every node had taken it.
Under a strict policy the other writes now go by where the last change
that wrote them is among those replayed (`between`), with the links,
and keep their times for later replays. Without a strict policy there
are no links, and the groups go by time as before.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A strict policy could be written over with one that isn't, or deleted,
by a user who may manage the policy. While the swarm was relaxed so,
nothing was asked of the time before it turned strict: a change written
beside that turn was taken, and once the swarm turned strict again,
built on, a node judging that change while strict from the first turn
(one back from away, a joiner) refused it, and every node it told
dropped it with the second turn and everything after.
Under a strict policy, the policy is now written again only as strict:
an envelope there whose value isn't a strict policy, a signed `null`
among them, is refused. So a strict swarm has one change that turned
it, and the time before it stays closed; to leave it, start a new swarm
from its content. A swarm that isn't strict writes its policy as it
did.
|
| |
|
|
|
|
|
|
| |
`--bootstrap-policy` records the policy in the genesis change, "no
change of it from before the policy". With `--genesis --remake`, the
content is a change of its own before the one recording the users and
the policy. access.md says so, and that a change built on the content
beside that one is refused as from the time before a strict policy.
|
| |
|
|
|
|
|
| |
Where the new epoch holds as high a `seq` at a signed place as the old
one reads, the chain isn't replayed: it was counted as superseded and
left out even with `--superseded-writes quarantine`, unlike every other
write a newer one superseded. Now it goes to the quarantine then too.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under a strict policy, the links of the chains to signed values were
ordered across places by their changes' timestamps. How a link is
judged in the new epoch depends on what was replayed before it: a key
added to a user's entry, a capability granted. A write signed with a
key added a moment before, through a node whose clock is behind, went
first, was refused and quarantined, though every node had taken it.
The changes replayed (`between`) now come each after those it builds
on, clocks deciding only between changes neither of which saw the
other, then the lower hash; the links follow that order, and an
envelope takes its time from the first change that wrote it there.
remakes.md says so, and what becomes of a place where a link is
refused. Without a strict policy there are no links, and nothing
changes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A change written under a policy that isn't strict was refused, in a
strict document, unless it was in the history of the change that wrote
the policy value the document read now. So the policy written again by
a node that held a change from before, taken beside the strict policy,
put that change in the new writer's history: that node kept it, every
other node refused it, and the new policy with it, and the node was cut
off.
Now the reference is the change that turned the swarm strict: one that
wrote a strict policy where the policy at its history wasn't, found by
following back the writes of what the policy holds
(`store::writers`). A change written under a policy that isn't strict is
refused where such a change is beside it, neither in its history nor
built on it. A policy written again, strict over strict, names the same
change.
One turning the swarm strict beside it is refused like any other. Of
two at once neither is preferred: any rule choosing one, the lower hash
say, would let a change made later to look as old take the place of the
one every node took, and every node would drop it with all that was
built on it. So two members turning a swarm strict at once split the
nodes that took one from those that took the other; access.md says to
turn it from one.
|
| |
|
|
|
|
|
|
|
|
| |
A change is judged as its writer saw the document, and its writer
chooses what it saw. So a capability revoked, a user disabled or a key
removed holds against members that weren't members before it, but a
member that was can still commit, at a history from before, an
envelope the user signed then, and the next, as far as it likes; the
highest `seq` is the place's value. A remake ends it. access.md says
so where it says what signed values keep out.
|
| |
|
|
|
|
|
|
| |
Where the policy asks for signed values, a place's value is chosen by
`seq`, but conflict reports still called the choice `newestWins`, and
the code and the architecture still said "newest" of what a read
shows. A report names it `highestSeq`; the rest says "the one a read
shows".
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A swarm turned strict by writing the policy into it kept the time
before open: a change whose history lacks the policy's change is
judged by the policy then, none or one that isn't strict, needs no
signature there, and is taken whenever it comes, from any member. With
values read by `seq`, an envelope planted at that time with the
highest `seq` there is can never be followed: a ban, a user, a
declaration, for good.
Once a document's policy is strict, a change written under one that
isn't is refused, received or held, unless it is in the history of the
change that wrote the policy the document reads (`store::written_by`).
A node that holds one beside that change, taken before it came, is
told so by any peer that refused it (REFUSALS), judges it again, now
refuses it too, and drops it with what builds on it, as for any change
it took unjudged. A swarm strict from its genesis change has no such
time; one whose policy isn't strict judges as before.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under a strict policy, a replay wrote at each path the old document's
merged view: at a place of a value its user signed, the last envelope
alone, whose `prev` names one the new epoch doesn't hold if the value
was written twice since the base. Every node refused it, it went to
the quarantine, and the new epoch kept the base's value: a remake
rolled back every signed value changed twice since its base, and a
rejoining node lost its own the same way. And the replay found what
changed by Automerge's diff, which says nothing of a value that
changed beside Automerge's own choice: where a place held two values
at the base, a write replacing the one read by `seq` wasn't replayed
at all.
Now, under a strict policy, the places of signed values are found from
the changes' operations as well as from the diff, and each is replayed
as the chain that leads to the envelope the old document reads: every
envelope from the one the new document holds there, following `prev`
through the changes since the base, each in a change of its own by its
signer at the time it was made, judged as every node will judge it.
A place is replayed only where the new document holds a lower `seq`
there; where no chain leads from what it holds, it goes to the
quarantine. A path above such places is split into its keys. Without
a strict policy nothing changes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The order by `seq` sat in `store::candidates`, which every swarm reads
through: in a swarm that isn't strict, a string shaped like an
envelope, written at the same time as a plain value or a map, was read
first. What a swarm without a strict policy reads must not change for
signed values.
The order now applies only where the policy asks for signed values
(`"values": "signed"`), as any value at the policy's place says, read
as written (`signs_values`), so the policy's own reading doesn't go
round. Elsewhere `candidates` is newest first, as always. It is looked
at only where a place holds several values and one is an envelope.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A member could put a user's older signed value back beside a newer
one: a change made with dependencies from before both is judged where
the place was empty, so the older envelope (`prev` empty) is taken;
and of values written at once, the one read was the one with the
highest operation, which whoever writes the change steers. A revoked
capability, a lifted ban or an earlier policy came back that way,
signed by whoever signed it then.
An envelope is now `cv2.<value>.<meta>.<signature>`: the value as its
user wrote it, and apart from it what continuum adds (swarm, path,
user, at, seq, prev), the signature over the value's line and the
meta's. `seq` is one more than that of the envelope it replaces, 0
where it replaces none; every node checks it with `prev`.
Of the values a place holds, written at once, signed ones are read
before any other, the highest `seq` first, of equal ones the lower
digest (`store::candidates`): reads, snapshots and writes all go by
it. An older envelope beside a newer one changes nothing.
`application/continuum-signed` is the value's line, the meta's, then
the signature; `scripts/continuum-signed` writes and checks it so.
The wire version goes up: nodes must agree on what a place's value is.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Screening took marks in a text, checking that a mark's end comes at its
begin or after it, by walking the elements each is inserted after back to
the text's head: up to 22 s for one change of 9 KB. And it took a value
put at a mark's begin or end, replacing it: sound until an honest node
edits that text, then the node panics at its next sync or append, and its
save doesn't load.
Continuum's store writes no marks. A change with a mark's begin or end is
now refused, and the walk is gone. An element written at is one a value
or an object was inserted as.
|
| |
|
|
|
|
|
|
|
|
| |
Screening took a table for a map. A table made is sound, but Automerge
panics applying a change that puts a value into one, made by that change
or a later one, and applying isn't caught where it panics. Transactions
make a table and can't write into it; continuum's store makes none.
A change making a table is refused, and so is one writing into a table
the document holds.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Screening asked what an operation isn't: a deletion replacing nothing, a
value put at a list's head without inserting, a mark ended but right after
its begin. Others pass that Automerge's transactions never write, and
Automerge takes them and breaks: an element written over naming as replaced
the element inserted after it (an inserted element's key is the element it
follows, its place is itself), an insert replacing something, a deletion or
an increment inserted, an increment at a list's head, a mark ended ahead of
its begin or at the head, a mark in a list. Giving such a change back
panics or gives another change under its hash, and the save doesn't load.
Each operation is now asked to be one transactions write
(`document::changes::unwritten`): inserted, a value, an object or a mark's
begin or end into a list or a text, replacing nothing; at a list's element,
never its head, without inserting, replacing what is at that element; at a
map's key, never inserted, a deletion or an increment replacing something;
a mark's begin with its end as the next operation, both inserted. A value
replaced at a list's element is the element itself or written at it, not an
element inserted after it. Marks are only in a text, and a mark's end is at
its begin or at an element after the begin's: their places follow from the
elements each is inserted after, back to the text's head, as the change's
history holds them.
The document the tests write now has counters in a list and a map, an
element written over, and marks over a span, the whole text, none of it, and
across what was deleted and inserted since; and each case above is a test.
|
| |
|
|
|
|
|
|
|
|
|
| |
Automerge 0.12.0 takes some changes that name nothing wrong, and then
can't give them back: a deletion that replaces nothing, a value put
at a list's head without being inserted, a mark ended where no mark
began right before it. Giving the change back panics, the save
doesn't load, and a sync to a peer that lacks it panics: one member
stops every node it reaches.
Those are refused with the other checks (`changes::Written`).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Screening checks that a change is one Automerge writes
(`changes::Written`) before it looks for forks and judges the rules,
and the checks recorded what a change made as soon as it passed them.
A fork of a change the document holds has its actor and counters: if
it was checked first in a batch, and refused as forged after, its
record stood in for that change's operations, outside the history of
the next. An honest change writing into what the real one made was
then refused, for good. Anyone could make such a fork, its hash
ground to sort first.
What a change made is recorded once screening takes it
(`Written::taken`), and an operation named is looked for in the batch
and in the document, whichever the change's history holds.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
A node switched to a fresh actor whenever a peer showed it a change of
its own actor that it didn't hold, signed or not. So any peer made a
node start a writer at will, by sending a copy of its last change with
another value: and every writer costs every node memory in proportion
to the document's history.
Copies of a node's data directory hold its key, and sign their
changes with it; a stranger can't. A twin switches the node only where
a signature by the node's own key of it is kept or waiting. Unsigned,
it is refused as forged as before, and nothing switches.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A change is refused before Automerge sees it unless it is one
Automerge writes (`document::changes::Written`). Three things about
that, each of which let a crafted change through or parted nodes:
* An operation a change names (the object written into, a list's
element, an operation replaced) must be made in the change's own
history, or before in the change itself, not anywhere in the
document. Else a node that holds the operation takes the change and
one that doesn't yet refuses it for good: nodes part by the order
changes reach them.
* And it must be what it is named as: an object of the kind written
into, an element of that list, an operation at the place written.
A change that replaces an operation elsewhere marks an unrelated
value gone, and Automerge then gives back another change under its
hash and saves a document that doesn't load; one that writes into
an operation that made no object makes it panic.
* A change that isn't its actor's first must have the one before it
among its dependencies, as a transaction puts it there. A gap in an
actor's numbers makes Automerge panic.
What the document holds at the changes this one builds on is read
there where it can be (a map's key, an object held by a map's key);
else the operation's own change is decoded and the history walked
back to it, no further than the operation's counter. So operations on
a list's elements cost a walk each.
Decoding a change can panic too (an operation naming an actor its
change doesn't list): caught, and the change refused as one whose
bytes aren't Automerge's.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Automerge 0.12.0 applies a change that lists an actor none of its
operations names, or whose first operation is numbered below its
dependencies' or near 2^32. It then gives back another change than
the one it was given and saves a document that doesn't load, or
panics at the next write. A member sending one stops the nodes that
take it.
Every change from elsewhere is looked at before Automerge sees it
(`document::changes::Written`, from `access::screen::apply`, with or
without a policy), and refused like one breaking a rule unless:
* encoded again, it has the hash it came with;
* its first operation is numbered one after the highest of its
dependencies, 1 without any, as a transaction at the document's
heads numbers it;
* every operation it names (an object, a list's element, an
operation replaced) is its own, or was made before it, in the
document or by a change of the batch looked at before.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
The document file's format names itself in its first line
(continuum-document/2) and each record's kind in its first byte. A
record of a kind the reading version doesn't know makes the file
unusable: the node doesn't start on it unless told to move it aside
(--force badDocumentFile). lifecycle.md says so: a file one version
wrote is read only by versions knowing every kind of record in it. The
format's comment names the Opened record a node appends as it starts on
the file, which undoes the clean stop's mark.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
At start, a node on a document file appends an Opened record before it
writes anything, so that a Closed record before it no longer says the
file holds every change of the actor it names. It does so now before
deciding which actor to write as, and DocumentFile::open says whether it
could: where the append fails (the disk full, permissions), the file
still ends with Closed, and later appends likely fail too. A crash, or a
clean stop whose last append failed (close then sees the file behind and
writes no mark), would leave that Closed standing for a run the file
never got. So with --keep-actor, the node writes on as the actor of
before only where the file was marked as opened; else it writes as a
fresh actor and warns.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A token's limit narrows every endpoint but those under /auth, which any
registered user may call. Among them, PUT and DELETE /auth/keys/{id}
change the keys the user logs in with, and POST /auth/logout ends every
token of the user. With the token a dashboard hands to another member's
(the member list, read, five minutes), its holder could add a key of its
own and log in by it as the user, with everything the user may do.
These now take a password or a token without a limit
(Need::Credentials, refused where Caps::limited). A narrowed token still
refreshes within its limit, says who it is, lists the user's keys and
ends its own session (DELETE /auth/session): a dashboard opened from
another member's logs out with it.
|
| |
|
|
|
|
|
| |
With the other options of the document file: what it does, what it saves (a writer per
node and per crash or drop, rather than per start), and what it must not meet: two
nodes started from copies of one document file, or a node from an older copy of its
own, which would write as the same actor.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|