Skip to content

Add derived algorithm_version to node-rewards command#1875

Merged
pietrodimarco-dfinity merged 5 commits intomainfrom
pmarco/add-algorithm-version-to-rewards
Jan 27, 2026
Merged

Add derived algorithm_version to node-rewards command#1875
pietrodimarco-dfinity merged 5 commits intomainfrom
pmarco/add-algorithm-version-to-rewards

Conversation

@pietrodimarco-dfinity
Copy link
Contributor

@pietrodimarco-dfinity pietrodimarco-dfinity commented Jan 26, 2026

This PR adds support for propagating algorithm_version when running
node-rewards past-rewards <YYYY-MM> and when fetching daily rewards from NRC.

The algorithm_version is derived directly from the governance rewards for the corresponding month and is required to correctly backtrack reward calculations now that NRC supports multiple algorithm versions.


Note

Adds support for selecting the NRC rewards calculation algorithm.

  • Extends NodeRewardsCtx with optional algorithm_version and passes it to NRC via get_rewards_daily(day, algorithm_version)
  • past-rewards derives algorithm_version from governance snapshot and uses it for all daily fetches; ongoing sets it to None
  • Updates canister client (NodeRewardsCanisterWrapper) request payload to include optional algorithm_version
  • Minor lockfile adjustments to ic-error-types source references

Written by Cursor Bugbot for commit 98516b3. This will update automatically on new commits. Configure here.

@pietrodimarco-dfinity pietrodimarco-dfinity requested a review from a team as a code owner January 26, 2026 18:13
@pietrodimarco-dfinity pietrodimarco-dfinity changed the title Add algorithm version to rewards computation Add derived algorithm_version to node-rewards command Jan 27, 2026
@pietrodimarco-dfinity pietrodimarco-dfinity enabled auto-merge (squash) January 27, 2026 16:06
@pietrodimarco-dfinity pietrodimarco-dfinity merged commit 230f0be into main Jan 27, 2026
9 checks passed
@pietrodimarco-dfinity pietrodimarco-dfinity deleted the pmarco/add-algorithm-version-to-rewards branch January 27, 2026 16:24
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.

2 participants