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

WIP: Implement Delegation app #1

wants to merge 8 commits into
base: master


None yet
1 participant

izqui commented Aug 21, 2018

Implements a Delegation app that uses the Staking app to build a staked-based liquid democracy app.

See the current challenges (griefing attacks) in the research forum: An open issue is that delegation chain depths are not being recalculated on undelegations.

For now it is just a prototype to measure gas costs and evaluate feasibility of the approach.

Requires aragon/aragon-apps#415


This comment has been minimized.


izqui commented Aug 30, 2018

Performed some gas analysis on the both delegation and voting (checking overruling costs depending on chain depth).

Voting (assuming the vote is not the first vote for the option):

  • Casting single vote (final delegate or without delegation): ~61k gas
  • Overruling vote (after delegate votes): ~70k + 23k * depth
  • Overruling vote (before delegate votes): ~64k + 23k * depth`


  • Delegating (if the chain depth had never been reached): ~122k + 44k * depth
  • Undelegating: ~52k gas + 37k * depth

The analysis has been done on unoptimized code, but the results are promising IMO. The limit for maximum chain depth should be set given the costs for undelegation, because if undelegation goes out of gas trying to undelegate a chain that is too long, it would be pretty problematic.

The maximum hard limit for how deep a chain could be given the current gas limit of 8M is 179, however undelegating a chain of that size would need 6.7M gas (83% of a current block gas). I think a reasonable cap for the maximum cost of undelegating a chain would be 10% of the gas limit (800k gas), which would result in a maximum chain size of 20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment