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

validator: add voting power #7392

Merged
merged 1 commit into from
Jan 14, 2023
Merged

Conversation

emmazzz
Copy link
Contributor

@emmazzz emmazzz commented Jan 13, 2023

No description provided.

@vercel
Copy link

vercel bot commented Jan 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Ignored Deployments
Name Status Preview Comments Updated
explorer ⬜️ Ignored (Inspect) Jan 14, 2023 at 4:39AM (UTC)
explorer-storybook ⬜️ Ignored (Inspect) Jan 14, 2023 at 4:39AM (UTC)
wallet-adapter ⬜️ Ignored (Inspect) Jan 14, 2023 at 4:39AM (UTC)

@emmazzz emmazzz force-pushed the add_voting_power branch 2 times, most recently from 6a2b0c5 to 89df47c Compare January 13, 2023 22:53
Copy link
Collaborator

@sblackshear sblackshear left a comment

Choose a reason for hiding this comment

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

Thanks Emma!

I assume we also want to rename ValidatorSet.quorum_stake_threshold to something like ValidatorSet.quorum_threshold or ValidatorSet.voting_power_threshold. Will that require any changes on the Rust side?

@emmazzz
Copy link
Contributor Author

emmazzz commented Jan 14, 2023

I assume we also want to rename ValidatorSet.quorum_stake_threshold to something like ValidatorSet.quorum_threshold or ValidatorSet.voting_power_threshold. Will that require any changes on the Rust side?

Good catch. Will rename. No changes required on the Rust side since we don't use this number directly on the Rust side.

@emmazzz emmazzz force-pushed the add_voting_power branch 2 times, most recently from 096448b to 3d3f985 Compare January 14, 2023 00:26
@emmazzz emmazzz requested a review from sblackshear January 14, 2023 00:26
@@ -568,25 +585,17 @@ module sui::validator_set {
fun calculate_total_stake_and_quorum_threshold(validators: &vector<Validator>): (u64, u64, u64) {
let validator_state = 0;
let delegate_stake = 0;
let total_voting_power = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

This function no longer makes sense in that it's mixing the sum of stake and voting power threshold together, that's strange.
We should separate computations based on stake and computations based on voting power

@emmazzz emmazzz merged commit 9ea6273 into MystenLabs:main Jan 14, 2023
lxfind pushed a commit that referenced this pull request Jan 19, 2023
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.

3 participants