diff --git a/doc/release-process.md b/doc/release-process.md index 83a69c69c8..0a4be77680 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -1,66 +1,65 @@ Bitcoin ABC Release Process =========================== ## Before Release 1. Check configuration - Check features planned for the release are implemented and documented (or more informally, that the Release Manager agrees it is feature complete) - Check that finished tasks / tickets are marked as resolved 2. Verify tests passed - any known issues or limitations should be documented in release notes - known bugs should have tickets - Verify IBD without checkpoints and without assumevalid. 3. Update the documents / code which needs to be updated every release - Check that doc/release-notes.md is complete, and fill in any missing items. - Update [bips.md](bips.md) to account for changes since the last release. - (major releases) Update [`BLOCK_CHAIN_SIZE`](/src/qt/intro.cpp) to the current size plus some overhead. - Update `src/chainparams.cpp` defaultAssumeValid and nMinimumChainWork with information from the getblockhash rpc. - The selected value must not be orphaned so it may be useful to set the value two blocks back from the tip. - Testnet should be set some tens of thousands back from the tip due to reorgs there. - This update should be reviewed with a reindex-chainstate with assumevalid=0 to catch any defect that causes rejection of blocks in the past history. - Regenerate manpages (run contrib/devtools/gen-manpages.sh). - Update seeds as per [contrib/seeds/README.md](contrib/seeds/README.md) 4. Add git tag for release ## Release 5. Create Gitian Builds (see doc/gitian-building.md), notify PPA buildmaster to start creating Ubuntu PPAs 6. Verify matching gitian builds, gather signatures 7. Upload gitian build to [bitcoinabc.org](https://download.bitcoinabc.org/) 8. Create a [GitHub release](https://github.com/Bitcoin-ABC/bitcoin-abc/releases). The Github release name should be the same as the tag (without the prepended 'v'), and the contents of the release notes should be copied from release-notes.md. ## After Release 9. Increment version number in: - doc/Doxyfile - doc/release-notes.md (and copy existing one to versioned doc/release-notes/*.md) - configure.ac - src/config/CMakeLists.txt - - src/test/net_tests.cpp - src/clientversion.h - contrib/gitian-descriptors/*.yml (before a new major release) 10. Update version number on www.bitcoinabc.org 11. Publish signed checksums (various places, e.g. blog, reddit/r/BitcoinABC) 12. Announce Release: - [Reddit](https://www.reddit.com/r/BitcoinABC/) - Twitter @Bitcoin_ABC - Public slack channels friendly to Bitcoin ABC announcements (eg. #abc-announce on BTCforks, #hardfork on BTCchat) diff --git a/src/test/net_tests.cpp b/src/test/net_tests.cpp index 3da606097c..7040224528 100644 --- a/src/test/net_tests.cpp +++ b/src/test/net_tests.cpp @@ -1,208 +1,214 @@ // Copyright (c) 2012-2016 The Bitcoin Core developers // Copyright (c) 2017-2018 The Bitcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "addrman.h" #include "chainparams.h" +#include "clientversion.h" #include "config.h" #include "hash.h" #include "net.h" #include "netbase.h" #include "serialize.h" #include "streams.h" #include "test/test_bitcoin.h" +#include #include #include class CAddrManSerializationMock : public CAddrMan { public: virtual void Serialize(CDataStream &s) const = 0; //! Ensure that bucket placement is always the same for testing purposes. void MakeDeterministic() { nKey.SetNull(); insecure_rand = FastRandomContext(true); } }; class CAddrManUncorrupted : public CAddrManSerializationMock { public: void Serialize(CDataStream &s) const override { CAddrMan::Serialize(s); } }; class CAddrManCorrupted : public CAddrManSerializationMock { public: void Serialize(CDataStream &s) const override { // Produces corrupt output that claims addrman has 20 addrs when it only // has one addr. uint8_t nVersion = 1; s << nVersion; s << uint8_t(32); s << nKey; s << 10; // nNew s << 10; // nTried int nUBuckets = ADDRMAN_NEW_BUCKET_COUNT ^ (1 << 30); s << nUBuckets; CService serv; Lookup("252.1.1.1", serv, 7777, false); CAddress addr = CAddress(serv, NODE_NONE); CNetAddr resolved; LookupHost("252.2.2.2", resolved, false); CAddrInfo info = CAddrInfo(addr, resolved); s << info; } }; CDataStream AddrmanToStream(CAddrManSerializationMock &_addrman) { CDataStream ssPeersIn(SER_DISK, CLIENT_VERSION); ssPeersIn << FLATDATA(Params().DiskMagic()); ssPeersIn << _addrman; std::string str = ssPeersIn.str(); std::vector vchData(str.begin(), str.end()); return CDataStream(vchData, SER_DISK, CLIENT_VERSION); } BOOST_FIXTURE_TEST_SUITE(net_tests, BasicTestingSetup) BOOST_AUTO_TEST_CASE(caddrdb_read) { CAddrManUncorrupted addrmanUncorrupted; addrmanUncorrupted.MakeDeterministic(); CService addr1, addr2, addr3; Lookup("250.7.1.1", addr1, 8333, false); Lookup("250.7.2.2", addr2, 9999, false); Lookup("250.7.3.3", addr3, 9999, false); // Add three addresses to new table. CService source; Lookup("252.5.1.1", source, 8333, false); addrmanUncorrupted.Add(CAddress(addr1, NODE_NONE), source); addrmanUncorrupted.Add(CAddress(addr2, NODE_NONE), source); addrmanUncorrupted.Add(CAddress(addr3, NODE_NONE), source); // Test that the de-serialization does not throw an exception. CDataStream ssPeers1 = AddrmanToStream(addrmanUncorrupted); bool exceptionThrown = false; CAddrMan addrman1; BOOST_CHECK(addrman1.size() == 0); try { uint8_t pchMsgTmp[4]; ssPeers1 >> FLATDATA(pchMsgTmp); ssPeers1 >> addrman1; } catch (const std::exception &e) { exceptionThrown = true; } BOOST_CHECK(addrman1.size() == 3); BOOST_CHECK(exceptionThrown == false); // Test that CAddrDB::Read creates an addrman with the correct number of // addrs. CDataStream ssPeers2 = AddrmanToStream(addrmanUncorrupted); CAddrMan addrman2; CAddrDB adb(Params()); BOOST_CHECK(addrman2.size() == 0); adb.Read(addrman2, ssPeers2); BOOST_CHECK(addrman2.size() == 3); } BOOST_AUTO_TEST_CASE(caddrdb_read_corrupted) { CAddrManCorrupted addrmanCorrupted; addrmanCorrupted.MakeDeterministic(); // Test that the de-serialization of corrupted addrman throws an exception. CDataStream ssPeers1 = AddrmanToStream(addrmanCorrupted); bool exceptionThrown = false; CAddrMan addrman1; BOOST_CHECK(addrman1.size() == 0); try { uint8_t pchMsgTmp[4]; ssPeers1 >> FLATDATA(pchMsgTmp); ssPeers1 >> addrman1; } catch (const std::exception &e) { exceptionThrown = true; } // Even through de-serialization failed addrman is not left in a clean // state. BOOST_CHECK(addrman1.size() == 1); BOOST_CHECK(exceptionThrown); // Test that CAddrDB::Read leaves addrman in a clean state if // de-serialization fails. CDataStream ssPeers2 = AddrmanToStream(addrmanCorrupted); CAddrMan addrman2; CAddrDB adb(Params()); BOOST_CHECK(addrman2.size() == 0); adb.Read(addrman2, ssPeers2); BOOST_CHECK(addrman2.size() == 0); } BOOST_AUTO_TEST_CASE(cnode_simple_test) { SOCKET hSocket = INVALID_SOCKET; NodeId id = 0; int height = 0; in_addr ipv4Addr; ipv4Addr.s_addr = 0xa0b0c001; CAddress addr = CAddress(CService(ipv4Addr, 7777), NODE_NETWORK); std::string pszDest = ""; bool fInboundIn = false; // Test that fFeeler is false by default. std::unique_ptr pnode1(new CNode(id++, NODE_NETWORK, height, hSocket, addr, 0, 0, CAddress(), pszDest, fInboundIn)); BOOST_CHECK(pnode1->fInbound == false); BOOST_CHECK(pnode1->fFeeler == false); fInboundIn = true; std::unique_ptr pnode2(new CNode(id++, NODE_NETWORK, height, hSocket, addr, 1, 1, CAddress(), pszDest, fInboundIn)); BOOST_CHECK(pnode2->fInbound == true); BOOST_CHECK(pnode2->fFeeler == false); } BOOST_AUTO_TEST_CASE(test_getSubVersionEB) { BOOST_CHECK_EQUAL(getSubVersionEB(13800000000), "13800.0"); BOOST_CHECK_EQUAL(getSubVersionEB(3800000000), "3800.0"); BOOST_CHECK_EQUAL(getSubVersionEB(14000000), "14.0"); BOOST_CHECK_EQUAL(getSubVersionEB(1540000), "1.5"); BOOST_CHECK_EQUAL(getSubVersionEB(1560000), "1.5"); BOOST_CHECK_EQUAL(getSubVersionEB(210000), "0.2"); BOOST_CHECK_EQUAL(getSubVersionEB(10000), "0.0"); BOOST_CHECK_EQUAL(getSubVersionEB(0), "0.0"); } BOOST_AUTO_TEST_CASE(test_userAgentLength) { GlobalConfig config; config.SetMaxBlockSize(8000000); std::string long_uacomment = "very very very very very very very very very " "very very very very very very very very very " "very very very very very very very very very " "very very very very very very very very very " "very very very very very very very very very " "very very very very very very very very very " "very very very very very very very very very " "very very very very very very long comment"; gArgs.ForceSetMultiArg("-uacomment", long_uacomment); - BOOST_CHECK_EQUAL(userAgent(config).size(), MAX_SUBVERSION_LENGTH); - BOOST_CHECK_EQUAL(userAgent(config), - "/Bitcoin ABC:0.18.6(EB8.0; very very very very very " + std::ostringstream versionMessage; + versionMessage << "/Bitcoin ABC:" << CLIENT_VERSION_MAJOR << "." + << CLIENT_VERSION_MINOR << "." << CLIENT_VERSION_REVISION + << "(EB8.0; very very very very very " "very very very very very very very very very very very " "very very very very very very very very very very very " "very very very very very very very very very very very " - "very very very very very very very ve)/"); + "very very very very very very very ve)/"; + + BOOST_CHECK_EQUAL(userAgent(config).size(), MAX_SUBVERSION_LENGTH); + BOOST_CHECK_EQUAL(userAgent(config), versionMessage.str()); } BOOST_AUTO_TEST_SUITE_END()