From ef1a901314cb667bc8a7c7ff5f080550edef2815 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 6 Jul 2026 10:44:35 -0700 Subject: Slim ark state for sync so it fits the relay's 64KB event cap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cross-device ark sync silently failed: the full snapshot (deep-genesis vtxo bytes + done-action signing hex) was ~153KB and relay.coinos.io rejects events over 64KB, so no publish ever landed and other devices never saw the balance. The synced ark state is now slimmed — spent vtxos drop their signed bytes (kept only for spendable/pending, which a device might spend/exit), done board/offboard/exit actions keep just the fields history labels need (hex stripped), in-flight actions and movements beyond the last 300 are dropped. Local storage keeps the full state; only the published copy is slim. ~150KB -> well under 64KB. Co-Authored-By: Claude Fable 5 --- src/nostr.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/nostr.js') diff --git a/src/nostr.js b/src/nostr.js index a1d6cc4..e73aa5d 100644 --- a/src/nostr.js +++ b/src/nostr.js @@ -163,9 +163,8 @@ export class NostrSync { try { const content = nip44.encrypt(JSON.stringify(stateObj), this.ck); evt = finalizeEvent({ kind: 30078, created_at: Math.floor(Date.now() / 1000), tags: [['d', dtag]], content }, this.sk); - } catch (e) { console.log('[pubdbg] finalize threw', e.message); return; } - const res = await Promise.allSettled(pool.publish(this.relays, evt)); - console.log('[pubdbg] publish', dtag, 'bytes', evt.content.length, '->', JSON.stringify(res.map((r) => r.status === 'fulfilled' ? 'ok' : ('rej:' + String(r.reason).slice(0, 80))))); + } catch { return; } + await Promise.allSettled(pool.publish(this.relays, evt)); } // Deliver an encrypted DM (a locked gift's claim code) as a NIP-17 gift wrap -- cgit v1.2.3