From f13cea28af2a45b0fd236315ad160c94cea9920f Mon Sep 17 00:00:00 2001 From: szotov Date: Wed, 27 Feb 2019 17:02:52 +0300 Subject: [PATCH 1/5] Draft of docs for slashing --- docs/source/architecture/contracts.md | 14 +++++----- docs/source/architecture/slashing.rst | 37 +++++++++++++++++++++++++++ docs/source/index.rst | 1 + 3 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 docs/source/architecture/slashing.rst diff --git a/docs/source/architecture/contracts.md b/docs/source/architecture/contracts.md index c656a57d4..c1aa8aa36 100644 --- a/docs/source/architecture/contracts.md +++ b/docs/source/architecture/contracts.md @@ -6,6 +6,7 @@ * `NuCypherToken` ERC20 token contract * `MinersEscrow` Holds Ursula's stake, stores information about Ursula's activity, and assigns a reward for participating in the NuCypher network. (The `Issuer` contract is part of the `MinersEscrow`) * `PolicyManager` Holds a policy's fee and distributes fee by periods +* `MiningAdjudicator` Manages [the slashing protocol](slashing) * `Upgradeable` Base contract for [upgrading](upgradeable_proxy_contracts) * `Dispatcher` Proxy to other contracts. This provides upgrading of the `MinersEscrow` and `PolicyManager` contracts * `UserEscrow` Locks tokens for predetermined time. Tokens will be unlocked after specified time and all tokens can be used as stake in the `MinersEscrow` contract @@ -15,14 +16,15 @@ 1. Deploy `NuCypherToken` with all future supply tokens 2. Deploy `MinersEscrow` with a dispatcher targeting it 3. Deploy `PolicyManager` with its own dispatcher, also targeting it -4. Transfer reward tokens to the `MinersEscrow` contract. These tokens are future mining rewards, and initial allocations -5. Run the `initialize()` method to initialize the `MinersEscrow` contract -6. Set the address of the `PolicyManager` contract in the `MinersEscrow` by using the `setPolicyManager(address)` -7. Pre-deposit tokens to the `MinersEscrow` if necessary: +4. Deploy `MiningAdjudicator` with a dispatcher +5. Transfer reward tokens to the `MinersEscrow` contract. These tokens are future mining rewards, and initial allocations +6. Run the `initialize()` method to initialize the `MinersEscrow` contract +7. Set the address of the `PolicyManager` contract in the `MinersEscrow` by using the `setPolicyManager(address)` +8. Pre-deposit tokens to the `MinersEscrow` if necessary: * Approve the transfer tokens for the `MinersEscrow` contract using the `approve(address, uint)` method. The parameters are the address of `MinersEscrow` and the amount of tokens for a miner or group of miners; * Deposit tokens to the `MinersEscrow` contract using the `preDeposit(address[], uint[], uint[])` method. The parameters are the addresses of the miners, the amount of tokens for each miner and the periods during which tokens will be locked for each miner -8. Deploy `UserEscrowProxy` with `UserEscrowLibraryLinker` targeting it -9. Pre-deposit tokens to the `UserEscrow`, and if necessary: +9. Deploy `UserEscrowProxy` with `UserEscrowLibraryLinker` targeting it +10. Pre-deposit tokens to the `UserEscrow`, and if necessary: * Create new instance of the `UserEscrow` contract * Transfer ownership of the instance of the `UserEscrow` contract to the user diff --git a/docs/source/architecture/slashing.rst b/docs/source/architecture/slashing.rst new file mode 100644 index 000000000..6ad54fdff --- /dev/null +++ b/docs/source/architecture/slashing.rst @@ -0,0 +1,37 @@ +The Slashing Protocol +===================== + +TBD + + +Violations +---------- + +TBD + + +Calculating the slashing penalty +-------------------------------- + +TBD (https://github.com/nucypher/nucypher/issues/803) + + +How slashing affects stake +-------------------------- + +The punishment is to reduce the number of tokens that belongs to the offending staker. +In this case, the main task is not to violate the logic of locking tokens. +The whole stake consists of several parts: + +* tokens which the staker can withdraw at any moment +* tokens locked for a specific period + +Since a staker can divide a stake (extend a part of a stake), as well as lock new tokens, then the total stake is represented as the sum of all the sub stakes active at a particular period. Each sub stake has a beginning and duration, which is reduced only upon confirmation of the activity. Staker slashed on the principle: first a sub stake, which will end earlier. Therefore, in the first place, the not-locked part of tokens belonging to the staker is slashed. After that, if necessary, sub stakes are adjusted: finds the shortest sub stake and decreases by the required amount. If this is not enough, then the next short sub stake is searched for, and so on. A sub stake that begins in the next period is checked separately. + +Example: + +1000 tokens belong to the staker, 1st sub stake - 500 tokens are locked for 10 periods, 2nd sub stake - 200 tokens for 2 periods and 3rd sub stake - 100 tokens that are locked starting from the next period. + +* Penalty 100 tokens. The parameters of sub stakes will not change. Only the number of tokens belonging to the staker will decrease from 1000 to 900. +* Penalty 400 tokens. There will be 600 tokens belonging to the staker. At the same time, in the current period 700 tokens were locked, and in the next only 600. So to normalize stake distribution - the shortest sub stake (second) is reduced by 100 tokens, the remaining sub stakes remain unchanged +* Penalty 600 tokens. 400 tokens are remain. Reducing the shortest sub stake (second) is not enough, so it's removed. After the first sub stake is reduced from 500 to 400, and the third sub stake which starting in the next period is also removed. \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst index 3dc57fa31..9d660dada 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -120,6 +120,7 @@ Whitepapers architecture/contracts architecture/upgradeable_proxy_contracts + architecture/slashing .. toctree:: :maxdepth: 1 From 30cad65c99867938ef383a92cde70b4f11659950 Mon Sep 17 00:00:00 2001 From: MacLane Wilkison Date: Fri, 1 Mar 2019 12:42:08 +0300 Subject: [PATCH 2/5] Apply suggestions from code review mswilkison, cygnusv, derekpierre, KPrasch, arjunhassard --- docs/source/architecture/contracts.md | 17 ++++---- docs/source/architecture/slashing.rst | 57 ++++++++++++++++++++++----- 2 files changed, 55 insertions(+), 19 deletions(-) diff --git a/docs/source/architecture/contracts.md b/docs/source/architecture/contracts.md index c1aa8aa36..246fc1cf6 100644 --- a/docs/source/architecture/contracts.md +++ b/docs/source/architecture/contracts.md @@ -8,7 +8,7 @@ * `PolicyManager` Holds a policy's fee and distributes fee by periods * `MiningAdjudicator` Manages [the slashing protocol](slashing) * `Upgradeable` Base contract for [upgrading](upgradeable_proxy_contracts) -* `Dispatcher` Proxy to other contracts. This provides upgrading of the `MinersEscrow` and `PolicyManager` contracts +* `Dispatcher` Proxy to other contracts and provides upgrading of the `MinersEscrow` and `PolicyManager` contracts * `UserEscrow` Locks tokens for predetermined time. Tokens will be unlocked after specified time and all tokens can be used as stake in the `MinersEscrow` contract ## Deployment Procedure @@ -17,19 +17,18 @@ 2. Deploy `MinersEscrow` with a dispatcher targeting it 3. Deploy `PolicyManager` with its own dispatcher, also targeting it 4. Deploy `MiningAdjudicator` with a dispatcher -5. Transfer reward tokens to the `MinersEscrow` contract. These tokens are future mining rewards, and initial allocations +5. Transfer reward tokens to the `MinersEscrow` contract. These tokens are future mining rewards and initial allocations 6. Run the `initialize()` method to initialize the `MinersEscrow` contract 7. Set the address of the `PolicyManager` contract in the `MinersEscrow` by using the `setPolicyManager(address)` 8. Pre-deposit tokens to the `MinersEscrow` if necessary: * Approve the transfer tokens for the `MinersEscrow` contract using the `approve(address, uint)` method. The parameters are the address of `MinersEscrow` and the amount of tokens for a miner or group of miners; - * Deposit tokens to the `MinersEscrow` contract using the `preDeposit(address[], uint[], uint[])` method. The parameters are the addresses of the miners, the amount of tokens for each miner and the periods during which tokens will be locked for each miner + * Deposit tokens to the `MinersEscrow` contract using the `preDeposit(address[], uint[], uint[])` method. The parameters are the addresses of the miners, the amount of tokens for each miner, and the periods during which tokens will be locked for each miner 9. Deploy `UserEscrowProxy` with `UserEscrowLibraryLinker` targeting it -10. Pre-deposit tokens to the `UserEscrow`, and if necessary: - -* Create new instance of the `UserEscrow` contract -* Transfer ownership of the instance of the `UserEscrow` contract to the user -* Approve the transfer of tokens for the `UserEscrow` -* Deposit tokens by the `initialDeposit(uint256, uint256)` method +10. Pre-deposit tokens to the `UserEscrow` and, if necessary: + * Create new instance of the `UserEscrow` contract + * Transfer ownership of the instance of the `UserEscrow` contract to the user + * Approve the transfer of tokens for the `UserEscrow` + * Deposit tokens by the `initialDeposit(uint256, uint256)` method ## Alice's Contract Interaction diff --git a/docs/source/architecture/slashing.rst b/docs/source/architecture/slashing.rst index 6ad54fdff..5e7b39a9b 100644 --- a/docs/source/architecture/slashing.rst +++ b/docs/source/architecture/slashing.rst @@ -19,19 +19,56 @@ TBD (https://github.com/nucypher/nucypher/issues/803) How slashing affects stake -------------------------- -The punishment is to reduce the number of tokens that belongs to the offending staker. +The goal of slashing is to reduce the number of tokens that belongs to a staking offender. In this case, the main task is not to violate the logic of locking tokens. -The whole stake consists of several parts: +The entire stake consists of: -* tokens which the staker can withdraw at any moment -* tokens locked for a specific period + * tokens which the staker can withdraw at any moment + * tokens locked for a specific period -Since a staker can divide a stake (extend a part of a stake), as well as lock new tokens, then the total stake is represented as the sum of all the sub stakes active at a particular period. Each sub stake has a beginning and duration, which is reduced only upon confirmation of the activity. Staker slashed on the principle: first a sub stake, which will end earlier. Therefore, in the first place, the not-locked part of tokens belonging to the staker is slashed. After that, if necessary, sub stakes are adjusted: finds the shortest sub stake and decreases by the required amount. If this is not enough, then the next short sub stake is searched for, and so on. A sub stake that begins in the next period is checked separately. +A staker may extend the unlock period for any number of portions of their total stake. This divides the stake into smaller parts, each with a unique unlock date in the future. Stakers may also acquire and lock new tokens. The total stake is represented as the sum of all the different sub-stakes active in a given cycle (new cycle every 24h), which includes locked sub-stakes, and any sub-stakes that have passed their unlock date, and can be freely withdrawn. Each sub-stake has a beginning and duration (lock time). When a staker confirms activity each day, the remaining lock time for relevant sub-stakes is reduced. -Example: +Sub stakes get slashed in the order of their remaining lock time, beginning with the shortest – so the first portion of the stake to be slashed is the unlocked portion. After that, if necessary, locked sub-stakes are decreased – the shortest sub stake is decreased by the required amount; if the adjustment of that sub-stake is insufficient to fulfil the required punishment sum, then the next shortest sub-stake is decreased, and so on. Sub-stakes that begin in the next period are checked separately. -1000 tokens belong to the staker, 1st sub stake - 500 tokens are locked for 10 periods, 2nd sub stake - 200 tokens for 2 periods and 3rd sub stake - 100 tokens that are locked starting from the next period. +**Example:** -* Penalty 100 tokens. The parameters of sub stakes will not change. Only the number of tokens belonging to the staker will decrease from 1000 to 900. -* Penalty 400 tokens. There will be 600 tokens belonging to the staker. At the same time, in the current period 700 tokens were locked, and in the next only 600. So to normalize stake distribution - the shortest sub stake (second) is reduced by 100 tokens, the remaining sub stakes remain unchanged -* Penalty 600 tokens. 400 tokens are remain. Reducing the shortest sub stake (second) is not enough, so it's removed. After the first sub stake is reduced from 500 to 400, and the third sub stake which starting in the next period is also removed. \ No newline at end of file +A staker has 1000 tokens: + * 1st sub stake = 500 tokens locked for 10 periods + * 2nd sub stake = 200 tokens for 2 periods + * 3rd sub stake = 100 tokens locked starting from the next period + * 200 tokens in an unlocked state (still staked, but can be freely withdrawn). + +Penalty Scenarios: + +* *Scenario 1*: Staker incurs penalty calculated to be worth **100 tokens**: + + Only the unlocked tokens will be reduced; from 200 to 100. The values of locked sub-stakes will therefore remain unchanged in this punishment scenario. + + Result: + + * 1st sub stake = 500 tokens locked for 10 periods + * 2nd sub stake = 200 tokens for 2 periods + * 3rd sub stake = 100 tokens locked starting from the next period + * 100 tokens in an unlocked state + +* *Scenario 2*: Staker incurs penalty calculated to be worth **400 tokens**: + + The remaining tokens can only cover 200 tokens. In the current period, 700 tokens are locked and 800 tokens are locked for the next period. The 3rd sub stake is locked for the next period but has not yet been used as a deposit for "work" - not until the next period begins. Therefore, it will be the next sub stake to be slashed. However, it can only cover 100 tokens for the penalty which is still not enough. The next shortest locked sub stake (2nd) is then reduced by 100 tokens to cover the remainder of the penalty, and the other sub stakes remain unchanged. + + Result: + + * 1st sub stake = 500 tokens locked for 10 periods + * 2nd sub stake = 100 tokens for 2 periods + * 3rd sub stake = 0 tokens locked starting from the next period + * Remaining 0 tokens + +* *Scenario 3*: Staker incurs penalty calculated to be worth **600 tokens**: + + Reducing the unlocked remaining tokens, 3rd sub stakes, and the shortest sub stake (2nd) is not enough, so they are all removed. The next shortest sub stake is the 1st which is reduced from 500 to 400. + + Result: + + * 1st sub stake = 400 tokens locked for 10 periods + * 2nd sub stake = 0 tokens for 2 periods + * 3rd sub stake = 0 tokens locked starting from the next period + * Remaining 0 tokens From 19a11d0ab15c83b08a20ecd88db98664ed74efff Mon Sep 17 00:00:00 2001 From: szotov Date: Wed, 13 Mar 2019 15:13:18 +0300 Subject: [PATCH 3/5] Added one more slashing scenario and some ascii diagrams --- .circleci/config.yml | 2 +- docs/source/architecture/slashing.rst | 130 ++++++++++++++++++++------ docs/source/conf.py | 1 + 3 files changed, 105 insertions(+), 28 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b141767ab..79bd43344 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -523,7 +523,7 @@ jobs: at: ~/.local/share/virtualenvs/ - run: name: Install Documentation Build Dependencies - command: pip3 install --user sphinx recommonmark sphinx-rtd-theme + command: pip3 install --user sphinx recommonmark sphinx-rtd-theme aafigure - run: name: Build Sphinx Documentation command: | diff --git a/docs/source/architecture/slashing.rst b/docs/source/architecture/slashing.rst index 5e7b39a9b..55d471e44 100644 --- a/docs/source/architecture/slashing.rst +++ b/docs/source/architecture/slashing.rst @@ -23,8 +23,8 @@ The goal of slashing is to reduce the number of tokens that belongs to a staking In this case, the main task is not to violate the logic of locking tokens. The entire stake consists of: - * tokens which the staker can withdraw at any moment - * tokens locked for a specific period + * tokens which the staker can withdraw at any moment + * tokens locked for a specific period A staker may extend the unlock period for any number of portions of their total stake. This divides the stake into smaller parts, each with a unique unlock date in the future. Stakers may also acquire and lock new tokens. The total stake is represented as the sum of all the different sub-stakes active in a given cycle (new cycle every 24h), which includes locked sub-stakes, and any sub-stakes that have passed their unlock date, and can be freely withdrawn. Each sub-stake has a beginning and duration (lock time). When a staker confirms activity each day, the remaining lock time for relevant sub-stakes is reduced. @@ -32,43 +32,119 @@ Sub stakes get slashed in the order of their remaining lock time, beginning with **Example:** -A staker has 1000 tokens: - * 1st sub stake = 500 tokens locked for 10 periods - * 2nd sub stake = 200 tokens for 2 periods - * 3rd sub stake = 100 tokens locked starting from the next period - * 200 tokens in an unlocked state (still staked, but can be freely withdrawn). + A staker has 1000 tokens: + * 1st sub stake = 500 tokens locked for 10 periods + * 2nd sub stake = 200 tokens for 2 periods + * 3rd sub stake = 100 tokens locked starting from the next period and locked for 5 periods. The 3rd sub stake is locked for the next period but has not yet been used as a deposit for "work" - not until the next period begins. + * 200 tokens in an unlocked state (still staked, but can be freely withdrawn). + + .. aafig:: + :proportional: + :textual: + + stake + ^ + | + 800| +----+ + | | 3rd| + 700+-----+----+ + 600| +-------------+ + | 2nd | 3rd | + 500+----------+-------------+----------+ + | | + | 1st | + | | period + +-----------------------------------+---> + Penalty Scenarios: * *Scenario 1*: Staker incurs penalty calculated to be worth **100 tokens**: - Only the unlocked tokens will be reduced; from 200 to 100. The values of locked sub-stakes will therefore remain unchanged in this punishment scenario. + Only the unlocked tokens will be reduced; from 200 to 100. The values of locked sub-stakes will therefore remain unchanged in this punishment scenario. - Result: + Result: - * 1st sub stake = 500 tokens locked for 10 periods - * 2nd sub stake = 200 tokens for 2 periods - * 3rd sub stake = 100 tokens locked starting from the next period - * 100 tokens in an unlocked state + * 1st sub stake = 500 tokens locked for 10 periods + * 2nd sub stake = 200 tokens for 2 periods + * 3rd sub stake = 100 tokens locked starting from the next period + * 100 tokens in an unlocked state + +* *Scenario 2*: Staker incurs penalty calculated to be worth **300 tokens**: + + The unlocked tokens can only cover 200 tokens. In the current period, 700 tokens are locked and 800 tokens are locked for the next period. Therefore, we should reduce amount of locked tokens for the next period and leave unchanged locked amount in the current period. The 3rd sub stake suits for this purpose but it's not the shortest one. So we take the 2nd sub stake (the shortest), reduce it to 100 tokens and add new sub stake with 100 tokens which active only in the current period. + + Result: + + * 1st sub stake = 500 tokens locked for 10 periods + * 2nd sub stake = 100 tokens for 2 periods + * 3rd sub stake = 100 tokens locked starting from the next period for 5 periods + * 4rd sub stake = 100 tokens for 1 period + * Remaining 0 tokens + + .. aafig:: + :proportional: + :textual: + + stake + ^ + | + 700+-----+----+ + | 4th | 3rd| + 600+-----+----+-------------+ + | 2nd | 3rd | + 500+----------+-------------+----------+ + | | + | 1st | + | | period + +-----------------------------------+---> -* *Scenario 2*: Staker incurs penalty calculated to be worth **400 tokens**: +* *Scenario 3*: Staker incurs penalty calculated to be worth **400 tokens**: - The remaining tokens can only cover 200 tokens. In the current period, 700 tokens are locked and 800 tokens are locked for the next period. The 3rd sub stake is locked for the next period but has not yet been used as a deposit for "work" - not until the next period begins. Therefore, it will be the next sub stake to be slashed. However, it can only cover 100 tokens for the penalty which is still not enough. The next shortest locked sub stake (2nd) is then reduced by 100 tokens to cover the remainder of the penalty, and the other sub stakes remain unchanged. + The difference from the previous scenario is that should also decrease locked tokens in the current period. At the first step the 2nd sub stake is reduced to 100 tokens. Next step - adjustment for the next period. The shortest sub stake still the same - the 2nd. And we need to deacrese it from 100 to 0 only for the next period. Will be the same if we change duration of the 2nd sub stake from 2 periods to 1 and the other sub stakes remain unchanged. - Result: + Result: - * 1st sub stake = 500 tokens locked for 10 periods - * 2nd sub stake = 100 tokens for 2 periods - * 3rd sub stake = 0 tokens locked starting from the next period - * Remaining 0 tokens + * 1st sub stake = 500 tokens locked for 10 periods + * 2nd sub stake = 100 tokens for 1 period + * 3rd sub stake = 100 tokens locked starting from the next period + * Remaining 0 tokens + + .. aafig:: + :proportional: + :textual: + + stake + ^ + | + 600+----------+-------------+ + | 2nd | 3rd | + 500+----------+-------------+----------+ + | | + | 1st | + | | period + +-----------------------------------+---> -* *Scenario 3*: Staker incurs penalty calculated to be worth **600 tokens**: +* *Scenario 4*: Staker incurs penalty calculated to be worth **600 tokens**: - Reducing the unlocked remaining tokens, 3rd sub stakes, and the shortest sub stake (2nd) is not enough, so they are all removed. The next shortest sub stake is the 1st which is reduced from 500 to 400. + Reducing the unlocked remaining tokens, 3rd sub stakes, and the shortest sub stake (2nd) is not enough, so they are all removed. The next shortest sub stake is the 1st which is reduced from 500 to 400. - Result: + Result: - * 1st sub stake = 400 tokens locked for 10 periods - * 2nd sub stake = 0 tokens for 2 periods - * 3rd sub stake = 0 tokens locked starting from the next period - * Remaining 0 tokens + * 1st sub stake = 400 tokens locked for 10 periods + * 2nd sub stake = 0 tokens for 2 periods + * 3rd sub stake = 0 tokens locked starting from the next period + * Remaining 0 tokens + + .. aafig:: + :proportional: + :textual: + + stake + ^ + | + 400+-----------------------------------+ + | | + | 1st | + | | period + +-----------------------------------+---> diff --git a/docs/source/conf.py b/docs/source/conf.py index a2fe0faee..0eeaf9f67 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -51,6 +51,7 @@ extensions = [ 'sphinx.ext.napoleon', 'sphinx.ext.mathjax', 'sphinx.ext.viewcode', + 'aafigure.sphinxext', ] # Add any paths that contain templates here, relative to this directory. From 019dc0a9514f282812a9474f47b1bb2eb8be3060 Mon Sep 17 00:00:00 2001 From: szotov Date: Fri, 15 Mar 2019 12:05:14 +0300 Subject: [PATCH 4/5] Update docs/source/conf.py Update docs/source/architecture/contracts.md --- docs/source/architecture/contracts.md | 4 ++-- docs/source/conf.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/architecture/contracts.md b/docs/source/architecture/contracts.md index 246fc1cf6..57346df02 100644 --- a/docs/source/architecture/contracts.md +++ b/docs/source/architecture/contracts.md @@ -8,7 +8,7 @@ * `PolicyManager` Holds a policy's fee and distributes fee by periods * `MiningAdjudicator` Manages [the slashing protocol](slashing) * `Upgradeable` Base contract for [upgrading](upgradeable_proxy_contracts) -* `Dispatcher` Proxy to other contracts and provides upgrading of the `MinersEscrow` and `PolicyManager` contracts +* `Dispatcher` Proxy to other contracts and provides upgrading of the `MinersEscrow`, `PolicyManager` and `MiningAdjudicator` contracts * `UserEscrow` Locks tokens for predetermined time. Tokens will be unlocked after specified time and all tokens can be used as stake in the `MinersEscrow` contract ## Deployment Procedure @@ -22,7 +22,7 @@ 7. Set the address of the `PolicyManager` contract in the `MinersEscrow` by using the `setPolicyManager(address)` 8. Pre-deposit tokens to the `MinersEscrow` if necessary: * Approve the transfer tokens for the `MinersEscrow` contract using the `approve(address, uint)` method. The parameters are the address of `MinersEscrow` and the amount of tokens for a miner or group of miners; - * Deposit tokens to the `MinersEscrow` contract using the `preDeposit(address[], uint[], uint[])` method. The parameters are the addresses of the miners, the amount of tokens for each miner, and the periods during which tokens will be locked for each miner + * Deposit tokens to the `MinersEscrow` contract using the `preDeposit(address[], uint[], uint[])` method. The parameters are the addresses of the miners, the amount of tokens for each miner, and the number of periods during which tokens will be locked for each miner 9. Deploy `UserEscrowProxy` with `UserEscrowLibraryLinker` targeting it 10. Pre-deposit tokens to the `UserEscrow` and, if necessary: * Create new instance of the `UserEscrow` contract diff --git a/docs/source/conf.py b/docs/source/conf.py index 0eeaf9f67..14e7c1453 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -51,7 +51,7 @@ extensions = [ 'sphinx.ext.napoleon', 'sphinx.ext.mathjax', 'sphinx.ext.viewcode', - 'aafigure.sphinxext', + 'aafigure.sphinxext', ] # Add any paths that contain templates here, relative to this directory. From 10c89e6ffe9043eb3a005281c2e387a2672031f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=BA=C3=B1ez?= Date: Wed, 27 Mar 2019 11:05:15 +0100 Subject: [PATCH 5/5] Include aafigure package in Pipfile, setup.py and docs --- Pipfile | 1 + docs/source/guides/contribution_guide.rst | 2 +- setup.py | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index d9980b560..1c70ea605 100644 --- a/Pipfile +++ b/Pipfile @@ -54,6 +54,7 @@ bumpversion = "*" sphinx = "*" recommonmark = "*" sphinx_rtd_theme = "*" +aafigure = "*" # CLI nucypher = {editable = true,path = "."} diff --git a/docs/source/guides/contribution_guide.rst b/docs/source/guides/contribution_guide.rst index 61d188356..92a13dfce 100644 --- a/docs/source/guides/contribution_guide.rst +++ b/docs/source/guides/contribution_guide.rst @@ -171,7 +171,7 @@ Building Documentation .. note:: - ``sphinx``, ``recommonmark``, and ``sphinx_rtd_theme`` are non-standard dependencies that can be installed + ``sphinx``, ``recommonmark``, ``aafigure`` and ``sphinx_rtd_theme`` are non-standard dependencies that can be installed by running ``pip install -e .[docs]`` from the project directory. diff --git a/setup.py b/setup.py index a9b9cbf14..1f09cd821 100644 --- a/setup.py +++ b/setup.py @@ -92,7 +92,10 @@ DEPLOY_REQUIRES = [ DOCS_REQUIRE = [ 'sphinx', - 'sphinx-autobuild' + 'sphinx-autobuild', + 'recommonmark', + 'aafigure', + 'sphinx_rtd_theme' ] BENCHMARKS_REQUIRE = [