Skip to content

Commit

Permalink
Merge bitcoin#27626: Parallel compact block downloads, take 3
Browse files Browse the repository at this point in the history
d7f359b Add tests for parallel compact block downloads (Greg Sanders)
03423f8 Support up to 3 parallel compact block txn fetchings (Greg Sanders)
13f9b20 Only request full blocks from the peer we thought had the block in-flight (Greg Sanders)
cce9618 Convert mapBlocksInFlight to a multimap (Greg Sanders)
a905954 Remove nBlocksInFlight (Greg Sanders)
86cff8b alias BlockDownloadMap for mapBlocksInFlight (Greg Sanders)

Pull request description:

  This is an attempt at mitigating bitcoin#25258 , which is a revival of bitcoin#10984, which is a revival of bitcoin#9447.

  This PR attempts to mitigate a single case, where high bandwidth peers can bail us out of a flakey
  peer not completing blocks for us. We allow up to 2 additional getblocktxns requests per unique block.
  This would hopefully allow the chance for an honest high bandwidth peer to hand us the transactions
  even if the first in flight peer stalls out.

  In contrast to previous effort:

  1) it will not help if subsequent peers send block headers only, so only high-bandwidth peers this time. See: https://github.com/bitcoin/bitcoin/pull/10984/files#diff-6875de769e90cec84d2e8a9c1b962cdbcda44d870d42e4215827e599e11e90e3R1411
  2)  `MAX_GETBLOCKTXN_TXN_AFTER_FIRST_IN_FLIGHT` is removed, in favor of aiding recovery during turbulent mempools
  3) We require one of the 3 block fetching slots to be an outbound peer. This can be the original offering peer, or subsequent compact blocks given by high bandwidth peers.

ACKs for top commit:
  sdaftuar:
    ACK d7f359b
  mzumsande:
    Code Review ACK d7f359b

Tree-SHA512: 54980eac179e30f12a0bd49df147b2c3d63cd8f9401abb23c7baf02f76eeb59f2cfaaa155227990d0d39384de9fa38663f88774e891600a3837ae927f04f0db3
  • Loading branch information
fanquake committed May 24, 2023
2 parents 3132ec6 + d7f359b commit 51c0507
Show file tree
Hide file tree
Showing 5 changed files with 242 additions and 76 deletions.
2 changes: 2 additions & 0 deletions src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ class CNodeStats
int nVersion;
std::string cleanSubVer;
bool fInbound;
// We requested high bandwidth connection to peer
bool m_bip152_highbandwidth_to;
// Peer requested high bandwidth connection
bool m_bip152_highbandwidth_from;
int m_starting_height;
uint64_t nSendBytes;
Expand Down
Loading

0 comments on commit 51c0507

Please sign in to comment.