• Welcome to forex.pm forex forum binary options trade. Please login or sign up.
 

Bitcoin Core stalled peer logic during initial block download

Started by Bitcoin, Feb 04, 2022, 06:26 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bitcoin

Bitcoin Core stalled peer logic during initial block download

I'm trying to track down the cause of unexpected (20% to 85%) IBD slowdowns between my 2020 and 2021 annual performance tests.


I experienced this slowdown with multiple implementations, so I don't think the issue is Bitcoin Core specific, though I do want to understand one potential cause with regard to how Bitcoin Core handles stalled peers.


Several developers have told me that if a peer doesn't respond to a request for a block, a Bitcoin Core node will disconnect from it after 15 minutes. I see here that @pieter-wuille said something similar on a related question.


However, when I look at the "stalled block download" logic in Bitcoin Core it seems to be using a timeout of only 2 seconds.


I have several full debug logs from different syncs I ran and from looking at the logs, these stalled peers appear to get disconnected after 2 seconds; even the ones that are serving headers rather than blocks. Example log:


2021-10-28T13:00:43Z New outbound peer connected: version: 70016, blocks=707043, peer=9 (outbound-full-relay)
2021-10-28T13:00:45Z Ignoring getheaders from peer=9 because node is in initial block download
2021-10-28T13:00:48Z more getheaders (338000) to end to peer=9 (startheight:707043)
2021-10-28T13:00:48Z Protecting outbound peer=9 from eviction
2021-10-28T13:00:50Z more getheaders (340000) to end to peer=9 (startheight:707043)
2021-10-28T13:00:52Z more getheaders (368000) to end to peer=9 (startheight:707043)
2021-10-28T13:00:53Z more getheaders (342000) to end to peer=9 (startheight:707043)
2021-10-28T13:00:54Z more getheaders (370000) to end to peer=9 (startheight:707043)
2021-10-28T13:00:56Z more getheaders (344000) to end to peer=9 (startheight:707043)
2021-10-28T13:00:59Z more getheaders (372000) to end to peer=9 (startheight:707043)
2021-10-28T13:01:00Z more getheaders (346000) to end to peer=9 (startheight:707043)
2021-10-28T13:01:02Z more getheaders (374000) to end to peer=9 (startheight:707043)
2021-10-28T13:01:03Z more getheaders (348000) to end to peer=9 (startheight:707043)
2021-10-28T13:01:04Z more getheaders (437999) to end to peer=9 (startheight:707043)
2021-10-28T13:01:07Z more getheaders (376000) to end to peer=9 (startheight:707043)
2021-10-28T13:01:09Z more getheaders (350000) to end to peer=9 (startheight:707043)
2021-10-28T13:01:11Z more getheaders (439999) to end to peer=9 (startheight:707043)
2021-10-28T13:01:14Z more getheaders (378000) to end to peer=9 (startheight:707043)
2021-10-28T13:01:16Z more getheaders (352000) to end to peer=9 (startheight:707043)
2021-10-28T13:01:18Z more getheaders (489999) to end to peer=9 (startheight:707043)
2021-10-28T13:01:19Z more getheaders (441999) to end to peer=9 (startheight:707043)
2021-10-28T13:01:20Z more getheaders (380000) to end to peer=9 (startheight:707043)
2021-10-28T13:01:22Z more getheaders (354000) to end to peer=9 (startheight:707043)
2021-10-28T13:01:23Z initial getheaders (707100) to peer=9 (startheight:707043)
2021-10-28T13:01:24Z more getheaders (491999) to end to peer=9 (startheight:707043)
2021-10-28T13:01:25Z more getheaders (443999) to end to peer=9 (startheight:707043)
2021-10-28T13:01:26Z Peer=9 is stalling block download, disconnecting

In short, I'm trying to better understand what the worst case scenario of slow / malicious peers could be with regard to impacting IBD performance and how I might diagnose which peers are causing the sync slowdown.


Source: Bitcoin Core stalled peer logic during initial block download