Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b2e6a7a
Merge bitcoin/bitcoin#22751: rpc/wallet: add simulaterawtransaction RPC
achow101 Aug 5, 2022
9343dcd
Merge bitcoin/bitcoin#19391: RPC/Mining: Clean out pre-Segwit miner c…
fanquake Aug 17, 2022
787091a
Merge bitcoin/bitcoin#26031: test: Display skipped tests reason
Sep 9, 2022
c82eac2
Merge bitcoin/bitcoin#25922: wallet: trigger MaybeResendWalletTxs() e…
achow101 Aug 26, 2022
776d805
Merge bitcoin/bitcoin#25914: test: Fix intermittent issue in p2p_leak.py
fanquake Sep 4, 2022
dd6a131
Merge bitcoin#26069: rpc: unify arg type error message
PastaPastaPasta Jun 2, 2025
d30b102
Merge bitcoin/bitcoin#26645: util: Include full version id in bug rep…
DashCoreAutoGuix Jul 9, 2025
fe2175a
Merge bitcoin/bitcoin#26617: test: add extra_args to BitcoinTestFrame…
DashCoreAutoGuix Jul 9, 2025
75dc71c
Merge bitcoin/bitcoin#25900: ci: run docker wrapper with a non-root user
DashCoreAutoGuix Jul 10, 2025
9a6a783
Merge bitcoin/bitcoin#26292: util: move threadinterrupt into util/
DashCoreAutoGuix Jul 10, 2025
5089233
Merge bitcoin/bitcoin#26376: test: Use type-safe NodeSeconds for Test…
DashCoreAutoGuix Jul 10, 2025
4331957
Merge bitcoin/bitcoin#26630: test: Fix intermittent issue in rpc_net.py
DashCoreAutoGuix Jun 19, 2025
08503dc
Merge bitcoin/bitcoin#26620: test: refactor: eliminate genesis block …
DashCoreAutoGuix Jul 9, 2025
ad6e04f
Merge bitcoin/bitcoin#26446: build: Drop unneeded linking of `contrib…
DashCoreAutoGuix Jul 10, 2025
fde992c
Merge bitcoin/bitcoin#25311: refactor: remove CBlockIndex copy constr…
DashCoreAutoGuix Jul 10, 2025
46d68e0
Merge bitcoin-core/gui#685: clang-tidy: Fix `readability-redundant-st…
DashCoreAutoGuix Jul 10, 2025
3575231
Merge bitcoin/bitcoin#26419: log: mempool: log removal reason in vali…
DashCoreAutoGuix Jul 10, 2025
d695d3b
Merge bitcoin/bitcoin#26402: doc: Fix typos
DashCoreAutoGuix Jul 10, 2025
a44683d
Merge bitcoin/bitcoin#28740: refactor: Add LIFETIMEBOUND to all (w)tx…
DashCoreAutoGuix Jul 11, 2025
cdba8aa
Merge bitcoin/bitcoin#28283: doc: clarify cookie generation in JSON-R…
DashCoreAutoGuix Jul 11, 2025
83da000
Merge bitcoin/bitcoin#25680: rpc, docs: Add note for commands that su…
DashCoreAutoGuix Jul 11, 2025
5a1b908
test: align DashTestFramework.setup_nodes with BitcoinTestFramework
PastaPastaPasta Jul 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions ci/test/04_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ export P_CI_DIR="$PWD"

if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
echo "Creating $DOCKER_NAME_TAG container to run in"
LOCAL_UID=$(id -u)
LOCAL_GID=$(id -g)

# the name isn't important, so long as we use the same UID
LOCAL_USER=nonroot
${CI_RETRY_EXE} docker pull "$DOCKER_NAME_TAG"

# shellcheck disable=SC2086
Expand All @@ -45,26 +50,39 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
--env-file /tmp/env \
--name $CONTAINER_NAME \
$DOCKER_NAME_TAG)
export DOCKER_CI_CMD_PREFIX="docker exec $DOCKER_ID"

# Create a non-root user inside the container which matches the local user.
#
# This prevents the root user in the container modifying the local file system permissions
# on the mounted directories
docker exec "$DOCKER_ID" useradd -u "$LOCAL_UID" -o -m "$LOCAL_USER"
docker exec "$DOCKER_ID" groupmod -o -g "$LOCAL_GID" "$LOCAL_USER"
docker exec "$DOCKER_ID" chown -R "$LOCAL_USER":"$LOCAL_USER" "${BASE_ROOT_DIR}"
export DOCKER_CI_CMD_PREFIX_ROOT="docker exec -u 0 $DOCKER_ID"
export DOCKER_CI_CMD_PREFIX="docker exec -u $LOCAL_UID $DOCKER_ID"
else
echo "Running on host system without docker wrapper"
fi

CI_EXEC () {
$DOCKER_CI_CMD_PREFIX bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd \"$P_CI_DIR\" && $*"
}
CI_EXEC_ROOT () {
$DOCKER_CI_CMD_PREFIX_ROOT bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd \"$P_CI_DIR\" && $*"
}
export -f CI_EXEC
export -f CI_EXEC_ROOT

if [ -n "$DPKG_ADD_ARCH" ]; then
CI_EXEC dpkg --add-architecture "$DPKG_ADD_ARCH"
CI_EXEC_ROOT dpkg --add-architecture "$DPKG_ADD_ARCH"
fi

if [[ $DOCKER_NAME_TAG == *centos* ]]; then
CI_EXEC yum -y install epel-release
CI_EXEC yum -y install "$DOCKER_PACKAGES" "$PACKAGES"
CI_EXEC_ROOT yum -y install epel-release
CI_EXEC_ROOT yum -y install "$DOCKER_PACKAGES" "$PACKAGES"
elif [ "$CI_USE_APT_INSTALL" != "no" ]; then
${CI_RETRY_EXE} CI_EXEC apt-get update
${CI_RETRY_EXE} CI_EXEC apt-get install --no-install-recommends --no-upgrade -y "$PACKAGES" "$DOCKER_PACKAGES"
${CI_RETRY_EXE} CI_EXEC_ROOT apt-get update
${CI_RETRY_EXE} CI_EXEC_ROOT apt-get install --no-install-recommends --no-upgrade -y "$PACKAGES" "$DOCKER_PACKAGES"
if [ -n "$PIP_PACKAGES" ]; then
# shellcheck disable=SC2086
${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES
Expand Down
1 change: 1 addition & 0 deletions ci/test/05_before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if [ "$CI_OS_NAME" == "macos" ]; then
echo > "${HOME}/Library/Application Support/DashCore"
else
CI_EXEC echo \> \$HOME/.dashcore
CI_EXEC_ROOT echo \> \$HOME/.dashcore
fi

CI_EXEC mkdir -p "${DEPENDS_DIR}/SDKs" "${DEPENDS_DIR}/sdk-sources"
Expand Down
4 changes: 0 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1925,10 +1925,6 @@ AC_SUBST(HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR)
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini])
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])])
AC_CONFIG_LINKS([contrib/devtools/security-check.py:contrib/devtools/security-check.py])
AC_CONFIG_LINKS([contrib/devtools/test-security-check.py:contrib/devtools/test-security-check.py])
AC_CONFIG_LINKS([contrib/devtools/symbol-check.py:contrib/devtools/symbol-check.py])
AC_CONFIG_LINKS([contrib/devtools/test-symbol-check.py:contrib/devtools/test-symbol-check.py])
AC_CONFIG_LINKS([contrib/filter-lcov.py:contrib/filter-lcov.py])
AC_CONFIG_LINKS([src/.bear-tidy-config:src/.bear-tidy-config])
AC_CONFIG_LINKS([src/.clang-tidy:src/.clang-tidy])
Expand Down
2 changes: 1 addition & 1 deletion contrib/devtools/test-security-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def env_flags() -> List[str]:

def call_security_check(cc, source, executable, options):
subprocess.run([*cc,source,'-o',executable] + env_flags() + options, check=True)
p = subprocess.run(['./contrib/devtools/security-check.py',executable], stdout=subprocess.PIPE, universal_newlines=True)
p = subprocess.run([os.path.join(os.path.dirname(__file__), 'security-check.py'), executable], stdout=subprocess.PIPE, universal_newlines=True)
return (p.returncode, p.stdout.rstrip())

def get_arch(cc, source, executable):
Expand Down
2 changes: 1 addition & 1 deletion contrib/devtools/test-symbol-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def call_symbol_check(cc: List[str], source, executable, options):
env_flags += filter(None, os.environ.get(var, '').split(' '))

subprocess.run([*cc,source,'-o',executable] + env_flags + options, check=True)
p = subprocess.run(['./contrib/devtools/symbol-check.py',executable], stdout=subprocess.PIPE, universal_newlines=True)
p = subprocess.run([os.path.join(os.path.dirname(__file__), 'symbol-check.py'), executable], stdout=subprocess.PIPE, universal_newlines=True)
os.remove(source)
os.remove(executable)
return (p.returncode, p.stdout.rstrip())
Expand Down
2 changes: 1 addition & 1 deletion doc/JSON-RPC-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ RPC interface will be abused.
Instead, expose it only on the host system's localhost, for example:
`-p 127.0.0.1:8332:8332`

- **Secure authentication:** By default, Dash Core generates unique
- **Secure authentication:** By default, when no `rpcpassword` is specified, Dash Core generates unique
login credentials each time it restarts and puts them into a file
readable only by the user that started Dash Core, allowing any of
that user's RPC clients with read access to the file to login
Expand Down
8 changes: 4 additions & 4 deletions doc/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ the passed message.

#### Tracepoint `net:outbound_message`

Is called when a message is send to a peer over the P2P network. Passes
Is called when a message is sent to a peer over the P2P network. Passes
information about our peer, the connection and the message as arguments.

Arguments passed:
Expand Down Expand Up @@ -116,7 +116,7 @@ added to and removed (spent) from the cache when we connect a new block.
(`chainstate.CoinsTip()`). For example, the RPCs `generateblock` and
`getblocktemplate` call `TestBlockValidity()`, which applies the UTXO set
changes to a temporary cache. Similarly, mempool consistency checks, which are
frequent on regtest, also apply the the UTXO set changes to a temporary cache.
frequent on regtest, also apply the UTXO set changes to a temporary cache.
Changes to the _main_ UTXO cache and to temporary caches trigger the tracepoints.
We can't tell if a temporary cache or the _main_ cache was changed.

Expand Down Expand Up @@ -253,8 +253,8 @@ TRACE6(net, inbound_message,

### Guidelines and best practices

#### Clear motivation and use-case
Tracepoints need a clear motivation and use-case. The motivation should
#### Clear motivation and use case
Tracepoints need a clear motivation and use case. The motivation should
outweigh the impact on, for example, code readability. There is no point in
adding tracepoints that don't end up being used.

Expand Down
4 changes: 2 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ BITCOIN_CORE_H = \
support/lockedpool.h \
sync.h \
timestampindex.h \
threadinterrupt.h \
threadsafety.h \
timedata.h \
torcontrol.h \
Expand Down Expand Up @@ -381,6 +380,7 @@ BITCOIN_CORE_H = \
util/system.h \
util/time.h \
util/thread.h \
util/threadinterrupt.h \
util/threadnames.h \
util/tokenpipe.h \
util/trace.h \
Expand Down Expand Up @@ -840,7 +840,6 @@ libbitcoin_util_a_SOURCES = \
stacktraces.cpp \
support/cleanse.cpp \
sync.cpp \
threadinterrupt.cpp \
util/asmap.cpp \
util/bip32.cpp \
util/bytevectorhash.cpp \
Expand All @@ -864,6 +863,7 @@ libbitcoin_util_a_SOURCES = \
util/serfloat.cpp \
util/string.cpp \
util/thread.cpp \
util/threadinterrupt.cpp \
util/threadnames.cpp \
util/tokenpipe.cpp \
util/wpipe.cpp \
Expand Down
22 changes: 18 additions & 4 deletions src/chain.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,6 @@ class CBlockIndex
//! (memory only) Maximum nTime in the chain up to and including this block.
unsigned int nTimeMax{0};

CBlockIndex()
{
}

explicit CBlockIndex(const CBlockHeader& block)
: nVersion{block.nVersion},
hashMerkleRoot{block.hashMerkleRoot},
Expand Down Expand Up @@ -333,6 +329,24 @@ class CBlockIndex
//! Efficiently find an ancestor of this block.
CBlockIndex* GetAncestor(int height);
const CBlockIndex* GetAncestor(int height) const;

CBlockIndex() = default;
~CBlockIndex() = default;

protected:
//! CBlockIndex should not allow public copy construction because equality
//! comparison via pointer is very common throughout the codebase, making
//! use of copy a footgun. Also, use of copies do not have the benefit
//! of simplifying lifetime considerations due to attributes like pprev and
//! pskip, which are at risk of becoming dangling pointers in a copied
//! instance.
//!
//! We declare these protected instead of simply deleting them so that
//! CDiskBlockIndex can reuse copy construction.
CBlockIndex(const CBlockIndex&) = default;
CBlockIndex& operator=(const CBlockIndex&) = delete;
CBlockIndex(CBlockIndex&&) = delete;
CBlockIndex& operator=(CBlockIndex&&) = delete;
};

arith_uint256 GetBlockProof(const CBlockIndex& block);
Expand Down
1 change: 1 addition & 0 deletions src/i2p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <util/spanparsing.h>
#include <util/strencodings.h>
#include <util/system.h>
#include <util/threadinterrupt.h>

#include <chrono>
#include <memory>
Expand Down
2 changes: 1 addition & 1 deletion src/i2p.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <netaddress.h>
#include <netbase.h>
#include <sync.h>
#include <threadinterrupt.h>
#include <util/sock.h>
#include <util/threadinterrupt.h>

#include <memory>
#include <optional>
Expand Down
2 changes: 1 addition & 1 deletion src/index/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#define BITCOIN_INDEX_BASE_H

#include <dbwrapper.h>
#include <threadinterrupt.h>
#include <util/threadinterrupt.h>
#include <validationinterface.h>

#include <atomic>
Expand Down
2 changes: 1 addition & 1 deletion src/llmq/instantsend.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <consensus/params.h>
#include <net_types.h>
#include <primitives/transaction.h>
#include <threadinterrupt.h>
#include <util/threadinterrupt.h>
#include <txmempool.h>
#include <unordered_lru_cache.h>

Expand Down
2 changes: 1 addition & 1 deletion src/llmq/quorums.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <gsl/pointers.h>
#include <protocol.h>
#include <saltedhasher.h>
#include <threadinterrupt.h>
#include <util/threadinterrupt.h>
#include <unordered_lru_cache.h>
#include <util/time.h>

Expand Down
2 changes: 1 addition & 1 deletion src/llmq/signing.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <random.h>
#include <saltedhasher.h>
#include <sync.h>
#include <threadinterrupt.h>
#include <util/threadinterrupt.h>
#include <unordered_lru_cache.h>

#include <unordered_map>
Expand Down
2 changes: 1 addition & 1 deletion src/llmq/signing_shares.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <saltedhasher.h>
#include <serialize.h>
#include <sync.h>
#include <threadinterrupt.h>
#include <util/threadinterrupt.h>
#include <uint256.h>

#include <atomic>
Expand Down
2 changes: 1 addition & 1 deletion src/mapport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#include <net.h>
#include <netaddress.h>
#include <netbase.h>
#include <threadinterrupt.h>
#include <util/system.h>
#include <util/thread.h>
#include <util/threadinterrupt.h>

#ifdef USE_NATPMP
#include <compat/compat.h>
Expand Down
1 change: 1 addition & 0 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <util/strencodings.h>
#include <util/system.h>
#include <util/thread.h>
#include <util/threadinterrupt.h>
#include <util/time.h>
#include <util/trace.h>
#include <util/translation.h>
Expand Down
2 changes: 1 addition & 1 deletion src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
#include <span.h>
#include <streams.h>
#include <sync.h>
#include <threadinterrupt.h>
#include <uint256.h>
#include <util/check.h>
#include <util/edge.h>
#include <util/sock.h>
#include <util/system.h>
#include <util/threadinterrupt.h>
#include <util/wpipe.h>
#include <consensus/params.h>

Expand Down
4 changes: 2 additions & 2 deletions src/primitives/transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#ifndef BITCOIN_PRIMITIVES_TRANSACTION_H
#define BITCOIN_PRIMITIVES_TRANSACTION_H

#include <attributes.h>
#include <consensus/amount.h>
#include <prevector.h>
#include <script/script.h>
#include <serialize.h>
#include <uint256.h>
Expand Down Expand Up @@ -260,7 +260,7 @@ class CTransaction
return vin.empty() && vout.empty();
}

const uint256& GetHash() const { return hash; }
const uint256& GetHash() const LIFETIMEBOUND { return hash; }

// Return sum of txouts.
CAmount GetValueOut() const;
Expand Down
4 changes: 2 additions & 2 deletions src/qt/transactionrecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ class TransactionRecord
static const int RecommendedNumConfirmations = 6;

TransactionRecord():
hash(), time(0), type(Other), strAddress(""), debit(0), credit(0), idx(0)
hash(), time(0), type(Other), debit(0), credit(0), idx(0)
{
txDest = DecodeDestination(strAddress);
}

TransactionRecord(uint256 _hash, qint64 _time):
hash(_hash), time(_time), type(Other), strAddress(""), debit(0),
hash(_hash), time(_time), type(Other), debit(0),
credit(0), idx(0)
{
txDest = DecodeDestination(strAddress);
Expand Down
2 changes: 2 additions & 0 deletions src/rpc/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ static const CRPCConvertParam vRPCConvertParams[] =
{ "send", 1, "conf_target" },
{ "send", 3, "fee_rate"},
{ "send", 4, "options" },
{ "simulaterawtransaction", 0, "rawtxs" },
{ "simulaterawtransaction", 1, "options" },
{ "importprivkey", 2, "rescan" },
{ "importelectrumwallet", 1, "index" },
{ "importaddress", 2, "rescan" },
Expand Down
16 changes: 0 additions & 16 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,6 @@ static RPCHelpMan getblocktemplate()
std::string strMode = "template";
UniValue lpval = NullUniValue;
std::set<std::string> setClientRules;
int64_t nMaxVersionPreVB = -1;
CChainState& active_chainstate = chainman.ActiveChainstate();
CChain& active_chain = active_chainstate.m_chain;
if (!request.params[0].isNull())
Expand Down Expand Up @@ -719,12 +718,6 @@ static RPCHelpMan getblocktemplate()
const UniValue& v = aClientRules[i];
setClientRules.insert(v.get_str());
}
} else {
// NOTE: It is important that this NOT be read if versionbits is supported
const UniValue& uvMaxVersion = find_value(oparam, "maxversion");
if (uvMaxVersion.isNum()) {
nMaxVersionPreVB = uvMaxVersion.get_int64();
}
}
}

Expand Down Expand Up @@ -914,7 +907,6 @@ static RPCHelpMan getblocktemplate()
if (setClientRules.find(vbinfo.name) == setClientRules.end()) {
// Not supported by the client; make sure it's safe to proceed
if (!vbinfo.gbt_force) {
// If we do anything other than throw an exception here, be sure version/force isn't sent to old clients
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Support for '%s' rule requires explicit client support", vbinfo.name));
}
}
Expand All @@ -927,14 +919,6 @@ static RPCHelpMan getblocktemplate()
result.pushKV("vbavailable", vbavailable);
result.pushKV("vbrequired", int(0));

if (nMaxVersionPreVB >= 2) {
// If VB is supported by the client, nMaxVersionPreVB is -1, so we won't get here
// Because BIP 34 changed how the generation transaction is serialized, we can only use version/force back to v2 blocks
// This is safe to do [otherwise-]unconditionally only because we are throwing an exception above if a non-force deployment gets activated
// Note that this can probably also be removed entirely after the first BIP9 non-force deployment (ie, probably segwit) gets activated
aMutable.push_back("version/force");
}

const bool fDIP0001Active_context{DeploymentActiveAfter(pindexPrev, consensusParams, Consensus::DEPLOYMENT_DIP0001)};
result.pushKV("previousblockhash", pblock->hashPrevBlock.GetHex());
result.pushKV("transactions", transactions);
Expand Down
3 changes: 2 additions & 1 deletion src/rpc/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ void RPCTypeCheck(const UniValue& params,
void RPCTypeCheckArgument(const UniValue& value, const UniValueType& typeExpected)
{
if (!typeExpected.typeAny && value.type() != typeExpected.type) {
throw JSONRPCError(RPC_TYPE_ERROR, strprintf("Expected type %s, got %s", uvTypeName(typeExpected.type), uvTypeName(value.type())));
throw JSONRPCError(RPC_TYPE_ERROR,
strprintf("JSON value of type %s is not of expected type %s", uvTypeName(value.type()), uvTypeName(typeExpected.type)));
}
}

Expand Down
Loading
Loading