Skip to content
  •  
  •  
  •  
28 changes: 22 additions & 6 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ BITCOIN_CORE_H = \
coinjoin/util.h \
coinjoin/walletman.h \
coins.h \
common/args.h \
common/bloom.h \
common/init.h \
common/run_command.h \
Expand All @@ -214,6 +215,8 @@ BITCOIN_CORE_H = \
compat/compat.h \
compat/cpuid.h \
compat/endian.h \
common/settings.h \
common/system.h \
compressor.h \
consensus/consensus.h \
consensus/tx_check.h \
Expand Down Expand Up @@ -308,6 +311,7 @@ BITCOIN_CORE_H = \
kernel/mempool_limits.h \
kernel/mempool_options.h \
kernel/mempool_persist.h \
kernel/notifications_interface.h \
kernel/validation_cache_sizes.h \
key.h \
key_io.h \
Expand Down Expand Up @@ -370,6 +374,7 @@ BITCOIN_CORE_H = \
node/database_args.h \
node/eviction.h \
node/interface_ui.h \
node/kernel_notifications.h \
node/mempool_args.h \
node/mempool_persist_args.h \
node/miner.h \
Expand Down Expand Up @@ -441,10 +446,13 @@ BITCOIN_CORE_H = \
txrequest.h \
undo.h \
unordered_lru_cache.h \
util/any.h \
util/asmap.h \
util/batchpriority.h \
util/bip32.h \
util/bitset.h \
util/bytevectorhash.h \
util/chaintype.h \
util/check.h \
util/edge.h \
util/epochguard.h \
Expand All @@ -458,6 +466,7 @@ BITCOIN_CORE_H = \
util/hash_type.h \
util/hasher.h \
util/helpers.h \
util/insert.h \
util/macros.h \
util/message.h \
util/moneystr.h \
Expand All @@ -467,14 +476,12 @@ BITCOIN_CORE_H = \
util/readwritefile.h \
util/result.h \
util/serfloat.h \
util/settings.h \
util/sock.h \
util/spanparsing.h \
util/std23.h \
util/string.h \
util/subprocess.h \
util/syserror.h \
util/system.h \
util/thread.h \
util/threadinterrupt.h \
util/threadnames.h \
Expand Down Expand Up @@ -654,6 +661,7 @@ libbitcoin_node_a_SOURCES = \
node/eviction.cpp \
node/interface_ui.cpp \
node/interfaces.cpp \
node/kernel_notifications.cpp \
node/mempool_args.cpp \
node/mempool_persist_args.cpp \
node/miner.cpp \
Expand Down Expand Up @@ -999,10 +1007,14 @@ libbitcoin_common_a_SOURCES = \
bech32.cpp \
chainparams.cpp \
coins.cpp \
common/args.cpp \
common/bloom.cpp \
common/config.cpp \
common/init.cpp \
common/interfaces.cpp \
common/run_command.cpp \
common/settings.cpp \
common/system.cpp \
common/url.cpp \
compressor.cpp \
core_read.cpp \
Expand Down Expand Up @@ -1066,8 +1078,10 @@ libbitcoin_util_a_SOURCES = \
support/lockedpool.cpp \
sync.cpp \
util/asmap.cpp \
util/batchpriority.cpp \
util/bip32.cpp \
util/bytevectorhash.cpp \
util/chaintype.cpp \
util/check.cpp \
util/edge.cpp \
util/error.cpp \
Expand All @@ -1081,13 +1095,11 @@ libbitcoin_util_a_SOURCES = \
util/ranges_set.cpp \
util/readwritefile.cpp \
util/serfloat.cpp \
util/settings.cpp \
util/sock.cpp \
util/spanparsing.cpp \
util/strencodings.cpp \
util/string.cpp \
util/syserror.cpp \
util/system.cpp \
util/thread.cpp \
util/threadinterrupt.cpp \
util/threadnames.cpp \
Expand Down Expand Up @@ -1284,7 +1296,11 @@ libdashkernel_la_SOURCES = \
chainparamsbase.cpp \
clientversion.cpp \
coins.cpp \
common/args.cpp \
common/bloom.cpp \
common/config.cpp \
common/settings.cpp \
common/system.cpp \
compressor.cpp \
consensus/merkle.cpp \
consensus/tx_check.cpp \
Expand Down Expand Up @@ -1381,7 +1397,9 @@ libdashkernel_la_SOURCES = \
txdb.cpp \
txmempool.cpp \
uint256.cpp \
util/batchpriority.cpp \
util/bytevectorhash.cpp \
util/chaintype.cpp \
util/check.cpp \
util/exception.cpp \
util/fs.cpp \
Expand All @@ -1391,12 +1409,10 @@ libdashkernel_la_SOURCES = \
util/moneystr.cpp \
util/ranges_set.cpp \
util/serfloat.cpp \
util/settings.cpp \
util/sock.cpp \
util/strencodings.cpp \
util/string.cpp \
util/syserror.cpp \
util/system.cpp \
util/thread.cpp \
util/threadinterrupt.cpp \
util/threadnames.cpp \
Expand Down
1 change: 1 addition & 0 deletions src/active/masternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <chainparams.h>
#include <deploymentstatus.h>
#include <evo/deterministicmns.h>
#include <logging.h>
#include <net.h>
#include <netbase.h>
#include <protocol.h>
Expand Down
9 changes: 4 additions & 5 deletions src/addrdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <addrman.h>
#include <chainparams.h>
#include <clientversion.h>
#include <common/args.h>
#include <hash.h>
#include <logging.h>
#include <logging/timer.h>
Expand All @@ -23,8 +24,6 @@
#include <univalue.h>
#include <util/fs.h>
#include <util/fs_helpers.h>
#include <util/settings.h>
#include <util/system.h>
#include <util/translation.h>

#include <cstdint>
Expand Down Expand Up @@ -140,7 +139,7 @@ CBanDB::CBanDB(fs::path ban_list_path)
bool CBanDB::Write(const banmap_t& banSet)
{
std::vector<std::string> errors;
if (util::WriteSettings(m_banlist_json, {{JSON_KEY, BanMapToJson(banSet)}}, errors)) {
if (common::WriteSettings(m_banlist_json, {{JSON_KEY, BanMapToJson(banSet)}}, errors)) {
return true;
}

Expand All @@ -160,10 +159,10 @@ bool CBanDB::Read(banmap_t& banSet)
return false;
}

std::map<std::string, util::SettingsValue> settings;
std::map<std::string, common::SettingsValue> settings;
std::vector<std::string> errors;

if (!util::ReadSettings(m_banlist_json, settings, errors)) {
if (!common::ReadSettings(m_banlist_json, settings, errors)) {
for (const auto& err : errors) {
LogPrintf("Cannot load banlist %s: %s\n", fs::PathToString(m_banlist_json), err);
}
Expand Down
3 changes: 2 additions & 1 deletion src/banman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

#include <banman.h>

#include <common/system.h>
#include <logging.h>
#include <netaddress.h>
#include <node/interface_ui.h>
#include <sync.h>
#include <util/system.h>
#include <util/time.h>
#include <util/translation.h>

Expand Down
2 changes: 1 addition & 1 deletion src/bench/bench_bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

#include <bls/bls.h>
#include <clientversion.h>
#include <common/args.h>
#include <crypto/sha256.h>
#include <crypto/x11/dispatch.h>
#include <util/fs.h>
#include <util/strencodings.h>
#include <util/system.h>

#include <chrono>
#include <cstdint>
Expand Down
5 changes: 3 additions & 2 deletions src/bench/checkblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
#include <bench/data.h>

#include <chainparams.h>
#include <common/args.h>
#include <consensus/validation.h>
#include <stats/client.h>
#include <streams.h>
#include <util/system.h>
#include <util/chaintype.h>
#include <validation.h>

#include <memory>
Expand Down Expand Up @@ -39,7 +40,7 @@ static void DeserializeAndCheckBlockTest(benchmark::Bench& bench)
stream.write({&a, 1}); // Prevent compaction

ArgsManager bench_args;
const auto chainParams = CreateChainParams(bench_args, CBaseChainParams::MAIN);
const auto chainParams = CreateChainParams(bench_args, ChainType::MAIN);
// CheckBlock calls g_stats_client internally, we aren't using a testing setup
// so we need to do this manually. We can use the stub interface for this.
::g_stats_client = std::make_unique<StatsdClient>();
Expand Down
2 changes: 1 addition & 1 deletion src/bench/checkqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

#include <bench/bench.h>
#include <checkqueue.h>
#include <common/system.h>
#include <key.h>
#include <prevector.h>
#include <pubkey.h>
#include <random.h>
#include <util/system.h>

#include <vector>

Expand Down
3 changes: 2 additions & 1 deletion src/bench/load_external.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <bench/data.h>
#include <chainparams.h>
#include <test/util/setup_common.h>
#include <util/chaintype.h>
#include <validation.h>

/**
Expand All @@ -22,7 +23,7 @@
*/
static void LoadExternalBlockFile(benchmark::Bench& bench)
{
const auto testing_setup{MakeNoLogFileContext<const TestingSetup>(CBaseChainParams::MAIN)};
const auto testing_setup{MakeNoLogFileContext<const TestingSetup>(ChainType::MAIN)};

// Create a single block as in the blocks files (magic bytes, block size,
// block data) as a stream object.
Expand Down
3 changes: 2 additions & 1 deletion src/bench/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <bench/bench.h>
#include <logging.h>
#include <test/util/setup_common.h>
#include <util/chaintype.h>

// All but 2 of the benchmarks should have roughly similar performance:
//
Expand All @@ -18,7 +19,7 @@ static void Logging(benchmark::Bench& bench, const std::vector<const char*>& ext
LogInstance().DisableCategory(BCLog::LogFlags::ALL);

TestingSetup test_setup{
CBaseChainParams::REGTEST,
ChainType::REGTEST,
extra_args,
};

Expand Down
5 changes: 3 additions & 2 deletions src/bench/mempool_stress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <policy/policy.h>
#include <test/util/setup_common.h>
#include <txmempool.h>
#include <util/chaintype.h>
#include <validation.h>

#include <vector>
Expand Down Expand Up @@ -86,7 +87,7 @@ static void ComplexMemPool(benchmark::Bench& bench)
childTxs = static_cast<int>(bench.complexityN());
}
std::vector<CTransactionRef> ordered_coins = CreateOrderedCoins(det_rand, childTxs, /*min_ancestors=*/1);
const auto testing_setup = MakeNoLogFileContext<const TestingSetup>(CBaseChainParams::MAIN);
const auto testing_setup = MakeNoLogFileContext<const TestingSetup>(ChainType::MAIN);
CTxMemPool& pool = *testing_setup.get()->m_node.mempool;
LOCK2(cs_main, pool.cs);
bench.run([&]() NO_THREAD_SAFETY_ANALYSIS {
Expand All @@ -101,7 +102,7 @@ static void ComplexMemPool(benchmark::Bench& bench)
static void MempoolCheck(benchmark::Bench& bench)
{
FastRandomContext det_rand{true};
auto testing_setup = MakeNoLogFileContext<TestChain100Setup>(CBaseChainParams::REGTEST, {"-checkmempool=1"});
auto testing_setup = MakeNoLogFileContext<TestChain100Setup>(ChainType::REGTEST, {"-checkmempool=1"});
CTxMemPool& pool = *testing_setup.get()->m_node.mempool;
LOCK2(cs_main, pool.cs);
testing_setup->PopulateMempool(det_rand, 400, true);
Expand Down
2 changes: 1 addition & 1 deletion src/bench/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ using namespace std::literals;

static void InventoryBatch(benchmark::Bench& bench, uint32_t count)
{
const auto setup = MakeNoLogFileContext<TestingSetup>(CBaseChainParams::REGTEST);
const auto setup = MakeNoLogFileContext<TestingSetup>(ChainType::REGTEST);
auto& chainstate = *static_cast<TestChainState*>(&setup->m_node.chainman->ActiveChainstate());
chainstate.JumpOutOfIbd();
auto& peerman = *setup->m_node.peerman;
Expand Down
3 changes: 2 additions & 1 deletion src/bench/rpc_blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
#include <rpc/blockchain.h>
#include <streams.h>
#include <test/util/setup_common.h>
#include <util/chaintype.h>
#include <validation.h>

#include <univalue.h>

namespace {

struct TestBlockAndIndex {
const std::unique_ptr<const TestingSetup> testing_setup{MakeNoLogFileContext<const TestingSetup>(CBaseChainParams::MAIN)};
const std::unique_ptr<const TestingSetup> testing_setup{MakeNoLogFileContext<const TestingSetup>(ChainType::MAIN)};
CBlock block{};
uint256 blockHash{};
CBlockIndex blockindex{};
Expand Down
4 changes: 2 additions & 2 deletions src/bench/rpc_mempool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <bench/bench.h>
#include <chainparamsbase.h>
#include <kernel/cs_main.h>
#include <kernel/mempool_entry.h>
#include <rpc/mempool.h>
#include <test/util/setup_common.h>
#include <txmempool.h>
#include <util/chaintype.h>

#include <univalue.h>

Expand All @@ -21,7 +21,7 @@ static void AddTx(const CTransactionRef& tx, const CAmount& fee, CTxMemPool& poo

static void RpcMempool(benchmark::Bench& bench)
{
const auto testing_setup = MakeNoLogFileContext<const ChainTestingSetup>(CBaseChainParams::MAIN);
const auto testing_setup = MakeNoLogFileContext<const ChainTestingSetup>(ChainType::MAIN);
CTxMemPool& pool = *Assert(testing_setup->m_node.mempool);
LOCK2(cs_main, pool.cs);

Expand Down
Loading
Loading