hiero-ledger / hiero-ledger/hiero-consensus-node
Execution should decide which state snapshots are saved to disk
- Dominant language
- Java
- Stars
- 406
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
Currently, if the all the nodes in the network crash at the same time the record stream can break. This is due to the fact that record stream files are not aligned with state snapshots. By moving the decision on which snapshots go to disk to execution, this gives them an opportunity to close record files at those boundaries and align them to state snapshots.
Tasks for the consensus team:
- Add an interface by which execution can tell consensus to save a snapshot to disk at the end of a round. Probably this should be done by modifying`ConsensusStateEventHandler.onSealConsensusRound()`
- Create a mechanism by which this will propagate this information to the component that writes states to disk
- Add a config value that switches the state saving mechanism from the current one, to the new one
- Once this has been migrated, remove the old code that decides which state go to disk
Contributor guide
Research direction
Start with ConsensusStateEventHandler.onSealConsensusRound() and trace how its events reach the component that writes states to disk. Review the current state-saving decision and configuration, then map the migration tasks: execution-driven end-of-round decisions, propagation to disk writing, a switch for the new mechanism, and removal of the old decision path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100