aboutsummaryrefslogtreecommitdiffstats
path: root/docs/peers.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/peers.md')
-rw-r--r--docs/peers.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/peers.md b/docs/peers.md
index 763f6aa..9118fde 100644
--- a/docs/peers.md
+++ b/docs/peers.md
@@ -313,6 +313,22 @@ says, for as long as it is fresh (two STATUS refreshes and a keepalive: 7 minute
the default keepalive), and nothing goes into the document. `GET /peers` shows it
(`localReaches`, and `reaches` per peer).
+A writer's changes pass on along its tree ([`swarm/tree.rs`](../src/swarm/tree.rs)), the same on every node:
+built on the graph the member list gives (as if every member reached every other) and
+on whom each member says it reaches. Members are ordered by their distance from the
+writer over that graph, then by key; a member's parent is the neighbour it reaches that
+comes before it, the closest to the writer first, then by pair score. Coming before
+rules out cycles; taking only one it reaches routes around links that don't work (one
+behind NAT that reaches a single member takes that one). A sync message that passes a
+writer's change on says whose; whoever applies one sends it at once to its children in
+that writer's tree, however it got it, and leaves them out of its announcement round.
+A member without a parent it reaches, or whose parent missed the change, gets it by
+announcement and pull as before, then passes it on to its own children. With every link
+working, each member gets each change once (`bench_writer_trees`: 1999 messages per
+change at 2000 members, against about 25,000 by announcements alone, at most 5 hops);
+with 5% of the links down, more than 90% get it along the tree, the rest after one or
+two announcement rounds.
+
## Keepalive and self-healing
```mermaid