From 45d3add2ddfc47ce374dc5d0db8289510f68427d Mon Sep 17 00:00:00 2001 From: Claude Agent Date: Fri, 4 Sep 2026 09:21:21 +0000 Subject: [PATCH] Add node identity key deletion after fast-path restore (fixes rpc-us-50 avalanche incident) --- clone-backup.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/clone-backup.sh b/clone-backup.sh index 0680de1e..c05a4631 100755 --- a/clone-backup.sh +++ b/clone-backup.sh @@ -7,6 +7,7 @@ # --no-slowdisk : do NOT offload static files to /slowdisk (no symlinks); # extract everything onto the local disk instead. Required to # proceed when /slowdisk is too small for the static files. +# KEEP_NODE_KEYS=1 : keep the restored identity keys (default: delete via node-key-globs.txt) # Pull the --no-slowdisk flag out of the args so the positional / # parsing below is unaffected regardless of where the flag is placed. @@ -689,6 +690,17 @@ main() { [[ -n "$skipped_volumes" ]] && echo " Skipped (no backup by design):$skipped_volumes" [[ -n "$failed_volumes" ]] && echo " Failed:$failed_volumes" + # Regenerate the node's P2P identity on the destination (2026-09-04, rpc-us-50 avalanche + # incident): a restored volume carries the SOURCE node's identity keys (avalanchego + # staking/*, geth nodekey, ...). If the source still runs elsewhere, the copy is a + # duplicate NodeID and never peers. restore-volumes.sh already does this as its last + # step; the fast path skipped it. Patterns: node-key-globs.txt. KEEP_NODE_KEYS=1 opts out. + if [[ -z "$failed_volumes" && "${KEEP_NODE_KEYS:-0}" != "1" ]]; then + echo "Deleting node identity keys on $DEST_HOST (node-key-globs.txt) ..." + $SSH_CMD "$DEST_HOST" "cd /root/rpc && ./delete-node-keys.sh '$1'" \ + || echo "WARNING: delete-node-keys.sh failed on $DEST_HOST - the restored node may carry a duplicate identity; run ./delete-node-keys $1 manually" + fi + # Restore Network buffer and congestion control settings. # These are better for your 0.2-1.4ms environment -- 2.49.1