feat(node-rewards): reward type4.5 nodes as type1.1#10393
Merged
pietrodimarco-dfinity merged 1 commit intoJun 4, 2026
Conversation
Remap NodeRewardType::Type4dot5 to Type1dot1 when building the rewardable nodes, so type4.5 nodes use the type1.1 rate, grouping and reported type throughout the reward calculation.
NikolaMilosa
approved these changes
Jun 4, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the node rewards canister’s registry query layer so that nodes registered as NodeRewardType::Type4dot5 are treated (and reported) as NodeRewardType::Type1dot1 in the computed RewardableNode set, making reward calculation and reporting behave identically for those nodes.
Changes:
- Remap
NodeRewardType::Type4dot5toNodeRewardType::Type1dot1when constructingRewardableNodeentries inRegistryQuerier::get_rewardable_nodes_per_provider. - Add a regression test asserting that a type4.5 node surfaces as type1.1 in the rewardable nodes output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
rs/node_rewards/canister/src/registry_querier.rs |
Remaps Type4dot5 to Type1dot1 before building RewardableNode, ensuring downstream reward logic and reporting treat them identically. |
rs/node_rewards/canister/src/registry_querier/tests.rs |
Adds a unit test confirming the remap behavior via the public rewardable-nodes query API. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Make nodes with
NodeRewardType::Type4dot5(type4.5) be rewarded exactly asNodeRewardType::Type1dot1(type1.1).How
Minimal change in
registry_querier.rs: right after derivingnode_reward_typefrom the registry node record, remapType4dot5toType1dot1before constructing theRewardableNode. Since the whole reward calculation keys offRewardableNode.node_reward_type(base-rate lookup, type grouping, and per-node reporting), this single remap makes type4.5 nodes behave as type1.1 everywhere.Note: this also changes the reported
node_reward_typefor those nodes to type1.1.Tests
Added
test_type4dot5_nodes_rewarded_as_type1dot1to the registry querier tests, asserting a registered type4.5 node surfaces as type1.1 in the rewardable nodes.