Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- 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>
183 lines
5.6 KiB
Bash
Executable File
183 lines
5.6 KiB
Bash
Executable File
#!/bin/bash
|
|
# Automated Besu Configuration Compatibility Checker
|
|
# Checks for legacy vs layered tx-pool compatibility issues
|
|
|
|
set -euo pipefail
|
|
|
|
# Load IP configuration
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
source "${PROJECT_ROOT}/config/ip-addresses.conf" 2>/dev/null || true
|
|
|
|
|
|
PROXMOX_USER="${PROXMOX_USER:-root}"
|
|
PROXMOX_ML110="${PROXMOX_ML110:-192.168.11.10}"
|
|
PROXMOX_R630="${PROXMOX_R630:-192.168.11.11}"
|
|
|
|
# Colors
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
BLUE='\033[0;34m'
|
|
NC='\033[0m'
|
|
|
|
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
|
|
log_success() { echo -e "${GREEN}[✓]${NC} $1"; }
|
|
log_warn() { echo -e "${YELLOW}[⚠]${NC} $1"; }
|
|
log_error() { echo -e "${RED}[✗]${NC} $1"; }
|
|
|
|
echo "=== Besu Configuration Compatibility Check ==="
|
|
echo ""
|
|
|
|
# Check Besu version
|
|
check_besu_version() {
|
|
local VMID=$1
|
|
local HOST=$2
|
|
local SSH_TARGET="${PROXMOX_USER}@${HOST}"
|
|
|
|
log_info "Checking Besu version for VMID $VMID..."
|
|
|
|
VERSION=$(ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no "$SSH_TARGET" \
|
|
"pct exec $VMID -- besu --version 2>/dev/null | head -1" 2>/dev/null || echo "")
|
|
|
|
if [ -z "$VERSION" ]; then
|
|
log_warn "Could not determine Besu version for $VMID"
|
|
return 1
|
|
fi
|
|
|
|
echo " Version: $VERSION"
|
|
|
|
# Check if version is 23.10.0 or later (layered pool default)
|
|
if echo "$VERSION" | grep -qE "23\.(1[0-9]|[2-9][0-9])|2[4-9]"; then
|
|
log_success "Version supports layered tx-pool (default)"
|
|
return 0
|
|
else
|
|
log_warn "Version may not support layered tx-pool by default"
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
# Check for legacy tx-pool options
|
|
check_legacy_txpool() {
|
|
local VMID=$1
|
|
local HOST=$2
|
|
local CONFIG_PATH=$3
|
|
local SSH_TARGET="${PROXMOX_USER}@${HOST}"
|
|
|
|
log_info "Checking for legacy tx-pool options in $CONFIG_PATH..."
|
|
|
|
if ! ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no "$SSH_TARGET" \
|
|
"pct exec $VMID -- test -f $CONFIG_PATH" 2>/dev/null; then
|
|
log_warn "Config file not found: $CONFIG_PATH"
|
|
return 1
|
|
fi
|
|
|
|
LEGACY_OPTIONS=$(ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no "$SSH_TARGET" \
|
|
"pct exec $VMID -- grep -E 'tx-pool-max-size|tx-pool-limit-by-account-percentage|tx-pool-retention-hours' $CONFIG_PATH" 2>/dev/null || echo "")
|
|
|
|
if [ -n "$LEGACY_OPTIONS" ]; then
|
|
log_error "Legacy tx-pool options found (incompatible with layered pool):"
|
|
echo "$LEGACY_OPTIONS" | sed 's/^/ /'
|
|
return 1
|
|
else
|
|
log_success "No legacy tx-pool options found"
|
|
return 0
|
|
fi
|
|
}
|
|
|
|
# Check for layered tx-pool options
|
|
check_layered_txpool() {
|
|
local VMID=$1
|
|
local HOST=$2
|
|
local CONFIG_PATH=$3
|
|
local SSH_TARGET="${PROXMOX_USER}@${HOST}"
|
|
|
|
log_info "Checking for layered tx-pool options in $CONFIG_PATH..."
|
|
|
|
if ! ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no "$SSH_TARGET" \
|
|
"pct exec $VMID -- test -f $CONFIG_PATH" 2>/dev/null; then
|
|
return 1
|
|
fi
|
|
|
|
LAYERED_OPTIONS=$(ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no "$SSH_TARGET" \
|
|
"pct exec $VMID -- grep -E 'tx-pool-max-future-by-sender|tx-pool-layer-max-capacity|tx-pool-max-prioritized' $CONFIG_PATH" 2>/dev/null || echo "")
|
|
|
|
if [ -n "$LAYERED_OPTIONS" ]; then
|
|
log_success "Layered tx-pool options found:"
|
|
echo "$LAYERED_OPTIONS" | sed 's/^/ /'
|
|
return 0
|
|
else
|
|
log_info "No explicit layered options (using defaults)"
|
|
return 0
|
|
fi
|
|
}
|
|
|
|
# Main check function
|
|
check_node() {
|
|
local VMID=$1
|
|
local HOST=$2
|
|
local NODE_TYPE=$3
|
|
local CONFIG_PATH=$4
|
|
|
|
echo "--- Checking $NODE_TYPE (VMID $VMID on $HOST) ---"
|
|
|
|
# Check version
|
|
if ! check_besu_version "$VMID" "$HOST"; then
|
|
log_warn "Version check incomplete for $VMID"
|
|
fi
|
|
|
|
# Check for legacy options (should NOT exist)
|
|
if ! check_legacy_txpool "$VMID" "$HOST" "$CONFIG_PATH"; then
|
|
log_error "COMPATIBILITY ISSUE: Legacy tx-pool options found - will cause crashes!"
|
|
return 1
|
|
fi
|
|
|
|
# Check for layered options (optional, but good if present)
|
|
check_layered_txpool "$VMID" "$HOST" "$CONFIG_PATH"
|
|
|
|
echo ""
|
|
return 0
|
|
}
|
|
|
|
# Check all validators
|
|
echo "=== Checking Validators ==="
|
|
echo ""
|
|
|
|
check_node 1000 "$PROXMOX_R630" "Validator" "/etc/besu/config-validator.toml"
|
|
check_node 1001 "$PROXMOX_R630" "Validator" "/etc/besu/config-validator.toml"
|
|
check_node 1002 "$PROXMOX_R630" "Validator" "/etc/besu/config-validator.toml"
|
|
check_node 1003 "$PROXMOX_ML110" "Validator" "/etc/besu/config-validator.toml"
|
|
check_node 1004 "$PROXMOX_ML110" "Validator" "/etc/besu/config-validator.toml"
|
|
|
|
# Check RPC (if config can be found)
|
|
echo "=== Checking RPC Node ==="
|
|
echo ""
|
|
|
|
RPC_CONFIG_PATHS=(
|
|
"/etc/besu/config-rpc-core.toml"
|
|
"/var/lib/besu/config-rpc-core.toml"
|
|
"/config/config-rpc-core.toml"
|
|
)
|
|
|
|
RPC_CONFIG_FOUND=""
|
|
for path in "${RPC_CONFIG_PATHS[@]}"; do
|
|
if ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no "${PROXMOX_USER}@${PROXMOX_ML110}" \
|
|
"pct exec 2101 -- test -f $path" 2>/dev/null; then
|
|
RPC_CONFIG_FOUND="$path"
|
|
break
|
|
fi
|
|
done
|
|
|
|
if [ -n "$RPC_CONFIG_FOUND" ]; then
|
|
check_node 2101 "$PROXMOX_ML110" "RPC" "$RPC_CONFIG_FOUND"
|
|
else
|
|
log_warn "RPC config file not found in standard locations"
|
|
fi
|
|
|
|
echo "=== Compatibility Check Complete ==="
|
|
echo ""
|
|
echo "Summary:"
|
|
echo " - Legacy tx-pool options: INCOMPATIBLE with Besu 23.10+ layered pool"
|
|
echo " - Layered tx-pool options: Compatible (or use defaults)"
|
|
echo " - If legacy options found: Remove them to prevent crashes"
|