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

CLPR-4.5: Gossip-based peer discovery and reciprocity selection

Open
#24,538 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
407
Forks
226
Avg merge
3d 4h
Merged PRs (30d)
210

Description

Story CLPR-4.5: Gossip-Based Peer Discovery and Reciprocity Selection

Parent Epic: CLPR-4: Hiero Endpoint

Objective

Implement the off-chain gossip-based peer endpoint discovery protocol and reciprocity-based peer selection.

Acceptance Criteria
  • AC-1: On startup, the endpoint module reads seed endpoints from the peer's ClprLedgerConfiguration (obtained during connection registration and updated via ConfigUpdate).
  • AC-2: Endpoint contacts seed endpoints via discoverEndpoints RPC to learn about additional peer endpoints.
  • AC-3: Through iterative discovery, endpoints converge on a view of the peer network.
  • AC-4: Discovered peer data is ephemeral (in-memory, not persisted to the Merkle tree). Resets on restart (re-bootstraps from seed endpoints).
  • AC-5: Discovery responses are throttled (configurable rate limit per caller, e.g., 1 request/minute/IP).
  • AC-6: Reciprocity scoring: peers that provide bundles with messages during sync get a reputation bonus. Peers that only request messages without providing any get deprioritized.
  • AC-7: Freeloading cannot be faked — providing a valid bundle with messages requires having actual messages to send.
  • AC-8: When the active consensus roster changes, the endpoint count is updated for per-endpoint throttle calculation.
Notes
  • Replaces the old model where peer endpoint data was stored in PEER_ENDPOINT_ROSTERS state and propagated via EndpointJoin/EndpointLeave control messages.
  • The new model avoids O(N × M) gas cost of propagating endpoint changes across N endpoints and M connections.
  • No authentication is required for discovery — if a peer provides false endpoint info, the worst outcome is wasted connection attempts.
Dependencies
  • CLPR-4.1 (gRPC server — hosts discoverEndpoints RPC)
  • CLPR-4.3 (sync orchestration — uses discovered peers)
  • CLPR-1.4 (Connection with verified peer config containing seed endpoints)
Risk

Medium — Gossip convergence. Discovery throttling. Reciprocity scoring calibration.

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 the discoverEndpoints RPC dependency, then trace ClprLedgerConfiguration from connection registration and ConfigUpdate into the sync orchestration described in the dependencies. Review how the active consensus roster supplies the endpoint count for throttling. Done means satisfying AC-1 through AC-8, including ephemeral iterative discovery, rate limiting, reciprocity scoring, and roster-aware throttle updates.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, java
Domain
backend-api-design, distributed-systems, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.