hedera-mirror-node icon indicating copy to clipboard operation
hedera-mirror-node copied to clipboard

Add `DatabaseReadableKVStateBase` implementation for `ReadableKVState`

Open IvanKavaldzhiev opened this issue 6 months ago • 0 comments

Problem

In order to integrate the reusable services internal state handling with the DB layer, we should add mirror node specific implementation of the ReadableKVState interface that will hold map of specific DatabaseReadableKVState for each service. For example:

The DatabaseReadableKVState for tokens will contain:

  • AccountDatabaseReadableKVState
  • TokenDatabaseReadableKVState
  • TokenRelationshipDatabaseReadableKVState etc..

Solution

Add DatabaseReadableKVStateBase implementation, which and have a caching mechanism to keep read only access of entities that are already fetched from DB. This cache might make having a cache inside the specific DatabaseReadableKVState for a given type obsolete.

Perform unit and integration tests for all initialization types of DatabaseReadableKVStateBase, reading all types of data from DB, that will be needed. That is:

  • contract storage
  • contract bytecode
  • accounts
  • tokens ( + nfts)
  • aliases
  • token relationships
  • airdrops
  • files

Note: this task is blocked by the tasks for adding the needed ReadableKVState implementations.

Alternatives

No response

IvanKavaldzhiev avatar Sep 03 '24 07:09 IvanKavaldzhiev