Skip to content

Conversation

@sedited
Copy link
Collaborator

@sedited sedited commented Apr 16, 2025

A refactor that moves the responsibility of managing coins from ConnectBlock to ConnectTip. Coins are now pre-fetched into the CBlockUndo in ConnectTip and then used in ConnectBlock. Down the road, this allows block validation without having a coins view present, which might be useful for non-assumevalid swiftsync, UTreeXO, and a sans-IO kernel library API.

@l0rinc
Copy link
Collaborator

l0rinc commented Apr 16, 2025

@willcl-ark, is it still necessary to rebase on top of here 0c50e4c5846417224c96965fda3f7a9264721707?

@github-actions
Copy link

📊 Benchmark results for this run (14490747253) will be available at: https://bitcoin-dev-tools.github.io/benchcoin/results/pr-162/14490747253/index.html after the github pages "build and deployment" action has completed.
🚀 Speedups: mainnet-default-uninstrumented: 1.4%, mainnet-large-uninstrumented: 1.8%

@github-actions
Copy link

📊 Benchmark results for this run (14499155218) will be available at: https://bitcoin-dev-tools.github.io/benchcoin/results/pr-162/14499155218/index.html after the github pages "build and deployment" action has completed.
🚀 Speedups: mainnet-default-uninstrumented: -0.1%, mainnet-large-uninstrumented: -0.1%

@l0rinc
Copy link
Collaborator

l0rinc commented Apr 17, 2025

quickly ran a reindex-chainstate IBD (single run, so may not be that stable), but it does indicate some measurable speedup - I'll bench it properly once it's pushed to where you pushed originally :p

COMMITS="817edfb21e4fa96289d69d4e1dbabb6b9ef9d8f5 168fa6702676e9c4a46f61d86807b63d69567e85"; \
STOP_HEIGHT=888888; DBCACHE=45000; \
CC=gcc; CXX=g++; \
BASE_DIR="/mnt/my_storage"; DATA_DIR="$BASE_DIR/BitcoinData"; LOG_DIR="$BASE_DIR/logs"; \
(for c in $COMMITS; do git fetch origin $c -q && git log -1 --pretty=format:'%h %s' $c || exit 1; done) && \
hyperfine \
  --sort 'command' \
  --runs 1 \
  --export-json "$BASE_DIR/rdx-${COMMITS// /-}-$STOP_HEIGHT-$DBCACHE-$CC.json" \
  --parameter-list COMMIT ${COMMITS// /,} \
  --prepare "killall bitcoind; rm -f $DATA_DIR/debug.log; git checkout {COMMIT}; git clean -fxd; git reset --hard; \
    cmake -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_WALLET=OFF && cmake --build build -j$(nproc) --target bitcoind && \
    ./build/bin/bitcoind -datadir=$DATA_DIR -stopatheight=$STOP_HEIGHT -dbcache=5000 -printtoconsole=0; sleep 100" \
  --cleanup "cp $DATA_DIR/debug.log $LOG_DIR/debug-{COMMIT}-$(date +%s).log" \
  "COMPILER=$CC ./build/bin/bitcoind -datadir=$DATA_DIR -stopatheight=$STOP_HEIGHT -dbcache=$DBCACHE -blocksonly -reindex-chainstate -connect=0 -printtoconsole=0"

817edfb Merge bitcoin#32245: doc: Updates how to reproduce fuzz CI failure locally
168fa67 Use undo data in ConnectBlock

Benchmark 1: COMPILER=gcc ./build/bin/bitcoind -datadir=/mnt/my_storage/BitcoinData -stopatheight=888888 -dbcache=45000 -blocksonly -reindex-chainstate -connect=0 -printtoconsole=0 (COMMIT = 817edfb21e4fa96289d69d4e1dbabb6b9ef9d8f5)
  Time (abs ≡):        16777.027 s               [User: 20534.671 s, System: 677.014 s]
 
Benchmark 2: COMPILER=gcc ./build/bin/bitcoind -datadir=/mnt/my_storage/BitcoinData -stopatheight=888888 -dbcache=45000 -blocksonly -reindex-chainstate -connect=0 -printtoconsole=0 (COMMIT = 168fa6702676e9c4a46f61d86807b63d69567e85)
  Time (abs ≡):        16406.915 s               [User: 20119.624 s, System: 657.841 s]
Relative speed comparison
        1.02          COMPILER=gcc ./build/bin/bitcoind -datadir=/mnt/my_storage/BitcoinData -stopatheight=888888 -dbcache=45000 -blocksonly -reindex-chainstate -connect=0 -printtoconsole=0 (COMMIT = 817edfb21e4fa96289d69d4e1dbabb6b9ef9d8f5)
        1.00          COMPILER=gcc ./build/bin/bitcoind -datadir=/mnt/my_storage/BitcoinData -stopatheight=888888 -dbcache=45000 -blocksonly -reindex-chainstate -connect=0 -printtoconsole=0 (COMMIT = 168fa6702676e9c4a46f61d86807b63d69567e85)

i.e. 2.2% faster reindex-chainstate.

@github-actions
Copy link

📊 Benchmark results for this run (14548030742) will be available at: https://bitcoin-dev-tools.github.io/benchcoin/results/pr-162/14548030742/index.html after the github pages "build and deployment" action has completed.
🚀 Speedups: mainnet-default-uninstrumented: -1.1%, mainnet-large-uninstrumented: 0.1%

@willcl-ark willcl-ark force-pushed the master branch 5 times, most recently from 5a6cd85 to d9d7b46 Compare December 10, 2025 09:45
@willcl-ark willcl-ark force-pushed the master branch 3 times, most recently from 44241cc to da1434a Compare December 30, 2025 05:30
@willcl-ark willcl-ark force-pushed the master branch 6 times, most recently from 623391b to 201f2eb Compare January 6, 2026 05:32
@willcl-ark willcl-ark force-pushed the master branch 11 times, most recently from 9252506 to aa46724 Compare January 13, 2026 02:53
@willcl-ark willcl-ark force-pushed the master branch 5 times, most recently from 5f20e15 to 133f0db Compare January 17, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants