Skip to content

Commit

Permalink
Merge branch 'auxpow'
Browse files Browse the repository at this point in the history
  • Loading branch information
domob1812 committed Dec 9, 2024
2 parents 80389c2 + 8dbcccf commit 6bdd907
Show file tree
Hide file tree
Showing 125 changed files with 1,426 additions and 1,145 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ task:
FILE_ENV: "./ci/test/00_setup_env_arm.sh"

task:
name: 'Win64, unit tests, no gui tests, no functional tests'
name: 'Win64-cross'
<< : *GLOBAL_TASK_TEMPLATE
persistent_worker:
labels:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ jobs:
run: |
# A workaround for "The `brew link` step did not complete successfully" error.
brew install --quiet python@3 || brew link --overwrite python@3
# Update to install pkgconf, once the GHA image has been updated.
brew install --quiet coreutils ninja gnu-getopt ccache boost libevent zeromq qt@5 qrencode
brew install --quiet coreutils ninja pkgconf gnu-getopt ccache boost libevent zeromq qt@5 qrencode
- name: Set Ccache directory
run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV"
Expand Down
2 changes: 1 addition & 1 deletion ci/lint/04_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ curl -sL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_
tar --xz -xf - --directory /tmp/
mv "/tmp/shellcheck-${SHELLCHECK_VERSION}/shellcheck" /usr/bin/

MLC_VERSION=v0.18.0
MLC_VERSION=v0.19.0
MLC_BIN=mlc-x86_64-linux
curl -sL "https://github.com/becheran/mlc/releases/download/${MLC_VERSION}/${MLC_BIN}" -o "/usr/bin/mlc"
chmod +x /usr/bin/mlc
Expand Down
3 changes: 2 additions & 1 deletion ci/test/00_setup_env_native_tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ export LC_ALL=C.UTF-8

export CI_IMAGE_NAME_TAG="docker.io/ubuntu:24.04"
export CONTAINER_NAME=ci_native_tidy
export TIDY_LLVM_V="18"
export TIDY_LLVM_V="19"
export APT_LLVM_V="${TIDY_LLVM_V}"
export PACKAGES="clang-${TIDY_LLVM_V} libclang-${TIDY_LLVM_V}-dev llvm-${TIDY_LLVM_V}-dev libomp-${TIDY_LLVM_V}-dev clang-tidy-${TIDY_LLVM_V} jq libevent-dev libboost-dev libzmq3-dev systemtap-sdt-dev qtbase5-dev qttools5-dev qttools5-dev-tools libqrencode-dev libsqlite3-dev libdb++-dev"
export NO_DEPENDS=1
export RUN_UNIT_TESTS=false
Expand Down
3 changes: 3 additions & 0 deletions ci/test/00_setup_env_win64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export CI_IMAGE_NAME_TAG="docker.io/amd64/debian:bookworm" # Check that https:/
export HOST=x86_64-w64-mingw32
export DPKG_ADD_ARCH="i386"
export PACKAGES="nsis g++-mingw-w64-x86-64-posix wine-binfmt wine64 wine32 file"
# Install wine, but do not run unit tests, as they surface frequent
# false-positives.
export RUN_UNIT_TESTS=${RUN_UNIT_TESTS:-false}
export RUN_FUNCTIONAL_TESTS=false
export GOAL="deploy"
# Prior to 11.0.0, the mingw-w64 headers were missing noreturn attributes, causing warnings when
Expand Down
3 changes: 2 additions & 1 deletion cmake/module/TryAppendCXXFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ function(try_append_cxx_flags flags)
target_compile_options(${TACXXF_TARGET} INTERFACE ${TACXXF_IF_CHECK_PASSED})
endif()
if(DEFINED TACXXF_VAR)
string(STRIP "${${TACXXF_VAR}} ${TACXXF_IF_CHECK_PASSED}" ${TACXXF_VAR})
list(JOIN TACXXF_IF_CHECK_PASSED " " flags_if_check_passed_as_string)
string(STRIP "${${TACXXF_VAR}} ${flags_if_check_passed_as_string}" ${TACXXF_VAR})
endif()
else()
if(DEFINED TACXXF_TARGET)
Expand Down
3 changes: 2 additions & 1 deletion cmake/module/TryAppendLinkerFlag.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ function(try_append_linker_flag flag)
target_link_options(${TALF_TARGET} INTERFACE ${TALF_IF_CHECK_PASSED})
endif()
if(DEFINED TALF_VAR)
string(STRIP "${${TALF_VAR}} ${TALF_IF_CHECK_PASSED}" ${TALF_VAR})
list(JOIN TALF_IF_CHECK_PASSED " " flags_if_check_passed_as_string)
string(STRIP "${${TALF_VAR}} ${flags_if_check_passed_as_string}" ${TALF_VAR})
endif()
else()
if(DEFINED TALF_TARGET)
Expand Down
3 changes: 1 addition & 2 deletions contrib/devtools/iwyu/bitcoin.core.imp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Fixups / upstreamed changes
# Nothing for now.
[
{ include: [ "<bits/chrono.h>", private, "<chrono>", public ] },
]
4 changes: 2 additions & 2 deletions contrib/guix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ section](#choosing-your-security-model) before proceeding to perform a build.

In order to perform a build for macOS (which is included in the default set of
platform triples to build), you'll need to extract the macOS SDK tarball using
tools found in the [`macdeploy` directory](../macdeploy/README.md).
tools found in the [`macdeploy` directory](../macdeploy/README.md#sdk-extraction).

You can then either point to the SDK using the `SDK_PATH` environment variable:

Expand Down Expand Up @@ -68,7 +68,7 @@ following from the top of a clean repository:

The `guix-codesign` command attaches codesignatures (produced by codesigners) to
existing non-codesigned outputs. Please see the [release process
documentation](/doc/release-process.md) for more context.
documentation](/doc/release-process.md#codesigning) for more context.

It respects many of the same environment variable flags as `guix-build`, with 2
crucial differences:
Expand Down
6 changes: 3 additions & 3 deletions contrib/tracing/log_raw_p2p_msgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@


def print_message(event, inbound):
print(f"%s %s msg '%s' from peer %d (%s, %s) with %d bytes: %s" %
(
f"Warning: incomplete message (only %d out of %d bytes)!" % (
print("{} {} msg '{}' from peer {} ({}, {}) with {} bytes: {}".format(

"Warning: incomplete message (only {} out of {} bytes)!".format(
len(event.msg), event.msg_size) if len(event.msg) < event.msg_size else "",
"inbound" if inbound else "outbound",
event.msg_type.decode("utf-8"),
Expand Down
9 changes: 9 additions & 0 deletions depends/toolchain.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,21 @@ set(DEPENDS_COMPILE_DEFINITIONS_DEBUG @CPPFLAGS_DEBUG@)
if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT)
set(CMAKE_EXE_LINKER_FLAGS_INIT "@LDFLAGS@")
endif()
if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_INIT)
set(CMAKE_SHARED_LINKER_FLAGS_INIT "@LDFLAGS@")
endif()
if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT)
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "@LDFLAGS_RELEASE@")
endif()
if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT)
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT "@LDFLAGS_RELEASE@")
endif()
if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT)
set(CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "@LDFLAGS_DEBUG@")
endif()
if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT)
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT "@LDFLAGS_DEBUG@")
endif()

set(CMAKE_AR "@AR@")
set(CMAKE_RANLIB "@RANLIB@")
Expand Down
2 changes: 1 addition & 1 deletion doc/fuzzing.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $ FUZZ=process_message build_fuzz/src/test/fuzz/fuzz
# abort fuzzing using ctrl-c
```

One can use `--prefix=libfuzzer-nosan` to do the same without common sanitizers enabled.
One can use `--preset=libfuzzer-nosan` to do the same without common sanitizers enabled.
See [further](#run-without-sanitizers-for-increased-throughput) for more information.

There is also a runner script to execute all fuzz targets. Refer to
Expand Down
2 changes: 1 addition & 1 deletion doc/policy/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ The following rules are only enforced for packages to be submitted to the mempoo
enforced for test accepts):

* Packages must be child-with-unconfirmed-parents packages. This also means packages must contain at
least 2 transactions. (#22674)
least 1 transaction. (#31096)

- *Rationale*: This allows for fee-bumping by CPFP. Allowing multiple parents makes it possible
to fee-bump a batch of transactions. Restricting packages to a defined topology is easier to
Expand Down
8 changes: 8 additions & 0 deletions doc/release-notes-31175.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
RPC
---

Duplicate blocks submitted with `submitblock` will now persist their block data
even if it was previously pruned. If pruning is activated, the data will be
pruned again eventually once the block file it is persisted in is selected for
pruning. This is consistent with the behaviour of `getblockfrompeer` where the
block is persisted as well even when pruning.
2 changes: 1 addition & 1 deletion doc/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ git -C ./guix.sigs pull
### Create the macOS SDK tarball (first time, or when SDK version changes)

Create the macOS SDK tarball, see the [macdeploy
instructions](/contrib/macdeploy/README.md#deterministic-macos-app-notes) for
instructions](/contrib/macdeploy/README.md#sdk-extraction) for
details.

### Build and attest to build outputs
Expand Down
7 changes: 5 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ if(DEFINED ENV{CFLAGS})
endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS OFF)
add_subdirectory(secp256k1)
set_target_properties(secp256k1 PROPERTIES
EXCLUDE_FROM_ALL TRUE
)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
string(APPEND CMAKE_C_COMPILE_OBJECT " ${APPEND_CPPFLAGS} ${APPEND_CFLAGS}")

Expand Down Expand Up @@ -307,8 +310,8 @@ target_link_libraries(bitcoin_node
minisketch
univalue
Boost::headers
libevent::core
libevent::extra
$<TARGET_NAME_IF_EXISTS:libevent::core>
$<TARGET_NAME_IF_EXISTS:libevent::extra>
$<TARGET_NAME_IF_EXISTS:libevent::pthreads>
$<TARGET_NAME_IF_EXISTS:USDT::headers>
)
Expand Down
6 changes: 3 additions & 3 deletions src/bench/checkqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ static void CCheckQueueSpeedPrevectorJob(benchmark::Bench& bench)
explicit PrevectorJob(FastRandomContext& insecure_rand){
p.resize(insecure_rand.randrange(PREVECTOR_SIZE*2));
}
bool operator()()
std::optional<int> operator()()
{
return true;
return std::nullopt;
}
};

Expand All @@ -62,7 +62,7 @@ static void CCheckQueueSpeedPrevectorJob(benchmark::Bench& bench)
}
// control waits for completion by RAII, but
// it is done explicitly here for clarity
control.Wait();
control.Complete();
});
}
BENCHMARK(CCheckQueueSpeedPrevectorJob, benchmark::PriorityLevel::HIGH);
21 changes: 0 additions & 21 deletions src/bitcoin-chainstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,27 +180,6 @@ int main(int argc, char* argv[])
break;
}

if (block.vtx.empty() || !block.vtx[0]->IsCoinBase()) {
std::cerr << "Block does not start with a coinbase" << std::endl;
break;
}

uint256 hash = block.GetHash();
{
LOCK(cs_main);
const CBlockIndex* pindex = chainman.m_blockman.LookupBlockIndex(hash);
if (pindex) {
if (pindex->IsValid(BLOCK_VALID_SCRIPTS)) {
std::cerr << "duplicate" << std::endl;
break;
}
if (pindex->nStatus & BLOCK_FAILED_MASK) {
std::cerr << "duplicate-invalid" << std::endl;
break;
}
}
}

{
LOCK(cs_main);
const CBlockIndex* pindex = chainman.m_blockman.LookupBlockIndex(block.hashPrevBlock);
Expand Down
8 changes: 4 additions & 4 deletions src/bitcoin-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static void SetupCliArgs(ArgsManager& argsman)

argsman.AddArg("-version", "Print version and exit", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-conf=<file>", strprintf("Specify configuration file. Relative paths will be prefixed by datadir location. (default: %s)", BITCOIN_CONF_FILENAME), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-datadir=<dir>", "Specify data directory", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-datadir=<dir>", "Specify data directory", ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_NEGATION, OptionsCategory::OPTIONS);
argsman.AddArg("-generate",
strprintf("Generate blocks, equivalent to RPC getnewaddress followed by RPC generatetoaddress. Optional positional integer "
"arguments are number of blocks to generate (default: %s) and maximum iterations to try (default: %s), equivalent to "
Expand All @@ -94,7 +94,7 @@ static void SetupCliArgs(ArgsManager& argsman)
argsman.AddArg("-netinfo", strprintf("Get network peer connection information from the remote server. An optional argument from 0 to %d can be passed for different peers listings (default: 0). If a non-zero value is passed, an additional \"outonly\" (or \"o\") argument can be passed to see outbound peers only. Pass \"help\" (or \"h\") for detailed help documentation.", NETINFO_MAX_LEVEL), ArgsManager::ALLOW_ANY, OptionsCategory::CLI_COMMANDS);

SetupChainParamsBaseOptions(argsman);
argsman.AddArg("-color=<when>", strprintf("Color setting for CLI output (default: %s). Valid values: always, auto (add color codes when standard output is connected to a terminal and OS is not WIN32), never.", DEFAULT_COLOR_SETTING), ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_NEGATION, OptionsCategory::OPTIONS);
argsman.AddArg("-color=<when>", strprintf("Color setting for CLI output (default: %s). Valid values: always, auto (add color codes when standard output is connected to a terminal and OS is not WIN32), never. Only applies to the output of -getinfo.", DEFAULT_COLOR_SETTING), ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_NEGATION, OptionsCategory::OPTIONS);
argsman.AddArg("-named", strprintf("Pass named instead of positional arguments (default: %s)", DEFAULT_NAMED), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-rpcclienttimeout=<n>", strprintf("Timeout in seconds during HTTP requests, or 0 for no timeout. (default: %d)", DEFAULT_HTTP_CLIENT_TIMEOUT), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-rpcconnect=<ip>", strprintf("Send commands to node running on <ip> (default: %s)", DEFAULT_RPCCONNECT), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
Expand Down Expand Up @@ -145,10 +145,10 @@ static int AppInitRPC(int argc, char* argv[])
tfm::format(std::cerr, "Error parsing command line arguments: %s\n", error);
return EXIT_FAILURE;
}
if (argc < 2 || HelpRequested(gArgs) || gArgs.IsArgSet("-version")) {
if (argc < 2 || HelpRequested(gArgs) || gArgs.GetBoolArg("-version", false)) {
std::string strUsage = CLIENT_NAME " RPC client version " + FormatFullVersion() + "\n";

if (gArgs.IsArgSet("-version")) {
if (gArgs.GetBoolArg("-version", false)) {
strUsage += FormatParagraph(LicenseInfo());
} else {
strUsage += "\n"
Expand Down
4 changes: 2 additions & 2 deletions src/bitcoin-tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ static int AppInitRawTx(int argc, char* argv[])

fCreateBlank = gArgs.GetBoolArg("-create", false);

if (argc < 2 || HelpRequested(gArgs) || gArgs.IsArgSet("-version")) {
if (argc < 2 || HelpRequested(gArgs) || gArgs.GetBoolArg("-version", false)) {
// First part of help message is specific to this utility
std::string strUsage = CLIENT_NAME " namecoin-tx utility version " + FormatFullVersion() + "\n";

if (gArgs.IsArgSet("-version")) {
if (gArgs.GetBoolArg("-version", false)) {
strUsage += FormatParagraph(LicenseInfo());
} else {
strUsage += "\n"
Expand Down
4 changes: 2 additions & 2 deletions src/bitcoin-util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ static int AppInitUtil(ArgsManager& args, int argc, char* argv[])
return EXIT_FAILURE;
}

if (HelpRequested(args) || args.IsArgSet("-version")) {
if (HelpRequested(args) || args.GetBoolArg("-version", false)) {
// First part of help message is specific to this utility
std::string strUsage = CLIENT_NAME " bitcoin-util utility version " + FormatFullVersion() + "\n";

if (args.IsArgSet("-version")) {
if (args.GetBoolArg("-version", false)) {
strUsage += FormatParagraph(LicenseInfo());
} else {
strUsage += "\n"
Expand Down
6 changes: 3 additions & 3 deletions src/bitcoin-wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static void SetupWalletToolArgs(ArgsManager& argsman)
SetupChainParamsBaseOptions(argsman);

argsman.AddArg("-version", "Print version and exit", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-datadir=<dir>", "Specify data directory", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-datadir=<dir>", "Specify data directory", ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_NEGATION, OptionsCategory::OPTIONS);
argsman.AddArg("-wallet=<wallet-name>", "Specify wallet name", ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::OPTIONS);
argsman.AddArg("-dumpfile=<file name>", "When used with 'dump', writes out the records to this file. When used with 'createfromdump', loads the records into a new wallet.", ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_NEGATION, OptionsCategory::OPTIONS);
argsman.AddArg("-debug=<category>", "Output debugging information (default: 0).", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
Expand All @@ -60,10 +60,10 @@ static std::optional<int> WalletAppInit(ArgsManager& args, int argc, char* argv[
return EXIT_FAILURE;
}
const bool missing_args{argc < 2};
if (missing_args || HelpRequested(args) || args.IsArgSet("-version")) {
if (missing_args || HelpRequested(args) || args.GetBoolArg("-version", false)) {
std::string strUsage = strprintf("%s namecoin-wallet utility version", CLIENT_NAME) + " " + FormatFullVersion() + "\n";

if (args.IsArgSet("-version")) {
if (args.GetBoolArg("-version", false)) {
strUsage += FormatParagraph(LicenseInfo());
} else {
strUsage += "\n"
Expand Down
4 changes: 2 additions & 2 deletions src/bitcoind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ static bool ParseArgs(NodeContext& node, int argc, char* argv[])
static bool ProcessInitCommands(ArgsManager& args)
{
// Process help and version before taking care about datadir
if (HelpRequested(args) || args.IsArgSet("-version")) {
if (HelpRequested(args) || args.GetBoolArg("-version", false)) {
std::string strUsage = CLIENT_NAME " daemon version " + FormatFullVersion() + "\n";

if (args.IsArgSet("-version")) {
if (args.GetBoolArg("-version", false)) {
strUsage += FormatParagraph(LicenseInfo());
} else {
strUsage += "\n"
Expand Down
Loading

0 comments on commit 6bdd907

Please sign in to comment.