Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node Syncing - Service Unavailable | Discovered new validators count=0 #4977

Closed
avenbreaks opened this issue Jan 5, 2023 · 5 comments
Closed

Comments

@avenbreaks
Copy link

i got an error on getProposerDuites when connecting geth with lodestart using a customize file

Logs :

Jan-05 19:33:12.012[] info: Discovered new validators count=0
Jan-05 19:33:12.014[] info: Node is syncing - Service Unavailable: Node is syncing - waiting for peers - Error on getProposerDuties
Jan-05 19:33:24.013[] info: Node is syncing - Service Unavailable: Node is syncing - waiting for peers - Error on getProposerDuties
Jan-05 19:33:36.015[] info: Node is syncing - Service Unavailable: Node is syncing - waiting for peers - Error on getProposerDuties
Jan-05 19:33:48.013[] info: Node is syncing - Service Unavailable: Node is syncing - waiting for peers - Error on getProposerDuties
Jan-05 19:34:00.015[] info: Node is syncing - Service Unavailable: Node is syncing - waiting for peers - Error on getProposerDuties
Jan-05 19:34:12.015[] info: Node is syncing - Service Unavailable: Node is syncing - waiting for peers - Error on getProposerDuties
Jan-05 19:34:24.015[] info: Node is syncing - Service Unavailable: Node is syncing - waiting for peers - Error on getProposerDuties

Expected behavior
Node Syncing Successful

Steps to Reproduce

geth init \
  --datadir "/home/Desktop/gitshock-client/account-1" \
  /home/joy/Desktop/holesovice/ether-tools/ethereum-genesis-generator/data/custom_config_data/genesis.json
geth init \
  --datadir "/home/Desktop/gitshock-client/account-2" \
  /home/joy/Desktop/holesovice/ether-tools/ethereum-genesis-generator/data/custom_config_data/genesis.json
geth \
  --networkid 1881 \
  --datadir "/home/Desktop/gitshock-client/account-1"
geth \
  --networkid 1881 \
  --datadir "/home/Desktop/gitshock-client/account-2" \
  --authrpc.port 8651 \
  --port 31303 \
  --bootnodes enode://4834776309cc5528030da68da7b5a9e76684fc4743f3c1405549cd16400cba81291aba792de3c2306b82cd5956312e46292a2b30f5ff95015d571a358a3ac85b@127.0.0.1:30303
eth2-testnet-genesis merge \
  --config "/home/joy/Desktop/ether-tools/ethereum-genesis-generator/data/custom_config_data/config.yaml" \
  --eth1-config "/home/joy/Desktop/ether-tools/ethereum-genesis-generator/data/custom_config_data/genesis.json" \
  --mnemonics "/home/joy/Desktop/ether-tools/ethereum-genesis-generator/data/custom_config_data/mnemonics.yaml" \
  --state-output "/home/joy/Desktop/ether-tools/ethereum-genesis-generator/data/custom_config_data/genesis.ssz" \
  --tranches-dir "/home/joy/Desktop/ether-tools/ethereum-genesis-generator/data/custom_config_data/tranches"
./lodestar beacon \
  --suggestedFeeRecipient "0xC286B121d79856D734AF9eC2c78d50D1A33AAA5A" \
  --execution.urls "http://127.0.0.1:8551" \
  --jwt-secret "/home/Desktop/gitshock-client/account-1/geth/jwtsecret" \
  --dataDir "/home/Desktop/gitshock-client/account-1" \
  --paramsFile "/home/Desktop/ether-tools/ethereum-genesis-generator/data/custom_config_data/config.yaml" \
  --genesisStateFile "/home/Desktop/ether-tools/ethereum-genesis-generator/data/custom_config_data/genesis.ssz" \
  --enr.ip 127.0.0.1
./lodestar beacon \
  --suggestedFeeRecipient "0xC286B121d79856D734AF9eC2c78d50D1A33AAA5A" \
  --execution.urls "http://127.0.0.1:8551" \
  --jwt-secret "/home/Desktop/gitshock-client/account-1/geth/jwtsecret" \
  --dataDir "/home/Desktop/gitshock-client/account-2" \
  --paramsFile "/home/Desktop/ether-tools/ethereum-genesis-generator/data/custom_config_data/config.yaml" \
  --genesisStateFile "/home/Desktop/ether-tools/ethereum-genesis-generator/data/custom_config_data/genesis.ssz" \
  --enr.ip 127.0.0.1 \
  --rest.port 9696 \
  --port 9100 \
  --network.connectToDiscv5Bootnodes true \
  --bootnodes "enr:-L24QGygYyU52vODc9wzdSzMeEHeHcEjGEESjTJqaRTQaRKBW3RHC_dRXcr8x5FfQv3zZU2bYdUVFwbFKI6S_4Ob-hsGh2F0dG5ldHOIAAAAAAAAAACEZXRoMpCsnaz-AhiBAP__________gmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQJAZb35rS1E1I5eNpz5wyZsOj7--9kfba8tlcaDSmLYdIhzeW5jbmV0c4gAAAAAAAAAAIN0Y3CCIyg"
./lodestar validator \
  --dataDir "/home/Desktop/gitshock-client/account-1" \
  --suggestedFeeRecipient "0xC286B121d79856D734AF9eC2c78d50D1A33AAA5A" \
  --graffiti "YOLO HOLESOVICE LODESTAR" \
  --paramsFile "/home/Desktop/ether-tools/ethereum-genesis-generator/data/custom_config_data/config.yaml" \
  --importKeystores "/home/Desktop/staking-deposit-cli/validator_keys/keystore-m_12381_3600_0_0_0-1672917341.json" \
  --importKeystoresPassword "/home/Desktop/staking-deposit-cli/validator_keys/password.txt"

Screenshots
image
image
image

Desktop (please complete the following information):

  • OS: Ubuntu
  • Version: 22
  • Branch: latest
@avenbreaks
Copy link
Author

http://localhost:9596/eth/v1/node/syncing
{"data":{"head_slot":"0","sync_distance":"139409947","is_syncing":true,"is_optimistic":false}}

http://localhost:9596/eth/v1/node/identity
{"data":{"peer_id":"16Uiu2HAkym445W5zj77VcZTu66D7MrAisSzmVeaNvvfvmTWfRCEw","enr":"enr:-L24QGygYyU52vODc9wzdSzMeEHeHcEjGEESjTJqaRTQaRKBW3RHC_dRXcr8x5FfQv3zZU2bYdUVFwbFKI6S_4Ob-hsGh2F0dG5ldHOIAAAAAAAAAACEZXRoMpCsnaz-AhiBAP__________gmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQJAZb35rS1E1I5eNpz5wyZsOj7--9kfba8tlcaDSmLYdIhzeW5jbmV0c4gAAAAAAAAAAIN0Y3CCIyg","p2p_addresses":["/ip4/127.0.0.1/tcp/9000/p2p/16Uiu2HAkym445W5zj77VcZTu66D7MrAisSzmVeaNvvfvmTWfRCEw","/ip4/192.168.18.92/tcp/9000/p2p/16Uiu2HAkym445W5zj77VcZTu66D7MrAisSzmVeaNvvfvmTWfRCEw"],"discovery_addresses":["/ip4/127.0.0.1/tcp/9000"],"metadata":{"seq_number":"0","attnets":"0x0000000000000000","syncnets":"0x00"}}}

@dapplion
Copy link
Contributor

dapplion commented Jan 9, 2023

A node cannot safely consider itself synced unless it has peers. If you are running on a local devnet with not value, you can use the hidden options --sync.isSingleNode --network.allowPublishToZeroPeers to allow the node to consider itself synced with 0 peers.

@yummyweb
Copy link

yummyweb commented May 5, 2023

I am running a local testnet using the dev command, and I am getting a similar command.

My command:
image

The output:
image

It connects to peers, but it periodically gives me the error for service unavailable. I am trying to use the API: /eth/v2/validator/blocks/2263622 to produce a block, however, i get this output.

{ "statusCode": 503, "error": "Service Unavailable", "message": "Node is syncing - waiting for peers" }

@nflaig
Copy link
Member

nflaig commented Jun 29, 2023

The issue seems to be that the node will not be able to sync if the genesisTime is too far in past (more than SLOTS_PER_EPOCH).

This is due to the fact that we check that the head slot is within a range from current slot, otherwise it will start a range sync which requires peers that provide the historical data.

(headSlot <= currentSlot && headSlot >= currentSlot - this.slotImportTolerance)) &&

The head slot will always be 0 if starting the node with an empty db (unless checkpoint sync is used) and the current slot is calculated based on the genesis time.

return GENESIS_SLOT + getSlotsSinceGenesis(config, genesisTime);

To get the chain to start syncing the genesisTime needs to be within SLOTS_PER_EPOCH range or a future point in time.
For setting up a local testnet, the dev scripts can be used which ensure that the genesis time is always the current date.

@nflaig
Copy link
Member

nflaig commented Aug 4, 2023

For anyone trying to set up a local / private Ethereum network, please check out https://github.com/rocknet/ethiab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants