feat(governance): let proposer cancel a collective proposal early#1428
Draft
gilescope wants to merge 2 commits into
Draft
feat(governance): let proposer cancel a collective proposal early#1428gilescope wants to merge 2 commits into
gilescope wants to merge 2 commits into
Conversation
Adds pallet-collective-proposer-cancel and wires it as two instances (CouncilProposerCancel, TechnicalCommitteeProposerCancel). Each instance exposes a cancel_proposal extrinsic that lets the original proposer withdraw their pallet_collective proposal without waiting out the 5-day voting window or marshalling enough NO votes for early disapproval. pallet_collective::disapprove_proposal and kill are gated on EnsureRoot, which on this chain is only reachable through a successful federated motion. That left no quick path to retract a clearly-bad proposal. Proposer identity is recovered from pallet_collective::CostOf. Both collectives now use a no-deposit RecordProposer MaybeConsideration in runtime-common so that map is populated; under the previous unit () Consideration it was left empty.
Contributor
|
Hi @gilescope ! It seems that it fails with
|
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.


Overview
Adds a
cancel_proposalextrinsic to a new pallet,pallet-collective-proposer-cancel, wired as two instances —CouncilProposerCancelandTechnicalCommitteeProposerCancel. Each instance lets the original proposer withdraw theirpallet_collectiveproposal without waiting out the 5-day voting window or organising enough NO votes for early disapproval.Why
pallet_collective::disapprove_proposalandkillare gated onEnsureRoot, and Root on this chain only comes via a successful federated motion (a 5-day vote). That meant an obviously-bad proposal could not be cleared cheaply by its own author — the only options were marshalling NO votes or waiting out the window. This was raised in chat: "We have no clean way to cancel a proposal early… was it a design choice or should we implement a workaround?". This PR adds the workaround: a tightly-scoped extrinsic that only the original proposer can call.How
pallets/collective-proposer-cancel(instance-generic over apallet_collective::Config<I>). Thecancel_proposal(hash)extrinsic looks the proposer up inpallet_collective::CostOf, verifies the caller matches, releases any held deposit, and callspallet_collective::Pallet::do_disapprove_proposal.CostOf. Both collective instances previously hadConsideration = (), which causesis_none() == trueandCostOfis never written. They now useruntime_common::governance::RecordProposer— a tiny no-depositMaybeConsiderationimpl that returnsis_none() == falseso the(AccountId, _)row is stored. No deposit is taken; encoded size is unchanged from the unit type.Consideration = ()(or anyMaybeConsiderationwhoseis_none() == true),cancel_proposalalways returnsProposerNotRecorded.DisapproveOrigin/KillOriginremainEnsureRoot— the new path doesn't widen Root's blast radius, it just adds an orthogonal proposer-only path that cannot affect anyone else's proposal.🗹 TODO before merging
/bot rebuild-metadataon this PR — adding pallets and changingCostOf's value type means runtime metadata must be regenerated.📌 Submission Checklist
git commit -s) for the DCO🧪 Testing Evidence
Unit tests in
pallets/collective-proposer-cancel/src/tests.rscover:NotProposer, original storage intactProposalMissingProposalMissingProposalMissingcargo clippy -p midnight-node-runtime -p pallet-collective-proposer-cancel -p runtime-common --all-targets— clean.🔱 Fork Strategy
Links