substrate icon indicating copy to clipboard operation
substrate copied to clipboard

Society v2

Open gavofyork opened this issue 3 years ago • 13 comments

Closes #10465

Substantial changes to Society:

  • The number of members are no longer limited technically (Members is no longer a Vec item).
  • Proper use of BoundedVec.
  • Max members and intake size can be altered by founder without runtime upgrade.
  • Members are ranked. Voting weight is determined as a rank-plus-one-squared.
  • Right now there's only two ranks, with all members starting as rank zero (vote weight 1) and all members eligible to become rank one (vote weight 4) if they return any funds they received from the society back into its treasury and give up the possibility of getting future funds.
  • The concept of a suspended candidate is removed: Candidates can remain a candidate indefinitely, however unless there is persistent indecision among the membership and inaction by the founder, then all candidates will be either approved as a member or rejected entirely after a full additional intake round.

Candiate voting:

  • The process for moving from candidate to member is no longer automatic and requires a call into one of a number of free dispatchables.
  • The voting/reward/punishment scheme for candidates and challenged members is completely different.
  • The candidate voting round is two phase, initially a voting phase and then a period afterwards where membership may be claimed based on those votes before the next candidate(s) are selected.
  • There is now only one Skeptic and their duty is changed.
  • No members are rewarded for voting.
  • Only the Skeptic is punished for invalid/missing votes.
  • Unlike the original voting scheme, the new scheme involves no random input.
  • The Skeptic is selected at random from the members, but no vote is attributed to them.
  • Members may vote on any candidate at any time.
  • The "clear result" of voting is when there are twice as many votes for either approval or rejection as there are for the alternative.
  • There is no "clear result" of voting if neither the votes for approval nor the votes for rejection are more than twice as great as the other.
  • A candidate may always resign their candidacy at any time, but this incurs the loss of their deposit.
  • If they do not, then their candidacy may not end until the voting period is elapsed.
  • Once the voting period is elapsed, they may elevate themselves to become a member if the clear result of voting is in approval.
  • Once the following intake round is ended, then anyone may cancel the candidate's candidacy if there is a clear rejection of the candidate among voters.
  • Once the voting period is elapsed, the founder may elevate them to member if there is not a clear rejection of the candidate among voters.
  • Similarly, once the voting period is elapsed, the founder may cancel their candidacy if there is not a clear approval of the candidate among voters.
  • At any point once the voting period is over, the Skeptic can be forced by anyone to receive a strike for any candidate on which they either did not vote or did vote but voted against the clear result (if there was one). The Skeptic may only be punished once for any candidate.

Member challenges:

  • At every Challenge Period, a member is selected to become the new Defender and another member is selected at random to become the Challenge Skeptic.
    • The Defender is generally selected at random from the members.
    • However, if the previous Challenge Skeptic received a strike for missing or invalid voting, then they become the Defender.
  • Prior to the commencement of the next Challenge Period, any member may vote on the continued validity of the member's membership.
  • The Challenge Skeptic receives a strike and becomes the next Defender if they did not vote or if their vote is against the clear result of the voters (if any).
  • A random member is selected as the next Defender if the Challenge Skeptic's vote is present and valid.
  • If the clear result of the voters is to reject the Defender's evidence of continued eligibility for membership, then the Defender is removed as a member and placed in the SuspendedMembers list. The founder may restore their membership or remove them as before.

New dispatchables to be integrated in the UI (CC @jacogr):

  • waive_repay: Attempt to clear any payouts and promote the member to rank 1. This transfers the given amount of the sender's balance back into the Society. This will only work if the given amount is at least as great as the member's debt to the society.
  • punish_skeptic: Callable by a candidate after the voting period has ended to ensure that the Skeptic is punished for inaction or invalid voting.
  • claim_membership: Callable by a candidate to claim their membership after the voting period has ended and when there is a clear result of approval.
  • bestow_membership: Callable by the Founder to elevate a candidate to member after the voting period has ended and when there is not a clear result of rejection.
  • kick_candidate: Callable by the Founder to reject a candidate after the voting period has ended and when there is not a clear result of approval. The candidate loses their deposit.
  • resign_candidacy: Callable by a candidate to end their candidacy. The candidate loses their deposit.
  • drop_candidate: Callable by anyone to end a candidate's candidacy after the intake period following the one in which the candidate applied and only when there is a clear result of rejection. The candidate loses their deposit.

TODO:

  • [x] Repay / Waive
  • [x] Rank rules
  • [x] Old tests
  • [x] New test(s)?
  • [x] Migration
  • [x] Prove that the remove_all(None) calls are bounded.
  • [x] Tidy any old rank/group stuff.

gavofyork avatar Apr 30 '22 10:04 gavofyork

The ranking system was designed in this way on purpose. It is a fair signal to demonstrate the member's commitment to the society and the network by removing the factor of financial incentive. All members are free to return what they received to gain the higher rank. From the network's point of view it doesn't make sense to consider the USD/EUR/BTC/ETH/*** value of it: if the member disposed of the KSM they received and as a result finds it difficult to attain a higher rank, it would be unfair to members who received little or no KSM to facilitate their promotion.

The rank system may not be perfect, but at this point the only difference it makes is to give greater weight to those who have not taken from the society's treasury when evaluating a candidate/members PoI. Given the previous system for evaluation was rather broken, I can't see how this is a retrograde step of any kind.

I expect that the Founder will make an effort to ensure that all candidates and members which hold valid PoI will be properly recognised prior to this being launched.

gavofyork avatar May 12 '22 09:05 gavofyork

The ranking system was designed in this way on purpose. It is a fair signal to demonstrate the member's commitment to the society and the network by removing the factor of financial incentive. All members are free to return what they received to gain the higher rank. From the network's point of view it doesn't make sense to consider the USD/EUR/BTC/ETH/*** value of it: if the member disposed of the KSM they received and as a result finds it difficult to attain a higher rank, it would be unfair to members who received little or no KSM to facilitate their promotion.

The rank system may not be perfect, but at this point the only difference it makes is to give greater weight to those who have not taken from the society's treasury when evaluating a candidate/members PoI. Given the previous system for evaluation was rather broken, I can't see how this is a retrograde step of any kind.

I expect that the Founder will make an effort to ensure that all candidates and members which hold valid PoI will be properly recognised prior to this being launched.

I know that from the network's point of view it doesn't make sense to consider external fluctuations, but the society is a different beast than the network, it's an "alliance between humans and machines" after all. It should consider the human component and humans live off-chain with real-life economic implications.

This approach works well for balancing on-chain power, but poorly for measuring soft power outside of it, because even though the ranking only grants some voting power on-chain without major implications, it can also grants major privileges outside of it: there are discussions already happening of using the ranking to grant access to different places, physical and virtual.

This means that someone who just joined will have more privileges than someone who is contributing for a long time, without having to pay anything for it, hence benefiting those who can afford it. Paradoxically, by introducing a mechanism of ranking that involves giving up financial incentives, you are benefiting those who can afford it. I, for one, didn't dispose my KSM and could eventually return it, but it's too high of a price to pay comparing to someone who literally just joined and won't have to give up anything. I agree that's a better system than before and maybe if it worked this way since the beginning I wouldn't have a problem with it, but considering we have a legacy, I don't think we should ignore the implications of this decision.

Plus, I'm not comfortable with this top-down approach, as I said before, we never discussed this as a society. Members should have a say on this, like everything else we have been doing lately.

What I'm suggesting is to introduce a time-based way of ranking up too. Time and dedication are also a way of signalling commitment, maybe even stronger than giving up money.

laurogripa avatar May 12 '22 13:05 laurogripa

There's another concern that just occurred to me: in the past we discussed using the voting mechanism to decide on things other than valid PoIs, we even discussed moving the funds of Motion 186 to the society's treasury and voting on how to the funds should be allocated. We decided to not do this right now because of regulatory concerns, but if we decide to do this in the future, the ranking should definitely be different.

laurogripa avatar May 12 '22 14:05 laurogripa

The members of the Society are free to create whatever off-chain voting mechanisms they want to represent themselves.

However regarding the use of the Pot, no affordance (whether implicit or explicit) was ever given to the members (either individually or as a union), to determine its use. It use was codified in the Society pallet and thus far that has remained unchanged.

gavofyork avatar May 31 '22 20:05 gavofyork

The members of the Society are free to create whatever off-chain voting mechanisms they want to represent themselves.

However regarding the use of the Pot, no affordance (whether implicit or explicit) was ever given to the members (either individually or as a union), to determine its use. It use was codified in the Society pallet and thus far that has remained unchanged.

I know, I'm just expressing and documenting some concerns since we didn't have the chance to discuss this as a society. I really appreciate the effort, I think the new design is good and I wouldn't have a problem with it if it wasn't for the legacy.

My main issue is that, again, we never discussed this as a society. Not even before it was founded, there's no mention of ranks anywhere in the documents, not even as an intention for future developments. Not that I'm aware of, at least, and I gathered every piece of document we had scattered around. The idea of giving up rewards is not mentioned anywhere either, with the exception of a vague mention on The Third Generation episode. To be fair, it's also mentioned there that no single person could introduce radical changes to the society, which doesn't seem true right now.

What's actually documented in the Overview section of the README of this module states the opposite of giving up rewards:

"The Society module is an economic game which incentivizes users to participate and maintain a membership society."

And again in Mechanics:

"Members are incentivized to participate in the society through rewards paid by the Society treasury."

To be clear, I'm not against these changes. I just don't like this top-down/unilateral approach. But anyway, it's not the end of the world, it's still a big step forward. Btw, we are working on the benchmarks, we should have them ready soon.

laurogripa avatar Jun 03 '22 00:06 laurogripa

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 03 '22 02:07 stale[bot]

Hey @gavofyork and @laurogripa I've open a PR#11776 to track this one and to add benchmarking.rs to the Society's pallet.

arturgontijo avatar Jul 05 '22 00:07 arturgontijo

I'll make tests work in #11776 and do a proper code review.

arturgontijo avatar Jul 27 '22 10:07 arturgontijo

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 31 '22 01:08 stale[bot]

Just added a few more tests and more storage cleanups when calling dissolve() (#11776).

arturgontijo avatar Sep 13 '22 16:09 arturgontijo

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 13 '22 23:10 stale[bot]

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 07 '23 15:01 stale[bot]

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 27 '23 21:03 stale[bot]

Planning on spend some time on this one the next few days, let me know if there is any blockers.

arturgontijo avatar Mar 29 '23 12:03 arturgontijo

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 28 '23 23:04 stale[bot]

bot rebase

kianenigma avatar Jun 13 '23 06:06 kianenigma

Rebased

bot merge

gavofyork avatar Jun 18 '23 14:06 gavofyork

Error: "Check reviews" status is not passing for https://github.com/paritytech/polkadot/pull/7356