Hey Ben, thanks for taking some time to analyze the contracts and giving feedback.
I didn’t imagine this requeueing scenario, so I wasn’t sure if it was possible. I added a test case to make it easier to simulate and collaborate, feel free to run the repo and test.
What you mentioned is correct if we solely analyze the Governor.sol
contract used in the ENSGovernor.sol
However, there appears to be some confusion regarding the behavior of the state
function and the inheritance in the GovernorTimelockControl
contract. Here’s a clarification:
- Inheritance Structure:
ENSGovernor
contract inherits theGovernorTimelockControl
contract that inherits theGovernor
contract, meaning it extends the functionality ofGovernor
and can override its functions.
- GovernorTimelockControl.state() Function:
-
When
state(proposalId)
is called onGovernorTimelockControl
, it first invokes theGovernor.state()
function, which will returnsucceeded
. -
After obtaining the initial state from
Governor.state()
,GovernorTimelockControl
performs additional checks (see Line 49 ofGovernorTimelockControl.sol
). -
If the proposal wasn’t queued before, it returns
succeeded
, otherwise it performs the checks below. -
It checks the proposal status in the Timelock using
timelock.isOperationDone
, which returns false if the operation is not completed. -
Based on these checks, if the proposal is not in an
executed
state in the Timelock, the function will return the proposal state asqueued
.
- Requeueing Constraints:
- If an attempt is made to requeue a proposal that has been directly cancelled in the Timelock, the
queue()
call will revert withGovernor: proposal not successful
due to the proposal state beingqueued
.
Conclusion
The feedback may not have fully accounted for the overridden state
function in GovernorTimelockControl
. The additional checks ensure the proposal’s status in the Timelock is accurately reflected. Therefore, a proposal cannot be requeued once it has been canceled directly in the Timelock.
I hope this clarifies how the state
and queue
function in ENSGovernor
operates and addresses the concerns raised.
Again, thank you for bringing this up, the more eyes we have on those contracts and proposals on the DAO, the better. I encourage you to take a deeper look at the contracts so we can find more nuances.