Files
proxmox/scripts/archive/backups/cleanup-besu-deprecated-options.sh
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

228 lines
8.9 KiB
Bash
Executable File

#!/usr/bin/env bash
# Cleanup Deprecated Besu Configuration Options
# Removes deprecated/invalid options that cause Besu v23.10.0+ to fail
set -euo pipefail
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
# Script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
# Dry-run mode flag
DRY_RUN="${1:-}"
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
log_success() { echo -e "${GREEN}[✓]${NC} $1"; }
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
# Function to backup a file
backup_file() {
local file="$1"
if [ -f "$file" ]; then
local backup="${file}.backup.$(date +%Y%m%d_%H%M%S)"
if [ "$DRY_RUN" != "--dry-run" ]; then
cp "$file" "$backup"
echo "$backup"
else
echo "${file}.backup.TIMESTAMP"
fi
fi
}
# Function to clean deprecated options from a file
clean_deprecated_options() {
local file="$1"
local node_type="$2"
if [ ! -f "$file" ]; then
log_warn "File not found: $file (skipping)"
return 1
fi
log_info "Cleaning deprecated options from: $file ($node_type)"
if [ "$DRY_RUN" != "--dry-run" ]; then
# Backup file
local backup=$(backup_file "$file")
log_info " Backup created: $backup"
# Remove deprecated options
# Note: Using sed with -i for in-place editing
sed -i \
-e '/^log-destination=/d' \
-e '/^fast-sync-min-peers=/d' \
-e '/^database-path=/d' \
-e '/^trie-logs-enabled=/d' \
-e '/^accounts-enabled=/d' \
-e '/^max-remote-initiated-connections=/d' \
-e '/^rpc-http-host-allowlist=/d' \
-e '/^rpc-tx-feecap="0x0"/d' \
-e '/^tx-pool-max-size=/d' \
-e '/^tx-pool-price-bump=/d' \
-e '/^tx-pool-retention-hours=/d' \
"$file"
log_success " Deprecated options removed"
return 0
else
log_info " [DRY-RUN] Would remove deprecated options:"
log_info " - log-destination"
log_info " - fast-sync-min-peers"
log_info " - database-path"
log_info " - trie-logs-enabled"
log_info " - accounts-enabled"
log_info " - max-remote-initiated-connections"
log_info " - rpc-http-host-allowlist"
log_info " - rpc-tx-feecap=\"0x0\""
log_info " - tx-pool-max-size"
log_info " - tx-pool-price-bump"
log_info " - tx-pool-retention-hours"
return 0
fi
}
# Main execution
echo -e "${BLUE}╔══════════════════════════════════════════════════════════════╗${NC}"
echo -e "${BLUE}║ BESU DEPRECATED OPTIONS CLEANUP ║${NC}"
echo -e "${BLUE}╚══════════════════════════════════════════════════════════════╝${NC}"
echo ""
if [ "$DRY_RUN" == "--dry-run" ]; then
log_warn "DRY-RUN MODE: No files will be modified"
echo ""
fi
# Track statistics
CLEANED=0
SKIPPED=0
# Validator configurations
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
echo -e "${BLUE}Cleaning Validator Configurations${NC}"
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
echo ""
VALIDATOR_FILES=(
"$PROJECT_ROOT/smom-dbis-138/config/config-validator.toml"
"$PROJECT_ROOT/smom-dbis-138-proxmox/templates/besu-configs/config-validator.toml"
)
for file in "${VALIDATOR_FILES[@]}"; do
if clean_deprecated_options "$file" "validator"; then
CLEANED=$((CLEANED + 1))
else
SKIPPED=$((SKIPPED + 1))
fi
echo ""
done
# RPC node configurations
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
echo -e "${BLUE}Cleaning RPC Node Configurations${NC}"
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
echo ""
RPC_FILES=(
"$PROJECT_ROOT/smom-dbis-138/config/config-rpc-core.toml"
"$PROJECT_ROOT/smom-dbis-138/config/config-rpc-public.toml"
"$PROJECT_ROOT/smom-dbis-138/config/config-rpc-perm.toml"
"$PROJECT_ROOT/smom-dbis-138/config/config-rpc-thirdweb.toml"
"$PROJECT_ROOT/smom-dbis-138/config/config-rpc-4.toml"
"$PROJECT_ROOT/smom-dbis-138/config/config-rpc-putu-1.toml"
"$PROJECT_ROOT/smom-dbis-138/config/config-rpc-putu-8a.toml"
"$PROJECT_ROOT/smom-dbis-138/config/config-rpc-luis-1.toml"
"$PROJECT_ROOT/smom-dbis-138/config/config-rpc-luis-8a.toml"
"$PROJECT_ROOT/smom-dbis-138-proxmox/templates/besu-configs/config-rpc-core.toml"
"$PROJECT_ROOT/smom-dbis-138-proxmox/templates/besu-configs/config-rpc.toml"
"$PROJECT_ROOT/smom-dbis-138-proxmox/templates/besu-configs/config-rpc-4.toml"
)
for file in "${RPC_FILES[@]}"; do
if clean_deprecated_options "$file" "RPC"; then
CLEANED=$((CLEANED + 1))
else
SKIPPED=$((SKIPPED + 1))
fi
echo ""
done
# Sentry configurations
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
echo -e "${BLUE}Cleaning Sentry Configurations${NC}"
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
echo ""
SENTRY_FILES=(
"$PROJECT_ROOT/smom-dbis-138-proxmox/templates/besu-configs/config-sentry.toml"
)
for file in "${SENTRY_FILES[@]}"; do
if clean_deprecated_options "$file" "sentry"; then
CLEANED=$((CLEANED + 1))
else
SKIPPED=$((SKIPPED + 1))
fi
echo ""
done
# Member configurations
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
echo -e "${BLUE}Cleaning Member Configurations${NC}"
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
echo ""
MEMBER_FILES=(
"$PROJECT_ROOT/smom-dbis-138/config/config-member.toml"
)
for file in "${MEMBER_FILES[@]}"; do
if clean_deprecated_options "$file" "member"; then
CLEANED=$((CLEANED + 1))
else
SKIPPED=$((SKIPPED + 1))
fi
echo ""
done
# Summary
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
echo -e "${BLUE}Summary${NC}"
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
echo ""
echo "Files cleaned: $CLEANED"
echo "Files skipped: $SKIPPED"
echo ""
if [ "$DRY_RUN" == "--dry-run" ]; then
log_warn "This was a dry-run. No files were modified."
echo "Run without --dry-run to apply changes."
else
log_success "Deprecated options cleanup complete!"
echo ""
echo "Deprecated options removed:"
echo " ✓ log-destination"
echo " ✓ fast-sync-min-peers (incompatible with FULL sync-mode)"
echo " ✓ database-path (use data-path instead)"
echo " ✓ trie-logs-enabled"
echo " ✓ accounts-enabled"
echo " ✓ max-remote-initiated-connections"
echo " ✓ rpc-http-host-allowlist"
echo " ✓ rpc-tx-feecap=\"0x0\" (invalid value)"
echo " ✓ tx-pool-max-size (legacy, incompatible with layered implementation)"
echo " ✓ tx-pool-price-bump (legacy, incompatible with layered implementation)"
echo " ✓ tx-pool-retention-hours (legacy, incompatible with layered implementation)"
echo ""
echo "Next steps:"
echo " 1. Review the cleaned configuration files"
echo " 2. Test configurations with Besu v23.10.0+"
echo " 3. Deploy updated configurations to nodes"
fi