From 8340829bc867eaa4e0605d1c85313def864241b7 Mon Sep 17 00:00:00 2001 From: David Burkett Date: Wed, 6 Apr 2022 12:45:15 -0400 Subject: [PATCH] * Remove temporary g_desire_mweb_flag hack and always just require NODE_MWEB. There are enough MWEB-capable public nodes now, so this is no longer necessary. * Update chainparamsseeds.h to include some additional MWEB-capable public nodes * Only set NODE_MWEB service flag when NODE_WITNESS is set --- contrib/seeds/nodes_main.txt | 5 +++++ contrib/seeds/nodes_test.txt | 3 +++ src/chainparamsseeds.h | 10 +++++++++- src/init.cpp | 5 +++-- src/net_processing.cpp | 4 ---- src/protocol.cpp | 9 ++------- src/protocol.h | 3 --- 7 files changed, 22 insertions(+), 17 deletions(-) diff --git a/contrib/seeds/nodes_main.txt b/contrib/seeds/nodes_main.txt index 47f66420d..798ee3dd6 100644 --- a/contrib/seeds/nodes_main.txt +++ b/contrib/seeds/nodes_main.txt @@ -5,6 +5,7 @@ 5.79.123.3:9333 5.100.250.140:9333 5.149.250.76:9333 +8.214.154.25:9333 14.203.57.50:9333 23.112.250.126:9333 24.196.138.163:9333 @@ -15,6 +16,7 @@ 37.29.116.122:10333 37.221.209.222:9333 38.39.205.6:9333 +39.104.163.200:9333 40.71.41.208:9333 45.11.183.189:9333 45.89.16.46:9333 @@ -125,6 +127,7 @@ 96.249.252.98:9333 99.245.46.72:9333 103.231.191.7:9333 +104.3.38.247:9333 104.175.176.153:9333 109.236.88.130:9333 109.236.88.245:9333 @@ -144,6 +147,7 @@ 136.244.118.237:9333 143.89.60.134:9333 143.178.35.162:9333 +143.178.57.3:9333 149.210.226.74:10333 158.181.226.33:9333 159.100.240.189:9333 @@ -158,6 +162,7 @@ 173.94.183.76:9333 173.176.184.54:9333 173.255.209.39:9333 +174.62.70.234:9333 175.118.126.20:19334 176.99.7.253:9333 176.126.167.10:9333 diff --git a/contrib/seeds/nodes_test.txt b/contrib/seeds/nodes_test.txt index 69bba8599..e8d57265d 100644 --- a/contrib/seeds/nodes_test.txt +++ b/contrib/seeds/nodes_test.txt @@ -4,12 +4,14 @@ 39.100.99.116:30008 51.15.115.97:19335 52.13.42.125:19335 +54.255.128.110:19333 62.171.161.203:19333 64.227.19.92:19335 78.28.225.160:19335 79.98.159.7:19333 84.38.3.199:19335 89.39.104.167:19335 +89.160.159.45:19335 94.79.55.28:19335 95.216.76.224:19335 100.25.120.154:19335 @@ -19,6 +21,7 @@ 147.135.11.124:49333 173.209.40.61:19335 173.209.42.7:19335 +178.62.46.195:19333 185.180.221.201:19335 198.58.102.18:19335 202.238.193.15:19335 diff --git a/src/chainparamsseeds.h b/src/chainparamsseeds.h index 888f2edd4..f999721f5 100644 --- a/src/chainparamsseeds.h +++ b/src/chainparamsseeds.h @@ -15,6 +15,7 @@ static SeedSpec6 pnSeed6_main[] = { {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x4f,0x7b,0x03}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x64,0xfa,0x8c}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x95,0xfa,0x4c}, 9333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x08,0xd6,0x9a,0x19}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x0e,0xcb,0x39,0x32}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x17,0x70,0xfa,0x7e}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0xc4,0x8a,0xa3}, 9333}, @@ -25,6 +26,7 @@ static SeedSpec6 pnSeed6_main[] = { {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0x1d,0x74,0x7a}, 10333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0xdd,0xd1,0xde}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x26,0x27,0xcd,0x06}, 9333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x27,0x68,0xa3,0xc8}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x28,0x47,0x29,0xd0}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x0b,0xb7,0xbd}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x59,0x10,0x2e}, 9333}, @@ -135,6 +137,7 @@ static SeedSpec6 pnSeed6_main[] = { {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x60,0xf9,0xfc,0x62}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x63,0xf5,0x2e,0x48}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0xe7,0xbf,0x07}, 9333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0x03,0x26,0xf7}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0xaf,0xb0,0x99}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0xec,0x58,0x82}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0xec,0x58,0xf5}, 9333}, @@ -154,6 +157,7 @@ static SeedSpec6 pnSeed6_main[] = { {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x88,0xf4,0x76,0xed}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8f,0x59,0x3c,0x86}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8f,0xb2,0x23,0xa2}, 9333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8f,0xb2,0x39,0x03}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x95,0xd2,0xe2,0x4a}, 10333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9e,0xb5,0xe2,0x21}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9f,0x64,0xf0,0xbd}, 9333}, @@ -168,6 +172,7 @@ static SeedSpec6 pnSeed6_main[] = { {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0x5e,0xb7,0x4c}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0xb0,0xb8,0x36}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0xff,0xd1,0x27}, 9333}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xae,0x3e,0x46,0xea}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xaf,0x76,0x7e,0x14}, 19334}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0x63,0x07,0xfd}, 9333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb0,0x7e,0xa7,0x0a}, 9333}, @@ -249,12 +254,14 @@ static SeedSpec6 pnSeed6_test[] = { {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x27,0x64,0x63,0x74}, 30008}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x33,0x0f,0x73,0x61}, 19335}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x34,0x0d,0x2a,0x7d}, 19335}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0xff,0x80,0x6e}, 19333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0xab,0xa1,0xcb}, 19333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x40,0xe3,0x13,0x5c}, 19335}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x1c,0xe1,0xa0}, 19335}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4f,0x62,0x9f,0x07}, 19333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x54,0x26,0x03,0xc7}, 19335}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0x27,0x68,0xa7}, 19335}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0xa0,0x9f,0x2d}, 19335}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0x4f,0x37,0x1c}, 19335}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xd8,0x4c,0xe0}, 19335}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x64,0x19,0x78,0x9a}, 19335}, @@ -264,10 +271,11 @@ static SeedSpec6 pnSeed6_test[] = { {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x93,0x87,0x0b,0x7c}, 49333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0xd1,0x28,0x3d}, 19335}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0xd1,0x2a,0x07}, 19335}, + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0x3e,0x2e,0xc3}, 19333}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0xb4,0xdd,0xc9}, 19335}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x3a,0x66,0x12}, 19335}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xca,0xee,0xc1,0x0f}, 19335}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xcb,0xd8,0x00,0x69}, 19335}, {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0x53,0xae,0xff}, 19335} }; -#endif // BITCOIN_CHAINPARAMSSEEDS_H +#endif // BITCOIN_CHAINPARAMSSEEDS_H \ No newline at end of file diff --git a/src/init.cpp b/src/init.cpp index 6674f20ea..10d119e90 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1850,9 +1850,10 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA // Advertise witness capabilities. // The option to not set NODE_WITNESS is only used in the tests and should be removed. nLocalServices = ServiceFlags(nLocalServices | NODE_WITNESS); - } - nLocalServices = ServiceFlags(nLocalServices | NODE_MWEB); + // NODE_MWEB requires NODE_WITNESS, so we shouldn't signal for NODE_MWEB without NODE_WITNESS + nLocalServices = ServiceFlags(nLocalServices | NODE_MWEB); + } // ********************************************************* Step 11: import blocks diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 3e11287df..1f307f39c 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1360,10 +1360,6 @@ void PeerManager::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockInde const int nNewHeight = pindexNew->nHeight; m_connman.SetBestHeight(nNewHeight); - if (!GetDesireMWEBFlag() && IsMWEBEnabled(pindexNew, m_chainparams.GetConsensus())) { - SetDesireMWEBFlag(true); - } - SetServiceFlagsIBDCache(!fInitialDownload); if (!fInitialDownload) { // Find the hashes of all blocks that weren't previously in the best chain. diff --git a/src/protocol.cpp b/src/protocol.cpp index 722c84a5b..44da30ea2 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -10,7 +10,6 @@ #include static std::atomic g_initial_block_download_completed(false); -static std::atomic g_desire_mweb_flag(false); namespace NetMsgType { const char *VERSION="version"; @@ -138,20 +137,16 @@ bool CMessageHeader::IsCommandValid() const ServiceFlags GetDesirableServiceFlags(ServiceFlags services) { - ServiceFlags mweb_flags = g_desire_mweb_flag ? NODE_MWEB : NODE_NONE; if ((services & NODE_NETWORK_LIMITED) && g_initial_block_download_completed) { - return ServiceFlags(NODE_NETWORK_LIMITED | NODE_WITNESS | mweb_flags); + return ServiceFlags(NODE_NETWORK_LIMITED | NODE_WITNESS | NODE_MWEB); } - return ServiceFlags(NODE_NETWORK | NODE_WITNESS | mweb_flags); + return ServiceFlags(NODE_NETWORK | NODE_WITNESS | NODE_MWEB); } void SetServiceFlagsIBDCache(bool state) { g_initial_block_download_completed = state; } -bool GetDesireMWEBFlag() { return g_desire_mweb_flag; } -void SetDesireMWEBFlag(const bool val) { g_desire_mweb_flag = val; } - CInv::CInv() { type = 0; diff --git a/src/protocol.h b/src/protocol.h index a377c72cc..7621ea699 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -340,9 +340,6 @@ ServiceFlags GetDesirableServiceFlags(ServiceFlags services); /** Set the current IBD status in order to figure out the desirable service flags */ void SetServiceFlagsIBDCache(bool status); -bool GetDesireMWEBFlag(); -void SetDesireMWEBFlag(const bool val); - /** * A shortcut for (services & GetDesirableServiceFlags(services)) * == GetDesirableServiceFlags(services), ie determines whether the given