Implementation of an On-Chain pDAO (RPIP-33)¶
Snapshotting¶
| Test | Expected | Done |
|---|---|---|
| Submit prices | Updates RPL price snapshot | check |
| Vacant minipool deposit | Increases active minipool count, and increases ETH matched by the bond amount | |
| Deposit using credit | Increases active minipool count, does not increase ETH matched | Increases ETH matched but I think that is correct |
| Normal deposit | Increases active minipool count, increases ETH matched | check |
| Close dissolved minipool (8 & 16) | Reduced ETH matched and node active minipool count | |
| Finalise minipool (8 & 16) | Reduced ETH matched and node active minipool count | check |
| Initialise Voting | Sets correct values | |
| Registering a node | Increases node count snapshot | |
| Stake RPL | Increases RPL stake of node in snapshot | check |
| Unstake RPL | Decreases RPL stake of node in snapshot | check |
Proposing¶
| Test | Expected | Done |
|---|---|---|
| Submit proposal with old block number | Should revert block is too old | |
| Submit valid proposal | Should include all proposal values, and durations set based on pDAO parameters |
Challenging¶
| Test | Expected | Done |
|---|---|---|
| Submit proposal with incorrect calculation of voting power | Submission successful | check |
| Challenge and defeat proposal | Challenge should defeat proposal | check |
| Challenger unlocks bond, and claims reward | Challenger bond should be unlocked / withdrawable, and they should have been rewarded proposers RPL | FAIL |
| Proposer claims the rest of their bond OR other party executes finalise | ||
| Submit valid proposal | Submission successful | check |
| Incorrectly challenge proposal | Challenge should not defeat proposal |
Voting¶
| Test | Expected | Done |
|---|---|---|
| Delegate votes For a proposal (phase 1) | Vote registered | check |
| Delegate votes Against a proposal (phase 1) | Vote registered | check |
| Voter votes For a proposal (phase 1) | Vote registered | check |
| Voter overrides delegates For vote with Against (phase 1) | Vote should be changed to Against | check |
Executing¶
| Test | Expected | Done |
|---|---|---|
| Execute successful proposal (For won) | Payload executed and change applied to the protocol | check |
| Once proposal has been executed, proposer unlocks bond | RPL bond should be unlocked / withdrawable | check |
| Execute unsuccessful proposal (Against won) | Transaction should revert, payload not executed and change not applied to the protocol | check |
Quorum Not Met¶
| Test | Expected | Done |
|---|---|---|
| Start new proposal | Proposal unchallenged | |
| Setup votes so that it does not meet quorum | After voting periods status of proposal should be QuorumNotMet |
Vetoing¶
| Test | Expected | Done |
|---|---|---|
| Voter casts veto vote | Vote counted as veto vote | |
| Delegate casts veto vote | Votes counted as veto vote | |
| Wait voting periods | Vote decided as veto | |
| Anyone finalises proposal | Proposers bond is burnt, proposal in vetoed state |
Parameter Changes - Successful¶
| Test | Expected | Done |
|---|---|---|
| Submit a valid proposal that changes a parameter | Proposal submitted | check |
| Vote on proposal with For votes | Proposal successful | check |
| Execute proposal | Parameter has changed | check |
Parameter Changes - Out of bounds¶
| Test | Expected | Done |
|---|---|---|
| Submit a valid proposal that changes a parameter to a value that is out of bounds | Proposal submitted | check |
| Vote on proposal with For votes | Proposal successful | check |
| Execute proposal | Proposal should revert execution because the value is out of bounds | check |
Treasury Management - Spend¶
| Test | Expected | Done |
|---|---|---|
| Submit a proposal that spends pDAO reserve funds | Proposal submitted | check |
| Vote on proposal with For votes | Proposal successful | check |
| Execute proposal | pDAO reserve funds should be transferred | check |
Treasury Management - Contract¶
| Test | Expected | Done |
|---|---|---|
| Submit a proposal that creates a reoccurring payment | Propossal submitted | check |
| Vote on proposal with For votes | Proposal successful | check |
| Execute proposal | Claim contract details have been added | check |
Treasury Management - Claim¶
| Test | Expected | Done |
|---|---|---|
| Wait a number of periods, submit withdrawal | RPL tokens should be transferred | check |
| Try again to withdraw | No tokens sent | check |
Security Council - Execute Proposal¶
| Test | Expected | Done |
|---|---|---|
| As Security Council member, submit a proposal | Proposal submitted | check |
| As other Security Council members, submit vote For proposal | Proposal successful | check |
| As Security Council member, execute proposal | Parameter change applied to the protocol | check |
Security Council - Cancel Proposal¶
| Test | Expected | Done |
|---|---|---|
| As Security Council member, submit a proposal | Proposal submitted | |
| As Security Council proposer, cancel proposal | Proposal cancelled |
Security Council - pDAO Invite Member¶
| Test | Expected | Done |
|---|---|---|
| Submit a Security Council invite proposal | Proposal submitted | check |
| Vote on proposal with For votes | Proposal successful | check |
| Execute proposal | Member has been whitelisted to join | check |
| As new Security Council member, submit join council | New member added to Security Council | check |
Security Council - pDAO Invite Member, expired¶
| Test | Expected | Done |
|---|---|---|
| Submit a Security Council invite proposal | Proposal submitted | |
| Vote on proposal with For votes | Proposal successful | |
| Execute proposal | Member has been whitelisted to join | |
| As new Security Council member, wait action timeout, submit join council | Transaction reverts because their invite has expired |
Security Council - pDAO Kick Member¶
| Test | Expected | Done |
|---|---|---|
| Submit a Security Council kick member proposal | Proposal submitted | check |
| Vote on proposal with For votes | Proposal successful | check |
| Execute proposal | Security Council member has been removed | check |
Security Council - Member Leave¶
| Test | Expected | Done |
|---|---|---|
| As a Security Council member, request to leave the Security Council | Request submitted and timer started | |
| As a Security Council member, wait the timeout period, then call leave | Security Council member has left the Security Council |
RPL Withdrawal Address (RPIP-31)¶
Initialisation Defaults¶
| Test | Expected | Done |
|---|---|---|
| Register a new node | The RPL withdrawal address SHALL be initialized as unset for new node operators | check |
| Check an existing (prerelease) node | The RPL withdrawal address SHALL be initialized as unset for existing node operators |
Setting the Address¶
| Test | Expected | Done |
|---|---|---|
| As a node operator, with no RPL withdrawal address set, try to set the RPL withdrawal address | RPL withdrawal address awaiting confirmation | check |
| As the RPL withdrawal address, confirm the withdrawal address setting | RPL withdrawal address has been set | check |
| As a node operator, with an RPL withdrawal address set, try to set the RPL withdrawal address | Should revert, cannot set the RPL withdrawal address as node operator | check |
| As the RPL withdrawal address, try to change it to another address | RPL withdrawal address is awaiting confirmation | check |
| As the new RPL withdrawal address, confirm the withdrawal address setting | RPL withdrawal address has been set | check |
| As the RPL withdrawal address, call unset to reset the withdrawal address | RPL withdrawal address should be the primary withdrawal address | check |
| As a node operator, with no RPL withdrawal address set but a primary withdrawal address set, try to set the RPL withdrawal address | Should revert | check |
| As a primary withdrawal address, with no RPL withdrawal address set, try to set the RPL withdrawal address | RPL withdrawal address set | check |
Withdrawing RPL¶
| Test | Expected | Done |
|---|---|---|
| As a node operator, with no RPL withdrawal address set, try to withdraw staked RPL | Staked RPL is withdrawn to the primary withdrawal address | check |
| Set an RPL withdrawal address on the node | RPL withdrawal address confirmed and set | check |
| As the RPL withdrawal address, try to withdraw staked RPL | Staked RPL is withdrawal to the RPL withdrawal address | check |
| As a node operator, try to withdraw staked RPL | Should revert, cannot withdrawal RPL from node | check |
Claiming RPL Rewards¶
| Test | Expected | Done |
|---|---|---|
| As a node operator, with no RPL withdrawal address set, try to claim RPL rewards | RPL rewards are withdrawn to the primary withdrawal address | |
| As a node operator, with no RPL withdrawal address set, try to claim and restake RPL rewards | RPL rewards are restaked and the rest is withdrawn to the primary withdrawal address | |
| As a node operator, with a RPL withdrawal address set, try to claim RPL rewards | RPL rewards are withdrawal to the RPL withdrawal address | |
| As the RPL withdrawal address, try to claim RPL rewards | RPL rewards are withdrawal to the RPL withdrawal address | |
| As a node operator, with a RPL withdrawal address set, try to claim and restake RPL rewards | Should revert, node operator cannot stake RPL | |
| As the RPL withdrawal address, try to claim and restake RPL rewards | RPL rewards are restaked and the rest is withdrawn to the primary withdrawal address |
Staking RPL¶
| Test | Expected | Done |
|---|---|---|
| As a node operator, with no RPL withdrawal address set, stake additional RPL | RPL is staked | check |
| As a node operator, with no RPL withdrawal address set, whitelist an address | Address whitelisted | check |
| As the whitelist address, stake additional RPL | RPL is staked | check |
| As a node operator with no RPL withdrawal address set, unset the whitelisted address | Address no longer whitelisted | check |
| As the non-whitelisted address, stake additional RPL | Should revert, cannot stake RPL is not whitelisted | check |
| As a node operator, with a RPL withdrawal address set, stake additional RPL | Should revert, cannot stake RPL when RPL withdrawal set | check |
| As a node operator, with a RPL withdrawal address set, whitelist an address | Should revert, cannot whitelist if RPL withdrawal address set | check |
| As the RPL withdrawal address, stake additional RPL | RPL is staked | check |
| As the RPL withdrawal address, whitelist an address | Address whitelisted | check |
| As the whitelist address, stake additional RPL | RPL is staked | check |
| As the RPL withdrawal address, unset the whitelisted address | Address no longer whitelisted | check |
| As the non-whitelisted address, stake additional RPL | Should revert, cannot stake RPL is not whitelisted | check |
RPL Locking¶
| Test | Expected | Done |
|---|---|---|
| By default RPL locking | Should be disallowed | check |
| As a node operator, with no RPL withdrawal address set, allow RPL locking | RPL locking allowed | check |
| As a node operator, with no RPL withdrawal address set, disallow RPL locking | RPL locking disallowed | check |
| As a node operator, with a RPL withdrawal address set, allow RPL locking | Should revert, only RPL withdrawal address can allow | check |
| As the RPL withdrawal address, allow RPL locking | RPL locking allowed | check |
| As the RPL withdrawal address, disallow RPL locking | RPL locking disallowed | check |
Stake ETH on behalf of node (RPIP-32)¶
Depositing ETH and Withdrawing¶
| Test | Expected | Done |
|---|---|---|
| As a random address, stake ETH on behalf of a node that has a primary withdrawal address set | Stake ETH on behalf of balance should increase | check |
| As a random address, try to withdraw the ETH on behalf of the node | Should revert, only withdrawal address can withdraw the ETH | check |
| As the node address, try to withdraw the ETH on behalf of the node | Should revert, only withdrawal address can withdraw the ETH | check |
| As the node's primary withdrawal address, withdraw the ETH | ETH should be withdraw | check |
Depositing minipools¶
| Test | Expected | Done |
|---|---|---|
| As a node operator, deposit a new 8 ETH minipool using the ETH staked on behalf of the node | Minipool should be deposited | check |
| As a node operator, deposit a new 16 ETH minipool | Minipool should be staking, node balance should have decreases by 16 ETH | check |
| As a node operator, migrate the 16 ETH minipool to 8 ETH | Minipool should be 8 ETH and node credit should be 8 ETH | check |
| As a random address, stake ETH on behalf of the node | Stake ETH on behalf balance should increase | check |
| As a node operator, deposit minipools until both credit balances are exhausted | check |
Exiting Minipools¶
| Test | Expected | Done |
|---|---|---|
| As a node operator exit a minipool | Minipool exited and the funds have been returned to the minipool | check |
| As the primary withdrawal address, distribute the rewards | Funds should be in the primary withdrawal address | check |
Time-based Balance and RPL Price Submissions (RPIP-X)¶
| Test | Expected | Done |
|---|---|---|