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

Refactor delegation mechanics and make as a core feature #280

Open
bonustrack opened this issue Mar 28, 2022 · 5 comments
Open

Refactor delegation mechanics and make as a core feature #280

bonustrack opened this issue Mar 28, 2022 · 5 comments
Assignees

Comments

@bonustrack
Copy link
Member

We need to specs how to move to delegation as core feature, this will require changes on:

snapshot-hub
snapshot-score
snapshot-strategies
snapshot

@ChaituVR
Copy link
Member

Few questions to find out the specs:

  • Can the delegator take back their voting power when they vote? like in delegation strategy
  • While setting the delegation, will the user be able to set it on the entire space or on a single strategy like network field?

@ChaituVR
Copy link
Member

ChaituVR commented Apr 8, 2022

  • Changes in UI:
    • On top of all strategies add a select menu for the delegation with the following options:
      • None
      • Only delegated Voting power
      • Delegated + Own Voting power
    • Add a checkbox "Delegator can take back their voting power when they vote"
    • While creating a proposal, on the new vote and when calculating the VP before the vote, send the following params along with the network param:
      "delegation": { type: 'only-delegated', delegatorRevert: true, space: 'balancer.eth' }
      Value can also be none only-delegated delegated-and-self
    • Use VP and vp_by_strategy from the votes query, don't calculate voting power on UI,
    • Show Current results result from scores and scores_by_strategy from proposal query
    • If the proposal block is from the future, show a message "Snapshot block is from future than proposal start, so voting power may be outdated, voting power will be updated once the proposal is closed"
  • Changes in hub:
    • On Vote, calculate the voting power and save the voting power, if the block is in the future set scores_state: "pending" else scores_state: "finished"
    • If the proposal has delegatorRevert: true, after getting the voting power, check if the delegations field exists, find the top delegate of the voter (example if A -> B -> C, If A vote now and C already voted and not B, C will be the top delegate, if C didn't vote and B voted, B will be the top delegate) Reduce the voting power of current voter from the top delegate score
    • On the Proposal end, if scores_state: "pending" calculate the score with all voters, and store the voting power
  • Changes in score API and strategies
    • Receive delegation param from the input
    • inside getScoresDirect if delegation.type !== 'none' get the delegations of all the voters (recurevely), based on the type, calculate the voting power
    • if delegatorRevert: true then reduce the voting power from the above level delegate VP, recursively

@bonustrack
Copy link
Member Author

@ChaituVR Core delegation should work only with "Delegated + Own Voting power" we shouldn't provide option to work with just Delegated vp, not sure who would need that? Also we shouldn't allow "Delegator can take back their voting power when they vote" this is exactly what blocking us to store vp when someone cast a vote. So basically you can only enable or disable delegation. This mean we need to store on the hub db for each proposal if there is delegation enabled or not. We also need to think how it work if someone delegate voting power in multiple chain.

@zzuziak
Copy link
Contributor

zzuziak commented Jan 30, 2023

Hi @bonustrack @ChaituVR , what's the status on this one? Does it need a pitch?

@ChaituVR
Copy link
Member

Yep need a pitch, I feel now we can support delegation as a core feature (at least for non-overriding strategies)

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

4 participants