From 6a6b31b74dfa859699f2ffc751e2df6a19dd1c2a Mon Sep 17 00:00:00 2001 From: Ilya Savinov Date: Thu, 14 Sep 2017 14:42:37 +0300 Subject: [PATCH] Dip0001-related adjustments (inc. constants) (#1621) * block size related constants adjusted; other minor fixes * revert constants related to storing blocks on disk * move AssertLockHeld to a separate PR --- src/net.cpp | 2 +- src/net.h | 4 ++-- src/validation.h | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 2f874d753..6eb6c8b8c 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2557,7 +2557,7 @@ void CConnman::RecordBytesSent(uint64_t bytes) void CConnman::SetMaxOutboundTarget(uint64_t limit) { LOCK(cs_totalBytesSent); - uint64_t recommendedMinimum = (nMaxOutboundTimeframe / 600) * MaxBlockSize(fDIP0001ActiveAtTip); + uint64_t recommendedMinimum = (nMaxOutboundTimeframe / 600) * MaxBlockSize(true); nMaxOutboundLimit = limit; if (limit > 0 && limit < recommendedMinimum) diff --git a/src/net.h b/src/net.h index 4c56aea6d..46789e04c 100644 --- a/src/net.h +++ b/src/net.h @@ -55,8 +55,8 @@ static const int FEELER_INTERVAL = 120; static const unsigned int MAX_INV_SZ = 50000; /** 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 2 MiB is currently acceptable). */ -static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH = 2 * 1024 * 1024; +/** Maximum length of incoming protocol messages (no message over 3 MiB is currently acceptable). */ +static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH = 3 * 1024 * 1024; /** Maximum length of strSubVer in `version` message */ static const unsigned int MAX_SUBVERSION_LENGTH = 256; /** Maximum number of outgoing nodes */ diff --git a/src/validation.h b/src/validation.h index 45968f67d..f26e124e0 100644 --- a/src/validation.h +++ b/src/validation.h @@ -186,15 +186,15 @@ static const unsigned int MIN_BLOCKS_TO_KEEP = 288; static const signed int DEFAULT_CHECKBLOCKS = MIN_BLOCKS_TO_KEEP; static const unsigned int DEFAULT_CHECKLEVEL = 3; -// Require that user allocate at least 550MB for block & undo files (blk???.dat and rev???.dat) -// At 1MB per block, 288 blocks = 288MB. -// Add 15% for Undo data = 331MB -// Add 20% for Orphan block rate = 397MB -// We want the low water mark after pruning to be at least 397 MB and since we prune in +// Require that user allocate at least 945MB for block & undo files (blk???.dat and rev???.dat) +// At 2MB per block, 288 blocks = 576MB. +// Add 15% for Undo data = 662MB +// Add 20% for Orphan block rate = 794MB +// We want the low water mark after pruning to be at least 794 MB and since we prune in // full block file chunks, we need the high water mark which triggers the prune to be -// one 128MB block file + added 15% undo data = 147MB greater for a total of 545MB -// Setting the target to > than 550MB will make it likely we can respect the target. -static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES = 550 * 1024 * 1024; +// one 128MB block file + added 15% undo data = 147MB greater for a total of 941MB +// Setting the target to > than 945MB will make it likely we can respect the target. +static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES = 945 * 1024 * 1024; /** * Process an incoming block. This only returns after the best known valid