Skip to content

Conversation

@l0rinc
Copy link
Contributor

@l0rinc l0rinc commented Jan 12, 2025

This change is part of [IBD] - Tracking PR for speeding up Initial Block Download

Summary

When the in-memory UTXO set is flushed to LevelDB (after IBD or AssumeUTXO load), it does so in batches to manage memory usage during the flush.
A hidden -dbbatchsize config option exists to modify this value. This PR only changes the default from 16 MiB to 32 MiB.
Using a larger default reduces the overhead of many small writes and improves I/O efficiency (especially on HDDs). It may also help LevelDB optimize writes more effectively (e.g., via internal ordering).
The change is meant to speed up a critical part of IBD: dumping the accumulated work to disk.

Context

The UTXO set has grown significantly since 2017, when the original fixed 16 MiB batch size was chosen.

With the current multi-gigabyte UTXO set and the common practice of using larger -dbcache values, the fixed 16 MiB batch size leads to several inefficiencies:

  • Flushing the entire UTXO set often requires thousands of separate 16 MiB write operations.
  • Particularly on HDDs, the cumulative disk seek time and per-operation overhead from numerous small writes significantly slow down the flushing process.
  • Each WriteBatch call incurs internal LevelDB overhead (e.g., MemTable handling, compaction triggering logic). More frequent, smaller batches amplify this cumulative overhead.

Flush times of 20-30 minutes are not uncommon, even on capable hardware.

Considerations

As noted by sipa, flushing involves a temporary memory usage increase as the batch is prepared. A larger batch size naturally leads to a larger peak during this phase. Crashing due to OOM during a flush is highly undesirable, but now that #30611 is merged, the most we'd lose is the first hour of IBD.

Increasing the LevelDB write batch size from 16 to 32 MiB raised the measured peaks by ~70 MiB in my tests during UTXO dump. The option remains hidden, and users can always override it.

The increased peak memory usage (detailed below) is primarily attributed to LevelDB's leveldb::Arena (backing MemTables) and the temporary storage of serialized batch data (e.g., std::string in CDBBatch::WriteImpl).

Performance gains are most pronounced on systems with slower I/O (HDDs), but some SSDs also show measurable improvements.

Measurements:

AssumeUTXO proxy, multiple runs with error bars (flushing time is faster that the measured loading + flushing):

  • Raspberry Pi, dbcache=500: ~30% faster with 32 MiB vs 16 MiB, peak +~75 MiB and still < 1 GiB.
  • i7 + HDD: results vary by dbcache, but 32 MiB usually beats 16 MiB and tracks close to 64 MiB without the larger peak.
  • i9 + fast NVMe: roughly flat across 16/32/64 MiB. The goal here is to avoid regressions, which holds.

Reproducer:

# Set up a clean demo environment
rm -rfd demo && mkdir -p demo

# Build Bitcoin Core
cmake -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build -j$(nproc)

# Start bitcoind with minimal settings without mempool and internet connection
build/bin/bitcoind -datadir=demo -stopatheight=1
build/bin/bitcoind -datadir=demo -blocksonly=1 -connect=0 -dbcache=3000 -daemon

# Load the AssumeUTXO snapshot, making sure the path is correct
# Expected output includes `"coins_loaded": 184821030`
build/bin/bitcoin-cli -datadir=demo -rpcclienttimeout=0 loadtxoutset ~/utxo-880000.dat

# Stop the daemon and verify snapshot flushes in the logs
build/bin/bitcoin-cli -datadir=demo stop
grep "FlushSnapshotToDisk: completed" demo/debug.log

This PR originally proposed 64 MiB, then a dynamic size, but both were dropped: 64 MiB increased peaks more than desired on low-RAM systems, and the dynamic variant underperformed across mixed hardware. 32 MiB is a simpler default that captures most of the gains with a modest peak increase.

For more details see: #31645 (comment)

While the PR isn't about IBD in general, rather about a critical section of it, I have measured a reindex-chainstate until 900k blocks, showing a 1% overall speedup:

Details
COMMITS="e6bfd95d5012fa1d91f83bf4122cb292afd6277f af653f321b135a59e38794b537737ed2f4a0040b"; \
STOP=900000; DBCACHE=10000; \
CC=gcc; CXX=g++; \
BASE_DIR="/mnt/my_storage"; DATA_DIR="$BASE_DIR/BitcoinData"; LOG_DIR="$BASE_DIR/logs"; \
(echo ""; for c in $COMMITS; do git fetch -q origin $c && git log -1 --pretty='%h %s' $c || exit 1; done; echo "") && \
hyperfine \
  --sort command \
  --runs 1 \
  --export-json "$BASE_DIR/rdx-$(sed -E 's/(\w{8})\w+ ?/\1-/g;s/-$//'<<<"$COMMITS")-$STOP-$DBCACHE-$CC.json" \
  --parameter-list COMMIT ${COMMITS// /,} \
  --prepare "killall bitcoind 2>/dev/null; rm -f $DATA_DIR/debug.log; git checkout {COMMIT}; git clean -fxd; git reset --hard && \
    cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release && ninja -C build bitcoind && \
    ./build/bin/bitcoind -datadir=$DATA_DIR -stopatheight=$STOP -dbcache=1000 -printtoconsole=0; sleep 10" \
  --cleanup "cp $DATA_DIR/debug.log $LOG_DIR/debug-{COMMIT}-$(date +%s).log" \
  "COMPILER=$CC ./build/bin/bitcoind -datadir=$DATA_DIR -stopatheight=$STOP -dbcache=$DBCACHE -reindex-chainstate -blocksonly -connect=0 -printtoconsole=0"

e6bfd95d50 Merge bitcoin-core/gui#881: Move `FreespaceChecker` class into its own module
af653f321b coins: derive `batch_write_bytes` from `-dbcache` when unspecified

Benchmark 1: COMPILER=gcc ./build/bin/bitcoind -datadir=/mnt/my_storage/BitcoinData -stopatheight=900000 -dbcache=10000 -reindex-chainstate -blocksonly -connect=0 -printtoconsole=0 (COMMIT = e6bfd95d5012fa1d91f83bf4122cb292afd6277f)
  Time (abs ≡):        25016.346 s               [User: 30333.911 s, System: 826.463 s]
 
Benchmark 2: COMPILER=gcc ./build/bin/bitcoind -datadir=/mnt/my_storage/BitcoinData -stopatheight=900000 -dbcache=10000 -reindex-chainstate -blocksonly -connect=0 -printtoconsole=0 (COMMIT = af653f321b135a59e38794b537737ed2f4a0040b)
  Time (abs ≡):        24801.283 s               [User: 30328.665 s, System: 834.110 s]
 
Relative speed comparison
        1.01          COMPILER=gcc ./build/bin/bitcoind -datadir=/mnt/my_storage/BitcoinData -stopatheight=900000 -dbcache=10000 -reindex-chainstate -blocksonly -connect=0 -printtoconsole=0 (COMMIT = e6bfd95d5012fa1d91f83bf4122cb292afd6277f)
        1.00          COMPILER=gcc ./build/bin/bitcoind -datadir=/mnt/my_storage/BitcoinData -stopatheight=900000 -dbcache=10000 -reindex-chainstate -blocksonly -connect=0 -printtoconsole=0 (COMMIT = af653f321b135a59e38794b537737ed2f4a0040b)

@l0rinc
Copy link
Contributor Author

l0rinc commented Jan 12, 2025

Visual representation of the AssumeUTXO 840k measurements (16MiB was the previous default, 64MiB is the proposed one):

image
Bash script to run assumeUTXO with differenty values
set -e

killall bitcoind 2>/dev/null || true
cd /mnt/my_storage/bitcoin
mkdir -p demo

for i in 1 2; do
  for dbcache in 440 5000 30000; do
    for dbbatchsize in 4194304 8388608 16777216 33554432 67108864 134217728 268435456; do
      cmake -B build -DCMAKE_BUILD_TYPE=Release > /dev/null 2>&1
      cmake --build build -j"$(nproc)" > /dev/null 2>&1

      build/bin/bitcoin-cli -datadir=demo stop 2>/dev/null || true
      killall bitcoind 2>/dev/null || true
      sleep 10

      rm -rfd demo/chainstate demo/chainstate_snapshot
      build/bin/bitcoind -datadir=demo -stopatheight=1 -printtoconsole=0 && rm -f demo/debug.log

      echo "Starting bitcoind with dbcache=$dbcache"
      build/bin/bitcoind -datadir=demo -blocksonly=1 -connect=0 -dbcache="$dbcache" -dbbatchsize="$dbbatchsize" -daemon -printtoconsole=0
      sleep 10

      echo "Loading UTXO snapshot..."
      build/bin/bitcoin-cli -datadir=demo -rpcclienttimeout=0 loadtxoutset /mnt/my_storage/utxo-880000.dat | grep -q '"coins_loaded": 184821030' || { echo "ERROR: Wrong number of coins loaded"; exit 1; }
      build/bin/bitcoin-cli -datadir=demo stop
      killall bitcoind 2>/dev/null || true
      sleep 10

      out_file="results_i_${i}_dbcache_${dbcache}_dbbatchsize_${dbbatchsize}.log"
      echo "Collecting logs in ${out_file}"
      grep "FlushSnapshotToDisk: completed" demo/debug.log | tee -a "${out_file}"
      echo "---" >> "${out_file}"

      echo "Done with i=${i}, dbcache=${dbcache}, dbbatchsize=${dbbatchsize}"
      echo
    done
  done
done

echo "All runs complete. Logs are saved in results_dbcache*.log files."
Python file to sum the flush times
import re
import sys


def parse_bitcoin_debug_log(file_path):
    results = []

    flush_sum = 0.0
    flush_count = 0

    version_pattern = re.compile(r"Bitcoin Core version")
    flush_pattern = re.compile(r'FlushSnapshotToDisk: completed \(([\d.]+)ms\)')

    def finalize_current_block():
        nonlocal flush_sum, flush_count
        if flush_count > 0:
            results.append((flush_sum, flush_count))
        flush_sum = 0.0
        flush_count = 0

    try:
        with open(file_path, 'r') as file:
            for line in file:
                if version_pattern.search(line):
                    finalize_current_block()
                    continue

                match_flush = flush_pattern.search(line)
                if match_flush:
                    flush_ms = float(match_flush.group(1))
                    flush_sum += flush_ms
                    flush_count += 1
    except Exception as e:
        print(f"Error reading file: {e}")
        sys.exit(1)

    finalize_current_block()

    return results


if __name__ == "__main__":
    if len(sys.argv) < 2:
        print("Usage: python3 script.py <path_to_debug_log>")
        sys.exit(1)

    file_path = sys.argv[1]
    parsed_results = parse_bitcoin_debug_log(file_path)

    for total_flush_time, total_flush_calls in parsed_results:
        print(f"{total_flush_time:.2f},{total_flush_calls}")

Edit:
Reran the benchmarks on a Hetzner Linux machine with the new AssumeUTXO 880k set, parsing the logged flush times and plotting the results.
For different dbcache (440, 5000, 30000) and dbbatchsize (4-256MiB range, 16MiB (current) and 64MiB (proposed) are highlighted and trendline is added for clarity), each one twice for stability:
image
image
image


Sorting the same measurements (and calculating the sums) might give us a better understanding of the trends:
image
image
image

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 12, 2025

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31645.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK TheCharlatan, laanwj, andrewtoth
Stale ACK ryanofsky, jonatack, hodlinator

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #32427 ((RFC) kernel: Replace leveldb-based BlockTreeDB with flat-file based store by TheCharlatan)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@sipa
Copy link
Member

sipa commented Jan 13, 2025

FWIW, the reason for the existence of the batch size behavior (as opposed to just writing everything at once) is that it causes a memory usage spike at flush time. If that spike exceeds the memory the process can allocate it causes a crash, at a particularly bad time (may require a replay to fix, which may be slower than just reprocessing the blocks).

Given that changing this appears to improve performance it's worth considering of course, but it is essentially a trade-off between speed and memory usage spiking.

@1440000bytes

This comment was marked as abuse.

@sipa
Copy link
Member

sipa commented Jan 13, 2025

There is a config option. This is about changing the dedault.

@1440000bytes

This comment was marked as abuse.

@l0rinc
Copy link
Contributor Author

l0rinc commented Jan 13, 2025

If that spike exceeds the memory the process can allocate it causes a crash

Thanks for the context, @sipa.
On the positive side, the extra allocation is constant (or at least non-proportional with the usage) and it's narrowing the window for other crashes during flushing (#30611 will also likely help here).
This change may also enable another one (that I'm currently re-measuring to be sure), which seems to halve the remaining flush time again (by sorting the values in descending order before adding them to the batch), e.g. from 30 minutes (on master) to 10 (with this change included).

@luke-jr
Copy link
Member

luke-jr commented Jan 14, 2025

Can we predict the memory usage spike size? Presumably as we flush, that releases memory, which allows for a larger and larger batch size?

@l0rinc
Copy link
Contributor Author

l0rinc commented Jan 16, 2025

Since profilers may not catch these short-lived spikes, I've instrumented the code, loaded the UTXO set (as described the in the PR), parsed the logged flushing times and memory usages and plotted them against each other to see the effect of the batch size increase.

txdb.cpp flush time and memory instrumentation:
diff --git a/src/txdb.cpp b/src/txdb.cpp
--- a/src/txdb.cpp	(revision d249a353be58868d41d2a7c57357038ffd779eba)
+++ b/src/txdb.cpp	(revision bae884969d35469320ed9967736eb15b5d87edff)
@@ -90,7 +90,81 @@
     return vhashHeadBlocks;
 }

+/*
+ * Author:  David Robert Nadeau
+ * Site:    http://NadeauSoftware.com/
+ * License: Creative Commons Attribution 3.0 Unported License
+ *          http://creativecommons.org/licenses/by/3.0/deed.en_US
+ */
+#if defined(_WIN32)
+#include <windows.h>
+#include <psapi.h>
+
+#elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__))
+#include <unistd.h>
+#include <sys/resource.h>
+
+#if defined(__APPLE__) && defined(__MACH__)
+#include <mach/mach.h>
+
+#elif (defined(_AIX) || defined(__TOS__AIX__)) || (defined(__sun__) || defined(__sun) || defined(sun) && (defined(__SVR4) || defined(__svr4__)))
+#include <fcntl.h>
+#include <procfs.h>
+
+#elif defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__)
+#include <stdio.h>
+
+#endif
+
+#else
+#error "Cannot define  getCurrentRSS( ) for an unknown OS."
+#endif
+
+/**
+ * Returns the current resident set size (physical memory use) measured
+ * in bytes, or zero if the value cannot be determined on this OS.
+ */
+size_t getCurrentRSS( )
+{
+#if defined(_WIN32)
+    /* Windows -------------------------------------------------- */
+    PROCESS_MEMORY_COUNTERS info;
+    GetProcessMemoryInfo( GetCurrentProcess( ), &info, sizeof(info) );
+    return (size_t)info.WorkingSetSize;
+
+#elif defined(__APPLE__) && defined(__MACH__)
+    /* OSX ------------------------------------------------------ */
+    struct mach_task_basic_info info;
+    mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT;
+    if ( task_info( mach_task_self( ), MACH_TASK_BASIC_INFO,
+        (task_info_t)&info, &infoCount ) != KERN_SUCCESS )
+        return (size_t)0L;      /* Can't access? */
+    return (size_t)info.resident_size;
+
+#elif defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__)
+    /* Linux ---------------------------------------------------- */
+    long rss = 0L;
+    FILE* fp = NULL;
+    if ( (fp = fopen( "/proc/self/statm", "r" )) == NULL )
+        return (size_t)0L;      /* Can't open? */
+    if ( fscanf( fp, "%*s%ld", &rss ) != 1 )
+    {
+        fclose( fp );
+        return (size_t)0L;      /* Can't read? */
+    }
+    fclose( fp );
+    return (size_t)rss * (size_t)sysconf( _SC_PAGESIZE);
+
+#else
+    /* AIX, BSD, Solaris, and Unknown OS ------------------------ */
+    return (size_t)0L;          /* Unsupported. */
+#endif
+}
+
 bool CCoinsViewDB::BatchWrite(CoinsViewCacheCursor& cursor, const uint256 &hashBlock) {
+    const auto start = std::chrono::steady_clock::now();
+    size_t max_mem{getCurrentRSS()};
+
     CDBBatch batch(*m_db);
     size_t count = 0;
     size_t changed = 0;
@@ -129,7 +203,11 @@
         it = cursor.NextAndMaybeErase(*it);
         if (batch.SizeEstimate() > m_options.batch_write_bytes) {
             LogDebug(BCLog::COINDB, "Writing partial batch of %.2f MiB\n", batch.SizeEstimate() * (1.0 / 1048576.0));
+
+            max_mem = std::max(max_mem, getCurrentRSS());
             m_db->WriteBatch(batch);
+            max_mem = std::max(max_mem, getCurrentRSS());
+
             batch.Clear();
             if (m_options.simulate_crash_ratio) {
                 static FastRandomContext rng;
@@ -146,8 +224,16 @@
     batch.Write(DB_BEST_BLOCK, hashBlock);

     LogDebug(BCLog::COINDB, "Writing final batch of %.2f MiB\n", batch.SizeEstimate() * (1.0 / 1048576.0));
+
+    max_mem = std::max(max_mem, getCurrentRSS());
     bool ret = m_db->WriteBatch(batch);
+    max_mem = std::max(max_mem, getCurrentRSS());
+
     LogDebug(BCLog::COINDB, "Committed %u changed transaction outputs (out of %u) to coin database...\n", (unsigned int)changed, (unsigned int)count);
+    if (changed > 0) {
+        const auto end{std::chrono::steady_clock::now()};
+        LogInfo("BatchWrite took=%dms, maxMem=%dMiB", duration_cast<std::chrono::milliseconds>(end - start).count(), max_mem >> 20);
+    }
     return ret;
 }
Python script to load the utxo set, parse the logs and create the flush and memory plots
import os
import re
import shutil
import statistics
import subprocess
import time
import datetime
import argparse
import matplotlib.pyplot as plt  # python3.12 -m pip install matplotlib --break-system-packages

# Regex to parse logs
BATCHWRITE_REGEX = re.compile(r"^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z) BatchWrite took=(\d+)ms, maxMem=(\d+)MiB")


def parse_log(archive):
    """Parse the log file to extract elapsed times, flush times, and memory usage."""
    start_time = None
    elapsed, batchwrite_times, usage_snapshots = [], [], []
    with open(archive, "r") as f:
        for line in f:
            if m := BATCHWRITE_REGEX.search(line):
                dt = datetime.datetime.strptime(m.group(1), "%Y-%m-%dT%H:%M:%SZ")
                if start_time is None:
                    start_time = dt
                elapsed.append((dt - start_time).total_seconds())
                batchwrite_times.append(int(m.group(2)))
                usage_snapshots.append(int(m.group(3)))
    return elapsed, batchwrite_times, usage_snapshots


def plot_results(results, output_dir):
    """Create separate plots for flush times and memory usage."""
    if len(results) != 2:
        print("plot_results() requires exactly 2 runs for comparison.")
        return

    (dbbatch0, elapsed0, flush0, mem0) = results[0]
    (dbbatch1, elapsed1, flush1, mem1) = results[1]

    # Compute percentage differences
    avg_flush0, avg_flush1 = statistics.mean(flush0), statistics.mean(flush1)
    max_mem0, max_mem1 = max(mem0), max(mem1)
    flush_improvement = round(((avg_flush0 - avg_flush1) / avg_flush0) * 100, 1)
    mem_increase = round(((max_mem1 - max_mem0) / max_mem0) * 100, 1)

    # Plot flush times
    plt.figure(figsize=(16, 8))
    plt.plot(elapsed0, flush0, color="red", linestyle="-", label=f"Flush Times (dbbatch={dbbatch0})")
    plt.axhline(y=avg_flush0, color="red", linestyle="--", alpha=0.5, label=f"Mean ({dbbatch0})={avg_flush0:.1f}ms")
    plt.plot(elapsed1, flush1, color="orange", linestyle="-", label=f"Flush Times (dbbatch={dbbatch1})")
    plt.axhline(y=avg_flush1, color="orange", linestyle="--", alpha=0.5, label=f"Mean ({dbbatch1})={avg_flush1:.1f}ms")
    plt.title(f"Flush Times (dbbatch {dbbatch0} vs {dbbatch1}) — {abs(flush_improvement)}% {'faster' if flush_improvement > 0 else 'slower'}")
    plt.xlabel("Elapsed Time (seconds)")
    plt.ylabel("Flush Times (ms)")
    plt.legend()
    plt.grid(True)
    plt.tight_layout()
    flush_out_file = os.path.join(output_dir, "plot_flush_times.png")
    plt.savefig(flush_out_file)
    print(f"Flush Times plot saved as {flush_out_file}")
    plt.close()

    # Plot memory usage
    plt.figure(figsize=(16, 8))
    plt.plot(elapsed0, mem0, color="blue", linestyle="-", label=f"Memory (dbbatch={dbbatch0})")
    plt.axhline(y=max_mem0, color="blue", linestyle="--", alpha=0.5, label=f"Max Mem ({dbbatch0})={max_mem0}MiB")
    plt.plot(elapsed1, mem1, color="green", linestyle="-", label=f"Memory (dbbatch={dbbatch1})")
    plt.axhline(y=max_mem1, color="green", linestyle="--", alpha=0.5, label=f"Max Mem ({dbbatch1})={max_mem1}MiB")
    plt.title(f"Memory Usage (dbbatch {dbbatch0} vs {dbbatch1}) — {abs(mem_increase)}% {'higher' if mem_increase > 0 else 'lower'}")
    plt.xlabel("Elapsed Time (seconds)")
    plt.ylabel("Memory Usage (MiB)")
    plt.legend()
    plt.grid(True)
    plt.tight_layout()
    mem_out_file = os.path.join(output_dir, "plot_memory_usage.png")
    plt.savefig(mem_out_file)
    print(f"Memory Usage plot saved as {mem_out_file}")
    plt.close()


def loadtxoutset(dbbatchsize, datadir, bitcoin_cli, bitcoind, utxo_file):
    """Load the UTXO set and run the Bitcoin node."""
    archive = os.path.join(datadir, f"results_dbbatch-{dbbatchsize}.log")

    # Skip if logs already exist
    if os.path.exists(archive):
        print(f"Log file {archive} already exists. Skipping loadtxoutset for dbbatchsize={dbbatchsize}.")
        return

    os.makedirs(datadir, exist_ok=True)
    debug_log = os.path.join(datadir, "debug.log")

    try:
        print("Cleaning up previous run")
        for subdir in ["chainstate", "chainstate_snapshot"]:
            shutil.rmtree(os.path.join(datadir, subdir), ignore_errors=True)

        print("Preparing UTXO load")
        subprocess.run([bitcoind, f"-datadir={datadir}", "-stopatheight=1"], cwd=bitcoin_core_path)
        os.remove(debug_log)

        print(f"Starting bitcoind with dbbatchsize={dbbatchsize}")
        subprocess.run([bitcoind, f"-datadir={datadir}", "-daemon", "-blocksonly=1", "-connect=0", f"-dbbatchsize={dbbatchsize}", f"-dbcache={440}"], cwd=bitcoin_core_path)
        time.sleep(5)

        print("Loading UTXO set")
        subprocess.run([bitcoin_cli, f"-datadir={datadir}", "loadtxoutset", utxo_file], cwd=bitcoin_core_path)
    except Exception as e:
        print(f"Error during loadtxoutset for dbbatchsize={dbbatchsize}: {e}")
        raise
    finally:
        print("Stopping bitcoind...")
        subprocess.run([bitcoin_cli, f"-datadir={datadir}", "stop"], cwd=bitcoin_core_path, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
        time.sleep(5)

    shutil.copy2(debug_log, archive)
    print(f"Archived logs to {archive}")


if __name__ == "__main__":
    # Parse script arguments
    parser = argparse.ArgumentParser(description="Benchmark Bitcoin dbbatchsize configurations.")
    parser.add_argument("--utxo-file", required=True, help="Path to the UTXO snapshot file.")
    parser.add_argument("--bitcoin-core-path", required=True, help="Path to the Bitcoin Core project directory.")
    args = parser.parse_args()

    utxo_file = args.utxo_file
    bitcoin_core_path = args.bitcoin_core_path
    datadir = os.path.join(bitcoin_core_path, "demo")
    debug_log = os.path.join(datadir, "debug.log")
    bitcoin_cli = os.path.join(bitcoin_core_path, "build/src/bitcoin-cli")
    bitcoind = os.path.join(bitcoin_core_path, "build/src/bitcoind")

    # Build Bitcoin Core
    print("Building Bitcoin Core...")
    subprocess.run(["cmake", "-B", "build", "-DCMAKE_BUILD_TYPE=Release"], cwd=bitcoin_core_path, check=True)
    subprocess.run(["cmake", "--build", "build", "-j", str(os.cpu_count())], cwd=bitcoin_core_path, check=True)

    # Run tests for each dbbatchsize
    results = []
    for dbbatchsize in [16777216, 67108864]:  # Original and proposed
        loadtxoutset(dbbatchsize, datadir, bitcoin_cli, bitcoind, utxo_file)
        archive = os.path.join(datadir, f"results_dbbatch-{dbbatchsize}.log")
        elapsed, batchwrite_times, usage_snapshots = parse_log(archive)
        results.append((dbbatchsize, elapsed, batchwrite_times, usage_snapshots))

    # Plot results
    plot_results(results, bitcoin_core_path)
    print("All configurations processed.")

For standard dbcache values the results are very close (though the memory measurements aren't as scientific as I'd like them to be (probably because there is still enough memory), some runs even indicate that 16MiB consumes a bit more memory than the 64MiB version), but the trend seems to be clear from the produced plots: the batch writes are faster (and seem more predictable) with bigger batches, while the memory usage is only slightly higher.

plot_flush_times
plot_memory_usage

Is there any other way that you'd like me to test this @sipa, @luke-jr, @1440000bytes?

@luke-jr
Copy link
Member

luke-jr commented Jan 16, 2025

I think those graphs need to be on height rather than seconds. The larger dbbatchsize making it faster means it gets further in the chain, leading to the higher max at the end...

I would expect both lines to be essentially overlapping except during flushes.

@l0rinc
Copy link
Contributor Author

l0rinc commented Jan 17, 2025

I would expect both lines to be essentially overlapping except during flushes.

I was only measuring the memory here during flushes. There is no direct height available there, but if we instrument UpdateTipLog instead (and fetch some data from the assumeUTXO height), we'd get:

dbbatchsize=16MiB:

image

dbbatchsize=64MiB (+ experimental sorting):

image


overlapped (blue 16, green 64):
image

luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Feb 22, 2025
The UTXO set has grown significantly, and flushing it from memory to LevelDB often takes over 20 minutes after a successful IBD with large dbcache values.
The final UTXO set is written to disk in batches, which LevelDB sorts into SST files.
By increasing the default batch size, we can reduce overhead from repeated compaction cycles, minimize constant overhead per batch, and achieve more sequential writes.

Experiments with different batch sizes (loaded via assumeutxo at block 840k, then measuring final flush time) show that 64 MiB batches significantly reduce flush time without notably increasing memory usage:

| dbbatchsize | flush_sum (ms) |
|-------------|----------------|
| 8 MiB       | ~240,000       |
| 16 MiB      | ~220,000       |
| 32 MiB      | ~200,000       |
| *64 MiB*    | *~150,000*     |
| 128 MiB     | ~156,000       |
| 256 MiB     | ~166,000       |
| 512 MiB     | ~186,000       |
| 1 GiB       | ~186,000       |

Checking the impact of a `-reindex-chainstate` with `-stopatheight=878000` and `-dbcache=30000` gives:
16 << 20
```
2025-01-12T07:31:05Z Flushed fee estimates to fee_estimates.dat.
2025-01-12T07:31:05Z [warning] Flushing large (26 GiB) UTXO set to disk, it may take several minutes
2025-01-12T07:53:51Z Shutdown: done
```
Flush time: 22 minutes and 46 seconds

64 >> 20
```
2025-01-12T18:30:00Z Flushed fee estimates to fee_estimates.dat.
2025-01-12T18:30:00Z [warning] Flushing large (26 GiB) UTXO set to disk, it may take several minutes
2025-01-12T18:44:43Z Shutdown: done
```
Flush time: ~14 minutes 43 seconds.

Github-Pull: bitcoin#31645
Rebased-From: d249a35
@l0rinc l0rinc changed the title optimization: increase default LevelDB write batch size to 64 MiB [IBD] Flush UXTOs in bigger batches Mar 12, 2025
@l0rinc l0rinc changed the title [IBD] Flush UXTOs in bigger batches [IBD] flush UXTOs in bigger batches Mar 12, 2025
Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

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

Code review ACK 868413340f8d6058d74186b65ac3498d6b7f254a

If that spike exceeds the memory the process can allocate it causes a crash, at a particularly bad time (may require a replay to fix, which may be slower than just reprocessing the blocks).

It is difficult for me to have a sense of how safe this change is but I'd hope we are not currently pushing systems so close to the edge that using an extra 48mb will cause them to start crashing. This does seem like a nice performance improvment if it doesn't cause crashes.

In theory, we could dynamically limit the batch size based on available memory to mitigate the risk of crashes. However, since the batch size is already small and further increases don’t provide much additional benefit (per the commit message), that added complexity probably isn’t worth it here.

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

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

Concept ACK on raising the default from 16 to 67 megabytes (note that -dbbatchsize is a hidden -help-debug config option). Testing.

$ ./build/bin/bitcoind -help-debug | grep -A2 dbbatch
  -dbbatchsize
       Maximum database write batch size in bytes (default: 67108864)

@l0rinc l0rinc force-pushed the l0rinc/utxo-dump-batching branch from af653f3 to 956a6b4 Compare August 7, 2025 00:34
Copy link
Contributor Author

@l0rinc l0rinc left a comment

Choose a reason for hiding this comment

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

Pushed the remaining nits that I promised a long time ago :)

Re-rebased, you can re-review with git range-diff af653f3...956a6b4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added braces

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Extracted min/max and added some comments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ended up with extracting min/max and adding an assert

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

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

ACK 956a6b454704120ba4c482d7157db89c20130e75

  • Note that #31645 (comment) refers to a change of approach from several months ago, prior to my previous review -- in that context, I found the comment confusing
  • I would suggest not rebasing if there is no merge conflict; this eases reviewing the diff (and after, I'll usually rebase the PR branch to master locally anyway)
  • Happy to re-ack if you take the review suggestions

Copy link
Member

Choose a reason for hiding this comment

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

In 6fa584fde601dd8fc966fa2496084203c9503215, seems it would make sense to place these two together.

  //! Suggested default amount of cache reserved for the kernel (bytes)
 static constexpr size_t DEFAULT_KERNEL_CACHE{450_MiB};
+//! Batch size of DEFAULT_KERNEL_CACHE
+static constexpr size_t DEFAULT_DB_CACHE_BATCH{16_MiB};
 //! Max memory allocated to block tree DB specific cache (bytes)
 static constexpr size_t MAX_BLOCK_DB_CACHE{2_MiB};
 //! Max memory allocated to coin DB specific cache (bytes)
 static constexpr size_t MAX_COINS_DB_CACHE{8_MiB};
 
-//! The batch size of DEFAULT_KERNEL_CACHE
-static constexpr size_t DEFAULT_DB_CACHE_BATCH{16_MiB};
-
 namespace kernel {
 struct CacheSizes {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could, I'll do it next time I push

Copy link
Contributor

@hodlinator hodlinator left a comment

Choose a reason for hiding this comment

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

Concept ACK 956a6b454704120ba4c482d7157db89c20130e75

Have not confirmed the improvements in IBD speedup.

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Could motivate the min value:

Suggested change
BOOST_CHECK_EQUAL(node::GetDbBatchSize(4_MiB), 16'777'216);
static_assert(MIN_DB_CACHE == 4_MiB);
BOOST_CHECK_EQUAL(node::GetDbBatchSize(4_MiB), 16'777'216);

Comment on lines 1088 to 1108
Copy link
Contributor

Choose a reason for hiding this comment

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

Might as well make use of constexpr?

Suggested change
BOOST_AUTO_TEST_CASE(db_batch_sizes)
{
BOOST_REQUIRE_EQUAL(node::GetDbBatchSize(DEFAULT_KERNEL_CACHE), DEFAULT_DB_CACHE_BATCH);
BOOST_REQUIRE_EQUAL(node::GetDbBatchSize(0_MiB), DEFAULT_DB_CACHE_BATCH);
BOOST_CHECK_EQUAL(node::GetDbBatchSize(4_MiB), 16'777'216);
BOOST_CHECK_EQUAL(node::GetDbBatchSize(10_MiB), 16'777'216);
BOOST_CHECK_EQUAL(node::GetDbBatchSize(45_MiB), 16'777'216);
BOOST_CHECK_EQUAL(node::GetDbBatchSize(100_MiB), 16'777'216);
BOOST_CHECK_EQUAL(node::GetDbBatchSize(450_MiB), 16'777'216);
BOOST_CHECK_EQUAL(node::GetDbBatchSize(1000_MiB), 33'554'432);
BOOST_CHECK_EQUAL(node::GetDbBatchSize(2000_MiB), 67'108'864);
BOOST_CHECK_EQUAL(node::GetDbBatchSize(3000_MiB), 100'663'296);
#if SIZE_MAX > UINT32_MAX
BOOST_CHECK_EQUAL(node::GetDbBatchSize(4500_MiB), 167'772'160);
BOOST_CHECK_EQUAL(node::GetDbBatchSize(7000_MiB), 251'658'240);
BOOST_CHECK_EQUAL(node::GetDbBatchSize(10000_MiB), 268'435'456);
BOOST_CHECK_EQUAL(node::GetDbBatchSize(45000_MiB), 268'435'456);
#endif
}
// Verify DB batch sizes:
static_assert(node::GetDbBatchSize(DEFAULT_KERNEL_CACHE) == DEFAULT_DB_CACHE_BATCH);
static_assert(node::GetDbBatchSize(0_MiB) == DEFAULT_DB_CACHE_BATCH);
static_assert(node::GetDbBatchSize(4_MiB) == 16'777'216);
static_assert(node::GetDbBatchSize(10_MiB) == 16'777'216);
static_assert(node::GetDbBatchSize(45_MiB) == 16'777'216);
static_assert(node::GetDbBatchSize(100_MiB) == 16'777'216);
static_assert(node::GetDbBatchSize(450_MiB) == 16'777'216);
static_assert(node::GetDbBatchSize(1000_MiB) == 33'554'432);
static_assert(node::GetDbBatchSize(2000_MiB) == 67'108'864);
static_assert(node::GetDbBatchSize(3000_MiB) == 100'663'296);
#if SIZE_MAX > UINT32_MAX
static_assert(node::GetDbBatchSize(4500_MiB) == 167'772'160);
static_assert(node::GetDbBatchSize(7000_MiB) == 251'658'240);
static_assert(node::GetDbBatchSize(10000_MiB) == 268'435'456);
static_assert(node::GetDbBatchSize(45000_MiB) == 268'435'456);
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not a fan of compile time tests, they're usually harder to debug, when needed.
And these are as fast as they get, we wouldn't be saving any time. So it would be inconsistent with other tests, while being slightly harder to debug and not any faster.
Do you think there's any tangible advantage there?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would just default to testing at compile time:

  • No need to (re)run ctest/test_bitcoin to exercise checks.
  • Only run when compilation unit is (re)built. Not re-run when iterating on test code in other compilation units.
  • Inconsistency might push other tests towards being converted to compile time, which I would say is a positive effect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are extremely fast tests, keeping the usual test format has more advantages in my opinion.
If you have a string preference or if other reviewers prefer that, I don't mind changing, but I don't think the current one has measurable disadvantages compared to the suggestion - while being more in-line with how we usually test, making GetDbBatchSize easily debuggable (often helps with understanding if you can step through it).

Copy link
Contributor

@hodlinator hodlinator left a comment

Choose a reason for hiding this comment

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

ACK 956a6b454704120ba4c482d7157db89c20130e75

Change scales hidden -dbbatchsize by the -dbcache setting if unset.

Compared IBD until block 910'000 from local peer in 3 variations (both nodes on SSD, edit: both on NVMe); PR change for -dbcache of 450 vs 45'000, and base commit for PR with 45'000.

  • Baseline of -dbcache=450 averaged 267mins across 3 runs.
  • -dbcache=45000 without this PR averaged 241mins across 3 runs (these were probably the runs where I was doing the least work on the other node).
  • -dbcache=45000 with this PR averaged 233mins across 3 runs.

That looks like at least an average 3% improvement in the -dbcache=45000 case for me. Still nice.

Edit: Did another run with PR and -dbcache=45000 and without working on any of the nodes, got a wall time of 218min. Strengthening the impression that this PR is beneficial.

Run log

With PR changes (956a6b454704120ba4c482d7157db89c20130e75):

rm -rf ~/.bitcoin && time ./build/bin/bitcoind -connect=workstation.lan -dbcache=45000 -stopatheight=910000

real	238m57.330s
user	527m48.667s
sys	19m49.001s

rm -rf ~/.bitcoin && time ./build/bin/bitcoind -connect=workstation.lan -dbcache=450 -stopatheight=910000

real	266m16.473s
user	636m6.859s
sys	32m59.252s

repeated:

real	273m25.548s
user	640m5.442s
sys	31m58.674s

rm -rf ~/.bitcoin && time ./build/bin/bitcoind -connect=workstation.lan -dbcache=45000 -stopatheight=910000

real	228m12.943s
user	509m52.682s
sys	17m10.000s

rm -rf ~/.bitcoin && time ./build/bin/bitcoind -connect=workstation.lan -dbcache=450 -stopatheight=910000

real	261m47.071s
user	631m42.243s
sys	31m34.241s

PR base (d767503):

rm -rf ~/.bitcoin && time ./build/bin/bitcoind -connect=workstation.lan -dbcache=45000 -stopatheight=910000

real	246m56.108s
user	522m46.642s
sys	20m24.343s

again:

real	232m41.467s
user	508m7.763s
sys	19m16.589s

again:

real	242m17.316s
user	506m25.625s
sys	18m45.029s

=> 241

Again on PR:

rm -rf ~/.bitcoin && time ./build/bin/bitcoind -connect=workstation.lan -dbcache=45000 -stopatheight=910000

real	232m37.784s
user	490m58.944s
sys	18m3.817s

Averages:

450 runs:
266+273+262 = 267mins

45'000 without PR runs:
247+233+242 / 3 = 241min

45'000 with PR runs:
239+228+233 / 3 = 233min

Comment on lines 1088 to 1108
Copy link
Contributor

Choose a reason for hiding this comment

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

I would just default to testing at compile time:

  • No need to (re)run ctest/test_bitcoin to exercise checks.
  • Only run when compilation unit is (re)built. Not re-run when iterating on test code in other compilation units.
  • Inconsistency might push other tests towards being converted to compile time, which I would say is a positive effect.

l0rinc added 2 commits August 28, 2025 10:09
The constant for the default batch size is moved to `kernel/caches.h` to consolidate kernel-related cache constants.
The default database write batch size is increased from 16 MiB to 32 MiB to improve I/O efficiency and performance during UTXO flushes, particularly during Initial Block Download and `assumeutxo` loads.

On systems with slower I/O, a larger batch size reduces overhead from numerous small writes. Measurements show this change provides a modest performance improvement on most hardware during a critical section, with a minimal peak memory increase (approx. 75 MiB on default settings).
@l0rinc l0rinc changed the title [IBD] flush UTXO set in batches proportional to dbcache size [IBD] coins: increase default UTXO flush batch size to 32 MiB Aug 28, 2025
@l0rinc l0rinc force-pushed the l0rinc/utxo-dump-batching branch from 956a6b4 to b6f8c48 Compare August 28, 2025 17:23
@l0rinc
Copy link
Contributor Author

l0rinc commented Aug 28, 2025

Thanks a lot for testing this @hodlinator and @Eunovo.

It seems that different configurations behave differently here, so I've retested a few scenarios on a few different platforms to understand what the performance increase depends on exactly. It's not even a linear speedup (i.e. sometimes 32 MiB is faster, sometimes it's 64 MiB), some dbcache values reliably produce a lot faster results, while others reliably produce slower results for the same config (i.e. the before-after-plot for different dbcache values doesn't look like two parallel lines).

Novo's measurement results showing barely any speedup for `dbcache=1000` image

My recent measurement used assumeutxo loading as a proxy (previous measurements indicated that it's a realistic proxy for dumping utxos), and I ran each independent dbcache size 5 times to have proper error bars.

First, on raspberry pi the difference is obviously a lot better with a bigger batch, even with a tiny memory increase:

bitcoin_benchmark_comparison-batch_pi

for very small dbcache, 64 MiB batch size would make `assumeutxo` load and dump ~59% faster on average on a Pi for 500 MB dbcache, 32 MiB would make it 30% faster
dbcache=500 MB (dynamic batch size would be 17.8 MB)
  371bece67f: 2215.101±198.228 s  use fixed 64_MiB
  0a77b9eee6: 2698.961±108.559 s  use fixed 32_MiB
  1c88f34884: 2880.934±137.068 s  coins: introduce dynamic batch size calculator based on `dbcache` value
  6ca6f3b37b: 3513.171±761.674 s  Merge bitcoin/bitcoin#33241: Update libmultiprocess subtree to fix build issues

dbcache=2500 MB (dynamic batch size would be 88.9 MB)
  0a77b9eee6: 2202.481±100.896 s  use fixed 32_MiB
  6ca6f3b37b: 2277.482±131.931 s  Merge bitcoin/bitcoin#33241: Update libmultiprocess subtree to fix build issues
  1c88f34884: 2313.098±202.818 s  coins: introduce dynamic batch size calculator based on `dbcache` value
  371bece67f: 2360.670±73.818 s  use fixed 64_MiB

For a relatively performant i7 processor with HDD, I'm getting values are all over the place, but it's obvious that the current batch size isn't the best. Looks like dynamic sizing isn't as performant as powers-of-two. The 32 MiB version seems pretty good though.

bitcoin_benchmark_comparison-batch_i7

Details
dbcache=500 MB (dynamic batch size would be 17.8 MB)
  371bece67f: 723.753±74.142 s  use fixed 64_MiB
  0a77b9eee6: 872.229±19.075 s  use fixed 32_MiB
  6ca6f3b37b: 924.901±34.220 s  Merge bitcoin/bitcoin#33241: Update libmultiprocess subtree to fix build issues
  1c88f34884: 927.929±20.000 s  coins: introduce dynamic batch size calculator based on `dbcache` value

dbcache=1000 MB (dynamic batch size would be 35.6 MB)
  371bece67f: 763.976±18.272 s  use fixed 64_MiB
  0a77b9eee6: 780.121±21.817 s  use fixed 32_MiB
  6ca6f3b37b: 850.142±53.788 s  Merge bitcoin/bitcoin#33241: Update libmultiprocess subtree to fix build issues
  1c88f34884: 865.503±48.942 s  coins: introduce dynamic batch size calculator based on `dbcache` value

dbcache=1500 MB (dynamic batch size would be 53.3 MB)
  0a77b9eee6: 741.196±42.555 s  use fixed 32_MiB
  371bece67f: 753.405±23.264 s  use fixed 64_MiB
  1c88f34884: 835.422±16.123 s  coins: introduce dynamic batch size calculator based on `dbcache` value
  6ca6f3b37b: 841.494±27.479 s  Merge bitcoin/bitcoin#33241: Update libmultiprocess subtree to fix build issues

dbcache=2000 MB (dynamic batch size would be 71.1 MB)
  371bece67f: 726.012±25.313 s  use fixed 64_MiB
  6ca6f3b37b: 799.339±29.058 s  Merge bitcoin/bitcoin#33241: Update libmultiprocess subtree to fix build issues
  1c88f34884: 820.236±29.547 s  coins: introduce dynamic batch size calculator based on `dbcache` value
  0a77b9eee6: 858.368±16.452 s  use fixed 32_MiB

dbcache=2500 MB (dynamic batch size would be 88.9 MB)
  371bece67f: 707.112±55.839 s  use fixed 64_MiB
  1c88f34884: 749.380±35.179 s  coins: introduce dynamic batch size calculator based on `dbcache` value
  6ca6f3b37b: 768.356±33.643 s  Merge bitcoin/bitcoin#33241: Update libmultiprocess subtree to fix build issues
  0a77b9eee6: 781.631±25.348 s  use fixed 32_MiB

dbcache=3000 MB (dynamic batch size would be 106.7 MB)
  371bece67f: 704.683±36.839 s  use fixed 64_MiB
  0a77b9eee6: 749.494±14.230 s  use fixed 32_MiB
  6ca6f3b37b: 802.988±29.282 s  Merge bitcoin/bitcoin#33241: Update libmultiprocess subtree to fix build issues
  1c88f34884: 812.413±14.338 s  coins: introduce dynamic batch size calculator based on `dbcache` value

dbcache=3500 MB (dynamic batch size would be 124.4 MB)
  371bece67f: 747.208±31.524 s  use fixed 64_MiB
  0a77b9eee6: 756.109±9.717 s  use fixed 32_MiB
  1c88f34884: 769.228±35.585 s  coins: introduce dynamic batch size calculator based on `dbcache` value
  6ca6f3b37b: 783.391±43.066 s  Merge bitcoin/bitcoin#33241: Update libmultiprocess subtree to fix build issues

dbcache=4000 MB (dynamic batch size would be 142.2 MB)
  0a77b9eee6: 742.536±13.438 s  use fixed 32_MiB
  1c88f34884: 752.711±21.669 s  coins: introduce dynamic batch size calculator based on `dbcache` value
  6ca6f3b37b: 753.414±15.107 s  Merge bitcoin/bitcoin#33241: Update libmultiprocess subtree to fix build issues
  371bece67f: 759.595±15.312 s  use fixed 64_MiB

dbcache=4500 MB (dynamic batch size would be 160.0 MB)
  371bece67f: 722.305±22.894 s  use fixed 64_MiB
  0a77b9eee6: 738.573±28.200 s  use fixed 32_MiB
  1c88f34884: 743.053±12.117 s  coins: introduce dynamic batch size calculator based on `dbcache` value
  6ca6f3b37b: 747.821±16.638 s  Merge bitcoin/bitcoin#33241: Update libmultiprocess subtree to fix build issues

dbcache=5000 MB (dynamic batch size would be 177.8 MB)
  6ca6f3b37b: 707.499±23.626 s  Merge bitcoin/bitcoin#33241: Update libmultiprocess subtree to fix build issues
  1c88f34884: 708.064±21.035 s  coins: introduce dynamic batch size calculator based on `dbcache` value
  0a77b9eee6: 713.495±18.264 s  use fixed 32_MiB
  371bece67f: 723.671±18.868 s  use fixed 64_MiB

dbcache=5500 MB (dynamic batch size would be 195.6 MB)
  371bece67f: 697.942±15.469 s  use fixed 64_MiB
  0a77b9eee6: 705.869±15.561 s  use fixed 32_MiB
  6ca6f3b37b: 797.158±15.429 s  Merge bitcoin/bitcoin#33241: Update libmultiprocess subtree to fix build issues
  1c88f34884: 797.677±17.496 s  coins: introduce dynamic batch size calculator based on `dbcache` value
  • I reran 32_MiB for dbcache=2000 and got the same result again, it doesn't seem to be a measurement error

Also measured on a very performant i9 with a really fast NVMe - making the difference between memory and background storage more blurry.
Here a bigger dbcache doesn't even increase the overall speed, assumeutxo is basically the same speed whatever we do - here the goal is to keep the current speed.

bitcoin_benchmark_comparison-batch_i9

Details

dbcache=500 MB (dynamic batch size would be 17.8 MB)
371bece: 409.650±1.656 s use fixed 64_MiB
0a77b9e: 411.217±4.367 s use fixed 32_MiB
1c88f34: 455.376±1.326 s coins: introduce dynamic batch size calculator based on dbcache value
6ca6f3b: 455.975±1.697 s Merge #33241: Update libmultiprocess subtree to fix build issues

dbcache=1000 MB (dynamic batch size would be 35.6 MB)
371bece: 416.379±1.989 s use fixed 64_MiB
1c88f34: 448.944±6.389 s coins: introduce dynamic batch size calculator based on dbcache value
0a77b9e: 449.627±1.714 s use fixed 32_MiB
6ca6f3b: 456.552±27.444 s Merge #33241: Update libmultiprocess subtree to fix build issues

dbcache=1500 MB (dynamic batch size would be 53.3 MB)
371bece: 400.644±1.372 s use fixed 64_MiB
6ca6f3b: 430.214±3.485 s Merge #33241: Update libmultiprocess subtree to fix build issues
1c88f34: 430.987±4.601 s coins: introduce dynamic batch size calculator based on dbcache value
0a77b9e: 442.139±9.970 s use fixed 32_MiB

dbcache=2000 MB (dynamic batch size would be 71.1 MB)
371bece: 435.944±2.428 s use fixed 64_MiB
6ca6f3b: 443.443±3.007 s Merge #33241: Update libmultiprocess subtree to fix build issues
1c88f34: 446.855±2.847 s coins: introduce dynamic batch size calculator based on dbcache value
0a77b9e: 467.190±4.509 s use fixed 32_MiB

dbcache=2500 MB (dynamic batch size would be 88.9 MB)
6ca6f3b: 431.099±1.968 s Merge #33241: Update libmultiprocess subtree to fix build issues
1c88f34: 431.577±3.782 s coins: introduce dynamic batch size calculator based on dbcache value
371bece: 435.850±9.648 s use fixed 64_MiB
0a77b9e: 461.795±4.254 s use fixed 32_MiB

dbcache=3000 MB (dynamic batch size would be 106.7 MB)
6ca6f3b: 428.011±3.228 s Merge #33241: Update libmultiprocess subtree to fix build issues
1c88f34: 429.848±2.192 s coins: introduce dynamic batch size calculator based on dbcache value
371bece: 431.654±5.198 s use fixed 64_MiB
0a77b9e: 445.446±5.815 s use fixed 32_MiB

dbcache=3500 MB (dynamic batch size would be 124.4 MB)
1c88f34: 453.404±4.046 s coins: introduce dynamic batch size calculator based on dbcache value
6ca6f3b: 455.361±3.817 s Merge #33241: Update libmultiprocess subtree to fix build issues
371bece: 469.343±2.369 s use fixed 64_MiB
0a77b9e: 474.821±12.205 s use fixed 32_MiB

dbcache=4000 MB (dynamic batch size would be 142.2 MB)
1c88f34: 443.378±5.214 s coins: introduce dynamic batch size calculator based on dbcache value
6ca6f3b: 443.661±4.678 s Merge #33241: Update libmultiprocess subtree to fix build issues
371bece: 457.182±5.747 s use fixed 64_MiB
0a77b9e: 471.365±8.131 s use fixed 32_MiB


Edit: The above ones are the complete AssumeUTXO load & dump. Extracting only the batch saving times (the only change of the PR) on an i7 with HDD reveals a 40% speedup for default memory and a 3% speedup for bigger one with fewer batch writes:

Measurement
COMMITS="8bbb7b8bf8e3b2b6465f318ec102cc5275e5bf8c b6f8c48946cbfceb066de660c485ae1bd2c27cc1"; \
CC=gcc; CXX=g++; \
BASE_DIR="/mnt/my_storage"; DATA_DIR="$BASE_DIR/ShallowBitcoinData"; LOG_DIR="$BASE_DIR/logs"; UTXO_SNAPSHOT_PATH="$BASE_DIR/utxo-880000.dat"; \
(echo ""; for c in $COMMITS; do git fetch -q origin $c && git log -1 --pretty='%h %s' $c || exit 1; done; echo "") && \
for DBCACHE in 450 4500; do \
  hyperfine \
  --sort command \
  --runs 5 \
  --export-json "$BASE_DIR/assumeutxo-$(sed -E 's/(\w{8})\w+ ?/\1-/g;s/-$//'<<<"$COMMITS")-$DBCACHE-$CC-$(date +%s).json" \
  --parameter-list COMMIT ${COMMITS// /,} \
  --prepare "killall bitcoind 2>/dev/null; rm -rf $DATA_DIR/chainstate $DATA_DIR/chainstate_snapshot $DATA_DIR/debug.log; git checkout {COMMIT}; git clean -fxd; git reset --hard && \
    cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DENABLE_IPC=OFF && ninja -C build bitcoind bitcoin-cli && \
      ./build/bin/bitcoind -datadir=$DATA_DIR -stopatheight=1 -printtoconsole=0; sleep 20 && \
      ./build/bin/bitcoind -datadir=$DATA_DIR -daemon -blocksonly -connect=0 -dbcache=$DBCACHE -printtoconsole=0; sleep 20" \
    --cleanup "cp $DATA_DIR/debug.log $LOG_DIR/debug-assumeutxo-{COMMIT}-dbcache-$DBCACHE-$(date +%s).log; \
      build/bin/bitcoin-cli -datadir=$DATA_DIR stop || true; killall bitcoind || true" \
    "COMPILER=$CC DBCACHE=$DBCACHE ./build/bin/bitcoin-cli -datadir=$DATA_DIR -rpcclienttimeout=0 loadtxoutset $UTXO_SNAPSHOT_PATH"; \
done

8bbb7b8bf8 refactor: Extract default batch size into kernel
b6f8c48946 coins: increase default `dbbatchsize` to 32 MiB

Benchmark 1: COMPILER=gcc DBCACHE=450 ./build/bin/bitcoin-cli -datadir=/mnt/my_storage/ShallowBitcoinData -rpcclienttimeout=0 loadtxoutset /mnt/my_storage/utxo-880000.dat (COMMIT = 8bbb7b8bf8e3b2b6465f318ec102cc5275e5bf8c)
  Time (mean ± σ):     993.753 s ± 41.940 s    [User: 0.002 s, System: 0.001 s]
  Range (min … max):   920.460 s … 1027.298 s    5 runs
 
Benchmark 2: COMPILER=gcc DBCACHE=450 ./build/bin/bitcoin-cli -datadir=/mnt/my_storage/ShallowBitcoinData -rpcclienttimeout=0 loadtxoutset /mnt/my_storage/utxo-880000.dat (COMMIT = b6f8c48946cbfceb066de660c485ae1bd2c27cc1)
  Time (mean ± σ):     827.580 s ± 37.633 s    [User: 0.001 s, System: 0.002 s]
  Range (min … max):   778.174 s … 868.777 s    5 runs
 
Relative speed comparison
        1.20 ±  0.07  COMPILER=gcc DBCACHE=450 ./build/bin/bitcoin-cli -datadir=/mnt/my_storage/ShallowBitcoinData -rpcclienttimeout=0 loadtxoutset /mnt/my_storage/utxo-880000.dat (COMMIT = 8bbb7b8bf8e3b2b6465f318ec102cc5275e5bf8c)
        1.00          COMPILER=gcc DBCACHE=450 ./build/bin/bitcoin-cli -datadir=/mnt/my_storage/ShallowBitcoinData -rpcclienttimeout=0 loadtxoutset /mnt/my_storage/utxo-880000.dat (COMMIT = b6f8c48946cbfceb066de660c485ae1bd2c27cc1)


Benchmark 1: COMPILER=gcc DBCACHE=4500 ./build/bin/bitcoin-cli -datadir=/mnt/my_storage/ShallowBitcoinData -rpcclienttimeout=0 loadtxoutset /mnt/my_storage/utxo-880000.dat (COMMIT = 8bbb7b8bf8e3b2b6465f318ec102cc5275e5bf8c)
  Time (mean ± σ):     754.283 s ±  6.920 s    [User: 0.001 s, System: 0.002 s]
  Range (min … max):   747.235 s … 765.162 s    5 runs
 
Benchmark 2: COMPILER=gcc DBCACHE=4500 ./build/bin/bitcoin-cli -datadir=/mnt/my_storage/ShallowBitcoinData -rpcclienttimeout=0 loadtxoutset /mnt/my_storage/utxo-880000.dat (COMMIT = b6f8c48946cbfceb066de660c485ae1bd2c27cc1)
  Time (mean ± σ):     740.267 s ±  9.414 s    [User: 0.001 s, System: 0.002 s]
  Range (min … max):   726.094 s … 751.329 s    5 runs
 
Relative speed comparison
        1.02 ±  0.02  COMPILER=gcc DBCACHE=4500 ./build/bin/bitcoin-cli -datadir=/mnt/my_storage/ShallowBitcoinData -rpcclienttimeout=0 loadtxoutset /mnt/my_storage/utxo-880000.dat (COMMIT = 8bbb7b8bf8e3b2b6465f318ec102cc5275e5bf8c)
        1.00          COMPILER=gcc DBCACHE=4500 ./build/bin/bitcoin-cli -datadir=/mnt/my_storage/ShallowBitcoinData -rpcclienttimeout=0 loadtxoutset /mnt/my_storage/utxo-880000.dat (COMMIT = b6f8c48946cbfceb066de660c485ae1bd2c27cc1)

Edit2: A similar measurement on a Raspberry PI for only the dumping part of the UTXOs reveals a 70% speedup (before: ~39 minutes vs ~23 minutes after) for default dbcache (consisting of 58 separate batch writes).


So in summary, the dynamic scaling seems like a needless complication and 64 MiB seems to add too much extra memory.

The above tests indicate that a constant 32 MiB bump (without any differentiation based on dbcache) is usually faster for most system with most dbcache values than the current one of 16 MiB (even if usually not as fast as the 64 MiB alternative).

Comparing the massif memory usage of the current 16 MiB:

    MB
744.4^                            :
     |# :::: :  ::: ::  :::::  ::@:::::   ::::::::@@
     |# : :: :  ::: ::  : ::   ::@:: ::   ::: ::: @
     |#:: :: :  ::: ::  : ::   ::@:: ::   ::: ::: @
     |#:: :: :  ::: ::  : ::   ::@:: :: ::::: ::: @
     |#:: :: :  ::: ::  : ::   ::@:: :: : ::: ::: @
     |#:: :: :  ::: ::  : ::   ::@:: :::: ::: ::: @
     |#:: :: :::::: ::  : ::   ::@:: :::: ::: ::: @
     |#:: ::::: ::: ::::: :: ::::@:: :::: ::: ::: @
     |#:: ::::: ::::::: : :: : ::@:: :::: ::: ::: @
     |#:: ::::: ::::::: : :: : ::@:: :::: ::: ::: @
     |#:: ::::: ::::::: : :: : ::@:: :::: ::: ::: @
     |#:: ::::: ::::::: : :: : ::@:: :::: ::: ::: @
     |#:: ::::: ::::::: : :: : ::@:: :::: ::: ::: @
     |#:: ::::: ::::::: : :: : ::@:: :::: ::: ::: @ ::::::::@@::@::::::::::@::
     |#:: ::::: ::::::: : :: : ::@:: :::: ::: ::: @ : : : : @ ::@:::: :::::@::
     |#:: ::::: ::::::: : :: : ::@:: :::: ::: ::: @ : : : : @ ::@:::: :::::@::
     |#:: ::::: ::::::: : :: : ::@:: :::: ::: ::: @ : : : : @ ::@:::: :::::@::
     |#:: ::::: ::::::: : :: : ::@:: :::: ::: ::: @ : : : : @ ::@:::: :::::@::
     |#:: ::::: ::::::: : :: : ::@:: :::: ::: ::: @ : : : : @ ::@:::: :::::@::
   0 +----------------------------------------------------------------------->h
     0                                                                   1.603

vs the new proposed fix 32 MiB:

    MB
819.6^      ##
     | :    #       :      :  :           :
     | :  ::# :::@@:::::::::  :  @:::::: :::::::
     | :  : # :: @ ::: :: ::  :  @:: ::  :::: :
     | :: : # :: @ ::: :: ::  :  @:: ::  :::: :
     | :: : # :: @ ::: :: ::  :  @:: ::  :::: :
     | :: : # :: @ ::: :: ::  :  @:: ::  :::: :
     | :::: # :: @ ::: :: ::  :  @:: ::  :::: :
     | :::: # :: @ ::: :: ::  :  @:: ::  :::: :
     | :::: # :: @ ::: :: :::::  @:: ::  :::: :
     | :::: # :: @ ::: :: ::: :::@:: ::  :::: :
     | :::: # :: @ ::: :: ::: :: @:: ::  :::: :
     | :::: # :: @ ::: :: ::: :: @:: :: ::::: :
     | :::: # :: @ ::: :: ::: :: @:: :: ::::: :
     | :::: # :: @ ::: :: ::: :: @:: :: ::::: : :::::::::::@::::@::::@:::::::@
     | :::: # :: @ ::: :: ::: :: @:: :: ::::: : : : :::::: @::::@::::@:::::::@
     | :::: # :: @ ::: :: ::: :: @:: :: ::::: : : : :::::: @::::@::::@:::::::@
     | :::: # :: @ ::: :: ::: :: @:: :: ::::: : : : :::::: @::::@::::@:::::::@
     | :::: # :: @ ::: :: ::: :: @:: :: ::::: : : : :::::: @::::@::::@:::::::@
     | :::: # :: @ ::: :: ::: :: @:: :: ::::: : : : :::::: @::::@::::@:::::::@
   0 +----------------------------------------------------------------------->h
     0                                                                   1.484

Reveals that we're still a lot below 1GiB, the peak memory only increased by 75 MiB in total (and only during dumping the UTXO set), while the total time decreased from 1.6h to 1.48h (8% faster).

What about dbcache=4500?! it's 65 MiB bigger and 3% faster

I was interested in the total memory usage of dbcache=4500 as well:

    GB
4.705^                                 :
     | ##::  :::::  ::@:::  :@::: :@::::
     | # ::  : :::  ::@: :  :@::: :@: ::
     | # ::  : :::  ::@: :  :@::: :@: ::
     | # ::  : :::  ::@: :  :@::: :@: ::
     | # :: :: :::  ::@: : ::@::: :@: ::
     | # :: :: :::  ::@: : ::@::: :@: ::
     | # :: :: :::  ::@: : ::@::: :@: ::
     | # :: :: :::  ::@: : ::@::: :@: :::::::
     | # :: :: :::  ::@: : ::@::: :@: ::: ::
     | # :: :: ::: :::@: : ::@::: :@: ::: ::
     | # :: :: ::: :::@: : ::@::: :@: ::: ::
     | # :: :: ::: :::@: : ::@::: :@: ::: ::
     | # :: :: ::: :::@: : ::@::: :@: ::: ::
     | # ::::: ::: :::@: : ::@::: :@: ::: ::
     |@# ::::: ::: :::@: : ::@::: :@: ::: ::
     |@# ::::: :::@:::@: : ::@::: :@: ::: ::
     |@# ::::: :::@:::@: : ::@::: :@: ::: ::
     |@# ::::: :::@:::@: : ::@::: :@: ::: ::
     |@# ::::: :::@:::@: ::::@:::::@: ::: :: @@::@:::@:::::::::@::::::@::::::@
   0 +----------------------------------------------------------------------->h
     0                                                                   1.294

vs master:

    GB
4.640^                       ::
     |  #::  :::@@:  ::@:   :@ @::: @:::
     |  #:   :: @ :  ::@:  @:@ @ :: @: :
     |  #:   :: @ :  ::@:  @:@ @ :: @: :
     |  #:   :: @ :  ::@:  @:@ @ :::@: :
     |  #:  ::: @ : :::@:  @:@ @ :::@: :
     |  #:  ::: @ : :::@:  @:@ @ :::@: :
     |  #:  ::: @ : :::@:  @:@ @ :::@: :
     |  #:  ::: @ : :::@:  @:@ @ :::@: : :::
     |  #:  ::: @ : :::@:  @:@ @ :::@: : :::
     |  #:  ::: @ : :::@:  @:@ @ :::@: : :::
     |  #:  ::: @ : :::@:  @:@ @ :::@: : :::
     | :#:  ::: @ :@:::@:  @:@ @ :::@: : :::
     | :#:  ::: @ :@:::@:  @:@ @ :::@: :::::
     | :#:  ::: @ :@:::@:  @:@ @ :::@: :::::
     | :#:  ::: @ :@:::@:::@:@ @ :::@: :::::
     | :#:  ::: @ :@:::@:: @:@ @ :::@: :::::
     | :#:  ::: @ :@:::@:: @:@ @ :::@: :::::
     | :#: :::: @ :@:::@:: @:@ @ :::@: :::::
     | :#: :::: @ :@:::@:: @:@ @ :::@: :::::::::::::::::::::::::::::::::::@:::
   0 +----------------------------------------------------------------------->h
     0                                                                   1.338

@l0rinc
Copy link
Contributor Author

l0rinc commented Sep 25, 2025

Now that we have built-in support for querying total memory, I wonder if the batch size should depend on that or if we should just bump it to constant 32 (as proposed currently). Given how messy it was to measure even this one reliably, it's likely best to leave it a constant.
But maybe we can still keep the 64 MiB version (which performed best), now that excessive dbcache already warns. Feedback is welcome.

@l0rinc
Copy link
Contributor Author

l0rinc commented Oct 2, 2025

I have also measured a db-cache adjusted AssumeUTXO load to see which version performs better under the same memory requirements - as suggested by @sipa.

Reran the before scenario with -dbcache=450, it basically consumed the same 744 MiB memory as before, finishing in 1h:46m:

Command:            ./build/bin/bitcoind -datadir=/mnt/my_storage/ShallowBitcoinData -server -blocksonly -connect=0 -dbcache=450 -printtoconsole=0
Massif arguments:   --time-unit=ms --massif-out-file=/mnt/my_storage/logs/massif-assumeutxo-8bbb7b8bf8e3b2b6465f318ec102cc5275e5bf8c-450.out
ms_print arguments: /mnt/my_storage/logs/massif-assumeutxo-8bbb7b8bf8e3b2b6465f318ec102cc5275e5bf8c-450.out
--------------------------------------------------------------------------------


    MB
744.8^                          :                                             
     |##:::::  ::@::::   ::::@:::::::: ::::: @@@  :@                          
     |# ::: :  ::@:  :   :: :@: :: : : : :: :@    :@                          
     |# ::: :  ::@:  : :::: :@: :: : : : :: :@    :@                          
     |# ::: :  ::@:  : : :: :@: :: : : : :: :@    :@                          
     |# ::: :  ::@:  ::: :: :@: :: : : : :: :@    :@                          
     |# ::: :  ::@:  ::: :: :@: :: : : : :: :@    :@                          
     |# ::: :  ::@:  ::: :: :@: :: : : : :: :@    :@                          
     |# ::: :  ::@:  ::: :: :@: :: : : : :: :@    :@                          
     |# ::: :  ::@:  ::: :: :@: :: : : : :: :@  :::@                          
     |# ::: :  ::@:  ::: :: :@: :: : : : :: :@  : :@                          
     |# ::: :::::@:  ::: :: :@: :: : ::: :: :@  : :@                          
     |# ::: :: ::@:  ::: :: :@: :: : ::: :: :@  : :@                          
     |# ::: :: ::@:  ::: :: :@: :: : ::: :: :@  : :@                          
     |# ::: :: ::@:  ::: :: :@: :: : ::: :: :@  : :@::::@:::::@::::@:::::@::::
     |# ::: :: ::@:  ::: :: :@: :: : ::: :: :@  : :@::::@::: :@::::@:::::@::::
     |# ::: :: ::@:  ::: :: :@: :: : ::: :: :@  : :@::::@::: :@::::@:::::@::::
     |# ::: :: ::@:  ::: :: :@: :: : ::: :: :@  : :@::::@::: :@::::@:::::@::::
     |# ::: :: ::@:  ::: :: :@: :: : ::: :: :@  : :@::::@::: :@::::@:::::@::::
     |# ::: :: ::@:  ::: :: :@: :: : ::: :: :@  : :@::::@::: :@::::@:::::@::::
   0 +----------------------------------------------------------------------->h
     0                                                                   1.783

I also ran the new proposed 32 MiB batch size with a -dbcache value of (450-(819.6-744.4) = ~375MiB) so that the peak memory of the two runs is similar - it consumes 737MiB peak memory and finished in 1h:41m:

Command:            ./build/bin/bitcoind -datadir=/mnt/my_storage/ShallowBitcoinData -server -blocksonly -connect=0 -dbcache=375 -printtoconsole=0
Massif arguments:   --time-unit=ms --massif-out-file=/mnt/my_storage/logs/massif-assumeutxo-b6f8c48946cbfceb066de660c485ae1bd2c27cc1-375.out
ms_print arguments: /mnt/my_storage/logs/massif-assumeutxo-b6f8c48946cbfceb066de660c485ae1bd2c27cc1-375.out
--------------------------------------------------------------------------------


    MB
737.2^ #                                                                      
     | #      : ::  : ::  :            :       :                              
     | #@:::::::::  :::  ::@: :::::: : :::: :: ::                             
     | #@: : :::::  ::: :::@: : :::: : :::: :: ::                             
     | #@: : :::::  ::: :::@: : :::: : :::: :: ::                             
     | #@: : :::::  ::: :::@: : :::: : :::: :: ::                             
     | #@: : :::::  ::: :::@: : :::: : :::: :: ::                             
     | #@: : :::::  ::: :::@: : :::: : :::: :: ::                             
     | #@: : :::::  ::: :::@: : :::: :::::: :: ::                             
     | #@: : :::::  ::: :::@: : ::::::::::::::@::                             
     | #@: : :::::  ::: :::@:@: ::::::::::::::@::                             
     | #@: : :::::::::: :::@:@: ::::::::::::::@::                             
     | #@: : :::::: ::: :::@:@: ::::::::::::::@:::@:::@::::::@::::::@:::::@:::
     | #@: : :::::: ::: :::@:@: ::::::::::::::@:::@:: @::::::@::::::@:::::@:::
     | #@: : :::::: ::: :::@:@: ::::::::::::::@:::@:: @::::::@::::::@:::::@:::
     | #@: : :::::: ::: :::@:@: ::::::::::::::@:::@:: @::::::@::::::@:::::@:::
     | #@: : :::::: ::: :::@:@: ::::::::::::::@:::@:: @::::::@::::::@:::::@:::
     | #@: : :::::: ::: :::@:@: ::::::::::::::@:::@:: @::::::@::::::@:::::@:::
     | #@: : :::::: ::: :::@:@: ::::::::::::::@:::@:: @::::::@::::::@:::::@:::
     | #@: : :::::: ::: :::@:@: ::::::::::::::@:::@:: @::::::@::::::@:::::@:::
   0 +----------------------------------------------------------------------->h
     0                                                                   1.693

Copy link
Contributor

@sedited sedited left a comment

Choose a reason for hiding this comment

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

ACK b6f8c48

I don't think complicating this with a dynamic calculation makes sense either given the trade offs documented in this discussion.

@laanwj
Copy link
Member

laanwj commented Oct 21, 2025

Concept and code review ACK b6f8c48

Copy link
Contributor

@andrewtoth andrewtoth left a comment

Choose a reason for hiding this comment

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

ACK b6f8c48

This constant was set when the UTXO set was much smaller, so a lot less time was spent writing. It makes sense to increase this, since IBD will benefit from the increase in IO efficiency during all that writing. During steady state the dirty UTXO set is written to disk every hour which is much less than 16MB, so this limit should have no effect.

@l0rinc
Copy link
Contributor Author

l0rinc commented Oct 28, 2025

Thank you for the reviews!

rfm?

@glozow glozow merged commit da6f041 into bitcoin:master Oct 31, 2025
19 checks passed
@l0rinc l0rinc deleted the l0rinc/utxo-dump-batching branch October 31, 2025 17:14
sedited added a commit to sedited/rust-bitcoinkernel that referenced this pull request Nov 5, 2025
…c5704e73079

5c5704e73079 Merge bitcoin/bitcoin#33791: kernel: Use enumeration type for flags argument
ed5720509f03 kernel: Use enumeration type for flags argument
50d106a4d6ac Merge bitcoin/bitcoin#33781: clang-tidy: Remove no longer needed NOLINT
ffd7ca3c4688 Merge bitcoin/bitcoin#33780: guix: disable libsanitizer in Linux GCC build
33389f1144e6 Merge bitcoin-core/gui#899: Modernize custom filtering
038849e2e09b clang-tidy: Remove no longer needed NOLINT
5c41fa2918c8 guix: disable libsanitizer in Linux GCC build
4da01123df0f Merge bitcoin/bitcoin#30595: kernel: Introduce C header API
96614fff6327 Merge bitcoin/bitcoin#33714: random: scope environ extern to macOS, BSDs and Illumos
4e9bd579d3ed Merge bitcoin/bitcoin#33045: depends: disable variables, rules and suffixes.
5ffa63d6814d Merge bitcoin/bitcoin#33626: ci: run native fuzz with MSAN job
75baff98fcf9 Merge bitcoin/bitcoin#33744: ci: Fix lint runner selection (and docker cache)
2593ed1b5f4b Merge bitcoin/bitcoin#33574: doc: update Guix INSTALL.md
1cd8d9fe5cd5 Merge bitcoin/bitcoin#33445: ci: Update Clang in "tidy" job
56329beaee27 Merge bitcoin/bitcoin#32301: test: cover invalid codesep positions for signature in taproot
1e6e32fa8a64 ci: run native fuzz with MSAN job
3784d15bcd50 ci: use LLVM libcxx 21.1.5
e15e8cbadad5 qt: Modernize custom filtering
745eb053a41c Merge bitcoin-core/gui#901: Add createwallet, createwalletdescriptor, and migratewallet to history filter
52b1595850f6 depends: disable builtin variables
8b5a28fa7893 depends: disable builtin rules and suffixes.
7632e0ba312a ci: fix configure docker action inputs
746d36cc80f0 Merge bitcoin/bitcoin#33754: ci: gha: Set debug_pull_request_number_str annotation
25c45bb0d0bd Merge bitcoin/bitcoin#33567: node: change a tx-relay on/off flag to enum
422b468229f1 Merge bitcoin/bitcoin#33683: refactor/doc: Add blockman param to GetTransaction doc comment
da6f041e39ef Merge bitcoin/bitcoin#31645: [IBD] coins: increase default UTXO flush batch size to 32 MiB
832a57673af7 Merge bitcoin/bitcoin#33749: test: ipc: resolve symlinks in `which capnp`
3cd4263bf664 Merge bitcoin/bitcoin#33753: test: Format strings in `test_runner`
78d4d36730d4 test: Format strings in `*.rs`
fa9d0f994b45 ci: gha: Set debug_pull_request_number_str annotation
305384a0372a Merge bitcoin/bitcoin#33746: ci: Add missing python3-dev package for riscv64
8eda7210eb33 Merge bitcoin/bitcoin#33743: fuzz: refactor memcpy to std::ranges::copy to work around ubsan warn
51093d6ae1d4 test: resolve symlinks in which result for capnp
6f359695c36c Merge bitcoin/bitcoin#33698: test: Use same rpc timeout for authproxy and cli
c281bb6837b0 Merge bitcoin/bitcoin#32924: test: add valid tx test with minimum-sized ECDSA signature (8 bytes DER-encoded)
facf8b771a19 ci: Add missing python3-dev package for riscv64
b4d0288c467f doc: update Guix INSTALL.md
0b3b8a3be1a0 ci: fix lint docker caching
fa4b52bd1618 fuzz: refactor memcpy to std::ranges::copy to work around ubsan warn
72511fd02e72 Merge bitcoin/bitcoin#33555: build: Bump clang minimum supported version to 17
79d6f458e230 random: scope environ extern to macOS, BSDs and Illumos
292ea0eb8982 Merge bitcoin/bitcoin#33677: ci: Retry image building once on failure
dd82c6c5d09f Merge bitcoin/bitcoin#33693: ci: use pycapnp 2.2.1
5d784bebaff5 clang-tidy: Disable `ArrayBound` check in src/ipc and src/test
5efdb0ef3056 ci: Update Clang in "tidy" job
53b34c80c631 ci: use pycapnp 2.2.1 in mac native job
865432869c0d ci: remove Python version comment from mac config
1a1f46c22859 refactor/doc: Add blockman param to `GetTransaction` doc comment and reorder out param
66667d651229 test: Use same rpc timeout for authproxy and cli
5555bce994b6 ci: Document why IN_GETOPT_BIN env var is needed on macOS
fabe516440c9 ci: Export the container id in python script
fa6aa9f42faa ci: Retry image building once on failure
fa4dbe04d782 ci: Allow overwriting check option in run() helper
fa8e4de5c31d ci: Use os.environ[key] access when value must be set
07a926474b5a node: change a tx-relay on/off flag to enum
4e352efa2ce7 qt: add createwallet, createwalletdescriptor, and migratewallet to history filter
fa0fa0f70087 refactor: Revert "disable self-assign warning for tests"
faed118fb30f build: Bump clang minimum supported version to 17
b6f8c48946cb coins: increase default `dbbatchsize` to 32 MiB
8bbb7b8bf8e3 refactor: Extract default batch size into kernel
81e5c8385b9e test: cover invalid codesep positions for signature in taproot
5fa81e239a39 test: add valid tx test with minimum-sized ECDSA signature (8 bytes DER-encoded)

git-subtree-dir: libbitcoinkernel-sys/bitcoin
git-subtree-split: 5c5704e730796c6f31e2d7891bf6334674a04219
stickies-v added a commit to stickies-v/py-bitcoinkernel that referenced this pull request Nov 5, 2025
4da01123df0f Merge bitcoin/bitcoin#30595: kernel: Introduce C header API
96614fff6327 Merge bitcoin/bitcoin#33714: random: scope environ extern to macOS, BSDs and Illumos
4e9bd579d3ed Merge bitcoin/bitcoin#33045: depends: disable variables, rules and suffixes.
5ffa63d6814d Merge bitcoin/bitcoin#33626: ci: run native fuzz with MSAN job
75baff98fcf9 Merge bitcoin/bitcoin#33744: ci: Fix lint runner selection (and docker cache)
2593ed1b5f4b Merge bitcoin/bitcoin#33574: doc: update Guix INSTALL.md
1cd8d9fe5cd5 Merge bitcoin/bitcoin#33445: ci: Update Clang in "tidy" job
56329beaee27 Merge bitcoin/bitcoin#32301: test: cover invalid codesep positions for signature in taproot
1e6e32fa8a64 ci: run native fuzz with MSAN job
3784d15bcd50 ci: use LLVM libcxx 21.1.5
6c7a34f3b0bd kernel: Add Purpose section to header documentation
7e9f00bcc174 kernel: Allowing reducing exports
7990463b1059 kernel: Add pure kernel bitcoin-chainstate
36ec9a3ea232 Kernel: Add functions for working with outpoints
5eec7fa96aa3 kernel: Add block hash type and block tree utility functions to C header
f5d5d1213cc4 kernel: Add function to read block undo data from disk to C header
09d0f626388a kernel: Add functions to read block from disk to C header
a263a4caf231 kernel: Add function for copying block data to C header
b30e15f4329a kernel: Add functions for the block validation state to C header
aa262da7bcfa kernel: Add validation interface to C header
d27e27758d51 kernel: Add interrupt function to C header
1976b13be9c8 kernel: Add import blocks function to C header
a747ca1f516e kernel: Add chainstate load options for in-memory dbs in C header
070e77732cdb kernel: Add options for reindexing in C header
ad80abc73df3 kernel: Add block validation to C header
cb1590b05efd kernel: Add chainstate loading when instantiating a ChainstateManager
e2c1bd3d713f kernel: Add chainstate manager option for setting worker threads
65571c36a265 kernel: Add chainstate manager object to C header
c62f657ba330 kernel: Add notifications context option to C header
9e1bac45852d kernel: Add chain params context option to C header
337ea860dfda kernel: Add kernel library context object
28d679bad9fd kernel: Add logging to kernel library C header
2cf136dec4ce kernel: Introduce initial kernel C header API
745eb053a41c Merge bitcoin-core/gui#901: Add createwallet, createwalletdescriptor, and migratewallet to history filter
52b1595850f6 depends: disable builtin variables
8b5a28fa7893 depends: disable builtin rules and suffixes.
7632e0ba312a ci: fix configure docker action inputs
746d36cc80f0 Merge bitcoin/bitcoin#33754: ci: gha: Set debug_pull_request_number_str annotation
25c45bb0d0bd Merge bitcoin/bitcoin#33567: node: change a tx-relay on/off flag to enum
422b468229f1 Merge bitcoin/bitcoin#33683: refactor/doc: Add blockman param to GetTransaction doc comment
da6f041e39ef Merge bitcoin/bitcoin#31645: [IBD] coins: increase default UTXO flush batch size to 32 MiB
832a57673af7 Merge bitcoin/bitcoin#33749: test: ipc: resolve symlinks in `which capnp`
3cd4263bf664 Merge bitcoin/bitcoin#33753: test: Format strings in `test_runner`
78d4d36730d4 test: Format strings in `*.rs`
fa9d0f994b45 ci: gha: Set debug_pull_request_number_str annotation
305384a0372a Merge bitcoin/bitcoin#33746: ci: Add missing python3-dev package for riscv64
8eda7210eb33 Merge bitcoin/bitcoin#33743: fuzz: refactor memcpy to std::ranges::copy to work around ubsan warn
51093d6ae1d4 test: resolve symlinks in which result for capnp
6f359695c36c Merge bitcoin/bitcoin#33698: test: Use same rpc timeout for authproxy and cli
c281bb6837b0 Merge bitcoin/bitcoin#32924: test: add valid tx test with minimum-sized ECDSA signature (8 bytes DER-encoded)
facf8b771a19 ci: Add missing python3-dev package for riscv64
b4d0288c467f doc: update Guix INSTALL.md
0b3b8a3be1a0 ci: fix lint docker caching
fa4b52bd1618 fuzz: refactor memcpy to std::ranges::copy to work around ubsan warn
72511fd02e72 Merge bitcoin/bitcoin#33555: build: Bump clang minimum supported version to 17
79d6f458e230 random: scope environ extern to macOS, BSDs and Illumos
292ea0eb8982 Merge bitcoin/bitcoin#33677: ci: Retry image building once on failure
dd82c6c5d09f Merge bitcoin/bitcoin#33693: ci: use pycapnp 2.2.1
3bb30658e631 Merge bitcoin/bitcoin#32380: Modernize use of UTF-8 in Windows code
5a58d4915e5c Merge bitcoin/bitcoin#33546: test: add functional test for `TestShell` (matching doc example)
1abc8fa308d2 Merge bitcoin/bitcoin#33218: refactor: rename `fees.{h,cpp}` to `fees/block_policy_estimator.{h,cpp}`
de15e52f09d4 Merge bitcoin/bitcoin#32867: doc: mention key removal in rpc interface modification
5d784bebaff5 clang-tidy: Disable `ArrayBound` check in src/ipc and src/test
5efdb0ef3056 ci: Update Clang in "tidy" job
24434c1284b8 Merge bitcoin/bitcoin#31308: ci, iwyu: Treat warnings as errors for specific directories
27cd7f504944 Merge bitcoin/bitcoin#33185: guix: update time-machine to 5cb84f2013c5b1e48a7d0e617032266f1e6059e2
80bb7012be8e Merge bitcoin/bitcoin#31514: wallet: allow label for non-ranged external descriptor (if `internal=false`) & disallow label for ranged descriptors
5e1f626ac30f Merge bitcoin/bitcoin#32504: test: descriptor: cover invalid multi/multi_a cases
56e9703968e2 Merge bitcoin/bitcoin#29640: Fix tiebreak when loading blocks from disk (and add tests for comparing chain ties)
53b34c80c631 ci: use pycapnp 2.2.1 in mac native job
865432869c0d ci: remove Python version comment from mac config
9bd9ec00b238 Merge bitcoin/bitcoin#33688: test: Update BIP324 test vectors
1a7fb5eeeef3 fees: return current block height in estimateSmartFee
ab49480d9be4 fees: rename fees_args to block_policy_estimator_args
06db08a43568 fees: refactor: rename fees to block_policy_estimator
6dfdd7e034dd fees: refactor: rename policy_fee_tests.cpp to feerounder_tests.cpp
f54ffb4bc141 Merge bitcoin/bitcoin#32813: clang-format: make formatting deterministic for different formatter versions
1916c51cd855 Merge bitcoin/bitcoin#33210: fuzz: enhance wallet_fees by mocking mempool stuff
0eb554728ca9 Merge bitcoin/bitcoin#33336: log: print every script verification state change
c6c4edf324a3 Merge bitcoin/bitcoin#32983: rpc: refactor: use string_view in Arg/MaybeArg
00ad998d9545 Merge bitcoin/bitcoin#33252: p2p: add `DifferenceFormatter` fuzz target and invariant check
1a1f46c22859 refactor/doc: Add blockman param to `GetTransaction` doc comment and reorder out param
66667d651229 test: Use same rpc timeout for authproxy and cli
5555bce994b6 ci: Document why IN_GETOPT_BIN env var is needed on macOS
fabe516440c9 ci: Export the container id in python script
f6ba97cea1d3 Merge bitcoin/bitcoin#33666: ci: Drop libFuzzer from msan fuzz task
af78d3651299 Merge bitcoin/bitcoin#32588: util: Abort on failing CHECK_NONFATAL in debug builds
51877f2fc5eb test: Update BIP324 test vectors
161864a038ea Merge bitcoin/bitcoin#32579: p2p: Correct unrealistic headerssync unit test behavior
70a6fb5e5ab5 Merge bitcoin/bitcoin#33172: test: p2p block malleability
99cb2054bdfe Merge bitcoin/bitcoin#33600: refactor: Construct g_verify_flag_names on first use
211bf6c97503 Merge bitcoin/bitcoin#33566: miner: fix empty mempool case for waitNext()
944e5ff848f6 doc: mention key removal in rpc interface modification
d32f9525e484 Merge bitcoin/bitcoin#33679: test: set number of RPC server threads to 2
1c85d062321c Merge bitcoin/bitcoin#32266: depends: Avoid `warning: "_FORTIFY_SOURCE" redefined` for `libevent`
11684c9ce2c1 Merge bitcoin/bitcoin#33674: ci: Doc ASLR workaround for sanitizer tasks
e9cd45e3d3c7 test: set number of RPC server threads to 2
fa6aa9f42faa ci: Retry image building once on failure
fa4dbe04d782 ci: Allow overwriting check option in run() helper
fa8e4de5c31d ci: Use os.environ[key] access when value must be set
7d27af98c7cf Merge bitcoin/bitcoin#33461: ci: add Valgrind fuzz
1569bcc387fe Merge bitcoin/bitcoin#33639: ci: Only write docker build images to Cirrus cache
98c4994d0f36 Merge bitcoin/bitcoin#33570: randomenv: Fix MinGW dllimport warning for `environ`
c211d1832211 Merge bitcoin/bitcoin#33670: test: Use unassigned p2p_port instead of hardcoded 60000 in p2p_i2p_ports.py
e4b04630bcf5 ci: add Valgrind fuzz
3fee0754a2ec Merge bitcoin/bitcoin#33550: Fix windows libc++ `fs::path` `fstream` compile errors
fa0e36156cba ci: Doc ASLR workaround for sanitizer tasks
fa20275db32c test: Use unassigned p2p_port instead of hardcoded 60000 in p2p_i2p_ports.py
c862936d16a6 Merge bitcoin/bitcoin#33370: ci: use Mold linker for asan-lsan-ubsan-integer-no-depends-usdt workflow
fabe0e07de1a ci: Only write docker build images to Cirrus cache
fab64a5d6fd7 ci: Move buildx command to python script
fa72a2bd5c80 ci: Remove unused MAYBE_CPUSET
fa70e23de75b ci: Drop libFuzzer from msan fuzz task
abe7cbfe1a4e Merge bitcoin/bitcoin#33470: build: Move CMAKE_SKIP_INSTALL_RPATH from CMake to Guix script
689ec28d1d1e Merge bitcoin/bitcoin#33633: test: [move-only] binary utils to utils.py
0eeae4d174a4 Merge bitcoin/bitcoin#33625: Update secp256k1 subtree to latest master
4b41f99d57d8 build: Move CMAKE_SKIP_INSTALL_RPATH from CMake to Guix script
d30f149360d1 Merge bitcoin/bitcoin#33630: doc: correct topology requirements in submitpackage helptext
3d222825642b [doc] correct topology requirements in submitpackage helptext
e744fd1249bf Merge bitcoin/bitcoin#33641: Update leveldb subtree to latest master
4371740bebfa Merge bitcoin/bitcoin#33642: doc: archive release notes for v28.3
ceea24b92153 doc: archive release notes for v28.3
54ffe3de5b1d Update leveldb subtree to latest master
f21162d81933 Squashed 'src/leveldb/' changes from aba469ad6a..cad64b151d
e14451ac8733 Merge bitcoin/bitcoin#33469: TxGraph: change m_excluded_clusters
f76e1ae38991 Merge bitcoin/bitcoin#32313: coins: fix `cachedCoinsUsage` accounting in `CCoinsViewCache`
59c4898994bd guix: remove python-pydantic-core input from LIEF
9f2a6927d3a9 guix: use Clang & LLVM 19 for macOS build
9570ddbec9cb guix: update time-machine to 5cb84f2013c5b1e48a7d0e617032266f1e6059e2
7b5cc276aa0a guix: patch around riscv issue with newer (2.40+) binutils
91b5cbaabbca ci: use Debian Trixie for macOS cross job
fa75ef4328f6 test: Move export_env_build_path to util.py
fa9f495308af test: Move get_binary_paths and Binaries to util.py
40e7d4cd0d7f Merge bitcoin/bitcoin#33549: ci: Add macOS cross task for arm64-apple-darwin
ea17618c1167 Merge bitcoin/bitcoin#33480: ci: Turn CentOS config into Alpine musl config
b1f8a13702e8 Merge bitcoin/bitcoin#33624: test: P2SH sig ops are only counted with `SCRIPT_VERIFY_P2SH`
879c21045eba Update secp256k1 subtree to latest master
3cbf7cb3e6ac Squashed 'src/secp256k1/' changes from b9313c6e1a..d543c0d917
2f7a50f67cdb Merge bitcoin/bitcoin#33462: ci: add libcpp hardening flags to macOS fuzz job
07a926474b5a node: change a tx-relay on/off flag to enum
48aa0e98d0b7 Merge bitcoin/bitcoin#29675: wallet: Be able to receive and spend inputs involving MuSig2 aggregate keys
db4bde0b0347 Merge bitcoin/bitcoin#33517: multiprocess: Fix high overhead from message logging
3a10d700bc18 test: P2SH sig ops are only counted with `SCRIPT_VERIFY_P2SH` flag
9314113b295a Merge bitcoin/bitcoin#33610: doc: archive release notes for v29.2
9b43428c9687 TxGraph: change m_excluded_clusters
6e1adbbaa157 Merge bitcoin/bitcoin#33612: test: change log rate limit version gate
fdcf67de8033 Merge bitcoin/bitcoin#33157: cluster mempool: control/optimize TxGraph memory usage
7b544341c002 test: change log rate limit version gate from 299900 to 290100
9610b0d1e28a randomenv: Fix MinGW dllimport warning for `environ`
6c4fe401e908 Merge bitcoin/bitcoin#33508: ci: fix buildx gha cache authentication on forks
8f7673257a1a miner: fix empty mempool case for waitNext()
c11a3dcc8895 doc: archive release notes for v29.2
64a7c7cbb975 Merge bitcoin/bitcoin#33558: ci: Use native platform for win-cross task
93b56e95c028 Merge bitcoin/bitcoin#33601: doc: archive release notes for v30.0
563747971be4 Merge bitcoin/bitcoin#33580: depends: Use $(package)_file_name when downloading from the fallback
24d861da7894 coins: only adjust `cachedCoinsUsage` on `EmplaceCoinInternalDANGER` insert
d7c9d6c2914a coins: fix `cachedCoinsUsage` accounting to prevent underflow
39cf8bb3d0d9 refactor: remove redundant usage tracking from `CoinsViewCacheCursor`
67cff8bec909 refactor: assert newly-created parent cache entry has zero memory usage
023cd5a5469a txgraph: add SingletonClusterImpl (mem optimization)
e34625073253 txgraph: give Clusters a range of intended tx counts (preparation)
e93b0f09cc2a txgraph: abstract out creation of empty Clusters (refactor)
6baf12621f66 txgraph: comment fixes (doc fix)
726b995739ab txgraph: make Cluster an abstract class (refactor)
2602d89edd04 txgraph: avoid accessing other Cluster internals (refactor)
04c808ac4c47 txgraph: expose memory usage estimate function (feature)
7680bb8fd48d txgraph: keep track of Cluster memory usage (preparation)
4ba562e5f4e4 txgraph: keep data structures compact (mem optimization)
bb5cb222ae55 depgraph: add memory usage control (feature)
b1637a90deb8 txgraph: avoid holes in DepGraph positions (mem optimization)
2b1d30250877 txgraph: move some sanity checks from Cluster to TxGraphImpl (refactor)
d40302fbaf41 txgraph: Make level of Cluster implicit (optimization)
8d6e49158e3a doc: archive release notes for v30.0
4e352efa2ce7 qt: add createwallet, createwalletdescriptor, and migratewallet to history filter
0626b90f507d multiprocess: align our logging with libmultiprocess's
9d068225ee2b multiprocess: update multiprocess EventLoop construction to use options
d2987102dd13 Merge bitcoin/bitcoin#33573: doc: bump the template macOS version
f6567527d8da doc: bump the template macOS version
faa9d10c84bc refactor: Construct g_verify_flag_names on first use
becf15001318 Merge bitcoin/bitcoin#33518: Update libmultiprocess subtree to support reduced logging
cd1b7fa1ff7c Merge bitcoin/bitcoin#33577: Revert "depends: Update URL for `qrencode` package source tarball"
fa0fa0f70087 refactor: Revert "disable self-assign warning for tests"
faed118fb30f build: Bump clang minimum supported version to 17
6b4a92b0fab8 Merge bitcoin/bitcoin#33568: doc: how to update a subtree
90b2884ce4ba Merge bitcoin/bitcoin#33581: ci: Properly include $FILE_ENV in DEPENDS_HASH
d44b860cd09e Merge bitcoin/bitcoin#33584: ci: upgrade GitHub Action to download-artifact@v5
57f7c68821d9 test: add functional test for `TestShell` (matching doc example)
53874f7934d5 doc: test: update TestShell example instructions/options
b35341b9ba63 Update ci.yml
ceeb53adcd0a ci: Properly include $FILE_ENV in DEPENDS_HASH
671b774d1b58 depends: Use $(package)_file_name when downloading from the fallback
e4335a31920c Revert "depends: Update URL for `qrencode` package source tarball"
a89a822e6eb5 Revert "depends: Use hash instead of file name for package download stamp"
fad5a7101cc3 ci: Add macOS cross task for arm64
fa8c750a0aff ci: Refactor get_previous_releases step in win-test-cross task
e4c04f7759b0 ci: add libcpp hardening flags to macOS fuzz job
a1226bc760c7 doc: how to update a subtree
b510893d0076 Merge bitcoin/bitcoin#33494: depends: Update URL for `qrencode` package source tarball
ec5841888de7 Merge bitcoin/bitcoin#32513: ci: remove 3rd party js from windows dll gha job
d735e2e9b39a Merge bitcoin/bitcoin#32998: Bump SCRIPT_VERIFY flags to 64 bit
de1dc6b47ba7 Merge bitcoin/bitcoin#33515: Improve LastCommonAncestor performance + add tests
eda91b07fd9f Merge commit '0f01e1577f7c6734eb345139a12aba329ef22a5f' into pr/subtree-6
0f01e1577f7c Squashed 'src/ipc/libmultiprocess/' changes from 47d79db8a552..a4f929696490
fa6fd16f36e1 ci: Use native platform for win-cross task
53e4951a5b5b Switch to ANSI Windows API in `fsbridge::fopen()` function
dbe770d92106 Switch to ANSI Windows API in `Win32ErrorString()` function
06d0be4e22ce Remove no longer necessary `WinCmdLineArgs` class
f366408492f6 cmake: Set process code page to UTF-8 on Windows
dccbb178065f Set minimum supported Windows version to 1903 (May 2019 Update)
919e6d01e93a Merge bitcoin/bitcoin#33489: build: Drop support for EOL macOS 13
452ea5928112 Merge bitcoin/bitcoin#33454: net: support overriding the proxy selection in ConnectNode()
c864a4c1940d Simplify fs::path by dropping filename() and make_preferred() overloads
b0113afd44b4 Fix windows libc++ fs::path fstream compile errors
a33bd767a37d Merge bitcoin/bitcoin#33464: p2p: Use network-dependent timers for inbound inv scheduling
2578da69f416 Merge bitcoin/bitcoin#33485: test: set par=2 in default config for functional test framework
25dbe4bc86d3 Merge bitcoin/bitcoin#33533: test: addrman: check isTerrible when time is more than 10min in the future
cfb0d74698ad Merge bitcoin/bitcoin#33121: test: fix p2p_leak_tx.py
86eaa4d6cd5c Merge bitcoin/bitcoin#33482: contrib: fix macOS deployment with no translations
007900ee9b89 Merge bitcoin/bitcoin#33434: depends: static libxcb-cursor
8e47ed6906d5 test: addrman: check isTerrible when time is more than 10min in the future
3635d62f5a93 chain: make use of pskip in LastCommonAncestor (optimization)
2e09d66fbb7b tests: add unit tests for CBlockIndex::GetAncestor and LastCommonAncestor
156927903d64 ci: Check windows manifests for all executables
e1a1b14c9359 ci: use a more generic way of finding mt.exe
1ed00a0d39d5 Merge bitcoin/bitcoin#33504: Mempool: Do not enforce TRUC checks on reorg
b63428ac9ce2 rpc: refactor: use more (Maybe)Arg<std::string_view>
037830ca0dbb refactor: increase string_view usage
b3bf18f0bac0 rpc: refactor: use string_view in Arg/MaybeArg
c76de2eea180 net: support overriding the proxy selection in ConnectNode()
45bd8914658a log: split assumevalid ancestry-failure-reason message
6c13a38ab51c log: separate script verification reasons
f2ea6f04e79b refactor: untangle assumevalid decision branches
9bc298556cb0 validation: log initial script verification state
4fad4e992c49 test: add assumevalid scenarios scaffold
75353a016357 Merge bitcoin/bitcoin#32326: net: improve the interface around FindNode() and avoid a recursive mutex lock
87e7f37918d4 doc: clarify peer address in getpeerinfo and addnode RPC help
2a4450ccbbe3 net: change FindNode() to not return a node and rename it
4268abae1a1d net: avoid recursive m_nodes_mutex lock in DisconnectNode()
acc7f2a433b1 Merge bitcoin/bitcoin#33401: ci: Remove bash -c from cmake invocation using eval
1aaaaa078bb2 fuzz: Drop unused workaround after Apple-Clang bump
fadad7a49477 Drop support for EOL macOS 13
50194029e7c2 ci: Remove bash -c from cmake invocation using eval
f41f97240c06 Merge bitcoin/bitcoin#28584: Fuzz: extend CConnman tests
cc4a2cc6bdc4 Merge bitcoin/bitcoin#33453: docs: Undeprecate datacarrier and datacarriersize configuration options
7502d4e94038 Merge bitcoin/bitcoin#33260: test: Use extra_port() helper in feature_bind_extra.py
14ae71f323dd test: make notfound_on_unannounced more reliable
99bc552980d9 test: fix (w)txid confusion in p2p_leak_tx.py
576dd97cb91e test: increase timeout in p2p_leak_tx.py
ac599c4a9cb3 test: Test MuSig2 in the wallet
68ef954c4c59 wallet: Keep secnonces in DescriptorScriptPubKeyMan
4a273edda0ec sign: Create MuSig2 signatures for known MuSig2 aggregate keys
258db9388994 sign: Add CreateMuSig2AggregateSig
bf69442b3f50 sign: Add CreateMuSig2PartialSig
512b17fc56ea sign: Add CreateMuSig2Nonce
82ea67c607cd musig: Add MuSig2AggregatePubkeys variant that validates the aggregate
d99a081679e1 psbt: MuSig2 data in Fill/FromSignatureData
4d8b4f53363f signingprovider: Add musig2 secnonces
c06a1dc86ff2 Add MuSig2SecNonce class for secure allocation of musig nonces
9baff05e4944 sign: Include taproot output key's KeyOriginInfo in sigdata
4b24bfeab9d6 pubkey: Return tweaks from BIP32 derivation
8f73d9522146 Merge bitcoin/bitcoin#33299: wallet: reduce unconditional logging during load
0f7d4ee4e828 p2p: Use different inbound inv timer per network
93a70a42d30f depends: Update URL for `qrencode` package source tarball
6de80512632a depends: Use hash instead of file name for package download stamp
bc706955d740 ci: expose all ACTIONS_* vars
46135d90ea90 depends: Drop redundant check for downloaded file
771978952a98 depends: Fix `$(package)_fetched` target
25212dfdb4cd Merge bitcoin/bitcoin#33487: ci: use latest versions of lint deps
06df14ba75be test: add more TRUC reorg coverge
26e71c237d9d Mempool: Do not enforce TRUC checks on reorg
bbe8e9063c15 fuzz: don't bypass_limits for most mempool harnesses
d4f47f97715c ci: use latest versions of lint deps
fc861332b351 wallet, log: reduce unconditional logging during load
3a4d1a25cf94 net: merge AlreadyConnectedToAddress() and FindNode(CNetAddr)
444409ff2b78 ci: Reduce Alpine musl task to md runner size
d8fe258cd610 Merge bitcoin/bitcoin#33484: doc: rpc: fix case typo in `finalizepsbt` help (final_scriptwitness)
dda5228e02ca test: set par=2 in default config for functional test framework
ff05bebcc426 doc: rpc: fix case typo in `finalizepsbt` help (final_scriptwitness)
200150beba66 Merge bitcoin/bitcoin#33313: test/refactor: use test deque to avoid quadratic iteration
7e08445449fc Merge bitcoin/bitcoin#33399: key: use static context for libsecp256k1 calls where applicable
7b5261f7ef3d contrib: fix using macdploy script without translations.
65e909dfdd93 Merge bitcoin/bitcoin#33430: rpc: addpeeraddress: throw on invalid IP
31b29f8eb629 Merge bitcoin/bitcoin#33229: multiprocess: Don't require bitcoin -m argument when IPC options are used
e62e0a12b332 Merge bitcoin/bitcoin#33230: cli: Handle arguments that can be either JSON or string
7ae0497eef8f ci: remove 3rd party js from windows dll gha job
05d984b1a4fb Merge bitcoin/bitcoin#33475: bugfix: miner: fix `addPackageTxs` unsigned integer overflow
fa6b2e9efece ci: Turn centos config into alpine musl config
b807dfcdc592 miner: fix `addPackageTxs` unsigned integer overflow
d41b503ae128 Merge bitcoin/bitcoin#33446: rpc: fix getblock(header) returns target for tip
5ae8edbc304a Merge bitcoin/bitcoin#33158: macdeploy: avoid use of `Bitcoin Core` in Linux cross build
df67bb6fd84c test: Remove convert_to_json_for_cli
44a493e150a7 cli: Allow arguments to be both strings and json
ad4a49090da8 Merge bitcoin/bitcoin#33408: msvc: Update vcpkg manifest
dd61f08fd52b Merge bitcoin/bitcoin#33031: wallet: Set descriptor cache upgraded flag for migrated wallets
350692e561ce Merge bitcoin/bitcoin#33388: test: don't throw from the destructor of DebugLogHelper
94db966a3bb5 net: use generic network key for addrcache
eca50854e1cb depends: static libxcb_cursor
89144eb473c6 Merge bitcoin/bitcoin#33448: net/rpc: Report inv information for debugging
eaa1a3cd0b3d Merge bitcoin/bitcoin#33425: ci: remove Clang build from msan fuzz job
b77137a5644e ci: link against -lstdc++ in native fuzz with msan job
a86e1a6e32d8 Merge bitcoin/bitcoin#33427: rpc: Always return per-wtxid entries in submitpackage tx-results
6861dadfcb11 Merge bitcoin/bitcoin#33459: doc: remove unrelated `bitcoin-wallet` binary from `libbitcoin_ipc` description
3b3ab3a50a0b Merge bitcoin/bitcoin#33302: ci: disable cirrus cache in 32bit arm job
2738b63e025d test: validate behaviour of getpeerinfo last_inv_sequence and inv_to_send
fbde8d9a81d8 doc: remove unrelated `bitcoin-wallet` binary from `libbitcoin_ipc` description
34fefb633584 Merge bitcoin/bitcoin#33435: system: improve handling around GetTotalRAM()
56791b582958 test: split out `system_ram_tests` to signal when total ram cannot be determined
337a6e738616 system: improve handling around GetTotalRAM()
451ba9ada41f datacarrier: Undeprecate configuration option
77b2ebb81182 rpc/net: report per-peer last_inv_sequence
bf7996cbc3be rpc: fix getblock(header) returns target for tip
4c3c1f42cf70 test: add block 2016 to mock mainnet
953544d0286b Merge bitcoin/bitcoin#33429: fuzz: reduce iterations in slow targets
df101c97c260 Merge bitcoin/bitcoin#33422: build: Remove lingering Windows registry & shortcuts (#32132 follow-up)
56c6daa64f6b Merge bitcoin/bitcoin#28592: p2p: Increase tx relay rate
79752b9c0b6b build(windows): Remove lingering registry entries and shortcuts upon install
cad9a7fd7370 rpc: Always return per-wtxid entries in submitpackage tx-results
6a33970fef1b fuzz: Reduce iterations in slow targets
edb871cba22a Merge bitcoin/bitcoin#33412: Update libmultiprocess subtree to fix intermittent mptest hang
2427939935f3 test: forbid copying of DebugLogHelper
d6aa266d432f test: don't throw from the destructor of DebugLogHelper
91ac64b0a66f log: reword `signature validations` to `script verification` in `assumevalid` log
eaf2c464758b Merge bitcoin/bitcoin#33378: Remove unnecessary casts when calling socket operations
5aec516b2ce3 Merge bitcoin/bitcoin#33333: coins: warn on oversized `-dbcache`
316a0c513278 rpc: addpeeraddress: throw on invalid IP
74fa028da1ea Merge bitcoin/bitcoin#33420: test: Avoid interface_ipc.py Duplicate ID errors
168360f4ae47 coins: warn on oversized -dbcache
6c720459beea system: add helper for fetching total system memory
e9c52272ebd7 test: Avoid interface_ipc.py Duplicate ID errors
535fa0ad0d26 Squashed 'src/ipc/libmultiprocess/' changes from 13424cf2ecc1..47d79db8a552
c49a43591f88 Merge commit '535fa0ad0d2637f845beae92ea9dbbbbbe377c74' into pr/subtree-5
453b0fa286e5 bitcoin: Make wrapper not require -m
1444ed855f43 Merge bitcoin/bitcoin#33407: cmake: Install `bitcoin` manpage
29e836fae660 test: add tool_bitcoin to test bitcoin wrapper behavior
0972f5504021 init: add exe name to bitcoind, bitcoin-node -version output to be able to distinguish these in tests
2b0cd1f3fb22 Merge bitcoin/bitcoin#33395: net: do not apply whitelist permissions to onion inbounds
f14876213aad musig: Move synthetic xpub construction to its own function
ef20c2d11d96 build, msvc: Update vcpkg manifest baseline
1ff9e929489e key: use static context for libsecp256k1 calls where applicable
f563ce90818d net: Do not apply whitelist permission to onion inbounds
947bed28fe62 Merge bitcoin/bitcoin#33380: test: Add submitblock test in interface_ipc
7584a4fda95d cmake: Install `bitcoin` manpage
67f632b6deb8 net: remove unnecessary casts in socket operations
c4adfbf70626 Merge bitcoin/bitcoin#33373: depends: systemtap 5.3
5aa3d3135d25 Merge bitcoin/bitcoin#33391: test: Prevent disk space warning during node_init_tests
bdf01c6f6126 test: Prevent disk space warning during node_init_tests
0a26731c4cc1 test: Add submitblock test in interface_ipc
2d6a0c464912 Merge bitcoin/bitcoin#33379: cmake: Fix regression in `secp256k1.cmake`
f031536f2d26 ci: use Mold linker for asan-lsan-ubsan-integer-no-depends-usdt workflow
cc5dda1de333 headerssync: Make HeadersSyncState more flexible and move constants
8fd1c2893e67 test(headerssync): Test returning of pow_validated_headers behavior
7b00643ef5f9 test(headerssync): headers_sync_chainwork test improvements
04eeb9578c60 doc(test): Improve comments
fe896f8faa78 refactor(test): Store HeadersSyncState on the stack
f03686892a9c refactor(test): Break up headers_sync_state
e984618d0b99 refactor(headerssync): Process spans of headers
a4ac9915a95e refactor(headerssync): Extract test constants ahead of breakup into functions
9193c3e4340b cmake: Fix regression in `secp256k1.cmake`
d20f10affba8 Merge bitcoin/bitcoin#33268: wallet: Identify transactions spending 0-value outputs, and add tests for anchor outputs in a wallet
28efd724b478 depends: systemtap 5.3
9a5ba154bea1 Merge bitcoin/bitcoin#33310: trace: Workaround GCC bug compiling with old systemtap
853f0d881142 Merge bitcoin/bitcoin#33364: ci: always use tag for LLVM checkout
b81445333a10 Merge bitcoin/bitcoin#33243: test: Fix CLI_MAX_ARG_SIZE issues
f757da87f59d Merge bitcoin/bitcoin#33332: common: Make arith_uint256 trivially copyable
e416dc2fbbb7 Merge bitcoin/bitcoin#33321: kernel: make blockTip index const
75e6984ec8c6 test/refactor: use test deque to avoid quadratic iteration
176fac0f16d5 Merge bitcoin/bitcoin#33141: test: Remove polling loop from test_runner (take 2)
593d5fe37d7a Merge bitcoin/bitcoin#33354: txgraph: use enum Level instead of bool main_only
653a9849d5f9 common: Make arith_uint256 trivially copyable
b736052e39f1 ci: always use tag for LLVM checkout
652424ad162b test: additional test coverage for script_verify_flags
00c253d49417 ci: disable cirrus cache in 32bit arm job
ff18b6bbaf32 ci: refactor docker action to return provider str
d45f3717d2c6 txgraph: use enum Level instead of bool main_only
ee42d59d4de9 Merge bitcoin-core/gui#886: Avoid pathological QT text/markdown behavior...
2c8a478db4b8 Merge bitcoin/bitcoin#33231: net: Prevent node from binding to the same `CService`
591eea7b5ac5 Merge bitcoin/bitcoin#33082: wallet, refactor: Remove Legacy check and error
6a371b70c87a gui: Avoid pathological QT text/markdown behavior...
02d2b5a11c92 ci, iwyu: Treat warnings as errors for specific directories
57a3eac387bd refactor: Fix includes in `index` directory
c0894a0a2be0 Merge bitcoin/bitcoin#33348: contrib: add bitcoin binary to gen-manpages
53e6db91ef59 contrib: add placeholder manpage for bitcoin binary
bdb8eadcdc19 refactor: Fix includes in `crypto` directory
56f2a689a201 ci: Do not patch `leveldb` to workaround UB in "tidy" CI job
f5887a8de4c8 contrib: add bitcoin binary to gen-manpages
314c42b55bda Merge bitcoin/bitcoin#33347: build: bump `CLIENT_VERSION_MAJOR` to 30
9f744fffc39d build: bump CLIENT_VERSION_MAJOR to 30
042817ddb84c Merge bitcoin/bitcoin#33346: doc: remove release note fragment
0f0e6fe7f5f4 doc: remove release note fragment
84cf5420398c Merge bitcoin/bitcoin#33275: Release: 30.0 translations update
13809b867ad9 Merge bitcoin/bitcoin#33303: ci: Checkout latest merged pulls
e749205f83dd Merge bitcoin/bitcoin#33319: ci: reduce runner sizes on various jobs
9cbd346daa50 Merge bitcoin/bitcoin#33340: Fix benchmark CSV output
4776179be9fb Merge bitcoin/bitcoin#33342: guix: strip binaries in libexec
0ba44d9c38af Merge bitcoin/bitcoin#33296: net: check for empty header before calling FillBlock
1861030bea7f Merge bitcoin/bitcoin#30469: index: Fix coinstats overflow
8b6264768030 test: send duplicate blocktxn message in p2p_compactblocks.py
5e585a0fc4fd net: check for empty header before calling FillBlock
cb825a07ac6d Merge bitcoin/bitcoin#33338: net: Add interrupt to pcp retry loop
0b0bd74c3e9a Merge bitcoin/bitcoin#33312: clang-tidy: Disable `UndefinedBinaryOperatorResult` check in `src/ipc`
790b440197bd Fix benchmark CSV output
3cceda9f4855 guix: strip binaries in libexec
3eea9fd39532 Merge bitcoin/bitcoin#33308: doc: fix `LIBRARY_PATH` comment
0b38cc9bf7a3 Merge bitcoin/bitcoin#33339: doc: move release notes to wiki pre branch off
b320f5efa175 qt: 30.0 translations update
905c1a77f51c doc: move release notes to wiki pre branch off
2d799590feea Merge bitcoin/bitcoin#33283: contrib: update fixed seeds
188de70c8641 net: Add interrupt to pcp retry loop
9c6fa07b1248 Merge bitcoin/bitcoin#33322: Update libmultiprocess subtree to improve build and logs
c76797481155 clang-tidy: Fix critical warnings
54dc34ec2279 index: Remove unused coinstatsindex recovery code
37c4fba1f4c1 index: Check BIP30 blocks when rewinding Coinstatsindex
51df9de8e5b9 doc: Add release note for 30469
bb8d67318329 test: Add coinstatsindex compatibility test
b2e8b64ddc35 index, refactor: Append blocks to coinstatsindex without db read
431a076ae6e3 index: Fix coinstatsindex overflow issue
fa8f081af31c ci: Checkout latest merged pulls
36e40417de3f Merge bitcoin-core/gui#884: Fix compatibility with `-debuglogfile` command-line option
a334bbe9b79d Squashed 'src/ipc/libmultiprocess/' changes from 1b8d4a6f1e54..13424cf2ecc1
a4ee70e5b69c Merge commit 'a334bbe9b79ddf1999003c792bc8945639b7e9c1' into pr/subtree-4
e04cb9c1bdf2 Merge bitcoin/bitcoin#33201: Add functional test for IPC interface
75d9b7247570 kernel: make blockTip index const
a341e11ac92b ci: test IPC on additional hosts
6aee573bfcf6 ci: enable IPC tests in CI
8d2ee88fa2a5 tests: add functional tests for IPC interface
3cc9a06c8dd5 test: Add TestNode ipcbind option
3cceb60a7153 test: Provide path to `bitcoin` binary
8c7f0056291d test: add is_ipc_compiled() and skip_if_no_ipc() functions
37c21ebe4078 Merge bitcoin/bitcoin#33309: doc: archive v29.1 release notes
32e2484b67e6 Merge bitcoin/bitcoin#33304: depends: strip when installing qt binaries
4d4789dffad5 net: Prevent node from binding to the same CService
647cdb4f7e80 Merge bitcoin/bitcoin#33311: net: Quiet down logging when router doesn't support natpmp/pcp
589b65f06c33 clang-tidy: Disable `UndefinedBinaryOperatorResult` check in `src/ipc`
4f1a4cbccd78 net: Quiet down logging when router doesn't support natpmp/pcp
93a29ff28301 trace: Workaround GCC bug compiling with old systemtap
5eeb2facbbbb ci: reduce runner sizes on various jobs
61ec8866c639 [doc] archive v29.1 release notes
a2a35b58cb95 doc: fix LIBRARY_PATH comment
e1ce0c525c7f Merge bitcoin/bitcoin#33291: ci: cd into BASE_BUILD_DIR for GetCMakeLogFiles
84e813a02bb7 index, refactor: DRY coinbase check
fab842b32487 index, refactor: Rename ReverseBlock to RevertBlock
2d8f5b91881e Merge bitcoin/bitcoin#33136: ci: Remove redundant RUN_UNIT_TESTS_SEQUENTIAL
c9d5f211c119 depends: strip when installing qt
fae610d8581a ci: Remove redundant RUN_UNIT_TESTS_SEQUENTIAL
2562fe1b2b63 Merge bitcoin/bitcoin#32159: net, pcp: handle multi-part responses and filter for default route while querying default gateway
ed2ff3c63d83 Merge bitcoin/bitcoin#33235: build: set ENABLE_IPC to OFF when fuzzing
88db09bafe9e net: handle multi-part netlink responses
113a4228229b wallet: Add m_cached_from_me to cache "from me" status
609d265ebc51 test: Add a test for anchor outputs in the wallet
c40dc822d74a wallet: Throw an error in sendall if the tx size cannot be calculated
39a7dbdd277d wallet: Determine IsFromMe by checking for TXOs of inputs
e76c2f7a4111 test: Test wallet 'from me' status change
689a32197638 Merge bitcoin/bitcoin#33220: doc: truc packages allow sub min feerate transactions
9b76eef2d2b4 ci: cd into BASE_BUILD_DIR for GetCMakeLogFiles
8e434a84999c macdeploy: rename macOS output to bitcoin-macos-app.zip
05353d9cf08c macdeploy: combine appname & -zip arguments
939678940f6c contrib: update fixed seeds
6cdd8ee67618 contrib: update makeseeds minblocks
b8da9f4034e1 contrib: update makeseeds UA regex
ba0b4304ecee Merge bitcoin/bitcoin#32989: ci: Migrate CI to hosted Cirrus Runners
0eb3eae54865 Merge bitcoin/bitcoin#33274: kernel: chainparams & headersync updates for 30.0
fa4885ef2fde test: Remove polling loop from test_runner
7270839af425 doc: truc packages allow sub min feerate transactions
46369583f3a9 Merge bitcoin/bitcoin#33224: doc: unify `datacarriersize` warning with release notes
755152ac819a kernel: add testnet4 assumeutxo param at height 90'000
a6512686e335 kernel: add mainnet assumeutxo param at height 910'000
943de66b5043 kernel: update headersync params
66fb96242648 kernel: update chainTxData
c3cb26e02834 kernel: update assumevalid and minimumChainWork
b4adae76d466 kernel: update assumed blockchain & chainstate sizes
7e58c94112d0 Merge bitcoin/bitcoin#33269: test: Fixup fill_mempool docstring
65a10fc3c52e p2p: add assertion for BlockTransactionsRequest indexes
58be359f6b24 fuzz: add a target for DifferenceFormatter Class
13f36c020f03 clang-format: regenerate configs
3c5da69a232b ci: remove un-needed lint_run*.sh files
2aa288efdda2 ci: fix annoying docker warning
dd1c5903e8d8 ci: add ccache hit-rate warning when < 75%
f4272844833d doc: Detail configuration of hosted CI runners
3f339e99e00b ci: dynamically match makejobs with cores
4393ffdd837b ci: remove .cirrus.yml
bc41848d00f7 ci: port lint
d290a8e6eab7 ci: port msan-depends
9bbae61e3b40 ci: port tsan-depends
bf7d5364527c ci: port tidy
549074bc643f ci: port centos-depends-gui
58e38c3a0425 ci: port previous-releases-depends-debug
341196d75c30 ci: port fuzzer-address-undefined-integer-nodepends
f2068f26c123 ci: port no-IPC-i686-DEBUG
2a00b12d73bb ci: port nowallet-libbitcoinkernel
9c2514de5343 ci: port mac-cross-gui-notests
2c990d84a3db ci: force reinstall of kernel headers in asan
884251441bb7 ci: update asan-lsan-ubsan
f253031cb8e4 ci: port arm 32-bit job
5ded99a7f007 fuzz: MockMempoolMinFee in wallet_fees
c9a7a198d9e8 test: move MockMempoolMinFee to util/txmempool
adf67eb21baf fuzz: create FeeEstimatorTestingSetup to set fee_estimator
ff10a37e9927 fuzz: mock CBlockPolicyEstimator in wallet_fuzz
04e7bfbceb03 ci: update windows-cross job
cc1735d77714 ci: add job to determine runner type
020069e6b718 ci: add Cirrus cache host
9c2b96e0d030 ci: have base install run in right dir
18f6be09d02b ci: use docker build cache arg directly
94a09325475d ci: use buildx in ci
fdf64e553245 ci: add configure-docker action
33ba073df7a8 ci: add REPO_USE_CIRRUS_RUNNERS
b232b0fa5e96 ci: add caching actions
b8fcc9fcbcdd ci: add configure environment action
f591c3becafc fees: make estimateSmartFee/HighestTargetTracked virtual for mocking
fa3f682032a3 test: Fixup fill_mempool docstring
7cc9a087069b Merge bitcoin/bitcoin#33253: Revert compact block cache inefficiencies
084fd68fda2c Merge bitcoin/bitcoin#33258: ci: use LLVM 21
6ff2d423625d Merge bitcoin/bitcoin#33189: rpc: followups for 33106
4d54bb2b92cc Merge bitcoin/bitcoin#33264: threading: reduce the scope of lock in getblocktemplate
9ae23950ef80 Merge bitcoin/bitcoin#33261: ci: return to using dash in CentOS job
b6f8c48946cb coins: increase default `dbbatchsize` to 32 MiB
8bbb7b8bf8e3 refactor: Extract default batch size into kernel
493ba0f68831 threading: reduce the scope of lock in getblocktemplate
509ffea40abb ci: return to using dash in CentOS job
fabc2615af26 test: Use extra_port() helper in feature_bind_extra.py
b7b249d3adfb Revert "[refactor] rewrite vTxHashes as a vector of CTransactionRef"
b9300d8d0a74 Revert "refactor: Simplify `extra_txn` to be a vec of CTransactionRef instead of a vec of pair<Wtxid, CTransactionRef>"
df5a50e5de20 bench/blockencodings: add compact block reconstruction benchmark
4cf0ae474ba0 ci: use LLVM 21
fa96a4afea2a ci: Enable CI_LIMIT_STACK_SIZE=1 in i686_no_ipc task
facfde2cdce6 test: Fix CLI_MAX_ARG_SIZE issues
6ca6f3b37b99 Merge bitcoin/bitcoin#33241: Update libmultiprocess subtree to fix build issues
9703b7e6d563 Merge bitcoin/bitcoin#32592: threading: remove ancient CRITICAL_SECTION macros
dd68d0f40b61 Squashed 'src/ipc/libmultiprocess/' changes from b4120d34bad2..1b8d4a6f1e54
323b3fd27283 Merge commit 'dd68d0f40b614474f24469fbe1ba02f8f9146b31' into pr/subtree-3
d3c5e47391e2 wallet, refactor: Remove Legacy check and error
73220fc0f958 Merge bitcoin/bitcoin#33212: index: Don't commit state in BaseIndex::Rewind
46ca7712cb5f threading: remove unused template instantiations
b537a6a6dbd3 threading: remove obsolete critsect macros
0d0e0a39b4a5 threading: use a reverse lock rather than manual critsect macros
3ddd554d3181 tests: Add Assertions in reverse_lock tests to exercise thread-safety annotations
c88b1cbf57a3 tests: get rid of remaining manual critsect usage
2c223de2af72 Merge bitcoin/bitcoin#33237: doc: use new block_to_connect parameter name
02f6758e0ce8 Merge bitcoin/bitcoin#33233: doc: follow-ups to "Add bitcoin-{node,gui} to release binaries for IPC"
682bd04462d2 Merge bitcoin/bitcoin#33236: doc: Remove wrong and redundant doxygen tag
a9701de0c9fd Merge bitcoin/bitcoin#33217: depends: remove xinerama extension from libxcb
78351ed083b1 Merge bitcoin/bitcoin#33222: miner: clamp options instead of asserting
de65c86572c5 doc: capnproto instruction for Alpine and Arch
49d1a1a36306 doc: add capnproto-devel to Fedora build instruction
a602f6fb7bf5 test: index with an unclean restart after a reorg
01b95ac6f496 index: don't commit state in BaseIndex::Rewind
1c3db0ed8e6f doc: use new block_to_connect parameter name
8333aa530290 Merge bitcoin/bitcoin#32523: wallet: Remove isminetypes
eab5518913a6 doc: mark bitcoin-{node,gui} installed in files.md
966666de9a62 doc: Remove wrong and redundant doxygen tag
d0e1bbad016c test: repeat block malleability test with relayable block over P2P
af4156ab7556 build: set ENABLE_IPC to OFF when fuzzing
2a815d126bc9 doc: link to capnp version bump PR
decc3671c88b guix: remove libxcb-xinerama.so.0 from allowed libs
3d9314f3838c depends: remove xinerama extension from libxcb
7d9789401be4 Merge bitcoin/bitcoin#31802: Add bitcoin-{node,gui} to release binaries for IPC
2885bd0e1c4f doc: unify `datacarriersize` warning with release notes
be776a1443fd wallet: Remove isminetype
009a69a616cf wallet: Remove ISMINE_USED
6a7aa015747e wallet: Remove COutput::spendable and AvailableCoinsListUnspent
7392b8b084be miner: clamp options instead of asserting
620abe985e51 interfaces, gui: Remove is_mine output parameter from getAddress
c0d28c8f5b15 qt: Fix compatibility with `-debuglogfile` command-line option
19273d0705fc fuzz: set mempool options in wallet_fees
81e5c8385b9e test: cover invalid codesep positions for signature in taproot
daa40a3ff973 doc fixups for 33106
c568511e8ced test fixup for incremental feerate
636fa219d37f test fixups
9169a50d529e [rpc] expose blockmintxfee via getmininginfo
ce7d94a492e6 doc: add release note
71f29d4fa90a doc: update build and dependencies docs for IPC
3cbf747c328f cmake: set ENABLE_IPC by default
32a90e1b9017 ci: use bitcoin-node for one depends job
b333cc14d50b ci: build one depends job without multiprocess
16bce9ac4cd0 build: depends makes libmultiprocess by default
417437eb01ac script/verify_flags: extend script_verify_flags to 64 bits
3cbbcb66efc3 script/interpreter: make script_verify_flag_name an ordinary enum
bddcadee82da script/verify_flags: make script_verify_flags type safe
a5ead122fe06 script/interpreter: introduce script_verify_flags typename
4577fb2b1e09 rpc: have getdeploymentinfo report script verify flags
a3986935f073 validation: export GetBlockScriptFlags()
5db8cd2d37eb Move mapFlagNames and FormatScriptFlags logic to script/interpreter.h
adefb51c5437 rpc/net: add per-peer inv_to_send sizes
30c6f64eed30 test: Remove unnecessary LoadWallet() calls
fb8720f1e09f sign: Refactor Schnorr sighash computation out of CreateSchnorrSig
a4cfddda644f tests: Clarify why musig derivation adds a pubkey and xpub
39a63bf2e7e3 descriptors: Add a doxygen comment for has_hardened output_parameter
2320184d0ea8 descriptors: Fix meaning of any_key_parsed
88b0647f027a wallet: Always write last hardened cache flag in migrated wallets
8a08eef645ee tests: Check that the last hardened cache upgrade occurs
0465574c1279 test: Fixes send_blocks_and_test docs
09c95f21e71d test: Adds block tiebreak over restarts tests
18524b072e6b Make nSequenceId init value constants
8b91883a23aa Set the same best tip on restart if two candidates have the same work
5370bed21e0b test: add functional test for complex reorgs
ab145cb3b471 Updates CBlockIndexWorkComparator outdated comment
fa37153288ca util: Abort on failing CHECK_NONFATAL in debug builds
fa0dc4bdffb0 test: Allow testing of check failures
faeb58fe6686 refactor: Set G_ABORT_ON_FAILED_ASSUME when G_FUZZING_BUILD
5fa81e239a39 test: add valid tx test with minimum-sized ECDSA signature (8 bytes DER-encoded)
0802398e749c fuzz: make it possible to mock (fuzz) CThreadInterrupt
6d9e5d130d2e fuzz: add CConnman::SocketHandler() to the tests
3265df63a48d fuzz: add CConnman::InitBinds() to the tests
91cbf4dbd864 fuzz: add CConnman::CreateNodeFromAcceptedSocket() to the tests
50da7432ec1e fuzz: add CConnman::OpenNetworkConnection() to the tests
e6a917c8f8e0 fuzz: add Fuzzed NetEventsInterface and use it in connman tests
e883b3776881 fuzz: set the output argument of FuzzedSock::Accept()
58e55b17e632 test: descriptor: cover invalid multi/multi_a cases
664657ed1343 bugfix: disallow label for ranged descriptors & allow external non-ranged descriptors to have label
fe71a4b139f3 depends: Avoid `warning: "_FORTIFY_SOURCE" redefined` for `libevent`
42e99ad77396 net: skip non-route netlink responses
57ce645f05d1 net: filter for default routes in netlink responses
b81f37031c8f p2p: Increase tx relay rate
REVERT: 1857296c067b kernel: Fix bitcoin-chainstate for windows
REVERT: b14455e3fcc5 kernel: Add Purpose section to header documentation
REVERT: b6bc17b703dd kernel: Allowing reducing exports
REVERT: b1ef48b20730 kernel: Add pure kernel bitcoin-chainstate
REVERT: b8e4169e453a kernel: Add functions to get the block hash from a block
REVERT: ea03b539a2fa kernel: Add block index utility functions to C header
REVERT: 10e8bc695713 kernel: Add function to read block undo data from disk to C header
REVERT: 49743bf8c133 kernel: Add functions to read block from disk to C header
REVERT: 11588ec6537c kernel: Add function for copying block data to C header
REVERT: de24590872f8 kernel: Add functions for the block validation state to C header
REVERT: dcba34ad8f86 kernel: Add validation interface to C header
REVERT: 527435ebcc73 kernel: Add interrupt function to C header
REVERT: c6a3da91764a kernel: Add import blocks function to C header
REVERT: f7d879349a61 kernel: Add chainstate load options for in-memory dbs in C header
REVERT: 9b0116f0adad kernel: Add options for reindexing in C header
REVERT: 4bbd99b03001 kernel: Add block validation to C header
REVERT: 8dbc8230f110 kernel: Add chainstate loading when instantiating a ChainstateManager
REVERT: f1a9d6f4dfff kernel: Add chainstate manager option for setting worker threads
REVERT: 864008a1a71a kernel: Add chainstate manager object to C header
REVERT: b160f13ed141 kernel: Add notifications context option to C header
REVERT: d465a997f2e9 kernel: Add chain params context option to C header
REVERT: e61538b88b32 kernel: Add kernel library context object
REVERT: 3963f4c9de73 kernel: Add logging to kernel library C header
REVERT: f3acc94b4b7e kernel: Introduce initial kernel C header API

git-subtree-dir: depend/bitcoin
git-subtree-split: 4da01123df0f4cb7e05c09dbb1c6b00c064beabe
stringintech added a commit to stringintech/go-bitcoinkernel that referenced this pull request Nov 6, 2025
5c5704e730 Merge bitcoin/bitcoin#33791: kernel: Use enumeration type for flags argument
ed5720509f kernel: Use enumeration type for flags argument
50d106a4d6 Merge bitcoin/bitcoin#33781: clang-tidy: Remove no longer needed NOLINT
ffd7ca3c46 Merge bitcoin/bitcoin#33780: guix: disable libsanitizer in Linux GCC build
33389f1144 Merge bitcoin-core/gui#899: Modernize custom filtering
038849e2e0 clang-tidy: Remove no longer needed NOLINT
5c41fa2918 guix: disable libsanitizer in Linux GCC build
4da01123df Merge bitcoin/bitcoin#30595: kernel: Introduce C header API
96614fff63 Merge bitcoin/bitcoin#33714: random: scope environ extern to macOS, BSDs and Illumos
4e9bd579d3 Merge bitcoin/bitcoin#33045: depends: disable variables, rules and suffixes.
5ffa63d681 Merge bitcoin/bitcoin#33626: ci: run native fuzz with MSAN job
75baff98fc Merge bitcoin/bitcoin#33744: ci: Fix lint runner selection (and docker cache)
2593ed1b5f Merge bitcoin/bitcoin#33574: doc: update Guix INSTALL.md
1cd8d9fe5c Merge bitcoin/bitcoin#33445: ci: Update Clang in "tidy" job
56329beaee Merge bitcoin/bitcoin#32301: test: cover invalid codesep positions for signature in taproot
1e6e32fa8a ci: run native fuzz with MSAN job
3784d15bcd ci: use LLVM libcxx 21.1.5
6c7a34f3b0 kernel: Add Purpose section to header documentation
7e9f00bcc1 kernel: Allowing reducing exports
7990463b10 kernel: Add pure kernel bitcoin-chainstate
36ec9a3ea2 Kernel: Add functions for working with outpoints
5eec7fa96a kernel: Add block hash type and block tree utility functions to C header
f5d5d1213c kernel: Add function to read block undo data from disk to C header
09d0f62638 kernel: Add functions to read block from disk to C header
a263a4caf2 kernel: Add function for copying block data to C header
b30e15f432 kernel: Add functions for the block validation state to C header
aa262da7bc kernel: Add validation interface to C header
d27e27758d kernel: Add interrupt function to C header
1976b13be9 kernel: Add import blocks function to C header
a747ca1f51 kernel: Add chainstate load options for in-memory dbs in C header
070e77732c kernel: Add options for reindexing in C header
ad80abc73d kernel: Add block validation to C header
cb1590b05e kernel: Add chainstate loading when instantiating a ChainstateManager
e2c1bd3d71 kernel: Add chainstate manager option for setting worker threads
65571c36a2 kernel: Add chainstate manager object to C header
c62f657ba3 kernel: Add notifications context option to C header
9e1bac4585 kernel: Add chain params context option to C header
337ea860df kernel: Add kernel library context object
28d679bad9 kernel: Add logging to kernel library C header
2cf136dec4 kernel: Introduce initial kernel C header API
e15e8cbada qt: Modernize custom filtering
745eb053a4 Merge bitcoin-core/gui#901: Add createwallet, createwalletdescriptor, and migratewallet to history filter
52b1595850 depends: disable builtin variables
8b5a28fa78 depends: disable builtin rules and suffixes.
7632e0ba31 ci: fix configure docker action inputs
746d36cc80 Merge bitcoin/bitcoin#33754: ci: gha: Set debug_pull_request_number_str annotation
25c45bb0d0 Merge bitcoin/bitcoin#33567: node: change a tx-relay on/off flag to enum
422b468229 Merge bitcoin/bitcoin#33683: refactor/doc: Add blockman param to GetTransaction doc comment
da6f041e39 Merge bitcoin/bitcoin#31645: [IBD] coins: increase default UTXO flush batch size to 32 MiB
832a57673a Merge bitcoin/bitcoin#33749: test: ipc: resolve symlinks in `which capnp`
3cd4263bf6 Merge bitcoin/bitcoin#33753: test: Format strings in `test_runner`
78d4d36730 test: Format strings in `*.rs`
fa9d0f994b ci: gha: Set debug_pull_request_number_str annotation
305384a037 Merge bitcoin/bitcoin#33746: ci: Add missing python3-dev package for riscv64
8eda7210eb Merge bitcoin/bitcoin#33743: fuzz: refactor memcpy to std::ranges::copy to work around ubsan warn
51093d6ae1 test: resolve symlinks in which result for capnp
6f359695c3 Merge bitcoin/bitcoin#33698: test: Use same rpc timeout for authproxy and cli
c281bb6837 Merge bitcoin/bitcoin#32924: test: add valid tx test with minimum-sized ECDSA signature (8 bytes DER-encoded)
facf8b771a ci: Add missing python3-dev package for riscv64
b4d0288c46 doc: update Guix INSTALL.md
0b3b8a3be1 ci: fix lint docker caching
fa4b52bd16 fuzz: refactor memcpy to std::ranges::copy to work around ubsan warn
72511fd02e Merge bitcoin/bitcoin#33555: build: Bump clang minimum supported version to 17
79d6f458e2 random: scope environ extern to macOS, BSDs and Illumos
292ea0eb89 Merge bitcoin/bitcoin#33677: ci: Retry image building once on failure
dd82c6c5d0 Merge bitcoin/bitcoin#33693: ci: use pycapnp 2.2.1
3bb30658e6 Merge bitcoin/bitcoin#32380: Modernize use of UTF-8 in Windows code
5a58d4915e Merge bitcoin/bitcoin#33546: test: add functional test for `TestShell` (matching doc example)
1abc8fa308 Merge bitcoin/bitcoin#33218: refactor: rename `fees.{h,cpp}` to `fees/block_policy_estimator.{h,cpp}`
de15e52f09 Merge bitcoin/bitcoin#32867: doc: mention key removal in rpc interface modification
5d784bebaf clang-tidy: Disable `ArrayBound` check in src/ipc and src/test
5efdb0ef30 ci: Update Clang in "tidy" job
24434c1284 Merge bitcoin/bitcoin#31308: ci, iwyu: Treat warnings as errors for specific directories
27cd7f5049 Merge bitcoin/bitcoin#33185: guix: update time-machine to 5cb84f2013c5b1e48a7d0e617032266f1e6059e2
80bb7012be Merge bitcoin/bitcoin#31514: wallet: allow label for non-ranged external descriptor (if `internal=false`) & disallow label for ranged descriptors
5e1f626ac3 Merge bitcoin/bitcoin#32504: test: descriptor: cover invalid multi/multi_a cases
56e9703968 Merge bitcoin/bitcoin#29640: Fix tiebreak when loading blocks from disk (and add tests for comparing chain ties)
53b34c80c6 ci: use pycapnp 2.2.1 in mac native job
865432869c ci: remove Python version comment from mac config
9bd9ec00b2 Merge bitcoin/bitcoin#33688: test: Update BIP324 test vectors
1a7fb5eeee fees: return current block height in estimateSmartFee
ab49480d9b fees: rename fees_args to block_policy_estimator_args
06db08a435 fees: refactor: rename fees to block_policy_estimator
6dfdd7e034 fees: refactor: rename policy_fee_tests.cpp to feerounder_tests.cpp
f54ffb4bc1 Merge bitcoin/bitcoin#32813: clang-format: make formatting deterministic for different formatter versions
1916c51cd8 Merge bitcoin/bitcoin#33210: fuzz: enhance wallet_fees by mocking mempool stuff
0eb554728c Merge bitcoin/bitcoin#33336: log: print every script verification state change
c6c4edf324 Merge bitcoin/bitcoin#32983: rpc: refactor: use string_view in Arg/MaybeArg
00ad998d95 Merge bitcoin/bitcoin#33252: p2p: add `DifferenceFormatter` fuzz target and invariant check
1a1f46c228 refactor/doc: Add blockman param to `GetTransaction` doc comment and reorder out param
66667d6512 test: Use same rpc timeout for authproxy and cli
5555bce994 ci: Document why IN_GETOPT_BIN env var is needed on macOS
fabe516440 ci: Export the container id in python script
f6ba97cea1 Merge bitcoin/bitcoin#33666: ci: Drop libFuzzer from msan fuzz task
af78d36512 Merge bitcoin/bitcoin#32588: util: Abort on failing CHECK_NONFATAL in debug builds
51877f2fc5 test: Update BIP324 test vectors
161864a038 Merge bitcoin/bitcoin#32579: p2p: Correct unrealistic headerssync unit test behavior
70a6fb5e5a Merge bitcoin/bitcoin#33172: test: p2p block malleability
99cb2054bd Merge bitcoin/bitcoin#33600: refactor: Construct g_verify_flag_names on first use
211bf6c975 Merge bitcoin/bitcoin#33566: miner: fix empty mempool case for waitNext()
944e5ff848 doc: mention key removal in rpc interface modification
d32f9525e4 Merge bitcoin/bitcoin#33679: test: set number of RPC server threads to 2
1c85d06232 Merge bitcoin/bitcoin#32266: depends: Avoid `warning: "_FORTIFY_SOURCE" redefined` for `libevent`
11684c9ce2 Merge bitcoin/bitcoin#33674: ci: Doc ASLR workaround for sanitizer tasks
e9cd45e3d3 test: set number of RPC server threads to 2
fa6aa9f42f ci: Retry image building once on failure
fa4dbe04d7 ci: Allow overwriting check option in run() helper
fa8e4de5c3 ci: Use os.environ[key] access when value must be set
7d27af98c7 Merge bitcoin/bitcoin#33461: ci: add Valgrind fuzz
1569bcc387 Merge bitcoin/bitcoin#33639: ci: Only write docker build images to Cirrus cache
98c4994d0f Merge bitcoin/bitcoin#33570: randomenv: Fix MinGW dllimport warning for `environ`
c211d18322 Merge bitcoin/bitcoin#33670: test: Use unassigned p2p_port instead of hardcoded 60000 in p2p_i2p_ports.py
e4b04630bc ci: add Valgrind fuzz
3fee0754a2 Merge bitcoin/bitcoin#33550: Fix windows libc++ `fs::path` `fstream` compile errors
fa0e36156c ci: Doc ASLR workaround for sanitizer tasks
fa20275db3 test: Use unassigned p2p_port instead of hardcoded 60000 in p2p_i2p_ports.py
c862936d16 Merge bitcoin/bitcoin#33370: ci: use Mold linker for asan-lsan-ubsan-integer-no-depends-usdt workflow
fabe0e07de ci: Only write docker build images to Cirrus cache
fab64a5d6f ci: Move buildx command to python script
fa72a2bd5c ci: Remove unused MAYBE_CPUSET
fa70e23de7 ci: Drop libFuzzer from msan fuzz task
abe7cbfe1a Merge bitcoin/bitcoin#33470: build: Move CMAKE_SKIP_INSTALL_RPATH from CMake to Guix script
689ec28d1d Merge bitcoin/bitcoin#33633: test: [move-only] binary utils to utils.py
0eeae4d174 Merge bitcoin/bitcoin#33625: Update secp256k1 subtree to latest master
4b41f99d57 build: Move CMAKE_SKIP_INSTALL_RPATH from CMake to Guix script
d30f149360 Merge bitcoin/bitcoin#33630: doc: correct topology requirements in submitpackage helptext
3d22282564 [doc] correct topology requirements in submitpackage helptext
e744fd1249 Merge bitcoin/bitcoin#33641: Update leveldb subtree to latest master
4371740beb Merge bitcoin/bitcoin#33642: doc: archive release notes for v28.3
ceea24b921 doc: archive release notes for v28.3
54ffe3de5b Update leveldb subtree to latest master
f21162d819 Squashed 'src/leveldb/' changes from aba469ad6a..cad64b151d
e14451ac87 Merge bitcoin/bitcoin#33469: TxGraph: change m_excluded_clusters
f76e1ae389 Merge bitcoin/bitcoin#32313: coins: fix `cachedCoinsUsage` accounting in `CCoinsViewCache`
59c4898994 guix: remove python-pydantic-core input from LIEF
9f2a6927d3 guix: use Clang & LLVM 19 for macOS build
9570ddbec9 guix: update time-machine to 5cb84f2013c5b1e48a7d0e617032266f1e6059e2
7b5cc276aa guix: patch around riscv issue with newer (2.40+) binutils
91b5cbaabb ci: use Debian Trixie for macOS cross job
fa75ef4328 test: Move export_env_build_path to util.py
fa9f495308 test: Move get_binary_paths and Binaries to util.py
40e7d4cd0d Merge bitcoin/bitcoin#33549: ci: Add macOS cross task for arm64-apple-darwin
ea17618c11 Merge bitcoin/bitcoin#33480: ci: Turn CentOS config into Alpine musl config
b1f8a13702 Merge bitcoin/bitcoin#33624: test: P2SH sig ops are only counted with `SCRIPT_VERIFY_P2SH`
879c21045e Update secp256k1 subtree to latest master
3cbf7cb3e6 Squashed 'src/secp256k1/' changes from b9313c6e1a..d543c0d917
2f7a50f67c Merge bitcoin/bitcoin#33462: ci: add libcpp hardening flags to macOS fuzz job
07a926474b node: change a tx-relay on/off flag to enum
48aa0e98d0 Merge bitcoin/bitcoin#29675: wallet: Be able to receive and spend inputs involving MuSig2 aggregate keys
db4bde0b03 Merge bitcoin/bitcoin#33517: multiprocess: Fix high overhead from message logging
3a10d700bc test: P2SH sig ops are only counted with `SCRIPT_VERIFY_P2SH` flag
9314113b29 Merge bitcoin/bitcoin#33610: doc: archive release notes for v29.2
9b43428c96 TxGraph: change m_excluded_clusters
6e1adbbaa1 Merge bitcoin/bitcoin#33612: test: change log rate limit version gate
fdcf67de80 Merge bitcoin/bitcoin#33157: cluster mempool: control/optimize TxGraph memory usage
7b544341c0 test: change log rate limit version gate from 299900 to 290100
9610b0d1e2 randomenv: Fix MinGW dllimport warning for `environ`
6c4fe401e9 Merge bitcoin/bitcoin#33508: ci: fix buildx gha cache authentication on forks
8f7673257a miner: fix empty mempool case for waitNext()
c11a3dcc88 doc: archive release notes for v29.2
64a7c7cbb9 Merge bitcoin/bitcoin#33558: ci: Use native platform for win-cross task
93b56e95c0 Merge bitcoin/bitcoin#33601: doc: archive release notes for v30.0
563747971b Merge bitcoin/bitcoin#33580: depends: Use $(package)_file_name when downloading from the fallback
24d861da78 coins: only adjust `cachedCoinsUsage` on `EmplaceCoinInternalDANGER` insert
d7c9d6c291 coins: fix `cachedCoinsUsage` accounting to prevent underflow
39cf8bb3d0 refactor: remove redundant usage tracking from `CoinsViewCacheCursor`
67cff8bec9 refactor: assert newly-created parent cache entry has zero memory usage
023cd5a546 txgraph: add SingletonClusterImpl (mem optimization)
e346250732 txgraph: give Clusters a range of intended tx counts (preparation)
e93b0f09cc txgraph: abstract out creation of empty Clusters (refactor)
6baf12621f txgraph: comment fixes (doc fix)
726b995739 txgraph: make Cluster an abstract class (refactor)
2602d89edd txgraph: avoid accessing other Cluster internals (refactor)
04c808ac4c txgraph: expose memory usage estimate function (feature)
7680bb8fd4 txgraph: keep track of Cluster memory usage (preparation)
4ba562e5f4 txgraph: keep data structures compact (mem optimization)
bb5cb222ae depgraph: add memory usage control (feature)
b1637a90de txgraph: avoid holes in DepGraph positions (mem optimization)
2b1d302508 txgraph: move some sanity checks from Cluster to TxGraphImpl (refactor)
d40302fbaf txgraph: Make level of Cluster implicit (optimization)
8d6e49158e doc: archive release notes for v30.0
4e352efa2c qt: add createwallet, createwalletdescriptor, and migratewallet to history filter
0626b90f50 multiprocess: align our logging with libmultiprocess's
9d068225ee multiprocess: update multiprocess EventLoop construction to use options
d2987102dd Merge bitcoin/bitcoin#33573: doc: bump the template macOS version
f6567527d8 doc: bump the template macOS version
faa9d10c84 refactor: Construct g_verify_flag_names on first use
becf150013 Merge bitcoin/bitcoin#33518: Update libmultiprocess subtree to support reduced logging
cd1b7fa1ff Merge bitcoin/bitcoin#33577: Revert "depends: Update URL for `qrencode` package source tarball"
fa0fa0f700 refactor: Revert "disable self-assign warning for tests"
faed118fb3 build: Bump clang minimum supported version to 17
6b4a92b0fa Merge bitcoin/bitcoin#33568: doc: how to update a subtree
90b2884ce4 Merge bitcoin/bitcoin#33581: ci: Properly include $FILE_ENV in DEPENDS_HASH
d44b860cd0 Merge bitcoin/bitcoin#33584: ci: upgrade GitHub Action to download-artifact@v5
57f7c68821 test: add functional test for `TestShell` (matching doc example)
53874f7934 doc: test: update TestShell example instructions/options
b35341b9ba Update ci.yml
ceeb53adcd ci: Properly include $FILE_ENV in DEPENDS_HASH
671b774d1b depends: Use $(package)_file_name when downloading from the fallback
e4335a3192 Revert "depends: Update URL for `qrencode` package source tarball"
a89a822e6e Revert "depends: Use hash instead of file name for package download stamp"
fad5a7101c ci: Add macOS cross task for arm64
fa8c750a0a ci: Refactor get_previous_releases step in win-test-cross task
e4c04f7759 ci: add libcpp hardening flags to macOS fuzz job
a1226bc760 doc: how to update a subtree
eda91b07fd Merge commit '0f01e1577f7c6734eb345139a12aba329ef22a5f' into pr/subtree-6
0f01e1577f Squashed 'src/ipc/libmultiprocess/' changes from 47d79db8a552..a4f929696490
fa6fd16f36 ci: Use native platform for win-cross task
53e4951a5b Switch to ANSI Windows API in `fsbridge::fopen()` function
dbe770d921 Switch to ANSI Windows API in `Win32ErrorString()` function
06d0be4e22 Remove no longer necessary `WinCmdLineArgs` class
f366408492 cmake: Set process code page to UTF-8 on Windows
dccbb17806 Set minimum supported Windows version to 1903 (May 2019 Update)
c864a4c194 Simplify fs::path by dropping filename() and make_preferred() overloads
b0113afd44 Fix windows libc++ fs::path fstream compile errors
b63428ac9c rpc: refactor: use more (Maybe)Arg<std::string_view>
037830ca0d refactor: increase string_view usage
b3bf18f0ba rpc: refactor: use string_view in Arg/MaybeArg
45bd891465 log: split assumevalid ancestry-failure-reason message
6c13a38ab5 log: separate script verification reasons
f2ea6f04e7 refactor: untangle assumevalid decision branches
9bc298556c validation: log initial script verification state
4fad4e992c test: add assumevalid scenarios scaffold
ac599c4a9c test: Test MuSig2 in the wallet
68ef954c4c wallet: Keep secnonces in DescriptorScriptPubKeyMan
4a273edda0 sign: Create MuSig2 signatures for known MuSig2 aggregate keys
258db93889 sign: Add CreateMuSig2AggregateSig
bf69442b3f sign: Add CreateMuSig2PartialSig
512b17fc56 sign: Add CreateMuSig2Nonce
82ea67c607 musig: Add MuSig2AggregatePubkeys variant that validates the aggregate
d99a081679 psbt: MuSig2 data in Fill/FromSignatureData
4d8b4f5336 signingprovider: Add musig2 secnonces
c06a1dc86f Add MuSig2SecNonce class for secure allocation of musig nonces
9baff05e49 sign: Include taproot output key's KeyOriginInfo in sigdata
4b24bfeab9 pubkey: Return tweaks from BIP32 derivation
bc706955d7 ci: expose all ACTIONS_* vars
444409ff2b ci: Reduce Alpine musl task to md runner size
fa6b2e9efe ci: Turn centos config into alpine musl config
91ac64b0a6 log: reword `signature validations` to `script verification` in `assumevalid` log
f14876213a musig: Move synthetic xpub construction to its own function
f031536f2d ci: use Mold linker for asan-lsan-ubsan-integer-no-depends-usdt workflow
cc5dda1de3 headerssync: Make HeadersSyncState more flexible and move constants
8fd1c2893e test(headerssync): Test returning of pow_validated_headers behavior
7b00643ef5 test(headerssync): headers_sync_chainwork test improvements
04eeb9578c doc(test): Improve comments
fe896f8faa refactor(test): Store HeadersSyncState on the stack
f03686892a refactor(test): Break up headers_sync_state
e984618d0b refactor(headerssync): Process spans of headers
a4ac9915a9 refactor(headerssync): Extract test constants ahead of breakup into functions
02d2b5a11c ci, iwyu: Treat warnings as errors for specific directories
57a3eac387 refactor: Fix includes in `index` directory
bdb8eadcdc refactor: Fix includes in `crypto` directory
56f2a689a2 ci: Do not patch `leveldb` to workaround UB in "tidy" CI job
65a10fc3c5 p2p: add assertion for BlockTransactionsRequest indexes
58be359f6b fuzz: add a target for DifferenceFormatter Class
13f36c020f clang-format: regenerate configs
5ded99a7f0 fuzz: MockMempoolMinFee in wallet_fees
c9a7a198d9 test: move MockMempoolMinFee to util/txmempool
adf67eb21b fuzz: create FeeEstimatorTestingSetup to set fee_estimator
ff10a37e99 fuzz: mock CBlockPolicyEstimator in wallet_fuzz
f591c3beca fees: make estimateSmartFee/HighestTargetTracked virtual for mocking
b6f8c48946 coins: increase default `dbbatchsize` to 32 MiB
8bbb7b8bf8 refactor: Extract default batch size into kernel
d0e1bbad01 test: repeat block malleability test with relayable block over P2P
19273d0705 fuzz: set mempool options in wallet_fees
81e5c8385b test: cover invalid codesep positions for signature in taproot
fb8720f1e0 sign: Refactor Schnorr sighash computation out of CreateSchnorrSig
a4cfddda64 tests: Clarify why musig derivation adds a pubkey and xpub
39a63bf2e7 descriptors: Add a doxygen comment for has_hardened output_parameter
2320184d0e descriptors: Fix meaning of any_key_parsed
0465574c12 test: Fixes send_blocks_and_test docs
09c95f21e7 test: Adds block tiebreak over restarts tests
18524b072e Make nSequenceId init value constants
8b91883a23 Set the same best tip on restart if two candidates have the same work
5370bed21e test: add functional test for complex reorgs
ab145cb3b4 Updates CBlockIndexWorkComparator outdated comment
fa37153288 util: Abort on failing CHECK_NONFATAL in debug builds
fa0dc4bdff test: Allow testing of check failures
faeb58fe66 refactor: Set G_ABORT_ON_FAILED_ASSUME when G_FUZZING_BUILD
5fa81e239a test: add valid tx test with minimum-sized ECDSA signature (8 bytes DER-encoded)
58e55b17e6 test: descriptor: cover invalid multi/multi_a cases
664657ed13 bugfix: disallow label for ranged descriptors & allow external non-ranged descriptors to have label
fe71a4b139 depends: Avoid `warning: "_FORTIFY_SOURCE" redefined` for `libevent`
REVERT: 81cec737e6 kernel: Fix bitcoin-chainstate for windows
REVERT: 1826c485dd kernel: Add Purpose section to header documentation
REVERT: d7e618aa98 kernel: Allowing reducing exports
REVERT: fb7f524133 kernel: Add pure kernel bitcoin-chainstate
REVERT: dd0bdf279e Kernel: Add functions for working with outpoints
REVERT: eaa6abfc73 kernel: Add block hash type and block tree utility functions to C header
REVERT: 824ddf2885 kernel: Add function to read block undo data from disk to C header
REVERT: 76cab0768b kernel: Add functions to read block from disk to C header
REVERT: e41f6f459a kernel: Add function for copying block data to C header
REVERT: 39c647647a kernel: Add functions for the block validation state to C header
REVERT: 8a19a9d607 kernel: Add validation interface to C header
REVERT: 38a990dd48 kernel: Add interrupt function to C header
REVERT: fee8f6ff38 kernel: Add import blocks function to C header
REVERT: c29a6b87cc kernel: Add chainstate load options for in-memory dbs in C header
REVERT: e788b3ba06 kernel: Add options for reindexing in C header
REVERT: 2707fc515c kernel: Add block validation to C header
REVERT: 51a24c4004 kernel: Add chainstate loading when instantiating a ChainstateManager
REVERT: ea01a8caf3 kernel: Add chainstate manager option for setting worker threads
REVERT: add5904e0a kernel: Add chainstate manager object to C header
REVERT: 37a3395d27 kernel: Add notifications context option to C header
REVERT: d838a934be kernel: Add chain params context option to C header
REVERT: dc58ae9fc0 kernel: Add kernel library context object
REVERT: 7744997596 kernel: Add logging to kernel library C header
REVERT: dc504f57b3 kernel: Introduce initial kernel C header API

git-subtree-dir: depend/bitcoin
git-subtree-split: 5c5704e730796c6f31e2d7891bf6334674a04219
yuvicc added a commit to yuvicc/bitcoinkernel-jdk that referenced this pull request Nov 16, 2025
c66e988754 Merge bitcoin/bitcoin#33865: cmake: Specify Windows plugin path in `test_bitcoin-qt` property
e221b25246 Merge bitcoin/bitcoin#33860: depends: drop Qt patches
dfde31f2ec Merge bitcoin/bitcoin#33864: scripted-diff: fix leftover references to `policy/fees.h`
0dd8d5c237 cmake: Specify Windows plugin path in `test_bitcoin-qt` property
b0a3887154 scripted-diff: fix leftover references to `policy/fees.h`
48d4b936e0 Merge bitcoin/bitcoin#33511: init: Fix Ctrl-C shutdown hangs during wait calls
3c3c6adb72 Merge bitcoin/bitcoin#33745: mining: check witness commitment in submitBlock
e652b69b8d Merge bitcoin/bitcoin#33003: test: add option to skip large re-org test in feature_block
3789215f73 Merge bitcoin/bitcoin#33724: refactor: Return uint64_t from GetSerializeSize
d4e2a45833 Merge bitcoin/bitcoin#33750: doc: document fingerprinting risk when operating node on multiple networks
47618446a0 Merge bitcoin/bitcoin#33853: kernel: Allow null arguments for serialized data
3e9aca6f1b depends: drop qtbase-moc-ignore-gcc-macro.patch qt patch
0da5a82700 depends: drop unused qt patch
d0da953773 Merge bitcoin/bitcoin#32482: build: add `-W*-whitespace`
f450761f83 Merge bitcoin/bitcoin#33842: build: Bump g++ minimum supported version to 12
fa9f29a4a7 doc: Recommend latest Debian stable or Ubuntu LTS
fa1711ee0d doc: Add GCC-12 min release notes
faa8be75c9 ci: Enable experimental kernel stuff in G++-12 task (previous releases)
fabce97b30 test: Remove gccbug_90348 test case
fa3854e432 test: Remove unused fs::create_directories test
fa9dacdbde util: [refactor] Remove unused create_directories workaround
138726a6f8 Merge bitcoin/bitcoin#33850: depends: drop qtbase_avoid_native_float16 qt patch
1c3d5c8ffd Merge bitcoin/bitcoin#33840: test: [refactor] Use reference over ptr to chainman
40dcbf580d build: add -Wtrailing-whitespace=any
a3ac59a431 ci: Enable experimental kernel stuff in ASan task
5b89956eeb kernel: Allow null arguments for serialized data
169f93d2ac depends: drop qtbase_avoid_native_float16 qt patch
d7659cd7e6 build: add -Wleading-whitespace=spaces
d86650220a cmake: Disable `-Wtrailing-whitespace` warnings for RCC-generated files
aabc5ca6ed cmake: Switch from AUTORCC to `qt6_add_resources`
25ae14c339 subprocess: replace tab with space
0c2b9dadd5 scripted-diff: remove whitespace in sha256_sse4.cpp
4da084fbc9 scripted-diff: change whitespace to spaces in univalue
e6caf150b3 ci: add moreutils to lint job
a7e8067610 Merge bitcoin/bitcoin#33181: guix: build for Linux HOSTS with `-static-libgcc`
b354d1ce5c Merge bitcoin/bitcoin#33820: kernel: trim Chain interface
fa807f78ae build: Bump g++ minimum supported version to 12
a4e96cae7d Merge bitcoin/bitcoin#33042: refactor: inline constant return values from `dbwrapper` write methods
8c2710b041 Merge bitcoin/bitcoin#32517: rpc: add "ischange: true" to decoded tx outputs in wallet gettransaction response
1fe851a478 Merge bitcoin/bitcoin#32180: p2p: Advance pindexLastCommonBlock early after connecting blocks
5f0303b93f Merge bitcoin/bitcoin#33443: log: reduce excessive "rolling back/forward" messages during block replay
f4903dddc9 Merge bitcoin/bitcoin#33433: Bugfix: QA: rpc_bind: Skip nonloopback test if no such address is found
7a4901c902 test, refactor: Fix `-Warray-bounds` warning
06e9458869 Merge bitcoin/bitcoin#32856: Update `minisketch` subtree
66978a1a95 kernel: remove btck_chain_get_tip
4dd7e6dc48 kernel: remove btck_chain_get_genesis
faf2759c8c test: [refactor] Use reference over ptr to chainman
490cb056f6 Merge bitcoin/bitcoin#33785: util: Allow `Assert` (et al.) in contexts without __func__
dcd0099a76 Merge bitcoin/bitcoin#33826: scripted-diff: Remove obsolete comment
01adbbcd9c Merge bitcoin/bitcoin#33827: doc: Correct `pkgin` command usage on NetBSD
eec21bc7c8 Merge bitcoin/bitcoin#33536: doc: reference fuzz coverage steps in quick-start
035f934e02 Merge bitcoin/bitcoin#33823: ci: Use cmake --preset=dev-mode in test-each-commit task
ddd2afac10 Merge bitcoin/bitcoin#33676: interfaces: enable cancelling running `waitNext` calls
dee7eec643 doc: mention coverage build in quickstart section
0698c6b494 doc: Correct `pkgin` command usage on NetBSD
36724205fc scripted-diff: Remove obsolete comment
ca1ce52a0f Merge bitcoin/bitcoin#33825: refactor: Add missing include in bitcoinkernel_wrapper.h
fa1e8d8bad refactor: Add missing include in bitcoinkernel_wrapper.h
fa6db67369 ci: [refactor] Extract build_dir constant in ci-test-each-commit-exec.py
fa95e6cdc1 ci: Use cmake --preset=dev-mode in test-each-commit task
513a0da2e0 Merge bitcoin/bitcoin#33818: ci: Extend tidy job to cover kernel code
5d0a40d607 ci: Extend tidy job to cover kernel code
93e79181da Merge bitcoin/bitcoin#33786: script: remove dead code in `CountWitnessSigOps`
3c4bec6223 Merge bitcoin/bitcoin#33782: test: remove obsolete `get_{key,multisig}` helpers from wallet_util.py
4b12beedae Merge bitcoin/bitcoin#33793: test: move create_malleated_version() to messages.py for reuse
0b45e6db10 Merge bitcoin/bitcoin#33789: doc: add cmake help option in Windows build docs
2b9c351198 Merge bitcoin/bitcoin#33768: refactor: remove dead branches in `SingletonClusterImpl`
fad6efd3be refactor: Use STR_INTERNAL_BUG macro where possible
fada379589 doc: Remove unused bugprone-lambda-function-name suppression
f06c6e1898 guix: build for Linux HOSTS with -static-libgcc
1bdf4695b0 guix: patch store paths out of libunwind
078a72c35f guix: move static-libc++ into CMAKE_EXE_LINKER_FLAGS flags
2bd155e6ee test: move create_malleated_version() to messages.py for reuse
5c5704e730 Merge bitcoin/bitcoin#33791: kernel: Use enumeration type for flags argument
ed5720509f kernel: Use enumeration type for flags argument
50d106a4d6 Merge bitcoin/bitcoin#33781: clang-tidy: Remove no longer needed NOLINT
ffd7ca3c46 Merge bitcoin/bitcoin#33780: guix: disable libsanitizer in Linux GCC build
9577daa3b8 doc: Add cmake help option in Windows build instructions
fae1d99651 refactor: Use const reference to std::source_location
fa5fbcd615 util: Allow Assert() in contexts without __func__
24bcad3d4d refactor: remove dead code in `CountWitnessSigOps`
33389f1144 Merge bitcoin-core/gui#899: Modernize custom filtering
ec8516ceb7 test: remove obsolete `get_{key,multisig}` helpers from wallet_util.py
038849e2e0 clang-tidy: Remove no longer needed NOLINT
5c41fa2918 guix: disable libsanitizer in Linux GCC build
4da01123df Merge bitcoin/bitcoin#30595: kernel: Introduce C header API
96614fff63 Merge bitcoin/bitcoin#33714: random: scope environ extern to macOS, BSDs and Illumos
4e9bd579d3 Merge bitcoin/bitcoin#33045: depends: disable variables, rules and suffixes.
5ffa63d681 Merge bitcoin/bitcoin#33626: ci: run native fuzz with MSAN job
75baff98fc Merge bitcoin/bitcoin#33744: ci: Fix lint runner selection (and docker cache)
2593ed1b5f Merge bitcoin/bitcoin#33574: doc: update Guix INSTALL.md
1cd8d9fe5c Merge bitcoin/bitcoin#33445: ci: Update Clang in "tidy" job
56329beaee Merge bitcoin/bitcoin#32301: test: cover invalid codesep positions for signature in taproot
1e6e32fa8a ci: run native fuzz with MSAN job
3784d15bcd ci: use LLVM libcxx 21.1.5
6c7a34f3b0 kernel: Add Purpose section to header documentation
7e9f00bcc1 kernel: Allowing reducing exports
7990463b10 kernel: Add pure kernel bitcoin-chainstate
36ec9a3ea2 Kernel: Add functions for working with outpoints
5eec7fa96a kernel: Add block hash type and block tree utility functions to C header
f5d5d1213c kernel: Add function to read block undo data from disk to C header
09d0f62638 kernel: Add functions to read block from disk to C header
a263a4caf2 kernel: Add function for copying block data to C header
b30e15f432 kernel: Add functions for the block validation state to C header
aa262da7bc kernel: Add validation interface to C header
d27e27758d kernel: Add interrupt function to C header
1976b13be9 kernel: Add import blocks function to C header
a747ca1f51 kernel: Add chainstate load options for in-memory dbs in C header
070e77732c kernel: Add options for reindexing in C header
ad80abc73d kernel: Add block validation to C header
cb1590b05e kernel: Add chainstate loading when instantiating a ChainstateManager
e2c1bd3d71 kernel: Add chainstate manager option for setting worker threads
65571c36a2 kernel: Add chainstate manager object to C header
c62f657ba3 kernel: Add notifications context option to C header
9e1bac4585 kernel: Add chain params context option to C header
337ea860df kernel: Add kernel library context object
28d679bad9 kernel: Add logging to kernel library C header
2cf136dec4 kernel: Introduce initial kernel C header API
e15e8cbada qt: Modernize custom filtering
745eb053a4 Merge bitcoin-core/gui#901: Add createwallet, createwalletdescriptor, and migratewallet to history filter
52b1595850 depends: disable builtin variables
8b5a28fa78 depends: disable builtin rules and suffixes.
7632e0ba31 ci: fix configure docker action inputs
746d36cc80 Merge bitcoin/bitcoin#33754: ci: gha: Set debug_pull_request_number_str annotation
2d23820ee1 refactor: remove dead branches in `SingletonClusterImpl`
e346ecae83 Add eclipse, partitioning, and fingerprinting note to i2p.md
25c45bb0d0 Merge bitcoin/bitcoin#33567: node: change a tx-relay on/off flag to enum
422b468229 Merge bitcoin/bitcoin#33683: refactor/doc: Add blockman param to GetTransaction doc comment
da6f041e39 Merge bitcoin/bitcoin#31645: [IBD] coins: increase default UTXO flush batch size to 32 MiB
832a57673a Merge bitcoin/bitcoin#33749: test: ipc: resolve symlinks in `which capnp`
3cd4263bf6 Merge bitcoin/bitcoin#33753: test: Format strings in `test_runner`
78d4d36730 test: Format strings in `*.rs`
fa9d0f994b ci: gha: Set debug_pull_request_number_str annotation
6eaa00fe20 test: clarify submitBlock() mutates the template
862bd43283 mining: ensure witness commitment check in submitBlock
00d1b6ef4b doc: clarify UpdateUncommittedBlockStructures
305384a037 Merge bitcoin/bitcoin#33746: ci: Add missing python3-dev package for riscv64
8eda7210eb Merge bitcoin/bitcoin#33743: fuzz: refactor memcpy to std::ranges::copy to work around ubsan warn
19a6a3e75e Add eclipse, partitioning, and fingerprinting note in tor.md
51093d6ae1 test: resolve symlinks in which result for capnp
fa6c0bedd3 refactor: Return uint64_t from GetSerializeSize
fad0c8680e refactor: Use uint64_t over size_t for serialized-size values
fa4f388fc9 refactor: Use fixed size ints over (un)signed ints for serialized values
6f359695c3 Merge bitcoin/bitcoin#33698: test: Use same rpc timeout for authproxy and cli
c281bb6837 Merge bitcoin/bitcoin#32924: test: add valid tx test with minimum-sized ECDSA signature (8 bytes DER-encoded)
facf8b771a ci: Add missing python3-dev package for riscv64
b4d0288c46 doc: update Guix INSTALL.md
0b3b8a3be1 ci: fix lint docker caching
fa4b52bd16 fuzz: refactor memcpy to std::ranges::copy to work around ubsan warn
72511fd02e Merge bitcoin/bitcoin#33555: build: Bump clang minimum supported version to 17
060bb55508 rpc: add decoded tx details to gettransaction with extra wallet fields
ad1c3bdba5 [move only] move DecodeTxDoc() to a common util file for sharing
d633db5416 rpc: add "ischange: true" in wallet gettransaction decoded tx output
79d6f458e2 random: scope environ extern to macOS, BSDs and Illumos
292ea0eb89 Merge bitcoin/bitcoin#33677: ci: Retry image building once on failure
dd82c6c5d0 Merge bitcoin/bitcoin#33693: ci: use pycapnp 2.2.1
3bb30658e6 Merge bitcoin/bitcoin#32380: Modernize use of UTF-8 in Windows code
5a58d4915e Merge bitcoin/bitcoin#33546: test: add functional test for `TestShell` (matching doc example)
1abc8fa308 Merge bitcoin/bitcoin#33218: refactor: rename `fees.{h,cpp}` to `fees/block_policy_estimator.{h,cpp}`
de15e52f09 Merge bitcoin/bitcoin#32867: doc: mention key removal in rpc interface modification
5d784bebaf clang-tidy: Disable `ArrayBound` check in src/ipc and src/test
5efdb0ef30 ci: Update Clang in "tidy" job
fa01f38e53 move-only: Move CBlockFileInfo to kernel namespace
fa2bbc9e4c refactor: [rpc] Remove cast when reporting serialized size
fa364af89b test: Remove outdated comment
24434c1284 Merge bitcoin/bitcoin#31308: ci, iwyu: Treat warnings as errors for specific directories
27cd7f5049 Merge bitcoin/bitcoin#33185: guix: update time-machine to 5cb84f2013c5b1e48a7d0e617032266f1e6059e2
80bb7012be Merge bitcoin/bitcoin#31514: wallet: allow label for non-ranged external descriptor (if `internal=false`) & disallow label for ranged descriptors
5e1f626ac3 Merge bitcoin/bitcoin#32504: test: descriptor: cover invalid multi/multi_a cases
dcb56fd4cb interfaces: add interruptWait method
56e9703968 Merge bitcoin/bitcoin#29640: Fix tiebreak when loading blocks from disk (and add tests for comparing chain ties)
53b34c80c6 ci: use pycapnp 2.2.1 in mac native job
865432869c ci: remove Python version comment from mac config
9bd9ec00b2 Merge bitcoin/bitcoin#33688: test: Update BIP324 test vectors
1a7fb5eeee fees: return current block height in estimateSmartFee
ab49480d9b fees: rename fees_args to block_policy_estimator_args
06db08a435 fees: refactor: rename fees to block_policy_estimator
6dfdd7e034 fees: refactor: rename policy_fee_tests.cpp to feerounder_tests.cpp
f54ffb4bc1 Merge bitcoin/bitcoin#32813: clang-format: make formatting deterministic for different formatter versions
1916c51cd8 Merge bitcoin/bitcoin#33210: fuzz: enhance wallet_fees by mocking mempool stuff
0eb554728c Merge bitcoin/bitcoin#33336: log: print every script verification state change
c6c4edf324 Merge bitcoin/bitcoin#32983: rpc: refactor: use string_view in Arg/MaybeArg
00ad998d95 Merge bitcoin/bitcoin#33252: p2p: add `DifferenceFormatter` fuzz target and invariant check
1a1f46c228 refactor/doc: Add blockman param to `GetTransaction` doc comment and reorder out param
66667d6512 test: Use same rpc timeout for authproxy and cli
5555bce994 ci: Document why IN_GETOPT_BIN env var is needed on macOS
fabe516440 ci: Export the container id in python script
f6ba97cea1 Merge bitcoin/bitcoin#33666: ci: Drop libFuzzer from msan fuzz task
af78d36512 Merge bitcoin/bitcoin#32588: util: Abort on failing CHECK_NONFATAL in debug builds
51877f2fc5 test: Update BIP324 test vectors
161864a038 Merge bitcoin/bitcoin#32579: p2p: Correct unrealistic headerssync unit test behavior
70a6fb5e5a Merge bitcoin/bitcoin#33172: test: p2p block malleability
99cb2054bd Merge bitcoin/bitcoin#33600: refactor: Construct g_verify_flag_names on first use
211bf6c975 Merge bitcoin/bitcoin#33566: miner: fix empty mempool case for waitNext()
944e5ff848 doc: mention key removal in rpc interface modification
d32f9525e4 Merge bitcoin/bitcoin#33679: test: set number of RPC server threads to 2
1c85d06232 Merge bitcoin/bitcoin#32266: depends: Avoid `warning: "_FORTIFY_SOURCE" redefined` for `libevent`
11684c9ce2 Merge bitcoin/bitcoin#33674: ci: Doc ASLR workaround for sanitizer tasks
e9cd45e3d3 test: set number of RPC server threads to 2
fa6aa9f42f ci: Retry image building once on failure
fa4dbe04d7 ci: Allow overwriting check option in run() helper
fa8e4de5c3 ci: Use os.environ[key] access when value must be set
7d27af98c7 Merge bitcoin/bitcoin#33461: ci: add Valgrind fuzz
1569bcc387 Merge bitcoin/bitcoin#33639: ci: Only write docker build images to Cirrus cache
98c4994d0f Merge bitcoin/bitcoin#33570: randomenv: Fix MinGW dllimport warning for `environ`
c211d18322 Merge bitcoin/bitcoin#33670: test: Use unassigned p2p_port instead of hardcoded 60000 in p2p_i2p_ports.py
e4b04630bc ci: add Valgrind fuzz
3fee0754a2 Merge bitcoin/bitcoin#33550: Fix windows libc++ `fs::path` `fstream` compile errors
fa0e36156c ci: Doc ASLR workaround for sanitizer tasks
fa20275db3 test: Use unassigned p2p_port instead of hardcoded 60000 in p2p_i2p_ports.py
c862936d16 Merge bitcoin/bitcoin#33370: ci: use Mold linker for asan-lsan-ubsan-integer-no-depends-usdt workflow
fabe0e07de ci: Only write docker build images to Cirrus cache
fab64a5d6f ci: Move buildx command to python script
fa72a2bd5c ci: Remove unused MAYBE_CPUSET
fa70e23de7 ci: Drop libFuzzer from msan fuzz task
abe7cbfe1a Merge bitcoin/bitcoin#33470: build: Move CMAKE_SKIP_INSTALL_RPATH from CMake to Guix script
689ec28d1d Merge bitcoin/bitcoin#33633: test: [move-only] binary utils to utils.py
0eeae4d174 Merge bitcoin/bitcoin#33625: Update secp256k1 subtree to latest master
4b41f99d57 build: Move CMAKE_SKIP_INSTALL_RPATH from CMake to Guix script
d30f149360 Merge bitcoin/bitcoin#33630: doc: correct topology requirements in submitpackage helptext
3d22282564 [doc] correct topology requirements in submitpackage helptext
e744fd1249 Merge bitcoin/bitcoin#33641: Update leveldb subtree to latest master
4371740beb Merge bitcoin/bitcoin#33642: doc: archive release notes for v28.3
ceea24b921 doc: archive release notes for v28.3
54ffe3de5b Update leveldb subtree to latest master
f21162d819 Squashed 'src/leveldb/' changes from aba469ad6a..cad64b151d
e14451ac87 Merge bitcoin/bitcoin#33469: TxGraph: change m_excluded_clusters
f76e1ae389 Merge bitcoin/bitcoin#32313: coins: fix `cachedCoinsUsage` accounting in `CCoinsViewCache`
59c4898994 guix: remove python-pydantic-core input from LIEF
9f2a6927d3 guix: use Clang & LLVM 19 for macOS build
9570ddbec9 guix: update time-machine to 5cb84f2013c5b1e48a7d0e617032266f1e6059e2
7b5cc276aa guix: patch around riscv issue with newer (2.40+) binutils
91b5cbaabb ci: use Debian Trixie for macOS cross job
fa75ef4328 test: Move export_env_build_path to util.py
fa9f495308 test: Move get_binary_paths and Binaries to util.py
40e7d4cd0d Merge bitcoin/bitcoin#33549: ci: Add macOS cross task for arm64-apple-darwin
ea17618c11 Merge bitcoin/bitcoin#33480: ci: Turn CentOS config into Alpine musl config
b1f8a13702 Merge bitcoin/bitcoin#33624: test: P2SH sig ops are only counted with `SCRIPT_VERIFY_P2SH`
879c21045e Update secp256k1 subtree to latest master
3cbf7cb3e6 Squashed 'src/secp256k1/' changes from b9313c6e1a..d543c0d917
2f7a50f67c Merge bitcoin/bitcoin#33462: ci: add libcpp hardening flags to macOS fuzz job
07a926474b node: change a tx-relay on/off flag to enum
48aa0e98d0 Merge bitcoin/bitcoin#29675: wallet: Be able to receive and spend inputs involving MuSig2 aggregate keys
db4bde0b03 Merge bitcoin/bitcoin#33517: multiprocess: Fix high overhead from message logging
3a10d700bc test: P2SH sig ops are only counted with `SCRIPT_VERIFY_P2SH` flag
9314113b29 Merge bitcoin/bitcoin#33610: doc: archive release notes for v29.2
9b43428c96 TxGraph: change m_excluded_clusters
6e1adbbaa1 Merge bitcoin/bitcoin#33612: test: change log rate limit version gate
fdcf67de80 Merge bitcoin/bitcoin#33157: cluster mempool: control/optimize TxGraph memory usage
7b544341c0 test: change log rate limit version gate from 299900 to 290100
9610b0d1e2 randomenv: Fix MinGW dllimport warning for `environ`
6c4fe401e9 Merge bitcoin/bitcoin#33508: ci: fix buildx gha cache authentication on forks
8f7673257a miner: fix empty mempool case for waitNext()
c11a3dcc88 doc: archive release notes for v29.2
64a7c7cbb9 Merge bitcoin/bitcoin#33558: ci: Use native platform for win-cross task
93b56e95c0 Merge bitcoin/bitcoin#33601: doc: archive release notes for v30.0
c235aa468b Update minisketch subtree to latest upstream
4543a3bde2 Squashed 'src/minisketch/' changes from ea8f66b1ea..d1bd01e189
563747971b Merge bitcoin/bitcoin#33580: depends: Use $(package)_file_name when downloading from the fallback
24d861da78 coins: only adjust `cachedCoinsUsage` on `EmplaceCoinInternalDANGER` insert
d7c9d6c291 coins: fix `cachedCoinsUsage` accounting to prevent underflow
39cf8bb3d0 refactor: remove redundant usage tracking from `CoinsViewCacheCursor`
67cff8bec9 refactor: assert newly-created parent cache entry has zero memory usage
023cd5a546 txgraph: add SingletonClusterImpl (mem optimization)
e346250732 txgraph: give Clusters a range of intended tx counts (preparation)
e93b0f09cc txgraph: abstract out creation of empty Clusters (refactor)
6baf12621f txgraph: comment fixes (doc fix)
726b995739 txgraph: make Cluster an abstract class (refactor)
2602d89edd txgraph: avoid accessing other Cluster internals (refactor)
04c808ac4c txgraph: expose memory usage estimate function (feature)
7680bb8fd4 txgraph: keep track of Cluster memory usage (preparation)
4ba562e5f4 txgraph: keep data structures compact (mem optimization)
bb5cb222ae depgraph: add memory usage control (feature)
b1637a90de txgraph: avoid holes in DepGraph positions (mem optimization)
2b1d302508 txgraph: move some sanity checks from Cluster to TxGraphImpl (refactor)
d40302fbaf txgraph: Make level of Cluster implicit (optimization)
8d6e49158e doc: archive release notes for v30.0
4e352efa2c qt: add createwallet, createwalletdescriptor, and migratewallet to history filter
0626b90f50 multiprocess: align our logging with libmultiprocess's
9d068225ee multiprocess: update multiprocess EventLoop construction to use options
d2987102dd Merge bitcoin/bitcoin#33573: doc: bump the template macOS version
f6567527d8 doc: bump the template macOS version
faa9d10c84 refactor: Construct g_verify_flag_names on first use
becf150013 Merge bitcoin/bitcoin#33518: Update libmultiprocess subtree to support reduced logging
01cc20f330 test: improve coverage for a resolved stalling situation
9af6daf07e test: remove magic number when checking for blocks that have arrived
3069d66dca p2p: During block download, adjust pindexLastCommonBlock better
cd1b7fa1ff Merge bitcoin/bitcoin#33577: Revert "depends: Update URL for `qrencode` package source tarball"
fa0fa0f700 refactor: Revert "disable self-assign warning for tests"
faed118fb3 build: Bump clang minimum supported version to 17
6b4a92b0fa Merge bitcoin/bitcoin#33568: doc: how to update a subtree
90b2884ce4 Merge bitcoin/bitcoin#33581: ci: Properly include $FILE_ENV in DEPENDS_HASH
d44b860cd0 Merge bitcoin/bitcoin#33584: ci: upgrade GitHub Action to download-artifact@v5
57f7c68821 test: add functional test for `TestShell` (matching doc example)
53874f7934 doc: test: update TestShell example instructions/options
b35341b9ba Update ci.yml
ceeb53adcd ci: Properly include $FILE_ENV in DEPENDS_HASH
671b774d1b depends: Use $(package)_file_name when downloading from the fallback
e4335a3192 Revert "depends: Update URL for `qrencode` package source tarball"
a89a822e6e Revert "depends: Use hash instead of file name for package download stamp"
fad5a7101c ci: Add macOS cross task for arm64
fa8c750a0a ci: Refactor get_previous_releases step in win-test-cross task
e4c04f7759 ci: add libcpp hardening flags to macOS fuzz job
a1226bc760 doc: how to update a subtree
eda91b07fd Merge commit '0f01e1577f7c6734eb345139a12aba329ef22a5f' into pr/subtree-6
0f01e1577f Squashed 'src/ipc/libmultiprocess/' changes from 47d79db8a552..a4f929696490
fa6fd16f36 ci: Use native platform for win-cross task
53e4951a5b Switch to ANSI Windows API in `fsbridge::fopen()` function
dbe770d921 Switch to ANSI Windows API in `Win32ErrorString()` function
06d0be4e22 Remove no longer necessary `WinCmdLineArgs` class
f366408492 cmake: Set process code page to UTF-8 on Windows
dccbb17806 Set minimum supported Windows version to 1903 (May 2019 Update)
c864a4c194 Simplify fs::path by dropping filename() and make_preferred() overloads
b0113afd44 Fix windows libc++ fs::path fstream compile errors
b63428ac9c rpc: refactor: use more (Maybe)Arg<std::string_view>
037830ca0d refactor: increase string_view usage
b3bf18f0ba rpc: refactor: use string_view in Arg/MaybeArg
45bd891465 log: split assumevalid ancestry-failure-reason message
6c13a38ab5 log: separate script verification reasons
f2ea6f04e7 refactor: untangle assumevalid decision branches
9bc298556c validation: log initial script verification state
4fad4e992c test: add assumevalid scenarios scaffold
c25a5e670b init: Signal m_tip_block_cv on Ctrl-C
6a29f79006 test: Test SIGTERM handling during waitforblockheight call
ac599c4a9c test: Test MuSig2 in the wallet
68ef954c4c wallet: Keep secnonces in DescriptorScriptPubKeyMan
4a273edda0 sign: Create MuSig2 signatures for known MuSig2 aggregate keys
258db93889 sign: Add CreateMuSig2AggregateSig
bf69442b3f sign: Add CreateMuSig2PartialSig
512b17fc56 sign: Add CreateMuSig2Nonce
82ea67c607 musig: Add MuSig2AggregatePubkeys variant that validates the aggregate
d99a081679 psbt: MuSig2 data in Fill/FromSignatureData
4d8b4f5336 signingprovider: Add musig2 secnonces
c06a1dc86f Add MuSig2SecNonce class for secure allocation of musig nonces
9baff05e49 sign: Include taproot output key's KeyOriginInfo in sigdata
4b24bfeab9 pubkey: Return tweaks from BIP32 derivation
bc706955d7 ci: expose all ACTIONS_* vars
444409ff2b ci: Reduce Alpine musl task to md runner size
fa6b2e9efe ci: Turn centos config into alpine musl config
1fc7a81f1f log: reduce excessive messages during block replay
79b4c276e7 Bugfix: QA: rpc_bind: Skip nonloopback test if no such address is found
91ac64b0a6 log: reword `signature validations` to `script verification` in `assumevalid` log
f14876213a musig: Move synthetic xpub construction to its own function
f031536f2d ci: use Mold linker for asan-lsan-ubsan-integer-no-depends-usdt workflow
cc5dda1de3 headerssync: Make HeadersSyncState more flexible and move constants
8fd1c2893e test(headerssync): Test returning of pow_validated_headers behavior
7b00643ef5 test(headerssync): headers_sync_chainwork test improvements
04eeb9578c doc(test): Improve comments
fe896f8faa refactor(test): Store HeadersSyncState on the stack
f03686892a refactor(test): Break up headers_sync_state
e984618d0b refactor(headerssync): Process spans of headers
a4ac9915a9 refactor(headerssync): Extract test constants ahead of breakup into functions
02d2b5a11c ci, iwyu: Treat warnings as errors for specific directories
57a3eac387 refactor: Fix includes in `index` directory
bdb8eadcdc refactor: Fix includes in `crypto` directory
56f2a689a2 ci: Do not patch `leveldb` to workaround UB in "tidy" CI job
65a10fc3c5 p2p: add assertion for BlockTransactionsRequest indexes
58be359f6b fuzz: add a target for DifferenceFormatter Class
13f36c020f clang-format: regenerate configs
5ded99a7f0 fuzz: MockMempoolMinFee in wallet_fees
c9a7a198d9 test: move MockMempoolMinFee to util/txmempool
adf67eb21b fuzz: create FeeEstimatorTestingSetup to set fee_estimator
ff10a37e99 fuzz: mock CBlockPolicyEstimator in wallet_fuzz
f591c3beca fees: make estimateSmartFee/HighestTargetTracked virtual for mocking
b6f8c48946 coins: increase default `dbbatchsize` to 32 MiB
8bbb7b8bf8 refactor: Extract default batch size into kernel
d0e1bbad01 test: repeat block malleability test with relayable block over P2P
19273d0705 fuzz: set mempool options in wallet_fees
81e5c8385b test: cover invalid codesep positions for signature in taproot
743abbcbde refactor: inline constant return value of `BlockTreeDB::WriteBatchSync` and `BlockManager::WriteBlockIndexDB` and `BlockTreeDB::WriteFlag`
e030240e90 refactor: inline constant return value of `CDBWrapper::Erase` and `BlockTreeDB::WriteReindexing`
cdab9480e9 refactor: inline constant return value of `CDBWrapper::Write`
d1847cf5b5 refactor: inline constant return value of `TxIndex::DB::WriteTxs`
50b63a5698 refactor: inline constant return value of `CDBWrapper::WriteBatch`
fb8720f1e0 sign: Refactor Schnorr sighash computation out of CreateSchnorrSig
a4cfddda64 tests: Clarify why musig derivation adds a pubkey and xpub
39a63bf2e7 descriptors: Add a doxygen comment for has_hardened output_parameter
2320184d0e descriptors: Fix meaning of any_key_parsed
0465574c12 test: Fixes send_blocks_and_test docs
09c95f21e7 test: Adds block tiebreak over restarts tests
18524b072e Make nSequenceId init value constants
8b91883a23 Set the same best tip on restart if two candidates have the same work
5370bed21e test: add functional test for complex reorgs
ab145cb3b4 Updates CBlockIndexWorkComparator outdated comment
fa37153288 util: Abort on failing CHECK_NONFATAL in debug builds
fa0dc4bdff test: Allow testing of check failures
faeb58fe66 refactor: Set G_ABORT_ON_FAILED_ASSUME when G_FUZZING_BUILD
8810642b57 test: add option to skip large re-org test in feature_block
5fa81e239a test: add valid tx test with minimum-sized ECDSA signature (8 bytes DER-encoded)
58e55b17e6 test: descriptor: cover invalid multi/multi_a cases
664657ed13 bugfix: disallow label for ranged descriptors & allow external non-ranged descriptors to have label
fe71a4b139 depends: Avoid `warning: "_FORTIFY_SOURCE" redefined` for `libevent`
REVERT: 81cec737e6 kernel: Fix bitcoin-chainstate for windows
REVERT: 1826c485dd kernel: Add Purpose section to header documentation
REVERT: d7e618aa98 kernel: Allowing reducing exports
REVERT: fb7f524133 kernel: Add pure kernel bitcoin-chainstate
REVERT: dd0bdf279e Kernel: Add functions for working with outpoints
REVERT: eaa6abfc73 kernel: Add block hash type and block tree utility functions to C header
REVERT: 824ddf2885 kernel: Add function to read block undo data from disk to C header
REVERT: 76cab0768b kernel: Add functions to read block from disk to C header
REVERT: e41f6f459a kernel: Add function for copying block data to C header
REVERT: 39c647647a kernel: Add functions for the block validation state to C header
REVERT: 8a19a9d607 kernel: Add validation interface to C header
REVERT: 38a990dd48 kernel: Add interrupt function to C header
REVERT: fee8f6ff38 kernel: Add import blocks function to C header
REVERT: c29a6b87cc kernel: Add chainstate load options for in-memory dbs in C header
REVERT: e788b3ba06 kernel: Add options for reindexing in C header
REVERT: 2707fc515c kernel: Add block validation to C header
REVERT: 51a24c4004 kernel: Add chainstate loading when instantiating a ChainstateManager
REVERT: ea01a8caf3 kernel: Add chainstate manager option for setting worker threads
REVERT: add5904e0a kernel: Add chainstate manager object to C header
REVERT: 37a3395d27 kernel: Add notifications context option to C header
REVERT: d838a934be kernel: Add chain params context option to C header
REVERT: dc58ae9fc0 kernel: Add kernel library context object
REVERT: 7744997596 kernel: Add logging to kernel library C header
REVERT: dc504f57b3 kernel: Introduce initial kernel C header API

git-subtree-dir: bitcoinkernel/bitcoin
git-subtree-split: c66e988754391a094af93ef2a9127200d093b669
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Nov 24, 2025
Summary:
The constant for the default batch size is moved to `kernel/caches.h` to consolidate kernel-related cache constants.

The default database write batch size is increased from 16 MiB to 32 MiB to improve I/O efficiency and performance during UTXO flushes, particularly during Initial Block Download and `assumeutxo` loads.

On systems with slower I/O, a larger batch size reduces overhead from numerous small writes. Measurements show this change provides a modest performance improvement on most hardware during a critical section, with a minimal peak memory increase (approx. 75 MiB on default settings).
This is a backport of [[bitcoin/bitcoin#31645 | core#31645]]

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D18987
@l0rinc l0rinc mentioned this pull request Jan 14, 2026
23 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.