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

Governance (at Marinade): Adding weighted choice for the VoteType #1

Closed
wants to merge 39 commits into from

Conversation

ochaloup
Copy link

@ochaloup ochaloup commented Oct 6, 2022

Adding a MultiWeightedChoice as vote type.

Task: BE: SPL-Gov-Gauges - Build contract
(https://www.notion.so/marinade/BE-SPL-Gov-Gauges-Build-contract-86d4d5eda1754e6a973a33b8073eb9f9)

PR in solana labs at solana-labs#3721

@ochaloup
Copy link
Author

ochaloup commented Oct 6, 2022

@luciotato proposing the weighted vote change. The differences from the prior "compare" view are:

  • it's required that the vote is defined with sum of weighted choices to be 100%
  • integration tests fixed and added two more

@ochaloup
Copy link
Author

ochaloup commented Oct 6, 2022

@luciotato would you have an idea what's the reason of the failed test error: linking with cc failed: exit status: 1
https://github.com/marinade-finance/solana-program-library/actions/runs/3196111526/jobs/5217607856

I don't have much experience with these type of liking errors. I tried to run on my localhost and the test passes.

@ochaloup ochaloup force-pushed the weighted-choice branch 2 times, most recently from f27abbc to 5a6c9df Compare October 7, 2022 18:11
@ochaloup
Copy link
Author

ochaloup commented Oct 7, 2022

Ok, the tests pass now. I merged the new integration tests into single test file and it started to work (the reason for the linkage error is covered in mist for me).

@ochaloup ochaloup force-pushed the weighted-choice branch 4 times, most recently from 9f73151 to 8e889d6 Compare October 17, 2022 10:10
@ochaloup ochaloup force-pushed the weighted-choice branch 2 times, most recently from 14aa59f to 8afc7d1 Compare October 17, 2022 12:05
@ochaloup
Copy link
Author

PR in solana labs at solana-labs#3721

@ochaloup ochaloup force-pushed the weighted-choice branch 2 times, most recently from 78d7cfc to df89c91 Compare October 20, 2022 08:47
@ochaloup ochaloup changed the title Governance: Adding weighted choice for the VoteType Governance (at Marinade): Adding weighted choice for the VoteType Oct 20, 2022
@ochaloup ochaloup force-pushed the weighted-choice branch 5 times, most recently from 62c7181 to 9e01a9a Compare October 26, 2022 07:18
SebastianBor and others added 6 commits November 25, 2022 11:43
* wip: add voting_cool_off_time

* feat: Default voting_cool_off_time to 1h for 10h or longer votes

* wip: Assert valid voting cool of time

* chore: cleanup GovernanceConfig tests

* chore: Rename vote_end_time() to expected_vote_end_time()

* chore: test_cast_council_veto_vote_within_cool_off_time

* chore: test_cast_approve_vote_with_cannot_vote_in_cool_off_time_error

* chore: test_change_yes_vote_to_no_within_cool_off_time

* chore: Reorder GovernanceConfig fields

* chore: test_finalize_vote_with_cannot_finalize_during_cool_off_time_error

* fix: Remove default voting_cool_off_time

* fix: Use max = base + cool_off voting time setup

* chore: Cleanup

* chore: Fix test_change_yes_vote_to_no_within_cool_off_time

* chore: Adjust base, cool off and max voting time names

* chore: Create has_voting_base_time_ended
…s#3852)

* stake-pool: Split up more tests to help CI, avoid warping

* Remove unnecessary updates

* Split preferred test that keeps failing
…#3853)

* stake-pool: Refresh blockhash more often on update tests

* Bump down max pool size, updated correctly in solana-labs#3839

* Move withdraw test to another file

* Refactor withdraw tests more

* Get more blockhashes during `update_stake_pool_balance`
joncinque and others added 27 commits December 6, 2022 02:23
* Expose other types from CMT to allow usage on the client side while deserializing accounts.

* adds a convenient creation slot getter
…-labs#3878)

* require regular fee proof for self-transfers with fee

* process encrypted lo and hi fee separately
* Fixed three integer overflows in binary-option

* Update binary-option/program/src/state.rs

Change error type to AmountOverflow.

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
* docs: Add token-2022 audits and clarify upgradeability

* Update docs/src/token-2022.md

Co-authored-by: Michael Vines <mvines@gmail.com>

* Update docs/src/token-2022.md

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

* More updates

Co-authored-by: Michael Vines <mvines@gmail.com>
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
* stake-pool: Cleanup clippy, maybe fix a test

* Change withdraw instructions more

* Refresh blockhashes
Bumps [console](https://github.com/mitsuhiko/console) from 0.14.1 to 0.15.0.
- [Release notes](https://github.com/mitsuhiko/console/releases)
- [Changelog](https://github.com/mitsuhiko/console/blob/master/CHANGELOG.md)
- [Commits](console-rs/console@0.14.1...v0.15.0)

---
updated-dependencies:
- dependency-name: console
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

Bumps [crossbeam-utils](https://github.com/crossbeam-rs/crossbeam) from 0.8.5 to 0.8.11.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](crossbeam-rs/crossbeam@crossbeam-utils-0.8.5...crossbeam-utils-0.8.11)

---
updated-dependencies:
- dependency-name: crossbeam-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…py (solana-labs#3886)

Bumps [certifi](https://github.com/certifi/python-certifi) from 2022.6.15 to 2022.12.7.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](certifi/python-certifi@2022.06.15...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [num-traits](https://github.com/rust-num/num-traits) from 0.2.14 to 0.2.15.
- [Release notes](https://github.com/rust-num/num-traits/releases)
- [Changelog](https://github.com/rust-num/num-traits/blob/master/RELEASES.md)
- [Commits](rust-num/num-traits@num-traits-0.2.14...num-traits-0.2.15)

---
updated-dependencies:
- dependency-name: num-traits
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [certifi](https://github.com/certifi/python-certifi) from 2021.5.30 to 2022.12.7.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](certifi/python-certifi@2021.05.30...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…s#3717)

Bumps [mocha](https://github.com/mochajs/mocha) and [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha). These dependencies needed to be updated together.

Updates `mocha` from 9.2.2 to 10.1.0
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](mochajs/mocha@v9.2.2...v10.1.0)

Updates `@types/mocha` from 9.1.1 to 10.0.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-major
- dependency-name: "@types/mocha"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…-labs#3197)

Bumps [bn.js](https://github.com/indutny/bn.js) from 5.2.0 to 5.2.1.
- [Release notes](https://github.com/indutny/bn.js/releases)
- [Changelog](https://github.com/indutny/bn.js/blob/master/CHANGELOG.md)
- [Commits](indutny/bn.js@v5.2.0...v5.2.1)

---
updated-dependencies:
- dependency-name: bn.js
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix: stake-pool-js: add browser CJS build

* update package-lock.json

* run prettier

* only emit ts declaration files
* Governance: Remove proposal counter (solana-labs#127)

* feat: Use proposal seed instead of index

* chore: Rename and reset legacy1 to reserved1

* chore: Make Clippy happy

* chore: Fix Chat tests compilation

* Governance: Remove Realm voting proposal count (solana-labs#128)

* feat: Remove Realm.voting_proposal_count

* chore: Update comments

* chore: Add tests and explicit assertions for non existing accounts

* Governance: Remove TokenOwnerRecord total_votes_count (solana-labs#130)

* feat: Extend unrelinquished_votes_count to u64

* chore: Update comments and names

* chore: Update asserts

* chore: Update comments

* chore: Use u32:MAX to trim unrelinquished_votes_count

* chore: Make Clippy happy

* chore: Update versioning cleanup comments

* Governance: Active proposal count (solana-labs#131)

* feat: Add active_proposal_count to Governance

* feat: Reallocate GovernanceV1 to GovernanceV2

* chore: test_create_proposal_and_migrate_v1_governance_to_v2

* chore: Cleanup code

* chore: Update comments

* chore: Use assert_is_valid_realm instead of deserializing the account

* chore: Update comments

* chore: Update comments

* chore: Check for empty account first

* chore: Update comments

* fix: Assert new account size is greater than the existing one

* Governance: Proposal deposit (solana-labs#135)

* feat: Add active_proposal_count to Governance

* feat: Reallocate GovernanceV1 to GovernanceV2

* chore: test_create_proposal_and_migrate_v1_governance_to_v2

* chore: Cleanup code

* chore: Update comments

* chore: Use assert_is_valid_realm instead of deserializing the account

* chore: Update comments

* chore: Update comments

* chore: Check for empty account first

* feat: Add extra_lamports to create_and_serialize_account

* chore: Make Clippy happy

* feat: Implement Proposal security deposit

* chore: Make Clippy happy

* chore: Add proposal deposit amount tests

* feat: Implement RefundProposalDeposit

* chore: test_refund_proposal_deposit

* chore: Make Clippy happy

* chore: test_refund_proposal_deposit_with_cannot_refund_draft_proposal_error

* chore: test_refund_proposal_deposit_with_invalid_proposal_owner_record_error

* chore: test_refund_proposal_deposit_with_invalid_proposal_owner_error

* fix: Return deposit to deposit payer

* chore: Cleanup

* chore: test_refund_proposal_deposit_with_invalid_proposal_deposit_account_error

* fix: Remove unnecessary max(1) for account lamports

* Governance: Review feedback (solana-labs#139)

* chore: Update active_proposal_count comment

* chore: Update account indices in process_create_proposal

* fix: Disallow u8::MAX for deposit_exempt_proposal_count

* chore: Use u64 without option for extra_lamports

* fix: Use explicit version 1 for TokenOwnerRecord migration

* chore: Update math for RealmConfigAccount::get_max_size

* fix: Flag ProposalCoolOffTimeNotSupported as legacy instead of reusing it

* Governance: Add proposal and payer to ProposalDeposit account (solana-labs#141)

* feat: Add proposal and payer to ProposalDeposit account

* chore: Update tests

* feat: Use referential fields to check ProposalDeposit

* chore: Make Clippy happy

* chore: Update Proposal deposit amount comments

* chore: Update deposit amount comment

* chore: Update versions (solana-labs#142)
@ochaloup
Copy link
Author

Closing this. Replaced with solana-labs#3721 at upstream.

@ochaloup ochaloup closed this Dec 19, 2022
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.