hiero-ledger / hiero-ledger/hiero-consensus-node
Entity IDs in stream output should be valid
- Dominant language
- Java
- Stars
- 407
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
### Background
The mirror node encountered an issue in testnet that it had to workaround with an invalid entity ID appearing in the `TransactionRecord`. It would be better if consensus nodes respected the invariant that all data in the stream output is valid.
### Acceptance Criteria
1. Any entity ID in `TransactionRecord` should be valid.
2. Any entity ID in block item outputs should be valid.
3. The definition of "valid" could be as strict as "exists in state", but is probably more performant to just consider "Don't imply a 0.0.X entity exists when X is above highest used entity number"
### Dependencies
_No response_
### Definition of Ready (DoR) Checklist
- [ ] Clear acceptance criteria
- [ ] Clear and detailed description
- [ ] Dependencies identified
- [ ] Links to documentation
- [ ] Should be completable in 2-3 Days
- [ ] Initial draft of Low-level design document
- [ ] At least high level test plan
- [ ] Groomed/Estimated
### Definition of Done (DoD) Checklist
- [ ] Acceptance Criteria complete
- [ ] No Codacy issues greater than minor (in new code)
- [ ] JavaDocs updated/created
- [ ] Code commented
- [ ] Unit tests created/updated
- [ ] 80% test code coverage (in new code)
- [ ] Happy Path and major negative cases in HAPI tests as applicable
Contributor guide
Research direction
Start by tracing where TransactionRecord and block item stream outputs are produced and how entity IDs are represented or validated. Review existing tests around these outputs and define the highest-used-entity boundary. Done means every entity ID in both output types satisfies the agreed validity rule, with unit tests covering invalid IDs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100