hedera-services
hedera-services copied to clipboard
Flush virtual node cache to disk before a snapshot is taken
State snapshots include snapshots of all virtual maps. Every virtual map has two parts in a snapshot:
- data source (MerkleDb) snapshot, which includes all data files and indices
- node cache snapshot, which is a part of the main
SignedState.swh
file
The cache is serialized using SelfSerializable
mechanism. What exactly is stored to the state file is not well specified, it's just some binary data. When state snapshots are changed to be in protobuf format, it will become an issue. One option is to have a well defined protobuf schema for node cache, but even better would be not to serialize the cache at all.
To do that, the cache must be flushed to disk before a snapshot is taken.