RigoBlock / v3-contracts

Smart contracts of RigoBlock v3
https://rigoblock.com
Apache License 2.0
9 stars 2 forks source link

Governance Feature: prevent potential future state changes of past proposal state #200

Open gabririgo opened 1 year ago

gabririgo commented 1 year ago

Rigoblock governance has an upgradable quorum. The quorum for determining a proposal state is read from the state, meaning that should the quorum change (in this context decrease) at some point in the future, there is a possible edge scenario where a past failed proposal becomes executable, causing unintended behavior. While it would be formally correct, in practice a change in the quorum should only affect future proposals, and past proposals state should be deterministic.

Possible patch:

  1. limited time window to queue a successful proposal, cannot be queued (and executed) in case of future changes in quorum
  2. add quorum checkpoints. This solution is gas-expensive and requires writing quorum at block whenever changes, plus looping through all past quorum checkpoints at each vote action, as the proposal state is verified in the call
  3. storing quorum in the proposal struct. Because of optimizer struct storage compression, this could probably not result in higher proposal creation gas cost, as there is enough room for another uint96 slot (actually uint104).
stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 1 year ago

This issue has been automatically closed because no activity occured in 30 days after being marked as stale. If it's still relevant - feel free to reopen. Thank you for your contributions.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.