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

CLPR-3.1: Connector Wire Formats and State Schema

Open
#24,528 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-3.1: Connector Wire Formats and State Schema

**Parent Epic:** CLPR-3: Payment & Routing Layer
**Repo:** hiero-ledger/hiero-consensus-node

### Objective

Define protobuf wire formats, state stores, and system contract interface for the payment and routing layer.

### Acceptance Criteria

- **AC-1:** HAPI transaction bodies for connector operations that are also system contract methods: `ClprRegisterConnectorTransactionBody` (connection_id, source_connector_address, connector_contract (AccountID), initial_balance (uint64 tinybars), stake (uint64 tinybars), admin (AccountID, optional — defaults to payer)), `ClprTopUpConnectorTransactionBody` (connection_id, source_connector_address, amount), `ClprWithdrawConnectorBalanceTransactionBody` (connection_id, source_connector_address, amount), `ClprDeregisterConnectorTransactionBody` (connection_id, source_connector_address).
- **AC-2:** CLPR system contract Solidity interface includes corresponding methods for all four connector operations (so smart contracts can call them too).
- **AC-3:** CLPR system contract includes `getConnector(bytes32 connectionId, bytes sourceConnectorAddress)` as a `view` function. This is NOT a HAPI query.
- **AC-4:** `ClprConnector` state: `connection_id`, `source_connector_address`, `connector_contract` (AccountID), `admin` (AccountID), `balance` (uint64), `locked_stake` (uint64), `slash_count` (uint64).
- **AC-5:** State stores: `CONNECTORS` K/V (ClprConnectorKey → ClprConnector), `CONNECTOR_INDEX` K/V (ClprConnectorIndexKey → ClprConnectorKey) for cross-chain mapping.
- **AC-6:** `TransactionBody` oneof extended with all 4 connector types.
- **AC-7:** Transaction records: `ClprRegisterConnector` includes `(connection_id, source_connector_address)`.
- **AC-8:** All MATS pass.

### Notes

- `getQueueDepth` has been removed. Queue depth can be read via Mirror Node.
- `getConnector` is a system contract `view` function only, not a HAPI query.
- The only HAPI query in CLPR is `getLedgerConfiguration`.

### Dependencies

- CLPR-1.1 (extends existing types)

### Risk

**Low** — Straightforward proto additions plus system contract interface extension.

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing CLPR-1.1 types, TransactionBody and transaction-record definitions, the CLPR system contract interface, and the connector state stores. Trace how related types are represented before adding the four operations, connector state and index. Done means AC-1 through AC-7 are represented and all MATS pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, solidity
Domain
backend-api-design, blockchain, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.