Git Product home page Git Product logo

chief-keeper's Introduction

chief-keeper

Build Status codecov

The chief-keeper monitors and interacts with DSChief and DSSSpells, which is the executive voting contract and a type of proposal object of the Maker Protocol.

Its purpose is to lift the hat in DSChief as well as streamline executive actions.

To 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.

While in operation, the chief-keeper:

  • Monitors each new block for a change in the state of executive votes
  • lifts the hat for the spell (yay) most favored (approvals[yay])
  • Schedules spells in the GSM by calling DSSSpell.schedule()
  • Executes spells after their eta has elapsed in the GSM by calling DSSSpell.cast()

Review

The following section assumes familiarity with the DSChief, DSSSpells, and DSPause (Governance Security Module), as well as the processes within MakerDAO Governance.

Architecture

alt text

chief-keeper interacts directly with the DS-Chief and DSSSpells.

Operation

This keeper is run continuously, and saves a local database of yays (spell addresses) and an yay:eta dictionary to reduce chain state reads. If 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.

Installation

Prerequisites:

  • Python v3.6.6
  • virtualenv
    • 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.

In order to clone the project and install required third-party packages please execute:

git clone https://github.com/makerdao/chief-keeper.git
cd chief-keeper
git submodule update --init --recursive
./install.sh

If tinydb isn't visible/installed through ./install.sh, simply run pip3 install tinydb after the commands above.

For some known Ubuntu and macOS issues see the pymaker README.

Sample Startup Script

Make a run-chief-keeper.sh to easily spin up the chief-keeper.

#!/bin/bash
/full/path/to/chief-keeper/bin/chief-keeper \
	--rpc-host 'https://sample.ParityNode.com:8545' \
	--network 'kovan' \
	--eth-from '0xABCAddress' \
	--eth-key 'key_file=/full/path/to/keystoreFile.json,pass_file=/full/path/to/passphrase/file.txt' \
	--chief-deployment-block 14374534

Testing

This project uses pytest for unit testing. Testing of Multi-collateral Dai is performed on a Dockerized local testchain included in tests\config.

In order to be able to run tests, please install development dependencies first by executing:

./install-dev.sh

You can then run all tests with:

./test.sh

Roadmap

License

See COPYING file.

Disclaimer

YOU (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. THE 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. YOU 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.

chief-keeper's People

Contributors

dizzy avatar godsflaw avatar jeannettemcd avatar kentonprescott avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.