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

feat(dre): Provide an estimate of node types in the dre registry #927

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

sasa-tomic
Copy link
Member

@sasa-tomic sasa-tomic commented Sep 13, 2024

The node type information is not yet associated with node records in the registry.
There is an ongoing effort to rectify that, and to achieve that we need an accurate estimate of the node types based on the information available in the node operator record: rewardable_nodes.

What the code does is:

  • iterate over all nodes, and
  • for each node fetch the node operator
  • count the number of rewardable nodes of in each type (implementation detail: this is done by subtracting the rewardable nodes count)
  • estimate the node type based on the next available rewardable_nodes entry (not yet assigned to some other node record)

Again, this is only an estimate, and the correct information will be added to the registry in the future by the NNS team. At that point, we'll want to adjust the code.

Node information in the output now shows

    {
      "node_id": "yzi7p-lnf22-u2wot-tgxzn-v3ubs-4yuqq-fywh7-4tkk7-ly2xh-r5byg-mqe",
      "xnet": {
        "ip_addr": "2a01:2a8:a13c:1:6801:4eff:fede:8834",
        "port": 2497
      },
      "http": {
        "ip_addr": "2a01:2a8:a13c:1:6801:4eff:fede:8834",
        "port": 8080
      },
      "node_operator_id": "ciprs-d7ktn-eiqrv-pqbcf-npk57-ty4m3-npkk2-yu4en-d4ccs-ek5xw-dae",
      "chip_id": null,
      "hostos_version_id": "2e269c77aa2f6b2353ddad6a4ac3d5ddcac196b1",
      "public_ipv4_config": null,
      "subnet_id": null,
      "dc_id": "zh6",
      "node_provider_id": "6r5lw-l7db7-uwixn-iw5en-yy55y-ilbtq-e6gcv-g22r2-j3g6q-y37jk-jqe",
      "status": "Healthy",
      "node_type": "type1"
    },

The node type information is not yet associated with node records in the registry.
There is an ongoing effort to rectify that, and to achieve that we need an accurate estimate of the node types based on the information available in the node operator record: rewardable_nodes.

What the code does is:
- iterate over all nodes, and
- for each node fetch the node operator
- count the number of rewardable nodes of in each type (implementation detail: this is done by subtracting the rewardable nodes count)
- estimate the node type based on the next available rewardable_nodes entry (not yet assigned to some other node record)

Again, this is only an estimate, and the correct information will be added to the registry in the future by the NNS team. At that point, we'll want to adjust the code.
@sasa-tomic sasa-tomic requested a review from a team as a code owner September 13, 2024 17:02
@sasa-tomic sasa-tomic merged commit 2f2a6b8 into main Sep 17, 2024
4 checks passed
@sasa-tomic sasa-tomic deleted the sat-dre-registry-node-types branch September 17, 2024 11:38
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.

3 participants