hiero-ledger / hiero-ledger/hiero-consensus-node
Estimated virtual map size for NFTs and token rels needs to be adjusted
- Dominant language
- Java
- Stars
- 406
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
With data on disk, accounts, NFTs, and token rels are all stored in virtual maps. When the maps are initially created (during migration), size estimation is provided for each map:
```java
private static final long MAX_ACCOUNTS = 100_000_000L;
private static final long MAX_TOKEN_RELS = 100_000_000L;
private static final long MAX_MINTABLE_NFTS = 500_000_000L;
```
These numbers do not look right. For example, number of token rels is expected to be much higher than the number of NFTs.
At MerkleDb level, virtual map estimation is used to calculate the number of object key buckets. With the sizes above, there aren't many buckets for token rels, which implies a lot of collision (lots of keys with similar hash codes) in every bucket, which hurts performance.
Contributor guide
Assessment
This issue has not been assessed yet.