hiero-ledger / hiero-ledger/hiero-consensus-node

Redundant genesis state is created even if a node is started from a snapshot

Open
#26,549 0 comments 0 reactions 1 assignee Claimed by @imalygin View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.