Skip to content

Commit

Permalink
Merge commit 'refs/pull/6582/head' of https://github.com/dashpay/dash
Browse files Browse the repository at this point in the history
…into pr_6582
  • Loading branch information
UdjinM6 committed Feb 20, 2025
2 parents c72cbbf + 0fc6cdd commit 239be56
Show file tree
Hide file tree
Showing 21 changed files with 148 additions and 160 deletions.
4 changes: 2 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ compute_credits_template: &CREDITS_TEMPLATE


task:
name: 'lint [jammy]'
name: 'lint [bookworm]'
<< : *BASE_TEMPLATE
container:
image: ubuntu:jammy
image: debian:bookworm
cpu: 1
memory: 1G
# For faster CI feedback, immediately schedule the linters
Expand Down
1 change: 0 additions & 1 deletion ci/test/00_setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export RUN_SECURITY_TESTS=${RUN_SECURITY_TESTS:-false}
# might be slow or a reindex might be waiting on disk IO.
export TEST_RUNNER_TIMEOUT_FACTOR=${TEST_RUNNER_TIMEOUT_FACTOR:-4}
export RUN_FUZZ_TESTS=${RUN_FUZZ_TESTS:-false}
export EXPECTED_TESTS_DURATION_IN_SECONDS=${EXPECTED_TESTS_DURATION_IN_SECONDS:-1000}

export CONTAINER_NAME=${CONTAINER_NAME:-ci_unnamed}
export DOCKER_NAME_TAG=${DOCKER_NAME_TAG:-ubuntu:20.04}
Expand Down
12 changes: 9 additions & 3 deletions contrib/guix/libexec/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@ unset OBJCPLUS_INCLUDE_PATH

export C_INCLUDE_PATH="${NATIVE_GCC}/include"
export CPLUS_INCLUDE_PATH="${NATIVE_GCC}/include/c++:${NATIVE_GCC}/include"
export OBJC_INCLUDE_PATH="${NATIVE_GCC}/include"
export OBJCPLUS_INCLUDE_PATH="${NATIVE_GCC}/include/c++:${NATIVE_GCC}/include"

case "$HOST" in
*darwin*) export LIBRARY_PATH="${NATIVE_GCC}/lib" ;;
*darwin*) export LIBRARY_PATH="${NATIVE_GCC}/lib" ;; # Required for qt/qmake
*mingw*) export LIBRARY_PATH="${NATIVE_GCC}/lib" ;;
*)
NATIVE_GCC_STATIC="$(store_path gcc-toolchain static)"
Expand Down Expand Up @@ -182,6 +180,14 @@ make -C depends --jobs="$JOBS" HOST="$HOST" \
x86_64_linux_NM=x86_64-linux-gnu-gcc-nm \
x86_64_linux_STRIP=x86_64-linux-gnu-strip

case "$HOST" in
*darwin*)
# Unset now that Qt is built
unset C_INCLUDE_PATH
unset CPLUS_INCLUDE_PATH
unset LIBRARY_PATH
;;
esac

###########################
# Source Tarball Building #
Expand Down
102 changes: 23 additions & 79 deletions contrib/guix/manifest.scm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
(gnu packages commencement)
(gnu packages compression)
(gnu packages cross-base)
(gnu packages curl)
(gnu packages file)
(gnu packages gawk)
(gnu packages gcc)
Expand All @@ -20,7 +19,6 @@
((gnu packages python) #:select (python-minimal))
((gnu packages python-build) #:select (python-tomli))
((gnu packages python-crypto) #:select (python-asn1crypto))
((gnu packages python-xyz) #:select (python-altgraph))
((gnu packages tls) #:select (openssl))
((gnu packages version-control) #:select (git-minimal))
(guix build-system cmake)
Expand Down Expand Up @@ -83,11 +81,11 @@ FILE-NAME found in ./patches relative to the current file."
(build-system trivial-build-system)
(arguments '(#:builder (begin (mkdir %output) #t)))
(propagated-inputs
`(("binutils" ,xbinutils)
("libc" ,xlibc)
("libc:static" ,xlibc "static")
("gcc" ,xgcc)
("gcc-lib" ,xgcc "lib")))
(list xbinutils
xlibc
xgcc
`(,xlibc "static")
`(,xgcc "lib")))
(synopsis (string-append "Complete GCC tool chain for " target))
(description (string-append "This package provides a complete GCC tool
chain for " target " development."))
Expand Down Expand Up @@ -150,10 +148,10 @@ desirable for building Dash Core release binaries."
(build-system trivial-build-system)
(arguments '(#:builder (begin (mkdir %output) #t)))
(propagated-inputs
`(("binutils" ,xbinutils)
("libc" ,pthreads-xlibc)
("gcc" ,pthreads-xgcc)
("gcc-lib" ,pthreads-xgcc "lib")))
(list xbinutils
pthreads-xlibc
pthreads-xgcc
`(,pthreads-xgcc "lib")))
(synopsis (string-append "Complete GCC tool chain for " target))
(description (string-append "This package provides a complete GCC tool
chain for " target " development."))
Expand Down Expand Up @@ -218,11 +216,7 @@ and abstract ELF, PE and MachO formats.")
(base32
"1j47vwq4caxfv0xw68kw5yh00qcpbd56d7rq6c483ma3y7s96yyz"))))
(build-system cmake-build-system)
(inputs
`(("openssl", openssl)))
(arguments
'(#:configure-flags
(list "-DCMAKE_DISABLE_FIND_PACKAGE_CURL=TRUE")))
(inputs (list openssl))
(home-page "https://github.com/mtrojnar/osslsigncode")
(synopsis "Authenticode signing and timestamping tool")
(description "osslsigncode is a small tool that implements part of the
Expand Down Expand Up @@ -279,8 +273,7 @@ thus should be able to compile on most platforms where these exist.")
(files '("etc/ssl/certs/ca-certificates.crt")))))

(propagated-inputs
`(("python-asn1crypto" ,python-asn1crypto)
("openssl" ,openssl)))
(list python-asn1crypto openssl))
(arguments
`(#:phases
(modify-phases %standard-phases
Expand Down Expand Up @@ -318,7 +311,7 @@ thus should be able to compile on most platforms where these exist.")
(package (inherit python-oscrypto)
(name "python-oscryptotests")
(propagated-inputs
`(("python-oscrypto" ,python-oscrypto)))
(list python-oscrypto))
(arguments
`(#:tests? #f
#:phases
Expand All @@ -345,9 +338,9 @@ thus should be able to compile on most platforms where these exist.")
"1qw2k7xis53179lpqdqyylbcmp76lj7sagp883wmxg5i7chhc96k"))))
(build-system python-build-system)
(propagated-inputs
`(("python-asn1crypto" ,python-asn1crypto)
("python-oscrypto" ,python-oscrypto)
("python-oscryptotests", python-oscryptotests))) ;; certvalidator tests import oscryptotests
(list python-asn1crypto
python-oscrypto
python-oscryptotests)) ;; certvalidator tests import oscryptotests
(arguments
`(#:phases
(modify-phases %standard-phases
Expand Down Expand Up @@ -395,56 +388,8 @@ certificates or paths. Supports various options, including: validation at a
specific moment in time, whitelisting and revocation checks.")
(license license:expat))))

(define-public python-macholib
(package
(name "python-macholib")
(version "1.14")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/ronaldoussoren/macholib")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
"0aislnnfsza9wl4f0vp45ivzlc0pzhp9d4r08700slrypn5flg42"))))
(build-system python-build-system)
(propagated-inputs
`(("python-altgraph" ,python-altgraph)))
(arguments
'(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'disable-broken-tests
(lambda _
;; This test is broken as there is no keyboard interrupt.
(substitute* "macholib_tests/test_command_line.py"
(("^(.*)class TestCmdLine" line indent)
(string-append indent
"@unittest.skip(\"Disabled by Guix\")\n"
line)))
(substitute* "macholib_tests/test_dyld.py"
(("^(.*)def test_\\S+_find" line indent)
(string-append indent
"@unittest.skip(\"Disabled by Guix\")\n"
line))
(("^(.*)def testBasic" line indent)
(string-append indent
"@unittest.skip(\"Disabled by Guix\")\n"
line))
)
#t)))))
(home-page "https://github.com/ronaldoussoren/macholib")
(synopsis "Python library for analyzing and editing Mach-O headers")
(description "macholib is a Macho-O header analyzer and editor. It's
typically used as a dependency analysis tool, and also to rewrite dylib
references in Mach-O headers to be @executable_path relative. Though this tool
targets a platform specific file format, it is pure python code that is platform
and endian independent.")
(license license:expat)))

(define-public python-signapple
(let ((commit "7a96b4171a360abf0f0f56e499f8f9ed2116280d"))
(let ((commit "62155712e7417aba07565c9780a80e452823ae6a"))
(package
(name "python-signapple")
(version (git-version "0.1" "1" commit))
Expand All @@ -457,14 +402,13 @@ and endian independent.")
(file-name (git-file-name name commit))
(sha256
(base32
"0aa4k180jnpal15yhncnm3g3z9gzmi7qb25q5l0kaj444a1p2pm4"))))
"1nm6rm4h4m7kbq729si4cm8rzild62mk4ni8xr5zja7l33fhv3gb"))))
(build-system python-build-system)
(propagated-inputs
`(("python-asn1crypto" ,python-asn1crypto)
("python-oscrypto" ,python-oscrypto)
("python-certvalidator" ,python-certvalidator)
("python-elfesteem" ,python-elfesteem)
("python-macholib" ,python-macholib)))
(list python-asn1crypto
python-oscrypto
python-certvalidator
python-elfesteem))
;; There are no tests, but attempting to run python setup.py test leads to
;; problems, just disable the test
(arguments '(#:tests? #f))
Expand Down Expand Up @@ -584,7 +528,6 @@ inspecting signatures in Mach-O binaries.")
autoconf-2.71
automake
pkg-config
bison
;; Scripting
python-minimal ;; (3.10)
;; Git
Expand All @@ -599,7 +542,8 @@ inspecting signatures in Mach-O binaries.")
nss-certs
osslsigncode))
((string-contains target "-linux-")
(list (list gcc-toolchain-12 "static")
(list bison
(list gcc-toolchain-12 "static")
(make-bitcoin-cross-toolchain target)))
((string-contains target "darwin")
(list clang-toolchain-18
Expand Down
15 changes: 0 additions & 15 deletions contrib/macdeploy/gen-sdk
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,6 @@ import gzip
import os
import contextlib

# monkey-patch Python 3.8 and older to fix wrong TAR header handling
# see https://github.com/bitcoin/bitcoin/pull/24534
# and https://github.com/python/cpython/pull/18080 for more info
if sys.version_info < (3, 9):
_old_create_header = tarfile.TarInfo._create_header
def _create_header(info, format, encoding, errors):
buf = _old_create_header(info, format, encoding, errors)
# replace devmajor/devminor with binary zeroes
buf = buf[:329] + bytes(16) + buf[345:]
# recompute checksum
chksum = tarfile.calc_chksums(buf)[0]
buf = buf[:-364] + bytes("%06o\0" % chksum, "ascii") + buf[-357:]
return buf
tarfile.TarInfo._create_header = staticmethod(_create_header)

@contextlib.contextmanager
def cd(path):
"""Context manager that restores PWD even if an exception was raised."""
Expand Down
10 changes: 2 additions & 8 deletions depends/hosts/darwin.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,11 @@ darwin_STRIP=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-strip")
# Disable adhoc codesigning (for now) when using LLVM tooling, to avoid
# non-determinism issues with the Identifier field.

darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
-u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
-u LIBRARY_PATH \
$(clang_prog) --target=$(host) \
darwin_CC=$(clang_prog) --target=$(host) \
-isysroot$(OSX_SDK) -nostdlibinc \
-iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks

darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
-u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
-u LIBRARY_PATH \
$(clangxx_prog) --target=$(host) \
darwin_CXX=$(clangxx_prog) --target=$(host) \
-isysroot$(OSX_SDK) -nostdlibinc \
-iwithsysroot/usr/include/c++/v1 \
-iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks
Expand Down
3 changes: 2 additions & 1 deletion depends/packages/qt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ $(package)_patches += memory_resource.patch
$(package)_patches += clang_18_libpng.patch
$(package)_patches += utc_from_string_no_optimize.patch
$(package)_patches += windows_lto.patch
$(package)_patches += darwin_no_libm.patch
$(package)_patches += zlib-timebits64.patch

$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
Expand Down Expand Up @@ -255,9 +256,9 @@ define $(package)_preprocess_cmds
patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \
patch -p1 -i $($(package)_patch_dir)/duplicate_lcqpafonts.patch && \
patch -p1 -i $($(package)_patch_dir)/utc_from_string_no_optimize.patch && \
patch -p1 -i $($(package)_patch_dir)/fast_fixed_dtoa_no_optimize.patch && \
patch -p1 -i $($(package)_patch_dir)/guix_cross_lib_path.patch && \
patch -p1 -i $($(package)_patch_dir)/windows_lto.patch && \
patch -p1 -i $($(package)_patch_dir)/darwin_no_libm.patch && \
patch -p1 -i $($(package)_patch_dir)/zlib-timebits64.patch && \
mkdir -p qtbase/mkspecs/macx-clang-linux &&\
cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
Expand Down
17 changes: 17 additions & 0 deletions depends/patches/qt/darwin_no_libm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
build: remove explicit -lm link from qttools

This causes issues with at least the macOS cross build, and shouldn't
actually be required anywhere else. GCC with libstdc++ will already get libm.

--- a/qtbase/src/corelib/tools/tools.pri
+++ b/qtbase/src/corelib/tools/tools.pri
@@ -111,9 +111,6 @@ qtConfig(easingcurve) {
tools/qtimeline.cpp
}

-# Note: libm should be present by default becaue this is C++
-unix:!macx-icc:!vxworks:!haiku:!integrity:!wasm: LIBS_PRIVATE += -lm
-
TR_EXCLUDE += ../3rdparty/*

# MIPS DSP
20 changes: 0 additions & 20 deletions depends/patches/qt/fast_fixed_dtoa_no_optimize.patch

This file was deleted.

5 changes: 4 additions & 1 deletion src/addrman.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,16 @@ class AddrMan

/**
* Attempt to add one or more addresses to addrman's new table.
* If an address already exists in addrman, the existing entry may be updated
* (e.g. adding additional service flags). If the existing entry is in the new table,
* it may be added to more buckets, improving the probability of selection.
*
* @param[in] vAddr Address records to attempt to add.
* @param[in] source The address of the node that sent us these addr records.
* @param[in] time_penalty A "time penalty" to apply to the address record's nTime. If a peer
* sends us an address record with nTime=n, then we'll add it to our
* addrman with nTime=(n - time_penalty).
* @return true if at least one address is successfully added. */
* @return true if at least one address is successfully added, or added to an additional bucket. Unaffected by updates. */
bool Add(const std::vector<CAddress>& vAddr, const CNetAddr& source, std::chrono::seconds time_penalty = 0s);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/init/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void AddLoggingArgs(ArgsManager& argsman)
ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-debugexclude=<category>", "Exclude debug and trace logging for a category. Can be used in conjunction with -debug=1 to output debug and trace logging for all categories except the specified category. This option can be specified multiple times to exclude multiple categories.", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-logips", strprintf("Include IP addresses in debug output (default: %u)", DEFAULT_LOGIPS), ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-loglevel=<level>|<category>:<level>", strprintf("Set the global or per-category severity level for logging categories enabled with the -debug configuration option or the logging RPC: %s (default=%s); warning and error levels are always logged. If <category>:<level> is supplied, the setting will override the global one and may be specified multiple times to set multiple category-specific levels. <category> can be: %s.", LogInstance().LogLevelsString(), LogInstance().LogLevelToStr(BCLog::DEFAULT_LOG_LEVEL), LogInstance().LogCategoriesString()), ArgsManager::DISALLOW_NEGATION | ArgsManager::DISALLOW_ELISION | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-loglevel=<level>|<category>:<level>", strprintf("Set the global or per-category severity level for logging categories enabled with the -debug configuration option or the logging RPC. Possible values are %s (default=%s). The following levels are always logged: error, warning, info. If <category>:<level> is supplied, the setting will override the global one and may be specified multiple times to set multiple category-specific levels. <category> can be: %s.", LogInstance().LogLevelsString(), LogInstance().LogLevelToStr(BCLog::DEFAULT_LOG_LEVEL), LogInstance().LogCategoriesString()), ArgsManager::DISALLOW_NEGATION | ArgsManager::DISALLOW_ELISION | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-logtimestamps", strprintf("Prepend debug output with timestamp (default: %u)", DEFAULT_LOGTIMESTAMPS), ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
#ifdef HAVE_THREAD_LOCAL
argsman.AddArg("-logthreadnames", strprintf("Prepend debug output with name of the originating thread (only available on platforms supporting thread_local) (default: %u)", DEFAULT_LOGTHREADNAMES), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
Expand Down
4 changes: 4 additions & 0 deletions src/leveldb/include/leveldb/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ class LEVELDB_EXPORT Status {
inline Status::Status(const Status& rhs) {
state_ = (rhs.state_ == nullptr) ? nullptr : CopyState(rhs.state_);
}

// NOLINTBEGIN(bugprone-unhandled-self-assignment)
inline Status& Status::operator=(const Status& rhs) {
// The following condition catches both aliasing (when this == &rhs),
// and the common case where both rhs and *this are ok.
Expand All @@ -112,6 +114,8 @@ inline Status& Status::operator=(const Status& rhs) {
}
return *this;
}
// NOLINTEND(bugprone-unhandled-self-assignment)

inline Status& Status::operator=(Status&& rhs) noexcept {
std::swap(state_, rhs.state_);
return *this;
Expand Down
3 changes: 3 additions & 0 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3546,6 +3546,9 @@ void PeerManagerImpl::ProcessMessage(
vRecv >> addrMe;
if (!pfrom.IsInboundConn())
{
// Overwrites potentially existing services. In contrast to this,
// unvalidated services received via gossip relay in ADDR/ADDRV2
// messages are only ever added but cannot replace existing ones.
m_addrman.SetServices(pfrom.addr, nServices);
}
if (pfrom.ExpectServicesFromConn() && !HasAllDesirableServiceFlags(nServices))
Expand Down
Loading

0 comments on commit 239be56

Please sign in to comment.