Fix governance proposal kind ambiguity#448
Draft
carrion256 wants to merge 5 commits into
Draft
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
dd4aa5f to
7234c47
Compare
Reject broad accept_kind when multiple pending proposals share the requested GovernanceActionKind, so callers cannot accidentally accept an arbitrary matching proposal. Add a CapGroup regression proving ambiguous broad-kind acceptance leaves all proposals pending.
Make revoke_kind match accept_kind exactly-one semantics: a broad GovernanceActionKind revoke now fails with DuplicatePending when multiple pending proposals share that kind instead of cancelling all of them. Add a TimelockConfig regression proving ambiguous broad-kind revocation preserves both proposals.
Make the policy explicit: pending proposals keep their submit-time ready_at_ns even if the corresponding governance timelock is raised before acceptance. The regression accepts the curator proposal at the original maturity after raising the curator timelock.
7234c47 to
14fa1ec
Compare
Stop granting the governance contract full Curator authority at runtime bootstrap. Governance-executed policy commands now use the execute_governance identity check plus internal preauthorized policy mutation paths, while direct policy admin entrypoints remain Curator-gated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes governance proposal broad-kind ambiguity and documents the in-flight timelock policy with one finding-scoped commit per fix:
#FIND-065—accept_kindambiguity when multiple pending proposals share the same broad action kind.#FIND-088—revoke_kindpreviously cancelled all proposals of a broad kind whileaccept_kindaccepted only one.#FIND-095— in-flight proposals intentionally retain the submit-time timelock even if that timelock is raised later.Commits
fix governance accept kind ambiguity (#FIND-065)fix governance revoke kind semantics (#FIND-088)test governance in-flight timelock policy (#FIND-095)Changes
accept_kindfail withGovernanceError::DuplicatePendingwhen more than one pending proposal matches the requested broadGovernanceActionKind.revoke_kinduse the same exactly-one broad-kind policy instead of revoking every matching proposal.Triage notes
#FIND-091: current branch already carries focused no-change/classifier coverage around duplicate submissions, cap/group classifiers, and membership clear semantics; no additional code change was needed in this PR slice.#FIND-059: current branch already mirrors cap-group membership state and tests membership clear/no-change classification.#FIND-061: not changed here; broad abdication remains kind-level by design unless product wants a new precise-action abdication API.Verification
cargo fmt -p templar-soroban-governancecargo test -p templar-soroban-governance accept_kind_rejects_ambiguous_broad_kind -- --nocapturecargo test -p templar-soroban-governance revoke_kind_rejects_ambiguous_broad_kind -- --nocapturecargo test -p templar-soroban-governance in_flight_proposal_keeps_submit_time_timelock_after_timelock_raise -- --nocapturecargo test -p templar-soroban-governance -- --nocapture93961 bytes)This change is