Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
91588a8
fix: annotate `getblockchaininfo[softforks]` as `OBJ_DYN`
kwvg Oct 11, 2025
a0b38e9
test: drop extra `generate`s from `wallet_signrawtransactionwithwallet`
kwvg Oct 17, 2025
8b4a1aa
merge bitcoin#23345: Drop unneeded dependencies for bitcoin-wallet tool
kwvg Oct 17, 2025
bf69eb9
merge bitcoin#23508: Add getdeploymentinfo RPC
kwvg Oct 17, 2025
9e79118
merge bitcoin#24187: Followups for getdeploymentinfo
kwvg Oct 11, 2025
780afc1
merge bitcoin#24528: rename getdeploymentinfo status-next to status_next
kwvg Oct 11, 2025
9547c59
merge bitcoin#24579: Fix getblockchaininfo/getdeploymentinfo RPC docs
kwvg Mar 16, 2022
8411522
partial bitcoin#24595: move g_versionbitscache global to ChainstateMa…
kwvg Jan 18, 2022
2b7d35b
merge bitcoin#24410: Split hashing/index `GetUTXOStats` codepaths, de…
kwvg Oct 16, 2025
34b0b25
merge bitcoin#15936: Expose settings.json methods to GUI
kwvg Apr 29, 2019
358bdfe
merge bitcoin#25748: Avoid copies in FlatSigningProvider Merge
kwvg Jul 30, 2022
b8ffa84
merge bitcoin#25863: remove unused norm_prv parameter in `descriptor_…
kwvg Oct 17, 2025
a34f9c6
merge bitcoin#24051: bitcoin-{cli,tx,util} don't need UPnP, NAT-PMP, …
kwvg Jan 12, 2022
cc73b1e
merge bitcoin#25315: Add warning on first startup if free disk space …
kwvg Oct 17, 2025
0f6e1f4
merge bitcoin#26624: Rename local variable to distinguish it from typ…
kwvg Dec 2, 2022
de5b4bf
merge bitcoin#26894: Remove redundant key_to_p2pkh call
kwvg Jan 16, 2023
908eb3d
merge bitcoin#25412: add `/deploymentinfo` endpoint
kwvg Oct 14, 2025
11da4e6
refactor: move `BLSInit()` call out of `SanityChecks()`
kwvg Oct 19, 2025
b1608e3
merge bitcoin#25065: Introduce `kernel::Context`, encapsulate global …
kwvg Mar 3, 2022
43ed9f5
ArgsMan: Add Get*Arg functions returning optional
kwvg Oct 24, 2021
99c6cc8
scripted-diff: Rename DEFAULT_MAX_MEMPOOL_SIZE to indicate SI unit
kwvg Oct 11, 2025
dcae1ba
pool: Add and use MemPoolOptions, ApplyArgsManOptions
kwvg Oct 11, 2025
541e865
mempool: Pass in -maxmempool instead of referencing gArgs
kwvg Oct 11, 2025
22253dc
mempool: Make GetMinFee() with custom size protected
kwvg Jun 27, 2022
4fc9efd
init: Only determine maxmempool once
kwvg May 18, 2022
47eba1b
mempool: Pass in -mempoolexpiry instead of referencing gArgs
kwvg Oct 28, 2021
7d7e411
scripted-diff: Rename DEFAULT_MEMPOOL_EXPIRY to indicate time unit
kwvg Oct 11, 2025
70c76dd
scripted-diff: Rename anc/desc size limit vars to indicate SI unit
kwvg Oct 11, 2025
bc44502
mempool: Introduce (still-unused) MemPoolLimits
kwvg Mar 18, 2022
f5f829d
mempoolaccept: Use limits from mempool in constructor
kwvg Jun 7, 2022
805cebe
node/ifaces: Use existing MemPoolLimits
kwvg May 18, 2022
a95b52f
mempool: Use m_limit for UpdateTransactionsFromBlock
kwvg May 18, 2022
cded1db
init: Remove redundant -*mempool*, -limit* queries
kwvg Jun 6, 2022
3713f01
fees: Pass in a filepath instead of referencing gArgs
kwvg Dec 8, 2021
530c5c2
merge bitcoin#25290: Decouple `CTxMemPool` from `ArgsManager`
kwvg Oct 11, 2025
ab2b76f
interfaces, refactor: Add more block information to block connected n…
kwvg Jan 13, 2022
143b222
indexes, refactor: Pass Chain interface instead of CChainState class …
kwvg Oct 20, 2025
2093000
indexes, refactor: Remove CBlockIndex* uses in coinstatsindex LookUpO…
kwvg Jan 17, 2022
f7d8d71
indexes, refactor: Remove CBlockIndex* uses in index Init methods
kwvg Jan 17, 2022
208135b
refactor: drop `fV20Active` where possible
kwvg Oct 20, 2025
3829c41
indexes, refactor: Remove CBlockIndex* uses in index WriteBlock methods
kwvg Jan 18, 2022
e2816c8
indexes, refactor: Remove CBlockIndex* uses in index Rewind methods
kwvg Jan 18, 2022
f0108ea
indexes, refactor: Remove CChainState use in index CommitInternal method
kwvg Jan 18, 2022
788ce27
merge bitcoin#25494: Stop using node internal types
kwvg Oct 20, 2025
9386c57
merge bitcoin#25439: Return incrementalrelayfee in getmempoolinfo
kwvg Jun 21, 2022
a26dd12
merge bitcoin#25648: Remove all policy globals
kwvg Oct 20, 2025
fec94a5
merge bitcoin#25772: Add missing static to IsStandardTx helper
kwvg Oct 20, 2025
e5a3519
merge bitcoin#25222: Pass reference to LookUpStats
kwvg May 26, 2022
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
1 change: 1 addition & 0 deletions ci/dash/lint-tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ cd "${BASE_ROOT_DIR}/build-ci/dashcore-${BUILD_TARGET}"
iwyu_tool.py \
"src/compat" \
"src/init" \
"src/node/mempool_args.cpp" \
"src/rpc/fees.cpp" \
"src/rpc/signmessage.cpp" \
"src/test/fuzz/txorphan.cpp" \
Expand Down
6 changes: 6 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1502,6 +1502,12 @@ if test "$use_usdt" != "no"; then
fi
AM_CONDITIONAL([ENABLE_USDT_TRACEPOINTS], [test "$use_usdt" = "yes"])

if test "$build_bitcoind$bitcoin_enable_qt$use_bench$use_tests" = "nononono"; then
use_upnp=no
use_natpmp=no
use_zmq=no
fi

dnl Check for libminiupnpc (optional)
if test "$use_upnp" != "no"; then
TEMP_CPPFLAGS="$CPPFLAGS"
Expand Down
9 changes: 9 additions & 0 deletions doc/REST-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ Returns various state info regarding block chain processing.
Only supports JSON as output format.
Refer to the `getblockchaininfo` RPC help for details.

#### Deployment info
`GET /rest/deploymentinfo.json`
`GET /rest/deploymentinfo/<BLOCKHASH>.json`

Returns an object containing various state info regarding deployments of
consensus changes at the current chain tip, or at <BLOCKHASH> if provided.
Only supports JSON as output format.
Refer to the `getdeploymentinfo` RPC help for details.

#### Query UTXO set
- `GET /rest/getutxos/<TXID>-<N>/<TXID>-<N>/.../<TXID>-<N>.<bin|hex|json>`
- `GET /rest/getutxos/checkmempool/<TXID>-<N>/<TXID>-<N>/.../<TXID>-<N>.<bin|hex|json>`
Expand Down
17 changes: 17 additions & 0 deletions doc/release-notes-6901.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Updated RPCs
------------

- Information on soft fork status has been moved from `getblockchaininfo`
to the new `getdeploymentinfo` RPC which allows querying soft fork status at any
block, rather than just at the chain tip. Inclusion of soft fork
status in `getblockchaininfo` can currently be restored using the
configuration `-deprecatedrpc=softforks`, but this will be removed in
a future release. Note that in either case, the `status` field
now reflects the status of the current block rather than the next
block.

New REST endpoint
-----------------

- A new `/rest/deploymentinfo` endpoint has been added for fetching various
state info regarding deployments of consensus changes.
36 changes: 31 additions & 5 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,12 @@ BITCOIN_CORE_H = \
instantsend/instantsend.h \
instantsend/lock.h \
instantsend/signing.h \
kernel/chain.h \
kernel/checks.h \
kernel/coinstats.h \
kernel/context.h \
kernel/mempool_limits.h \
kernel/mempool_options.h \
key.h \
key_io.h \
limitedmap.h \
Expand Down Expand Up @@ -304,21 +310,22 @@ BITCOIN_CORE_H = \
node/caches.h \
node/chainstate.h \
node/coin.h \
node/coinstats.h \
node/connection_types.h \
node/context.h \
node/eviction.h \
node/interface_ui.h \
node/mempool_args.h \
node/miner.h \
node/minisketchwrapper.h \
node/psbt.h \
node/transaction.h \
node/txreconciliation.h \
node/interface_ui.h \
node/utxo_snapshot.h \
noui.h \
outputtype.h \
policy/feerate.h \
policy/fees.h \
policy/fees_args.h \
policy/packages.h \
policy/policy.h \
policy/settings.h \
Expand Down Expand Up @@ -526,6 +533,10 @@ libbitcoin_node_a_SOURCES = \
instantsend/instantsend.cpp \
instantsend/lock.cpp \
instantsend/signing.cpp \
kernel/chain.cpp \
kernel/checks.cpp \
kernel/coinstats.cpp \
kernel/context.cpp \
llmq/blockprocessor.cpp \
llmq/commitment.cpp \
llmq/context.cpp \
Expand Down Expand Up @@ -557,19 +568,20 @@ libbitcoin_node_a_SOURCES = \
node/caches.cpp \
node/chainstate.cpp \
node/coin.cpp \
node/coinstats.cpp \
node/connection_types.cpp \
node/context.cpp \
node/eviction.cpp \
node/interface_ui.cpp \
node/interfaces.cpp \
node/mempool_args.cpp \
node/miner.cpp \
node/minisketchwrapper.cpp \
node/psbt.cpp \
node/transaction.cpp \
node/txreconciliation.cpp \
node/interface_ui.cpp \
noui.cpp \
policy/fees.cpp \
policy/fees_args.cpp \
policy/packages.cpp \
policy/policy.cpp \
policy/settings.cpp \
Expand Down Expand Up @@ -1082,7 +1094,21 @@ dash_wallet_SOURCES = bitcoin-wallet.cpp
dash_wallet_CPPFLAGS = $(bitcoin_bin_cppflags)
dash_wallet_CXXFLAGS = $(bitcoin_bin_cxxflags)
dash_wallet_LDFLAGS = $(bitcoin_bin_ldflags)
dash_wallet_LDADD = $(LIBBITCOIN_WALLET_TOOL) $(bitcoin_bin_ldadd)
dash_wallet_LDADD = \
$(LIBBITCOIN_WALLET_TOOL) \
$(LIBBITCOIN_WALLET) \
$(LIBBITCOIN_COMMON) \
$(LIBBITCOIN_UTIL) \
$(LIBUNIVALUE) \
$(LIBBITCOIN_CONSENSUS) \
$(LIBBITCOIN_CRYPTO) \
$(LIBDASHBLS) \
$(LIBSECP256K1) \
$(BACKTRACE_LIB) \
$(BOOST_LIBS) \
$(BDB_LIBS) \
$(SQLITE_LIBS) \
$(GMP_LIBS)

if TARGET_WINDOWS
dash_wallet_SOURCES += dash-wallet-res.rc
Expand Down
2 changes: 1 addition & 1 deletion src/bench/duplicate_inputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static void DuplicateInputs(benchmark::Bench& bench)
coinbaseTx.vin[0].prevout.SetNull();
coinbaseTx.vout.resize(1);
coinbaseTx.vout[0].scriptPubKey = SCRIPT_PUB;
coinbaseTx.vout[0].nValue = GetBlockSubsidyInner(block.nBits, nHeight, chainparams.GetConsensus(), /*fV20Active=*/ false);
coinbaseTx.vout[0].nValue = GetBlockSubsidyInner(block.nBits, nHeight, chainparams.GetConsensus(), /*is_v20_active_override=*/false);
coinbaseTx.vin[0].scriptSig = CScript() << nHeight << OP_0;

naughtyTx.vout.resize(1);
Expand Down
5 changes: 4 additions & 1 deletion src/bitcoind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,14 @@ static bool AppInit(NodeContext& node, int argc, char* argv[])
// InitError will have been called with detailed error, which ends up on console
return false;
}
if (!AppInitSanityChecks())

node.kernel = std::make_unique<kernel::Context>();
if (!AppInitSanityChecks(*node.kernel))
{
// InitError will have been called with detailed error, which ends up on console
return false;
}

if (args.GetBoolArg("-daemon", DEFAULT_DAEMON) || args.GetBoolArg("-daemonwait", DEFAULT_DAEMONWAIT)) {
#if HAVE_DECL_FORK
tfm::format(std::cout, PACKAGE_NAME " starting\n");
Expand Down
8 changes: 3 additions & 5 deletions src/bls/bls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ bool CBLSSignature::Recover(Span<CBLSSignature> sigs, Span<CBLSId> ids)
}

#ifndef BUILD_BITCOIN_INTERNAL

static std::once_flag init_flag;
static mt_pooled_secure_allocator<uint8_t>* secure_allocator_instance;
static void create_secure_allocator()
Expand Down Expand Up @@ -423,12 +422,11 @@ static void secure_free(void* p)
size_t n = *reinterpret_cast<size_t*>(ptr);
return get_secure_allocator().deallocate(ptr, n);
}
#endif
#endif // BUILD_BITCOIN_INTERNAL

bool BLSInit()
void BLSInit()
{
#ifndef BUILD_BITCOIN_INTERNAL
bls::BLS::SetSecureAllocator(secure_allocate, secure_free);
#endif
return true;
#endif // BUILD_BITCOIN_INTERNAL
}
2 changes: 1 addition & 1 deletion src/bls/bls.h
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,6 @@ class CBLSLazyPublicKeyVersionWrapper {

using BLSVerificationVectorPtr = std::shared_ptr<std::vector<CBLSPublicKey>>;

bool BLSInit();
void BLSInit();

#endif // DASH_CRYPTO_BLS_H
2 changes: 1 addition & 1 deletion src/evo/creditpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ CCreditPoolDiff::CCreditPoolDiff(CCreditPool starter, const CBlockIndex* pindexP

if (DeploymentActiveAfter(pindexPrev, consensusParams, Consensus::DEPLOYMENT_MN_RR)) {
// If credit pool exists, it means v20 is activated
platformReward = PlatformShare(GetMasternodePayment(pindexPrev->nHeight + 1, blockSubsidy, /*fV20Active=*/ true));
platformReward = PlatformShare(GetMasternodePayment(pindexPrev->nHeight + 1, blockSubsidy, consensusParams));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/evo/specialtxman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ bool CSpecialTxProcessor::CheckCreditPoolDiffForBlock(const CBlock& block, const
if (!DeploymentActiveAt(*pindex, m_consensus_params, Consensus::DEPLOYMENT_V20)) return true;

try {
const CAmount blockSubsidy = GetBlockSubsidy(pindex, m_consensus_params);
const CAmount blockSubsidy = GetBlockSubsidy(pindex->nHeight, pindex->pprev->nBits, m_consensus_params);
const auto creditPoolDiff = GetCreditPoolDiffForBlock(m_cpoolman, m_chainman.m_blockman, m_qman, block,
pindex->pprev, m_consensus_params, blockSubsidy, state);
if (!creditPoolDiff.has_value()) return false;
Expand Down
4 changes: 1 addition & 3 deletions src/governance/classes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,10 @@ CAmount CSuperblock::GetPaymentsLimit(const CChain& active_chain, int nBlockHeig
return 0;
}

const bool fV20Active{nBlockHeight >= consensusParams.V20Height};

// min subsidy for high diff networks and vice versa
int nBits = consensusParams.fPowAllowMinDifficultyBlocks ? UintToArith256(consensusParams.powLimit).GetCompact() : 1;
// some part of all blocks issued during the cycle goes to superblock, see GetBlockSubsidy
CAmount nSuperblockPartOfSubsidy = GetSuperblockSubsidyInner(nBits, nBlockHeight - 1, consensusParams, fV20Active);
CAmount nSuperblockPartOfSubsidy = GetSuperblockSubsidyInner(nBits, nBlockHeight - 1, consensusParams);
CAmount nPaymentsLimit = nSuperblockPartOfSubsidy * consensusParams.nSuperblockCycle;
LogPrint(BCLog::GOBJECT, "CSuperblock::GetPaymentsLimit -- Valid superblock height %d, payments max %lld\n", nBlockHeight, nPaymentsLimit);

Expand Down
63 changes: 44 additions & 19 deletions src/index/base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

#include <chainparams.h>
#include <index/base.h>
#include <interfaces/chain.h>
#include <kernel/chain.h>
#include <node/blockstorage.h>
#include <node/context.h>
#include <node/interface_ui.h>
#include <shutdown.h>
#include <tinyformat.h>
Expand Down Expand Up @@ -32,6 +35,15 @@ static void FatalError(const char* fmt, const Args&... args)
StartShutdown();
}

CBlockLocator GetLocator(interfaces::Chain& chain, const uint256& block_hash)
{
CBlockLocator locator;
bool found = chain.findBlock(block_hash, interfaces::FoundBlock().locator(locator));
assert(found);
assert(!locator.IsNull());
return locator;
}

BaseIndex::DB::DB(const fs::path& path, size_t n_cache_size, bool f_memory, bool f_wipe, bool f_obfuscate) :
CDBWrapper(path, n_cache_size, f_memory, f_wipe, f_obfuscate)
{}
Expand All @@ -50,6 +62,9 @@ void BaseIndex::DB::WriteBestBlock(CDBBatch& batch, const CBlockLocator& locator
batch.Write(DB_BEST_BLOCK, locator);
}

BaseIndex::BaseIndex(std::unique_ptr<interfaces::Chain> chain)
: m_chain{std::move(chain)} {}

BaseIndex::~BaseIndex()
{
Interrupt();
Expand Down Expand Up @@ -165,12 +180,15 @@ void BaseIndex::ThreadSync()
}

CBlock block;
interfaces::BlockInfo block_info = kernel::MakeBlockInfo(pindex);
if (!ReadBlockFromDisk(block, pindex, consensus_params)) {
FatalError("%s: Failed to read block %s from disk",
__func__, pindex->GetBlockHash().ToString());
return;
} else {
block_info.data = &block;
}
if (!WriteBlock(block, pindex)) {
if (!CustomAppend(block_info)) {
FatalError("%s: Failed to write block %s to index database",
__func__, pindex->GetBlockHash().ToString());
return;
Expand Down Expand Up @@ -201,22 +219,20 @@ void BaseIndex::ThreadSync()

bool BaseIndex::Commit()
{
CDBBatch batch(GetDB());
if (!CommitInternal(batch) || !GetDB().WriteBatch(batch)) {
return error("%s: Failed to commit latest %s state", __func__, GetName());
}
return true;
}

bool BaseIndex::CommitInternal(CDBBatch& batch)
{
LOCK(cs_main);
// Don't commit anything if we haven't indexed any block yet
// (this could happen if init is interrupted).
if (m_best_block_index == nullptr) {
return false;
bool ok = m_best_block_index != nullptr;
if (ok) {
CDBBatch batch(GetDB());
ok = CustomCommit(batch);
if (ok) {
GetDB().WriteBestBlock(batch, GetLocator(*m_chain, m_best_block_index.load()->GetBlockHash()));
ok = GetDB().WriteBatch(batch);
}
}
if (!ok) {
return error("%s: Failed to commit latest %s state", __func__, GetName());
}
GetDB().WriteBestBlock(batch, m_chainstate->m_chain.GetLocator(m_best_block_index));
return true;
}

Expand All @@ -225,6 +241,10 @@ bool BaseIndex::Rewind(const CBlockIndex* current_tip, const CBlockIndex* new_ti
assert(current_tip == m_best_block_index);
assert(current_tip->GetAncestor(new_tip->nHeight) == new_tip);

if (!CustomRewind({current_tip->GetBlockHash(), current_tip->nHeight}, {new_tip->GetBlockHash(), new_tip->nHeight})) {
return false;
}

// In the case of a reorg, ensure persisted block locator is not stale.
// Pruning has a minimum of 288 blocks-to-keep and getting the index
// out of sync may be possible but a users fault.
Expand Down Expand Up @@ -272,8 +292,8 @@ void BaseIndex::BlockConnected(const std::shared_ptr<const CBlock>& block, const
return;
}
}

if (WriteBlock(*block, pindex)) {
interfaces::BlockInfo block_info = kernel::MakeBlockInfo(pindex, block.get());
if (CustomAppend(block_info)) {
// Setting the best block index is intentionally the last step of this
// function, so BlockUntilSyncedToCurrentChain callers waiting for the
// best block index to be updated can rely on the block being fully
Expand Down Expand Up @@ -354,13 +374,18 @@ void BaseIndex::Interrupt()
m_interrupt();
}

bool BaseIndex::Start(CChainState& active_chainstate)
bool BaseIndex::Start()
{
m_chainstate = &active_chainstate;
// m_chainstate member gives indexing code access to node internals. It is
// removed in followup https://github.com/bitcoin/bitcoin/pull/24230
m_chainstate = &m_chain->context()->chainman->ActiveChainstate();
// Need to register this ValidationInterface before running Init(), so that
// callbacks are not missed if Init sets m_synced to true.
RegisterValidationInterface(this);
if (!Init()) {
if (!Init()) return false;

const CBlockIndex* index = m_best_block_index.load();
if (!CustomInit(index ? std::make_optional(interfaces::BlockKey{index->GetBlockHash(), index->nHeight}) : std::nullopt)) {
return false;
}

Expand Down
Loading
Loading