Skip to content

Commit

Permalink
fix: vote description
Browse files Browse the repository at this point in the history
  • Loading branch information
krogla committed Feb 15, 2024
1 parent bdf50f1 commit 5ec7fde
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 22 deletions.
98 changes: 80 additions & 18 deletions scripts/vote_simple_dvt.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@
from utils.permissions import (
encode_permission_create,
encode_permission_grant,
encode_permission_revoke,
encode_permission_grant_p,
encode_oz_grant_role,
)
from utils.permission_parameters import Param, SpecialArgumentID, encode_argument_value_if, ArgumentValue, Op
from utils.easy_track import (
add_evmscript_factory,
create_permissions,
Expand All @@ -59,7 +56,72 @@


description = """
Deploy SimpleDVT
### I. Create new Aragon DAO Application Repo for Simple DVT
1. **Create new Aragon DAO Application Repo for Simple DVT app** with parameters:
* Name: `simple-dvt`
* Version: `1.0.0`
* Implementation address: [0x8538930c385C0438A357d2c25CB3eAD95Ab6D8ed](https://etherscan.io/address/0x8538930c385C0438A357d2c25CB3eAD95Ab6D8ed)
* Content IPFS URI: [ipfs:QmaSSujHCGcnFuetAPGwVW5BegaMBvn5SCsgi3LSfvraSo](https://ipfs.io/ipfs/QmaSSujHCGcnFuetAPGwVW5BegaMBvn5SCsgi3LSfvraSo) (hex-encoded: `0x697066733a516d615353756a484347636e4675657441504777565735426567614d42766e355343736769334c5366767261536f`)
### II. Setup and initialize Simple DVT module as new Aragon app
2. **Setup Simple DVT module as Aragon DAO app** with the same [contract implementation](https://etherscan.io/address/0x8538930c385C0438A357d2c25CB3eAD95Ab6D8ed) as the NodeOperatorsRegistry.
3. **Initialize of Simple DVT module** with parameters:
* Module Type = `curated-onchain-v1` (hex-encoded: `0x637572617465642d6f6e636861696e2d76310000000000000000000000000000`)
* Stuck Penalty Delay = `432000` (5 days - the same as in Curated Module)
### III. Add Simple DVT module to StakingRouter
4. **Create and grant permission `STAKING_ROUTER_ROLE` on Simple DVT module for StakingRouter**. This is necessary for the Simple DVT module to function as a staking module
5. **Grant `REQUEST_BURN_SHARES_ROLE` on Burner for Simple DVT module**. This role is required for ability to burn stETH tokens in case of operator’s penalties, you can read more [here](https://docs.lido.fi/guides/protocol-levers/#burning-steth-tokens)
6. **Add Simple DVT module to StakingRouter**. This action finally sets up new Simple DVT module contract to the [StakingRouter](https://etherscan.io/address/0xFdDf38947aFB03C621C71b06C9C70bce73f12999) as the second module
### IV. Grant permissions to EasyTrackEVMScriptExecutor to make operational changes to Simple DVT module
7. **Create and grant permission `MANAGE_NODE_OPERATOR_ROLE` on Simple DVT module for [EasyTrackEVMScriptExecutor](https://etherscan.io/address/0xFE5986E06210aC1eCC1aDCafc0cc7f8D63B3F977)**. This one and next 3 actions are needed to setup permissions required for [EasyTrack](https://etherscan.io/address/0xF0211b7660680B49De1A7E9f25C65660F0a13Fea) to manage operational tasks on the Simple DVT module
8. **Create and grant permission `SET_NODE_OPERATOR_LIMIT_ROLE` on Simple DVT module for EasyTrackEVMScriptExecutor**
9. **Create and grant permission `MANAGE_SIGNING_KEYS` on Simple DVT module for EasyTrackEVMScriptExecutor**
10. **Grant `STAKING_ROUTER_ROLE` on Simple DVT module for EasyTrackEVMScriptExecutor**
### V. Add Easy Track EVM script factories for Simple DVT module to EasyTrack registry
11. **Add AddNodeOperators EVM script factory** with address [0xcAa3AF7460E83E665EEFeC73a7a542E5005C9639](https://etherscan.io/address/0xcAa3AF7460E83E665EEFeC73a7a542E5005C9639)
12. **Add ActivateNodeOperators EVM script factory** with address [0xCBb418F6f9BFd3525CE6aADe8F74ECFEfe2DB5C8](https://etherscan.io/address/0xCBb418F6f9BFd3525CE6aADe8F74ECFEfe2DB5C8)
13. **Add DeactivateNodeOperators EVM script factory** with address [0x8B82C1546D47330335a48406cc3a50Da732672E7](https://etherscan.io/address/0x8B82C1546D47330335a48406cc3a50Da732672E7)
14. **Add SetVettedValidatorsLimits EVM script factory** with address [0xD75778b855886Fc5e1eA7D6bFADA9EB68b35C19D](https://etherscan.io/address/0xD75778b855886Fc5e1eA7D6bFADA9EB68b35C19D)
15. **Add UpdateTargetValidatorLimits EVM script factory** with address [0x41CF3DbDc939c5115823Fba1432c4EC5E7bD226C](https://etherscan.io/address/0x41CF3DbDc939c5115823Fba1432c4EC5E7bD226C)
16. **Add SetNodeOperatorNames EVM script factory** with address [0x7d509BFF310d9460b1F613e4e40d342201a83Ae4](https://etherscan.io/address/0x7d509BFF310d9460b1F613e4e40d342201a83Ae4)
17. **Add SetNodeOperatorRewardAddresses EVM script factory** with address [0x589e298964b9181D9938B84bB034C3BB9024E2C0](https://etherscan.io/address/0x589e298964b9181D9938B84bB034C3BB9024E2C0)
18. **Add ChangeNodeOperatorManagers EVM script factory** with address [0xE31A0599A6772BCf9b2bFc9e25cf941e793c9a7D](https://etherscan.io/address/0xE31A0599A6772BCf9b2bFc9e25cf941e793c9a7D)
### VI. Update Oracle Report Sanity Checker parameters
19. **Grant `MAX_ACCOUNTING_EXTRA_DATA_LIST_ITEMS_COUNT_ROLE` to the [Lido DAO Agent](https://etherscan.io/address/0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c) on [OracleReportSanityChecker](https://etherscan.io/address/0x9305c1Dbfe22c12c66339184C0025d7006f0f1cC) contract**. This makes possible to set sanity checker parameter values (see next actions)
20. **Grant `MAX_NODE_OPERATORS_PER_EXTRA_DATA_ITEM_COUNT_ROLE` to the `Lido DAO Agent` on `OracleReportSanityChecker` contract**
22. **Set `maxAccountingExtraDataListItemsCount` sanity checker parameter to 4**. This will allow to report extra data for 2 modules in 3rd phase of the accounting oracle report simultaneously
22. **Set `maxNodeOperatorsPerExtraDataItemCount` sanity checker parameter to `50`**. Limiting the number of operators guarantees a successful oracle report within the block gas limit
"""


Expand All @@ -68,10 +130,10 @@ def start_vote(tx_params: Dict[str, str], silent: bool) -> bool | list[int | Tra

vote_desc_items, call_script_items = zip(
#
# I. Create new Aragon DAO Application Repo for SimpleDVT
# I. Create new Aragon DAO Application Repo for Simple DVT
#
(
"1) Create new Repo for SimpleDVT app",
"1) Create new Aragon DAO Application Repo for Simple DVT app",
create_new_app_repo(
name=create_simple_dvt_app["name"],
manager=contracts.voting,
Expand All @@ -81,14 +143,14 @@ def start_vote(tx_params: Dict[str, str], silent: bool) -> bool | list[int | Tra
),
),
#
# II. Setup and initialize SimpleDVT module as new Aragon app
# II. Setup and initialize Simple DVT module as new Aragon app
#
(
"2) Setup SimpleDVT as Aragon DAO app",
"2) Setup Simple DVT module as Aragon DAO app",
update_app_implementation(create_simple_dvt_app["id"], create_simple_dvt_app["new_address"]),
),
(
"3) Initialize SimpleDVT module",
"3) Initialize of Simple DVT module",
(
contracts.simple_dvt.address,
contracts.simple_dvt.initialize.encode_input(
Expand All @@ -99,10 +161,10 @@ def start_vote(tx_params: Dict[str, str], silent: bool) -> bool | list[int | Tra
),
),
#
# III. Add SimpleDVT module to Staking Router
# III. Add Simple DVT module to Staking Router
#
(
"4) Create and grant permission STAKING_ROUTER_ROLE on SimpleDVT module for StakingRouter",
"4) *Create and grant permission STAKING_ROUTER_ROLE on Simple DVT module for StakingRouter",
encode_permission_create(
entity=contracts.staking_router,
target_app=contracts.simple_dvt,
Expand All @@ -111,7 +173,7 @@ def start_vote(tx_params: Dict[str, str], silent: bool) -> bool | list[int | Tra
),
),
(
"5) Grant REQUEST_BURN_SHARES_ROLE on Burner for SimpleDVT module",
"5) Grant REQUEST_BURN_SHARES_ROLE on Burner for Simple DVT module",
agent_forward(
[
encode_oz_grant_role(
Expand All @@ -123,7 +185,7 @@ def start_vote(tx_params: Dict[str, str], silent: bool) -> bool | list[int | Tra
),
),
(
"6) Add SimpleDVT module to StakingRouter",
"6) Add Simple DVT module to StakingRouter",
agent_forward(
[
(
Expand All @@ -140,10 +202,10 @@ def start_vote(tx_params: Dict[str, str], silent: bool) -> bool | list[int | Tra
),
),
#
# IV. Grant permissions to EasyTrackEVMScriptExecutor to make operational changes to SimpleDVT module
# IV. Grant permissions to EasyTrackEVMScriptExecutor to make operational changes to Simple DVT module
#
(
"7) Create and grant permission MANAGE_NODE_OPERATOR_ROLE on SimpleDVT module for EasyTrackEVMScriptExecutor",
"7) Create and grant permission MANAGE_NODE_OPERATOR_ROLE on Simple DVT module for EasyTrackEVMScriptExecutor",
encode_permission_create(
entity=EASYTRACK_EVMSCRIPT_EXECUTOR,
target_app=contracts.simple_dvt,
Expand All @@ -152,7 +214,7 @@ def start_vote(tx_params: Dict[str, str], silent: bool) -> bool | list[int | Tra
),
),
(
"8) Create and grant permission SET_NODE_OPERATOR_LIMIT_ROLE on SimpleDVT module for EasyTrackEVMScriptExecutor",
"8) Create and grant permission SET_NODE_OPERATOR_LIMIT_ROLE on Simple DVT module for EasyTrackEVMScriptExecutor",
encode_permission_create(
entity=EASYTRACK_EVMSCRIPT_EXECUTOR,
target_app=contracts.simple_dvt,
Expand All @@ -161,7 +223,7 @@ def start_vote(tx_params: Dict[str, str], silent: bool) -> bool | list[int | Tra
),
),
(
"9) Create and grant permission MANAGE_SIGNING_KEYS on SimpleDVT module for EasyTrackEVMScriptExecutor",
"9) Create and grant permission MANAGE_SIGNING_KEYS on Simple DVT module for EasyTrackEVMScriptExecutor",
encode_permission_create(
entity=EASYTRACK_EVMSCRIPT_EXECUTOR,
target_app=contracts.simple_dvt,
Expand All @@ -170,7 +232,7 @@ def start_vote(tx_params: Dict[str, str], silent: bool) -> bool | list[int | Tra
),
),
(
"10) Grant STAKING_ROUTER_ROLE on SimpleDVT module for EasyTrackEVMScriptExecutor",
"10) Grant STAKING_ROUTER_ROLE on Simple DVT module for EasyTrackEVMScriptExecutor",
encode_permission_grant(
target_app=contracts.simple_dvt,
permission_name="STAKING_ROUTER_ROLE",
Expand Down
6 changes: 2 additions & 4 deletions tests/test_vote_simple_dvt.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,9 @@ def test_vote(
assert kernel.getApp(kernel.APP_BASES_NAMESPACE(), SIMPLE_DVT_ARAGON_APP_ID) == ZERO_ADDRESS
assert not burner.hasRole(kernel.APP_BASES_NAMESPACE(), simple_dvt.address)

# check resolve failure
assert not network.web3.ens.resolve(simple_dvt_repo_ens)

# TODO: check absence of repo ?

evm_script_factories_before = easy_track.getEVMScriptFactories()

add_node_operators_evm_script_factory = EASYTRACK_SIMPLE_DVT_ADD_NODE_OPERATORS_FACTORY
Expand Down Expand Up @@ -300,8 +299,7 @@ def test_vote(
metadata = find_metadata_by_vote_id(vote_id)
print("metadata", metadata)

# TODO fix description
# assert get_lido_vote_cid_from_str(metadata) == "bafkreibugpzhp7nexxg7c6jpmmszikvaj2vscxw426zewa6uyv3z5y6ak4"
assert get_lido_vote_cid_from_str(metadata) == "bafkreietqdaevzjnhog4ui4a23iswak2haom4zfobeueefy3lmwkxnr2hq"

display_voting_events(vote_tx)

Expand Down

0 comments on commit 5ec7fde

Please sign in to comment.