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%

@github-actions
Copy link

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

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