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

Need a test validating the notion of a the state representation

Open
#22,754 0 comments 0 reactions 1 assignee Claimed by @imalygin View on GitHub
Platform
Dominant language
Java
Stars
406
Forks
226
Avg merge
3d 4h
Merged PRs (30d)
210

Description

In the `virtual_map_state.proto` file (in the CN repo), there is an implicit notion of how the state is exactly represented in the virtual map.

The BN cannot rely on this file directly, so it must use its own definition that is binary compatible with the CN's definition. Consequently, it has to depend on this implicit notion defined in `virtual_map_state.proto`.

We need to do two things:

- Make this notion explicit (i.e., properly document it).
- Create a test that ensures the definitions in `virtual_map_state.proto` comply with the set of rules that the BN relies on.

Here are the examples of such rules:
- if a key is a singleton, it's represented as a `SingletonType` encoded as `1`, and then it's follow by a specific number for the singleton keys.
- range of `1-50` is taken by regular keys
- range `126 - 10010` is taken by queue metadata
- if a key is not a singleton and not a queue, it's encoded with `oneof` range from 2 to 54, and then followed by the encoded key object
- queue states use `126 - 10010` range.

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.