Why do queue() and execute() not just take the proposalId

Hi, just wondering why targets/values/calldatas are needed for things like GovernorTimelockControl.queue() and Governor.execute()? Why not just provide the proposalId?

I'm doing something where I want to call .queue()/.execute() from another contract, but I won't have the targets/values/calldatas, only the proposalId.

I think if you read the code, you will find, proposalId can be calculated by these parameters

uint256 proposalId = hashProposal(targets, values, calldatas, keccak256(bytes(description)));

Yes, I'm asking what is the reasoning behind the signature of method being targets/values/calldatas/description instead of proposalId. As currently implemented, the caller needs to keep targets/values/calldatas/description in order to call queue()/execute(). Which means calling those functions from another contract is cumbersome, because 4 values need to be saved/passed around, as opposed to one value (proposalId)

If the functions took the proposalId as the argument, the contract would need to store the proposal parameters in storage. Storage is expensive, and to save on this expensive resource the parameters are resubmitted when needed.

1 Like

Ah, that makes sense. Thanks.