6. Peers compare heads, not content
Two peers with the same heads for every object hold the same data, so sync compares heads over hashed ranges and fetches only what differs; local writes stream at once.

6. Peers compare heads, not content

Two peers with the same heads for every object hold the same data, so sync compares heads over hashed ranges and fetches only what differs; local writes stream at once.

It is why a device can be gone for a month and resync cheaply.

Two peers want to know if they hold the same data. They do not compare the data.

They compare heads. For every object, the ids of its tips. Same heads everywhere means same data everywhere.

A head-sync round is a diff. The list is hashed in ranges. Both sides compare range hashes. Only the ranges that differ get opened.

That finds the objects that are new, changed, or missing. Then only those envelopes are fetched.

Local writes do not wait for a round. A new envelope is streamed at once, to the post office and to peers on the same network.

The round is the catch-up. About every thirty seconds, and on demand. A device gone for a month comes back with nothing but heads to compare.

Check yourself. What does a head-sync round send when nothing changed?

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Comments