Skip to content

reduce synchronize timeouts and increase block batch size

Christopher Schinnerl requested to merge tbenz9:sync-speedup into master

Created by: tbenz9

The sendBlkTimeout and sendBlocksTimeout are causing a huge amount of wasted time during the initial blockchain sync. I've synchronized the blockchain 3 times with default settings and Sia spent an average of 10701 seconds downloading the blocks. When I dropped the timeouts down to 10seconds I was able to download the blocks in just 815 seconds.

This PR tries to find a happy middle between slower peers and having a performant IBD. I believe every peer should be able to respond within the timeout limits specified, and we won't spend so much time waiting for the peer to timeout if it's not responding.

Changing MaxCatchUpBlocks to 25 is meant to reduce the overhead of requesting and sending so many blocks. This is harder to test since even if I ask for 100 blocks peers only send back 10 at a time right now, this change would have to propagate out to peers before we'll be able to measure its performance implications.

This PR is meant to improve the sync time while we wait for an overhaul of the consensus module.

Merge request reports