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

Newly created accounts should not be looked up on disk

Open
#13,872 1 comment 0 reactions 0 assignees View on GitHub
Performance
Dominant language
Java
Stars
406
Forks
226
Avg merge
3d 4h
Merged PRs (30d)
210

Description

### Problem

`StakingRewardsHandlerImpl.getStakedToMeRewardReceivers()` calls `getOriginalValue(id)` for all accounts modified in the current transactions. If the transaction creates a new account, that new account will be found neither in `ReadableKVStateBase`'s cache nor by `readFromDataSource(id)`. The latter, however, involves a disk read which is expensive. At high TPS and large scale it takes ~50% of transaction handling.

### Solution

Add newly created accounts to `ReadableKVStateBase`'s cache?
Avoid that code path for newly created accounts?

### Alternatives

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing StakingRewardsHandlerImpl.getStakedToMeRewardReceivers() and its getOriginalValue(id) calls into ReadableKVStateBase. Determine how newly created accounts are represented during the current transaction, then verify that those accounts no longer trigger readFromDataSource(id) while existing-account lookups retain their behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, databases, performance
Issue type
Bug
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.