4

I started syncing a geth node to the mainnet in fast sync mode 7 days ago. The status is still around 74 blocks behind the highestBlock, e.g. if I run the following:

eth.syncing.highestBlock - eth.syncing.currentBlock

Then I see something between 74 and 100 blocks behind mainnet.

I am running this node on a Digital Ocean droplet with a quad core processor, 8 GB RAM and a 500 GB SSD.

I tried restarting the service and it started off syncing pretty fast again and then got stuck at the same interval of between 74 and 100 blocks behind mainnet.

Can anyone help share some tips on how I might complete this syncing process please?

Any help much appreciated.

2 Answers 2

5

That's a normal behavior, you haven't finished to sync the blockchain.

Let's see the Geth documentation (https://geth.ethereum.org/docs/faq).

In fast sync mode, Geth first downloads blocks without executing the transactions :

The current default mode of sync for Geth is called fast sync. Instead of starting from the genesis block and reprocessing all the transactions that ever occurred (which could take weeks), fast sync downloads the blocks, and only verifies the associated proof-of-works. Downloading all the blocks is a straightforward and fast procedure and will relatively quickly reassemble the entire chain.

The client will then download the state trie (which contains accounts data) for and during the latest blocks :

Many people falsely assume that because they have the blocks, they are in sync. Unfortunately this is not the case, since no transaction was executed, so we do not have any account state available (ie. balances, nonces, smart contract code and data). These need to be downloaded separately and cross checked with the latest blocks. This phase is called the state trie download and it actually runs concurrently with the block downloads; alas it take a lot longer nowadays than downloading the blocks.

You should see in your Geth console Imported state entries logs scrolling and you must wait for the sync to complete :

If you see that you are 64 blocks behind mainnet, you aren’t yet synchronized, not even close. You are just done with the block download phase and still running the state downloads. You can see this yourself via the seemingly endless Imported state entries [...] stream of logs. You’ll need to wait that out too before your node comes truly online.

2
  • Thank you very much for the clarification on this Clement. Everything you mention is exactly what I see on my node right now. Is there anything that I can do to help speed this up? It's now another 24 hours passed since I last checked and the situation appears to be the same - about 100 blocks behind with the 'Imported new state entries' being endlessly logged. One thing I notice too is that the CPU utilization is very low, so the Geth node is not really doing very much processing at all. All 4 processors never get above 20%. Another thing is my bandwidth is around 3.6 Mbps which seems low. Oct 1, 2020 at 2:57
  • 1
    To speed up the process, please see this : ethereum.stackexchange.com/questions/392/….
    – clement
    Oct 1, 2020 at 12:09
3

I finally managed to sync a mainnet node in around 15 hours using i3.2xlarge AWS EC2 instance (8 core, 61 GiB RAM, 1.9 TiB NVMe SSD). It's way larger than what is needed but the main point being that its part of the family of high I/O compute instances offered by AWS. I also selected that instance type based on the Geth teams benchmarks reported here.

I starting geth with the command: geth --syncmode=fast --nousb --cache=4096 --maxpeers=50 (which I think these options are mostly defaults anyway).

...about 15 hours later the logs read Fast sync complete, auto disabling which was great to see! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.