Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions ci/test/03_test_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ 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 . ${CMAKE_GENERATOR:+-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
./configure $BITCOIN_CONFIG_ALL
./configure "$BITCOIN_CONFIG_ALL"
fi

cmake --build build --config Release --parallel "$MAKEJOBS"
Expand Down Expand Up @@ -159,12 +159,12 @@ cd "${BASE_BUILD_DIR}/elements-$HOST"

bash -c "./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG" || ( (cat config.log) && false)

# ELEMENTS FIXME: fix fix in order to correctly run it #30454
# ELEMENTS FIXME: fix fix in order to correctly run it #30454
# # Folder where the build is done.
# BASE_BUILD_DIR=${BASE_BUILD_DIR:-$BASE_SCRATCH_DIR/build-$HOST}
# mkdir -p "${BASE_BUILD_DIR}"
# cd "${BASE_BUILD_DIR}"
#
#
# BITCOIN_CONFIG_ALL="$BITCOIN_CONFIG_ALL -DENABLE_EXTERNAL_SIGNER=ON -DCMAKE_INSTALL_PREFIX=$BASE_OUTDIR"


Expand Down
2 changes: 1 addition & 1 deletion contrib/devtools/deterministic-fuzz-coverage/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ fn deterministic_coverage(
.success();
if !same {
eprintln!();
eprintln!("The coverage was not determinstic between runs.");
eprintln!("The coverage was not deterministic between runs.");
eprintln!("{}", err);
eprintln!("Exiting.");
exit(1);
Expand Down
Empty file modified contrib/guix/libexec/build.sh
100644 → 100755
Empty file.
22 changes: 11 additions & 11 deletions contrib/merge-prs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ PR_PREFIX="bitcoin/bitcoin"
# Set your git worktree location here. This is where the merges will be done, and where you should checkout the merged-master branch.
WORKTREE="/home/byron/code/elements-worktree"

# Set your parallellism during build/test. You probably want as many cores as possible.
# Set your parallelism during build/test. You probably want as many cores as possible.
# Parallel functional tests can somewhat exceed your core count, depends on the build machine CPU/RAM.
PARALLEL_BUILD=23 # passed to make -j
PARALLEL_TEST=46 # passed to test_runner.py --jobs
Expand Down Expand Up @@ -142,7 +142,7 @@ echo start > merge.log

quietly () {
if [[ "$VERBOSE" == "1" ]]; then
date | tee --append merge.log
date | tee --append merge.log
time "$@" 2>&1 | tee --append merge.log
else
chronic "$@"
Expand All @@ -158,7 +158,7 @@ notify () {
echo "$MESSAGE"
fi
if [[ "$2" == "1" ]]; then
exit 1
exit 1
fi
}

Expand All @@ -170,7 +170,7 @@ do
CHAIN=$(echo "$line" | cut -d ' ' -f 4)
PR_ID=$(echo "$line" | grep -o -P "#\d+")

GIT_HEAD=$(git rev-parse HEAD)
GIT_HEAD=$(git rev-parse HEAD)

## Do it
if [[ "$1" == "list-only" ]]; then
Expand Down Expand Up @@ -207,13 +207,13 @@ do
)
for STOPPER in "${STOPPERS[@]}"
do
if [[ "$PR_ID" == *"$STOPPER"* ]]; then
echo "Found $STOPPER in $PR_ID! Exiting."
notify "hit stopper, exiting"
exit 1
else
echo "Didn't find $STOPPER in $PR_ID. Continuing."
fi
if [[ "$PR_ID" == *"$STOPPER"* ]]; then
echo "Found $STOPPER in $PR_ID! Exiting."
notify "hit stopper, exiting"
exit 1
else
echo "Didn't find $STOPPER in $PR_ID. Continuing."
fi
done

if [[ "$SKIP_MERGE" == "1" ]]; then
Expand Down
2 changes: 0 additions & 2 deletions src/bench/mempool_eviction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
#include <memory>
#include <vector>

#include <primitives/transaction.h>

static void AddTx(const CTransactionRef& tx, const CAmount& nFee, CTxMemPool& pool) EXCLUSIVE_LOCKS_REQUIRED(cs_main, pool.cs)
{
int64_t nTime = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
#include <util/moneystr.h>
#include <util/strencodings.h>
#include <util/string.h>
#include <crypto/sha256.h>

#include <cassert>
#include <cstdint>
#include <limits>
#include <stdexcept>
#include <vector>
#include <bitcoin-build-config.h> // IWYU pragma: keep

using util::SplitString;

Expand Down
1 change: 1 addition & 0 deletions src/chainparamsbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <util/chaintype.h>

#include <assert.h>
#include <bitcoin-build-config.h> // IWYU pragma: keep

void SetupChainParamsBaseOptions(ArgsManager& argsman)
{
Expand Down
1 change: 0 additions & 1 deletion src/chainparamsbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <cstdint>
#include <util/chaintype.h>

#include <cstdint>
#include <memory>
#include <string>

Expand Down
1 change: 1 addition & 0 deletions src/common/args.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <string>
#include <utility>
#include <variant>
#include <bitcoin-build-config.h> // IWYU pragma: keep

#ifdef LIQUID
const char * const BITCOIN_CONF_FILENAME = "liquid.conf";
Expand Down
2 changes: 1 addition & 1 deletion src/confidential_validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ std::optional<std::pair<ScriptError, std::string>> CSurjectionCheck::operator()(
error = SCRIPT_ERR_SURJECTION;
return std::make_pair(error, std::move(debug_str));
}

return std::nullopt;
}

Expand Down
8 changes: 4 additions & 4 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)
if (chain.chain_type == ChainType::TESTNET) {
LogInfo("Warning: Support for testnet3 is deprecated and will be removed in an upcoming release. Consider switching to testnet4.\n");
}

if (!fs::is_directory(args.GetBlocksDirPath())) {
return InitError(strprintf(_("Specified blocks directory \"%s\" does not exist."), args.GetArg("-blocksdir", "")));
}
Expand Down Expand Up @@ -1146,7 +1146,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)
} catch (const std::exception& e) {
return InitError(Untranslated(strprintf("Error in -assetdir: %s\n", e.what())));
}

const std::vector<std::string> test_options = args.GetArgs("-test");
if (!test_options.empty()) {
if (chainparams.GetChainTypeMeta().chain_type != ChainType::REGTEST && chainparams.GetChainTypeMeta().chain_type != ChainType::CUSTOM) {
Expand Down Expand Up @@ -1515,7 +1515,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
node.scheduler = std::make_unique<CScheduler>();
assert(!node.reverification_scheduler);
node.reverification_scheduler = std::make_unique<CScheduler>();

auto& scheduler = *node.scheduler;

// Start the lightweight task scheduler thread
Expand Down Expand Up @@ -1572,7 +1572,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)

// ELEMENTS:
policyAsset = CAsset(uint256S(gArgs.GetArg("-feeasset", chainparams.GetConsensus().pegged_asset.GetHex())));

// Check port numbers
if (!CheckHostPortOptions(args)) return false;

Expand Down
3 changes: 2 additions & 1 deletion src/kernel/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <type_traits>

#include <assert.h>
#include <bitcoin-build-config.h> // IWYU pragma: keep

using util::SplitString;
using namespace util::hex_literals;
Expand Down Expand Up @@ -538,7 +539,7 @@ class CTestNet4Params : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_SIMPLICITY].nStartTime = Consensus::BIP9Deployment::NEVER_ACTIVE;
consensus.vDeployments[Consensus::DEPLOYMENT_SIMPLICITY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
consensus.vDeployments[Consensus::DEPLOYMENT_SIMPLICITY].min_activation_height = 0; // No activation delay

consensus.nMinimumChainWork = uint256{"0000000000000000000000000000000000000000000001d6dce8651b6094e4c1"};
consensus.defaultAssumeValid = uint256{"0000000000003ed4f08dbdf6f7d6b271a6bcffce25675cb40aa9fa43179a89f3"}; // 72600

Expand Down
1 change: 1 addition & 0 deletions src/kernel/chainparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <unordered_map>
#include <utility>
#include <vector>
#include <bitcoin-build-config.h> // IWYU pragma: keep

typedef std::map<int, uint256> MapCheckpoints;

Expand Down
2 changes: 1 addition & 1 deletion src/policy/policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ std::vector<uint32_t> GetDust(const CTransaction& tx, CFeeRate dust_relay_rate)
{
std::vector<uint32_t> dust_outputs;
for (uint32_t i{0}; i < tx.vout.size(); ++i) {
// ELEMENTS: check explicity
// ELEMENTS: check explicitly
const auto& output = tx.vout[i];
if (output.nAsset.IsExplicit() && output.nAsset.GetAsset() != ::policyAsset) continue;
if (IsDust(output, dust_relay_rate)) dust_outputs.push_back(i);
Expand Down
1 change: 1 addition & 0 deletions src/qt/guiconstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <chrono>
#include <cstdint>
#include <bitcoin-build-config.h> // IWYU pragma: keep

using namespace std::chrono_literals;

Expand Down
1 change: 1 addition & 0 deletions src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
#include <optional>
#include <string>
#include <vector>
#include <bitcoin-build-config.h> // IWYU pragma: keep

#if defined(Q_OS_MACOS)

Expand Down
1 change: 1 addition & 0 deletions src/qt/networkstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <util/chaintype.h>

#include <QApplication>
#include <bitcoin-build-config.h> // IWYU pragma: keep

static const struct {
const ChainType networkId;
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ static RPCHelpMan getnewblockhex()
options.min_tx_age = std::chrono::seconds(required_wait);
options.proposed_entry = proposed;
options.commit_scripts = data_commitments;

std::unique_ptr<CBlockTemplate> pblocktemplate(BlockAssembler(chainman.ActiveChainstate(), node.mempool.get(), options).CreateNewBlock());
if (!pblocktemplate.get()) {
throw JSONRPCError(RPC_INTERNAL_ERROR, "Wallet keypool empty");
Expand Down
1 change: 1 addition & 0 deletions src/rpc/request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <stdexcept>
#include <string>
#include <vector>
#include <bitcoin-build-config.h> // IWYU pragma: keep

/**
* JSON-RPC protocol. Bitcoin speaks version 1.0 for maximum compatibility,
Expand Down
1 change: 1 addition & 0 deletions src/test/argsman_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <vector>

#include <boost/test/unit_test.hpp>
#include <bitcoin-build-config.h> // IWYU pragma: keep

using util::ToString;

Expand Down
1 change: 1 addition & 0 deletions src/test/fuzz/bloom_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <limits>
#include <optional>
#include <vector>
#include <bitcoin-build-config.h> // IWYU pragma: keep

FUZZ_TARGET(bloom_filter)
{
Expand Down
1 change: 1 addition & 0 deletions src/test/fuzz/deserialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <optional>
#include <stdexcept>
#include <stdint.h>
#include <bitcoin-build-config.h> // IWYU pragma: keep

using node::SnapshotMetadata;

Expand Down
1 change: 1 addition & 0 deletions src/test/fuzz/psbt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <optional>
#include <string>
#include <vector>
#include <bitcoin-build-config.h> // IWYU pragma: keep

using node::AnalyzePSBT;
using node::PSBTAnalysis;
Expand Down
1 change: 1 addition & 0 deletions src/test/fuzz/rbf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <optional>
#include <string>
#include <vector>
#include <bitcoin-build-config.h> // IWYU pragma: keep

namespace {
const BasicTestingSetup* g_setup;
Expand Down
2 changes: 1 addition & 1 deletion src/txmempool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigne
}
}
}

if (m_opts.signals) {
m_opts.signals->MempoolTransactionsRemovedForBlock(txs_removed_for_block, nBlockHeight);
}
Expand Down
1 change: 1 addition & 0 deletions src/util/chaintype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <cassert>
#include <optional>
#include <string>
#include <bitcoin-build-config.h> // IWYU pragma: keep

std::string ChainTypeToString(ChainType chain)
{
Expand Down
1 change: 1 addition & 0 deletions src/util/chaintype.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <optional>
#include <string>
#include <bitcoin-build-config.h> // IWYU pragma: keep

enum class ChainType {
MAIN,
Expand Down
8 changes: 4 additions & 4 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ class MemPoolAccept
// or the peg-in paid enough subsidy
return true;
}

ValidationCache& GetValidationCache()
{
return m_active_chainstate.m_chainman.m_validation_cache;
Expand Down Expand Up @@ -3095,7 +3095,7 @@ bool Chainstate::ConnectBlock(const CBlock& block, BlockValidationState& state,
Ticks<SecondsDouble>(m_chainman.time_connect),
Ticks<MillisecondsDouble>(m_chainman.time_connect) / m_chainman.num_blocks_total);

// todo:
// todo:
// CAmountMap block_reward = fee_map;
// block_reward[consensusParams.subsidy_asset] += GetBlockSubsidy(pindex->nHeight, consensusParams);
// if (!MoneyRange(block_reward)) {
Expand All @@ -3105,7 +3105,7 @@ bool Chainstate::ConnectBlock(const CBlock& block, BlockValidationState& state,
// if (!VerifyCoinbaseAmount(*(block.vtx[0]), block_reward)) {
// LogPrintf("ERROR: ConnectBlock(): coinbase pays too much\n");
// return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-cb-amount");

CAmountMap block_reward = fee_map;
block_reward[consensusParams.subsidy_asset] += GetBlockSubsidy(pindex->nHeight, consensusParams);
if (!MoneyRange(block_reward) && state.IsValid()) {
Expand Down Expand Up @@ -4832,7 +4832,7 @@ static bool ContextualCheckBlockHeader(const CBlockHeader& block, BlockValidatio
LogPrintf("ERROR: %s: block height in header is incorrect (got %d, expected %d)\n", __func__, block.block_height, nHeight);
return state.Invalid(BlockValidationResult::BLOCK_INVALID_HEADER, "bad-header-height");
}

// Testnet4 and regtest only: Check timestamp against prev for difficulty-adjustment
// blocks to prevent timewarp attacks (see https://github.com/bitcoin/bitcoin/pull/15482).
if (consensusParams.enforce_BIP94) {
Expand Down
1 change: 0 additions & 1 deletion src/validation.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <consensus/amount.h>
#include <cuckoocache.h>
#include <deploymentstatus.h>
#include <kernel/chain.h>
#include <kernel/chainparams.h>
#include <kernel/chainstatemanager_opts.h>
#include <kernel/cs_main.h> // IWYU pragma: export
Expand Down
6 changes: 3 additions & 3 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2628,15 +2628,15 @@ std::optional<PSBTError> CWallet::SignPSBT(PartiallySignedTransaction& psbtx, bo
std::optional<common::PSBTError> CWallet::FillPSBT(PartiallySignedTransaction& psbtx, bool& complete, int sighash_type, bool sign, bool bip32derivs, bool imbalance_ok, size_t* n_signed, bool include_explicit, bool finalize) const
{
complete = false;

std::optional<common::PSBTError> error;
error = FillPSBTData(psbtx, bip32derivs, include_explicit);
if (error) {
return error;
}

// For backwards compatibility, do not check if amounts balance before signing in this case.

error = SignPSBT(psbtx, complete, sighash_type, sign, imbalance_ok, bip32derivs, n_signed, finalize);
if (error) {
return error;
Expand Down
2 changes: 0 additions & 2 deletions test/bitcoin_functional/functional/.gitignore

This file was deleted.

Loading
Loading