-
Notifications
You must be signed in to change notification settings - Fork 355
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 Governor component #1180
Add Governor component #1180
Conversation
…eleased-package-#1141
…emove-dual-dispatchers
…eat/remove-mocks-from-released-package-#1141
* feat: remove modules * fix: mock * fix: linter * fix: tests * fix: mock * feat: apply review suggestions
…om-released-package-#1141
…eat/remove-mocks-from-released-package-#1141
…eat/remove-mocks-from-released-package-#1141
…eat/remove-mocks-from-released-package-#1141
packages/governance/src/governor/extensions/governor_counting_simple.cairo
Outdated
Show resolved
Hide resolved
packages/governance/src/governor/extensions/governor_timelock_execution.cairo
Outdated
Show resolved
Hide resolved
packages/governance/src/governor/extensions/governor_votes_quorum_fraction.cairo
Outdated
Show resolved
Hide resolved
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.
Fantastic job with the first iteration of tests! I left some comments
/// Temporary defined as a function since constant ByteArray is not supported yet. | ||
fn DEFAULT_PARAMS() -> Span<felt252>; |
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.
We should adjust the comment. Maybe test this with a non-empty span, WDYT?
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.
Comment adjusted. Will revisit tests after finishing tests for extensions.
…eat/governance2-#294
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.
Left a couple of non-blocking comments. Good job, LGTM!
.execute_batch(calls, 0, this_component.timelock_salt(description_hash)); | ||
|
||
// Cleanup | ||
this_component.Governor_timelock_ids.write(proposal_id, 0); |
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.
It may be a bit more secure to update the state prior to making an external call, guards against reentrancy
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.
Note that there are no checks associated with the value for this particular case. Even if we don't update the value it should be ok, since the state of the timelock proposal should be correct one even if we don't remove the id. Also, the target of the execute may want to verify the state of the proposal at some point, and the id being accessible can help with that.
/// NOTE: This function does not emit an event if the new voting delay is the same as the | ||
/// old one. |
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.
Could be more clear if we move the note here and in the similar functions to the end of the function description
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.
Good call.
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.
Let's keep the "Emit event" section at the end for consistency, but let's put the note right on top.
packages/governance/src/governor/extensions/governor_settings.cairo
Outdated
Show resolved
Hide resolved
…eat/governance2-#294
Fixes #294
PR Checklist