testBroadcastBlock / testEthHandlerPoW¶
| Source (upstream pre-purge) | Current | |
|---|---|---|
| File | eth/handler_eth_test.go |
handler_eth_pow_test.go |
| Symbol | testBroadcastBlock |
testBroadcastBlock |
| Ref | f4d53133f~1 |
etc/v1.17.4-full-node |
The block propagation test #29169 deleted, revived with the TestBroadcastBlockNPeers table verbatim. It is the only end-to-end coverage of the PoW block path: a real block crosses a real p2p.MsgPipe as a NewBlockMsg, the sink runs the real protocol handler, so the message goes through handleNewBlockPow's decode, item caps and body verification, and the assembled block is asserted to arrive at the backend with the square-root propagation count. Adapted to the current signatures: newTestHandlerWithBlocks gained a SyncMode parameter, eth.NewPeer gained a chainConfig parameter, and the sink handshake calls Handshake68PoW. Two pieces could not be revived into their upstream homes and are fork-owned instead. testEthHandlerPoW embeds the upstream testEthHandler and adds back the blockBroadcasts feed and the *eth.NewBlockPacket case that #33511 removed, since the upstream struct cannot be extended from another file. newTestHandlerPoWWithBlocks mirrors newTestHandlerWithBlocks with IsPow set: the flag decides what newHandler wires up and which handshake runEthPeer runs, so it cannot be flipped after construction, and the upstream constructor never sets it.