Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport: trivial 2025 02 12 #6582

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
0be2932
Merge bitcoin/bitcoin#27009: validation: Skip VerifyDB checks of leve…
fanquake Feb 5, 2023
f2caccd
Merge bitcoin/bitcoin#27174: ci: bump lint task to bookworm for git v…
fanquake Feb 28, 2023
536a265
Merge bitcoin/bitcoin#27209: ci: Remove unused EXPECTED_TESTS_DURATIO…
glozow Mar 6, 2023
ba3aff7
Merge bitcoin-core/gui#729: test: Add missed header
hebasto May 17, 2023
1289d32
Merge bitcoin/bitcoin#27801: wallet: Add tracing for sqlite statements
fanquake Jun 5, 2023
15f8b74
Merge bitcoin/bitcoin#27779: guix: remove cURL from build env
fanquake Jun 6, 2023
a12ad80
Merge bitcoin/bitcoin#28325: test: wallet_backup.py, fix intermittent…
fanquake Aug 24, 2023
490b390
Merge bitcoin/bitcoin#28859: guix: update signapple (drop macho & alt…
fanquake Nov 15, 2023
34bbe69
Merge bitcoin/bitcoin#28965: guix: remove input labels
fanquake Nov 30, 2023
6235590
Merge bitcoin/bitcoin#29213: doc, test: test and explain service flag…
achow101 Jan 16, 2024
6506f52
Merge bitcoin/bitcoin#28833: wallet: refactor: remove unused `Signatu…
achow101 Feb 6, 2024
2ea479f
Merge bitcoin/bitcoin#29650: depends: drop 1 Qt determinism patch
fanquake Mar 15, 2024
a74b1e2
Merge bitcoin/bitcoin#30253: refactor: performance-for-range-copy in …
fanquake Jun 10, 2024
20bcee8
Merge bitcoin/bitcoin#30281: Update leveldb subtree to latest upstream
fanquake Jun 14, 2024
da11d29
Merge bitcoin/bitcoin#30282: Revert "contrib: macdeploy: monkey-patch…
fanquake Jun 18, 2024
c34e7ab
Merge bitcoin/bitcoin#30534: guix: move bison from global scope, to L…
fanquake Jul 29, 2024
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
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 @@ -44,7 +44,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
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
2 changes: 0 additions & 2 deletions depends/packages/qt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ $(package)_patches += no_warnings_for_symbols.patch
$(package)_patches += rcc_hardcode_timestamp.patch
$(package)_patches += duplicate_lcqpafonts.patch
$(package)_patches += guix_cross_lib_path.patch
$(package)_patches += fast_fixed_dtoa_no_optimize.patch
$(package)_patches += fix-macos-linker.patch
$(package)_patches += memory_resource.patch
$(package)_patches += clang_18_libpng.patch
Expand Down Expand Up @@ -255,7 +254,6 @@ 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 && \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

29650: incomplete (failed to drop $(package)_patches += fast_fixed_dtoa_no_optimize.patch line)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's so weird... Wonder why it didn't "conflict" / require manual intervention

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)/zlib-timebits64.patch && \
Expand Down
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
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
2 changes: 1 addition & 1 deletion src/psbt.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ struct PSBTInput

if (final_script_sig.empty()) {
// Write any partial signatures
for (auto sig_pair : partial_sigs) {
for (const auto& sig_pair : partial_sigs) {
SerializeToVector(s, CompactSizeWriter(PSBT_IN_PARTIAL_SIG), Span{sig_pair.second.first});
s << sig_pair.second.second;
}
Expand Down
2 changes: 2 additions & 0 deletions src/qt/test/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <qt/test/util.h>

#include <chrono>

#include <QApplication>
Expand Down
2 changes: 2 additions & 0 deletions src/qt/test/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include <chrono>

#include <qglobal.h>

QT_BEGIN_NAMESPACE
class QString;
QT_END_NAMESPACE
Expand Down
28 changes: 27 additions & 1 deletion src/test/addrman_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ BOOST_AUTO_TEST_CASE(load_addrman_corrupted)

BOOST_AUTO_TEST_CASE(addrman_update_address)
{
// Tests updating nTime via Connected() and nServices via SetServices()
// Tests updating nTime via Connected() and nServices via SetServices() and Add()
auto addrman = std::make_unique<AddrMan>(EMPTY_NETGROUPMAN, DETERMINISTIC, GetCheckRatio(m_node));
CNetAddr source{ResolveIP("252.2.2.2")};
CAddress addr{CAddress(ResolveService("250.1.1.1", 8333), NODE_NONE)};
Expand All @@ -1075,6 +1075,32 @@ BOOST_AUTO_TEST_CASE(addrman_update_address)
BOOST_CHECK_EQUAL(vAddr2.size(), 1U);
BOOST_CHECK(vAddr2.at(0).nTime >= start_time + 10000s);
BOOST_CHECK_EQUAL(vAddr2.at(0).nServices, NODE_NETWORK_LIMITED);

// Updating an existing addr through Add() (used in gossip relay) can add additional services but can't remove existing ones.
CAddress addr_v2{CAddress(ResolveService("250.1.1.1", 8333), NODE_P2P_V2)};
addr_v2.nTime = start_time;
BOOST_CHECK(!addrman->Add({addr_v2}, source));
std::vector<CAddress> vAddr3{addrman->GetAddr(/*max_addresses=*/0, /*max_pct=*/0, /*network=*/std::nullopt)};
BOOST_CHECK_EQUAL(vAddr3.size(), 1U);
BOOST_CHECK_EQUAL(vAddr3.at(0).nServices, NODE_P2P_V2 | NODE_NETWORK_LIMITED);

// SetServices() (used when we connected to them) overwrites existing service flags
addrman->SetServices(addr, NODE_NETWORK);
std::vector<CAddress> vAddr4{addrman->GetAddr(/*max_addresses=*/0, /*max_pct=*/0, /*network=*/std::nullopt)};
BOOST_CHECK_EQUAL(vAddr4.size(), 1U);
BOOST_CHECK_EQUAL(vAddr4.at(0).nServices, NODE_NETWORK);

// Promoting to Tried does not affect the service flags
BOOST_CHECK(addrman->Good(addr)); // addr has NODE_NONE
std::vector<CAddress> vAddr5{addrman->GetAddr(/*max_addresses=*/0, /*max_pct=*/0, /*network=*/std::nullopt)};
BOOST_CHECK_EQUAL(vAddr5.size(), 1U);
BOOST_CHECK_EQUAL(vAddr5.at(0).nServices, NODE_NETWORK);

// Adding service flags even works when the addr is in Tried
BOOST_CHECK(!addrman->Add({addr_v2}, source));
std::vector<CAddress> vAddr6{addrman->GetAddr(/*max_addresses=*/0, /*max_pct=*/0, /*network=*/std::nullopt)};
BOOST_CHECK_EQUAL(vAddr6.size(), 1U);
BOOST_CHECK_EQUAL(vAddr6.at(0).nServices, NODE_NETWORK | NODE_P2P_V2);
}

BOOST_AUTO_TEST_CASE(addrman_size)
Expand Down
Loading
Loading