Currently we only inv
the hash of the new tip, which means that several round-trips are needed to first discover the hashes of all blocks in between. We can just announce all new hashes.
Just a minor improvement, not intended for 0.10.
Currently we only inv
the hash of the new tip, which means that several round-trips are needed to first discover the hashes of all blocks in between. We can just announce all new hashes.
Just a minor improvement, not intended for 0.10.
2085@@ -2086,14 +2086,16 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo
2086 // or an activated best chain. pblock is either NULL or a pointer to a block
2087 // that is already loaded (to avoid loading it again from disk).
2088 bool ActivateBestChain(CValidationState &state, CBlock *pblock) {
2089- CBlockIndex *pindexNewTip = NULL;
2090 CBlockIndex *pindexMostWork = NULL;
2091 do {
2092 boost::this_thread::interruption_point();
2093
2094+ CBlockIndex *pindexNewTip;
pindexFork
on the line below).
I guess one side effect of this is that when announcing a reorg to an 0.10 peer, this increases the overhead. Say there are N blocks announced in the inv generated here. Then an 0.10 peer will generate N getheaders messages (with the same locator in each, but with a different hashstop), and the 0.10 peer will therefore receive N headers responses, with {0,1,…,(N-1)} headers in each message.
The total overhead is still not that large in absolute terms I think, but with N^2 behavior here, maybe this argues for the cap being more like 4 or 6, rather than 16?
Also I think in the case that we are truncating the inv’s, perhaps it would be better to revert to only inv’ing the tip, rather than announcing up to our cap (whatever we pick for that value), since 0.10 nodes would otherwise be requesting the same long chain of headers multiple times.
concept and light review ACK.
Main comment: If many nodes on the network are re-org’ing at once, doesn’t this cause traffic to spike?
I’ll see if I can queue up some worst case local testing in a week or so, if nobody beats me to it.