Maker Protocol Technical Docs
  • MakerDAO Technical Docs
  • Getting Started
    • Maker Protocol 101
  • Smart Contract Modules
    • Dai Module
      • Dai - Detailed Documentation
    • Core Module
      • Vat - Detailed Documentation
      • Spot - Detailed Documentation
    • Collateral Module
      • Join - Detailed Documentation
    • Liquidation 2.0 Module
    • System Stabilizer Module
      • Flapper - Detailed Documentation
      • Flopper - Detailed Documentation
      • Vow - Detailed Documentation
    • Oracle Module
      • Oracle Security Module (OSM) - Detailed Documentation
      • Median - Detailed Documentation
    • MKR Module
    • Governance Module
      • Spell - Detailed Documentation
      • Pause - Detailed Documentation
      • Chief - Detailed Documentation
    • Rates Module
      • Pot - Detailed Documentation
      • Jug - Detailed Documentation
    • Proxy Module
      • Proxy Actions - Detailed Documentation
      • Vote Proxy - Detailed Documentation
      • CDP Manager - Detailed Documentation
      • DSR Manager - Detailed Documentation
    • Flash Mint Module
    • Maker Protocol Emergency Shutdown
      • Emergency Shutdown for Partners
      • The Emergency Shutdown Process for Multi-Collateral Dai (MCD)
      • End - Detailed Documentation
      • ESM - Detailed Documentation
  • Glossary
    • MCD Glossaries
    • Smart Contract Annotations
  • Deployment Addresses
    • Maker Protocol Deployments
  • Security
    • Security for the Maker Protocol
  • Building on top of the Maker Protocol
    • Developer Guides and Tutorials
    • The Dai Javascript Library of the Maker Protocol
      • Getting started
      • Configuration
        • Plugins
      • Vault manager
      • Collateral types
      • Dai Savings Rate
      • Currency units
      • System data
      • Advanced
        • Transaction manager
        • DSProxy
        • Events
        • Using multiple accounts
        • Adding a new service
      • Single-Collateral Sai
        • Collateralized Debt Position
        • CDP Service
        • Price Service
        • System Status
        • Tokens
        • Token Conversion
        • Exchange Service
    • Pymaker
  • Keepers
    • The Auctions of the Maker Protocol
    • Auction Keepers
      • Auction Keeper Bot Setup Guide
    • Market Maker Keepers
      • Market Maker Keeper Bot Setup Guide
    • Cage Keeper
    • Simple Arbitrage Keeper
    • Chief Keeper
  • Command-line Interfaces
    • Seth
    • Multi Collateral Dai (MCD) CLI
    • Dai and Collateral Redemption during Emergency Shutdown
    • Emergency Shutdown (ES) CLI
  • Miscellaneous
    • Liquidations 1.2 System (Deprecated)
      • Cat - Detailed Documentation
      • Flipper - Detailed Documentation
    • SCD <> MCD Migration
    • Upgrading to Multi-Collateral Dai Guide
Powered by GitBook
On this page
  • Introduction
  • Architecture
  • Operation
  • Testing
  • Roadmap
  • License
  • Support
Export as PDF
  1. Keepers

Chief Keeper

Keeper that lifts the hat and streamlines executive actions

PreviousSimple Arbitrage KeeperNextSeth

Last updated 5 years ago

Introduction

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

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 , DSSSpells, and (Governance Security Module), as well as the processes within .

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:

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

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 'sample.ParityNode.com' \
	--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

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

pip3 install -r requirements-dev.txt

You can then run all tests with:

./test.sh

Roadmap

License

Support

For some known Ubuntu and macOS issues see the README.

Download

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

See file.

If you have questions regarding Cage Keepers, please reach out to us on the channel on .

Python v3.6.6
virtualenv
pymaker
docker and docker-compose
pytest
Dynamic gas pricing strategy
COPYING
#keeper
chat.makerdao.com
DSChief
Maker Protocol
DSChief
DSPause
MakerDAO Governance