hiero-ledger / hiero-ledger/hiero-consensus-node
Redundant genesis state is created even if a node is started from a snapshot
Open
Performance
Platform
- Dominant language
- Java
- Stars
- 406
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
When a `VirtualMapStateLifecycleManager` instance is created, it constructs a new empty `VirtualMap` right in the constructor. This is done even if the lifecycle manager will later be used to load a state from a snapshot using `loadSnapshot()` method. The genesis state will be just thrown away in this case.
Creating a virtual map is not free. It initializes a node cache and builds a MerkleDb data source, which includes working with multiple different files. This affects node startup time. It would be better to avoid creating this extra genesis state at startup if it isn't needed.
Contributor guide
Assessment
This issue has not been assessed yet.