set Wno-error for simplicity keep warning but dont error on it
What changed, and why it matters
This commit is a large maintenance patch for the Elements blockchain project. It mainly fixes build and test problems introduced by a recent upstream Bitcoin merge: compiler warnings became errors, fuzz tests used the wrong transaction format, Windows/MSVC builds failed, and some functional tests assumed too much disk space. The only directly user-visible runtime change is replacing a risky fixed-size on-stack array in transaction blinding code with a heap-allocated vector, which removes a potential stack-overflow/crash path when handling very large transactions. Most other changes are build-system, CI, or test-only adjustments.
Treat as a routine maintenance/build-fix commit. Review the blind.cpp stack-to-heap change for correctness (allocation size, zeroing, lifetime) and ensure fuzz/functional CI passes. No urgent security response is warranted, but the blind.cpp change is worth backporting if this commit is not already on release branches because it removes a real crash/DoS surface.
Security signals we found
Stack-to-heap change in blind.cpp removes a large fixed stack allocation that could cause stack exhaustion or crash during transaction blinding
Numerous API-adaptation changes (HexStr Span, DataStream Span, confidential CTxOut fields) are defensive compatibility fixes, not new vulnerabilities
Removal of `Assert(!g_used_g_prng)` in fuzzing test utility is a test-only workaround for Windows static initialization order, not a runtime weakening of PRNG guarantees
No changes to signature validation, consensus rules, network protocol parsing, or wallet encryption observed
Evidence from the diff
The commit is a grab-bag rebase/port of upstream Bitcoin changes onto Elements. Key technical changes: (1) src/blind.cpp replaces stack arrays unsigned char blind[10000][32] and asset_blind[10000][32] with std::vector<std::array<unsigned char,32>> sized by num_to_blind, mitigating a large stack allocation (≈640 KB) in blind transaction handling. (2) Many call sites adapt to upstream API changes: HexStr now requires a Span and is wrapped with MakeByteSpan; DataStream constructors take Span; CTxOut/CRecipient now include confidential asset/value fields; coin_control.destChange is now asset-indexed; tx_pool.check signature changed. (3) Build/CI: CMake generator defaulting, MSVC output directory fixes, Elements-branded binary names, Elements fuzz corpus, -Wno-error for vendored Simplicity code, -DPRODUCTION/-UNDEBUG for Simplicity, C11 for MSVC. (4) Tests: prune nodes to avoid disk-space warnings, disable broken tests, add --legacy-wallet flags, fix datadir path assumptions for Elements, remove a static-init-order assertion that breaks Windows fuzz builds. No cryptographic or consensus logic changes are evident.
Changed components
src/blind.cppsrc/assetsdir.cppsrc/core_read.cppsrc/core_write.cppsrc/common/signmessage.cppsrc/httprpc.cppsrc/i2p.cppsrc/init.cppsrc/net.cppsrc/primitives/confidential.hsrc/qt/recentrequeststablemodel.cppsrc/wallet/rpc/backup.cppsrc/wallet/rpc/coins.cppsrc/wallet/rpc/elements.cppsrc/wallet/salvage.cppsrc/test/fuzz/*src/test/util/random.cppsrc/test/util/setup_common.cpptest/functional/*.github/workflows/ci.ymlci/test/03_test_script.shsrc/CMakeLists.txtsrc/test/fuzz/CMakeLists.txtInspect captured patch +119 / −102
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4035128..8883596 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -222,7 +222,7 @@ jobs:
- name: Generate build system
run: |
- cmake -B build --preset vs2022-static -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" ${{ matrix.generate-options }}
+ cmake -B build --preset vs2022-static -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE="${{ github.workspace }}/build/bin" ${{ matrix.generate-options }}
- name: Save vcpkg binary cache
uses: actions/cache/save@v4
@@ -246,10 +246,10 @@ jobs:
if: matrix.job-type == 'standard'
working-directory: build
env:
- BITCOIND: '${{ github.workspace }}\build\bin\Release\bitcoind.exe'
- BITCOINCLI: '${{ github.workspace }}\build\bin\Release\bitcoin-cli.exe'
- BITCOINUTIL: '${{ github.workspace }}\build\bin\Release\bitcoin-util.exe'
- BITCOINWALLET: '${{ github.workspace }}\build\bin\Release\bitcoin-wallet.exe'
+ BITCOIND: '${{ github.workspace }}\build\bin\elementsd.exe'
+ BITCOINCLI: '${{ github.workspace }}\build\bin\elements-cli.exe'
+ BITCOINUTIL: '${{ github.workspace }}\build\bin\elements-util.exe'
+ BITCOINWALLET: '${{ github.workspace }}\build\bin\elements-wallet.exe'
TEST_RUNNER_EXTRA: ${{ github.event_name != 'pull_request' && '--extended' || '' }}
shell: cmd
run: py -3 test\functional\test_runner.py --jobs %NUMBER_OF_PROCESSORS% --ci --quiet --tmpdirprefix=%RUNNER_TEMP% --combinedlogslen=99999999 --timeout-factor=%TEST_RUNNER_TIMEOUT_FACTOR% %TEST_RUNNER_EXTRA%
@@ -257,7 +257,7 @@ jobs:
- name: Clone corpora
if: matrix.job-type == 'fuzz'
run: |
- git clone --depth=1 https://github.com/bitcoin-core/qa-assets "$env:RUNNER_TEMP\qa-assets"
+ git clone --depth=1 https://github.com/ElementsProject/qa-assets "$env:RUNNER_TEMP\qa-assets"
Set-Location "$env:RUNNER_TEMP\qa-assets"
Write-Host "Using qa-assets repo from commit ..."
git log -1
@@ -266,7 +266,7 @@ jobs:
if: matrix.job-type == 'fuzz'
working-directory: build
env:
- BITCOINFUZZ: '${{ github.workspace }}\build\bin\Release\fuzz.exe'
+ BITCOINFUZZ: '${{ github.workspace }}\build\bin\fuzz.exe'
shell: cmd
run: |
py -3 test\fuzz\test_runner.py --par %NUMBER_OF_PROCESSORS% --loglevel DEBUG %RUNNER_TEMP%\qa-assets\fuzz_corpora
diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh
index 6a23f4b..1e8b829 100755
--- a/ci/test/03_test_script.sh
+++ b/ci/test/03_test_script.sh
@@ -124,7 +124,7 @@ fi
# === CMake build (modern path used by the fork) ===
if [ -n "$NO_DEPENDS" ]; then
echo "Building with CMake (NO_DEPENDS=1)..."
- cmake -B build -S . -G "$CMAKE_GENERATOR" $BITCOIN_CONFIG_ALL
+ cmake -B build -S . ${CMAKE_GENERATOR:+-G "$CMAKE_GENERATOR"} $BITCOIN_CONFIG_ALL
else
# depends path (still uses configure in some jobs)
./autogen.sh
@@ -133,6 +133,21 @@ fi
cmake --build build --config Release --parallel "$MAKEJOBS"
+if [ -n "$NO_DEPENDS" ]; then
+ bash -c "${PRINT_CCACHE_STATISTICS}"
+
+ if [ "$RUN_UNIT_TESTS" = "true" ]; then
+ DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" CTEST_OUTPUT_ON_FAILURE=ON ctest --stop-on-failure "${MAKEJOBS}" --timeout $(( TEST_RUNNER_TIMEOUT_FACTOR * 60 ))
+ fi
+
+ if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then
+ eval "TEST_RUNNER_EXTRA=($TEST_RUNNER_EXTRA)"
+ test/functional/test_runner.py --ci "${MAKEJOBS}" --tmpdirprefix "${BASE_SCRATCH_DIR}"/test_runner/ --ansi --combinedlogslen=99999999 --timeout-factor="${TEST_RUNNER_TIMEOUT_FACTOR}" "${TEST_RUNNER_EXTRA[@]}" --quiet --failfast
+ fi
+
+ exit 0
+fi
+
mkdir -p "${BASE_BUILD_DIR}"
cd "${BASE_BUILD_DIR}"
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 903b342..806566e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -105,6 +105,9 @@ target_include_directories(elementssimplicity
target_compile_definitions(elementssimplicity PRIVATE PRODUCTION)
# Simplicity requires assertions; remove NDEBUG that cmake adds for optimized builds.
target_compile_options(elementssimplicity PRIVATE -UNDEBUG)
+target_compile_options(elementssimplicity PRIVATE
+ $<$<CXX_COMPILER_ID:MSVC>:/std:c11>
+)
target_link_libraries(elementssimplicity
PRIVATE
core_interface
@@ -113,8 +116,8 @@ target_link_libraries(elementssimplicity
# macOS Apple Clang is stricter than Linux GCC on this vendored code
if(APPLE)
target_compile_options(elementssimplicity PRIVATE
- -Wno-conditional-uninitialized
- -Wno-implicit-fallthrough
+ -Wno-error=conditional-uninitialized
+ -Wno-error=implicit-fallthrough
)
endif()
diff --git a/src/assetsdir.cpp b/src/assetsdir.cpp
index 4c37111..f69aab8 100644
--- a/src/assetsdir.cpp
+++ b/src/assetsdir.cpp
@@ -8,9 +8,6 @@
#include <tinyformat.h>
#include <util/strencodings.h>
-#include <boost/algorithm/string/classification.hpp>
-#include <boost/algorithm/string/split.hpp>
-
void CAssetsDir::Set(const CAsset& asset, const AssetMetadata& metadata)
{
// No asset or label repetition
@@ -41,7 +38,11 @@ void CAssetsDir::InitFromStrings(const std::vector<std::string>& assetsToInit, c
{
for (std::string strToSplit : assetsToInit) {
std::vector<std::string> vAssets;
- boost::split(vAssets, strToSplit, boost::is_any_of(":"));
+ const auto pos = strToSplit.find(':');
+ if (pos != std::string::npos) {
+ vAssets.push_back(strToSplit.substr(0, pos));
+ vAssets.push_back(strToSplit.substr(pos + 1));
+ }
if (vAssets.size() != 2) {
throw std::runtime_error("-assetdir parameters malformed, expecting asset:label");
}
diff --git a/src/blind.cpp b/src/blind.cpp
index 4d30c35..5f7c133 100644
--- a/src/blind.cpp
+++ b/src/blind.cpp
@@ -5,6 +5,7 @@
#include <blind.h>
#include <chainparams.h>
+#include <array>
#include <hash.h>
#include <primitives/transaction.h>
#include <primitives/confidential.h>
@@ -474,8 +475,8 @@ int BlindTransaction(std::vector<uint256 >& input_value_blinding_factors, const
//Running total of newly blinded outputs
static const unsigned char diff_zero[32] = {0};
assert(num_to_blind <= 10000); // More than 10k outputs? Stop spamming.
- unsigned char blind[10000][32];
- unsigned char asset_blind[10000][32];
+ std::vector<std::array<unsigned char, 32>> blind(num_to_blind);
+ std::vector<std::array<unsigned char, 32>> asset_blind(num_to_blind);
secp256k1_pedersen_commitment value_commit;
secp256k1_generator asset_gen;
CAsset asset;
diff --git a/src/common/signmessage.cpp b/src/common/signmessage.cpp
index 1612751..14afbdf 100644
--- a/src/common/signmessage.cpp
+++ b/src/common/signmessage.cpp
@@ -65,7 +65,7 @@ bool MessageSign(
return false;
}
- signature = EncodeBase64(signature_bytes);
+ signature = EncodeBase64(MakeByteSpan(signature_bytes));
return true;
}
diff --git a/src/core_read.cpp b/src/core_read.cpp
index 3f8f573..d0fdc2d 100644
--- a/src/core_read.cpp
+++ b/src/core_read.cpp
@@ -143,7 +143,7 @@ static bool DecodeTx(CMutableTransaction& tx, const std::vector<unsigned char>&
// Try decoding with extended serialization support, and remember if the result successfully
// consumes the entire input.
if (try_witness) {
- DataStream ssData(tx_data);
+ DataStream ssData(MakeByteSpan(tx_data));
try {
ssData >> TX_WITH_WITNESS(tx_extended);
if (ssData.empty()) ok_extended = true;
@@ -161,7 +161,7 @@ static bool DecodeTx(CMutableTransaction& tx, const std::vector<unsigned char>&
// Try decoding with legacy serialization, and remember if the result successfully consumes the entire input.
if (try_no_witness) {
- DataStream ssData(tx_data);
+ DataStream ssData(MakeByteSpan(tx_data));
try {
ssData >> TX_NO_WITNESS(tx_legacy);
if (ssData.empty()) ok_legacy = true;
@@ -208,7 +208,7 @@ bool DecodeHexBlockHeader(CBlockHeader& header, const std::string& hex_header)
if (!IsHex(hex_header)) return false;
const std::vector<unsigned char> header_data{ParseHex(hex_header)};
- DataStream ser_header(header_data);
+ DataStream ser_header(MakeByteSpan(header_data));
try {
ser_header >> TX_WITH_WITNESS(header);
} catch (const std::exception&) {
@@ -223,7 +223,7 @@ bool DecodeHexBlk(CBlock& block, const std::string& strHexBlk)
return false;
std::vector<unsigned char> blockData(ParseHex(strHexBlk));
- DataStream ssBlock(blockData);
+ DataStream ssBlock(MakeByteSpan(blockData));
try {
ssBlock >> TX_WITH_WITNESS(block);
}
diff --git a/src/core_write.cpp b/src/core_write.cpp
index e4c7736..2fd57e5 100644
--- a/src/core_write.cpp
+++ b/src/core_write.cpp
@@ -88,14 +88,14 @@ std::string FormatScript(const CScript& script)
}
}
if (vch.size() > 0) {
- ret += strprintf("0x%x 0x%x ", HexStr(std::vector<uint8_t>(it2, it - vch.size())),
- HexStr(std::vector<uint8_t>(it - vch.size(), it)));
+ ret += strprintf("0x%x 0x%x ", HexStr(MakeByteSpan(std::vector<uint8_t>(it2, it - vch.size()))),
+ HexStr(MakeByteSpan(std::vector<uint8_t>(it - vch.size(), it))));
} else {
- ret += strprintf("0x%x ", HexStr(std::vector<uint8_t>(it2, it)));
+ ret += strprintf("0x%x ", HexStr(MakeByteSpan(std::vector<uint8_t>(it2, it))));
}
continue;
}
- ret += strprintf("0x%x ", HexStr(std::vector<uint8_t>(it2, script.end())));
+ ret += strprintf("0x%x ", HexStr(MakeByteSpan(std::vector<uint8_t>(it2, script.end()))));
break;
}
return ret.substr(0, ret.empty() ? ret.npos : ret.size() - 1);
@@ -157,9 +157,9 @@ std::string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDeco
vch.pop_back(); // remove the sighash type byte. it will be replaced by the decode.
}
}
- str += HexStr(vch) + strSigHashDecode;
+ str += HexStr(MakeByteSpan(vch)) + strSigHashDecode;
} else {
- str += HexStr(vch);
+ str += HexStr(MakeByteSpan(vch));
}
}
} else {
@@ -180,7 +180,7 @@ UniValue EncodeHexScriptWitness(const CScriptWitness& witness)
{
UniValue witness_hex(UniValue::VARR);
for (const auto &item : witness.stack) {
- witness_hex.push_back(HexStr(item));
+ witness_hex.push_back(HexStr(MakeByteSpan(item)));
}
return witness_hex;
}
@@ -292,7 +292,7 @@ void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry
if (!scriptWitness.IsNull()) {
UniValue txinwitness(UniValue::VARR);
for (const auto &item : scriptWitness.stack) {
- txinwitness.push_back(HexStr(item));
+ txinwitness.push_back(HexStr(MakeByteSpan(item)));
}
in.pushKV("txinwitness", txinwitness);
}
@@ -301,7 +301,7 @@ void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry
if (tx.witness.vtxinwit.size() > i && !tx.witness.vtxinwit[i].m_pegin_witness.IsNull()) {
UniValue pegin_witness(UniValue::VARR);
for (const auto& item : tx.witness.vtxinwit[i].m_pegin_witness.stack) {
- pegin_witness.push_back(HexStr(item));
+ pegin_witness.push_back(HexStr(MakeByteSpan(item)));
}
in.pushKV("pegin_witness", pegin_witness);
}
@@ -330,12 +330,12 @@ void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry
if (issuance.nAmount.IsExplicit()) {
issue.pushKV("assetamount", ValueFromAmount(issuance.nAmount.GetAmount()));
} else if (issuance.nAmount.IsCommitment()) {
- issue.pushKV("assetamountcommitment", HexStr(issuance.nAmount.vchCommitment));
+ issue.pushKV("assetamountcommitment", HexStr(MakeByteSpan(issuance.nAmount.vchCommitment)));
}
if (issuance.nInflationKeys.IsExplicit()) {
issue.pushKV("tokenamount", ValueFromAmount(issuance.nInflationKeys.GetAmount()));
} else if (issuance.nInflationKeys.IsCommitment()) {
- issue.pushKV("tokenamountcommitment", HexStr(issuance.nInflationKeys.vchCommitment));
+ issue.pushKV("tokenamountcommitment", HexStr(MakeByteSpan(issuance.nInflationKeys.vchCommitment)));
}
in.pushKV("issuance", issue);
}
@@ -373,7 +373,7 @@ void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry
}
if (ptxoutwit->vchSurjectionproof.size()) {
- out.pushKV("surjectionproof", HexStr(ptxoutwit->vchSurjectionproof));
+ out.pushKV("surjectionproof", HexStr(MakeByteSpan(ptxoutwit->vchSurjectionproof)));
}
}
out.pushKV("valuecommitment", txout.nValue.GetHex());
diff --git a/src/httprpc.cpp b/src/httprpc.cpp
index 5789370..e26daa7 100644
--- a/src/httprpc.cpp
+++ b/src/httprpc.cpp
@@ -123,7 +123,7 @@ static bool multiUserAuthorized(std::string strUserPass)
CHMAC_SHA256(reinterpret_cast<const unsigned char*>(strSalt.data()), strSalt.size()).Write(reinterpret_cast<const unsigned char*>(strPass.data()), strPass.size()).Finalize(out);
std::vector<unsigned char> hexvec(out, out+KEY_SIZE);
- std::string strHashFromPass = HexStr(hexvec);
+ std::string strHashFromPass = HexStr(MakeByteSpan(hexvec));
if (TimingResistantEqual(strHashFromPass, strHash)) {
return true;
diff --git a/src/i2p.cpp b/src/i2p.cpp
index 0420bc9..ba8cdcc 100644
--- a/src/i2p.cpp
+++ b/src/i2p.cpp
@@ -438,7 +438,7 @@ void Session::CreateIfNotCreatedAlready()
GenerateAndSavePrivateKey(*sock);
}
- const std::string& private_key_b64 = SwapBase64(EncodeBase64(m_private_key));
+ const std::string& private_key_b64 = SwapBase64(EncodeBase64(MakeByteSpan(m_private_key)));
SendRequestAndGetReply(*sock,
strprintf("SESSION CREATE STYLE=STREAM ID=%s DESTINATION=%s "
diff --git a/src/init.cpp b/src/init.cpp
index f13d6ec..460010e 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -694,8 +694,8 @@ void SetupServerArgs(ArgsManager& argsman, bool can_listen_ipc)
argsman.AddArg("-pubkeyprefix", strprintf("The byte prefix, in decimal, of the chain's base58 pubkey address. (default: %d)", defaultChainParams->Base58Prefix(CChainParams::PUBKEY_ADDRESS)[0]), ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-scriptprefix", strprintf("The byte prefix, in decimal, of the chain's base58 script address. (default: %d)", defaultChainParams->Base58Prefix(CChainParams::SCRIPT_ADDRESS)[0]), ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-secretprefix", strprintf("The byte prefix, in decimal, of the chain's base58 secret key encoding. (default: %d)", defaultChainParams->Base58Prefix(CChainParams::SECRET_KEY)[0]), ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
- argsman.AddArg("-extpubkeyprefix", strprintf("The 4-byte prefix, in hex, of the chain's base58 extended public key encoding. (default: %s)", HexStr(defaultChainParams->Base58Prefix(CChainParams::EXT_PUBLIC_KEY))), ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
- argsman.AddArg("-extprvkeyprefix", strprintf("The 4-byte prefix, in hex, of the chain's base58 extended private key encoding. (default: %s)", HexStr(defaultChainParams->Base58Prefix(CChainParams::EXT_SECRET_KEY))), ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
+ argsman.AddArg("-extpubkeyprefix", strprintf("The 4-byte prefix, in hex, of the chain's base58 extended public key encoding. (default: %s)", HexStr(MakeByteSpan(defaultChainParams->Base58Prefix(CChainParams::EXT_PUBLIC_KEY)))), ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
+ argsman.AddArg("-extprvkeyprefix", strprintf("The 4-byte prefix, in hex, of the chain's base58 extended private key encoding. (default: %s)", HexStr(MakeByteSpan(defaultChainParams->Base58Prefix(CChainParams::EXT_SECRET_KEY)))), ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-bech32_hrp", strprintf("The human-readable part of the chain's bech32 encoding. (default: %s)", defaultChainParams->Bech32HRP()), ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-blech32_hrp", strprintf("The human-readable part of the chain's blech32 encoding. Used in confidential addresses.(default: %s)", defaultChainParams->Blech32HRP()), ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-assetdir", "Entries of pet names of assets, in this format:asset=<hex>:<label>. There can be any number of entries.", ArgsManager::ALLOW_ANY, OptionsCategory::ELEMENTS);
diff --git a/src/net.cpp b/src/net.cpp
index 735985a..9415971 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -207,7 +207,7 @@ static std::vector<CAddress> ConvertSeeds(const std::vector<uint8_t> &vSeedsIn)
const auto one_week{7 * 24h};
std::vector<CAddress> vSeedsOut;
FastRandomContext rng;
- ParamsStream s{DataStream{vSeedsIn}, CAddress::V2_NETWORK};
+ ParamsStream s{DataStream{MakeByteSpan(vSeedsIn)}, CAddress::V2_NETWORK};
while (!s.eof()) {
CService endpoint;
s >> endpoint;
diff --git a/src/primitives/confidential.h b/src/primitives/confidential.h
index 4d68dab..df09252 100644
--- a/src/primitives/confidential.h
+++ b/src/primitives/confidential.h
@@ -83,7 +83,7 @@ public:
return IsNull() || IsExplicit() || IsCommitment();
}
- std::string GetHex() const { return HexStr(vchCommitment); }
+ std::string GetHex() const { return HexStr(MakeByteSpan(vchCommitment)); }
friend bool operator==(const CConfidentialCommitment& a, const CConfidentialCommitment& b)
{
diff --git a/src/qt/recentrequeststablemodel.cpp b/src/qt/recentrequeststablemodel.cpp
index e662e13..0451e9c 100644
--- a/src/qt/recentrequeststablemodel.cpp
+++ b/src/qt/recentrequeststablemodel.cpp
@@ -188,7 +188,7 @@ void RecentRequestsTableModel::addNewRequest(const SendCoinsRecipient &recipient
void RecentRequestsTableModel::addNewRequest(const std::string &recipient)
{
std::vector<uint8_t> data(recipient.begin(), recipient.end());
- DataStream ss{data};
+ DataStream ss{MakeByteSpan(data)};
RecentRequestEntry entry;
ss >> entry;
diff --git a/src/test/fuzz/CMakeLists.txt b/src/test/fuzz/CMakeLists.txt
index 85a661a..db6d4f2 100644
--- a/src/test/fuzz/CMakeLists.txt
+++ b/src/test/fuzz/CMakeLists.txt
@@ -4,6 +4,12 @@
add_subdirectory(util)
+set_source_files_properties(
+ simplicity_compute_amr.c
+ PROPERTIES COMPILE_OPTIONS
+ "$<IF:$<CXX_COMPILER_ID:MSVC>,/std:c11;-UNDEBUG;-DPRODUCTION,-UNDEBUG;-DPRODUCTION>"
+)
+
add_executable(fuzz
addition_overflow.cpp
addrman.cpp
diff --git a/src/test/fuzz/p2p_headers_presync.cpp b/src/test/fuzz/p2p_headers_presync.cpp
index ed7041a..116c498 100644
--- a/src/test/fuzz/p2p_headers_presync.cpp
+++ b/src/test/fuzz/p2p_headers_presync.cpp
@@ -26,7 +26,7 @@ class HeadersSyncSetup : public TestingSetup
std::vector<CNode*> m_connections;
public:
- HeadersSyncSetup(const ChainType chain_type, TestOpts opts) : TestingSetup(chain_type, opts)
+ HeadersSyncSetup(const ChainType chain_type, TestOpts opts, const std::string& fedpegscript = "") : TestingSetup(chain_type, opts, fedpegscript)
{
PeerManager::Options peerman_opts;
node::ApplyArgsManOptions(*m_node.args, peerman_opts);
diff --git a/src/test/fuzz/package_eval.cpp b/src/test/fuzz/package_eval.cpp
index dd39fa9..968c5c6 100644
--- a/src/test/fuzz/package_eval.cpp
+++ b/src/test/fuzz/package_eval.cpp
@@ -267,7 +267,7 @@ FUZZ_TARGET(ephemeral_package_eval, .init = initialize_tx_pool)
// Create input
CTxIn in;
in.prevout = outpoint;
- in.scriptWitness.stack = P2WSH_EMPTY_TRUE_STACK;
+ tx_mut.witness.vtxinwit[&in - &tx_mut.vin[0]].scriptWitness.stack = P2WSH_EMPTY_TRUE_STACK;
tx_mut.vin.push_back(in);
}
@@ -275,13 +275,13 @@ FUZZ_TARGET(ephemeral_package_eval, .init = initialize_tx_pool)
const auto amount_fee = fuzzed_data_provider.ConsumeIntegralInRange<CAmount>(0, amount_in);
const auto amount_out = (amount_in - amount_fee) / num_out;
for (int i = 0; i < num_out; ++i) {
- tx_mut.vout.emplace_back(amount_out, P2WSH_EMPTY);
+ tx_mut.vout.emplace_back(CConfidentialAsset{}, CConfidentialValue(amount_out), P2WSH_EMPTY);
}
// Note output amounts can naturally drop to dust on their own.
if (!outpoint_to_rbf && fuzzed_data_provider.ConsumeBool()) {
uint32_t dust_index = fuzzed_data_provider.ConsumeIntegralInRange<uint32_t>(0, num_out);
- tx_mut.vout.insert(tx_mut.vout.begin() + dust_index, CTxOut(0, P2WSH_EMPTY));
+ tx_mut.vout.insert(tx_mut.vout.begin() + dust_index, CTxOut(CConfidentialAsset{}, CConfidentialValue(0), P2WSH_EMPTY));
}
auto tx = MakeTransactionRef(tx_mut);
@@ -297,7 +297,7 @@ FUZZ_TARGET(ephemeral_package_eval, .init = initialize_tx_pool)
}
// We need newly-created values for the duration of this run
for (size_t i = 0; i < tx->vout.size(); ++i) {
- outpoints_value[COutPoint(tx->GetHash(), i)] = tx->vout[i].nValue;
+ outpoints_value[COutPoint(tx->GetHash(), i)] = tx->vout[i].nValue.GetAmount();
}
return tx;
}());
@@ -341,7 +341,7 @@ FUZZ_TARGET(ephemeral_package_eval, .init = initialize_tx_pool)
node.validation_signals->UnregisterSharedValidationInterface(outpoints_updater);
- WITH_LOCK(::cs_main, tx_pool.check(chainstate.CoinsTip(), chainstate.m_chain.Height() + 1));
+ WITH_LOCK(::cs_main, tx_pool.check(chainstate.m_chain.Tip(), chainstate.CoinsTip(), chainstate.m_chain.Height() + 1));
}
diff --git a/src/test/fuzz/txdownloadman.cpp b/src/test/fuzz/txdownloadman.cpp
index 06385e7..c2d62b0 100644
--- a/src/test/fuzz/txdownloadman.cpp
+++ b/src/test/fuzz/txdownloadman.cpp
@@ -63,9 +63,10 @@ static CTransactionRef MakeTransactionSpending(const std::vector<COutPoint>& out
tx.vin.emplace_back(outpoint);
}
if (add_witness) {
- tx.vin[0].scriptWitness.stack.push_back({1});
+ tx.witness.vtxinwit.resize(tx.vin.size());
+ tx.witness.vtxinwit[0].scriptWitness.stack.push_back({1});
}
- for (size_t o = 0; o < num_outputs; ++o) tx.vout.emplace_back(CENT, P2WSH_OP_TRUE);
+ for (size_t o = 0; o < num_outputs; ++o) tx.vout.emplace_back(CConfidentialAsset{}, CConfidentialValue(CENT), P2WSH_OP_TRUE);
return MakeTransactionRef(tx);
}
static std::vector<COutPoint> PickCoins(FuzzedDataProvider& fuzzed_data_provider)
diff --git a/src/test/fuzz/util.h b/src/test/fuzz/util.h
index 38be59f..85fd9f8 100644
--- a/src/test/fuzz/util.h
+++ b/src/test/fuzz/util.h
@@ -72,7 +72,7 @@ template<typename B = uint8_t>
[[nodiscard]] inline DataStream ConsumeDataStream(FuzzedDataProvider& fuzzed_data_provider, const std::optional<size_t>& max_length = std::nullopt) noexcept
{
- return DataStream{ConsumeRandomLengthByteVector(fuzzed_data_provider, max_length)};
+ return DataStream{MakeByteSpan(ConsumeRandomLengthByteVector(fuzzed_data_provider, max_length))};
}
[[nodiscard]] inline std::vector<std::string> ConsumeRandomLengthStringVector(FuzzedDataProvider& fuzzed_data_provider, const size_t max_vector_size = 16, const size_t max_string_length = 16) noexcept
@@ -105,7 +105,7 @@ template <typename T, typename P>
[[nodiscard]] std::optional<T> ConsumeDeserializable(FuzzedDataProvider& fuzzed_data_provider, const P& params, const std::optional<size_t>& max_length = std::nullopt) noexcept
{
const std::vector<uint8_t> buffer{ConsumeRandomLengthByteVector(fuzzed_data_provider, max_length)};
- DataStream ds{buffer};
+ DataStream ds{MakeByteSpan(buffer)};
T obj;
try {
ds >> params(obj);
@@ -119,7 +119,7 @@ template <typename T>
[[nodiscard]] inline std::optional<T> ConsumeDeserializable(FuzzedDataProvider& fuzzed_data_provider, const std::optional<size_t>& max_length = std::nullopt) noexcept
{
const std::vector<uint8_t> buffer = ConsumeRandomLengthByteVector(fuzzed_data_provider, max_length);
- DataStream ds{buffer};
+ DataStream ds{MakeByteSpan(buffer)};
T obj;
try {
ds >> obj;
diff --git a/src/test/fuzz/util/wallet.h b/src/test/fuzz/util/wallet.h
index 1f04b5d..1922367 100644
--- a/src/test/fuzz/util/wallet.h
+++ b/src/test/fuzz/util/wallet.h
@@ -79,7 +79,7 @@ struct FuzzedWallet {
{
// The fee of "tx" is 0, so this is the total input and output amount
const CAmount total_amt{
- std::accumulate(tx.vout.begin(), tx.vout.end(), CAmount{}, [](CAmount t, const CTxOut& out) { return t + out.nValue; })};
+ std::accumulate(tx.vout.begin(), tx.vout.end(), CAmount{}, [](CAmount t, const CTxOut& out) { return t + out.nValue.GetAmount(); })};
const uint32_t tx_size(GetVirtualTransactionSize(CTransaction{tx}));
std::set<int> subtract_fee_from_outputs;
if (fuzzed_data_provider.ConsumeBool()) {
@@ -94,13 +94,13 @@ struct FuzzedWallet {
const CTxOut& tx_out = tx.vout[idx];
CTxDestination dest;
ExtractDestination(tx_out.scriptPubKey, dest);
- CRecipient recipient = {dest, tx_out.nValue, subtract_fee_from_outputs.count(idx) == 1};
+ CRecipient recipient = {dest, tx_out.nValue.GetAmount(), ::policyAsset, CPubKey(), subtract_fee_from_outputs.count(idx) == 1};
recipients.push_back(recipient);
}
CCoinControl coin_control;
coin_control.m_allow_other_inputs = fuzzed_data_provider.ConsumeBool();
CallOneOf(
- fuzzed_data_provider, [&] { coin_control.destChange = GetDestination(fuzzed_data_provider); },
+ fuzzed_data_provider, [&] { coin_control.destChange[::policyAsset] = GetDestination(fuzzed_data_provider); },
[&] { coin_control.m_change_type.emplace(fuzzed_data_provider.PickValueInArray(OUTPUT_TYPES)); },
[&] { /* no op (leave uninitialized) */ });
coin_control.fAllowWatchOnly = fuzzed_data_provider.ConsumeBool();
diff --git a/src/test/fuzz/witness_program.cpp b/src/test/fuzz/witness_program.cpp
index dd3245a..1150718 100644
--- a/src/test/fuzz/witness_program.cpp
+++ b/src/test/fuzz/witness_program.cpp
@@ -104,7 +104,7 @@ FUZZ_TARGET(witness_program)
witness.stack.push_back(program);
std::vector<unsigned char> control;
- control.push_back(TAPROOT_LEAF_TAPSCRIPT | extkey_parity->second);
+ control.push_back(TAPROOT_LEAF_TAPSCRIPT | static_cast<uint8_t>(extkey_parity->second));
control.insert(control.end(), intkey.begin(), intkey.end());
witness.stack.push_back(control);
diff --git a/src/test/util/random.cpp b/src/test/util/random.cpp
index d75f1ef..71e8e5d 100644
--- a/src/test/util/random.cpp
+++ b/src/test/util/random.cpp
@@ -42,7 +42,7 @@ void SeedRandomStateForTest(SeedRand seedtype)
g_seeded_g_prng_zero = seedtype == SeedRand::ZEROS;
if constexpr (G_FUZZING) {
Assert(g_seeded_g_prng_zero); // Only SeedRandomStateForTest(SeedRand::ZEROS) is allowed in fuzz tests
- Assert(!g_used_g_prng); // The global PRNG must not have been used before SeedRandomStateForTest(SeedRand::ZEROS)
+// Assert(!g_used_g_prng); // The global PRNG must not have been used before SeedRandomStateForTest(SeedRand::ZEROS) - disable for windows initialization order issues
}
const uint256& seed{seedtype == SeedRand::FIXED_SEED ? g_ctx_seed.value() : uint256::ZERO};
LogInfo("Setting random seed for current tests to %s=%s\n", RANDOM_CTX_SEED, seed.GetHex());
diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp
index 2597c27..a160623 100644
--- a/src/test/util/setup_common.cpp
+++ b/src/test/util/setup_common.cpp
@@ -159,7 +159,7 @@ BasicTestingSetup::BasicTestingSetup(const ChainType chainType, TestOpts opts, c
// tests, such as the fuzz tests to run in several processes at the
// same time, add a random element to the path. Keep it small enough to
// avoid a MAX_PATH violation on Windows.
- const auto rand{HexStr(g_rng_temp_path.randbytes(10))};
+ const auto rand{HexStr(MakeByteSpan(g_rng_temp_path.randbytes(10)))};
m_path_root = fs::temp_directory_path() / TEST_DIR_PATH_ELEMENT / test_name / rand;
TryCreateDirectories(m_path_root);
} else {
diff --git a/src/wallet/rpc/backup.cpp b/src/wallet/rpc/backup.cpp
index a79f034..cd29303 100644
--- a/src/wallet/rpc/backup.cpp
+++ b/src/wallet/rpc/backup.cpp
@@ -355,7 +355,7 @@ RPCHelpMan importprunedfunds()
}
uint256 hashTx = tx.GetHash();
- DataStream ssMB(ParseHexV(request.params[1], "proof"));
+ DataStream ssMB(MakeByteSpan(ParseHexV(request.params[1], "proof")));
CMerkleBlock merkleBlock;
ssMB >> TX_WITH_WITNESS(merkleBlock);
@@ -2101,7 +2101,7 @@ RPCHelpMan getwalletpakinfo()
CHECK_NONFATAL(len == 33);
CHECK_NONFATAL(negatedpubkeybytes.size() == 33);
- ret.pushKV("pakentry", "pak=" + HexStr(negatedpubkeybytes) + ":" + HexStr(pwallet->online_key));
+ ret.pushKV("pakentry", "pak=" + HexStr(MakeByteSpan(negatedpubkeybytes)) + ":" + HexStr(pwallet->online_key));
}
ret.pushKV("liquid_pak", HexStr(pwallet->online_key));
ret.pushKV("liquid_pak_address", EncodeDestination(PKHash(pwallet->online_key)));
diff --git a/src/wallet/rpc/coins.cpp b/src/wallet/rpc/coins.cpp
index 03ba284..55d5da8 100644
--- a/src/wallet/rpc/coins.cpp
+++ b/src/wallet/rpc/coins.cpp
@@ -814,11 +814,11 @@ RPCHelpMan listunspent()
entry.pushKV("amount", ValueFromAmount(amount));
if (g_con_elementsmode) {
if (tx_out.nAsset.IsCommitment()) {
- entry.pushKV("assetcommitment", HexStr(tx_out.nAsset.vchCommitment));
+ entry.pushKV("assetcommitment", HexStr(MakeByteSpan(tx_out.nAsset.vchCommitment)));
}
entry.pushKV("asset", assetid.GetHex());
if (tx_out.nValue.IsCommitment()) {
- entry.pushKV("amountcommitment", HexStr(tx_out.nValue.vchCommitment));
+ entry.pushKV("amountcommitment", HexStr(MakeByteSpan(tx_out.nValue.vchCommitment)));
}
entry.pushKV("amountblinder", out.bf_value.ToString());
entry.pushKV("assetblinder", out.bf_asset.ToString());
diff --git a/src/wallet/rpc/elements.cpp b/src/wallet/rpc/elements.cpp
index dfb8cac..1a470d1 100644
--- a/src/wallet/rpc/elements.cpp
+++ b/src/wallet/rpc/elements.cpp
@@ -138,7 +138,7 @@ RPCHelpMan signblock()
for (const auto& signature : block_sigs.signatures) {
UniValue obj(UniValue::VOBJ);
obj.pushKV("pubkey", HexStr(signature.second.first));
- obj.pushKV("sig", HexStr(signature.second.second));
+ obj.pushKV("sig", HexStr(MakeByteSpan(signature.second.second)));
ret.push_back(obj);
}
return ret;
@@ -438,7 +438,7 @@ RPCHelpMan initpegoutwallet()
CHECK_NONFATAL(negatedpubkeybytes.size() == 33);
UniValue pak(UniValue::VOBJ);
- pak.pushKV("pakentry", "pak=" + HexStr(negatedpubkeybytes) + ":" + HexStr(online_pubkey));
+ pak.pushKV("pakentry", "pak=" + HexStr(MakeByteSpan(negatedpubkeybytes)) + ":" + HexStr(online_pubkey));
pak.pushKV("liquid_pak", HexStr(online_pubkey));
pak.pushKV("liquid_pak_address", EncodeDestination(PKHash(online_pubkey)));
pak.pushKV("address_lookahead", address_list);
@@ -1255,7 +1255,7 @@ RPCHelpMan blindrawtransaction()
CWallet* const pwallet = wallet.get();
std::vector<unsigned char> txData(ParseHexV(request.params[0], "argument 1"));
- DataStream ssData(txData);
+ DataStream ssData(MakeByteSpan(txData));
CMutableTransaction tx;
try {
ssData >> TX_WITH_WITNESS(tx);
@@ -1941,7 +1941,7 @@ RPCHelpMan generatepegoutproof()
CHECK_NONFATAL(expectedOutputSize == preSize);
std::vector<unsigned char> voutput(output, output + expectedOutputSize / sizeof(output[0]));
- return HexStr(voutput);
+ return HexStr(MakeByteSpan(voutput));
},
};
}
diff --git a/src/wallet/salvage.cpp b/src/wallet/salvage.cpp
index b924239..90b477d 100644
--- a/src/wallet/salvage.cpp
+++ b/src/wallet/salvage.cpp
@@ -183,8 +183,8 @@ bool RecoverDatabaseFile(const ArgsManager& args, const fs::path& file_path, bil
for (KeyValPair& row : salvagedData)
{
/* Filter for only private key type KV pairs to be added to the salvaged wallet */
- DataStream ssKey{row.first};
- DataStream ssValue(row.second);
+ DataStream ssKey{MakeByteSpan(row.first)};
+ DataStream ssValue(MakeByteSpan(row.second));
std::string strType, strErr;
// We only care about KEY, MASTER_KEY, CRYPTED_KEY, and HDCHAIN types
diff --git a/src/wallet/test/fuzz/spend.cpp b/src/wallet/test/fuzz/spend.cpp
index 552364a..c3a7853 100644
--- a/src/wallet/test/fuzz/spend.cpp
+++ b/src/wallet/test/fuzz/spend.cpp
@@ -49,7 +49,7 @@ FUZZ_TARGET(wallet_create_transaction, .init = initialize_setup)
coin_control.m_avoid_partial_spends = fuzzed_data_provider.ConsumeBool();
coin_control.m_include_unsafe_inputs = fuzzed_data_provider.ConsumeBool();
if (fuzzed_data_provider.ConsumeBool()) coin_control.m_confirm_target = fuzzed_data_provider.ConsumeIntegralInRange<unsigned int>(0, 999'000);
- coin_control.destChange = fuzzed_data_provider.ConsumeBool() ? fuzzed_wallet.GetDestination(fuzzed_data_provider) : ConsumeTxDestination(fuzzed_data_provider);
+ coin_control.destChange[::policyAsset] = fuzzed_data_provider.ConsumeBool() ? fuzzed_wallet.GetDestination(fuzzed_data_provider) : ConsumeTxDestination(fuzzed_data_provider);
if (fuzzed_data_provider.ConsumeBool()) coin_control.m_change_type = fuzzed_data_provider.PickValueInArray(OUTPUT_TYPES);
if (fuzzed_data_provider.ConsumeBool()) coin_control.m_feerate = CFeeRate(ConsumeMoney(fuzzed_data_provider, /*max=*/COIN));
coin_control.m_allow_other_inputs = fuzzed_data_provider.ConsumeBool();
@@ -93,6 +93,8 @@ FUZZ_TARGET(wallet_create_transaction, .init = initialize_setup)
);
recipients.push_back({destination,
/*nAmount=*/ConsumeMoney(fuzzed_data_provider),
+ /*asset=*/::policyAsset,
+ /*confidentiality_key=*/CPubKey(),
/*fSubtractFeeFromAmount=*/fuzzed_data_provider.ConsumeBool()});
}
diff --git a/test/functional/feature_config_args.py b/test/functional/feature_config_args.py
index d2e7f48..1b759f4 100755
--- a/test/functional/feature_config_args.py
+++ b/test/functional/feature_config_args.py
@@ -24,6 +24,9 @@ class ConfArgsTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
+ # Prune to prevent disk space warning on CI systems with limited space,
+ # when using networks other than regtest.
+ self.extra_args = [["-prune=550"]]
self.supports_cli = False
self.wallet_names = []
self.disable_autoconnect = False
@@ -191,18 +194,17 @@ class ConfArgsTest(BitcoinTestFramework):
env, default_datadir = util.get_temp_default_datadir(Path(self.options.tmpdir, "test_config_file_log"))
default_datadir.mkdir(parents=True)
- # Write a bitcoin.conf file in the default data directory containing a
- # datadir= line pointing at the node datadir.
node = self.nodes[0]
conf_text = node.bitcoinconf.read_text()
- conf_path = default_datadir / "elements.conf"
+ # ELEMENTS: default datadir is ~/.elements, not ~/.bitcoin
+ conf_path = default_datadir / "elements.conf" # ELEMENTS: ~/.elements/elements.conf
conf_path.write_text(f"datadir={node.datadir_path}\n{conf_text}")
# Drop the node -datadir= argument during this test, because if it is
# specified it would take precedence over the datadir setting in the
# config file.
node_args = node.args
- node.args = [arg for arg in node.args if not arg.startswith("-datadir=")]
+ node.args = [arg for arg in node.args if not arg.startswith("-datadir=") and not arg.startswith("-prune=")]
# Check that correct configuration file path is actually logged
# (conf_path, not node.bitcoinconf)
@@ -471,32 +473,22 @@ class ConfArgsTest(BitcoinTestFramework):
self.log.info("Test testnet3 deprecation warning")
t3_warning_log = "Warning: Support for testnet3 is deprecated and will be removed in an upcoming release. Consider switching to testnet4."
- def warning_msg(node, approx_size):
- return f'Warning: Disk space for "{node.datadir_path / node.chain / "blocks" }" may not accommodate the block files. Approximately {approx_size} GB of data will be stored in this directory.'
-
- # Testnet3 node will log the warning
+ self.log.debug("Testnet3 node will log the deprecation warning")
self.nodes[0].chain = 'testnet3'
self.nodes[0].replace_in_config([('chain=elementsregtest', 'chain=test'), ('[elementsregtest]', '[test]')])
with self.nodes[0].assert_debug_log([t3_warning_log]):
- self.start_node(0, extra_args=["-validatepegin=0"])
- # Some CI environments will have limited space and some others won't
- # so we need to handle both cases as a valid result.
- self.nodes[0].stderr.seek(0)
- err = self.nodes[0].stdout.read()
- self.nodes[0].stderr.seek(0)
- self.nodes[0].stderr.truncate()
- if err != b'' and err != warning_msg(self.nodes[0], 42):
- raise AssertionError("Unexpected stderr after shutdown of Testnet3 node")
+ self.start_node(0, extra_args=["-validatepegin=0", "-prune=550"])
self.stop_node(0)
- # Testnet4 node will not log the warning
+ self.log.debug("Testnet4 node will not log the deprecation warning")
self.nodes[0].chain = 'testnet4'
self.nodes[0].replace_in_config([('chain=test\n', 'chain=testnet4\n'), ('[test]', '[testnet4]')])
with self.nodes[0].assert_debug_log([], unexpected_msgs=[t3_warning_log]):
- self.start_node(0, extra_args=["-validatepegin=0"])
+ self.start_node(0, extra_args=["-validatepegin=0", "-prune=550"])
self.stop_node(0)
# Reset to elementsregtest
+ self.log.debug("Reset to regtest")
self.nodes[0].chain = 'elementsregtest'
self.nodes[0].replace_in_config([('chain=testnet4', 'chain=elementsregtest'), ('[testnet4]', '[elementsregtest]')])
diff --git a/test/functional/feature_signet.py b/test/functional/feature_signet.py
index 7c16ecd..78a1028 100755
--- a/test/functional/feature_signet.py
+++ b/test/functional/feature_signet.py
@@ -26,12 +26,14 @@ signet_blocks = [
class SignetParams:
def __init__(self, challenge=None):
+ # Prune to prevent disk space warning on CI systems with limited space,
+ # when using networks other than regtest.
if challenge is None:
self.challenge = SIGNET_DEFAULT_CHALLENGE
- self.shared_args = []
+ self.shared_args = ["-prune=550"]
else:
self.challenge = challenge
- self.shared_args = [f"-signetchallenge={challenge}"]
+ self.shared_args = ["-prune=550", f"-signetchallenge={challenge}"]
class SignetBasicTest(BitcoinTestFramework):
def set_test_params(self):
diff --git a/test/functional/feature_trim_headers.py b/test/functional/feature_trim_headers.py
index 41162e6..386f59c 100755
--- a/test/functional/feature_trim_headers.py
+++ b/test/functional/feature_trim_headers.py
@@ -266,4 +266,4 @@ class TrimHeadersTest(BitcoinTestFramework):
if __name__ == '__main__':
- TrimHeadersTest().main()
+ TrimHeadersTest(__file__).main()
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py
index 760adca..52a4a29 100755
--- a/test/functional/test_framework/util.py
+++ b/test/functional/test_framework/util.py
@@ -499,18 +499,12 @@ def get_datadir_path(dirname, n):
def get_temp_default_datadir(temp_dir: pathlib.Path) -> tuple[dict, pathlib.Path]:
- """Return os-specific environment variables that can be set to make the
- GetDefaultDataDir() function return a datadir path under the provided
- temp_dir, as well as the complete path it would return."""
if platform.system() == "Windows":
env = dict(APPDATA=str(temp_dir))
datadir = temp_dir / "Bitcoin"
else:
env = dict(HOME=str(temp_dir))
- if platform.system() == "Darwin":
- datadir = temp_dir / "Library/Application Support/Elements"
- else:
- datadir = temp_dir / ".elements"
+ datadir = temp_dir / ".elements" # ELEMENTS: ~/.elements on all POSIX platforms
return env, datadir
diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py
index 838a83e..757d045 100755
--- a/test/functional/test_runner.py
+++ b/test/functional/test_runner.py
@@ -84,8 +84,8 @@ EXTENDED_SCRIPTS = [
# These tests are not run by default.
# Longest test should go first, to favor running tests in parallel
# 'feature_pruning.py', ELEMENTS: this is broken
- 'feature_dbcrash.py',
- 'feature_fee_estimation.py',
+# 'feature_dbcrash.py', ELEMENTS: long running test and uses excessive disk space on GHA
+# 'feature_fee_estimation.py', ELEMENTS: this is broken on v23
'feature_index_prune.py',
'feature_trim_headers.py',
'wallet_pruning.py --legacy-wallet',
@@ -112,19 +112,19 @@ BASE_SCRIPTS = [
'feature_issuance.py --legacy-wallet',
'feature_confidential_transactions.py --legacy-wallet',
'feature_default_asset_name.py --legacy-wallet',
- 'feature_assetsdir.py',
+ 'feature_assetsdir.py --legacy-wallet',
'feature_initial_reissuance_token.py --legacy-wallet',
'feature_progress.py',
'rpc_getnewblockhex.py',
'wallet_elements_regression_1172.py --legacy-wallet',
'wallet_elements_regression_1259.py --legacy-wallet',
'wallet_elements_21million.py --legacy-wallet',
- 'wallet_elements_dust_relay.py',
+ 'wallet_elements_dust_relay.py --legacy-wallet',
# Longest test should go first, to favor running tests in parallel
# vv Tests less than 5m vv
'feature_taproot.py',
'feature_block.py',
- 'wallet_elements_regression_1263.py',
+ 'wallet_elements_regression_1263.py --legacy-wallet',
'mempool_ephemeral_dust.py',
'wallet_conflicts.py --legacy-wallet',
'wallet_conflicts.py --descriptors',
Why this scored 25/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.