hiero-ledger / hiero-ledger/hiero-consensus-node
CLPR-3.3: Connector Authorization and Application Dispatch
- Dominant language
- Java
- Stars
- 406
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
## Story CLPR-3.3: Connector Authorization and Application Dispatch
**Parent Epic:** CLPR-3: Payment & Routing Layer
**Repo:** hiero-ledger/hiero-consensus-node
### Objective
Implement Connector authorization during `sendMessage` and application dispatch during `submitBundle` data message processing, per Hiero impl spec §6 and §7.
### Acceptance Criteria
**Authorization (source side, during sendMessage):**
- **AC-1:** Call `IClprConnectorAuth.authorizeMessage(sender, targetApplication, messageSize, messageData)` via `dispatchChildTransaction(ContractCallTransactionBody)`. Read-only call.
- **AC-2:** Returns `false` or reverts → reject message.
**Application dispatch (destination side, during submitBundle):**
- **AC-3:** Resolve Connector via cross-chain index: `(connection_id, ClprMessage.connector_id)` → local Connector.
- **AC-4:** Connector not found → `CONNECTOR_NOT_FOUND` response. Endpoint absorbs cost.
- **AC-5:** Connector underfunded (`balance < execution_cost + margin`) → `CONNECTOR_UNDERFUNDED` response. Slash (CLPR-3.4).
- **AC-6:** Charge Connector: deduct `execution_cost + margin` from `balance`. Margin reimburses submitting endpoint.
- **AC-7:** Dispatch: `ContractCallTransactionBody` to `target_application` calling `onClprMessage(connectionId, sender, messageData)` with gas limit `max_gas_per_message`.
- **AC-8:** Child transaction context: app revert → state changes rolled back, CLPR state (charge, response) retained.
- **AC-9:** Success → `SUCCESS` response with returned data. Revert → `APPLICATION_ERROR` with empty data.
- **AC-10:** Response enqueued in outbound queue (extends running hash).
- **AC-11:** Black-box tests: authorized, unauthorized, successful dispatch, app revert → APPLICATION_ERROR, connector not found, connector underfunded, charge correct, endpoint reimbursed, child transaction isolation
### Dependencies
- CLPR-2.2 (SendMessage — authorization point)
- CLPR-2.3 (SubmitBundle — dispatch point)
- CLPR-3.2 (Connector exists)
### Risk
**High** — EVM contract dispatch, child transaction isolation, fund transfer all intersect.
Contributor guide
Research direction
Start by reading the CLPR-2.2, CLPR-2.3, and CLPR-3.2 dependency issues alongside Hiero implementation specification sections 6 and 7. Trace the authorization and dispatch points described in the acceptance criteria, then verify completion with black-box coverage for authorization, dispatch, errors, charging, reimbursement, and child-transaction isolation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design, blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100