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 2024 10 25 pr1 #6362

Merged
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3070c3e
Merge bitcoin/bitcoin#30078: depends: set AR & RANLIB for CMake
fanquake May 14, 2024
3be0d3e
Merge bitcoin/bitcoin#30097: crypto: disable asan for sha256_sse4 wit…
fanquake May 16, 2024
63e139d
Merge bitcoin/bitcoin#30185: guix: show `*_FLAGS` variables in pre-bu…
fanquake Jun 5, 2024
ca83773
Merge bitcoin/bitcoin#30283: upnp: fix build with miniupnpc 2.2.8
fanquake Jun 19, 2024
479cb8b
Merge bitcoin/bitcoin#30312: contrib: add R(UN)PATH check to ELF symb…
fanquake Jun 26, 2024
9793fb1
Merge bitcoin/bitcoin#30340: test: Added coverage to Block not found …
achow101 Jul 2, 2024
ebed8af
Merge bitcoin/bitcoin#30336: depends: update doc in Qt pwd patch
fanquake Jul 12, 2024
69c04b2
Merge bitcoin/bitcoin#30372: util: Use SteadyClock in RandAddSeedPerfmon
fanquake Jul 12, 2024
4e144be
Merge bitcoin-core/gui#795: Keep focus on "Hide" while ModalOverlay i…
hebasto Jul 15, 2024
745addf
Merge bitcoin/bitcoin#30245: net: Allow -proxy=[::1] on nodes with IP…
achow101 Jul 18, 2024
62dcd43
Merge bitcoin/bitcoin#29880: depends: build FreeType with CMake
fanquake Jul 19, 2024
e016ffa
Merge bitcoin/bitcoin#29878: depends: build expat with CMake
fanquake Jul 24, 2024
57945ce
Merge bitcoin/bitcoin#30506: depends: Cleanup postprocess commands af…
fanquake Jul 25, 2024
df3c239
Merge bitcoin/bitcoin#26950: cleanse: switch to SecureZeroMemory for …
fanquake Jul 26, 2024
e4e5605
Merge bitcoin/bitcoin#30552: test: fix constructor of msg_tx
fanquake Jul 31, 2024
ddaec96
Merge bitcoin/bitcoin#30565: depends: Fix `zeromq` build on OpenBSD
fanquake Aug 1, 2024
f66547f
Merge bitcoin/bitcoin#30588: depends: fix ZMQ CMake getcachesize check
fanquake Aug 6, 2024
8a12237
Merge bitcoin/bitcoin#30630: doc: Update ccache website link
fanquake Aug 12, 2024
1bd090e
Merge bitcoin/bitcoin#30597: doc: Drop no longer needed workaround fo…
fanquake Aug 12, 2024
432f352
Merge bitcoin/bitcoin#30580: doc: Add note about distro's `g++-mingw-…
fanquake Aug 12, 2024
01b570e
Merge bitcoin/bitcoin#29999: guix: fix suggested fake date for openss…
achow101 Aug 12, 2024
745a819
Merge bitcoin/bitcoin#30690: devtools, utxo-snapshot: Fix block heigh…
achow101 Aug 26, 2024
b654479
Merge bitcoin/bitcoin#30705: test: Avoid intermittent block download …
fanquake Aug 27, 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
6 changes: 6 additions & 0 deletions contrib/devtools/symbol-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ def check_exported_symbols(binary) -> bool:
ok = False
return ok

def check_RUNPATH(binary) -> bool:
assert binary.get(lief.ELF.DYNAMIC_TAGS.RUNPATH) is None
assert binary.get(lief.ELF.DYNAMIC_TAGS.RPATH) is None
return True

def check_ELF_libraries(binary) -> bool:
ok: bool = True
for library in binary.libraries:
Expand Down Expand Up @@ -280,6 +285,7 @@ def check_ELF_ABI(binary) -> bool:
('LIBRARY_DEPENDENCIES', check_ELF_libraries),
('INTERPRETER_NAME', check_ELF_interpreter),
('ABI', check_ELF_ABI),
('RUNPATH', check_RUNPATH),
],
lief.EXE_FORMATS.MACHO: [
('DYNAMIC_LIBRARIES', check_MACHO_libraries),
Expand Down
4 changes: 4 additions & 0 deletions contrib/guix/guix-build
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,10 @@ INFO: Building ${VERSION:?not set} for platform triple ${HOST:?not set}:
...bind-mounted in container to: '$(DISTSRC_BASE=/distsrc-base && distsrc_for_host "$HOST")'
...outputting in: '$(outdir_for_host "$HOST")'
...bind-mounted in container to: '$(OUTDIR_BASE=/outdir-base && outdir_for_host "$HOST")'
ADDITIONAL FLAGS (if set)
ADDITIONAL_GUIX_COMMON_FLAGS: ${ADDITIONAL_GUIX_COMMON_FLAGS}
ADDITIONAL_GUIX_ENVIRONMENT_FLAGS: ${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS}
ADDITIONAL_GUIX_TIMEMACHINE_FLAGS: ${ADDITIONAL_GUIX_TIMEMACHINE_FLAGS}
EOF

# Run the build script 'contrib/guix/libexec/build.sh' in the build
Expand Down
3 changes: 3 additions & 0 deletions depends/funcs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ $(1)_cmake=env CC="$$($(1)_cc)" \
CXXFLAGS="$$($(1)_cppflags) $$($(1)_cxxflags)" \
LDFLAGS="$$($(1)_ldflags)" \
cmake -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)" \
-DCMAKE_AR=`which $$($(1)_ar)` \
-DCMAKE_NM=`which $$($(1)_nm)` \
-DCMAKE_RANLIB=`which $$($(1)_ranlib)` \
-DCMAKE_INSTALL_LIBDIR=lib/ \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
$$($(1)_config_opts)
Expand Down
14 changes: 7 additions & 7 deletions depends/patches/qt/dont_hardcode_pwd.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
commit 0e953866fc4672486e29e1ba6d83b4207e7b2f0b
Author: fanquake <[email protected]>
Date: Tue Aug 18 15:09:06 2020 +0800
Do not assume FHS in scripts

Don't hardcode pwd path
On systems that do not follow the Filesystem Hierarchy Standard, such as
guix, the hardcoded `/bin/pwd` will fail to be found so that the script
will fail.

Let a man use his builtins if he wants to! Also, removes the unnecessary
assumption that pwd lives under /bin/pwd.
Use `pwd`, instead, so that the command can be found through the normal
path search mechanism.

See #15581.
See https://github.com/qt/qtbase/commit/3388de698bfb9bbc456c08f03e83bf3e749df35c.

diff --git a/qtbase/configure b/qtbase/configure
index 08b49a8d..faea5b55 100755
Expand Down
7 changes: 7 additions & 0 deletions src/crypto/sha256_sse4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
namespace sha256_sse4
{
void Transform(uint32_t* s, const unsigned char* chunk, size_t blocks)
#if defined(__clang__) && !defined(__OPTIMIZE__)
/*
clang is unable to compile this with -O0 and -fsanitize=address.
See upstream bug: https://github.com/llvm/llvm-project/issues/92182
*/
__attribute__((no_sanitize("address")))
#endif
{
static const uint32_t K256 alignas(16) [] = {
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
Expand Down
5 changes: 4 additions & 1 deletion src/mapport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,11 @@ static bool ProcessUpnp()
struct UPNPUrls urls;
struct IGDdatas data;
int r;

#if MINIUPNPC_API_VERSION <= 17
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
#else
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr), nullptr, 0);
#endif
if (r == 1)
{
if (fDiscover) {
Expand Down
13 changes: 12 additions & 1 deletion src/netbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ std::vector<CNetAddr> WrappedGetAddrInfo(const std::string& name, bool allow_loo
ai_hint.ai_protocol = IPPROTO_TCP;
// We don't care which address family (IPv4 or IPv6) is returned
ai_hint.ai_family = AF_UNSPEC;

// If we allow lookups of hostnames, use the AI_ADDRCONFIG flag to only
// return addresses whose family we have an address configured for.
//
Expand All @@ -58,7 +59,17 @@ std::vector<CNetAddr> WrappedGetAddrInfo(const std::string& name, bool allow_loo
addrinfo* ai_res{nullptr};
const int n_err{getaddrinfo(name.c_str(), nullptr, &ai_hint, &ai_res)};
if (n_err != 0) {
return {};
if ((ai_hint.ai_flags & AI_ADDRCONFIG) == AI_ADDRCONFIG) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

looks like this can fix our IPv6 on CI: #6038

I will test it

Copy link
Collaborator

Choose a reason for hiding this comment

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

// AI_ADDRCONFIG on some systems may exclude loopback-only addresses
// If first lookup failed we perform a second lookup without AI_ADDRCONFIG
ai_hint.ai_flags = (ai_hint.ai_flags & ~AI_ADDRCONFIG);
const int n_err_retry{getaddrinfo(name.c_str(), nullptr, &ai_hint, &ai_res)};
if (n_err_retry != 0) {
return {};
}
} else {
return {};
}
}

// Traverse the linked list starting with ai_trav.
Expand Down
10 changes: 10 additions & 0 deletions src/qt/modaloverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ foreverHidden(false)
parent->installEventFilter(this);
raise();
}
ui->closeButton->installEventFilter(this);

blockProcessTime.clear();
setVisible(false);
Expand Down Expand Up @@ -75,6 +76,11 @@ bool ModalOverlay::eventFilter(QObject * obj, QEvent * ev) {
raise();
}
}

if (obj == ui->closeButton && ev->type() == QEvent::FocusOut && layerIsVisible) {
ui->closeButton->setFocus(Qt::OtherFocusReason);
}

return QWidget::eventFilter(obj, ev);
}

Expand Down Expand Up @@ -195,6 +201,10 @@ void ModalOverlay::showHide(bool hide, bool userRequested)
m_animation.setEndValue(QPoint(0, hide ? height() : 0));
m_animation.start(QAbstractAnimation::KeepWhenStopped);
layerIsVisible = !hide;

if (layerIsVisible) {
ui->closeButton->setFocus(Qt::OtherFocusReason);
}
}

void ModalOverlay::closeClicked()
Expand Down
6 changes: 3 additions & 3 deletions src/randomenv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ void RandAddSeedPerfmon(CSHA512& hasher)

// This can take up to 2 seconds, so only do it every 10 minutes.
// Initialize last_perfmon to 0 seconds, we don't skip the first call.
static std::atomic<std::chrono::seconds> last_perfmon{0s};
static std::atomic<SteadyClock::time_point> last_perfmon{SteadyClock::time_point{0s}};
auto last_time = last_perfmon.load();
auto current_time = GetTime<std::chrono::seconds>();
if (current_time < last_time + std::chrono::minutes{10}) return;
auto current_time = SteadyClock::now();
if (current_time < last_time + 10min) return;
last_perfmon = current_time;

std::vector<unsigned char> vData(250000, 0);
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_coinstatsindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ def _test_coin_stats_index(self):
)
self.restart_node(1, extra_args=["-coinstatsindex"])

self.log.info("Test obtaining info for a non-existent block hash")
assert_raises_rpc_error(-5, "Block not found", index_node.gettxoutsetinfo, hash_type="none", hash_or_height="ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", use_index=True)

def _test_use_index_option(self):
self.log.info("Test use_index option for nodes running the index")

Expand Down