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

CLPR-1.5: Connection governance (halt, resume, close)

Open
#24,511 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
406
Forks
226
Avg merge
3d 4h
Merged PRs (30d)
210

Description

## Story CLPR-1.5: Connection Governance (Halt, Resume, Close)

**Parent Epic:** #24484 (CLPR-1: Network Layer)

### Objective

Implement the `ClprHaltConnection`, `ClprResumeConnection`, and `ClprCloseConnection` handlers.

### Acceptance Criteria

- **AC-1:** `HaltConnection` transitions ACTIVE → HALTED. Returns error if not ACTIVE.
- **AC-2:** HALTED behavior: no new outbound messages accepted. Inbound bundles still processed (acknowledgements continue flowing so the peer's queue does not stall).
- **AC-3:** `ResumeConnection` transitions HALTED → ACTIVE. Returns error if not HALTED.
- **AC-4:** `CloseConnection` transitions ACTIVE or HALTED → CLOSED. Returns error if already CLOSED.
- **AC-5:** CLOSED is terminal — no further state transitions, all processing stops.
- **AC-6:** All three handlers require the CLPR admin key.
- **AC-7:** Non-existent `connection_id` returns error.
- **AC-8:** Black-box tests: halt active, resume halted, close active, close halted, wrong-status errors, admin key enforcement, halted connection accepts inbound bundles, halted connection rejects outbound send

### Notes

- HALTED can also be triggered automatically by a response ordering violation during `submitBundle` processing (CLPR-2.4). The admin-initiated halt uses the same state.
- There is no separate PAUSED state. HALTED serves both admin-initiated suspension and protocol-triggered suspension.

### Dependencies

- #24485 (CLPR-1.1: state schema)
- #24510 (CLPR-1.4: Connection must exist)

### Risk

**Low** — Straightforward status transitions with admin key enforcement.

Contributor guide

Open the contributing guide

Research direction

Start by reading the state schema from #24485 and the connection-existence work in #24510, then trace the CLPR connection handlers and submitBundle processing. Implement the three status transitions, admin-key checks, and halted inbound/outbound behavior described in the acceptance criteria. Verify completion with black-box tests covering transitions, invalid statuses, authorization, and halted connections.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems, networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.