-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
TimelockController 'salt' is unrecoverable yet required for execution #3216
Comments
Hello @0x0scion and thanks for raising this issue
If we don't run the hashing operation, how do we check that the other parameters (target, value, data) match the id that was scheduled? If we don't check that, you could possibly use any scheduled operation's id with unrelated params, and execute another operation. It's true that the salt not being present in the event is disturbing. I wonder how we missed that / if we had a reason for not including it. |
Ah, yes, did not think this through all the way - striking out that suggestion above. |
@Amxx @0x0scion Hey guys! I was wondering, doesn't this logic also apply to |
@ashwinYardi Cancel doesn't have other params. It just cancels the proposal that has a given ID. We could have required the cancel call to send all the details, hash them, and cancel that, but it would have been more expensive, and not safer. In short
|
So we need to emit the We can emit the salt in a new event |
I would assume it's common to use salt=0. Feels like we could emit the event only when it isn't 0. |
When scheduling a transaction using the
TimelockController
, one is required to provide asalt
to distinguish otherwise identical transactions. Thesalt
parameter is not emitted in theCallScheduled
event which makes it impossible to recover. Yetsalt
is required for executing the scheduled transaction transaction,even though it isn't necessary and more gas efficient if.id
is used instead💻 Environment
Openzeppelin v4.5.0 / hardhat
📝 Details
salt
is missing from theCallScheduled
event:openzeppelin-contracts/contracts/governance/TimelockController.sol
Line 35 in 458697b
salt
is required for theexecute
&executeBatch
calls:openzeppelin-contracts/contracts/governance/TimelockController.sol
Line 267 in 458697b
Instead ofsalt
theexecute
methods should be consuming the hashed operation (id
) directly, since that id is readily available via event data. This would also save on gas since there is no need to re-run the hashing operation.Happy to submit a PR
The text was updated successfully, but these errors were encountered: