DA0-DA0 / dao-contracts

CosmWasm smart contracts for Interchain DAOs.
https://docs.daodao.zone
BSD 3-Clause "New" or "Revised" License
206 stars 137 forks source link

Auto Pass Props if User Controls 100% of Voting power #776

Closed nickf12 closed 8 months ago

nickf12 commented 10 months ago

Hi @JakeHartnell This should close #775

NoahSaso commented 10 months ago

can you rebase on development? i think this PR is undoing some of the recent fixes

nickf12 commented 10 months ago

Rebased! Please let me know if there is any other conflict

NoahSaso commented 9 months ago

hey @nickf12 i'm concerned about the tests being modified. instead of modifying tests, could you add new tests that specifically cover this feature? that way we can be 100% confident that this doesn't break anything.

also, @JakeHartnell @bekauz, i'm curious what you think about the following:

  1. this currently results in a passed proposal with 0 votes cast. do you think this should auto-submit a yes vote? i'm leaning towards it should.
  2. i'm a bit uncomfortable setting the status to Passed right away as i'm worried about forgotten hooks and future logic. IMO it'd be much safer and future-proof to leave the existing execute_propose code as-is and then call the execute_vote function at the end if the proposer has all voting power, which takes care of adding the ballot, updating the status, and firing the proposal status change and new vote hooks. if we take that route instead, there should probably be a special case added to update the proposal into passed manually when allow_revoting is enabled, since just casting a vote wouldn't be sufficient to pass the proposal.
  3. this feature should be enabled by a config setting, like auto_pass_when_only_member_proposes.
bekauz commented 9 months ago

first, this needs to be rebased again.

i also share @NoahSaso concerns about modifying the tests and bypassing the Open prop state. imho it would be a little weird seeing a proposal that passed without any votes.

if we do want this i think some things need to be considered:

NoahSaso commented 9 months ago

first, this needs to be rebased again.

i also share @NoahSaso concerns about modifying the tests and bypassing the Open prop state. imho it would be a little weird seeing a proposal that passed without any votes.

if we do want this i think some things need to be considered:

  • what if revoting is enabled?
  • is it ok to potentially execute a prop before min_voting_period expires?
  • is the proposer_power == total_power check the right one or should we check the threshold as well?
  • what if veto is configured?

yeah, great points. i forgot about veto and min_voting_period. which is kind of exactly my point, this feels like an idea that sounds nice in theory but is going to make things very complicated very quickly, to a concerning degree, and make future feature changes harder.

also, if we can solve something in the frontend without making a smart contract change, i'm going to make a generalization (which i.. generally.. avoid) and claim we should always implement it via the frontend. we can solve this by adding a vote message to the same transaction as the proposal creation message. technically if someone submitted a proposal the instant before, the vote could be cast to the wrong proposal, but that's very low probability and safer than implementing this in the smart contract IMO

bekauz commented 9 months ago

i think adding an option to automatically cast a vote on proposal creation would make more sense.

proposals could be configured to allow atomic prop-then-vote. if that's the case, the proposer can choose to opt into it and cast their vote or remain neutral and just create a proposal.

this way we are just combining two actions that already exist, so no changes to the existing status flow should be needed.

NoahSaso commented 9 months ago

i think adding an option to automatically cast a vote on proposal creation would make more sense.

proposals could be configured to allow atomic prop-then-vote. if that's the case, the proposer can choose to opt into it and cast their vote or remain neutral and just create a proposal.

this way we are just combining two actions that already exist, so no changes to the existing status flow should be needed.

i love this solution, brilliant. people have asked for this in the past.

bekauz commented 9 months ago

proposals could be configured to allow atomic prop-then-vote

on a second thought, is this even needed? if for any reason a dao chose not want to enable this feature, the proposer could just create the prop and cast their vote on it anyways.

NoahSaso commented 9 months ago

proposals could be configured to allow atomic prop-then-vote

on a second thought, is this even needed? if for any reason a dao chose not want to enable this feature, the proposer could just create the prop and cast their vote on it anyways.

oh yeah, i guess there's no need to implement a config option for this.. nice

NoahSaso commented 8 months ago

hey, bump on this @nickf12, do you think you could change this PR to just add a parameter to propose so that the proposer can optionally cast a vote on proposal creation?

NoahSaso commented 8 months ago

closing in favor of #799