I initially ran geth --fast to sync the blockchain.

Now at ~163GB, each time I restart geth (without fast), and do geth attach -> eth.syncing it starts from currentBlock:0. I do have --cache=1024 set. Sample output after some time of syncing:

> eth.syncing
  currentBlock: 2406901,
  highestBlock: 5243532,
  knownStates: 3323202,
  pulledStates: 3295634,
  startingBlock: 0


elapsed=7.064ms   number=3124877 hash=65ce7a…d78803 size=511.42kB ignored=0
INFO [03-12|19:10:53] Imported new block headers               count=960  elapsed=73.505ms  number=3130944 hash=22a327…6bdc80 ignored=0
INFO [03-12|19:10:53] Imported new block receipts              count=839  elapsed=108.746ms number=3125716 hash=6cbb1f…acdcb2 size=4.81mB   ignored=0
INFO [03-12|19:10:53] Imported new block receipts              count=1203 elapsed=111.895ms number=3126919 hash=9bd7d9…f05e79 size=5.52mB   ignored=0
INFO [03-12|19:10:53] Imported new block headers               count=1152 elapsed=162.272ms number=3132096 hash=8f513f…592be3 ignored=0
INFO [03-12|19:10:53] Imported new block headers               count=192  elapsed=21.768ms  number=3132288 hash=b1bc5b…56f68b ignored=0

Why is this happening? Is it actually re-syncing the blocks or just loading/importing blocks into memory? How can I force it to pick up where it left off instead of going through this process each time?

edit: For some reason my startingBlock is always 0, which I think might be the crux of the issue.

  • What version of geth are you using? Since several versions --fast is the default option when no sync method is specified, so it should be ok. If you restart cleanly it should start where you left, perhaps geth was shutdown forcefully and it didn't close properly. – Ismael Mar 12 '18 at 20:19
  • what is the proper way to stop geth? That could be the issue, since I run geth in a docker container with docker-compose. – relik Mar 12 '18 at 20:22
  • Sending a kill signal and waiting for the process to exit should be enough (ie equivalent to Ctr+C from the console). – Ismael Mar 12 '18 at 20:32
  • thanks @Ismael The problem was indeed me not stopping geth properly by just stopping the docker container. I now see the correct starting block. Thanks much! – relik Mar 12 '18 at 21:47
  • it does not start from block zero, it starts from currentBlock, as you can see the currentBlock is 2406901 – Nulik Mar 12 '18 at 23:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.