diff options
| author | tv <tv@krebsco.de> | 2026-11-12 21:59:19 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-12 21:59:19 +0000 |
| commit | 74fbd89aebcede8f38bff8d08e4642f9c71117e7 (patch) | |
| tree | a9eb26d6fbee78eb60d01836984e0ec270c71b76 | |
| parent | 8daa8d67b2df3586efcfcae0f0e39b06fee1c5c8 (diff) | |
federation: why not an actor for every change
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.
| -rw-r--r-- | docs/federation.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/federation.md b/docs/federation.md index 37714e8..fcf3d14 100644 --- a/docs/federation.md +++ b/docs/federation.md @@ -1575,6 +1575,17 @@ back, so the point only moves forward as more of them show up. * **A registry of only what is signed**, from the start: nothing unsigned ever counts, but it is incomplete for as long as users take to come, and what reads it needs the repository beside it meanwhile. +* **An actor for every change, made from the change** (the hash of its bytes with the + actor left out, 32 bytes, number 1): two changes could never share an actor and a + number, so a fork of an actor would be two changes that every node holds, shown + and parting nobody. It is what Kleppmann's construction asks for, and a receiver + checks it with one hash. But Automerge 0.12 keeps a slot per actor in every clock + it caches, and moves its indices for every actor that comes, so memory and time + grow with the square of the changes: 10^4 changes take 32 to 257 MB of heap and 2 + to 20 ms to apply one more, 10^5 take 2.7 GB at least and 0.16 s *(measured + upstream)*. A hundred nodes stamping daily write 10^4 changes in a hundred days. + So a fork of an actor is proven and named, and not prevented, for as long as + Automerge's clocks grow with its actors. * **A document per user**, each written by one party, a claim counted across them (as in Secure Scuttlebutt's feeds). A fork of an actor then spoils only the forker's own document, not the swarm, which is the one thing this design can't give. It @@ -2038,6 +2049,13 @@ Measured upstream, with Automerge 0.12.0 alone, on histories of small writes to takes 42 MB with 10 writers, 79 MB with 100 and 435 MB with 1000, where the nodes write in turn: a slot of 4 bytes per writer in every clock Automerge caches, which there is one for most changes, and one for every 16th at best. +* With an actor for every change, heap and time grow with the square of the changes: + 32 MB at 10^4 changes and 2.7 GB at 10^5 for a line of them, eight times that at + 10^4 where each change also builds on its node's change before it; 2 to 20 ms to + apply one more change at 10^4, 0.16 s at 10^5. An actor that is the hash of its + change with the actor zeroed is made with the public API and checked with one + hash; two changes a node writes on the same change of its own are then both held, + with the same values in the same order whichever came first. From the docs: a node under an unknown policy receives without judging; every node takes a token any member signed, and lets in by key any user of the registry; where |
