Skip to content
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

Dev governance refactor #16

Merged
merged 104 commits into from
Oct 16, 2024
Merged

Dev governance refactor #16

merged 104 commits into from
Oct 16, 2024

Conversation

GalloDaSballo
Copy link
Collaborator

@GalloDaSballo GalloDaSballo commented Oct 10, 2024

Ongoing work to refactor the Governance contract to address the various concerns

Latest Invariant Tests Run:
https://getrecon.xyz/shares/000f6ffc-cb60-4054-a8d4-e8466a1098c7


  • Introduces getInitiativeState to better test race conditions and to move towards a fully enforced flow that forces to either claim rewards or unregister on an epoch
  • Introduces lastEpochClaim to keep view functions working (as well as hold the one epoch = one claim invariant)
  • Fixes an issue in which a delete proposals could be readded
  • Tests test_crit_accounting_mismatch - test_canAlwaysRemoveAllocation - These must be re-reviewed once mitigations are in place
  • Force linearization of claim vs unregister
  • Prevent Initiatives that were unregistered from being reregistered
  • Fixes to issues that would prevent a deleted proposals to have votes removed, permanently bricking a user voting power
  • Reorder functions to better show the flow
  • Bring back logic that causes multiple claims to work
  • Expand the FSM tracking to use Enums - BONUS - @nican0r (if you have time do this | then test it invariants)
  • Plan out Invariant Tests for Lifecycle to enforce one state per epoch (except Claim -> Claimed) @nican0r
    See: Invariant Tests #20 ->Lifecycle tests
  • Fix Counted vs not Counted | Insolvency
  • Remove Counted
  • Simplify Code to Remove Counted

InitiativeVoteSnapshot should contain all view values at all time, these values should not "have an opinion"

The flows can be enforced in other functions

  • From there, store votes and vetos at snapshot (TODO: Can later merge the two into one "vote - vetos"
  • Track all status from InitiativeVoteSnapshot
  • Simplify threshold logic (ideally remove it)
  • Add logic for Veto vs Votes in the relevant functions (claim and unregister)

I believe we can use the last claimed at check to also be used to determine if a initiative should be unregistered
Meaning the check protecting against re-claiming can also be used to determine if the initiative should be removed

  • Change logic around view variables (votes, vetos, all snapshotted values, store those)
  • Use logic to determine behaviour, do not use logic to alter view variables

  • Fix tests and document more tests that we need
  • Test and document dust amounts
  • Test and document vote vs veto issue, determine how to solve - SEE: e4ef357
  • Review test_crit_accounting_mismatch - test_canAlwaysRemoveAllocation

Stretch:

  • Separate view logic from storage changing logic
  • All methods default to storage changing
  • Add non-storage changing as pre-view
  • Test view vs non view
  • Invariant Test view vs non view

Invariant Testing:

To recheck:

  • Logic around deregistering - See: 62ed071

EXPERIMENTAL - Optimize the packing code + Simplify storage further - SEE #31

  • Figure out actual maximum size require (hint prob 88 + 32 = uint120)
  • Run invariant tests on reference version
  • Create optimized version
  • Do differential tests on it
  • Replace the reference

Misc Fixes

Encoding Decoding Lib:
12f94ed

Make most functions view
#34
b692f5b
8e60ecb
3a7fd77
ab20d48

Improve UX of Setting up and Claiming Bribes
#25

Uses FSM more consistently
#36

Copy link

Recon Campaign Started Medusa1hourbasicCI/CD

Copy link

Recon Campaign Started Medusa1hourbasicCI/CD

Copy link

Recon Campaign Started Medusa1hourbasicCI/CD

Copy link

Recon Campaign Started Medusa1hourbasicCI/CD

Copy link

Recon Campaign Started Medusa1hourbasicCI/CD

Copy link

Recon Campaign Started Medusa1hourbasicCI/CD

Copy link

Recon Campaign Started Medusa1hourbasicCI/CD

Copy link

Recon Campaign Started Medusa1hourbasicCI/CD

@GalloDaSballo GalloDaSballo merged commit 36f8327 into dev Oct 16, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants