-
Notifications
You must be signed in to change notification settings - Fork 67
[Advanced]: Implement HIP-1137 — Block Node discoverability via on-chain registry #1206
Description
🧠 Advanced
This issue is well-suited for contributors who are very familiar with the Hiero C++ SDK and enjoy working with its core abstractions and design patterns.
Advanced Issues often involve:
- Exploring and shaping SDK architecture
- Reasoning about trade-offs and long-term impact
- Working across multiple modules or systems
- Updating tests, examples, and documentation alongside code
The goal is to support thoughtful, high-impact contributions in a clear and collaborative way.
🐞 Problem Description
The Hiero C++ SDK does not currently support the registered node registry introduced by HIP-1137. This means SDK users cannot create, update, delete, or discover Block Nodes (or other registered node types such as mirror nodes and RPC relays) via on-chain data.
HIP-1137 adds three new transactions to the AddressBookService and extends several existing types. Without SDK support, developers must resort to raw protobuf construction to interact with the registered node registry — an experience that undermines the purpose of a typed, ergonomic SDK.
Key gaps:
- No
RegisteredNodeCreateTransaction,RegisteredNodeUpdateTransaction, orRegisteredNodeDeleteTransactionclasses - No
RegisteredServiceEndpointhierarchy (BlockNodeServiceEndpoint,MirrorNodeServiceEndpoint,RpcRelayServiceEndpoint) - No
BlockNodeApienum TransactionReceiptdoes not expose theregisteredNodeIdfieldNodeCreateTransactionandNodeUpdateTransactiondo not support the newassociatedRegisteredNodesfield- No
RegisteredNode,RegisteredNodeAddressBook, orRegisteredNodeAddressBookQuerytypes
💡 Proposed / Expected Outcome
Implement full SDK support for HIP-1137 following the SDK design document and the patterns already established in the codebase for consensus node transactions (NodeCreateTransaction, NodeUpdateTransaction, NodeDeleteTransaction).
The implementation should deliver:
New transaction types
RegisteredNodeCreateTransaction— creates a registered node with anadminKey, optionaldescription, optionalnodeAccountId, and a list of service endpoints (1–50). On success the receipt contains the network-assignedregisteredNodeId.RegisteredNodeUpdateTransaction— updates an existing registered node byregisteredNodeId. Supports changingadminKey(requires both old and new key signatures),description,nodeAccountId, and replacing the service endpoint list.RegisteredNodeDeleteTransaction— removes a registered node byregisteredNodeId. Must be signed by the node'sadminKeyor authorized by network governance.
All three transactions must be schedulable via ScheduleCreateTransaction.
New data types
BlockNodeApienum —OTHER,STATUS,PUBLISH,SUBSCRIBE_STREAM,STATE_PROOF.RegisteredServiceEndpoint— abstract base withipAddress(bytes) ordomainName(string),port, andrequiresTls. Three concrete subtypes:BlockNodeServiceEndpoint— addsendpointApi: BlockNodeApiMirrorNodeServiceEndpoint— empty subtype (future-proofing)RpcRelayServiceEndpoint— empty subtype (future-proofing)
RegisteredNode— immutable representation of a registered node as stored in network state.RegisteredNodeAddressBook— collection ofRegisteredNodeobjects.
New query type
RegisteredNodeAddressBookQuery— queries the mirror node for registered nodes and returns aRegisteredNodeAddressBook. Implementation should be deferred until the mirror node API is available, but the class skeleton should be defined.
Updates to existing types
TransactionReceipt— add nullableregisteredNodeId: uint64field.NodeCreateTransaction— addassociatedRegisteredNodes: list<uint64>andaddAssociatedRegisteredNode(uint64).NodeUpdateTransaction— add nullableassociatedRegisteredNodes: list<uint64>,
addAssociatedRegisteredNode(uint64), andclearAssociatedRegisteredNodes(). The protobuf uses a wrapper message for three-state semantics (not set / empty list / non-empty list).
Wiring
- Add
RegisteredNodeCreate,RegisteredNodeUpdate,RegisteredNodeDeleteto theTransactionTypeenum. - Register the new transaction types in the
Transaction.ccdispatch switch and add them toWrappedTransaction's variant. - Map to protobuf
DataCasevalues (kRegisteredNodeCreate,kRegisteredNodeUpdate,kRegisteredNodeDelete) and schedulable body fields.
🧠 Implementation & Design Notes
Patterns to follow
The existing NodeCreateTransaction / NodeUpdateTransaction / NodeDeleteTransaction implementations serve as the primary reference. Each new registered node transaction should follow the same CRTP pattern:
class RegisteredNodeCreateTransaction : public Transaction<RegisteredNodeCreateTransaction>Key methods to implement per transaction:
addToBody(proto::TransactionBody&)— set the allocated protobuf bodyinitFromSourceTransactionBody()— deserialize from protobufbuild()— construct and return the protobuf transaction bodysubmitRequest()— submit using the correctDataCase
Endpoint hierarchy
The design document specifies an inheritance-based endpoint hierarchy. In C++ this maps to:
- A base
RegisteredServiceEndpointclass (or struct) holding the shared fields (ipAddress,domainName,port,requiresTls) - Derived
BlockNodeServiceEndpointaddingBlockNodeApi endpointApi - Derived
MirrorNodeServiceEndpointandRpcRelayServiceEndpointas currently empty subtypes
Each subtype needs fromProtobuf() / toProtobuf() round-trip support, following the pattern in Endpoint.h / Endpoint.cc.
Key files to modify or create
New headers and sources (under src/sdk/main/include/ and src/sdk/main/src/):
RegisteredNodeCreateTransaction.h/.ccRegisteredNodeUpdateTransaction.h/.ccRegisteredNodeDeleteTransaction.h/.ccRegisteredServiceEndpoint.h/.ccBlockNodeServiceEndpoint.h/.ccMirrorNodeServiceEndpoint.h/.ccRpcRelayServiceEndpoint.h/.ccBlockNodeApi.hRegisteredNode.h/.ccRegisteredNodeAddressBook.h/.ccRegisteredNodeAddressBookQuery.h/.cc
Existing files to update:
TransactionReceipt.h/.cc— addregisteredNodeIdNodeCreateTransaction.h/.cc— addassociatedRegisteredNodesNodeUpdateTransaction.h/.cc— addassociatedRegisteredNodeswith
three-state wrapper semanticsTransactionType.h— add enum valuesTransaction.cc— register new types in theDataCaseswitchWrappedTransaction.h— add new types to the variant- CMake build files — add new source/header files
Protobuf dependencies
The implementation depends on new protobuf definitions from HIP-1137. Ensure the proto submodule or dependency includes:
registered_node_create.protoregistered_node_update.protoregistered_node_delete.protoregistered_service_endpoint.proto(or equivalent)- Updated
transaction_body.proto(fields 78–80) - Updated
schedulable_transaction_body.proto(fields 49–51) - Updated
transaction_receipt.proto(field 16)
Testing strategy
- Unit tests — verify serialization round-trips (
fromProtobuf/toProtobuf) for all new types, field validation (e.g. endpoint list bounds), and getter/setter correctness. - Integration tests — execute the full registered node lifecycle against a test network:
- Create a registered node with various endpoint types and verify the receipt contains a
registeredNodeId - Update the node's description, endpoints, and admin key
- Associate a registered node with a consensus node
- Delete the registered node
- Verify failure cases (missing admin key, empty endpoints, non-existent node ID, already-deleted node)
- Create a registered node with various endpoint types and verify the receipt contains a
- TCK alignment — corresponding test cases should be defined in the TCK repository per the design document's 18-point test plan.
Schedulability
All three transactions must be schedulable. The SDK already has internal machinery for this — ensure each new transaction is included in SchedulableTransactionBody handling.
Response codes
HIP-1137 does not define new response codes at this time. If consensus node implementation introduces registered-node-specific response codes, the SDK's retry logic should be evaluated and updated.
✅ Acceptance Criteria
A pull request for this issue should:
- Implement
RegisteredNodeCreateTransaction,RegisteredNodeUpdateTransaction, andRegisteredNodeDeleteTransactionfollowing existing transaction patterns - Implement the
RegisteredServiceEndpointhierarchy (BlockNodeServiceEndpoint,MirrorNodeServiceEndpoint,RpcRelayServiceEndpoint) and theBlockNodeApienum - Implement
RegisteredNodeandRegisteredNodeAddressBookdata types - Define the
RegisteredNodeAddressBookQueryclass skeleton - Update
TransactionReceiptto exposeregisteredNodeId - Update
NodeCreateTransactionandNodeUpdateTransactionwithassociatedRegisteredNodessupport - Register new transaction types in
TransactionType,Transaction.ccdispatch, andWrappedTransactionvariant - Ensure all three new transactions are schedulable
- Include unit tests for serialization, field validation, and getter/setter correctness
- Include integration tests covering the registered node lifecycle (create, update, associate, delete, and failure cases)
- Maintain backwards compatibility with existing APIs
- Follow existing C++ conventions and architectural patterns
- Pass all CI checks
📚 Additional Context, Links, or Prior Art
- HIP-1137 specification: https://github.com/hiero-ledger/hiero-improvement-proposals/blob/main/HIP/hip-1137.md
- SDK design document: https://github.com/hiero-ledger/sdk-collaboration-hub/blob/hip-1137/proposals/hips/hip-1137.md
- HIP discussion: HIP-1137: Block Node Discoverability hiero-improvement-proposals#1137
- Existing consensus node transaction patterns (reference implementation):
src/sdk/main/include/NodeCreateTransaction.hsrc/sdk/main/include/NodeUpdateTransaction.hsrc/sdk/main/include/NodeDeleteTransaction.h
- Existing endpoint pattern:
src/sdk/main/include/Endpoint.h
- Advanced issue guidelines: https://github.com/hiero-ledger/hiero-sdk-cpp/blob/main/docs/maintainers/guidelines-advanced-issues.md