diff options
| author | tv <tv@krebsco.de> | 2026-11-14 05:52:45 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-14 05:52:45 +0000 |
| commit | fdbb674621b25fbc51c23b432453fd4c46afdb70 (patch) | |
| tree | c1fb312c625c01bc7e13c9be1d1330f5c3236fa3 /docs | |
| parent | 66137ff698f41a96f7df1cb97e691c8ef96e9f26 (diff) | |
federation: what it costs
What every node pays was scattered over the text: what a statement, a
stamp, a cut's list and a carry record take, a snapshot a remake, a
signature's check. A section of its own says it per thing (a change,
a writer, a statement, a value, a node, a user at its limits, a claim,
a cut, a root's node, a remake, a signature), in memory, on disk, on
the wire and in time; what bounds the changes and the writers, and so
an epoch's heap (some 42 MB at the remake numbers recommended); what
nothing bounds; what was measured; what is assumed cheap.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/federation.md | 58 |
1 files changed, 52 insertions, 6 deletions
diff --git a/docs/federation.md b/docs/federation.md index f71fb20..8905818 100644 --- a/docs/federation.md +++ b/docs/federation.md @@ -1180,12 +1180,7 @@ waits in the new epoch for the nodes of two thirds of the voters to take it up a Who remakes, when, and from what base changes none of it: that is why the alive peers decide it, of whom a party running many nodes can be most. -For the registry the document is small: a statement is under a KiB, a node's alive -stamp with its digest and signature some 350 bytes, so a hundred nodes stamping -daily write some 13 MiB a year. What makes a swarm remake is mostly what its writers -cost in memory (Users), which grows with the history and with the writers: -`remakeChanges` and `remakeWriters` keep it in bounds, at some 40 MB on every node at -most. +What a remake bounds, and what everything costs, is said below (What it costs). ### Coming back after remakes @@ -1711,6 +1706,57 @@ takes along those of the nodes that carry for a user it holds. as every party keeps it, and is no boundary between the parties. Nothing here rests on it. +### What it costs + +What every node pays, per thing: in memory, on disk, on the wire and in time. Measured +where it says so; else from the design's own numbers. Automerge 0.12.0 holds a +document of small writes at about 0.2 KB of heap a change, its bytes besides, and 4 +bytes for every change and writer of the epoch, whenever the writer started +*(measured upstream)*: the heap goes by changes × (0.2 KB + 4 B × writers), and both +factors grow with the epoch. + +| What | What it costs every node | +|---|---| +| a change | its bytes, on disk and once on the wire; in memory 0.2 KB and its bytes, and 4 B for every writer of the epoch; when it was received, kept beside it | +| a writer | 4 B of heap for every change of the epoch, those before it too; a signature in every transfer of the whole history | +| a statement | under a KiB; 32 B in the next root change's list where it was signed in the epoch before, in each retirement's list that keeps it, in each carry record that names it | +| a value | its envelope, a few hundred bytes for a host; kept replaced while not stopped counting for good | +| a node | its member entry, `limits.entry` at most; a stamp each `stamp`, some 350 B; a writer a run; a record a proposal it takes up; a carry record a remake | +| a user at its limits | some 470 statements standing (keys, nodes, users created, vouches, proposals, a kind's claims), under half a MiB, and `limits.writers` writers | +| a claim | its statement; while it has a rival, what each witness had seen, kept as the node goes; until it is final, a length watched for each voter's node | +| a cut | 32 B for each statement and value it keeps | +| a root's node | a change a `witness` at most while claims reach it | +| a remake | the snapshot built by every node, the registry gone over once; 32 B in the root change for each envelope signed in the epoch left; a carry record a node, 32 B for each envelope beyond the base it holds; each such envelope written once more; the epoch left, on disk for `archiveRetention` | +| a signature | some 30 µs to check *(docs)* | + +What bounds it: + +* **Changes.** Stamps: nodes × days, at the recommended `stamp`. What users sign: what + stands by each user's limits, and what is signed and given up without end by each + party's budget at every node. A root's node's witness: one change a `witness`, 1 440 + a day with a minute, whatever the parties do. An epoch: `remakeChanges`. +* **Writers.** A user's by `limits.writers`, a party's by its budget, an epoch's by + `remakeWriters`. With them, an epoch's heap stays under 10 000 × (0.2 KB + 4 B × + 1 000), some 42 MB, on every node. +* **What it doesn't bound.** What reaches a node within others' histories (statements + past a limit, writers past theirs, a change that holds a million operations) is held + until a remake; a remake of an epoch, and every other a party commits of it, costs + every node a snapshot (what is not promised). + +What was measured, for a year of a hundred nodes stamping daily (36 500 changes): 23 +MB of heap where the nodes keep their writers, 112 MB where each starts one every 90 +days, 832 MB where each starts one a week, 491 MB with a writer for every change; one +user's 1 024 writers beside them, 143 MB more *(measured upstream)*. The remake numbers +recommended keep an epoch well below the second. + +What is assumed cheap, and is to be measured as it is built (What was checked): +judging a change that says it saw little, resolving as the node goes, the digest with +every stamp, the lengths watched, the snapshot at a registry's size. + +For the registry: a hundred nodes and a few thousand hosts make statements and values +of some MB, and a snapshot of as much; their stamps alone fill `remakeChanges` in about +a hundred days, and a remake follows. + ## Why it holds **Promise 1**, by how a change is judged: every node judges a change before applying |
