Skip to content

feat(node-rewards): reward type4.5 nodes as type1.1#10393

Merged
pietrodimarco-dfinity merged 1 commit into
masterfrom
pietro/node-rewards-type4dot5-as-type1dot1
Jun 4, 2026
Merged

feat(node-rewards): reward type4.5 nodes as type1.1#10393
pietrodimarco-dfinity merged 1 commit into
masterfrom
pietro/node-rewards-type4dot5-as-type1dot1

Conversation

@pietrodimarco-dfinity

Copy link
Copy Markdown
Contributor

What

Make nodes with NodeRewardType::Type4dot5 (type4.5) be rewarded exactly as NodeRewardType::Type1dot1 (type1.1).

How

Minimal change in registry_querier.rs: right after deriving node_reward_type from the registry node record, remap Type4dot5 to Type1dot1 before constructing the RewardableNode. Since the whole reward calculation keys off RewardableNode.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_type for those nodes to type1.1.

Tests

Added test_type4dot5_nodes_rewarded_as_type1dot1 to the registry querier tests, asserting a registered type4.5 node surfaces as type1.1 in the rewardable nodes.

//rs/node_rewards/canister:nrc_test ... PASSED
test registry_querier::tests::test_type4dot5_nodes_rewarded_as_type1dot1 ... ok

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.
@pietrodimarco-dfinity pietrodimarco-dfinity added this pull request to the merge queue Jun 4, 2026
Merged via the queue into master with commit 50a4d70 Jun 4, 2026
42 checks passed
@pietrodimarco-dfinity pietrodimarco-dfinity deleted the pietro/node-rewards-type4dot5-as-type1dot1 branch June 4, 2026 21:03
@r-birkner r-birkner requested a review from Copilot June 5, 2026 06:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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::Type4dot5 to NodeRewardType::Type1dot1 when constructing RewardableNode entries in RegistryQuerier::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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI_ALL_BAZEL_TARGETS Runs all bazel targets feat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants