near / nearcore

Reference client for NEAR Protocol
https://near.org
GNU General Public License v3.0
2.31k stars 615 forks source link

[Project tracking] Archival node database size optimizations #11827

Open tayfunelmas opened 1 month ago

tayfunelmas commented 1 month ago

For details, see this document.

The fine-granular tasks:

walnut-the-cat commented 1 week ago

Latest update from @tayfunelmas on Zulip:

There are 2 parts:

  1. For columns that are not needed in cold storage, I will start marking them as non-Cold and remove from Cold DB. As the first step to this, I am marking PartialChunks as non-Cold in #12029.
  2. For the State column, based on the assumption that archival node may not be used for RPC requests, I am thinking about storing only snapshots of State at certain intervals (eg. once per epoch). Then one can replay the chain for any block mid epoch starting from that snapshot. Note that, this will be slow and only for on-demand audit and verification purposes, not for high QPS RPC requests. Regarding how that State snapshot will look like will be depending on some experiments I need to do. For example, it could be some form of Flat state (leaves only but also with some value sharing) or full trie based on the storage each will take.
walnut-the-cat commented 1 week ago

According to SRE team, we have only ~2 months before them having to take an action to deal with ever-increasing size of archival node so this should be considered carefully