Commit Graph

152 Commits

Author SHA1 Message Date
Sebastian Bor a15fee9d37
Governance: Unify borsh serialisation api (#4224) 2023-05-09 15:11:50 +00:00
dependabot[bot] ba083343ab
build(deps): bump serde from 1.0.152 to 1.0.162 (#4207)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-09 10:59:45 +00:00
Jon Cinque d01730a7aa
deps: Upgrade base64 to 0.21.0, remove where it's not used (#4204) 2023-05-08 16:10:57 +00:00
dependabot[bot] 733f4044d1
build(deps): bump proptest from 1.0.0 to 1.1.0 (#4184)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-05 20:53:57 +00:00
Sebastian Bor 139ed61e84
Governance: Update spl-gov changelog and version to 3.1.1 (#4140) 2023-04-25 17:05:34 +00:00
chalda 9587db4e12
Governance: MultiChoice type Weighted (#3721)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Sebastian.Bor <sebastian_bor@hotmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-12 15:59:45 +00:00
chalda 4b76dc9d67
Governance: complete proposal instruction (#3826)
Co-authored-by: Sebastian.Bor <sebastian_bor@hotmail.com>
2023-04-11 15:08:56 +00:00
0xShuk 7fe04d880b
Correction in native treasury PDA's doc comment (#4104) 2023-03-31 15:54:06 +00:00
Jon Cinque 34b57d62fe
docs: Clarify audit status of all programs, no S word (#4046) 2023-02-13 22:05:49 +00:00
chalda 4f648f9a02
Governance: add comment labels for error.rs (#4030) 2023-02-07 23:09:27 +00:00
chalda f013deb868
Governance: assertion for proposal final state (#3964) 2023-02-07 22:51:53 +00:00
joeaba 891b4bdad8
chore: update maintainer references (#4008) 2023-01-31 08:06:36 -05:00
Jon Cinque 88684d52a2
ci: Update repo to Solana 1.14.12 (#3989) 2023-01-19 21:47:03 +01:00
Sebastian Bor f600c9035d
Governance: Allow token owner to revoke their own membership (#3976)
* wip: Allow token owner to revoke their own membership

* chore: test_revoke_own_council_tokens

* chore: test_revoke_own_council_tokens_with_owner_must_sign_error

* chore: test_revoke_council_tokens_with_invalid_revoke_authority_error

* chore: Make Clippy Happy
2023-01-17 22:45:09 +00:00
chalda 19b8fae56c
Governance: adding error labels (#3845) 2022-12-22 15:40:05 +00:00
Sebastian Bor c750e03f50
Governance: v3.1 (#3915)
* Governance: Remove proposal counter (#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 (#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 (#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 (#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 (#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 (#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 (#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 (#142)
2022-12-15 12:01:37 +00:00
Jon Cinque ae994afa3e
Update repo to `edition = "2021"` (#3900) 2022-12-13 23:46:26 +01:00
Jon Cinque 5f4943802b
clippy: Remove `useless_conversion` (#3899) 2022-12-13 15:56:12 +01:00
samkim-crypto bb404a6af5
update solana to 1.14.10 (#3872) 2022-12-06 12:59:00 +09:00
Sebastian Bor 21cfaffc78
Governance: voting_cool_off_time (#3830)
* 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
2022-11-25 11:43:32 +00:00
Sebastian Bor dc18878ef1
Governance: Maintenance update (#3832)
* chore: Add comment to unused Governance account

* chore: fix typos

* chore: Update comments
2022-11-19 14:48:14 +00:00
Sebastian Bor c5fcbefe19
Governance: Remove stats only fields to make room for more Config values (#3828)
* fix: Remove voting_proposal_count

* chore: add governance size tests

* chore: fix chat tests compilation
2022-11-18 15:49:04 +00:00
Sebastian Bor af7c378c95
Revert "Governance: Extend Veto vote period by min_transaction_hold_up_time (#3808)" (#3827)
This reverts commit 84e5c830cc.
2022-11-18 11:35:21 +00:00
Sebastian Bor 84e5c830cc
Governance: Extend Veto vote period by min_transaction_hold_up_time (#3808)
* feat: Extend Veto vote period by min_transaction_hold_up_time

* chore: add veto vote within hold up time tests

* chore: test_cast_council_veto_vote_within_hold_up_time

* chore: try to limit no of jobs to fix build

* chore: limit jobs to 1

* Revert "chore: limit jobs to 1"

This reverts commit 03191b891754c3d5f71463588ec7ff35aaa88534.

* Revert "chore: try to limit no of jobs to fix build"

This reverts commit 0adce587df96029569b67c19f97f623324a0ae11.

* fix: use saturating_add

* chore: rename vote_end_time() to expected_vote_end_time()
2022-11-17 19:56:38 +00:00
Sebastian Bor dabb7799f6
Governance: Cleanup drive space before executing build (#3818)
* fix: split execution of spl-governance tests

* chore: test governance pull request action

* fix: increase tests timeout

* wip: test_cast_council_veto_vote

* Revert "wip: test_cast_council_veto_vote"

This reverts commit 3678eb867826bbd43292929598daa5cb84bcff17.

* fix: split use_veto_vote

* chore: display disk space between tests runs

* fix: cleanup space on build machine

* chore: remove Android from runner

* Revert "fix: split use_veto_vote"

This reverts commit 197cd02483f1e79b5b8a94b94489162f16b04c92.

* wip: disable test split

* chore: revert test-sbf changes
2022-11-16 18:29:14 +00:00
samkim-crypto 0c8fb24d47
upgrade solana-program to 1.14.6 (#3765) 2022-10-27 07:59:25 +09:00
Sebastian Bor 84a04d2d6c
feat: change dispose_account to support vote casting (#3744) 2022-10-24 23:00:06 +01:00
hanako mumei 3a87c8fc0a update solana to 1.14.4 2022-10-12 10:48:23 -07:00
Sebastian Bor aaaf537be3
Governance: Move reserved space to GovernanceConfig (#3628)
* chore: move reserved space to GovernanceConfig

* chore: fix build
2022-09-27 21:23:43 +01:00
Alexander Meißner 7172b329a2
Same thing as in #3637 but for with_upgrade_program_transaction(). (#3642) 2022-09-24 13:23:45 +02:00
Alexander Meißner aa5fdee00a
Refactor `test_create_program_governance` (#3637)
* Splits the unrealistically large transaction generated by with_governed_program() into many.

* Update apt packet list before attempting install in CI.
2022-09-23 21:36:34 +02:00
Sebastian Bor 7fdb082445
Governance: Implement Absolute max voter weight source (#3627)
* feat: Implement Absolute max voter weight source

* chore: Rename max_vote_weight to max_voter_weight

* chore: update comments

* chore: test_try_tip_vote_with_reduced_absolute_mint_max_vote_weight_and_vote_overflow

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-09-22 09:40:44 -04:00
Lucio M. Tato 54695b2334
Governance: add notes to ease collaboration (#3617) 2022-09-19 10:30:10 +01:00
Jon Cinque f97a3dc7cf
clippy: Deny integer arithmetic, add allows where needed (#3606) 2022-09-15 13:16:53 +02:00
Sebastian Bor a179eba71e
Governance: Community Veto Vote (#3506)
* feat: Enable Community Veto Vote

* chore: test_veto_vote_with_community_voter_weight_addin

* chore: test_veto_vote_with_community_max_voter_weight_addin

* chore: assert valid community veto vote threshold

chore: Fix merge conflict
2022-08-23 02:03:29 +02:00
Sebastian Bor c5db9cec78
Governance: Explicit disabled weight thresholds (#3501)
* feat: enforce min_weight_to_create_governance Disabled value

* chore: test_create_proposal_with_community_disabled_error
2022-08-23 00:48:02 +02:00
Sebastian Bor 232406a9b4
Governance: Add council_vote_tipping (#3500)
* wip: Add council_vote_tipping

* feat: Use VoteTipping for relevant mint

* chore: test_cast_early_council_vote_with_disabled_community_vote_tipping

* chore: test_cast_community_vote_with_early_council_and_disabled_community_vote_tipping

* Update help text for `propose` (#3505)

* Governance: Use mint authority to revoke membership tokens (#3498)

* chore: fix process_revoke_governing_tokens feature

* feat: Use governing token mint authority to authorise token revocation

* chore: Fix authority spelling

* Governance: Do not tip on max vote weight when tipping Disabled (#3499)

* fix: Do not tip on max vote weight when tipping Disabled

* chore: test_cast_vote_with_strict_tipping_and_inflated_max_voter_weight_votes

* chore: fix test name


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

* wip: Add council_vote_tipping

* feat: Use VoteTipping for relevant mint

* chore: test_cast_early_council_vote_with_disabled_community_vote_tipping

* chore: test_cast_community_vote_with_early_council_and_disabled_community_vote_tipping

* chore: Fix merge conflicts

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-08-23 00:35:35 +02:00
Sebastian Bor babf51941a
Governance: Do not tip on max vote weight when tipping Disabled (#3499)
* fix: Do not tip on max vote weight when tipping Disabled

* chore: test_cast_vote_with_strict_tipping_and_inflated_max_voter_weight_votes

* chore: fix test name


Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-08-22 21:58:05 +02:00
Sebastian Bor 10cf50ec2e
Governance: Use mint authority to revoke membership tokens (#3498)
* chore: fix process_revoke_governing_tokens feature

* feat: Use governing token mint authority to authorise token revocation

* chore: Fix authority spelling
2022-08-22 21:52:05 +02:00
Sebastian Bor 6dfc68db13
Governance: Council membership & plugins (#3344)
* chore: Use GovernanceTokenConfig

* wip: add council_token_config to RealmConfigAccount

* chore: update comment

* wip: use GoverningTokenConfigArgs for community token config

* chore: Change Proxy token type to Dormant

* chore: Update comments

* chore: Use GoverningTokenConfigAccountArgs for instructions creators

* chore: Use default  GoverningTokenType

* chore: Make community_token_args optional

* chore: Make Clippy happy

* chore: Update comments

* chore: Always create RealmConfigAccount

* chore: Set CouncilTokenConfig when realm is created

* feat: Update RealmConfigArgs in SetRealmConfig

* chore: Make Clippy happy

* chore: Assert RealmConfigAccount PDA

* wip: Use default RealmConfigAccount if the account doesn't exist

* chore: Remove use_community_voter_weight_addin and use_max_community_voter_weight_addin from RealmConfig

* chore: code review cleanup

* wip: Use voter weight addin for Council

* feat: Use max_voter_weight_plugin for Council

* feat: Impl RevokeGoverningTokens instruction

* chore: Make Clippy happy

* feat: Enforce governing token withdraw and deposit rules

* feat: Support minting deposits

* feat: Do not enforce token source owner for deposit validation

* chore: test_deposit_community_tokens_using_mint

* chore: Remove not implemented comment

* fix: Fix progrma id for resolving realm config for chat

* chore: Update instructions comments

* feat: Do not allow community Liquid token change to Membership

* chore: test_set_realm_config_with_liquid_community_token_cannot_be_changed_to_memebership_error

* chore: test_set_realm_config_for_community_token

* chore: use GoverningTokenConfig for test args

* chore: Refactor SetRealmConfigArgs

* chore: Update RealmSetupArgs names

* chore: test_set_realm_config_for_council_token_config

* chore: Revoke council tokens tests

* chore: test_revoke_council_tokens_with_realm_authority_must_sign_error

* chore: test_revoke_council_tokens_with_invalid_realm_authority_error

* chore: test_revoke_council_tokens_with_invalid_token_holding_error

* chore: RevokeGoverningToken tests

* chore: Dormant and Membership tokens tests

* chore: Using council plugin tests

* chore: RealmConfigAccount validation tests

* chore: Update Dormant token type configs

* fix: Reset legacy fields

* chore: Use Default macro for derivable defaults

* Chore: use assert functions to validate spl-token account and mint

* chore: Update Membership tokens comments

* chore: Pass governing_token_config_args as reference

* chore: Use single statement to return InvalidRevokeAmount error

* chore: Make Clippy happy - add derived Eq

Co-authored-by: Jon Cinque
2022-08-19 19:49:41 +02:00
hana 65769ce23d
Update rust to 1.60, solana to 1.11.6 (#3492)
also change bpf to sbf throughout the codebase

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-08-18 12:16:02 -07:00
Tyera Eulberg 3c54aecfe9
Bump solana to v1.10.35 (#3485) 2022-08-16 12:33:24 -06:00
Pierre 52d329ee53
fix reference to the field hold_up_time in the governance README (#3428)
* fix reference to the field hold_up_time

* remove incorrect space

Co-authored-by: Arrowana <8245419+Arrowana@users.noreply.github.com>
2022-08-05 00:38:44 +02:00
Tyera Eulberg 7c6235d9e7
Bump token to v3.5.0 and ata to v1.1.1 (#3430) 2022-08-04 01:09:38 -06:00
Jon Cinque f5ce86d43d
token/ata: Bump versions to 3.4.0 and 1.1.0, respectively (#3427) 2022-08-04 01:03:04 +02:00
Tyera Eulberg c00194d225
Bump solana crates to v1.10.33 (#3385) 2022-07-27 11:28:14 -06:00
Daniel Kelleher c061a34cde
Now that token deposits can be used as inputs to vote plugins, remove the constraint that prevents token deposits when a vote plugin is used. (#3311) 2022-07-07 19:10:20 +01:00
Seth Girvan 1ca80547c8
Governance: set voting_completed_at to actual end time (#3179) 2022-07-06 12:24:05 +01:00
Jon Cinque c1ee6a58be
Update Solana crates to 1.10.29 (#3303) 2022-07-01 16:51:01 -04:00
Sebastian Bor aaca5353bc
chore: add test to show flash loan attack is not possible (#3238) 2022-06-11 12:56:06 +01:00