skalenetwork / skaled

Running more than 20 production blockchains, SKALED is Ethereum-compatible, high performance C++ Proof-of-Stake client, tools and libraries. Uses SKALE consensus as a blockchain consensus core. Includes dynamic Oracle. Implements file storage and retrieval as an EVM extension.
https://skale.network
GNU General Public License v3.0
86 stars 40 forks source link

Historic state directory size is 10 times more space rather than non historic blockchain data #1485

Open oleksandrSydorenkoJ opened 1 year ago

oleksandrSydorenkoJ commented 1 year ago

Describe the bug The archive node contains 2 extra directories - historic_state and historic_root, allowing get historical data from the blockchain. The mainnet difference between historic and non-historic states is 4 times (8TB for archive and 2TB for geth)

Versions: skalenetwork/schain:3.16.0-stable.3-historic

Preconditions: Active Skale chain with connected archival node The skale chain should have at least 4 million blocks and 10-12 million transactions with contract interaction (ERC20, ERC721 etc)

To Reproduce

  1. Run archive node to connected schain
  2. Wait for the archive node already syncing
  3. Check the size of the databases in skaled data_dir

Expected behavior Historic_state data-dir should be 4 times bigger rather than non-historic data as it represented on Ethereum

Actual state Historic state directory size is 10 times more space rather non-historic blockchain data

Example data-dirs size:

5.0G    blocks_and_extrass + state
1.5G    consensus blocks_N.db
0   filestorage
49M historic_roots
74G historic_state
DmytroNazarenko commented 1 year ago

@kladkogex Check and try to optimize space usage of historic state

DmytroNazarenko commented 1 year ago

Out of release 2.2 scope because it is not so critical

oleksandrSydorenkoJ commented 1 month ago

actual for 3.19.3