Page MenuHomePhabricator

[Chronik] Add `TxNumCache` to speed up `prepare_indexed_txs`
ClosedPublic

Authored by tobias_ruck on Mar 4 2024, 12:48.

Details

Summary

Currently, prepare_indexed_txs is still one of the slowest parts of the indexer due to the disk access, even when using batched queries.

We add TxNumCache, which internally works like a "conveyor belt" of buckets that are filled with TxId -> TxNum.

Each block puts all their TxId -> TxNum tuples into the bucket at the front of the belt, one-by-one. If this bucket is full, the bucket at the end of the belt is "dropped off", emptied and moved to the front, moving all other buckets one step back. Then the new empty bucket will be filled, until it is full, etc.

The required memory will be 40B per TxId (32-byte txid + 8-byte TxNum, +small HashMap overhead), so a 100000 tx bucket will require 4MB; meaning 10 buckets require 40MB, which is the default. Users can configure the number of buckets (-chroniktxnumcachebuckets) and bucket size (-chroniktxnumcachebucketsize) to tune Chronik to their machine; the default of 40MB strikes a good balance of RAM usage and performance.

Benchmarks for the first 300000ish blocks show a significant speedup of 5.24x when using a bucket size of 100k (40MB RAM), and a speedup of 2.26x (4MB RAM) when using a bucket size of 10k. Based on this, a bucket size of 100k was chosen. One benchmark with 100 buckets and bucket size 100k (400MB RAM) showed a speedup of 7.4x, but RAM usage is excessive.

Using 5 buckets and a bucket size of 200k is slower than 10 buckets a 100k. Using 10 buckets a 200k barely speeds up indexing but uses 2x the RAM.

I also benchmarked using the faster seahash hashing algorithm for HashMap, but it made no big difference, so for now it is left at the slower but cryptographically secure default hash. This indicates that we're not compute but memory bound, which is to be expected. In the future, we might want to use a faster hashing algorithm.

bench300k total time [s]300k time prepare [s]
noprepare1066.850
old, before D155714375.393308.54
base3148.512081.66
d10-b10k1988.43921.58
d10-b25k1672.90606.05
d10-b100k1464.02397.17
d10-b200k1432.11365.26
d100-b10k1664.05597.20
d100-b100k1348.24281.39
d10-b10k-sea1907.64840.79
d10-b100k-sea1488.08421.23
d5-b200k1648.01581.16

For reference, a previous version of this used a simpler approach, where the cache simply stores the last depth_blocks worth of tx nums in a VecDeque of HashMaps, like a queue of blocks. The oldest block of txids was dropped off at the end, and the new block is added at the beginning. Benchmarks however showed this is slower than using the conveyor belt cache. Benchmarks are kept in this diff for future reference.

bench300k total time [s]300k time prepare [s]400k total time [s]400k time prepare [s]
no prepare1066.8503476.100
old, before D155714375.393308.54
D155713148.512081.6611453.997977.89
block queue, depth = 102749.211682.368595.975119.87
block queue, depth = 1002297.971231.127214.193738.08
block queue, depth = 10002969.341902.4910865.727389.62
Test Plan

ninja check-functional

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tobias_ruck edited the summary of this revision. (Show Details)
tobias_ruck edited the summary of this revision. (Show Details)
tobias_ruck edited the summary of this revision. (Show Details)
tobias_ruck edited the summary of this revision. (Show Details)

add prepare_indexed_txs_cached, set default cache depth to 100 blocks

The build failed due to an unexpected infrastructure outage. The administrators have been notified to investigate. Sorry for the inconvenience.
tobias_ruck edited the summary of this revision. (Show Details)

use a belt mechanism instead of blocks

Tail of the build log:

[372/556] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[373/556] Building CXX object src/CMakeFiles/bitcoin-cli.dir/bitcoin-cli.cpp.o
[374/556] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[375/556] Building C object src/secp256k1/CMakeFiles/sign-bench.dir/src/bench_sign.c.o
[376/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[377/556] Linking C static library src/secp256k1/libsecp256k1.a
[378/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockindex.cpp.o
[379/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[380/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[381/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[382/556] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
[383/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[384/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[385/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[386/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[387/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[388/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[389/556] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[390/556] Linking C executable src/secp256k1/sign-bench
[391/556] Linking C executable src/secp256k1/recover-bench
[392/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[393/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[394/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[395/556] Linking C executable src/secp256k1/ecmult-bench
[396/556] Linking C executable src/secp256k1/internal-bench
[397/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[398/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[399/556] Linking C executable src/secp256k1/verify-bench
[400/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[401/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[402/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[403/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[404/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[405/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[406/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[407/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[408/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[409/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[410/556] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[411/556] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[412/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[413/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[414/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[415/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[416/556] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[417/556] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[418/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[419/556] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[420/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[421/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[422/556] Linking CXX static library src/libcommon.a
[423/556] Linking CXX static library src/libscript.a
[424/556] Linking CXX static library src/libbitcoinconsensus.a
[425/556] Linking CXX shared library src/libbitcoinconsensus.so.0.28.10
[426/556] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[427/556] Linking CXX executable src/bitcoin-cli
[428/556] Linking CXX executable src/bitcoin-tx
[429/556] Building CXX object src/CMakeFiles/server.dir/init.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build build-chronik-plugins failed with exit code 1

Tail of the build log:

[372/556] Linking CXX static library src/libcommon.a
[373/556] Linking C executable src/secp256k1/sign-bench
[374/556] Linking C executable src/secp256k1/verify-bench
[375/556] Linking CXX static library src/libscript.a
[376/556] Building C object src/secp256k1/CMakeFiles/ecmult-bench.dir/src/bench_ecmult.c.o
[377/556] Linking CXX static library src/libbitcoinconsensus.a
[378/556] Linking C executable src/secp256k1/ecmult-bench
[379/556] Linking CXX shared library src/libbitcoinconsensus.so.0.28.10
[380/556] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[381/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockindex.cpp.o
[382/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[383/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[384/556] Building CXX object src/CMakeFiles/server.dir/txmempool.cpp.o
[385/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[386/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[387/556] Building CXX object src/CMakeFiles/bitcoin-cli.dir/bitcoin-cli.cpp.o
[388/556] Linking CXX executable src/bitcoin-cli
[389/556] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[390/556] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[391/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[392/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[393/556] Linking CXX executable src/bitcoin-tx
[394/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[395/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[396/556] Building CXX object src/CMakeFiles/server.dir/rpc/rawtransaction.cpp.o
[397/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[398/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[399/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[400/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[401/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[402/556] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
[403/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[404/556] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[405/556] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[406/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[407/556] Building CXX object src/CMakeFiles/server.dir/rpc/blockchain.cpp.o
[408/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[409/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[410/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[411/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[412/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[413/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[414/556] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[415/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[416/556] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
[417/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[418/556] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[419/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[420/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[421/556] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[422/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[423/556] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[424/556] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[425/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[426/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[427/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[428/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[429/556] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build build-chronik failed with exit code 1

Tail of the build log:

[372/555] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockindex.cpp.o
[373/555] Building C object src/secp256k1/CMakeFiles/verify-bench.dir/src/bench_verify.c.o
[374/555] Linking C executable src/secp256k1/recover-bench
[375/555] Linking C executable src/secp256k1/verify-bench
[376/555] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[377/555] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[378/555] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[379/555] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[380/555] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[381/555] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[382/555] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[383/555] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[384/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[385/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[386/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[387/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[388/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[389/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[390/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[391/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[392/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[393/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[394/555] Linking CXX static library src/libcommon.a
[395/555] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[396/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[397/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[398/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[399/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[400/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[401/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[402/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[403/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[404/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[405/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[406/555] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[407/555] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[408/555] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[409/555] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[410/555] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[411/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[412/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[413/555] Building CXX object src/CMakeFiles/server.dir/policy/block/minerfund.cpp.o
[414/555] Building CXX object src/CMakeFiles/script.dir/script/sign.cpp.o
[415/555] Building CXX object src/CMakeFiles/script.dir/script/signingprovider.cpp.o
[416/555] Building CXX object src/CMakeFiles/server.dir/avalanche/compactproofs.cpp.o
[417/555] Linking CXX static library src/libscript.a
[418/555] Linking CXX static library src/libbitcoinconsensus.a
[419/555] Linking CXX shared library src/libbitcoinconsensus.so.0.28.10
[420/555] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[421/555] Linking CXX executable src/bitcoin-cli
[422/555] Linking CXX executable src/bitcoin-tx
[423/555] Building CXX object src/CMakeFiles/server.dir/txorphanage.cpp.o
[424/555] Building CXX object src/CMakeFiles/server.dir/node/miner.cpp.o
[425/555] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[426/555] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[427/555] Building CXX object src/CMakeFiles/server.dir/node/ui_interface.cpp.o
[428/555] Building CXX object src/CMakeFiles/server.dir/net.cpp.o
[429/555] Building CXX object src/CMakeFiles/server.dir/init.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build chronik-client-integration-tests failed with exit code 1
tobias_ruck edited the summary of this revision. (Show Details)
tobias_ruck edited the summary of this revision. (Show Details)

fix build, improve comments

The build failed due to an unexpected infrastructure outage. The administrators have been notified to investigate. Sorry for the inconvenience.

fix comments, rerun CI, rebase master

tobias_ruck edited the summary of this revision. (Show Details)
tobias_ruck edited the summary of this revision. (Show Details)
Fabien requested changes to this revision.Mar 6 2024, 12:53
Fabien added inline comments.
chronik/chronik-cpp/chronik.h
30 ↗(On Diff #45961)

You should add this to the default test framework config instead (since it is configurable) so it doesn't leak in the code.
See write_config in util.py

chronik/chronik-db/src/index_tx.rs
49 ↗(On Diff #45961)

It's probably an extra optimization since the goal is to speed up syncing. You could just clear the buckets instead.

75 ↗(On Diff #45961)

words are in the wrong order ?

199 ↗(On Diff #45961)

What about allocating once at construction time instead ? So you always have 10 empty buckets upon startup

This revision now requires changes to proceed.Mar 6 2024, 12:53

address feedback ie preallocate memory and don't have a different default for regtest

chronik/chronik-db/src/index_tx.rs
75 ↗(On Diff #45961)

They aren't but I admit it's a bit confusing, updated

Tail of the build log:

test io::token::tests::test_batch_common::test_batch_cycle ... ok
test io::token::tests::test_batch_common::test_batch_skip_validation ... ok
test io::token::tests::test_batch_burn::test_batch_burn ... ok
test io::token::tests::test_batch_alp::test_batch_alp ... ok
test io::token::tests::test_batch_common::test_batch_topological_sort ... ok
test io::token::tests::test_batch_disconnect_block::test_batch_disconnect ... ok
test io::token::tests::test_batch_genesis::test_batch_genesis_alp ... ok
test io::block_stats::tests::test_block_stats ... ok
test mem::group_history::tests::test_mempool_group_history ... ok
test mem::group_utxos::tests::test_mempool_group_utxos ... ok
test mem::spent_by::tests::test_mempool_spent_by ... ok
test io::token::tests::test_batch_genesis::test_batch_genesis_slp_fungible ... ok
test io::token::tests::test_batch_nft::test_batch_slp_nft1 ... ok
test io::token::tests::test_batch_unknown::test_batch_unknown ... ok
test ser::tests::test_deserialize_err ... ok
test ser::tests::test_deserialize_leftover_err ... ok
test ser::tests::test_err_display_deserialize ... ok
test ser::tests::test_err_display_deserialize_leftover ... ok
test ser::tests::test_err_display_serialize ... ok
test ser::tests::test_roundtrip ... ok
test ser::tests::test_roundtrip_vec ... ok
test ser::tests::test_serialize_err ... ok
test io::blocks::tests::test_blocks ... ok
test io::token::tests::test_batch_vault::test_batch_vault ... ok
test mem::tokens::tests::test_mempool_tokens ... ok
test io::group_utxos::tests::test_value_group_utxos ... ok
test reverse_lookup::tests::test_reverse_lookup ... ok
test index_tx::tests::test_prepare_indexed_txs ... ok
test reverse_lookup::tests::test_reverse_lookup_rng ... ok
test io::group_history::tests::test_value_group_history ... ok
test io::txs::tests::test_insert_txs ... ok
Error details: Test init merge error

MERGE ERROR: Test init merge error

test io::merge::tests::test_catch_merge ... ok
test io::spent_by::tests::test_spent_by ... ok

failures:

---- index_tx::tests::test_tx_num_cache stdout ----
thread 'index_tx::tests::test_tx_num_cache' panicked at chronik/chronik-db/src/index_tx.rs:341:9:
assertion failed: `(left == right)`

Diff < left / right > :
<2
>0


note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    index_tx::tests::test_tx_num_cache

test result: FAILED. 34 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 11.49s

error: test failed, to rerun pass `-p chronik-db --lib`
ninja: build stopped: cannot make progress due to previous errors.
Build build-chronik-plugins failed with exit code 1

Tail of the build log:

test io::token::tests::test_batch_common::test_batch_cycle ... ok
test io::token::tests::test_batch_common::test_batch_skip_validation ... ok
test io::token::tests::test_batch_common::test_batch_topological_sort ... ok
test io::token::tests::test_batch_burn::test_batch_burn ... ok
test io::token::tests::test_batch_alp::test_batch_alp ... ok
test io::token::tests::test_batch_disconnect_block::test_batch_disconnect ... ok
test io::token::tests::test_batch_genesis::test_batch_genesis_alp ... ok
test io::token::tests::test_batch_genesis::test_batch_genesis_slp_fungible ... ok
test mem::group_history::tests::test_mempool_group_history ... ok
test mem::group_utxos::tests::test_mempool_group_utxos ... ok
test mem::spent_by::tests::test_mempool_spent_by ... ok
test io::token::tests::test_batch_nft::test_batch_slp_nft1 ... ok
test io::token::tests::test_batch_unknown::test_batch_unknown ... ok
test io::blocks::tests::test_blocks ... ok
test ser::tests::test_deserialize_err ... ok
test ser::tests::test_deserialize_leftover_err ... ok
test ser::tests::test_err_display_deserialize ... ok
test ser::tests::test_err_display_deserialize_leftover ... ok
test ser::tests::test_err_display_serialize ... ok
test ser::tests::test_roundtrip ... ok
test ser::tests::test_roundtrip_vec ... ok
test ser::tests::test_serialize_err ... ok
test io::block_stats::tests::test_block_stats ... ok
test io::group_utxos::tests::test_value_group_utxos ... ok
test io::token::tests::test_batch_vault::test_batch_vault ... ok
test mem::tokens::tests::test_mempool_tokens ... ok
test reverse_lookup::tests::test_reverse_lookup ... ok
test index_tx::tests::test_prepare_indexed_txs ... ok
test reverse_lookup::tests::test_reverse_lookup_rng ... ok
test io::group_history::tests::test_value_group_history ... ok
test io::txs::tests::test_insert_txs ... ok
Error details: Test init merge error

MERGE ERROR: Test init merge error

test io::merge::tests::test_catch_merge ... ok
test io::spent_by::tests::test_spent_by ... ok

failures:

---- index_tx::tests::test_tx_num_cache stdout ----
thread 'index_tx::tests::test_tx_num_cache' panicked at chronik/chronik-db/src/index_tx.rs:341:9:
assertion failed: `(left == right)`

Diff < left / right > :
<2
>0


note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    index_tx::tests::test_tx_num_cache

test result: FAILED. 34 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 11.69s

error: test failed, to rerun pass `-p chronik-db --lib`
ninja: build stopped: cannot make progress due to previous errors.
Build build-chronik failed with exit code 1
This revision is now accepted and ready to land.Mar 6 2024, 14:51