Skip to content

Commit 3dca1d8

Browse files
committed
Addressed PR feedback
1 parent 77cd8a6 commit 3dca1d8

28 files changed

Lines changed: 71 additions & 19 deletions

File tree

.claude/skills/add-operators/SKILL.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ Ask the user: **"Are you an existing operator in the cluster, or a new operator
4343
[--dry-run]
4444
```
4545

46+
Set `WORK_DIR` env var to override the repository root directory if running from a custom location.
47+
48+
4649
The script will export the anti-slashing database, run the P2P ceremony, update keys, and print commands to start containers manually. After completion, remind the user to **wait ~2 epochs before starting** containers.
4750

4851
### If New Operator
@@ -76,4 +79,6 @@ After the existing operators have the ENR, gather:
7679
[--dry-run]
7780
```
7881

82+
Set `WORK_DIR` env var to override the repository root directory if running from a custom location.
83+
7984
Remind the user that **all operators (existing AND new) must participate simultaneously** in the P2P ceremony. After completion, the script will print commands to start containers manually. The new operator does NOT have slashing protection history (fresh start).

.claude/skills/add-validators/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ Run the script from the repository root:
4444
[--unverified] [--dry-run]
4545
```
4646

47+
Set `WORK_DIR` env var to override the repository root directory if running from a custom location.
48+
4749
The script will:
4850
1. Validate prerequisites
4951
2. Display current cluster info (operators, validators)

.claude/skills/recreate-private-keys/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Ask the user whether they want to run with `--dry-run` first to preview the oper
3434
./scripts/edit/recreate-private-keys/recreate-private-keys.sh [--dry-run]
3535
```
3636

37+
Set `WORK_DIR` env var to override the repository root directory if running from a custom location.
38+
3739
The script will:
3840
1. Validate prerequisites
3941
2. Stop the VC container and export the anti-slashing database

.claude/skills/remove-operators/SKILL.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ Ask the user: **"Are you a remaining operator (staying in the cluster) or a remo
5454
[--dry-run]
5555
```
5656

57+
Set `WORK_DIR` env var to override the repository root directory if running from a custom location.
58+
5759
After completion, the script will print commands to start containers manually. Remind the user to **wait ~2 epochs before starting** containers.
5860

5961
### If Removed Operator
@@ -81,4 +83,6 @@ This is **only needed when the removal exceeds fault tolerance**. If within faul
8183
[--dry-run]
8284
```
8385

86+
Set `WORK_DIR` env var to override the repository root directory if running from a custom location.
87+
8488
The script will participate in the ceremony and then stop your charon and VC containers. No ASDB operations are needed since you're leaving the cluster.

.claude/skills/replace-operator/SKILL.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ Ask the user: **"Are you a remaining operator (performing the replacement) or th
4747
[--dry-run]
4848
```
4949

50+
Set `WORK_DIR` env var to override the repository root directory if running from a custom location.
51+
5052
After completion, the script will print commands to start containers manually. Remind the user to **wait ~2 epochs before starting** containers.
5153

5254
### If New Operator
@@ -80,6 +82,8 @@ After receiving the current `cluster-lock.json` from remaining operators:
8082
[--dry-run]
8183
```
8284

85+
Set `WORK_DIR` env var to override the repository root directory if running from a custom location.
86+
8387
The new operator runs this **at the same time** as the remaining operators run their ceremony. All operators must participate together.
8488

8589
After the ceremony completes, the script automatically:

scripts/edit/add-operators/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ Automates the complete workflow for operators already in the cluster:
4444
| `--dry-run` | No | Preview without executing |
4545
| `-h, --help` | No | Show help message |
4646

47+
| Environment Variable | Description |
48+
|----------------------|-------------|
49+
| `WORK_DIR` | Override the repository root directory (defaults to auto-detected repo root) |
50+
4751
### Workflow
4852

4953
1. **Export ASDB** - Stop VC if running and export anti-slashing database
@@ -88,6 +92,10 @@ curl -o .charon/cluster-lock.json https://example.com/cluster-lock.json
8892
| `--dry-run` | No | Preview without executing |
8993
| `-h, --help` | No | Show help message |
9094

95+
| Environment Variable | Description |
96+
|----------------------|-------------|
97+
| `WORK_DIR` | Override the repository root directory (defaults to auto-detected repo root) |
98+
9199
## Related
92100

93101
- [Add-Validators Workflow](../add-validators/README.md)

scripts/edit/add-operators/existing-operator.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ log_step "Step 1: Exporting anti-slashing database..."
179179

180180
# VC container must be stopped before export (Lodestar locks the database while running)
181181
if [ "$DRY_RUN" = false ]; then
182-
if docker compose ps "$VC" 2>/dev/null | grep -q Up; then
182+
if docker compose ps --format '{{.Status}}' "$VC" 2>/dev/null | grep -qi running; then
183183
log_info "Stopping VC container ($VC) for ASDB export..."
184184
docker compose stop "$VC"
185185
fi

scripts/edit/add-operators/new-operator.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Prerequisites:
5757
- .env file with NETWORK and VC variables set
5858
- For --generate-enr: Docker installed
5959
- For ceremony: .charon/charon-enr-private-key must exist
60-
- For ceremony: Cluster-lock.json received from existing operators
60+
- For ceremony: cluster-lock.json received from existing operators
6161
EOF
6262
exit 0
6363
}
@@ -207,6 +207,9 @@ if [ "$GENERATE_ENR" = true ]; then
207207
log_info " ./scripts/edit/add-operators/new-operator.sh \\"
208208
log_info " --new-operator-enrs \"<all-new-enrs>\" \\"
209209
log_info " --cluster-lock <path-to-cluster-lock.json>"
210+
else
211+
log_error "ENR private key generation failed - .charon/charon-enr-private-key not found"
212+
exit 1
210213
fi
211214

212215
exit 0

scripts/edit/add-validators/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ All operators must run this script simultaneously:
4343
| `--dry-run` | No | Preview without executing |
4444
| `-h, --help` | No | Show help message |
4545

46+
| Environment Variable | Description |
47+
|----------------------|-------------|
48+
| `WORK_DIR` | Override the repository root directory (defaults to auto-detected repo root) |
49+
4650
## Workflow
4751

4852
The script performs the following steps:

scripts/edit/add-validators/add-validators.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ fi
173173
# Check if containers are currently running
174174
CHARON_WAS_RUNNING=false
175175
VC_WAS_RUNNING=false
176-
if docker compose ps charon 2>/dev/null | grep -q Up; then
176+
if docker compose ps --format '{{.Status}}' charon 2>/dev/null | grep -qi running; then
177177
CHARON_WAS_RUNNING=true
178178
fi
179-
if docker compose ps "$VC" 2>/dev/null | grep -q Up; then
179+
if docker compose ps --format '{{.Status}}' "$VC" 2>/dev/null | grep -qi running; then
180180
VC_WAS_RUNNING=true
181181
fi
182182

0 commit comments

Comments
 (0)