hiero-ledger / hiero-ledger/hiero-consensus-node
Asserts: consensus-ratio and stale-ratio
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 407
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
The consensus ratio is defined as: #events that reached consensus / #total events
The stale ratio is defined as: #stale events / #total events
We need to be able to define assertions on these ratios, e.g.
consensus ratio is within [0.9 - 0.05 * #nodes, 1.0]
stale ratio within [0.0, 0.01]
The current implementation can be found in OutputEventRatioValidation.
API proposal:
Add SingleNodeConsensusResult.consensusRatio() and SingleNodeConsensusResult.staleRatio(). This would allow assertions like:
assertThat(node.getConsensusResult().consensusRatio()).isBetween(0.9, 1.0);
assertThat(node.getConsensusResult().staleRatio()).isBetween(0.0, 0.01);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with OutputEventRatioValidation in platform-sdk/swirlds-platform-core/src/testFixtures/java/com/swirlds/platform/test/fixtures/consensus/framework/validation/OutputEventRatioValidation.java, then locate SingleNodeConsensusResult. Add consensusRatio() and staleRatio() so assertions can check the stated bounds, and verify the existing ratio definitions against the consensus and stale event counts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems, testing-qa
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100