Skip to content

Geth refuses to sync after being a few months offline #25730

@elsampsa

Description

@elsampsa

Weird behaviour from geth when putting a client online after it's been offline for a few months. I would really appreciate if someone would explain me what's going on / put me on the right track.

So far happened:

  • On Jan 22 did a fresh snap sync from scratch. The blockchain was synced within a matter of days. Awesome!
  • Wen't offline for the summer. Let's call the world state before summer "S0".
  • On Sept 22 went online again & wanted to go POS, so updated to geth 1.10.23 and started using prysm 3.0.0.
  • After going online again, geth refuses to reconstruct the current world state "SC".

I am using the "--syncmode=snap" option. When "--syncmode=snap" is enabled, I have to admit I am not sure which one of the two ways, (A) or (B), geth is syncing:

A. The full-node way:

  • Picks up the world state "S0" where it was left in before summer.
  • Starts executing the blocks, until the state has been updated from "S0"->"SC"

B. Snapshot download:

  • Proceeds in downloading state snapshot fragments from other peers
  • ..using snapshot packets, reconstructs the state from scratch into "SC"?
  • ..or tries to do an incremental heal of "S0" --> "SC" using snapshot fragments (sounds silly, right? I guess I'm just imaging this)

Is there some criteria which one of the two ways geth ends up doing? Say, if state is enough old, then do (B) instead of (A)?

Obviously, I would prefer (A), since I'm not syncing from scratch. Should I then remove "--syncmode=snap" ?

Next, let's take a look at the logs:

syys 05 11:28:36 sampsa-asus geth[11610]: INFO [09-05|11:28:36.595] Imported new block headers               count=1    elapsed=4.940ms     number=15,476,571 hash=0cb37e..4b58b2 age=1h51m15s
syys 05 11:28:46 sampsa-asus geth[11610]: INFO [09-05|11:28:46.906] State heal in progress                   accounts=11,848,[email protected] slots=34,874,[email protected]    codes=107,[email protected] nodes=363,163,[email protected] pending=1
syys 05 11:29:04 sampsa-asus geth[11610]: WARN [09-05|11:29:04.616] Snapshot extension registration failed   peer=35ba3061 err="peer connected on snap without compatible eth support"
syys 05 11:29:08 sampsa-asus geth[11610]: INFO [09-05|11:29:08.040] State heal in progress                   accounts=11,848,[email protected] slots=34,874,[email protected]    codes=107,[email protected] nodes=363,163,[email protected] pending=1
syys 05 11:29:08 sampsa-asus geth[11610]: INFO [09-05|11:29:08.096] Imported new block headers               count=1    elapsed=5.270ms     number=15,476,572 hash=eab73d..75ece5 age=1h51m42s
syys 05 11:29:08 sampsa-asus geth[11610]: WARN [09-05|11:29:08.098] Dropping unsynced node during sync       id=c83d584aa6a7cf69 conn=inbound addr=146.0.216.163:40678   type=Geth/v1.10.23-stable...
syys 05 11:29:23 sampsa-asus geth[11610]: WARN [09-05|11:29:23.229] Snapshot extension registration failed   peer=2b87dc19 err="peer connected on snap without compatible eth support"
syys 05 11:29:27 sampsa-asus geth[11610]: WARN [09-05|11:29:27.443] Snapshot extension registration failed   peer=6de3885d err="peer connected on snap without compatible eth support"
syys 05 11:30:04 sampsa-asus geth[11610]: INFO [09-05|11:30:04.652] Imported new block headers               count=1    elapsed=5.077ms     number=15,476,573 hash=695338..95f981 age=1h52m27s
syys 05 11:30:05 sampsa-asus geth[11610]: INFO [09-05|11:30:05.349] Downloader queue stats                   receiptTasks=0     blockTasks=0     itemSize=254.59KiB throttle=1030
syys 05 11:30:48 sampsa-asus geth[11610]: INFO [09-05|11:30:48.716] Imported new block headers               count=2    elapsed=5.064ms     number=15,476,575 hash=664007..cdd2dd age=1h52m55s
syys 05 11:30:49 sampsa-asus geth[11610]: WARN [09-05|11:30:49.374] Pivot became stale, moving               old=15,476,449 new=15,476,513
syys 05 11:30:49 sampsa-asus geth[11610]: INFO [09-05|11:30:49.504] Imported new block receipts              count=64   elapsed=129.241ms   number=15,476,512 hash=14ddfa..f13f36 age=2h9m6s    size=8.55MiB
syys 05 11:30:49 sampsa-asus geth[11610]: INFO [09-05|11:30:49.504] State heal in progress                   accounts=11,848,[email protected] slots=34,874,[email protected]    codes=107,[email protected] nodes=363,163,[email protected] pending=1
syys 05 11:30:55 sampsa-asus geth[11610]: INFO [09-05|11:30:55.112] Imported new block headers               count=1    elapsed=4.197ms     number=15,476,576 hash=413332..413f19 age=1h52m57s
syys 05 11:31:23 sampsa-asus geth[11610]: INFO [09-05|11:31:23.472] Imported new block headers               count=1    elapsed=4.914ms     number=15,476,577 hash=192227..5f294e age=1h52m55s
syys 05 11:31:24 sampsa-asus geth[11610]: INFO [09-05|11:31:24.524] Downloader queue stats                   receiptTasks=0     blockTasks=0     itemSize=260.17KiB throttle=1008
syys 05 11:31:36 sampsa-asus geth[11610]: INFO [09-05|11:31:36.180] Imported new block headers               count=2    elapsed=9.148ms     number=15,476,579 hash=1d9258..ef0920 age=1h52m52s
syys 05 11:32:04 sampsa-asus geth[11610]: INFO [09-05|11:32:04.529] Imported new block headers               count=2    elapsed=6.110ms     number=15,476,581 hash=37288d..497e7a age=1h53m14s
syys 05 11:32:07 sampsa-asus geth[11610]: INFO [09-05|11:32:07.813] Imported new block headers               count=6    elapsed=17.703ms    number=15,476,587 hash=dbcbde..6a6aa8 age=1h52m40s
syys 05 11:32:11 sampsa-asus geth[11610]: INFO [09-05|11:32:11.064] Imported new block headers               count=2    elapsed=5.816ms     number=15,476,589 hash=f78c93..d547a7 age=1h52m35s
syys 05 11:32:14 sampsa-asus geth[11610]: INFO [09-05|11:32:14.329] Imported new block headers               count=1    elapsed=5.343ms     number=15,476,590 hash=1d970a..dbb580 age=1h52m36s
syys 05 11:32:17 sampsa-asus geth[11610]: INFO [09-05|11:32:17.596] Imported new block headers               count=1    elapsed=5.462ms     number=15,476,591 hash=8efbe0..077eb1 age=1h52m28s
syys 05 11:32:24 sampsa-asus geth[11610]: INFO [09-05|11:32:24.007] Imported new block headers               count=2    elapsed=13.627ms    number=15,476,593 hash=9d2ae6..f64c80 age=1h51m17s
syys 05 11:32:24 sampsa-asus geth[11610]: INFO [09-05|11:32:24.562] Downloader queue stats                   receiptTasks=0     blockTasks=0     itemSize=372.89KiB throttle=704
syys 05 11:32:30 sampsa-asus geth[11610]: INFO [09-05|11:32:30.406] Imported new block headers               count=1    elapsed=5.857ms     number=15,476,594 hash=59a38c..b964ff age=1h50m21s
syys 05 11:32:33 sampsa-asus geth[11610]: INFO [09-05|11:32:33.696] Imported new block headers               count=1    elapsed=5.346ms     number=15,476,595 hash=a0f7d8..ccb3e3 age=1h50m1s
syys 05 11:32:40 sampsa-asus geth[11610]: INFO [09-05|11:32:40.090] Imported new block headers               count=3    elapsed=5.102ms     number=15,476,598 hash=961009..fc298a age=1h49m9s
syys 05 11:32:43 sampsa-asus geth[11610]: INFO [09-05|11:32:43.361] Imported new block headers               count=1    elapsed=4.918ms     number=15,476,599 hash=05bd57..d6f4b9 age=1h49m
syys 05 11:32:49 sampsa-asus geth[11610]: INFO [09-05|11:32:49.788] Imported new block headers               count=6    elapsed=22.194ms    number=15,476,605 hash=91c36f..a618eb age=1h48m28s
syys 05 11:32:53 sampsa-asus geth[11610]: INFO [09-05|11:32:53.036] Imported new block headers               count=1    elapsed=4.784ms     number=15,476,606 hash=d3a357..1cb4d0 age=1h48m30s
syys 05 11:32:56 sampsa-asus geth[11610]: INFO [09-05|11:32:56.313] Imported new block headers               count=1    elapsed=4.866ms     number=15,476,607 hash=c0fc48..6b72f0 age=1h48m30s
syys 05 11:32:59 sampsa-asus geth[11610]: INFO [09-05|11:32:59.583] Imported new block headers               count=1    elapsed=5.789ms     number=15,476,608 hash=f7470d..d2f3c5 age=1h48m31s
  • Blocks are imported at a good pace? A few milliseconds per block.
  • "Pivot became stale, moving" : does this has to do something with downloading the snapshot from other peers? .. starting it all over again? Is it doing (A) or (B) (see above)?
  • State heal in progress reports the number of accounts in ethereum.. this should be near hundred millions at the moment? Why the state is healed/updated soooo slow? (this is after being a few days online).

Let's continue:

syys 05 11:50:13 sampsa-asus geth[11610]: INFO [09-05|11:50:13.381] Disabling direct-ancient mode            origin=15,477,053 ancient=14,627,238
syys 05 11:50:13 sampsa-asus geth[11610]: INFO [09-05|11:50:13.381] State heal in progress                   accounts=11,848,[email protected] slots=34,874,[email protected]    codes=107,[email protected] nodes=363,168,[email protected] pending=1
syys 05 11:50:13 sampsa-asus geth[11610]: INFO [09-05|11:50:13.750] Imported new block headers               count=9    elapsed=90.869ms    number=15,477,128 hash=8cad3b..8a6686 age=1m10s     ignored=66
syys 05 11:50:17 sampsa-asus geth[11610]: INFO [09-05|11:50:17.219] Imported new block headers               count=1    elapsed=4.008ms     number=15,477,129 hash=4a8b20..97bd42 age=1m10s
syys 05 11:50:18 sampsa-asus geth[11610]: INFO [09-05|11:50:18.430] Downloader queue stats                   receiptTasks=0     blockTasks=0     itemSize=262.34KiB throttle=1000
syys 05 11:50:18 sampsa-asus geth[11610]: INFO [09-05|11:50:18.451] Imported new block receipts              count=10   elapsed=20.515ms    number=15,477,063 hash=68f457..1a4bca age=14m52s    size=2.11MiB
syys 05 11:50:18 sampsa-asus geth[11610]: INFO [09-05|11:50:18.451] State heal in progress                   accounts=11,848,[email protected] slots=34,874,[email protected]    codes=107,[email protected] nodes=363,168,[email protected] pending=1
syys 05 11:50:25 sampsa-asus geth[11610]: INFO [09-05|11:50:25.672] Imported new block headers               count=1    elapsed=6.006ms     number=15,477,130 hash=5c6caa..88b273
syys 05 11:50:29 sampsa-asus geth[11610]: INFO [09-05|11:50:29.716] State heal in progress                   accounts=11,848,[email protected] slots=34,874,[email protected]    codes=107,[email protected] nodes=363,169,[email protected] pending=19532
syys 05 11:50:40 sampsa-asus geth[11610]: WARN [09-05|11:50:40.869] Snapshot extension registration failed   peer=1125cc47 err="peer connected on snap without compatible eth support"
syys 05 11:50:47 sampsa-asus geth[11610]: INFO [09-05|11:50:47.686] Imported new block headers               count=1    elapsed=8.713ms     number=15,477,131 hash=0145a7..0ce6dc
  • What is disabling direct-ancient mode? Does it has to do with the problem at hand?
  • Note the "State heal in progress" reporting number of pending accounts jumping from 1 to 19532. Why's that?
  • Note that donwloaded and verified blocks are practically there: "age=1m10s"
  • Then we have a lot of this going on:
syys 05 16:08:19 sampsa-asus geth[11610]: WARN [09-05|16:08:19.561] Unexpected bytecode heal packet          peer=905d36fa reqid=7,304,675,219,279,965,590
  • what's that about? Haven't seen a proper explanation of this anywhere.

The client was running ~ 4 days until I got fed up and put it offline. Got this far:

syys 05 16:08:58 sampsa-asus geth[11610]: INFO [09-05|16:08:58.909] State heal in progress                   accounts=12,866,[email protected] slots=37,899,[email protected]    codes=111,[email protected] nodes=371,245,[email protected] pending=188,584

I interprete that downloaded and verified blocks are ok (it seem to reach the latest block occasionally), but the client is unable to reconstruct the up-to-date world state "SC".

I don't understand why. Once the block is downloaded and verified you get the state change, so what is interfering here with the state update/reconstruction?

Is there some competition/contradiction going on between (A) and (B)? (see above)

Some details on my system:
8 x Intel(R) Core(TM) i7-4700HQ CPU @ 2.40GHz
2TB SSD drive: "Crucial BX500"
12 GB RAM (& all the swap you could wish for)
(as mentioned, this was able to snapsync from scratch before summer)

P. S. It would be important to be able to contribute to the network without being a 24/7 avail/on-call eth-client-massage service provider.. to be offline if needed, etc. Imagine that I'd done staking at this point..!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions