Skip to content

Commit

Permalink
remove force deaffiliate command (#412)
Browse files Browse the repository at this point in the history
### Description

This ancient command harkens back to the days pre celo mainnet when we
were running a POA testnet.


It is not possible that this command is still usable as the method on
the Validator Contract it calls `forceDeaffiliateIfValidator` has a
`onlySlasher` modifier which check the caller against a set of slashers
stored on LockedGold slashers are stored as
`keccak256(abi.encodePacked(slasherIdentifier));` which must point to an
address in the registry. Therefore only slasher contracts can force
deaffiliation.

```
modifier onlySlasher() {
    require(getLockedGold().isSlasher(msg.sender), "Only registered slasher can call");
    _;
  }
```


### Other changes

add pre commands to docs generation to ensure it runs correctly each
time.

upon running the now fixed docs commands the previously removed reserve
commands were removed finally

<!-- start pr-codex -->

### see


https://github.com/celo-org/celo-monorepo/blob/faca88f6a48cc7c8e6104393e49ddf7c2d7d20e3/packages/protocol/contracts/governance/Validators.sol#L585


https://github.com/celo-org/celo-monorepo/blob/master/packages/protocol/contracts/governance/LockedGold.sol#L422


---

## PR-Codex overview
This PR focuses on removing the `celocli validator:force-deaffiliate`
command from the CLI, which was only usable before the mainnet launch.
The documentation and related references have been updated to reflect
this removal and provide alternative commands for managing validators.

### Detailed summary
- Deleted `docs/command-line-interface/reserve.md`.
- Deleted `packages/cli/src/commands/validator/force-deaffiliate.ts`.
- Updated `generate_docs.sh` to remove documentation for the deleted
command.
- Removed references to `celocli validator:force-deaffiliate` from
`docs/command-line-interface/validator.md`.
- Added a note in the changeset about the removal of `celocli
validator:force-deaffiliate` and provided alternative commands.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
  • Loading branch information
aaronmgdr authored Oct 30, 2024
1 parent b56b69d commit 23d36cc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 144 deletions.
9 changes: 9 additions & 0 deletions .changeset/dull-windows-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@celo/celocli': major
---

Remove `celocli validator:force-deaffiliate`

This command was only ever usable pre mainnet launch. The force deaffiliate method it would call is only callable by one of the whitelisted Slasher Contracts.

To force removal of validator with poor uptime use `celocli validator:downtime-slash` or to sever association with a validator from your group use `celocli validator:deaffiliate`
71 changes: 0 additions & 71 deletions docs/command-line-interface/reserve.md

This file was deleted.

36 changes: 0 additions & 36 deletions docs/command-line-interface/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ View and manage Validators
* [`celocli validator:deaffiliate`](#celocli-validatordeaffiliate)
* [`celocli validator:deregister`](#celocli-validatorderegister)
* [`celocli validator:downtime-slash`](#celocli-validatordowntime-slash)
* [`celocli validator:force-deaffiliate`](#celocli-validatorforce-deaffiliate)
* [`celocli validator:list`](#celocli-validatorlist)
* [`celocli validator:register`](#celocli-validatorregister)
* [`celocli validator:requirements`](#celocli-validatorrequirements)
Expand Down Expand Up @@ -164,41 +163,6 @@ EXAMPLES

_See code: [src/commands/validator/downtime-slash.ts](https://github.com/celo-org/developer-tooling/tree/master/packages/cli/src/commands/validator/downtime-slash.ts)_

## `celocli validator:force-deaffiliate`

Force deaffiliate a Validator from a Validator Group, and remove it from the Group if it is also a member. Used by stake-off admins in order to remove validators from the next epoch's validator set if they are down and consistently unresponsive, in order to preserve the health of the network. This feature will be removed once slashing for downtime is implemented.

```
USAGE
$ celocli validator:force-deaffiliate --from 0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d
--validator 0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d [--gasCurrency
0x1234567890123456789012345678901234567890] [--globalHelp]
FLAGS
--from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d (required) Initiator
--gasCurrency=0x1234567890123456789012345678901234567890 Use a specific gas currency
for transaction fees
(defaults to CELO if no gas
currency is supplied). It
must be a whitelisted token.
--globalHelp View all available global
flags
--validator=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d (required) Validator's
address
DESCRIPTION
Force deaffiliate a Validator from a Validator Group, and remove it from the Group if
it is also a member. Used by stake-off admins in order to remove validators from the
next epoch's validator set if they are down and consistently unresponsive, in order to
preserve the health of the network. This feature will be removed once slashing for
downtime is implemented.
EXAMPLES
force-deaffiliate --from 0x47e172f6cfb6c7d01c1574fa3e2be7cc73269d95 --validator 0xb7ef0985bdb4f19460A29d9829aA1514B181C4CD
```

_See code: [src/commands/validator/force-deaffiliate.ts](https://github.com/celo-org/developer-tooling/tree/master/packages/cli/src/commands/validator/force-deaffiliate.ts)_

## `celocli validator:list`

List registered Validators, their name (if provided), affiliation, uptime score, and public keys used for validating.
Expand Down
3 changes: 3 additions & 0 deletions packages/cli/generate_docs.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env bash
set -e
export COLUMNS=88
yarn build
yarn oclif manifest
rm -rf ../../docs/command-line-interface
yarn oclif readme --multi --dir=../../docs/command-line-interface
sed -i.bak '/^- \[/d' ../../docs/command-line-interface/*
rm -rf ../../docs/command-line-interface/*.bak
37 changes: 0 additions & 37 deletions packages/cli/src/commands/validator/force-deaffiliate.ts

This file was deleted.

0 comments on commit 23d36cc

Please sign in to comment.