Skip to content

Cluster edit and asdb management scripts#422

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

Cluster edit and asdb management scripts#422
pinebit wants to merge 28 commits intomainfrom
pinebit/script-replace-operator

Conversation

@pinebit
Copy link
Contributor

@pinebit pinebit commented Feb 11, 2026

Cluster Edit Scripts

  • All edit operations (script/edit/)
  • Anti-Slashing Database Scripts (scripts/edit/vc/)
  • Corresponding Claude Skills

Testing

  • Added ./scripts/edit/test/e2e_test.sh that runs complete E2E test using docker compose, by running real Lodestar VC, checking ASDB export/import and all edit commands in a sequence.

@pinebit pinebit changed the title Scripts for replace-operator and asdb management Cluster edit and asdb management scripts Feb 17, 2026
Comment on lines 94 to 97
# Make OUTPUT_DIR absolute for docker bind mount
if [[ "$OUTPUT_DIR" != /* ]]; then
OUTPUT_DIR="$(pwd)/$OUTPUT_DIR"
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes
mv: '/home/nick-obol/code/testing/node0c/./asdb-export/slashing-protection.json' and './asdb-export/slashing-protection.json' are the same file since $OUTPUT_FILE is relative but $OUTPUT_DIR is absolute. The comparison later on fails.

Suggested change
# Make OUTPUT_DIR absolute for docker bind mount
if [[ "$OUTPUT_DIR" != /* ]]; then
OUTPUT_DIR="$(pwd)/$OUTPUT_DIR"
fi
# Make paths absolute for docker bind mount
if [[ "$OUTPUT_FILE" != /* ]]; then
OUTPUT_FILE="$(pwd)/$OUTPUT_FILE"
fi
OUTPUT_DIR=$(dirname "$OUTPUT_FILE")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, fixed as suggested

Comment on lines +104 to +113
if ! docker compose run --rm -T \
--entrypoint node \
-v "$OUTPUT_DIR":/tmp/asdb-export \
vc-lodestar /usr/app/packages/cli/bin/lodestar validator slashing-protection export \
--file /tmp/asdb-export/slashing-protection.json \
--dataDir /opt/data \
--network "$NETWORK"; then
echo "Error: Failed to export slashing protection from vc-lodestar container" >&2
exit 1
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will create the slashing DB file owned as root, when the calling scripts try to run jq empty "$OUTPUT_FILE" it fails.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, fixed

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.

3 participants