From f472126622c9995f75bf56f2108ae7b33bee1b74 Mon Sep 17 00:00:00 2001 From: Glenn Willen Date: Tue, 1 Mar 2022 13:54:15 -0800 Subject: [PATCH] Raise max P2P message size to account for larger elements dynafed header size --- src/net.h | 2 +- test/bitcoin_functional/functional/p2p_invalid_messages.py | 2 +- test/functional/p2p_invalid_messages.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/net.h b/src/net.h index 6cae35e8e0..7801bedf46 100644 --- a/src/net.h +++ b/src/net.h @@ -52,7 +52,7 @@ static const unsigned int MAX_LOCATOR_SZ = 101; /** The maximum number of new addresses to accumulate before announcing. */ static const unsigned int MAX_ADDR_TO_SEND = 1000; /** Maximum length of incoming protocol messages (no message over 4 MB is currently acceptable). */ -static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH = 4 * 1000 * 1000; +static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH = 16 * 1000 * 1000; /** Maximum length of strSubVer in `version` message */ static const unsigned int MAX_SUBVERSION_LENGTH = 256; /** Maximum number of automatic outgoing nodes */ diff --git a/test/bitcoin_functional/functional/p2p_invalid_messages.py b/test/bitcoin_functional/functional/p2p_invalid_messages.py index 700fdf6e04..d30900eba3 100755 --- a/test/bitcoin_functional/functional/p2p_invalid_messages.py +++ b/test/bitcoin_functional/functional/p2p_invalid_messages.py @@ -52,7 +52,7 @@ class InvalidMessagesTest(BitcoinTestFramework): node.add_p2p_connection(P2PDataStore()) conn2 = node.add_p2p_connection(P2PDataStore()) - msg_limit = 4 * 1000 * 1000 # 4MB, per MAX_PROTOCOL_MESSAGE_LENGTH + msg_limit = 16 * 1000 * 1000 # 16MB, per MAX_PROTOCOL_MESSAGE_LENGTH valid_data_limit = msg_limit - 5 # Account for the 4-byte length prefix # diff --git a/test/functional/p2p_invalid_messages.py b/test/functional/p2p_invalid_messages.py index 700fdf6e04..d30900eba3 100755 --- a/test/functional/p2p_invalid_messages.py +++ b/test/functional/p2p_invalid_messages.py @@ -52,7 +52,7 @@ class InvalidMessagesTest(BitcoinTestFramework): node.add_p2p_connection(P2PDataStore()) conn2 = node.add_p2p_connection(P2PDataStore()) - msg_limit = 4 * 1000 * 1000 # 4MB, per MAX_PROTOCOL_MESSAGE_LENGTH + msg_limit = 16 * 1000 * 1000 # 16MB, per MAX_PROTOCOL_MESSAGE_LENGTH valid_data_limit = msg_limit - 5 # Account for the 4-byte length prefix #