Skip to content
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

Auto generate metadata for TC proposals #900

Merged
merged 14 commits into from
Jun 28, 2022
Merged

Conversation

thomas-waite
Copy link
Contributor

@thomas-waite thomas-waite commented Jun 13, 2022

Feature: Auto-generate the metadata for TC proposals

Summary

Automatically generates the metadata for registering TC proposals in the GovernanceMetadataRegistry: https://etherscan.io/address/0xd78Cd3AaE6168BE43B548877aAc68312B9df9AFb

Context

Registering proposals in the metadata registry is currently too high friction. It requires a seperate transaction by an engineer after a proposal has been queued on the TC timelock.

Solution

This PR outputs the calldata for the register metadata transaction that should be submitted to the registry at the same time the proposal is queued.

The podId is known for the TC (25) and the timelock proposalID can be computed deterministically ahead of time locally. The metadata human readable description of what the proposal does is taken from the proposals/description/fip_x.ts proposal.

New proposal submission flow

When submitting a TC proposal on the TC safe:

  1. Run DEPLOY_FILE=fip_x npm run calldata
  2. Get the Calldata (which will schedule the proposal) and the Metadata calldata (which will register the human readable description)
  3. Use the Gnosis Safe Transaction builder (turn on Custom data) to schedule two transactions:
    a. Call to the TC timelock (0xe0C7DE94395B629860Cbb3c42995F300F56e6d7a) with the Calldata
    b. Call to the Governance Metadata registry (0xd78Cd3AaE6168BE43B548877aAc68312B9df9AFb) with Metadata calldata
  4. Queue that transaction as normal
  5. When it comes to executing the proposal in the TC timelock, execute as normal

PR Checklist - Feature (Proposal)

  • All Tests Passing
  • Proposal Added to ProposalsConfig
  • Fork Block Correct
  • Remove Any .only's on Tests
  • Update Documentation If Needed
  • Update Roles Config
  • Proposal Submitted

@thomas-waite thomas-waite self-assigned this Jun 13, 2022
scripts/utils/constructProposalCalldata.ts Outdated Show resolved Hide resolved
scripts/utils/constructProposalCalldata.ts Outdated Show resolved Hide resolved
proposalId,
proposal.description
]);
return `Calldata: ${calldata}\nMetadata Calldata: ${registerMetadataCalldata}\nExecute Calldata: ${executeCalldata}`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's strange to me that we're returning a formatted string. If we want to log this to console, we should do that explicitly; the string returned should just be the pure calldata, imo.

Copy link
Contributor Author

@thomas-waite thomas-waite Jun 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function generates the string of calldata, returns that and it is later logged at the top level. I personally like that so you don't have logging going on several layers of abstraction down, it's clear where it's coming from

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that's what I'm saying - the logging should happen at the higher level

scripts/utils/constructProposalCalldata.ts Outdated Show resolved Hide resolved
scripts/utils/simulateTimelockProposal.ts Outdated Show resolved Hide resolved
@thomas-waite thomas-waite changed the title [WIP] Auto generate metadata for TC proposals Auto generate metadata for TC proposals Jun 15, 2022
@thomas-waite thomas-waite marked this pull request as ready for review June 15, 2022 14:33
Joeysantoro
Joeysantoro previously approved these changes Jun 20, 2022
@thomas-waite thomas-waite requested a review from a team as a code owner June 28, 2022 14:07
@thomas-waite thomas-waite merged commit 3c0daae into develop Jun 28, 2022
@thomas-waite thomas-waite deleted the auto-register-metadata branch June 28, 2022 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants