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

Show execute button on aproved proposal and not always like now #876

Open
Viterbo opened this issue Jan 15, 2025 · 0 comments
Open

Show execute button on aproved proposal and not always like now #876

Viterbo opened this issue Jan 15, 2025 · 0 comments

Comments

@Viterbo
Copy link
Collaborator

Viterbo commented Jan 15, 2025

Overview

We need to add precision to the way we calculate the necessary votes to determine if a proposal is approved or not. Currently what we do is just to assume all is approved and always show the execute button. We rely on the fact that the actual blockchain implementation checks everything perfectly and we are safe from any hack attempt. However, it is nicer to show the buttons only when they are available.

Related Issue: #856

Links

// Commenting this out, the logic is bad.
// BPs can be involved in non-BP proposals, so we can't just check if BPs are involved and then assume 2/3 + 1
// And if no BPs are involved, doesn't mean we need 100% approval, most msigs are 2/3 or 5/7, etc...
/*
if (activeProducers.value.length === 0) {
// No BPs are involved in the proposal, so we need to 100% of the requested approvals
isApproved.value = proposal.provided_approvals.length === totalRequestedApprovals;
} else {
// If BPs are involved, we need 2/3 (+1) of the BPs to approve the proposal
const approval = (activeProducers.value.length * 2 / 3) + 1;
isApproved.value = activeProducersApproved.value.length >= Math.floor(approval);
}
*/
isApproved.value = true;

Acceptance Criteria

  • if it's the case of approval for BPs, then the calculation is already correct:
    // If BPs are involved, we need 2/3 (+1) of the BPs to approve the proposal
    const approval = (activeProducers.value.length * 2 / 3) + 1;
    isApproved.value = activeProducersApproved.value.length >= Math.floor(approval);
  • if it's the case of approval for private parties, the calculated number should consider the weights of each vote and the minimum for that particular signer.
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

No branches or pull requests

1 participant