Files
proxmox/scripts/enable-eip-7702-besu.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

94 lines
3.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# Enable EIP-7702 support in Besu configuration
# EIP-7702 requires Cancun fork or later
# Usage: ./scripts/enable-eip-7702-besu.sh
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
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
# Configuration
VMID=2400
PROXMOX_HOST="${PROXMOX_HOST:-192.168.11.10}"
BESU_CONFIG="/etc/besu/config-rpc-thirdweb.toml"
GENESIS_FILE="/genesis/genesis.json"
# 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}[WARN]${NC} $1"; }
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
log_info "═══════════════════════════════════════════════════════════"
log_info " ENABLING EIP-7702 SUPPORT IN BESU"
log_info "═══════════════════════════════════════════════════════════"
echo ""
# Check SSH access
if ! ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no root@${PROXMOX_HOST} "echo 'SSH OK'" &>/dev/null; then
log_error "Cannot access $PROXMOX_HOST via SSH"
exit 1
fi
# Check if genesis file exists
log_info "Checking genesis file..."
GENESIS_EXISTS=$(ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no root@${PROXMOX_HOST} \
"pct exec $VMID -- test -f $GENESIS_FILE && echo 'exists' || echo 'missing'")
if [[ "$GENESIS_EXISTS" != "exists" ]]; then
log_error "Genesis file not found: $GENESIS_FILE"
log_info "EIP-7702 requires Cancun fork to be enabled in the genesis file"
exit 1
fi
# Check current genesis configuration
log_info "Checking current genesis configuration..."
GENESIS_CONFIG=$(ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no root@${PROXMOX_HOST} \
"pct exec $VMID -- cat $GENESIS_FILE 2>/dev/null" || echo "")
if [[ -z "$GENESIS_CONFIG" ]]; then
log_error "Could not read genesis file"
exit 1
fi
# Check if Cancun fork is enabled
if echo "$GENESIS_CONFIG" | grep -qi "cancun"; then
log_success "Cancun fork is already enabled in genesis file"
log_info "EIP-7702 should be supported if Besu version >= 24.1.0"
elif echo "$GENESIS_CONFIG" | grep -qi "shanghai\|london\|berlin"; then
log_warn "Genesis file has older fork configuration"
log_info "EIP-7702 requires Cancun fork (or later)"
log_info "To enable EIP-7702, update genesis file to include Cancun fork"
else
log_warn "Could not determine fork configuration from genesis file"
log_info "EIP-7702 requires Cancun fork to be enabled"
fi
# Note: EIP-7702 is typically enabled automatically if Cancun fork is active
# and Besu version supports it. No additional configuration needed in Besu config file.
log_info ""
log_info "EIP-7702 Support Status:"
log_info " - EIP-7702 is part of Cancun fork (Ethereum mainnet block 19426587)"
log_info " - If your network uses Cancun fork, EIP-7702 is automatically enabled"
log_info " - Requires Besu version 24.1.0 or later"
log_info ""
log_info "To enable EIP-7702:"
log_info " 1. Ensure genesis file includes Cancun fork configuration"
log_info " 2. Ensure Besu version is 24.1.0 or later"
log_info " 3. Restart Besu service after updating genesis file"
log_info ""