{"id":19096773,"url":"https://github.com/makerdao/chief-keeper","last_synced_at":"2025-04-30T14:16:06.343Z","repository":{"id":46456564,"uuid":"227915626","full_name":"makerdao/chief-keeper","owner":"makerdao","description":"Maker Keeper Framework: Keeper that lifts the hat and streamlines executive actions","archived":false,"fork":false,"pushed_at":"2025-02-04T03:26:31.000Z","size":818,"stargazers_count":8,"open_issues_count":2,"forks_count":10,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-19T04:40:45.395Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/makerdao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-12-13T20:19:36.000Z","updated_at":"2025-02-04T03:26:34.000Z","dependencies_parsed_at":"2023-10-23T17:36:16.892Z","dependency_job_id":"0b151d85-2382-4f10-9f7e-06595e9b597b","html_url":"https://github.com/makerdao/chief-keeper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fchief-keeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fchief-keeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fchief-keeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fchief-keeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makerdao","download_url":"https://codeload.github.com/makerdao/chief-keeper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251719695,"owners_count":21632731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T03:37:46.465Z","updated_at":"2025-04-30T14:16:06.288Z","avatar_url":"https://github.com/makerdao.png","language":"Python","readme":"# chief-keeper\n\n![Build Status](https://github.com/makerdao/chief-keeper/actions/workflows/.github/workflows/tests.yaml/badge.svg?branch=master)\n[![codecov](https://codecov.io/gh/makerdao/chief-keeper/branch/master/graph/badge.svg)](https://codecov.io/gh/makerdao/chief-keeper)\n\n\nThe `chief-keeper` monitors and interacts with [DSChief](https://github.com/dapphub/ds-chief) and DSSSpells, which is the executive voting contract and a type of proposal object of the [Maker Protocol](https://github.com/makerdao/dss).\n\nIts purpose is to lift the `hat` in DSChief as well as streamline executive actions.\n\nTo `lift` a spell, that spell must have more approvals than the current `hat`. The approvals of this spell can fluctuate and be surpassed by other spells, some of which could be malicious. This keeper \"guards\" the `hat` by ensuring the spell with the most approval is always the `hat`.  The `chief-keeper` does this in order to maximize the barrier of entry (approval) to `lift` a spell to the hat, thus acting as a \"guard\" against malicious governance actions.\n\nWhile in operation, the `chief-keeper`:\n* Monitors each new block for a change in the state of executive votes\n* `lift`s the hat for the spell (`yay`) most favored (`approvals[yay]`)\n* Schedules spells in the GSM by calling `DSSSpell.schedule()`\n* Executes spells after their `eta` has elapsed in the GSM by calling `DSSSpell.cast()`\n\n### Review\nThe following section assumes familiarity with the [DSChief](https://github.com/dapphub/ds-chief), DSSSpells, and [DSPause](https://github.com/dapphub/ds-pause) (Governance Security Module), as well as the processes within [MakerDAO Governance](https://community-development.makerdao.com/governance).\n\n## Architecture\n![alt text](operation.jpeg)\n\n`chief-keeper` interacts directly with the `DS-Chief` and `DSSSpell`s.\n\n## Operation\n\nThis keeper is run continuously, and saves a local database of `yays` (spell addresses) and an `yay:eta` dictionary to reduce chain state reads.\nIf you'd like to create your own database from scratch, first delete `src/database/db_mainnet.json` before running `bin/chief-keeper`; the initial query could take up to 15 minutes.\n\n### Installation\n\nPrerequisites:\n- [Python v3.6.6](https://www.python.org/downloads/release/python-366/)\n- [virtualenv](https://virtualenv.pypa.io/en/latest/)\n    - This project requires *virtualenv* to be installed if you want to use Maker's python tools. This helps with making sure that you are running the right version of python and checks that all of the pip packages that are installed in the **install.sh** are in the right place and have the right versions.\n\nIn order to clone the project and install required third-party packages please execute:\n```\ngit clone https://github.com/makerdao/chief-keeper.git\ncd chief-keeper\ngit submodule update --init --recursive\n./install.sh\n```\nIf `tinydb` isn't visible/installed through `./install.sh`, simply run `pip3 install tinydb` after the commands above.\n\nFor some known Ubuntu and macOS issues see the [pymaker](https://github.com/makerdao/pymaker) README.\n\n\n### Sample Startup Script\n\nMake a run-chief-keeper.sh to easily spin up the chief-keeper.\n\n```\n#!/bin/bash\n/full/path/to/chief-keeper/bin/chief-keeper \\\n\t--rpc-host 'https://sample.ParityNode.com:8545' \\\n\t--network 'kovan' \\\n\t--eth-from '0xABCAddress' \\\n\t--eth-key 'key_file=/full/path/to/keystoreFile.json,pass_file=/full/path/to/passphrase/file.txt' \\\n\t--chief-deployment-block 14374534\n```\n\n\n## Testing\n\n- Download [docker and docker-compose](https://www.docker.com/get-started)\n\nThis project uses [pytest](https://docs.pytest.org/en/latest/) for unit testing.  Testing of Multi-collateral Dai is\nperformed on a Dockerized local testchain included in `tests\\config`.\n\nIn order to be able to run tests, please install development dependencies first by executing:\n```\n./install-dev.sh\n```\n\nYou can then run all tests with:\n```\n./test.sh\n```\n\n## Roadmap\n- [X]  [Dynamic gas pricing strategy](https://github.com/makerdao/market-maker-keeper/blob/master/market_maker_keeper/gas.py)\n\n\n## License\n\nSee [COPYING](https://github.com/makerdao/chief-keeper/blob/master/COPYING) file.\n\n### Disclaimer\n\nYOU (MEANING ANY INDIVIDUAL OR ENTITY ACCESSING, USING OR BOTH THE SOFTWARE INCLUDED IN THIS GITHUB REPOSITORY) EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SOFTWARE IS AT YOUR SOLE RISK.\nTHE SOFTWARE IN THIS GITHUB REPOSITORY IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nYOU RELEASE AUTHORS OR COPYRIGHT HOLDERS FROM ALL LIABILITY FOR YOU HAVING ACQUIRED OR NOT ACQUIRED CONTENT IN THIS GITHUB REPOSITORY. THE AUTHORS OR COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS CONCERNING ANY CONTENT CONTAINED IN OR ACCESSED THROUGH THE SERVICE, AND THE AUTHORS OR COPYRIGHT HOLDERS WILL NOT BE RESPONSIBLE OR LIABLE FOR THE ACCURACY, COPYRIGHT COMPLIANCE, LEGALITY OR DECENCY OF MATERIAL CONTAINED IN OR ACCESSED THROUGH THIS GITHUB REPOSITORY.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakerdao%2Fchief-keeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakerdao%2Fchief-keeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakerdao%2Fchief-keeper/lists"}