Skip to content

Scripts for replace-operator and asdb management#422

Open
pinebit wants to merge 2 commits intomainfrom
pinebit/script-replace-operator
Open

Scripts for replace-operator and asdb management#422
pinebit wants to merge 2 commits intomainfrom
pinebit/script-replace-operator

Conversation

@pinebit
Copy link
Contributor

@pinebit pinebit commented Feb 11, 2026

Replace-Operator Workflow Automation

This PR adds automation scripts for the replace-operator workflow, enabling operators to safely replace a cluster member while preserving slashing protection.

Replace-Operator Scripts (scripts/edit/replace-operator/)

  • remaining-operator.sh - Automates the complete workflow for operators staying in the cluster:
    • Export anti-slashing database
    • Run charon edit replace-operator ceremony
    • Update ASDB pubkeys for new cluster configuration
    • Backup and replace cluster-lock
    • Import updated ASDB
    • Restart containers
  • new-operator.sh - Helps new operators join a cluster:
    • Generate ENR private key (--generate-enr)
    • Install new cluster-lock and start containers

Anti-Slashing Database Scripts (scripts/edit/vc/)

  • export_asdb.sh / import_asdb.sh - Unified wrappers that auto-detect VC type from $VC env var
  • update-anti-slashing-db.sh - Transforms pubkeys in exported ASDB when cluster-lock changes
  • VC-specific implementations for Lodestar, Teku, Prysm, and Nimbus

Integration Tests

Replace-Operator Tests (scripts/edit/replace-operator/test/)

  • 21 dry-run tests validating argument parsing, prerequisite checks, and workflow output
  • Uses mocked Docker commands for isolation

ASDB Export/Import Tests (scripts/edit/vc/test/)

  • Full integration tests for each VC type (Lodestar, Teku, Prysm, Nimbus)
  • Tests actual export → transform → import cycle with test containers
  • Isolated test data directories to avoid production interference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant