From 0f5c38f76f997e6e864bbd0c78a6382b96165c87 Mon Sep 17 00:00:00 2001 From: protonn Date: Sat, 24 Feb 2018 21:09:10 -0500 Subject: [PATCH 1/3] Speed up Initial Blockchain Download --- src/httpserver.cpp | 2 +- src/net.h | 4 ++-- src/net_processing.cpp | 2 +- src/validation.h | 12 ++++++------ 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/httpserver.cpp b/src/httpserver.cpp index e1763c6ad276c..b841223b938d6 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -36,7 +36,7 @@ #endif /** Maximum size of http request (request line + headers) */ -static const size_t MAX_HEADERS_SIZE = 8192; +static const size_t MAX_HEADERS_SIZE = 30720; /** HTTP request work item */ class HTTPWorkItem : public HTTPClosure diff --git a/src/net.h b/src/net.h index adbbe76e4dd8e..ebc1f0dcbd4f5 100644 --- a/src/net.h +++ b/src/net.h @@ -67,9 +67,9 @@ static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH = 32 * 1024 * 1024; /** Maximum length of strSubVer in `version` message */ static const unsigned int MAX_SUBVERSION_LENGTH = 256; /** Maximum number of automatic outgoing nodes */ -static const int MAX_OUTBOUND_CONNECTIONS = 64; +static const int MAX_OUTBOUND_CONNECTIONS = 32; /** Maximum number of addnode outgoing nodes */ -static const int MAX_ADDNODE_CONNECTIONS = 32; +static const int MAX_ADDNODE_CONNECTIONS = 16; /** -listen default */ static const bool DEFAULT_LISTEN = true; /** -upnp default */ diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 8d2611e723e5d..11f78e39209f3 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1593,7 +1593,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr // Send the rest of the chain if (pindex) pindex = chainActive.Next(pindex); - int nLimit = 500; + int nLimit = 2500; LogPrint("net", "getblocks %d to %s limit %d from peer=%d\n", (pindex ? pindex->nHeight : -1), hashStop.IsNull() ? "end" : hashStop.ToString(), nLimit, pfrom->id); for (; pindex; pindex = chainActive.Next(pindex)) { diff --git a/src/validation.h b/src/validation.h index d2fee8953e984..ba6270a6b88ec 100644 --- a/src/validation.h +++ b/src/validation.h @@ -81,22 +81,22 @@ static const int MAX_SCRIPTCHECK_THREADS = 16; /** -par default (number of script-checking threads, 0 = auto) */ static const int DEFAULT_SCRIPTCHECK_THREADS = 0; /** Number of blocks that can be requested at any given time from a single peer. */ -static const int MAX_BLOCKS_IN_TRANSIT_PER_PEER = 1024; +static const int MAX_BLOCKS_IN_TRANSIT_PER_PEER = 64; /** Timeout in seconds during which a peer must stall block download progress before being disconnected. */ -static const unsigned int BLOCK_STALLING_TIMEOUT = 4; +static const unsigned int BLOCK_STALLING_TIMEOUT = 2; /** Number of headers sent in one getheaders result. We rely on the assumption that if a peer sends * less than this number, we reached its tip. Changing this value is a protocol upgrade. */ -static const unsigned int MAX_HEADERS_RESULTS = 2000; +static const unsigned int MAX_HEADERS_RESULTS = 8000; /** Maximum size of a "headers" message. This is enforced starting with * SIZE_HEADERS_LIMIT_VERSION peers and prevents overloading if we have * very large headers (due to auxpow). */ -static const unsigned int MAX_HEADERS_SIZE = (6 << 20); // 6 MiB +static const unsigned int MAX_HEADERS_SIZE = (30 << 20); // 30 MiB this doesn't seem to actaully do anyting /** Size of a headers message that is the threshold for assuming that the * peer has more headers (even if we have less than MAX_HEADERS_RESULTS). * This is used starting with SIZE_HEADERS_LIMIT_VERSION peers. */ -static const unsigned int THRESHOLD_HEADERS_SIZE = (4 << 20); // 4 MiB +static const unsigned int THRESHOLD_HEADERS_SIZE = (6 << 20); // 6 MiB this doesn't seem to actaully do anyting /** Maximum depth of blocks we're willing to serve as compact blocks to peers * when requested. For older blocks, a regular BLOCK response will be sent. */ static const int MAX_CMPCTBLOCK_DEPTH = 10; @@ -106,7 +106,7 @@ static const int MAX_BLOCKTXN_DEPTH = 20; * Larger windows tolerate larger download speed differences between peer, but increase the potential * degree of disordering of blocks on disk (which make reindexing and in the future perhaps pruning * harder). We'll probably want to make this a per-peer adaptive value at some point. */ -static const unsigned int BLOCK_DOWNLOAD_WINDOW = 1536; +static const unsigned int BLOCK_DOWNLOAD_WINDOW = 2500; /** Time to wait (in seconds) between writing blocks/block index to disk. */ static const unsigned int DATABASE_WRITE_INTERVAL = 60 * 60; /** Time to wait (in seconds) between flushing chainstate to disk. */ From ca86400259aeb71ddb37fcf0361b2b45c21b8395 Mon Sep 17 00:00:00 2001 From: protonn Date: Sat, 24 Feb 2018 21:09:30 -0500 Subject: [PATCH 2/3] update version --- configure.ac | 2 +- src/clientversion.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 14d307516c1a7..075bb1bcadeac 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 4) define(_CLIENT_VERSION_MINOR, 14) -define(_CLIENT_VERSION_REVISION, 3) +define(_CLIENT_VERSION_REVISION, 4) define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_IS_RELEASE, true) diff --git a/src/clientversion.h b/src/clientversion.h index 6d436c0ac63a9..40ba9debc4bbc 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -16,7 +16,7 @@ //! These need to be macros, as clientversion.cpp's and bitcoin*-res.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 4 #define CLIENT_VERSION_MINOR 14 -#define CLIENT_VERSION_REVISION 3 +#define CLIENT_VERSION_REVISION 4 #define CLIENT_VERSION_BUILD 0 //! Set to true for release, false for prerelease or test build From 2d280a1fa22219747d4b03dabfa5037e4d886831 Mon Sep 17 00:00:00 2001 From: protonn Date: Sat, 24 Feb 2018 21:22:50 -0500 Subject: [PATCH 3/3] update seed nodes --- contrib/seeds/nodes_main.txt | 16 ++++++++++++++-- contrib/seeds/nodes_test.txt | 6 ++++-- src/chainparamsseeds.h | 35 ++++++++++++++++++++++++++++++++--- 3 files changed, 50 insertions(+), 7 deletions(-) diff --git a/contrib/seeds/nodes_main.txt b/contrib/seeds/nodes_main.txt index 78ccfa8e99d34..4b50777937a52 100644 --- a/contrib/seeds/nodes_main.txt +++ b/contrib/seeds/nodes_main.txt @@ -26,5 +26,17 @@ 167.88.15.89:13580 217.175.119.125:13580 94.130.16.85:13580 -45.32.200.142:13580 -45.76.112.155:13580 \ No newline at end of file +45.76.112.155:13580 +144.202.80.45:13580 +45.76.240.8:13580 +45.77.210.177:13580 +118.189.176.141:13580 +157.161.128.52:13580 +196.52.39.14:13580 +5.19.171.173:13580 +52.77.46.252:13580 +68.55.199.104:13580 +78.46.46.230:13580 +91.247.235.29:13580 +92.171.157.139:13580 +98.100.212.168:13580 \ No newline at end of file diff --git a/contrib/seeds/nodes_test.txt b/contrib/seeds/nodes_test.txt index 27fd5499a1a54..032f89e9dca2e 100644 --- a/contrib/seeds/nodes_test.txt +++ b/contrib/seeds/nodes_test.txt @@ -1,2 +1,4 @@ -75.19.27.27:20888 -75.19.27.28:20888 +45.76.112.155:13555 +144.202.80.45:13555 +45.76.240.8:13555 +45.77.210.177:13555 diff --git a/src/chainparamsseeds.h b/src/chainparamsseeds.h index 8d05efdbdba8f..0513462f847e9 100644 --- a/src/chainparamsseeds.h +++ b/src/chainparamsseeds.h @@ -9,24 +9,53 @@ */ static SeedSpec6 pnSeed6_main[] = { {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x88,0xf3,0x2d,0x8c}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x94,0xfb,0xbc,0x14}, 13580}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9d,0xa1,0x80,0x39}, 13580}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa4,0x84,0xa4,0x31}, 13580}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0xd4,0xca,0x21}, 13580}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0xd4,0xe1,0xb0}, 13580}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0x09,0x19,0x4f}, 13580}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0x28,0x4e,0x1f}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x5b,0xc8,0x09}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0x9f,0x3c,0xb3}, 13580}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0x20,0x06,0x84}, 13580}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x4c,0x70,0x9b}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x21,0x77,0x4e}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x21,0x16,0x09}, 13580}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x4f,0x48,0x1f}, 13580}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0xbd,0xb7,0x4a}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x33,0xdf,0x28,0x46}, 13580}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x33,0xfe,0x2d,0x75}, 13580}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0xba,0xdd,0x9a}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4a,0xd3,0x05,0x96}, 13580}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4d,0xf9,0xd5,0x19}, 13580}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x50,0xdc,0x98,0xd1}, 13580}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xde,0x24,0x19}, 13580} + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xde,0x24,0x19}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0xd9,0x43,0x44}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0xd9,0x49,0x70}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0x4c,0x47,0x8d}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa7,0x58,0x0f,0x59}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd9,0xaf,0x77,0x7d}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0x82,0x10,0x55}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x4c,0x70,0x9b}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0xca,0x50,0x2d}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x4c,0xf0,0x08}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x4d,0xd2,0xb1}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x76,0xbd,0xb0,0x8d}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9d,0xa1,0x80,0x34}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc4,0x34,0x27,0x0e}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x13,0xab,0xad}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x34,0x4d,0x2e,0xfc}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x44,0x37,0xc7,0x68}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x2e,0x2e,0xe6}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xf7,0xeb,0x1d}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5c,0xab,0x9d,0x8b}, 13580}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x62,0x64,0xd4,0xa8}, 13580} }; static SeedSpec6 pnSeed6_test[] = { - {{},} + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x4c,0x70,0x9b}, 13555}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0xca,0x50,0x2d}, 13555}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x4c,0xf0,0x08}, 13555}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x4d,0xd2,0xb1}, 13555} }; #endif // BITCOIN_CHAINPARAMSSEEDS_H