TimelockController 'salt' is unrecoverable yet required for execution
See original GitHub issueWhen scheduling a transaction using the TimelockController
, one is required to provide a salt
to distinguish otherwise identical transactions. The salt
parameter is not emitted in the CallScheduled
event which makes it impossible to recover. Yet salt
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 the CallScheduled
event: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/458697be32f41946e1ab66e946c7cf373c79577d/contracts/governance/TimelockController.sol#L35
salt
is required for the execute
& executeBatch
calls: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/458697be32f41946e1ab66e946c7cf373c79577d/contracts/governance/TimelockController.sol#L267
Instead of salt
the execute
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
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
So we need to emit the
salt
in an event, but we can’t change the existing event because it changes the event selector, which is a little concerning because any monitoring infrastructure in place will not see the new event.We can emit the salt in a new event
ProposalSalt(uint256 indexed proposalId, bytes32 salt)
.@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