You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(platform-wallet): bound the load-time history replay #5962
TL;DR: Opening a wallet replays its whole stored transaction history with no size limit, so a wallet that has received many transactions can take a lot of memory and time before it becomes usable.
User story
As a wallet user, I want my wallet to open in bounded time and memory however much history it has, to keep using the app after receiving many transactions.
Scenario
Base flow
A wallet built on the history replay of #5220 is reopened. Anyone can grow its history by sending small, valid transactions to its monitored addresses.
Actual behavior
On load, the Swift persistence handler fetches every PersistentTransaction, filters the full table for each wallet, and hands every matching body to Rust, which clones, plans and replays them all. There is no pagination, budget, checkpoint or eviction boundary (TODO(bound-load-history-replay) in rs-platform-wallet/src/manager/history_replay.rs). Memory and CPU at startup grow with history size.
Expected behavior
Load either stays within a fixed resource budget (bounded replay with durable spend claims for older history and a checkpoint), or fails closed with a typed error when the history exceeds that budget.
Detailed discussion
Swift: PlatformWalletPersistenceHandler.swift loads all history without a limit; the FFI decoder allocates with an unchecked Vec::with_capacity.
Options: a fail-closed count/byte budget with a typed restore error (smaller, about 100-150 lines in Swift and Rust), or a resumable, checkpointed replay (larger).
Activity