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

[pos] Add epoch argument to vp::pos::rewards (backport #4196) #4302

Merged
merged 15 commits into from
Feb 3, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Feb 3, 2025

Describe your changes

This adds an epoch argument to the rewards() function in vp::pos. It does require a RPC node update in order to work, but it's backwards compatible. Tested with previous build of namadan and results are same as before:

With node on main and client on this branch:

$ ./target/debug/namadac rewards --source tnam1qrtypl0yazfamk8ptmgp608msl8wzrkpmqwppc7w --validator tnam1qxsx2ezu89gx252kwwluqp7hadyp285tkczhaqg0
Current rewards available for claim: 4625.955882 NAM

With both client and node on this branch:

$ ./target/debug/namadac rewards --source tnam1qrtypl0yazfamk8ptmgp608msl8wzrkpmqwppc7w --validator tnam1qxsx2ezu89gx252kwwluqp7hadyp285tkczhaqg0
Current rewards available for claim: 4625.955882 NAM

$ ./target/debug/namadac rewards --source tnam1qrtypl0yazfamk8ptmgp608msl8wzrkpmqwppc7w --validator tnam1qxsx2ezu89gx252kwwluqp7hadyp285tkczhaqg0 --epoch 60
Rewards for epoch 60: 4625.955882 NAM

$ ./target/debug/namadac rewards --source tnam1qrtypl0yazfamk8ptmgp608msl8wzrkpmqwppc7w --validator tnam1qxsx2ezu89gx252kwwluqp7hadyp285tkczhaqg0 --epoch 59
Rewards for epoch 59: 3887.536527 NAM

$ ./target/debug/namadac rewards --source tnam1qrtypl0yazfamk8ptmgp608msl8wzrkpmqwppc7w --validator tnam1qxsx2ezu89gx252kwwluqp7hadyp285tkczhaqg0 --epoch 58
Rewards for epoch 58: 3148.755426 NAM

Checklist before merging

  • If this PR has some consensus breaking changes, I added the corresponding breaking:: labels
    • This will require 2 reviewers to approve the changes
  • If this PR requires changes to the docs or specs, a corresponding PR is opened in the namada-docs repo
    • Relevant PR if applies: (coming soon)
  • If this PR affects services such as namada-indexer or namada-masp-indexer, a corresponding PR is opened in that repo

This is an automatic backport of pull request #4196 done by [Mergify](https://mergify.com).

Copy link
Contributor Author

mergify bot commented Feb 3, 2025

Cherry-pick of 7937b91 has failed:

On branch mergify/bp/maint-libs-0.47/pr-4196
Your branch is ahead of 'origin/maint-libs-0.47' by 6 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 7937b91f6.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	added by them:   .changelog/libs-v0.47.0/SDK/4196-rewards-at-past-epoch.md

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot added the conflicts label Feb 3, 2025
Copy link

codecov bot commented Feb 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.17%. Comparing base (3eca617) to head (62fe537).
Report is 17 commits behind head on maint-libs-0.47.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           maint-libs-0.47    #4302      +/-   ##
===================================================
+ Coverage            74.07%   74.17%   +0.10%     
===================================================
  Files                  345      345              
  Lines               110155   110565     +410     
===================================================
+ Hits                 81592    82009     +417     
+ Misses               28563    28556       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

joel-u410 and others added 9 commits February 3, 2025 16:26
(cherry picked from commit 7937b91)

# Conflicts:
#	.changelog/libs-v0.47.0/SDK/4196-rewards-at-past-epoch.md
(cherry picked from commit c988a40)
…larify that it only returns accumulated rewards available to claim

(cherry picked from commit ec6763b)
…e state before invoking the shortcut

(cherry picked from commit aacd109)
(cherry picked from commit 0112097)
@tzemanovic tzemanovic force-pushed the mergify/bp/maint-libs-0.47/pr-4196 branch from 27df524 to 62fe537 Compare February 3, 2025 15:27
@tzemanovic tzemanovic added the merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass label Feb 3, 2025
@mergify mergify bot merged commit 3599d9d into maint-libs-0.47 Feb 3, 2025
11 of 12 checks passed
@mergify mergify bot deleted the mergify/bp/maint-libs-0.47/pr-4196 branch February 3, 2025 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicts merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants