hiero-ledger / hiero-ledger/hiero-consensus-node

Asserts: consensus-ratio and stale-ratio

Open
#19,186 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Otter
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.