aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/nwc.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-01 18:08:58 -0700
committerAdam Soltys <[email protected]>2026-08-01 18:08:58 -0700
commitcbc3a5907c55c20c248fa80fa14528cb483688ad (patch)
tree85f7b815f18095ec550583bb16850ba6a6c05ce3 /src/features/nwc.js
parent711807cb81f85408451b843e1a53e9616fd6df3b (diff)
downloadcoinosv3-cbc3a5907c55c20c248fa80fa14528cb483688ad.tar.gz
coinosv3-cbc3a5907c55c20c248fa80fa14528cb483688ad.zip
Split device sync into per-domain slots with bounded, dirty-only publishes
One monolithic snapshot per device outgrew a vanilla relay's 64KB event cap the moment real payment traffic arrived, and sync silently died. Snapshots now fragment into per-domain replaceable events (core wallet, ark, nwc — an extension claims a domain by naming it), published under a new ':x:' d-tag marker that pre-split clients don't match, so they can never mistake a fragment for a full snapshot. Only domains whose content changed republish, a refused publish retries on the next save instead of being marked done, and readers apply full-snapshot semantics only to core-carrying events. The ark projection also caps its history: spent stubs at 200, done actions at 50 — the event size is bounded for life, no special relay rules required. Co-Authored-By: Claude Fable 5 <[email protected]>
Diffstat (limited to 'src/features/nwc.js')
-rw-r--r--src/features/nwc.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/features/nwc.js b/src/features/nwc.js
index c2407ee..adafb06 100644
--- a/src/features/nwc.js
+++ b/src/features/nwc.js
@@ -155,6 +155,7 @@ export function nwcFeature(ctx) {
// sync is an optional feature: a minimal build has no cache extensions
if (wallet.registerCacheExtension) wallet.registerCacheExtension({
+ domain: 'nwc', // published as its own sync slot — see splitSnapshotDomains
mergeAlways: true, // the merge is commutative, so older snapshots are fine
save: () => {
const list = (load().conns || []);