diff --git a/.github/workflows/guix-build.yml b/.github/workflows/guix-build.yml index 680ed9647b9e..ca50fe24ec34 100644 --- a/.github/workflows/guix-build.yml +++ b/.github/workflows/guix-build.yml @@ -114,15 +114,14 @@ jobs: restore-keys: | depends-sources- - - name: Cache Guix and depends + - name: Restore Guix and depends cache id: guix-cache-restore if: github.ref_type != 'tag' - uses: actions/cache@v5 + uses: actions/cache/restore@v5 with: path: | ${{ github.workspace }}/.cache ${{ github.workspace }}/dash/depends/built - ${{ github.workspace }}/dash/depends/work /gnu/store key: ${{ runner.os }}-guix-${{ matrix.build_target }}-${{ github.sha }} restore-keys: | @@ -154,6 +153,16 @@ jobs: exit 1 fi + - name: Save Guix and depends cache + if: github.ref_type != 'tag' && github.event_name != 'pull_request_target' + uses: actions/cache/save@v5 + with: + path: | + ${{ github.workspace }}/.cache + ${{ github.workspace }}/dash/depends/built + /gnu/store + key: ${{ runner.os }}-guix-${{ matrix.build_target }}-${{ github.sha }} + - name: Compute SHA256 checksums continue-on-error: true # It will complain on depending on only some hosts env: diff --git a/.github/workflows/test-src.yml b/.github/workflows/test-src.yml index d6d9b7efe58f..3b25c11a3ef8 100644 --- a/.github/workflows/test-src.yml +++ b/.github/workflows/test-src.yml @@ -41,7 +41,8 @@ jobs: image: ${{ inputs.container-path }} # zizmor: ignore[unpinned-images] built earlier in this run by build-container.yml # SYS_PTRACE is required by LeakSanitizer's stop-the-world # (https://github.com/google/sanitizers/issues/764) - options: --user root --cap-add SYS_PTRACE + # LINUX_IMMUTABLE lets feature_reindex_readonly.py run chattr +i + options: --user root --cap-add LINUX_IMMUTABLE --cap-add SYS_PTRACE steps: - name: Checkout code uses: actions/checkout@v6 diff --git a/ci/dash/test_integrationtests.sh b/ci/dash/test_integrationtests.sh index 9cf3a8e08597..8ef49be1f600 100755 --- a/ci/dash/test_integrationtests.sh +++ b/ci/dash/test_integrationtests.sh @@ -18,6 +18,8 @@ if [ "$RUN_FUNCTIONAL_TESTS" != "true" ]; then exit 0 fi +echo "System info: $(uname --kernel-name --kernel-release)" + if [ -z "$NO_DEPENDS" ]; then export LD_LIBRARY_PATH=$DEPENDS_DIR/$HOST/lib fi diff --git a/ci/dash/test_unittests.sh b/ci/dash/test_unittests.sh index 0c33ebbd8655..549917f3f304 100755 --- a/ci/dash/test_unittests.sh +++ b/ci/dash/test_unittests.sh @@ -16,6 +16,8 @@ if [ "$RUN_UNIT_TESTS" != "true" ] && [ "$RUN_UNIT_TESTS_SEQUENTIAL" != "true" ] exit 0 fi +echo "System info: $(uname --kernel-name --kernel-release)" + export BOOST_TEST_RANDOM="${BOOST_TEST_RANDOM:-1}" if [ -z "$NO_DEPENDS" ]; then export LD_LIBRARY_PATH="$DEPENDS_DIR/$HOST/lib" diff --git a/ci/test/00_setup_env_aarch64.sh b/ci/test/00_setup_env_aarch64.sh index 40906d17e471..5666bb6815bc 100755 --- a/ci/test/00_setup_env_aarch64.sh +++ b/ci/test/00_setup_env_aarch64.sh @@ -7,17 +7,9 @@ export LC_ALL=C.UTF-8 export HOST=aarch64-linux-gnu -# The host arch is unknown, so we run the tests through qemu. -# If the host is arm64 and wants to run the tests natively, it can set QEMU_USER_CMD to the empty string. -if [ -z ${QEMU_USER_CMD+x} ]; then export QEMU_USER_CMD="${QEMU_USER_CMD:-"qemu-aarch64 -L /usr/aarch64-linux-gnu/"}"; fi export DPKG_ADD_ARCH="arm64" export PACKAGES="python3-zmq g++-11-aarch64-linux-gnu busybox libc6:arm64 libstdc++6:arm64 libfontconfig1:arm64 libxcb1:arm64" -if [ -n "$QEMU_USER_CMD" ]; then - # Likely cross-compiling, so install the needed gcc and qemu-user - export PACKAGES="$PACKAGES qemu-user" -fi export CONTAINER_NAME=ci_aarch64_linux -# Use debian to avoid 404 apt errors when cross compiling export CHECK_DOC=0 export USE_BUSY_BOX=true export RUN_UNIT_TESTS=false diff --git a/ci/test/00_setup_env_s390x.sh b/ci/test/00_setup_env_s390x.sh index 6f6b0f6c14d1..60558b2b7a48 100755 --- a/ci/test/00_setup_env_s390x.sh +++ b/ci/test/00_setup_env_s390x.sh @@ -7,16 +7,7 @@ export LC_ALL=C.UTF-8 export HOST=s390x-linux-gnu -# The host arch is unknown, so we run the tests through qemu. -# If the host is s390x and wants to run the tests natively, it can set QEMU_USER_CMD to the empty string. -if [ -z ${QEMU_USER_CMD+x} ]; then export QEMU_USER_CMD="${QEMU_USER_CMD:-"qemu-s390x"}"; fi export PACKAGES="python3-zmq" -if [ -n "$QEMU_USER_CMD" ]; then - # Likely cross-compiling, so install the needed gcc and qemu-user - export DPKG_ADD_ARCH="s390x" - export PACKAGES="$PACKAGES g++-s390x-linux-gnu qemu-user libc6:s390x libstdc++6:s390x" -fi -# Use debian to avoid 404 apt errors export CONTAINER_NAME=ci_s390x export RUN_UNIT_TESTS=true export TEST_RUNNER_EXTRA="--exclude feature_init,rpc_bind,feature_bind_extra" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547 diff --git a/contrib/containers/ci/ci-slim.Dockerfile b/contrib/containers/ci/ci-slim.Dockerfile index a4aa61b90d12..43ccd5405a91 100644 --- a/contrib/containers/ci/ci-slim.Dockerfile +++ b/contrib/containers/ci/ci-slim.Dockerfile @@ -40,6 +40,7 @@ RUN set -ex; \ build-essential \ ca-certificates \ curl \ + e2fsprogs \ g++ \ git \ jq \ diff --git a/contrib/containers/guix/scripts/setup-sdk b/contrib/containers/guix/scripts/setup-sdk index 1dd8e6dc4597..ed90c9a4206b 100755 --- a/contrib/containers/guix/scripts/setup-sdk +++ b/contrib/containers/guix/scripts/setup-sdk @@ -20,7 +20,7 @@ if [ ! -d "${SDK_PATH}/${XCODE_ARCHIVE}" ]; then if [ ! -f "${XCODE_AR_PATH}" ]; then echo "Downloading macOS SDK..." mkdir -p "${SDK_SOURCES}" - curl --location --fail "${SDK_URL}/${XCODE_ARCHIVE}.tar" -o "${XCODE_AR_PATH}" + curl --location --fail --retry 3 "${SDK_URL}/${XCODE_ARCHIVE}.tar" -o "${XCODE_AR_PATH}" fi echo "Verifying macOS SDK..." if [ "$(sha256sum "${XCODE_AR_PATH}" | cut -d' ' -f1)" != "${XCODE_AR_HASH}" ]; then diff --git a/doc/developer-notes.md b/doc/developer-notes.md index 56511991ff7e..853b2fd44403 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -659,8 +659,9 @@ Threads : Started from `main()` in `bitcoind.cpp`. Responsible for starting up and shutting down the application. -- [ThreadImport (`d-loadblk`)](https://doxygen.bitcoincore.org/namespacenode.html#ab4305679079866f0f420f7dbf278381d) - : Loads blocks from `blk*.dat` files or `-loadblock=` on startup. +- [Init load (`d-initload`)](https://doxygen.bitcoincore.org/namespacenode.html#ab4305679079866f0f420f7dbf278381d) + : Performs various loading tasks that are part of init but shouldn't block the node from being started: external block import, + reindex, reindex-chainstate, main chain activation, spawn indexes background sync threads and mempool load. - [CCheckQueue::Loop (`d-scriptch.x`)](https://doxygen.bitcoincore.org/class_c_check_queue.html#a6e7fa51d3a25e7cb65446d4b50e6a987) : Parallel script validation threads for transactions in blocks. diff --git a/doc/release-notes-27609.md b/doc/release-notes-27609.md new file mode 100644 index 000000000000..a69bcaffaaa5 --- /dev/null +++ b/doc/release-notes-27609.md @@ -0,0 +1,13 @@ +- A new RPC, `submitpackage`, has been added. It can be used to submit a list of raw hex + transactions to the mempool to be evaluated as a package using consensus and mempool policy rules. +These policies include package CPFP, allowing a child with high fees to bump a parent below the +mempool minimum feerate (but not minimum relay feerate). + + - Warning: successful submission does not mean the transactions will propagate throughout the + network, as package relay is not supported. + + - Not all features are available. The package is limited to a child with all of its + unconfirmed parents, and no parent may spend the output of another parent. Refer to + doc/policy/packages.md for more details on package policies and limitations. + + - This RPC is experimental. Its interface may change. diff --git a/src/Makefile.am b/src/Makefile.am index 7069ea92ed85..237ef3ebdcc5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -162,6 +162,7 @@ BITCOIN_CORE_H = \ active/dkgsession.h \ active/dkgsessionhandler.h \ active/masternode.h \ + addresstype.h \ addrdb.h \ addrman.h \ addrman_impl.h \ @@ -300,6 +301,7 @@ BITCOIN_CORE_H = \ kernel/mempool_options.h \ kernel/mempool_persist.h \ kernel/mempool_removal_reason.h \ + kernel/messagestartchars.h \ kernel/notifications_interface.h \ kernel/validation_cache_sizes.h \ key.h \ @@ -351,6 +353,7 @@ BITCOIN_CORE_H = \ netfulfilledman.h \ netgroup.h \ netmessagemaker.h \ + node/abort.h \ node/blockmanager_args.h \ node/blockstorage.h \ node/caches.h \ @@ -409,7 +412,7 @@ BITCOIN_CORE_H = \ script/sigcache.h \ script/sign.h \ script/signingprovider.h \ - script/standard.h \ + script/solver.h \ shutdown.h \ source_location.h \ spork.h \ @@ -465,6 +468,7 @@ BITCOIN_CORE_H = \ util/readwritefile.h \ util/result.h \ util/serfloat.h \ + util/signalinterrupt.h \ util/sock.h \ util/spanparsing.h \ util/std23.h \ @@ -639,6 +643,7 @@ libbitcoin_node_a_SOURCES = \ net_processing.cpp \ netfulfilledman.cpp \ netgroup.cpp \ + node/abort.cpp \ node/blockmanager_args.cpp \ node/blockstorage.cpp \ node/caches.cpp \ @@ -994,6 +999,7 @@ libbitcoin_consensus_a_SOURCES = \ libbitcoin_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS) libbitcoin_common_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) libbitcoin_common_a_SOURCES = \ + addresstype.cpp \ base58.cpp \ bech32.cpp \ chainparams.cpp \ @@ -1041,7 +1047,7 @@ libbitcoin_common_a_SOURCES = \ script/miniscript.cpp \ script/sign.cpp \ script/signingprovider.cpp \ - script/standard.cpp \ + script/solver.cpp \ warnings.cpp \ $(BITCOIN_CORE_H) # @@ -1085,6 +1091,7 @@ libbitcoin_util_a_SOURCES = \ util/moneystr.cpp \ util/ranges_set.cpp \ util/readwritefile.cpp \ + util/signalinterrupt.cpp \ util/serfloat.cpp \ util/sock.cpp \ util/spanparsing.cpp \ @@ -1349,6 +1356,7 @@ libdashkernel_la_SOURCES = \ messagesigner.cpp \ netaddress.cpp \ netbase.cpp \ + node/abort.cpp \ node/blockstorage.cpp \ node/chainstate.cpp \ node/interface_ui.cpp \ @@ -1371,7 +1379,7 @@ libdashkernel_la_SOURCES = \ script/script.cpp \ script/script_error.cpp \ script/sigcache.cpp \ - script/standard.cpp \ + script/solver.cpp \ shutdown.cpp \ spork.cpp \ streams.cpp \ @@ -1394,6 +1402,7 @@ libdashkernel_la_SOURCES = \ util/moneystr.cpp \ util/ranges_set.cpp \ util/serfloat.cpp \ + util/signalinterrupt.cpp \ util/sock.cpp \ util/strencodings.cpp \ util/string.cpp \ diff --git a/src/Makefile.test.include b/src/Makefile.test.include index db6502775cf5..0ee6b75e336b 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -366,6 +366,7 @@ test_fuzz_fuzz_SOURCES = \ test/fuzz/netbase_dns_lookup.cpp \ test/fuzz/node_eviction.cpp \ test/fuzz/p2p_transport_serialization.cpp \ + test/fuzz/package_eval.cpp \ test/fuzz/parse_hd_keypath.cpp \ test/fuzz/parse_numbers.cpp \ test/fuzz/parse_script.cpp \ diff --git a/src/addrdb.cpp b/src/addrdb.cpp index a1a536ea2b4f..8bafa5763c89 100644 --- a/src/addrdb.cpp +++ b/src/addrdb.cpp @@ -98,10 +98,10 @@ void DeserializeDB(Stream& stream, Data&& data, bool fCheckSum = true) { HashVerifier verifier{stream}; // de-serialize file header (network specific magic number) and .. - unsigned char pchMsgTmp[4]; + MessageStartChars pchMsgTmp; verifier >> pchMsgTmp; // ... verify the network matches ours - if (memcmp(pchMsgTmp, Params().MessageStart(), sizeof(pchMsgTmp))) { + if (pchMsgTmp != Params().MessageStart()) { throw std::runtime_error{"Invalid network magic number"}; } diff --git a/src/addresstype.cpp b/src/addresstype.cpp new file mode 100644 index 000000000000..f05018d867c9 --- /dev/null +++ b/src/addresstype.cpp @@ -0,0 +1,109 @@ +// Copyright (c) 2023 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or https://www.opensource.org/licenses/mit-license.php. + +#include + +#include +#include +#include