OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-overlay commits / 6c58321

overlay-replicator: diagnostic logging on the sync path
Concise console logs on send/recv delta, reconcile summary, and pull — to characterize why prod record files don't converge between two connected hpp nodes (leaseHolder proves the StateBase swarm connects them; the file-sync side is the unknown). Bump 0.3.6. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
6c583210afac41a39bf85ca391608d4b0cdcd3c1
by plankatron <fleeky@gmail.com> · 2026-07-19T22:03:32.000Z

Changed files (3) +7 -5

lib/overlay-replicator.js +4 -2
……@@ -55,6 +55,7 @@ export async function attachReplication (overlay, conn, { strategy = 'newest-win
5555 const r = await overlay.fetchFile(remote.hash, { destPath: disk })
5656 if (!r) throw new Error('attachReplication: content fetch failed for ' + remote.hash)
5757 await overlay.registerFile(overlayPath, disk, { contentHash: remote.hash, size: remote.size, rev: remote.rev })
58 try { console.log(JSON.stringify({ msg: 'overlay-repl pull', path: overlayPath, hash: String(remote.hash).slice(0, 12) })) } catch {}
5859 }
5960 const remove = async (overlayPath) => {
6061 try { fs.unlinkSync(diskFor(overlayPath)) } catch {}
……@@ -68,7 +69,7 @@ export async function attachReplication (overlay, conn, { strategy = 'newest-win
6869 if (!peerKey) return
6970 if (running) { again = true; return } // coalesce concurrent triggers; re-run once if one arrived mid-flight
7071 running = true
71 try { const s = await reconcile(engine, peerKey, { strategy, pull, remove }); if (onConverge) onConverge(s) } catch {}
72 try { const s = await reconcile(engine, peerKey, { strategy, pull, remove }); try { console.log(JSON.stringify({ msg: 'overlay-repl reconcile', peer: String(peerKey).slice(0, 12), pulled: s && s.pulled, removed: s && s.removed, pushed: s && s.pushed, skipped: s && s.skipped, conflicts: s && s.conflicts, failed: s && s.failed && s.failed.length })) } catch {}; if (onConverge) onConverge(s) } catch (e) { try { console.log(JSON.stringify({ msg: 'overlay-repl reconcile ERR', error: e && e.message })) } catch {} }
7273 finally { running = false; if (again) { again = false; runReconcile() } }
7374 }
7475
……@@ -79,6 +80,7 @@ export async function attachReplication (overlay, conn, { strategy = 'newest-win
7980 onmessage: async (data) => {
8081 if (!data || !Array.isArray(data.entries)) return
8182 if (!peerKey && data.feedKey) { peerKey = String(data.feedKey); engine._peerFeeds.set(peerKey, peer) }
83 try { console.log(JSON.stringify({ msg: 'overlay-repl recv', peer: String(peerKey).slice(0, 12), entries: data.entries.length })) } catch {}
8284 for (const e of data.entries) peer.add(e)
8385 await runReconcile()
8486 }
……@@ -94,7 +96,7 @@ export async function attachReplication (overlay, conn, { strategy = 'newest-win
9496 const entries = []
9597 for (let i = sentLen; i < end; i++) entries.push(await engine.feed.get(i))
9698 sentLen = end
97 try { msg.send({ feedKey: engine.feedKey, entries }) } catch {}
99 try { msg.send({ feedKey: engine.feedKey, entries }); console.log(JSON.stringify({ msg: 'overlay-repl send', entries: entries.length, feedKey: String(engine.feedKey).slice(0, 12) })) } catch (e) { try { console.log(JSON.stringify({ msg: 'overlay-repl send ERR', error: e && e.message })) } catch {} }
98100 }
99101 await sendDelta()
100102 const onAppend = () => { sendDelta().catch(() => {}) }
package-lock.json +2 -2
……@@ -1,12 +1,12 @@
11{
22 "name": "hyper-overlay",
3 "version": "0.3.1",
3 "version": "0.3.2",
44 "lockfileVersion": 3,
55 "requires": true,
66 "packages": {
77 "": {
88 "name": "hyper-overlay",
9 "version": "0.3.1",
9 "version": "0.3.2",
1010 "license": "AGPL-3.0",
1111 "dependencies": {
1212 "b4a": "^1.0.0",
package.json +1 -1
……@@ -1,6 +1,6 @@
11{
22 "name": "hyper-overlay",
3 "version": "0.3.5",
3 "version": "0.3.6",
44 "description": "Content-addressed P2P file distribution over Protomux \u2014 FastCDC chunking, multi-source fetch, resumable transfers, zero blob duplication. Files live on disk; the overlay is a thin index and transfer protocol.",
55 "type": "module",
66 "main": "index.js",