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

track staking events history; add staking rewards to validator history #752

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

Andrew7234
Copy link
Collaborator

This PR includes a chunk of the changes necessary for staking rewards that would be nice to include in the upcoming reindex release. There are two changes:

  • runtime analyzer now tracks staking event history in fast-sync mode
  • validator history analyzer now tracks per-validator staking rewards.

@Andrew7234 Andrew7234 force-pushed the andrew7234/staking-rewards-pt-1 branch from 05c599f to 80f41a2 Compare September 18, 2024 03:16
if ev, exists := stakingRewards[addr]; exists {
batch.Queue(queries.ValidatorStakingRewardUpdate,
vID.String(),
epoch.epoch-1, // previous epoch
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you affirm that this is all right

  1. staking rewards appear in the first block of the next epoch

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hm I asked a follow up in core-platform but as of now, the e2e integration tests show that the staking rewards are indeed populated in the first block of the next epoch. However, I'm not sure if there are any failure edge cases where the rewards might be populated in a subsequent block; will ask around.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

also confirmed that the staking rewards don't show up in the second block of the epochs in the e2e tests

@Andrew7234 Andrew7234 requested a review from pro-wh September 26, 2024 18:01
Copy link
Collaborator

@pro-wh pro-wh left a comment

Choose a reason for hiding this comment

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

thanks for the changes

@Andrew7234 Andrew7234 force-pushed the andrew7234/staking-rewards-pt-1 branch from fc6fb25 to 1dd6b6a Compare September 30, 2024 17:27
changelog

nit

update e2e test files

improve error messages

remove check for second block in epoch
@Andrew7234 Andrew7234 force-pushed the andrew7234/staking-rewards-pt-1 branch from 1dd6b6a to b481846 Compare September 30, 2024 18:21
@Andrew7234 Andrew7234 merged commit 73df7db into main Sep 30, 2024
16 checks passed
@Andrew7234 Andrew7234 deleted the andrew7234/staking-rewards-pt-1 branch September 30, 2024 19:10
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