| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
A gift-claimed wallet is a brand-new seed but the claim flow never
passed generated:true, so every gift wallet ground through the
indexer's full history (~336k tweaks) hunting silent payments it could
not have received — the CPU burn seen with a fresh gift wallet open.
Fresh claim wallets now fast-forward their scan watermark to the tip
like any other generated wallet. And two tabs on the same wallet no
longer duplicate a catch-up: a localStorage lease, refreshed per chunk,
lets the second tab yield.
Co-Authored-By: Claude Fable 5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An imported mainnet wallet's first scan pulled the indexer's whole
window (~336k tweaks, 25MB) and posted it to the worker as ONE message:
it blew the 30s worker timeout, fell back to the inline main-thread
loop (minutes of jank) while the worker kept grinding the orphaned
request — the runaway CPU/memory users saw. The catch-up now processes
100-block chunks: each worker call is seconds, the scan watermark
checkpoints after every chunk (an interrupted catch-up resumes instead
of restarting from zero), buffers free as it goes, and the UI yields
between chunks. Verified against the live indexer: full catch-up in
~5min of background work, main heap bounded (~80MB peak), no timeouts.
Co-Authored-By: Claude Fable 5 <[email protected]>
|
|
|
wallet.js drops from 2,374 to ~1,970 lines, holding only BIP84 on-chain
logic plus generic feature seams. New seams added this pass:
registerBalanceExtra extra confirmed/pending buckets
registerInputProvider extra spendable inputs for buildTx
registerSendPreparer destinations needing post-selection derivation
registerInputSigner non-BIP84 input signing
registerHistoryProvider / registerScanHook / registerRealtimeHook /
registerLoadHook / registerCacheExtension / registerCacheSavedHook
src/features/sp-wallet.js: the whole BIP-352 engine — key derivation,
worker-accelerated indexer scanning, the live indexer WebSocket, SP
outputs as spendable inputs, sp1 send preparation, and per-output-key
signing — installs via those seams (installSpWallet).
src/features/sync.js: nostr identity + encrypted cross-device state sync
plus its Settings card, installed via load/cache-saved/realtime hooks.
profileChip/nostrProfile move here-adjacent (into gifts, the only other
nostr consumer), so core app.js no longer imports nostr at all.
buildTx/sign are now feature-agnostic (input providers + preparers +
signers); _recomputeBalance* use the balance-extra registry, so a core
build with no SP no longer calls a missing spBalance() (that regression
dropped the minimal build into offline mode — caught by the smoke test).
New coverage: tools/sp-test.js drives two browser "devices" through an
SP send, indexer discovery, and an SP-input spend on the ark regtest
chain (needs tools/sp-indexer.js pointed at bitcoind:18543). Minimal
smoke now also asserts no SP/nostr code ships.
Minimal profile: 314KB, down from 412KB (full: 580KB). All suites green:
minimal smoke, sp-test, ark UI, gift lifecycle.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QFAcD4V284DvYZZHP7Rxxy
|