Repository navigation
Conversation
8d27e73 to
d1d5af1
Compare
d1d5af1 to
45bf9e3
Compare
|
Concept ACK. Thanks for picking this up, Jon! |
308cd07 to
f23984d
Compare
Thanks, John. The interesting thing is, unlike the PR17335 description, the original issue reported by @sdaftuar still appears to be unresolved. |
f23984d to
6ee65be
Compare
|
Rebased to add more tests to verify that the non-mining node does catch up to the chain tip on the next coinbase transactions after the first one. |
6ee65be to
c48c680
Compare
|
Thanks for digging into this more, @jonatack . I've run the test with the assert catching removed to reproduce the error. I've attached a combined log (best viewed with If we invalidate bitcoin/src/net_processing.cpp Lines 1270 to 1272 in 1269cab (ie the new block isn't as high as a block node0 has previously announced via compact blocks) Instead, node0 relies on block inventory sending in bitcoin/src/net_processing.cpp Lines 3956 to 3971 in 1269cab We're generating the blocks on the RPC thread (httpworker.x), but this block inventory relay happens on the MessageHandler thread. The timing windows for those two threads is the reason for the intermittency of this test failing. In my failing case, all 17 blocks are generated while the message handler thread is sleeping. Here's the sleep on the message handler thread: Line 2118 in 1269cab Here it is waking up to send the blocks: and here is the first of the 17 blocks being generated: (ie all block generation happens in the 0.1s message handler sleep) When node0 gets to the logic in bitcoin/src/net_processing.cpp Lines 3956 to 3971 in 1269cab Here it is in the log: The next time node0 goes through which node1 receives: I'd expect that to trigger node1 to send a getheaders for that block: bitcoin/src/net_processing.cpp Lines 2956 to 2961 in 1269cab But it doesn't. node1 doesn't do any processing or requesting for the final block, which is why it never syncs to the same tip as node0. I haven't dug into which logic path node1 takes through the CMPCTBLOCK processing. As the test demonstrates, if node0 then generates and announces another block, then node1 will be able to sync to it. I'm not sure what to do with this. It seems like a very limited edge-case, so maybe we can just document it and move on. Perhaps @sdaftuar or @TheBlueMatt have an opinion? |
|
No ACKs. Closing. |
This commit picks up #17335 to add an updated version of a test by Suhas Daftuar in issue #5806 to demonstrate a block propagation issue for the first coinbase following an
invalidateblock. As Suhas reported: "[only] the first 16 [blocks] will make it, because of the call to getdata on processing each inv, which occurs until we've maxed out the number of blocks in flight to that peer."Here we test that after running
invalidateblock, on the first coinbase transaction nodes will resync to a new lower chain tip, but for the non-mining node only reliably up to the number of blocks equal to the value (16) ofMAX_BLOCKS_IN_TRANSIT_PER_PEER. We then check that it catches up to the chain tip with the next coinbase transactions.Reviewers may test this by running the test with different values of
BLOCKSin the test and with rebuilding using different values ofMAX_BLOCKS_IN_TRANSIT_PER_PEERin net_processing.cpp.