-
Notifications
You must be signed in to change notification settings - Fork 170
feat: changing node account ids #3507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
src/client/WebClient.js
Outdated
| for (const nodeAddress of addressBook.nodeAddresses) { | ||
| for (const endpoint of nodeAddress.addresses) { | ||
| if (nodeAddress.accountId != null) { | ||
| // Exclude nodes with account ID 0.0.0 (removed node account IDs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic was removed from the HIP, it's not possible to set node account id to 0 => remove this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
src/client/Network.js
Outdated
| if ( | ||
| endpoint.port === port && | ||
| nodeAddress.accountId != null && | ||
| nodeAddress.accountId.toString() !== "0.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic was removed from the HIP, it's not possible to set node account id to 0 => remove this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
| expect(receipt.status).to.equal(Status.Success); | ||
| }); | ||
|
|
||
| it("should successfully remove node account ID (set to 0.0.0) with admin key signature", async function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are reworked please check again
| }); | ||
|
|
||
| describe("Node Account ID Update Operations", function () { | ||
| it("should successfully update node account ID with both admin and account key signatures", async function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test should bring back the original node account id at the end of the test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are reworked please check
| if (error instanceof PrecheckStatusError) { | ||
| expect(error.status).to.equal(Status.InvalidAccountId); | ||
| } else if (error instanceof StatusError) { | ||
| expect(error.status).to.equal(Status.InvalidAccountId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ifs don't make sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some for other tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fixed
| let originalNodeAccountId; | ||
|
|
||
| beforeAll(async function () { | ||
| env = await IntegrationTestEnv.new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will not work in CI, because in CI we don't use account 0.0.2. You should hard-code the client's operator (0.0.2) and it's 2 nodes 0.0.3 and 0.0.4 here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done
|
|
||
| describe("SDK Retry and Network Update Behavior", function () { | ||
| it("should retry with another node when encountering INVALID_NODE_ACCOUNT_ID", async function () { | ||
| const transaction = new TransferTransaction() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nowhere in this test i see the node account being updated, if it's using some of the above tests for doing the update -> it's a bad test. It should be self contained. See go's test https://github.com/hiero-ledger/hiero-sdk-go/blob/4c901a9700c8c9aefde6ef779a0e109993a5976a/sdk/node_update_transaction_e2e_test.go#L246
55e9bfb to
62cb6b7
Compare
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
be6f7db to
2cf661a
Compare
Signed-off-by: venilinvasilev <[email protected]>
Signed-off-by: venilinvasilev <[email protected]>
Signed-off-by: venilinvasilev <[email protected]>
Signed-off-by: venilinvasilev <[email protected]>
Signed-off-by: venilinvasilev <[email protected]>
Signed-off-by: venilinvasilev <[email protected]>
Signed-off-by: venilinvasilev <[email protected]>
Signed-off-by: venilinvasilev <[email protected]>
Signed-off-by: venilinvasilev <[email protected]>
1e6bf46 to
5e5fa1b
Compare
Summary
This PR implements the test plan for validating updates to the
account_idfield inNodeUpdateTransactionBodyas part of the DynamicAddress Book (DAB) enhancement. It also covers new SDK behaviors that
improve reliability when node account IDs become outdated or invalid.
Scope
Test coverage for
account_idupdatesaccount_id.SDK node-selection and retry behavior
Signing with all nodes
Ensures the SDK signs transactions with all nodes to reduce the
chance of failures caused by outdated node account IDs.
Client network refresh via mirror node
When an invalid node account error occurs, the SDK retrieves updated
network information from a mirror node and retries the transaction.
Fallback behavior without a mirror network
If no mirror node is configured, the SDK retries execution using the
next node ID in the transaction's node list until all options are
exhausted.
Alignment
The implementation aligns with the design described in:
"Changing of Node Account IDs for Nodes" (sdk-collaboration-hub#53)
Rationale
These tests ensure the robustness of Dynamic Address Book functionality,
reliable handling of account ID changes, and improved resilience in
transaction execution workflows.
Related issue(s):
#3370
Fixes #3370