Compare commits

...

5 commits

Author SHA1 Message Date
Cory Fields
8726708b64
Merge 763c9ddfab into c5e44a0435 2025-04-29 11:55:43 +02:00
merge-script
c5e44a0435
Merge bitcoin/bitcoin#32369: test: Use the correct node for doubled keypath test
Some checks are pending
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Windows native, VS 2022 (push) Waiting to run
CI / Windows native, fuzz, VS 2022 (push) Waiting to run
CI / Linux->Windows cross, no tests (push) Waiting to run
CI / Windows, test cross-built (push) Blocked by required conditions
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
32d55e28af test: Use the correct node for doubled keypath test (Ava Chow)

Pull request description:

  #29124 had a silent merge conflict with #32350 which resulted in it using the wrong node. Fix the test to use the correct v22 node.

ACKs for top commit:
  maflcko:
    lgtm ACK 32d55e28af
  rkrux:
    ACK 32d55e28af
  BrandonOdiwuor:
    Code Review ACK 32d55e28af

Tree-SHA512: 1e0231985beb382b16e1d608c874750423d0502388db0c8ad450b22d17f9d96f5e16a6b44948ebda5efc750f62b60d0de8dd20131f449427426a36caf374af92
2025-04-29 09:59:42 +01:00
Ava Chow
32d55e28af test: Use the correct node for doubled keypath test 2025-04-28 14:44:17 -07:00
Cory Fields
763c9ddfab kernel: avoid potential duplicate object in shared library/binary
Fixes warning and potential bug whereby init_flag may exist in both
libbitcoinkernel as well as a downstream user, as opposed to being shared as
intended.

src/support/lockedpool.h:224:31:
warning: 'init_flag' may be duplicated when built into a shared library: it is mutable, has hidden visibility, and external linkage [-Wunique-object-duplication]
2025-02-05 19:16:17 +00:00
Cory Fields
5ca103aac6 build: add kernel-specific warnings
In some cases, we'll want to be more aggressive or care about different things
when building the kernel. In this case, a warning is added for symbols which
may be duplicated between the kernel and downstream users.

A few caveats for now:
- This warning is introduced in clang 21, which is not yet released
- The warning doesn't actually show unless the CXX_VISIBILITY_PRESET hack is
  disabled in CMake, which won't happen for a while.

So this warning is not helpful for CI at the moment, but it's possible to use
it manually (as I have for this PR) by disabling the hack locally until then.
2025-02-05 19:16:17 +00:00
4 changed files with 25 additions and 7 deletions

View file

@ -80,9 +80,25 @@ add_library(bitcoinkernel
../validationinterface.cpp
../versionbits.cpp
)
# Compiler warnings that apply only to the kernel and its dependencies.
# These can be more strict and/or warnings that only apply to shared
# libs.
add_library(kernel_warn_interface INTERFACE)
if(MSVC)
else()
try_append_cxx_flags("-Wunique-object-duplication" TARGET kernel_warn_interface SKIP_LINK)
endif()
# Also manually apply the warnings to the kernel's internal dependencies
target_link_libraries(bitcoin_clientversion PRIVATE kernel_warn_interface)
target_link_libraries(bitcoin_crypto PRIVATE kernel_warn_interface)
target_link_libraries(leveldb PRIVATE kernel_warn_interface)
target_link_libraries(bitcoinkernel
PRIVATE
core_interface
kernel_warn_interface
bitcoin_clientversion
bitcoin_crypto
leveldb

View file

@ -400,3 +400,10 @@ void LockedPoolManager::CreateInstance()
static LockedPoolManager instance(std::move(allocator));
LockedPoolManager::_instance = &instance;
}
LockedPoolManager& LockedPoolManager::Instance()
{
static std::once_flag init_flag;
std::call_once(init_flag, LockedPoolManager::CreateInstance);
return *LockedPoolManager::_instance;
}

View file

@ -219,12 +219,7 @@ class LockedPoolManager : public LockedPool
{
public:
/** Return the current instance, or create it once */
static LockedPoolManager& Instance()
{
static std::once_flag init_flag;
std::call_once(init_flag, LockedPoolManager::CreateInstance);
return *LockedPoolManager::_instance;
}
static LockedPoolManager& Instance();
private:
explicit LockedPoolManager(std::unique_ptr<LockedPageAllocator> allocator);

View file

@ -87,7 +87,7 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
# 0.21.x and 22.x would both produce bad derivation paths when topping up an inactive hd chain
# Make sure that this is being automatically cleaned up by migration
node_master = self.nodes[1]
node_v22 = self.nodes[self.num_nodes - 5]
node_v22 = self.nodes[self.num_nodes - 3]
wallet_name = "bad_deriv_path"
node_v22.createwallet(wallet_name=wallet_name, descriptors=False)
bad_deriv_wallet = node_v22.get_wallet_rpc(wallet_name)