aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2020-12-24 09:18:07 +0800
committerfanquake <fanquake@gmail.com>2020-12-24 09:55:27 +0800
commit1be6f2dba9b79e54ffdb40ae6ac14cede61232ab (patch)
tree3df8f871f18c418648e86a7c9ec0e2de96bd68ea
parente669c3156ff88627a9478be8a6cac12723c2614a (diff)
parent176325a5a47befe32d480b3dc206dd0e64e04b21 (diff)
downloadbitcoin-1be6f2dba9b79e54ffdb40ae6ac14cede61232ab.tar.xz
Merge #20747: net processing: Remove dropmessagestest
176325a5a47befe32d480b3dc206dd0e64e04b21 [net processing] Remove dropmessagestest (John Newbery) Pull request description: -dropmessagestest is a command line option that causes 1 in n received messages to be dropped. The Bitcoin P2P protocol is stateful and in general cannot handle messages being dropped. Dropped version/verack/ping/pong messages will cause the connection to time out and be torn down. Other dropped messages may also cause the peer to believe that the peer has stalled and tear down the connection. It seems difficult to uncover any actual issues with -dropmessagestest, and any coverage that could be generated would probably be easier to trigger with fuzz testing. ACKs for top commit: MarcoFalke: cr ACK 176325a5a47befe32d480b3dc206dd0e64e04b21 practicalswift: cr ACK 176325a5a47befe32d480b3dc206dd0e64e04b21 dhruv: cr ACK 176325a amitiuttarwar: ACK 176325a5a47befe32d480b3dc206dd0e64e04b21 Tree-SHA512: bd582e5e8c9eb272a5d8ec01ff07c36c0033fbb84c30d1c72c87a7a6c7290021dcaf7bf549179a8b95aeb4f7243158d5593bc7fcf1ec16213782e470fe36bb89
-rw-r--r--src/init.cpp1
-rw-r--r--src/net_processing.cpp5
2 files changed, 0 insertions, 6 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 1220f39b14..97a588c8df 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -508,7 +508,6 @@ void SetupServerArgs(NodeContext& node)
argsman.AddArg("-checkmempool=<n>", strprintf("Run checks every <n> transactions (default: %u, regtest: %u)", defaultChainParams->DefaultConsistencyChecks(), regtestChainParams->DefaultConsistencyChecks()), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-checkpoints", strprintf("Enable rejection of any forks from the known historical chain until block %s (default: %u)", defaultChainParams->Checkpoints().GetHeight(), DEFAULT_CHECKPOINTS_ENABLED), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-deprecatedrpc=<method>", "Allows deprecated RPC method(s) to be used", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
- argsman.AddArg("-dropmessagestest=<n>", "Randomly drop 1 of every <n> network messages", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-stopafterblockimport", strprintf("Stop running after importing blocks from disk (default: %u)", DEFAULT_STOPAFTERBLOCKIMPORT), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-stopatheight", strprintf("Stop running after reaching the given height in the main chain (default: %u)", DEFAULT_STOPATHEIGHT), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-limitancestorcount=<n>", strprintf("Do not accept transactions if number of in-mempool ancestors is <n> or more (default: %u)", DEFAULT_ANCESTOR_LIMIT), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 4b9688d517..0dfb8e1344 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -2272,11 +2272,6 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat
const std::atomic<bool>& interruptMsgProc)
{
LogPrint(BCLog::NET, "received: %s (%u bytes) peer=%d\n", SanitizeString(msg_type), vRecv.size(), pfrom.GetId());
- if (gArgs.IsArgSet("-dropmessagestest") && GetRand(gArgs.GetArg("-dropmessagestest", 0)) == 0)
- {
- LogPrintf("dropmessagestest DROPPING RECV MESSAGE\n");
- return;
- }
PeerRef peer = GetPeerRef(pfrom.GetId());
if (peer == nullptr) return;