hiero-ledger / hiero-ledger/hiero-consensus-node
`0.0.0` can mean things different than `MISSING_ENTITY_ID`
- Dominant language
- Java
- Stars
- 406
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
`EntityId` defines a public constant [`MISSING_ENTITY_ID`](https://github.com/hashgraph/hedera-services/blob/7c4c4e32e3427afe596b0b35a16e6106adb03644/hedera-node/hedera-mono-service/src/main/java/com/hedera/node/app/service/mono/state/submerkle/EntityId.java#L51) `==` `0.0.0` which is used anywhere `0.0.0` is checked for or expected - even in cases where _semantically_ it is not a "missing entity id" but something else.
E.g., for unique NFTs, if the owner account is `0.0.0` that means that token is owned by the treasury account.
(There's also a single use of the name `REMOVED_TOKEN` for `0.0.0` in [`StateView`](https://github.com/hashgraph/hedera-services/blob/7c4c4e32e3427afe596b0b35a16e6106adb03644/hedera-node/hedera-mono-service/src/main/java/com/hedera/node/app/service/mono/context/primitives/StateView.java#L746)
The suggestion here is to add a second constant to `EntityId`, `OWNED_BY_TREASURY_ACCOUNT`, with the same `0.0.0` value, so that it can be used to distinguish, for the code reader, this special meaning.
And then at the same time figure out if there are _other_ semantic meanings for `0.0.0` that should be given names as well.
Contributor guide
Research direction
Start with EntityId.java, especially the MISSING_ENTITY_ID declaration, and StateView.java around the REMOVED_TOKEN use. Search Java usages of 0.0.0 and MISSING_ENTITY_ID to identify contexts with distinct semantics. Done means the treasury-owned meaning has an explicit name and other distinct meanings are assessed and named where appropriate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- blockchain
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100