Files
Jordan Hrycajandjordan 36e75fb4f1 Snap2 sync update download modules (#4708)
* Fix accounts coverage accounting cache DB error

why
  This must not be cached in memory while BALs are applied.
  Processing BALs might need to modify the coverage. So if at
  all, memory caching book keeping should only be done at DB
  level.

* Update accounts coverage accounting on cache DB

why
  Due to multi/quasi-parallel access, coverage must only be stored
  on the cache DB if peers are synced (i.e. no locked ranges.) This
  sync state is enforced with the `SnapDownloadFinish` state.

* Clarify storage and accounting for storage sub-MPTs

why
  There were no rigorous rules in a single place. Rules for handling
  storage sub-MPT have been composed in a `README.md` file.

  At the end of an accounts/storage download cycle, partial storage
  sub-MPTs are currently deleted.

  The BAL forwarding of storage sub-MPTs das been simplified.

* Refactor download source, prefer partial storage sub-MPTs download first

why
  Currently, at the end of an accounts/storage download cycle, partially
  processed storage sub-MPTs are deleted before BALs are be applied.

  This patch tries to reduce the number of partially processed storage
  sub-MPT. So there is less redundant download and rebuild after a
  BAL cycle to forward the state.

* Refactor cache download, modelled after (simplified) storage download

* Update FSA updater to detect completed data set

* Refactor statistics logging tool

why
  Fix some error and add a `smart` mode which does some rudimentary
  cache DB checks, and suppresses redundant output (due to checks.)

* Code cosmetics, comments update, small fixes and updates

---------

Co-authored-by: jordan <jordan@dry.pudding>
2026-08-29 11:58:05 +00:00
..
2026-08-21 06:22:53 +07:00