Skip to content
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

A0-3094: Validators network details rpc call #1447

Conversation

ggawryal
Copy link
Contributor

@ggawryal ggawryal commented Oct 18, 2023

Description

Adding an RPC call to get network details of validators. This only pulls and caches network data that was previously observed by a node, without modifying or adding any new information flow between nodes in the network.

Related PRs: #1448 #1449

RPC query output on local network

curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "alephNode_unstable_validatorNetworkInfo", "params": []}' http://localhost:9948/

{
  "jsonrpc": "2.0",
  "result": {
      "5F4H97f7nQovyrbiq4ZetaaviNwThSVcFobcA5aGab6167dK": {
          "session": 1,
          "network_level_address": "127.0.0.1:30346",
          "validator_network_peer_id": "5CwWuuXMCvcSC7hqeMdFSfNFzVGXCAtdSGAMjwV1nLwaqtqE"
      },
      "5GBNeWRhZc2jXu7D55rBimKYDk8PGk8itRYFTPfC8RJLKG5o": {
          "session": 1,
          "network_level_address": "127.0.0.1:30344",
          "validator_network_peer_id": "5H7yZo8EzYkSsZn7MgC4f9vaVYQLgNaS4kEZ29Q7WtiYMVF8"
      },
      "5Dfis6XL8J2P6JHUnUtArnFWndn62SydeP8ee8sG2ky9nfm9": {
          "session": 1,
          "network_level_address": "127.0.0.1:30345",
          "validator_network_peer_id": "5HZFGbT6tsY2iV2YT927wnN4q2TxmPT67SUJE99TqGQsjpGV"
      },
      "5D34dL5prEUaGNQtPPZ3yN5Y6BnkfXunKXXz6fo7ZJbLwRRH": {
          "session": 1,
          "network_level_address": "127.0.0.1:30343",
          "validator_network_peer_id": "5E1YcJyx4u3kQ4UiRPgPXPSvb2vbcCR2DsxS927GM6x8wz85"
      }
  },
  "id": 1
}                        

Has been run also on testnet, slowly collects network details for authorities in each session (without AccountId because of the old runtime version).

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have created new documentation

@ggawryal ggawryal marked this pull request as ready for review October 18, 2023 16:04
Copy link
Contributor

@DamianStraszak DamianStraszak left a comment

Choose a reason for hiding this comment

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

Very nice!

bin/node/Cargo.toml Outdated Show resolved Hide resolved
bin/node/src/aleph_node_rpc.rs Outdated Show resolved Hide resolved
finality-aleph/src/network/address_cache.rs Outdated Show resolved Hide resolved
finality-aleph/src/network/address_cache.rs Outdated Show resolved Hide resolved
bin/node/src/aleph_node_rpc.rs Outdated Show resolved Hide resolved
bin/node/src/aleph_node_rpc.rs Outdated Show resolved Hide resolved
bin/node/Cargo.toml Outdated Show resolved Hide resolved
bin/node/src/aleph_node_rpc.rs Outdated Show resolved Hide resolved
bin/node/src/aleph_node_rpc.rs Outdated Show resolved Hide resolved
finality-aleph/src/network/address_cache.rs Outdated Show resolved Hide resolved
finality-aleph/src/network/address_cache.rs Outdated Show resolved Hide resolved
finality-aleph/src/network/address_cache.rs Outdated Show resolved Hide resolved
finality-aleph/src/network/address_cache.rs Outdated Show resolved Hide resolved
finality-aleph/src/network/address_cache.rs Outdated Show resolved Hide resolved
finality-aleph/src/network/address_cache.rs Outdated Show resolved Hide resolved
finality-aleph/src/network/tcp.rs Outdated Show resolved Hide resolved
@ggawryal ggawryal marked this pull request as draft October 20, 2023 10:04
@ggawryal ggawryal changed the title A0-3094: Validators network details rpc call [Splitting to 2 prs] A0-3094: Validators network details rpc call Oct 20, 2023
@ggawryal ggawryal changed the title [Splitting to 2 prs] A0-3094: Validators network details rpc call [Splitting to 2 prs,will be rebased onto #1449] A0-3094: Validators network details rpc call Oct 20, 2023
github-merge-queue bot pushed a commit that referenced this pull request Oct 25, 2023
# Description

Adding structures that will be later helpful to construct RPC call to
get network details of validators. This is a part 2/3 of the whole task,
see #1447). This only pulls and caches network data that was previously
observed by a node, without modifying or adding any new information flow
between nodes in the network.

Follow up to #1448 

## Type of change

Please delete options that are not relevant.

- New feature (non-breaking change which adds functionality)

# Checklist:

<!-- delete when not applicable to your PR -->

- I have added tests
- I have created new documentation
@ggawryal ggawryal marked this pull request as ready for review October 25, 2023 11:11
@ggawryal ggawryal changed the title [Splitting to 2 prs,will be rebased onto #1449] A0-3094: Validators network details rpc call A0-3094: Validators network details rpc call Oct 25, 2023
Copy link
Contributor

@kostekIV kostekIV left a comment

Choose a reason for hiding this comment

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

gj

@ggawryal ggawryal added this pull request to the merge queue Nov 9, 2023
Merged via the queue into Cardinal-Cryptography:main with commit 97bc9cf Nov 9, 2023
9 checks passed
@ggawryal ggawryal deleted the a0-3094-validators-network-details-rpc branch November 9, 2023 09:11
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.

4 participants