grin icon indicating copy to clipboard operation
grin copied to clipboard

Restarting download "txhashset-NNNNN.zip" every 10 min on Sync step 2 - never finish

Open Novator opened this issue 2 years ago • 2 comments

The step 1 passed good. Then "Current Status: Sync step 2/7: Downloading 1041(MB) chain state for state sync: 58% at 263.0(kB/s)", and when pass 10 minutes, in tab "Logs" there are appeared messages:

20220427 01:51:18.614 WARN grin_servers::grin::server - Grin server started.
20220427 01:51:18.617 WARN grin_servers::mining::stratumserver - Stratum server started on 127.0.0.1:3416                                                                                         
20220427 02:01:19.885 ERROR grin_servers::grin::sync::state_sync - state_sync: TxHashsetDownload status timeout in 10 minutes!
20220427 02:01:19.896 ERROR grin_servers::grin::sync::state_sync - state_sync: error = Sync error
  Cause: Unknown
  Backtrace: . restart fast sync
20220427 02:11:19.903 ERROR grin_servers::grin::sync::state_sync - state_sync: TxHashsetDownload status timeout in 10 minutes!
20220427 02:11:19.914 ERROR grin_servers::grin::sync::state_sync - state_sync: error = Sync error
  Cause: Unknown
  Backtrace: . restart fast sync

New file "/home/user/.grin/main/tmp/txhashset-NNNNN.zip" starts to download. Meanwhile previous file "../txhashset-NNNNN.zip" also is continuing download. After 10 minute the situation repeats. So, the third "../txhashset-NNNNN.zip" starts, and so on. Now I have already 5 (FIVE, CARL!!!) files are downloading, and no one is finished.

So, you need to take into consideration, it exists not fast connections (I have 5 Mbits/sec):

  1. increase 10 minute limit to 30 minute or some alike
  2. break downloading the first file
  3. continue to download previous interrupted zip-file.

Give me an advice please, how can I pass step 2 in present version (grin-v5.2.0-alpha.1-linux-amd64.tar.gz)?

Novator avatar Apr 26 '22 21:04 Novator

I downloaded sources and install Rust with this manual: https://github.com/mimblewimble/grin/blob/master/doc/build.md then I found the file: /grin/servers/src/grin/sync/state_sync.rs line 219: if now - prev > Duration::minutes(10) {

I've changed it to: if now - prev > Duration::minutes(60) { then rebuild and restart grin.

Now step 2 has gone ok.

Guys, I think you should apply this in "master" branch, maybe even to add setup parameter for this.

Good luck!

Novator avatar Apr 26 '22 23:04 Novator

Thank you very much for this workaround. It fixed the problem for me. On a slow connection, the download can take longer than 60 minutes, so some will have to increase the value. I set it to 240 just to be on the safe side.

PIBD aims to solve this issue by requesting the UTXO set in pieces. Unfortunately, implementation is going very slowly, considering the RFC was published 2 years ago.

mmgen avatar Sep 10 '22 10:09 mmgen