aboutsummaryrefslogtreecommitdiffstats
path: root/src/ark
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-02 17:30:19 -0700
committerAdam Soltys <[email protected]>2026-09-02 17:30:19 -0700
commitdc42daaf139685aac3421a3aa8386893ff872d8b (patch)
tree8b5e9e0ab599efd384db0ecb74387f708cd7b576 /src/ark
parent11a7919939f30318c6f2bf81058e57e2bb604b67 (diff)
downloadcoinosv3-dc42daaf139685aac3421a3aa8386893ff872d8b.tar.gz
coinosv3-dc42daaf139685aac3421a3aa8386893ff872d8b.zip
The 200ms of secp256k1 hiding in every repaint: the depth advisory priced a full uncooperative exit — every hop of every coin, an EC tweak per hop — on each wallet render; the estimate now memoizes on coin set + feerate, and decoded vtxos cache by id (bytes are immutable). Profiled on a real phone: point add/double/wNAF was 1.3s of a 4.3s six-tab-switch trace
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr
Diffstat (limited to 'src/ark')
-rw-r--r--src/ark/manager.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/ark/manager.js b/src/ark/manager.js
index 9731dd6..a190480 100644
--- a/src/ark/manager.js
+++ b/src/ark/manager.js
@@ -187,7 +187,16 @@ export class ArkManager {
});
return true;
}
- _decoded(v) { return decodeVtxo(hex.decode(v.bytes)); }
+ _decoded(v) {
+ // vtxo bytes are immutable per id — parse once. The depth advisory and
+ // fee estimates decode every coin on every render without this.
+ const hit = this._decodeCache && this._decodeCache.get(v.id);
+ if (hit) return hit;
+ const d = decodeVtxo(hex.decode(v.bytes));
+ (this._decodeCache ||= new Map()).set(v.id, d);
+ if (this._decodeCache.size > 200) this._decodeCache.delete(this._decodeCache.keys().next().value);
+ return d;
+ }
// ---- chain adapter (esplora REST, same API the wallet already speaks) ----
//