mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2026-08-31 00:41:19 +00:00
* 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>