-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Add a public Governor.cancel function #3983
Add a public Governor.cancel function #3983
Conversation
🦋 Changeset detectedLatest commit: e9e5bfb The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! I only have a comment about the test helper.
Looking at the gas benchmarks it seems there is a +30% increase in At the same time, I think this is a reasonable tradeoff. Note that in 5.0 with better packing the cost of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good with me if you agree with the tradeoff I explained above.
Agree with your analysis and with this tradeoff. Two things for future PRs:
|
@@ -99,20 +99,15 @@ abstract contract GovernorCompatibilityBravo is IGovernorTimelock, IGovernorComp | |||
); | |||
} | |||
|
|||
function cancel(uint256 proposalId) public virtual override { | |||
function cancel(uint256 proposalId) public virtual override(IGovernor, Governor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs docs explaining the logic, also that it overrides and doesn't call super.cancel
from the core Governor.
* @dev Cancel a proposal. This is restricted to Pending proposal (before the vote starts) and is restricted to | ||
* the proposal's proposer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't really accurate here. The specific logic depends on the modules, for example it's different between Governor and GovernorCompatibilityBravo, so it should be documented in Governor
.
I don't know. I would say no because the governor contracts are already kind of large in code size (Bravo compat module is over the limit unless compiled with optimizations). Do we know roughly how much code size / deployment cost is added by such a getter? |
Fixes #3436
Note: in next breaking (5.0) we should remove the proposer
GovernorCompatibilityBravo.ProposalDetails
as its is now inGovenor.Proposal
PR Checklist
npx changeset add
)