-
Notifications
You must be signed in to change notification settings - Fork 236
[Advanced]: Implement HIP-1137 β Block Node discoverability via on-chain registryΒ #1911
Description
π§ Advanced
This issue is well-suited for contributors who are very familiar with the Hiero Python 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 Python 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.
Key gaps:
- No
RegisteredNodeCreateTransaction,RegisteredNodeUpdateTransaction, orRegisteredNodeDeleteTransactionclasses - No
RegisteredServiceEndpointhierarchy (BlockNodeServiceEndpoint,MirrorNodeServiceEndpoint,RpcRelayServiceEndpoint) - No
BlockNodeApienum TransactionReceiptdoes not expose theregistered_node_idfieldNodeCreateTransactionandNodeUpdateTransactiondo not support the newassociated_registered_nodesfield- 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 anadmin_key, optionaldescription, optionalnode_account_id, and a list of service endpoints (1β50). On success the receipt contains the network-assignedregistered_node_id.RegisteredNodeUpdateTransactionβ updates an existing registered node byregistered_node_id. Supports changingadmin_key(requires both old and new key signatures),description,node_account_id, and replacing the service endpoint list.RegisteredNodeDeleteTransactionβ removes a registered node byregistered_node_id. Must be signed by the node'sadmin_keyor 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 withip_address(bytes) ordomain_name(string),port, andrequires_tls. Three concrete subclasses:BlockNodeServiceEndpointβ addsendpoint_api: BlockNodeApiMirrorNodeServiceEndpointβ empty subclass (future-proofing)RpcRelayServiceEndpointβ empty subclass (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 optionalregistered_node_id: intfield.NodeCreateTransactionβ addassociated_registered_nodes: list[int]andadd_associated_registered_node(registered_node_id: int).NodeUpdateTransactionβ add optionalassociated_registered_nodes: list[int] | None,add_associated_registered_node(registered_node_id: int), andclear_associated_registered_nodes(). The protobuf uses a wrapper message for three-state semantics (not set / empty list / non-empty list).
Wiring
- Register the new transaction types in the
Transactionbody-to-class mapping (transaction/transaction.py) for deserialization. - Map to protobuf oneof cases and schedulable body fields.
π§ Implementation & Design Notes
Patterns to follow
The existing NodeCreateTransaction / NodeUpdateTransaction / NodeDeleteTransaction in src/hiero_sdk_python/nodes/ serve as the primary reference. Each new registered node transaction should follow the same class structure:
- Inherit from the base
Transactionclass - Implement
_build_transaction_body()and_from_proto()methods - Register in the body-to-class mapping in
transaction/transaction.py - Support scheduling via
ScheduleCreateTransaction
Endpoint hierarchy
The design document specifies inheritance-based endpoints. In Python this maps naturally to:
- An abstract base class
RegisteredServiceEndpointholding shared fields (ip_address,domain_name,port,requires_tls) BlockNodeServiceEndpointsubclass addingendpoint_apiMirrorNodeServiceEndpointandRpcRelayServiceEndpointas currently empty subclasses
Each subclass needs _from_proto() / _to_proto() round-trip support, following the pattern in src/hiero_sdk_python/address_book/endpoint.py.
Key files to create or modify
New files (under src/hiero_sdk_python/):
nodes/registered_node_create_transaction.pynodes/registered_node_update_transaction.pynodes/registered_node_delete_transaction.pyaddress_book/registered_service_endpoint.pyaddress_book/block_node_service_endpoint.pyaddress_book/mirror_node_service_endpoint.pyaddress_book/rpc_relay_service_endpoint.pyaddress_book/block_node_api.pyaddress_book/registered_node.pyaddress_book/registered_node_address_book.pyaddress_book/registered_node_address_book_query.py
Existing files to update:
transaction/transaction_receipt.pyβ addregistered_node_idnodes/node_create_transaction.pyβ addassociated_registered_nodesnodes/node_update_transaction.pyβ addassociated_registered_nodeswith three-state wrapper semanticstransaction/transaction.pyβ register new types in the body-to-class mapping- Package
__init__.pyfiles β export new public types
Protobuf dependencies
The implementation depends on new protobuf definitions from HIP-1137:
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 for all new types, field validation, 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
registered_node_id - 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 exposeregistered_node_id - Update
NodeCreateTransactionandNodeUpdateTransactionwithassociated_registered_nodessupport - Register new transaction types in the body-to-class mapping
- 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)
- Export all new public types from package entry points
- Maintain backwards compatibility with existing APIs
- Follow existing Python 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:
src/hiero_sdk_python/nodes/node_create_transaction.pysrc/hiero_sdk_python/nodes/node_update_transaction.pysrc/hiero_sdk_python/nodes/node_delete_transaction.py
- Existing endpoint pattern:
src/hiero_sdk_python/address_book/endpoint.py
- Advanced issue guidelines: https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/maintainers/advanced_issue_guidelines.md
Metadata
Metadata
Assignees
Labels
Type
Projects
Status