Skip to content

Client.setNetwork() does not propagate address book #2317

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

Closed
steven-sheehy opened this issue Apr 29, 2025 · 1 comment
Closed

Client.setNetwork() does not propagate address book #2317

steven-sheehy opened this issue Apr 29, 2025 · 1 comment
Assignees
Milestone

Comments

@steven-sheehy
Copy link
Contributor

steven-sheehy commented Apr 29, 2025

Similar to #1995, the address book support is still not fully propagated in some scenarios. When adjusting the network, the certificate info inside the NodeAddressBook parameter is not passed through to Node.setAddressBookEntry() so TLS does not work unless we also specify Client.setVerifyCertificates(false), which is less secure. Consider the below:

var client = Client.forMainnet();
var network = client.getNetwork();
client.setNetwork(Map.of("1.2.3.4:50211", "0.0.3"));
client.setNetwork(network);

So essentially the problem is you start with a valid address book and N nodes, then call setNetwork() with some subset of N and later add back any of those nodes, the nodes added back do not retain the address book information despite it being present in the Network class. This scenario may seem unconventional but mirror node does this at the start of its acceptance tests to validate each specific endpoints before test execution.

The fix is to follow the invariant then whenever a Node is created to lookup and set its corresponding address book entry. Probably Network.createNodeFromNetworkEntry() just needs to call node.setAddressBookEntry() if addressBook is present.

@0xivanov 0xivanov added this to the v2.56.0 milestone Apr 29, 2025
steven-sheehy added a commit to hiero-ledger/hiero-mirror-node that referenced this issue Apr 29, 2025
Fix acceptance test validation of partial node outage:

* Change validation from balance query to topic submit message since query can sometimes succeed for bad endpoints
* Workaround partial node outage by removing all endpoints for that node account until sdk [#2317](hiero-ledger/hiero-sdk-java#2317) is fixed

Signed-off-by: Steven Sheehy <[email protected]>
steven-sheehy added a commit to hiero-ledger/hiero-mirror-node that referenced this issue Apr 29, 2025
Fix acceptance test validation of partial node outage:

* Change validation from balance query to topic submit message since query can sometimes succeed for bad endpoints
* Workaround partial node outage by removing all endpoints for that node account until sdk [#2317](hiero-ledger/hiero-sdk-java#2317) is fixed

Signed-off-by: Steven Sheehy <[email protected]>
steven-sheehy added a commit to hiero-ledger/hiero-mirror-node that referenced this issue Apr 29, 2025
* Change validation from balance query to topic submit message since query can sometimes succeed for bad endpoints
* Workaround partial node outage by removing all endpoints for that node account until sdk [#2317](hiero-ledger/hiero-sdk-java#2317) is fixed

Signed-off-by: Steven Sheehy <[email protected]>
@naydenovn naydenovn self-assigned this May 2, 2025
@0xivanov
Copy link
Contributor

Fixed in #2322

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

No branches or pull requests

3 participants