go-ethereum icon indicating copy to clipboard operation
go-ethereum copied to clipboard

Failed to get remote head and new block ranges: EndpointError(FarBehind)

Open MuhammadJamshaidGhaffar opened this issue 6 months ago • 0 comments

I'm setting up a local PoS testnet using the Electra fork (Capella + deneb), with the deposit contract pre-deployed in genesis and everything configured manually.

However, when starting Lighthouse beacon node, it fails with:

Jun 10 18:11:05.831 WARN Execution endpoint is not synced        last_seen_block_unix_timestamp: 1, endpoint: http://localhost:8551/, auth=true, service: deposit_contract_rpc
Jun 10 18:11:05.831 ERRO Error updating deposit contract cache   error: Failed to get remote head and new block ranges: EndpointError(FarBehind), retry_millis: 60000, service: deposit_contract_rpc
Jun 10 18:11:05.841 CRIT Failed to start beacon node             reason: Failed to build beacon chain: Head block not found in store
Jun 10 18:11:05.841 INFO Internal shutdown received              reason: Failed to start beacon node
Jun 10 18:11:05.841 INFO Shutting down..                         reason: Failure("Failed to start beacon node")
Failed to start beacon node

I believe this may be due to Lighthouse expecting the execution node (Geth) to be synced, but this is a new chain starting from block 0 with no historical state.

Steps Taken:

Generated genesis.json and config.yaml manually (see below)

Predeployed deposit contract at genesis in alloc

Using JWT-based authenticated RPC between Lighthouse and Geth

Using --execution-endpoint http://localhost:8551 with Lighthouse

Ensured deposit contract address and deploy block in config.yaml are correct

Versions:

Geth: v1.15.11

Lighthouse: v7.0.1-e42406d

Network Type: Local Electra forked PoS testnet

Execution Layer: Geth with Engine API enabled

Consensus Layer: Lighthouse beacon node

Geth Command:

geth \
  --datadir /root/.ethereum \
  --identity "NODE_2" \
  --networkid 1337 \
  --syncmode full \
  --snapshot=false \
  --verbosity 2 \
  --allow-insecure-unlock \
  --port 30303 \
  --bootnodes "$(cat /tmp/eth-node-urls)" \
  --http \
  --http.addr 0.0.0.0 \
  --http.port 8545 \
  --http.corsdomain="*" \
  --http.api web3,eth,debug,net,engine,admin,txpool \
  --authrpc.addr 0.0.0.0 \
  --authrpc.port 8551 \
  --authrpc.vhosts="*" \
  --authrpc.jwtsecret /tmp/jwt.hex

Lighthouse Command:

lighthouse --debug-level info bn \
  --datadir /tmp/local-testnet/eth-2 \
  --testnet-dir /tmp/local-testnet/testnet \
  --enable-private-discovery \
  --staking \
  --enr-address 10.151.0.71 \
  --enr-udp-port 9000 \
  --enr-tcp-port 9000 \
  --port 9000 \
  --http-address 10.151.0.71 \
  --http-port 8000 \
  --http-allow-origin "*" \
  --disable-packet-filter \
  --target-peers 5 \
  --execution-endpoint http://localhost:8551 \
  --execution-jwt /tmp/jwt.hex

genesis.json (Electra fork):

{
  "config": {
    "chainId": 1337,
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip155Block": 0,
    "eip158Block": 0,
    "byzantiumBlock": 0,
    "constantinopleBlock": 0,
    "petersburgBlock": 0,
    "istanbulBlock": 0,
    "muirGlacierBlock": 0,
    "berlinBlock": 0,
    "londonBlock": 0,
    "arrowGlacierBlock": 0,
    "grayGlacierBlock": 0,
    "mergeForkBlock": 0,
    "shanghaiTime": 0,
    "cancunTime": 0,
    "terminalTotalDifficulty": 0,
    "ethash": {},
    "withdrawals": true
  },
  "nonce": "0x0",
  "timestamp": "0x0",
  "extraData": "0x00",
  "gasLimit": "0x1fffffffffffff",
  "difficulty": "0x0",
  "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "coinbase": "0x0000000000000000000000000000000000000000",
  "alloc": {
    "0x00000000219ab540356cbb839cbe05303d7705fa": {
      "balance": "0x0",
      "code": "<BYTECODE_OF_DEPOSIT_CONTRACT>",
      "storage": {
        "0x00": "0x01"
      }
    }
  }
}

config.yaml (Lighthouse):

CONFIG_NAME: mainnet
PRESET_BASE: mainnet
TERMINAL_TOTAL_DIFFICULTY: 0
TERMINAL_BLOCK_HASH: 0x0000000000000000000000000000000000000000000000000000000000000000
TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615
SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY: 128
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 1
GENESIS_FORK_VERSION: 0x42424242
GENESIS_DELAY: 0
# Altair
ALTAIR_FORK_VERSION: 0x01000000
ALTAIR_FORK_EPOCH: 0  # Oct 27, 2021, 10:56:23am UTC
# Bellatrix
BELLATRIX_FORK_VERSION: 0x02000000
BELLATRIX_FORK_EPOCH: 0  # Sept 6, 2022, 11:34:47am UTC
# Capella
CAPELLA_FORK_VERSION: 0x03000000
CAPELLA_FORK_EPOCH: 0  # April 12, 2023, 10:27:35pm UTC
# Deneb
DENEB_FORK_VERSION: 0x04000000
DENEB_FORK_EPOCH: 0  # March 13, 2024, 01:55:35pm UTC
# Electra
ELECTRA_FORK_VERSION: 0x05000000
ELECTRA_FORK_EPOCH: 0  # May 7, 2025, 10:05:11am UTC
SECONDS_PER_SLOT: 12
SECONDS_PER_ETH1_BLOCK: 14
MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256
SHARD_COMMITTEE_PERIOD: 256
ETH1_FOLLOW_DISTANCE: 16
INACTIVITY_SCORE_BIAS: 4
INACTIVITY_SCORE_RECOVERY_RATE: 16
EJECTION_BALANCE: 16000000000
MIN_PER_EPOCH_CHURN_LIMIT: 4
CHURN_LIMIT_QUOTIENT: 32
PROPOSER_SCORE_BOOST: 40
DEPOSIT_CHAIN_ID: 1337
DEPOSIT_NETWORK_ID: 1337
NETWORK_ID: 1337
DEPOSIT_CONTRACT_ADDRESS: 0x00000000219ab540356cBB839Cbe05303d7705Fa
MAX_COMMITTEES_PER_SLOT: 10
INACTIVITY_PENALTY_QUOTIENT_BELLATRIX: 8
TARGET_COMMITTEE_SIZE: 3
TARGET_AGGREGATORS_PER_COMMITTEE: 2

What I am doing wrong? I wan to create testnet with latest fork (electra) enabled right from genesis block. and since mine is removed so I can't mine either. I embedded deposit contract bytes right in genesis.json.

I really need help unblocking this to get my Electra fork testnet running with Lighthouse. Thank you!

MuhammadJamshaidGhaffar avatar Jun 10 '25 19:06 MuhammadJamshaidGhaffar