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

create WritableFreezeStore for SwirldDualState data

Open
#6,265 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
406
Forks
226
Avg merge
3d 4h
Merged PRs (30d)
210

Description

### Problem

FreezeService.handle needs access to SwirldDualState in order to read and write the freezeTime. SwirldDualState is currently not accessible from the modularized codebase.

### Solution

Create a WritableFreezeStore class. It should be a wrapper around the DualState interface. It will have freezeTime and lastFrozenTime fields getters/setters. It receives a DualState when it's constructed and it just calls through.

We only need a WritableFreezeStore, not a ReadableFreezeStore, because preHandle does not need access to this data, only handle. However we might want to create a ReadableFreezeStore for consistency with the other stores.

Create this store interface in the spi module. Unlike other stores, it is not defined as part of a module but defined as part of an spi. Any service could use this but they shouldn't, only FreezeService needs it. Implementation rests with HederaApp, not in a module. It's up to HederaApp to make sure that it's on the right version of the merkle tree.

Relies on issue #4211 before FreezeService can access this new store from outside its module.

### Alternatives

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reading the DualState interface, FreezeService.handle, the spi module, and HederaApp, while checking the dependency on issue #4211. Define the WritableFreezeStore in spi with delegated freezeTime and lastFrozenTime access, then ensure HederaApp supplies the appropriate DualState version for FreezeService.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.