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(registry): Add node_reward_type to NodeRecord #1608

Merged
merged 8 commits into from
Oct 15, 2024
Merged

Conversation

max-dfinity
Copy link
Contributor

@max-dfinity max-dfinity commented Sep 20, 2024

This adds support for node_reward_type to NodeRecord and to AddNodePayload.

It adds it as a string to AddNodePayload, but as an enum with validation to NodeRecord.

@max-dfinity max-dfinity changed the title Update the record definition feat(registry): Add node_type to NodeRecord Sep 20, 2024
@github-actions github-actions bot added the feat label Sep 20, 2024
@max-dfinity max-dfinity force-pushed the NNS1-3345 branch 2 times, most recently from 7ec43c4 to 178d0c1 Compare September 23, 2024 18:15
Copy link
Member

@sasa-tomic sasa-tomic left a comment

Choose a reason for hiding this comment

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

LGTM, Ty!

rs/registry/canister/api/src/lib.rs Outdated Show resolved Hide resolved
rs/protobuf/src/gen/registry/registry.node.v1.rs Outdated Show resolved Hide resolved
rs/protobuf/def/registry/node/v1/node.proto Outdated Show resolved Hide resolved
rs/orchestrator/src/registration.rs Outdated Show resolved Hide resolved
rs/protobuf/src/registry/node.rs Outdated Show resolved Hide resolved
@rumenov
Copy link
Member

rumenov commented Oct 7, 2024

we add the node type into the node record. Naming would be flexible. We here suggest to call it node_remuneration_type but I can see in the context of UTOPIA that they could have different node specs and it would be useful to have a record in the registry on which machine spec a particular node has.

For UTOPIA I would definitely prefer it to be a called node_type, as the remuneration will be done differently, yet having a record in the registry to be able to distinguish between machine specs would be of great benefit.

Is there a design doc to read about the UTOPIA renumaration ?

@rumenov
Copy link
Member

rumenov commented Oct 7, 2024

just rubber stamping

@yvonneanne
Copy link
Contributor

we add the node type into the node record. Naming would be flexible. We here suggest to call it node_remuneration_type but I can see in the context of UTOPIA that they could have different node specs and it would be useful to have a record in the registry on which machine spec a particular node has.

For UTOPIA I would definitely prefer it to be a called node_type, as the remuneration will be done differently, yet having a record in the registry to be able to distinguish between machine specs would be of great benefit.

Is there a design doc to read about the UTOPIA renumaration ?

How UTOPIA owners will cover the cost of running the nodes is up to them and NOT part of the product we will offer them in the near future. Therefore there is no design doc for this topic.

@rumenov
Copy link
Member

rumenov commented Oct 7, 2024

we add the node type into the node record. Naming would be flexible. We here suggest to call it node_remuneration_type but I can see in the context of UTOPIA that they could have different node specs and it would be useful to have a record in the registry on which machine spec a particular node has.

For UTOPIA I would definitely prefer it to be a called node_type, as the remuneration will be done differently, yet having a record in the registry to be able to distinguish between machine specs would be of great benefit.

Is there a design doc to read about the UTOPIA renumaration ?

How UTOPIA owners will cover the cost of running the nodes is up to them and NOT part of the product we will offer them in the near future. Therefore there is no design doc for this topic.

Then how do you know you will need node_type for UTOPIA as part of the renumaration for UTOPIA ? :)

@yvonneanne
Copy link
Contributor

we add the node type into the node record. Naming would be flexible. We here suggest to call it node_remuneration_type but I can see in the context of UTOPIA that they could have different node specs and it would be useful to have a record in the registry on which machine spec a particular node has.

For UTOPIA I would definitely prefer it to be a called node_type, as the remuneration will be done differently, yet having a record in the registry to be able to distinguish between machine specs would be of great benefit.

Is there a design doc to read about the UTOPIA renumaration ?

How UTOPIA owners will cover the cost of running the nodes is up to them and NOT part of the product we will offer them in the near future. Therefore there is no design doc for this topic.

Then how do you know you will need node_type for UTOPIA as part of the renumaration for UTOPIA ? :)

I don't think this will be needed for remuneration in UTOPIA. That's why I wouldn't want remuneration to be part of the name of the field. As Sasa says in the comment I refer to, having different types for nodes with different specs is useful, e.g., when creating subnet.

@max-dfinity
Copy link
Contributor Author

@sasa-tomic @rumenov @yvonneanne Would something like "node_hardware_type" be a reasonable name? I think node_type is too generic (given @andrewbattat's point about how many different "type" ideas refer to nodes. I'm open to suggestions here, and I now agree node_remuneration_type is not a good name either.

@yvonneanne
Copy link
Contributor

@sasa-tomic @rumenov @yvonneanne Would something like "node_hardware_type" be a reasonable name? I think node_type is too generic (given @andrewbattat's point about how many different "type" ideas refer to nodes. I'm open to suggestions here, and I now agree node_remuneration_type is not a good name either.

"node_hardware_type" seems very reasonable (and useful) to me.

@andrewbattat
Copy link
Member

"node_hardware_type" seems very reasonable (and useful) to me.

This is the Node Provider Machine Hardware Guide, so we'll just have to make sure it's updated to reflect all the different hardware sub-types.

@max-dfinity
Copy link
Contributor Author

max-dfinity commented Oct 9, 2024 via email

@sasa-tomic
Copy link
Member

@sasa-tomic would this still be consistent with the node remuneration? (i.e. if we used the node type specifications?)

I think this will just add to the confusion. We have only 2 hardware types (gen1 and gen2) used in production and we have the following remuneration node_types: type0, type1, type1.1, type2, type3, type3.1, and will likely have more in the future, all assigned to the same gen1/gen2 node types based on arbitrary agreements reached.
If we start using node_hardware_type to refer to remuneration types in the registry, then the term node_hardware_type will imply that it refers to gen1/gen2 based on the variable name, but will actually refer to to remuneration typeX.Y in the context of remuneration. I think that would be quite confusing.

So I think it would be clearer to have a more generic name that would be used for remuneration on the IC Mainnet, and for whatever they want on UTOPIA.

@yvonneanne
Copy link
Contributor

@sasa-tomic would this still be consistent with the node remuneration? (i.e. if we used the node type specifications?)

I think this will just add to the confusion. We have only 2 hardware types (gen1 and gen2) used in production and we have the following remuneration node_types: type0, type1, type1.1, type2, type3, type3.1, and will likely have more in the future, all assigned to the same gen1/gen2 node types based on arbitrary agreements reached. If we start using node_hardware_type to refer to remuneration types in the registry, then the term node_hardware_type will imply that it refers to gen1/gen2 based on the variable name, but will actually refer to to remuneration typeX.Y in the context of remuneration. I think that would be quite confusing.

So I think it would be clearer to have a more generic name that would be used for remuneration on the IC Mainnet, and for whatever they want on UTOPIA.

I assumed this type is exactly to differentiate between the two hardware types, Gen1 and Gen2 (and more types in the future)? (https://dfinity.atlassian.net/browse/IC-797)

If this is not the case (do we distinguish Gen1 and Gen2 by the chip_id field in this case?) and we use this type exclusively for remuneration, then remuneration should be part of the name.

@sasa-tomic
Copy link
Member

I just had a chat with @yvonneanne to discuss this change. Here is the summary:

  • we need a way to represent the node_hardware_type in the registry, but this is not of critical importance and can be done separately (i.e. would enable distinguishing gen1 vs gen2 nodes)
  • we need a way to represent the node_rewards_type or whatever the name, associated with each node record somehow, to enable us to calculate precisely how much rewards each NP should get -- this is what this PR is about (e.g. type1, type3, type3.1, ...)

The field should be optional to cover for the expected utopia use cases. For the Mainnet, we can make sure in SetupOS that all newly deployed Mainnet nodes have this value set.
In the interest of simplicity, it seems easiest to include this information in the node record, as was done in this PR. @rumenov already approved the PR as is, so I suppose the change is acceptable to him.

One option suggested by Rosti earlier was to have a map of rewardable nodes somewhere else. However, that option seems to add a bit more complexity, and thus doesn't seem to be preferred by the NNS team. I also don't see a huge benefit in this option, other than not polluting the node record with even more fields. As a downside, it adds more room for error (e.g. a node could exist in the rewardable nodes map, but not in the list of active node records).

So the only open question is the name of the field in the NodeRecord. I don't mind personally. All options are okay with me, as long as they are not confusing (e.g. by saying it's a hardware description when it's a reward-related field). So either name it with a reward/remuneration (former is simpler so better by me), or alternatively just plain node_type would also be okay. I delegate the decision to @max-dfinity since he's the code owner.

@max-dfinity max-dfinity changed the title feat(registry): Add node_type to NodeRecord feat(registry): Add node_reward_type to NodeRecord Oct 15, 2024
@max-dfinity max-dfinity force-pushed the NNS1-3345 branch 2 times, most recently from a7c2b68 to c1485df Compare October 15, 2024 19:09
@max-dfinity max-dfinity added this pull request to the merge queue Oct 15, 2024
Merged via the queue into master with commit 9fc5ab4 Oct 15, 2024
26 checks passed
@max-dfinity max-dfinity deleted the NNS1-3345 branch October 15, 2024 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants