near-daos / sputnik-dao-contract

Smart contracts for https://app.astrodao.com
https://astrodao.com/
MIT License
107 stars 79 forks source link

Policy is too large for wallet interactions #59

Closed ilblackdragon closed 2 years ago

ilblackdragon commented 2 years ago

When policy is too large, it's not possible to update it via Web Wallet. Specifically allowing for policy per group and per proposal type.

starpause commented 2 years ago

Delta/Granular/Path based updates to policy will also address the concern of snapshotted policy state being overwritten (when there are multiple proposals updating policy & the order they're passed will impact final policy state).

mikedotexe commented 2 years ago

I think we're going to need more detail here in terms of how to approach this. I don't want to set people off on the wrong track. I will note this is a resource for how one might create a JavaScript file that can be run to change a policy: https://hackmd.io/lMmmRVXASuGf9Xrx75Pmlw?view#Add-proposal-to-change-policy

So what is the course of action we want to see here?

mikedotexe commented 2 years ago

I'll give my suggestions here. Add proposal type:

ChangePolicyForRole

ChangePolicyForRole {
  name: String,
  role_permission: RolePermission
}

ChangeDefaultVotePolicy

ChangeDefaultVotePolicy {
  policy: VotePolicy
}

ChangePolicyItem

enum PolicyItem {
  ProposalBond,
  ProposalPeriod,
  BountyBond,
  BountyForgivenessPeriod
}

ChangeDefaultVotePolicy {
  item: PolicyItem,
  value: U128
}

Note that for this one, there are two items (proposal_period and bounty_forgiveness_period) that use U64 instead of U128 and we'll be casting them as such.

ctindogaru commented 2 years ago

I'll give my suggestions here. Add proposal type:

ChangePolicyForRole

ChangePolicyForRole {
  name: String,
  role_permission: RolePermission
}

ChangeDefaultVotePolicy

ChangeDefaultVotePolicy {
  policy: VotePolicy
}

ChangePolicyItem

enum PolicyItem {
  ProposalBond,
  ProposalPeriod,
  BountyBond,
  BountyForgivenessPeriod
}

ChangeDefaultVotePolicy {
  item: PolicyItem,
  value: U128
}

Note that for this one, there are two items (proposal_period and bounty_forgiveness_period) that use U64 instead of U128 and we'll be casting them as such.

This looks like the perfect split to me.

ctindogaru commented 2 years ago

I can start working on adding the ChangePolicyForRole which seems to be the most important one, and then add the latter ones as well. How does that sounds?

mikedotexe commented 2 years ago

I can start working on adding the ChangePolicyForRole which seems to be the most important one, and then add the latter ones as well. How does that sounds?

Sounds great, thanks Constantine!

ilblackdragon commented 2 years ago

This is already implemented here: https://github.com/near-daos/sputnik-dao-contract/pull/62 Please review.