hiero-ledger / hiero-ledger/hiero-consensus-node
Use PBJ code generator for MerkleDb metadata messages
- Dominant language
- Java
- Stars
- 406
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
This is a follow-up for https://github.com/hashgraph/hedera-services/issues/9722. In that fix, several metadata files were changed to use protobuf format: MerkleDb (database) metadata, MerkleDbDataSource (data source) metadata, data file collection metadata. Code to serialize and deserialize these objects is hand-written, with all PBJ field definitions provided manually as class constants.
The next step would be to leverage PBJ code generator for this purpose, similar to what Hedera Services do. The idea is to have a number of .proto files in resources, which are used in build time to generate PBJ classes (as Java records). These classes will provide all necessary methods: serialize, deserialize, size in bytes, hash code, equals, etc. The methods will then be used by MerkleDb to work with metadata objects.
Contributor guide
Research direction
Start by locating the MerkleDb, MerkleDbDataSource, and data file collection metadata code, then review how their manually defined PBJ fields serialize and deserialize objects. Identify the build-time resources and generation setup used for similar Hedera Services code. Done means the metadata uses .proto resources to generate PBJ Java records and MerkleDb relies on those generated methods.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100