Skip to content

Conversation

@zeegomo
Copy link
Contributor

@zeegomo zeegomo commented May 25, 2022

No description provided.

@zeegomo zeegomo requested a review from a team May 25, 2022 09:04
Base automatically changed from vp-cap to main June 15, 2022 15:10
@zeegomo zeegomo requested a review from cameron1024 June 16, 2022 08:18
zeegomo added 7 commits June 16, 2022 11:20
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.
Copy link
Contributor

@Mr-Leshiy Mr-Leshiy left a comment

Choose a reason for hiding this comment

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

LGTM !

Copy link
Contributor

@cameron1024 cameron1024 left a 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
Copy link
Contributor

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

@zeegomo zeegomo merged commit d260af9 into main Jun 27, 2022
@zeegomo zeegomo deleted the update-rewards branch June 27, 2022 11:49
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.

5 participants