Merge #6313: backport: bump boost min

c0154c0d8c partial merge bitcoin/bitcoin#27783: Add public Boost headers explicitly (fanquake)
49fcd4ab64 Merge bitcoin/bitcoin#29066: Bump minimum required Boost version due to migration to C++20 (fanquake)
355a69c47d Merge bitcoin/bitcoin#24558: build: explicitly disable Boost multi_index serialization (MarcoFalke)

Pull request description:

  ## Issue being fixed or feature implemented
  See commit

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [ ] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK c0154c0d8c
  knst:
    utACK c0154c0d8c

Tree-SHA512: d11045903e1b665b8bbb21326ce3f9b1ee2c83b881e48a08482f1c5103c7b9909f1defac27b222fa28ee6c1ae52c98c924850eb0a38993e53d6008c81791181d
This commit is contained in:
pasta 2024-10-08 09:21:23 -05:00
commit 0c39d14f6c
No known key found for this signature in database
GPG Key ID: E2F3D7916E722D38
11 changed files with 102 additions and 83 deletions

View File

@ -1461,11 +1461,14 @@ fi
if test x$use_boost = xyes; then if test x$use_boost = xyes; then
dnl Check for Boost headers dnl Check for Boost headers
AX_BOOST_BASE([1.64.0],[],[AC_MSG_ERROR([Boost is not available!])]) AX_BOOST_BASE([1.73.0],[],[AC_MSG_ERROR([Boost is not available!])])
if test x$want_boost = xno; then if test x$want_boost = xno; then
AC_MSG_ERROR([[only libdashconsensus can be built without boost]]) AC_MSG_ERROR([[only libdashconsensus can be built without boost]])
fi fi
dnl we don't use multi_index serialization
BOOST_CPPFLAGS="$BOOST_CPPFLAGS -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION"
dnl Prevent use of std::unary_function, which was removed in C++17, dnl Prevent use of std::unary_function, which was removed in C++17,
dnl and will generate warnings with newer compilers for Boost dnl and will generate warnings with newer compilers for Boost
dnl older than 1.80. dnl older than 1.80.

View File

@ -6,7 +6,7 @@ These are the dependencies currently used by Dash Core. You can find instruction
| Dependency | Version used | Minimum required | CVEs | Shared | [Bundled Qt library](https://doc.qt.io/qt-5/configure-options.html#third-party-libraries) | | Dependency | Version used | Minimum required | CVEs | Shared | [Bundled Qt library](https://doc.qt.io/qt-5/configure-options.html#third-party-libraries) |
| --- | --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- | --- |
| Berkeley DB | [4.8.30](https://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index.html) | 4.8.x | No | | | | Berkeley DB | [4.8.30](https://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index.html) | 4.8.x | No | | |
| Boost | [1.81.0](https://www.boost.org/users/download/) | [1.64.0](https://github.com/bitcoin/bitcoin/pull/22320) | No | | | | Boost | [1.81.0](https://www.boost.org/users/download/) | [1.73.0](https://github.com/bitcoin/bitcoin/pull/29066) | No | | |
| Clang<sup>[ \* ](#note1)</sup> | | [5.0+](https://releases.llvm.org/download.html) (C++17 support) | | | | | Clang<sup>[ \* ](#note1)</sup> | | [5.0+](https://releases.llvm.org/download.html) (C++17 support) | | | |
| fontconfig | [2.12.1](https://www.freedesktop.org/software/fontconfig/release/) | | No | Yes | | | fontconfig | [2.12.1](https://www.freedesktop.org/software/fontconfig/release/) | | No | Yes | |
| FreeType | [2.11.0](https://download.savannah.gnu.org/releases/freetype) | | No | | [Yes](https://github.com/dashpay/dash/blob/develop/depends/packages/qt.mk) (Android only) | | FreeType | [2.11.0](https://download.savannah.gnu.org/releases/freetype) | | No | | [Yes](https://github.com/dashpay/dash/blob/develop/depends/packages/qt.mk) (Android only) |

View File

@ -13,8 +13,11 @@
#include <optional> #include <optional>
#include <stdint.h> #include <stdint.h>
#include <boost/multi_index_container.hpp> #include <boost/multi_index/identity.hpp>
#include <boost/multi_index/indexed_by.hpp>
#include <boost/multi_index/ordered_index.hpp> #include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/tag.hpp>
#include <boost/multi_index_container.hpp>
class BlockManager; class BlockManager;
class CBlockIndex; class CBlockIndex;

View File

@ -71,7 +71,7 @@ static std::vector<COutPoint> SelectUTXOs(const CChain& active_chain, SimpleUTXO
utoxs.erase(it); utoxs.erase(it);
break; break;
} }
BOOST_ASSERT(found); BOOST_REQUIRE(found);
if (selectedAmount >= amount) { if (selectedAmount >= amount) {
changeRet = selectedAmount - amount; changeRet = selectedAmount - amount;
break; break;
@ -102,8 +102,8 @@ static void SignTransaction(const CTxMemPool& mempool, CMutableTransaction& tx,
for (auto [i, input] : enumerate(tx.vin)) { for (auto [i, input] : enumerate(tx.vin)) {
uint256 hashBlock; uint256 hashBlock;
CTransactionRef txFrom = GetTransaction(/* block_index */ nullptr, &mempool, input.prevout.hash, Params().GetConsensus(), hashBlock); CTransactionRef txFrom = GetTransaction(/* block_index */ nullptr, &mempool, input.prevout.hash, Params().GetConsensus(), hashBlock);
BOOST_ASSERT(txFrom); BOOST_REQUIRE(txFrom);
BOOST_ASSERT(SignSignature(tempKeystore, *txFrom, tx, i, SIGHASH_ALL)); BOOST_REQUIRE(SignSignature(tempKeystore, *txFrom, tx, i, SIGHASH_ALL));
} }
} }
@ -148,7 +148,8 @@ BOOST_FIXTURE_TEST_CASE(block_reward_reallocation, TestChainBRRBeforeActivationS
CScript coinbasePubKey = CScript() << ToByteVector(coinbaseKey.GetPubKey()) << OP_CHECKSIG; CScript coinbasePubKey = CScript() << ToByteVector(coinbaseKey.GetPubKey()) << OP_CHECKSIG;
BOOST_ASSERT(DeploymentDIP0003Enforced(WITH_LOCK(cs_main, return m_node.chainman->ActiveChain().Height()), consensus_params)); BOOST_REQUIRE(DeploymentDIP0003Enforced(WITH_LOCK(cs_main, return m_node.chainman->ActiveChain().Height()),
consensus_params));
// Register one MN // Register one MN
CKey ownerKey; CKey ownerKey;
@ -163,7 +164,7 @@ BOOST_FIXTURE_TEST_CASE(block_reward_reallocation, TestChainBRRBeforeActivationS
const CBlockIndex* const tip{m_node.chainman->ActiveChain().Tip()}; const CBlockIndex* const tip{m_node.chainman->ActiveChain().Tip()};
dmnman.UpdatedBlockTip(tip); dmnman.UpdatedBlockTip(tip);
BOOST_ASSERT(dmnman.GetListAtChainTip().HasMN(tx.GetHash())); BOOST_REQUIRE(dmnman.GetListAtChainTip().HasMN(tx.GetHash()));
BOOST_CHECK_EQUAL(tip->nHeight, 498); BOOST_CHECK_EQUAL(tip->nHeight, 498);
BOOST_CHECK(tip->nHeight < Params().GetConsensus().BRRHeight); BOOST_CHECK(tip->nHeight < Params().GetConsensus().BRRHeight);
@ -176,7 +177,7 @@ BOOST_FIXTURE_TEST_CASE(block_reward_reallocation, TestChainBRRBeforeActivationS
const CBlockIndex* const tip{m_node.chainman->ActiveChain().Tip()}; const CBlockIndex* const tip{m_node.chainman->ActiveChain().Tip()};
BOOST_CHECK_EQUAL(tip->nHeight, 499); BOOST_CHECK_EQUAL(tip->nHeight, 499);
dmnman.UpdatedBlockTip(tip); dmnman.UpdatedBlockTip(tip);
BOOST_ASSERT(dmnman.GetListAtChainTip().HasMN(tx.GetHash())); BOOST_REQUIRE(dmnman.GetListAtChainTip().HasMN(tx.GetHash()));
BOOST_CHECK(tip->nHeight < Params().GetConsensus().BRRHeight); BOOST_CHECK(tip->nHeight < Params().GetConsensus().BRRHeight);
// Creating blocks by different ways // Creating blocks by different ways
const auto pblocktemplate = BlockAssembler(m_node.chainman->ActiveChainstate(), m_node, *m_node.mempool, Params()).CreateNewBlock(coinbasePubKey); const auto pblocktemplate = BlockAssembler(m_node.chainman->ActiveChainstate(), m_node, *m_node.mempool, Params()).CreateNewBlock(coinbasePubKey);
@ -195,7 +196,7 @@ BOOST_FIXTURE_TEST_CASE(block_reward_reallocation, TestChainBRRBeforeActivationS
const CBlockIndex* const tip{m_node.chainman->ActiveChain().Tip()}; const CBlockIndex* const tip{m_node.chainman->ActiveChain().Tip()};
BOOST_CHECK_EQUAL(tip->nHeight, Params().GetConsensus().BRRHeight - 1); BOOST_CHECK_EQUAL(tip->nHeight, Params().GetConsensus().BRRHeight - 1);
dmnman.UpdatedBlockTip(tip); dmnman.UpdatedBlockTip(tip);
BOOST_ASSERT(dmnman.GetListAtChainTip().HasMN(tx.GetHash())); BOOST_REQUIRE(dmnman.GetListAtChainTip().HasMN(tx.GetHash()));
} }
{ {
@ -206,7 +207,7 @@ BOOST_FIXTURE_TEST_CASE(block_reward_reallocation, TestChainBRRBeforeActivationS
const CBlockIndex* const tip{m_node.chainman->ActiveChain().Tip()}; const CBlockIndex* const tip{m_node.chainman->ActiveChain().Tip()};
const bool isV20Active{DeploymentActiveAfter(tip, consensus_params, Consensus::DEPLOYMENT_V20)}; const bool isV20Active{DeploymentActiveAfter(tip, consensus_params, Consensus::DEPLOYMENT_V20)};
dmnman.UpdatedBlockTip(tip); dmnman.UpdatedBlockTip(tip);
BOOST_ASSERT(dmnman.GetListAtChainTip().HasMN(tx.GetHash())); BOOST_REQUIRE(dmnman.GetListAtChainTip().HasMN(tx.GetHash()));
const CAmount block_subsidy = GetBlockSubsidyInner(tip->nBits, tip->nHeight, consensus_params, isV20Active); const CAmount block_subsidy = GetBlockSubsidyInner(tip->nBits, tip->nHeight, consensus_params, isV20Active);
const CAmount masternode_payment = GetMasternodePayment(tip->nHeight, block_subsidy, isV20Active); const CAmount masternode_payment = GetMasternodePayment(tip->nHeight, block_subsidy, isV20Active);
const auto pblocktemplate = BlockAssembler(m_node.chainman->ActiveChainstate(), m_node, *m_node.mempool, Params()).CreateNewBlock(coinbasePubKey); const auto pblocktemplate = BlockAssembler(m_node.chainman->ActiveChainstate(), m_node, *m_node.mempool, Params()).CreateNewBlock(coinbasePubKey);

View File

@ -58,7 +58,7 @@ static std::vector<COutPoint> SelectUTXOs(const CChain& active_chain, SimpleUTXO
utoxs.erase(it); utoxs.erase(it);
break; break;
} }
BOOST_ASSERT(found); BOOST_REQUIRE(found);
if (selectedAmount >= amount) { if (selectedAmount >= amount) {
changeRet = selectedAmount - amount; changeRet = selectedAmount - amount;
break; break;
@ -89,8 +89,8 @@ static void SignTransaction(const CTxMemPool& mempool, CMutableTransaction& tx,
for (size_t i = 0; i < tx.vin.size(); i++) { for (size_t i = 0; i < tx.vin.size(); i++) {
uint256 hashBlock; uint256 hashBlock;
CTransactionRef txFrom = GetTransaction(/* block_index */ nullptr, &mempool, tx.vin[i].prevout.hash, Params().GetConsensus(), hashBlock); CTransactionRef txFrom = GetTransaction(/* block_index */ nullptr, &mempool, tx.vin[i].prevout.hash, Params().GetConsensus(), hashBlock);
BOOST_ASSERT(txFrom); BOOST_REQUIRE(txFrom);
BOOST_ASSERT(SignSignature(tempKeystore, *txFrom, tx, i, SIGHASH_ALL)); BOOST_REQUIRE(SignSignature(tempKeystore, *txFrom, tx, i, SIGHASH_ALL));
} }
} }
@ -182,7 +182,7 @@ template<typename ProTx>
static CMutableTransaction MalleateProTxPayout(const CMutableTransaction& tx) static CMutableTransaction MalleateProTxPayout(const CMutableTransaction& tx)
{ {
auto opt_protx = GetTxPayload<ProTx>(tx); auto opt_protx = GetTxPayload<ProTx>(tx);
BOOST_ASSERT(opt_protx.has_value()); BOOST_REQUIRE(opt_protx.has_value());
auto& protx = *opt_protx; auto& protx = *opt_protx;
CKey key; CKey key;
@ -226,7 +226,7 @@ static bool CheckTransactionSignature(const CTxMemPool& mempool, const CMutableT
const auto& txin = tx.vin[i]; const auto& txin = tx.vin[i];
uint256 hashBlock; uint256 hashBlock;
CTransactionRef txFrom = GetTransaction(/* block_index */ nullptr, &mempool, txin.prevout.hash, Params().GetConsensus(), hashBlock); CTransactionRef txFrom = GetTransaction(/* block_index */ nullptr, &mempool, txin.prevout.hash, Params().GetConsensus(), hashBlock);
BOOST_ASSERT(txFrom); BOOST_REQUIRE(txFrom);
CAmount amount = txFrom->vout[txin.prevout.n].nValue; CAmount amount = txFrom->vout[txin.prevout.n].nValue;
if (!VerifyScript(txin.scriptSig, txFrom->vout[txin.prevout.n].scriptPubKey, STANDARD_SCRIPT_VERIFY_FLAGS, MutableTransactionSignatureChecker(&tx, i, amount))) { if (!VerifyScript(txin.scriptSig, txFrom->vout[txin.prevout.n].scriptPubKey, STANDARD_SCRIPT_VERIFY_FLAGS, MutableTransactionSignatureChecker(&tx, i, amount))) {
@ -254,19 +254,19 @@ void FuncDIP3Activation(TestChainSetup& setup)
auto block = std::make_shared<CBlock>(setup.CreateBlock(txns, setup.coinbaseKey, chainman.ActiveChainstate())); auto block = std::make_shared<CBlock>(setup.CreateBlock(txns, setup.coinbaseKey, chainman.ActiveChainstate()));
chainman.ProcessNewBlock(Params(), block, true, nullptr); chainman.ProcessNewBlock(Params(), block, true, nullptr);
BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight); BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight);
BOOST_ASSERT(block->GetHash() != chainman.ActiveChain().Tip()->GetBlockHash()); BOOST_REQUIRE(block->GetHash() != chainman.ActiveChain().Tip()->GetBlockHash());
BOOST_ASSERT(!dmnman.GetListAtChainTip().HasMN(tx.GetHash())); BOOST_REQUIRE(!dmnman.GetListAtChainTip().HasMN(tx.GetHash()));
// This block should activate DIP3 // This block should activate DIP3
setup.CreateAndProcessBlock({}, setup.coinbaseKey); setup.CreateAndProcessBlock({}, setup.coinbaseKey);
BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight + 1); BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight + 1);
// Mining a block with a DIP3 transaction should succeed now // Mining a block with a DIP3 transaction should succeed now
block = std::make_shared<CBlock>(setup.CreateBlock(txns, setup.coinbaseKey, chainman.ActiveChainstate())); block = std::make_shared<CBlock>(setup.CreateBlock(txns, setup.coinbaseKey, chainman.ActiveChainstate()));
BOOST_ASSERT(chainman.ProcessNewBlock(Params(), block, true, nullptr)); BOOST_REQUIRE(chainman.ProcessNewBlock(Params(), block, true, nullptr));
dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip()); dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip());
BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight + 2); BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight + 2);
BOOST_CHECK_EQUAL(block->GetHash(), chainman.ActiveChain().Tip()->GetBlockHash()); BOOST_CHECK_EQUAL(block->GetHash(), chainman.ActiveChain().Tip()->GetBlockHash());
BOOST_ASSERT(dmnman.GetListAtChainTip().HasMN(tx.GetHash())); BOOST_REQUIRE(dmnman.GetListAtChainTip().HasMN(tx.GetHash()));
}; };
void FuncV19Activation(TestChainSetup& setup) void FuncV19Activation(TestChainSetup& setup)
@ -274,7 +274,7 @@ void FuncV19Activation(TestChainSetup& setup)
auto& chainman = *Assert(setup.m_node.chainman.get()); auto& chainman = *Assert(setup.m_node.chainman.get());
auto& dmnman = *Assert(setup.m_node.dmnman); auto& dmnman = *Assert(setup.m_node.dmnman);
BOOST_ASSERT(!DeploymentActiveAfter(chainman.ActiveChain().Tip(), Params().GetConsensus(), Consensus::DEPLOYMENT_V19)); BOOST_REQUIRE(!DeploymentActiveAfter(chainman.ActiveChain().Tip(), Params().GetConsensus(), Consensus::DEPLOYMENT_V19));
// create // create
auto utxos = BuildSimpleUtxoMap(setup.m_coinbase_txns); auto utxos = BuildSimpleUtxoMap(setup.m_coinbase_txns);
@ -289,14 +289,14 @@ void FuncV19Activation(TestChainSetup& setup)
int nHeight = chainman.ActiveChain().Height(); int nHeight = chainman.ActiveChain().Height();
auto block = std::make_shared<CBlock>(setup.CreateBlock({tx_reg}, setup.coinbaseKey, chainman.ActiveChainstate())); auto block = std::make_shared<CBlock>(setup.CreateBlock({tx_reg}, setup.coinbaseKey, chainman.ActiveChainstate()));
BOOST_ASSERT(chainman.ProcessNewBlock(Params(), block, true, nullptr)); BOOST_REQUIRE(chainman.ProcessNewBlock(Params(), block, true, nullptr));
BOOST_ASSERT(!DeploymentActiveAfter(chainman.ActiveChain().Tip(), Params().GetConsensus(), Consensus::DEPLOYMENT_V19)); BOOST_REQUIRE(!DeploymentActiveAfter(chainman.ActiveChain().Tip(), Params().GetConsensus(), Consensus::DEPLOYMENT_V19));
++nHeight; ++nHeight;
BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight); BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight);
dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip()); dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip());
dmnman.DoMaintenance(); dmnman.DoMaintenance();
auto tip_list = dmnman.GetListAtChainTip(); auto tip_list = dmnman.GetListAtChainTip();
BOOST_ASSERT(tip_list.HasMN(tx_reg_hash)); BOOST_REQUIRE(tip_list.HasMN(tx_reg_hash));
auto pindex_create = chainman.ActiveChain().Tip(); auto pindex_create = chainman.ActiveChain().Tip();
auto base_list = dmnman.GetListForBlock(pindex_create); auto base_list = dmnman.GetListForBlock(pindex_create);
std::vector<CDeterministicMNListDiff> diffs; std::vector<CDeterministicMNListDiff> diffs;
@ -307,14 +307,14 @@ void FuncV19Activation(TestChainSetup& setup)
auto tx_upreg = CreateProUpRegTx(chainman.ActiveChain(), *(setup.m_node.mempool), utxos, tx_reg_hash, owner_key, operator_key_new.GetPublicKey(), owner_key.GetPubKey().GetID(), collateralScript, setup.coinbaseKey); auto tx_upreg = CreateProUpRegTx(chainman.ActiveChain(), *(setup.m_node.mempool), utxos, tx_reg_hash, owner_key, operator_key_new.GetPublicKey(), owner_key.GetPubKey().GetID(), collateralScript, setup.coinbaseKey);
block = std::make_shared<CBlock>(setup.CreateBlock({tx_upreg}, setup.coinbaseKey, chainman.ActiveChainstate())); block = std::make_shared<CBlock>(setup.CreateBlock({tx_upreg}, setup.coinbaseKey, chainman.ActiveChainstate()));
BOOST_ASSERT(chainman.ProcessNewBlock(Params(), block, true, nullptr)); BOOST_REQUIRE(chainman.ProcessNewBlock(Params(), block, true, nullptr));
BOOST_ASSERT(!DeploymentActiveAfter(chainman.ActiveChain().Tip(), Params().GetConsensus(), Consensus::DEPLOYMENT_V19)); BOOST_REQUIRE(!DeploymentActiveAfter(chainman.ActiveChain().Tip(), Params().GetConsensus(), Consensus::DEPLOYMENT_V19));
++nHeight; ++nHeight;
BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight); BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight);
dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip()); dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip());
dmnman.DoMaintenance(); dmnman.DoMaintenance();
tip_list = dmnman.GetListAtChainTip(); tip_list = dmnman.GetListAtChainTip();
BOOST_ASSERT(tip_list.HasMN(tx_reg_hash)); BOOST_REQUIRE(tip_list.HasMN(tx_reg_hash));
diffs.push_back(base_list.BuildDiff(tip_list)); diffs.push_back(base_list.BuildDiff(tip_list));
// spend // spend
@ -325,61 +325,62 @@ void FuncV19Activation(TestChainSetup& setup)
FillableSigningProvider signing_provider; FillableSigningProvider signing_provider;
signing_provider.AddKeyPubKey(collateral_key, collateral_key.GetPubKey()); signing_provider.AddKeyPubKey(collateral_key, collateral_key.GetPubKey());
BOOST_ASSERT(SignSignature(signing_provider, CTransaction(tx_reg), tx_spend, 0, SIGHASH_ALL)); BOOST_REQUIRE(SignSignature(signing_provider, CTransaction(tx_reg), tx_spend, 0, SIGHASH_ALL));
block = std::make_shared<CBlock>(setup.CreateBlock({tx_spend}, setup.coinbaseKey, chainman.ActiveChainstate())); block = std::make_shared<CBlock>(setup.CreateBlock({tx_spend}, setup.coinbaseKey, chainman.ActiveChainstate()));
BOOST_ASSERT(chainman.ProcessNewBlock(Params(), block, true, nullptr)); BOOST_REQUIRE(chainman.ProcessNewBlock(Params(), block, true, nullptr));
BOOST_ASSERT(!DeploymentActiveAfter(chainman.ActiveChain().Tip(), Params().GetConsensus(), Consensus::DEPLOYMENT_V19)); BOOST_REQUIRE(!DeploymentActiveAfter(chainman.ActiveChain().Tip(), Params().GetConsensus(), Consensus::DEPLOYMENT_V19));
++nHeight; ++nHeight;
BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight); BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight);
dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip()); dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip());
dmnman.DoMaintenance(); dmnman.DoMaintenance();
diffs.push_back(tip_list.BuildDiff(dmnman.GetListAtChainTip())); diffs.push_back(tip_list.BuildDiff(dmnman.GetListAtChainTip()));
tip_list = dmnman.GetListAtChainTip(); tip_list = dmnman.GetListAtChainTip();
BOOST_ASSERT(!tip_list.HasMN(tx_reg_hash)); BOOST_REQUIRE(!tip_list.HasMN(tx_reg_hash));
BOOST_ASSERT(dmnman.GetListForBlock(pindex_create).HasMN(tx_reg_hash)); BOOST_REQUIRE(dmnman.GetListForBlock(pindex_create).HasMN(tx_reg_hash));
// mine another block so that it's not the last one before V19 // mine another block so that it's not the last one before V19
setup.CreateAndProcessBlock({}, setup.coinbaseKey); setup.CreateAndProcessBlock({}, setup.coinbaseKey);
BOOST_ASSERT(!DeploymentActiveAfter(chainman.ActiveChain().Tip(), Params().GetConsensus(), Consensus::DEPLOYMENT_V19)); BOOST_REQUIRE(!DeploymentActiveAfter(chainman.ActiveChain().Tip(), Params().GetConsensus(), Consensus::DEPLOYMENT_V19));
++nHeight; ++nHeight;
BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight); BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight);
dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip()); dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip());
dmnman.DoMaintenance(); dmnman.DoMaintenance();
diffs.push_back(tip_list.BuildDiff(dmnman.GetListAtChainTip())); diffs.push_back(tip_list.BuildDiff(dmnman.GetListAtChainTip()));
tip_list = dmnman.GetListAtChainTip(); tip_list = dmnman.GetListAtChainTip();
BOOST_ASSERT(!tip_list.HasMN(tx_reg_hash)); BOOST_REQUIRE(!tip_list.HasMN(tx_reg_hash));
BOOST_ASSERT(dmnman.GetListForBlock(pindex_create).HasMN(tx_reg_hash)); BOOST_REQUIRE(dmnman.GetListForBlock(pindex_create).HasMN(tx_reg_hash));
// this block should activate V19 // this block should activate V19
setup.CreateAndProcessBlock({}, setup.coinbaseKey); setup.CreateAndProcessBlock({}, setup.coinbaseKey);
BOOST_ASSERT(DeploymentActiveAfter(chainman.ActiveChain().Tip(), Params().GetConsensus(), Consensus::DEPLOYMENT_V19)); BOOST_REQUIRE(DeploymentActiveAfter(chainman.ActiveChain().Tip(), Params().GetConsensus(), Consensus::DEPLOYMENT_V19));
++nHeight; ++nHeight;
BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight); BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight);
dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip()); dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip());
dmnman.DoMaintenance(); dmnman.DoMaintenance();
diffs.push_back(tip_list.BuildDiff(dmnman.GetListAtChainTip())); diffs.push_back(tip_list.BuildDiff(dmnman.GetListAtChainTip()));
tip_list = dmnman.GetListAtChainTip(); tip_list = dmnman.GetListAtChainTip();
BOOST_ASSERT(!tip_list.HasMN(tx_reg_hash)); BOOST_REQUIRE(!tip_list.HasMN(tx_reg_hash));
BOOST_ASSERT(dmnman.GetListForBlock(pindex_create).HasMN(tx_reg_hash)); BOOST_REQUIRE(dmnman.GetListForBlock(pindex_create).HasMN(tx_reg_hash));
// check mn list/diff // check mn list/diff
CDeterministicMNListDiff dummy_diff = base_list.BuildDiff(tip_list); CDeterministicMNListDiff dummy_diff = base_list.BuildDiff(tip_list);
CDeterministicMNList dummmy_list = base_list.ApplyDiff(chainman.ActiveChain().Tip(), dummy_diff); CDeterministicMNList dummmy_list = base_list.ApplyDiff(chainman.ActiveChain().Tip(), dummy_diff);
// Lists should match // Lists should match
BOOST_ASSERT(dummmy_list == tip_list); BOOST_REQUIRE(dummmy_list == tip_list);
// mine 10 more blocks // mine 10 more blocks
for (int i = 0; i < 10; ++i) for (int i = 0; i < 10; ++i)
{ {
setup.CreateAndProcessBlock({}, setup.coinbaseKey); setup.CreateAndProcessBlock({}, setup.coinbaseKey);
BOOST_ASSERT(DeploymentActiveAfter(chainman.ActiveChain().Tip(), Params().GetConsensus(), Consensus::DEPLOYMENT_V19)); BOOST_REQUIRE(
DeploymentActiveAfter(chainman.ActiveChain().Tip(), Params().GetConsensus(), Consensus::DEPLOYMENT_V19));
BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight + 1 + i); BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight + 1 + i);
dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip()); dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip());
dmnman.DoMaintenance(); dmnman.DoMaintenance();
diffs.push_back(tip_list.BuildDiff(dmnman.GetListAtChainTip())); diffs.push_back(tip_list.BuildDiff(dmnman.GetListAtChainTip()));
tip_list = dmnman.GetListAtChainTip(); tip_list = dmnman.GetListAtChainTip();
BOOST_ASSERT(!tip_list.HasMN(tx_reg_hash)); BOOST_REQUIRE(!tip_list.HasMN(tx_reg_hash));
BOOST_ASSERT(dmnman.GetListForBlock(pindex_create).HasMN(tx_reg_hash)); BOOST_REQUIRE(dmnman.GetListForBlock(pindex_create).HasMN(tx_reg_hash));
} }
// check mn list/diff // check mn list/diff
@ -387,19 +388,19 @@ void FuncV19Activation(TestChainSetup& setup)
auto v19_list = dmnman.GetListForBlock(v19_index); auto v19_list = dmnman.GetListForBlock(v19_index);
dummy_diff = v19_list.BuildDiff(tip_list); dummy_diff = v19_list.BuildDiff(tip_list);
dummmy_list = v19_list.ApplyDiff(chainman.ActiveChain().Tip(), dummy_diff); dummmy_list = v19_list.ApplyDiff(chainman.ActiveChain().Tip(), dummy_diff);
BOOST_ASSERT(dummmy_list == tip_list); BOOST_REQUIRE(dummmy_list == tip_list);
// NOTE: this fails on v19/v19.1 with errors like: // NOTE: this fails on v19/v19.1 with errors like:
// "RemoveMN: Can't delete a masternode ... with a pubKeyOperator=..." // "RemoveMN: Can't delete a masternode ... with a pubKeyOperator=..."
dummy_diff = base_list.BuildDiff(tip_list); dummy_diff = base_list.BuildDiff(tip_list);
dummmy_list = base_list.ApplyDiff(chainman.ActiveChain().Tip(), dummy_diff); dummmy_list = base_list.ApplyDiff(chainman.ActiveChain().Tip(), dummy_diff);
BOOST_ASSERT(dummmy_list == tip_list); BOOST_REQUIRE(dummmy_list == tip_list);
dummmy_list = base_list; dummmy_list = base_list;
for (const auto& diff : diffs) { for (const auto& diff : diffs) {
dummmy_list = dummmy_list.ApplyDiff(chainman.ActiveChain().Tip(), diff); dummmy_list = dummmy_list.ApplyDiff(chainman.ActiveChain().Tip(), diff);
} }
BOOST_ASSERT(dummmy_list == tip_list); BOOST_REQUIRE(dummmy_list == tip_list);
}; };
void FuncDIP3Protx(TestChainSetup& setup) void FuncDIP3Protx(TestChainSetup& setup)
@ -439,18 +440,20 @@ void FuncDIP3Protx(TestChainSetup& setup)
// Technically, the payload is still valid... // Technically, the payload is still valid...
{ {
LOCK(cs_main); LOCK(cs_main);
BOOST_ASSERT(CheckProRegTx(dmnman, CTransaction(tx), chainman.ActiveChain().Tip(), dummy_state, chainman.ActiveChainstate().CoinsTip(), true)); BOOST_REQUIRE(CheckProRegTx(dmnman, CTransaction(tx), chainman.ActiveChain().Tip(), dummy_state,
BOOST_ASSERT(CheckProRegTx(dmnman, CTransaction(tx2), chainman.ActiveChain().Tip(), dummy_state, chainman.ActiveChainstate().CoinsTip(), true)); chainman.ActiveChainstate().CoinsTip(), true));
BOOST_REQUIRE(CheckProRegTx(dmnman, CTransaction(tx2), chainman.ActiveChain().Tip(), dummy_state,
chainman.ActiveChainstate().CoinsTip(), true));
} }
// But the signature should not verify anymore // But the signature should not verify anymore
BOOST_ASSERT(CheckTransactionSignature(*(setup.m_node.mempool), tx)); BOOST_REQUIRE(CheckTransactionSignature(*(setup.m_node.mempool), tx));
BOOST_ASSERT(!CheckTransactionSignature(*(setup.m_node.mempool), tx2)); BOOST_REQUIRE(!CheckTransactionSignature(*(setup.m_node.mempool), tx2));
setup.CreateAndProcessBlock({tx}, setup.coinbaseKey); setup.CreateAndProcessBlock({tx}, setup.coinbaseKey);
dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip()); dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip());
BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight + 1); BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight + 1);
BOOST_ASSERT(dmnman.GetListAtChainTip().HasMN(tx.GetHash())); BOOST_REQUIRE(dmnman.GetListAtChainTip().HasMN(tx.GetHash()));
nHeight++; nHeight++;
} }
@ -467,10 +470,10 @@ void FuncDIP3Protx(TestChainSetup& setup)
CBlock block = setup.CreateAndProcessBlock({}, setup.coinbaseKey); CBlock block = setup.CreateAndProcessBlock({}, setup.coinbaseKey);
dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip()); dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip());
BOOST_ASSERT(!block.vtx.empty()); BOOST_REQUIRE(!block.vtx.empty());
auto dmnPayout = FindPayoutDmn(dmnman, block); auto dmnPayout = FindPayoutDmn(dmnman, block);
BOOST_ASSERT(dmnPayout != nullptr); BOOST_REQUIRE(dmnPayout != nullptr);
BOOST_CHECK_EQUAL(dmnPayout->proTxHash.ToString(), dmnExpectedPayee->proTxHash.ToString()); BOOST_CHECK_EQUAL(dmnPayout->proTxHash.ToString(), dmnExpectedPayee->proTxHash.ToString());
nHeight++; nHeight++;
@ -493,7 +496,7 @@ void FuncDIP3Protx(TestChainSetup& setup)
BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight + 1); BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight + 1);
for (size_t j = 0; j < 3; j++) { for (size_t j = 0; j < 3; j++) {
BOOST_ASSERT(dmnman.GetListAtChainTip().HasMN(txns[j].GetHash())); BOOST_REQUIRE(dmnman.GetListAtChainTip().HasMN(txns[j].GetHash()));
} }
nHeight++; nHeight++;
@ -507,7 +510,7 @@ void FuncDIP3Protx(TestChainSetup& setup)
nHeight++; nHeight++;
auto dmn = dmnman.GetListAtChainTip().GetMN(dmnHashes[0]); auto dmn = dmnman.GetListAtChainTip().GetMN(dmnHashes[0]);
BOOST_ASSERT(dmn != nullptr && dmn->pdmnState->addr.GetPort() == 1000); BOOST_REQUIRE(dmn != nullptr && dmn->pdmnState->addr.GetPort() == 1000);
// test ProUpRevTx // test ProUpRevTx
tx = CreateProUpRevTx(chainman.ActiveChain(), *(setup.m_node.mempool), utxos, dmnHashes[0], operatorKeys[dmnHashes[0]], setup.coinbaseKey); tx = CreateProUpRevTx(chainman.ActiveChain(), *(setup.m_node.mempool), utxos, dmnHashes[0], operatorKeys[dmnHashes[0]], setup.coinbaseKey);
@ -517,19 +520,19 @@ void FuncDIP3Protx(TestChainSetup& setup)
nHeight++; nHeight++;
dmn = dmnman.GetListAtChainTip().GetMN(dmnHashes[0]); dmn = dmnman.GetListAtChainTip().GetMN(dmnHashes[0]);
BOOST_ASSERT(dmn != nullptr && dmn->pdmnState->GetBannedHeight() == nHeight); BOOST_REQUIRE(dmn != nullptr && dmn->pdmnState->GetBannedHeight() == nHeight);
// test that the revoked MN does not get paid anymore // test that the revoked MN does not get paid anymore
for (size_t i = 0; i < 20; i++) { for (size_t i = 0; i < 20; i++) {
auto dmnExpectedPayee = dmnman.GetListAtChainTip().GetMNPayee(chainman.ActiveChain().Tip()); auto dmnExpectedPayee = dmnman.GetListAtChainTip().GetMNPayee(chainman.ActiveChain().Tip());
BOOST_ASSERT(dmnExpectedPayee->proTxHash != dmnHashes[0]); BOOST_REQUIRE(dmnExpectedPayee->proTxHash != dmnHashes[0]);
CBlock block = setup.CreateAndProcessBlock({}, setup.coinbaseKey); CBlock block = setup.CreateAndProcessBlock({}, setup.coinbaseKey);
dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip()); dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip());
BOOST_ASSERT(!block.vtx.empty()); BOOST_REQUIRE(!block.vtx.empty());
auto dmnPayout = FindPayoutDmn(dmnman, block); auto dmnPayout = FindPayoutDmn(dmnman, block);
BOOST_ASSERT(dmnPayout != nullptr); BOOST_REQUIRE(dmnPayout != nullptr);
BOOST_CHECK_EQUAL(dmnPayout->proTxHash.ToString(), dmnExpectedPayee->proTxHash.ToString()); BOOST_CHECK_EQUAL(dmnPayout->proTxHash.ToString(), dmnExpectedPayee->proTxHash.ToString());
nHeight++; nHeight++;
@ -545,11 +548,13 @@ void FuncDIP3Protx(TestChainSetup& setup)
TxValidationState dummy_state; TxValidationState dummy_state;
{ {
LOCK(cs_main); LOCK(cs_main);
BOOST_ASSERT(CheckProUpRegTx(dmnman, CTransaction(tx), chainman.ActiveChain().Tip(), dummy_state, chainman.ActiveChainstate().CoinsTip(), true)); BOOST_REQUIRE(CheckProUpRegTx(dmnman, CTransaction(tx), chainman.ActiveChain().Tip(), dummy_state,
BOOST_ASSERT(!CheckProUpRegTx(dmnman, CTransaction(tx2), chainman.ActiveChain().Tip(), dummy_state, chainman.ActiveChainstate().CoinsTip(), true)); chainman.ActiveChainstate().CoinsTip(), true));
BOOST_REQUIRE(!CheckProUpRegTx(dmnman, CTransaction(tx2), chainman.ActiveChain().Tip(), dummy_state,
chainman.ActiveChainstate().CoinsTip(), true));
} }
BOOST_ASSERT(CheckTransactionSignature(*(setup.m_node.mempool), tx)); BOOST_REQUIRE(CheckTransactionSignature(*(setup.m_node.mempool), tx));
BOOST_ASSERT(!CheckTransactionSignature(*(setup.m_node.mempool), tx2)); BOOST_REQUIRE(!CheckTransactionSignature(*(setup.m_node.mempool), tx2));
// now process the block // now process the block
setup.CreateAndProcessBlock({tx}, setup.coinbaseKey); setup.CreateAndProcessBlock({tx}, setup.coinbaseKey);
dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip()); dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip());
@ -563,8 +568,8 @@ void FuncDIP3Protx(TestChainSetup& setup)
nHeight++; nHeight++;
dmn = dmnman.GetListAtChainTip().GetMN(dmnHashes[0]); dmn = dmnman.GetListAtChainTip().GetMN(dmnHashes[0]);
BOOST_ASSERT(dmn != nullptr && dmn->pdmnState->addr.GetPort() == 100); BOOST_REQUIRE(dmn != nullptr && dmn->pdmnState->addr.GetPort() == 100);
BOOST_ASSERT(dmn != nullptr && !dmn->pdmnState->IsBanned()); BOOST_REQUIRE(dmn != nullptr && !dmn->pdmnState->IsBanned());
// test that the revived MN gets payments again // test that the revived MN gets payments again
bool foundRevived = false; bool foundRevived = false;
@ -576,15 +581,15 @@ void FuncDIP3Protx(TestChainSetup& setup)
CBlock block = setup.CreateAndProcessBlock({}, setup.coinbaseKey); CBlock block = setup.CreateAndProcessBlock({}, setup.coinbaseKey);
dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip()); dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip());
BOOST_ASSERT(!block.vtx.empty()); BOOST_REQUIRE(!block.vtx.empty());
auto dmnPayout = FindPayoutDmn(dmnman, block); auto dmnPayout = FindPayoutDmn(dmnman, block);
BOOST_ASSERT(dmnPayout != nullptr); BOOST_REQUIRE(dmnPayout != nullptr);
BOOST_CHECK_EQUAL(dmnPayout->proTxHash.ToString(), dmnExpectedPayee->proTxHash.ToString()); BOOST_CHECK_EQUAL(dmnPayout->proTxHash.ToString(), dmnExpectedPayee->proTxHash.ToString());
nHeight++; nHeight++;
} }
BOOST_ASSERT(foundRevived); BOOST_REQUIRE(foundRevived);
const_cast<Consensus::Params&>(Params().GetConsensus()).DIP0003EnforcementHeight = DIP0003EnforcementHeightBackup; const_cast<Consensus::Params&>(Params().GetConsensus()).DIP0003EnforcementHeight = DIP0003EnforcementHeightBackup;
} }
@ -615,7 +620,7 @@ void FuncTestMempoolReorg(TestChainSetup& setup)
SignTransaction(*(setup.m_node.mempool), tx_collateral, setup.coinbaseKey); SignTransaction(*(setup.m_node.mempool), tx_collateral, setup.coinbaseKey);
auto block = std::make_shared<CBlock>(setup.CreateBlock({tx_collateral}, setup.coinbaseKey, chainman.ActiveChainstate())); auto block = std::make_shared<CBlock>(setup.CreateBlock({tx_collateral}, setup.coinbaseKey, chainman.ActiveChainstate()));
BOOST_ASSERT(chainman.ProcessNewBlock(Params(), block, true, nullptr)); BOOST_REQUIRE(chainman.ProcessNewBlock(Params(), block, true, nullptr));
setup.m_node.dmnman->UpdatedBlockTip(chainman.ActiveChain().Tip()); setup.m_node.dmnman->UpdatedBlockTip(chainman.ActiveChain().Tip());
BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight + 1); BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight + 1);
BOOST_CHECK_EQUAL(block->GetHash(), chainman.ActiveChain().Tip()->GetBlockHash()); BOOST_CHECK_EQUAL(block->GetHash(), chainman.ActiveChain().Tip()->GetBlockHash());
@ -757,7 +762,7 @@ void FuncVerifyDB(TestChainSetup& setup)
SignTransaction(*(setup.m_node.mempool), tx_collateral, setup.coinbaseKey); SignTransaction(*(setup.m_node.mempool), tx_collateral, setup.coinbaseKey);
auto block = std::make_shared<CBlock>(setup.CreateBlock({tx_collateral}, setup.coinbaseKey, chainman.ActiveChainstate())); auto block = std::make_shared<CBlock>(setup.CreateBlock({tx_collateral}, setup.coinbaseKey, chainman.ActiveChainstate()));
BOOST_ASSERT(chainman.ProcessNewBlock(Params(), block, true, nullptr)); BOOST_REQUIRE(chainman.ProcessNewBlock(Params(), block, true, nullptr));
dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip()); dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip());
BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight + 1); BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight + 1);
BOOST_CHECK_EQUAL(block->GetHash(), chainman.ActiveChain().Tip()->GetBlockHash()); BOOST_CHECK_EQUAL(block->GetHash(), chainman.ActiveChain().Tip()->GetBlockHash());
@ -789,11 +794,11 @@ void FuncVerifyDB(TestChainSetup& setup)
auto tx_reg_hash = tx_reg.GetHash(); auto tx_reg_hash = tx_reg.GetHash();
block = std::make_shared<CBlock>(setup.CreateBlock({tx_reg}, setup.coinbaseKey, chainman.ActiveChainstate())); block = std::make_shared<CBlock>(setup.CreateBlock({tx_reg}, setup.coinbaseKey, chainman.ActiveChainstate()));
BOOST_ASSERT(chainman.ProcessNewBlock(Params(), block, true, nullptr)); BOOST_REQUIRE(chainman.ProcessNewBlock(Params(), block, true, nullptr));
dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip()); dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip());
BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight + 2); BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight + 2);
BOOST_CHECK_EQUAL(block->GetHash(), chainman.ActiveChain().Tip()->GetBlockHash()); BOOST_CHECK_EQUAL(block->GetHash(), chainman.ActiveChain().Tip()->GetBlockHash());
BOOST_ASSERT(dmnman.GetListAtChainTip().HasMN(tx_reg_hash)); BOOST_REQUIRE(dmnman.GetListAtChainTip().HasMN(tx_reg_hash));
// Now spend the collateral while updating the same MN // Now spend the collateral while updating the same MN
SimpleUTXOMap collateral_utxos; SimpleUTXOMap collateral_utxos;
@ -801,15 +806,16 @@ void FuncVerifyDB(TestChainSetup& setup)
auto proUpRevTx = CreateProUpRevTx(chainman.ActiveChain(), *(setup.m_node.mempool), collateral_utxos, tx_reg_hash, operatorKey, collateralKey); auto proUpRevTx = CreateProUpRevTx(chainman.ActiveChain(), *(setup.m_node.mempool), collateral_utxos, tx_reg_hash, operatorKey, collateralKey);
block = std::make_shared<CBlock>(setup.CreateBlock({proUpRevTx}, setup.coinbaseKey, chainman.ActiveChainstate())); block = std::make_shared<CBlock>(setup.CreateBlock({proUpRevTx}, setup.coinbaseKey, chainman.ActiveChainstate()));
BOOST_ASSERT(chainman.ProcessNewBlock(Params(), block, true, nullptr)); BOOST_REQUIRE(chainman.ProcessNewBlock(Params(), block, true, nullptr));
dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip()); dmnman.UpdatedBlockTip(chainman.ActiveChain().Tip());
BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight + 3); BOOST_CHECK_EQUAL(chainman.ActiveChain().Height(), nHeight + 3);
BOOST_CHECK_EQUAL(block->GetHash(), chainman.ActiveChain().Tip()->GetBlockHash()); BOOST_CHECK_EQUAL(block->GetHash(), chainman.ActiveChain().Tip()->GetBlockHash());
BOOST_ASSERT(!dmnman.GetListAtChainTip().HasMN(tx_reg_hash)); BOOST_REQUIRE(!dmnman.GetListAtChainTip().HasMN(tx_reg_hash));
// Verify db consistency // Verify db consistency
LOCK(cs_main); LOCK(cs_main);
BOOST_ASSERT(CVerifyDB().VerifyDB(chainman.ActiveChainstate(), Params(), chainman.ActiveChainstate().CoinsTip(), *(setup.m_node.evodb), 4, 2)); BOOST_REQUIRE(CVerifyDB().VerifyDB(chainman.ActiveChainstate(), Params(), chainman.ActiveChainstate().CoinsTip(),
*(setup.m_node.evodb), 4, 2));
} }
BOOST_AUTO_TEST_SUITE(evo_dip3_activation_tests) BOOST_AUTO_TEST_SUITE(evo_dip3_activation_tests)

View File

@ -26,7 +26,7 @@ BOOST_AUTO_TEST_CASE(simplifiedmns_merkleroots)
if (auto service = Lookup(ip, i, false); service.has_value()) { if (auto service = Lookup(ip, i, false); service.has_value()) {
smle.service = service.value(); smle.service = service.value();
} else { } else {
BOOST_ASSERT(false); BOOST_REQUIRE(false);
} }
std::vector<unsigned char> vecBytes{static_cast<unsigned char>(i)}; std::vector<unsigned char> vecBytes{static_cast<unsigned char>(i)};

View File

@ -14,13 +14,13 @@ BOOST_AUTO_TEST_CASE(llmq_dkgerror)
{ {
using namespace llmq; using namespace llmq;
for (auto i : irange::range(ToUnderlying(llmq::DKGError::type::_COUNT))) { for (auto i : irange::range(ToUnderlying(llmq::DKGError::type::_COUNT))) {
BOOST_ASSERT(GetSimulatedErrorRate(llmq::DKGError::type(i)) == 0.0); BOOST_REQUIRE(GetSimulatedErrorRate(llmq::DKGError::type(i)) == 0.0);
SetSimulatedDKGErrorRate(llmq::DKGError::type(i), 1.0); SetSimulatedDKGErrorRate(llmq::DKGError::type(i), 1.0);
BOOST_ASSERT(GetSimulatedErrorRate(llmq::DKGError::type(i)) == 1.0); BOOST_REQUIRE(GetSimulatedErrorRate(llmq::DKGError::type(i)) == 1.0);
} }
BOOST_ASSERT(GetSimulatedErrorRate(llmq::DKGError::type::_COUNT) == 0.0); BOOST_REQUIRE(GetSimulatedErrorRate(llmq::DKGError::type::_COUNT) == 0.0);
SetSimulatedDKGErrorRate(llmq::DKGError::type::_COUNT, 1.0); SetSimulatedDKGErrorRate(llmq::DKGError::type::_COUNT, 1.0);
BOOST_ASSERT(GetSimulatedErrorRate(llmq::DKGError::type::_COUNT) == 0.0); BOOST_REQUIRE(GetSimulatedErrorRate(llmq::DKGError::type::_COUNT) == 0.0);
} }

View File

@ -441,13 +441,13 @@ CBlock TestChainSetup::CreateBlock(
if (block.vtx[0]->nType == TRANSACTION_COINBASE) { if (block.vtx[0]->nType == TRANSACTION_COINBASE) {
LOCK(cs_main); LOCK(cs_main);
auto cbTx = GetTxPayload<CCbTx>(*block.vtx[0]); auto cbTx = GetTxPayload<CCbTx>(*block.vtx[0]);
BOOST_ASSERT(cbTx.has_value()); Assert(cbTx.has_value());
BlockValidationState state; BlockValidationState state;
if (!CalcCbTxMerkleRootMNList(block, chainstate.m_chain.Tip(), cbTx->merkleRootMNList, *m_node.dmnman, state, chainstate.CoinsTip())) { if (!CalcCbTxMerkleRootMNList(block, chainstate.m_chain.Tip(), cbTx->merkleRootMNList, *m_node.dmnman, state, chainstate.CoinsTip())) {
BOOST_ASSERT(false); Assert(false);
} }
if (!CalcCbTxMerkleRootQuorums(block, chainstate.m_chain.Tip(), *m_node.llmq_ctx->quorum_block_processor, cbTx->merkleRootQuorums, state)) { if (!CalcCbTxMerkleRootQuorums(block, chainstate.m_chain.Tip(), *m_node.llmq_ctx->quorum_block_processor, cbTx->merkleRootQuorums, state)) {
BOOST_ASSERT(false); Assert(false);
} }
CMutableTransaction tmpTx{*block.vtx[0]}; CMutableTransaction tmpTx{*block.vtx[0]};
SetTxPayload(tmpTx, *cbTx); SetTxPayload(tmpTx, *cbTx);

View File

@ -31,8 +31,11 @@
#include <util/hasher.h> #include <util/hasher.h>
#include <boost/multi_index/hashed_index.hpp> #include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/identity.hpp>
#include <boost/multi_index/indexed_by.hpp>
#include <boost/multi_index/ordered_index.hpp> #include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/sequenced_index.hpp> #include <boost/multi_index/sequenced_index.hpp>
#include <boost/multi_index/tag.hpp>
#include <boost/multi_index_container.hpp> #include <boost/multi_index_container.hpp>
class CBlockIndex; class CBlockIndex;

View File

@ -209,7 +209,7 @@ public:
BOOST_FIXTURE_TEST_CASE(coinjoin_manager_start_stop_tests, CTransactionBuilderTestSetup) BOOST_FIXTURE_TEST_CASE(coinjoin_manager_start_stop_tests, CTransactionBuilderTestSetup)
{ {
CCoinJoinClientManager* cj_man = m_node.cj_ctx->walletman->Get(""); CCoinJoinClientManager* cj_man = m_node.cj_ctx->walletman->Get("");
BOOST_ASSERT(cj_man != nullptr); BOOST_REQUIRE(cj_man != nullptr);
BOOST_CHECK_EQUAL(cj_man->IsMixing(), false); BOOST_CHECK_EQUAL(cj_man->IsMixing(), false);
BOOST_CHECK_EQUAL(cj_man->StartMixing(), true); BOOST_CHECK_EQUAL(cj_man->StartMixing(), true);
BOOST_CHECK_EQUAL(cj_man->IsMixing(), true); BOOST_CHECK_EQUAL(cj_man->IsMixing(), true);

View File

@ -51,8 +51,11 @@ fi
EXPECTED_BOOST_INCLUDES=( EXPECTED_BOOST_INCLUDES=(
boost/date_time/posix_time/posix_time.hpp boost/date_time/posix_time/posix_time.hpp
boost/multi_index/hashed_index.hpp boost/multi_index/hashed_index.hpp
boost/multi_index/identity.hpp
boost/multi_index/indexed_by.hpp
boost/multi_index/ordered_index.hpp boost/multi_index/ordered_index.hpp
boost/multi_index/sequenced_index.hpp boost/multi_index/sequenced_index.hpp
boost/multi_index/tag.hpp
boost/multi_index_container.hpp boost/multi_index_container.hpp
boost/pool/pool_alloc.hpp boost/pool/pool_alloc.hpp
boost/process.hpp boost/process.hpp