-
Notifications
You must be signed in to change notification settings - Fork 15
Update rewards #141
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
Update rewards #141
Conversation
Use VoterHIR as the output format for the snapshot tool
Limit overall influence of actors in an election by capping their maximum voting power at arbitrary levels. Since a lot of configurations are going in the snapshot process, I'm thinking of having it output two different artifacts: the list of VoterHIRs, as already proposed, and another one which is a light wrapper around VoterHIR which contains contributions from snapshot, to be used for the reward process. I'm proposing to keep the separate because the first one is more general, while the second one is tied to our current deployment and more likely to change.
Mr-Leshiy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
cameron1024
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| Ok(rewards_to_mainnet_addresses(rewards, snapshot)) | ||
| let mut total_active_stake = 0u64; | ||
| let mut stake_per_voter = HashMap::new(); | ||
| // iterative as Iterator::sum() panic on overflows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could something like this work?
let total_active_stake = active_addresses
.iter()
.try_fold(0u64, |acc, x| acc.checked_add(x.hir.voting_power.into()));Not a big deal, not like there's anything wrong with for loops
No description provided.