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

Look into and document potential modes of operation #39

Open
mds1 opened this issue Dec 21, 2021 · 2 comments
Open

Look into and document potential modes of operation #39

mds1 opened this issue Dec 21, 2021 · 2 comments

Comments

@mds1
Copy link
Contributor

mds1 commented Dec 21, 2021

@moodysalem Here's the 4 potential modes of operation we discussed. I think all but the GitHub Action approach are a bit up in the air at this point, pending some searching into how to support the last one and how it impacts the others. Let me know if this looks right / needs changes / etc.

GitHub Actions

This will be a mode of operation

Cron job through GitHub Actions workflow that runs hourly. For each pair of DAO_NAME and GOVERNOR_ADDRESS in governance-checks.yaml, look for any pending proposals (or more generally, unsimulated proposals, to also simulate past proposals at least once?), pull the proposal data from the chain, simulate with tenderly, and write the report to the reports branch of the repo.

To add a DAO to the workflow, fork this repo, add your DAO_NAME and GOVERNOR_ADDRESS, then submit a PR back to main with those changes

TypeScript Simulation Files

TBD whether to support this

This mode would work as follows:

  1. Fork the repo
  2. In the sims folder, create a configuration file called mySimName.sim.ts (see existing template files)
  3. Run SIM_NAME=mySimName yarn start
  4. Report is saved in reports/<daoName>/<governorAddress>

@uniswap/governance-seatbelt npm package

TBD whether to support this

Users can install the @uniswap/governance-seatbelt package as normal, which exports a single function with the below interface:

async function simulate(config: SimulationConfig): Promise<SimulationResult>

Users can then generate the configuration object with any tooling they want, and run a simulation with await simulate(config)

npx @uniswap/governance-seatbelt <configFile>

TBD whether to support this

Let users define a TS config file anywhere and run it without needing to explicitly install an npm package using npx @uniswap/governance-seatbelt <path/to/configFile.ts>

@moodysalem
Copy link
Contributor

maybe for the @uniswap/governance-seatbelt npm package we also export code for rendering and implement one for markdown
e.g.

interface Renderer<T> {
  render(result: SimulationResult): T 
}

class MarkdownRenderer implements Renderer<string> {
  render(result: SimulationResult): string {
    // ... whatever we do for the github actions rendering
  }
}

@mds1
Copy link
Contributor Author

mds1 commented Dec 22, 2021

I like that 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants