Skip to content

HIP-1137: Block Node discoverability via on-chain registry#1659

Merged
Dosik13 merged 42 commits into
mainfrom
feat/add-hip1137
May 8, 2026
Merged

HIP-1137: Block Node discoverability via on-chain registry#1659
Dosik13 merged 42 commits into
mainfrom
feat/add-hip1137

Conversation

@Dosik13

@Dosik13 Dosik13 commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Description:

Add support for HIP-1137.

  • Add BlockNodeApi enum with well-known block node API kinds (OTHER, STATUS, PUBLISH, SUBSCRIBE_STREAM, STATE_PROOF)
  • Add RegisteredServiceEndpoint interface with registeredEndpointBase shared struct for common endpoint fields (IP/domain, port, TLS)
  • Add BlockNodeServiceEndpoint, MirrorNodeServiceEndpoint, RpcRelayServiceEndpoint, and GeneralServiceEndpoint as concrete endpoint subtypes with protobuf round-trip support
  • Add RegisteredNodeCreateTransaction for creating registered nodes with admin key, description, and service endpoints
  • Add RegisteredNodeUpdateTransaction for updating registered node description, admin key, and service endpoints
  • Add RegisteredNodeDeleteTransaction for removing registered nodes from the address book
  • Wire all three registered-node transactions into SchedulableTransactionBody so they can be scheduled via ScheduleCreateTransaction
  • Add RegisteredNodeAddressBookQuery (REST against the mirror node) along with RegisteredNode and RegisteredNodeAddressBook result types — supports SetRegisteredNodeId filtering and SetLimit page size
  • Add RegisteredNodeId field to TransactionReceipt
  • Add new response status codes (INVALID_REGISTERED_NODE_ID, INVALID_REGISTERED_ENDPOINT, REGISTERED_ENDPOINTS_EXCEEDED_LIMIT, INVALID_REGISTERED_ENDPOINT_ADDRESS, INVALID_REGISTERED_ENDPOINT_TYPE, REGISTERED_NODE_STILL_ASSOCIATED, MAX_REGISTERED_NODES_EXCEEDED)
  • Add associatedRegisteredNodes field to NodeCreateTransaction with setter and getter
  • Add associatedRegisteredNodes field to NodeUpdateTransaction with Set/Add/Clear/Get methods (three-state semantics: nil = unchanged, empty = clear, non-empty = replace)
  • Add examples/registered_node/main.go walking through the full lifecycle
  • Add unit tests for all new types and transactions including mock server, protobuf round-trip, coverage, and serialization tests
  • Add e2e tests covering the test plan**, with mirror-node verification on every success-path test**
  • Fix record/receipt query unit tests that need the new registeredNodeId field
  • Add constants.go and extract shared "UNKNOWN" string literal to fix goconst lint warning

Related issue(s):

Fixes #1634

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@lfdt-bot

lfdt-bot commented Mar 26, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@codecov

codecov Bot commented Mar 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.53488% with 72 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
sdk/registered_node_address_book_query.go 79.67% 23 Missing and 15 partials ⚠️
sdk/transaction.go 33.33% 12 Missing ⚠️
sdk/node_update_transaction.go 74.35% 9 Missing and 1 partial ⚠️
sdk/node_create_transaction.go 81.81% 4 Missing ⚠️
sdk/registered_node_delete_transaction.go 95.55% 1 Missing and 1 partial ⚠️
sdk/registered_node_update_transaction.go 97.75% 1 Missing and 1 partial ⚠️
sdk/transaction_receipt.go 81.81% 1 Missing and 1 partial ⚠️
sdk/block_node_api.go 96.29% 1 Missing ⚠️
sdk/registered_service_endpoint.go 98.14% 1 Missing ⚠️
Files with missing lines Coverage Δ
sdk/block_node_service_endpoint.go 100.00% <100.00%> (ø)
sdk/fee_estimate_types.go 100.00% <100.00%> (ø)
sdk/general_service_endpoint.go 100.00% <100.00%> (ø)
sdk/mirror_node_service_endpoint.go 100.00% <100.00%> (ø)
sdk/registered_node_create_transaction.go 100.00% <100.00%> (ø)
sdk/rpc_relay_service_endpoint.go 100.00% <100.00%> (ø)
sdk/status.go 99.87% <100.00%> (ø)
sdk/block_node_api.go 96.29% <96.29%> (ø)
sdk/registered_service_endpoint.go 98.14% <98.14%> (ø)
sdk/registered_node_delete_transaction.go 95.55% <95.55%> (ø)
... and 6 more

... and 71 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Dosik13 Dosik13 requested review from 0xivanov March 27, 2026 11:44
@codacy-production

codacy-production Bot commented Mar 31, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 372 complexity · 356 duplication

Metric Results
Complexity 372
Duplication 356

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@kaldun-tech

Copy link
Copy Markdown
Contributor

Hi @Dosik13 @0xivanov

I've been following the repo. Would love to contribute a code review pass. Looks like there's a coverage gap with transaction.go (28.57%) I could improve on if you like.

Dosik13 added 24 commits May 7, 2026 14:05
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
…Transaction

Signed-off-by: dosi <dosi.kolev@limechain.tech>
…eTransaction

Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
…Transaction

Signed-off-by: dosi <dosi.kolev@limechain.tech>
…eTransaction

Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Dosik13 added 10 commits May 7, 2026 14:25
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
…mProtobuf

Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
@Dosik13 Dosik13 force-pushed the feat/add-hip1137 branch from 047f5ff to 916eb8e Compare May 7, 2026 12:36
@Dosik13 Dosik13 marked this pull request as ready for review May 7, 2026 12:41
@Dosik13 Dosik13 requested review from a team as code owners May 7, 2026 12:41
Signed-off-by: dosi <dosi.kolev@limechain.tech>
@ivaylonikolov7

Copy link
Copy Markdown

blockNodeApiFromString silently maps unknowns to BlockNodeApiOther. That can mask a future endpoint_apis value the SDK doesn't yet know about.

@ivaylonikolov7

Copy link
Copy Markdown

When TransactionReceipt.RegisteredNodeId is nil when the proto value is absent you map it to 0. I think you should map it to nil so user is not confused when he sees node id 0. Our users might not know that there is no consensus node id 0.

Dosik13 and others added 7 commits May 7, 2026 17:12
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>

@gstoykow gstoykow left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Dosik13 Dosik13 merged commit dd5a08f into main May 8, 2026
17 checks passed
@Dosik13 Dosik13 deleted the feat/add-hip1137 branch May 8, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement HIP-1137 — Block Node discoverability via on-chain registry

6 participants