Page MenuHomePhabricator

[Chronik] Resync index
ClosedPublic

Authored by tobias_ruck on Mar 10 2023, 21:16.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCd5f89bf049ac: [Chronik] Resync index
Summary

Revert the index until the fork block relative to the node and then add blocks from the node until synced

Depends on D13294 and D13293.

Test Plan

./test/functional/test_runner.py chronik_resync

Diff Detail

Event Timeline

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

Rebase on the previous diffs

Tail of the build log:

wallet_listsinceblock.py                  | ✓ Passed  | 6 s
wallet_listsinceblock.py --descriptors    | ✓ Passed  | 6 s
wallet_listtransactions.py                | ✓ Passed  | 4 s
wallet_listtransactions.py --descriptors  | ✓ Passed  | 4 s
wallet_multiwallet.py                     | ✓ Passed  | 55 s
wallet_multiwallet.py --usecli            | ✓ Passed  | 10 s
wallet_reorgsrestore.py                   | ✓ Passed  | 3 s
wallet_resendwallettransactions.py        | ✓ Passed  | 2 s
wallet_send.py                            | ✓ Passed  | 7 s
wallet_startup.py                         | ✓ Passed  | 2 s
wallet_timelock.py                        | ✓ Passed  | 1 s
wallet_txn_clone.py                       | ✓ Passed  | 1 s
wallet_txn_clone.py --mineblock           | ✓ Passed  | 3 s
wallet_txn_doublespend.py                 | ✓ Passed  | 1 s
wallet_txn_doublespend.py --mineblock     | ✓ Passed  | 3 s
wallet_watchonly.py                       | ✓ Passed  | 1 s
wallet_watchonly.py --usecli              | ✓ Passed  | 1 s
interface_usdt_net.py                     | ○ Skipped | 0 s
interface_usdt_utxocache.py               | ○ Skipped | 0 s
interface_usdt_validation.py              | ○ Skipped | 0 s

ALL                                       | ✓ Passed  | 1387 s (accumulated) 
Runtime: 278 s

[135/483] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/script_tests.cpp.o
In file included from /usr/include/boost/test/unit_test.hpp:19,
                 from ../../src/test/script_tests.cpp:30:
../../src/test/script_tests.cpp: In member function ‘void script_tests::script_build::test_method()’:
../../src/test/script_tests.cpp:540:22: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
  540 | BOOST_AUTO_TEST_CASE(script_build) {
      |                      ^~~~~~~~~~~~
[203/483] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/__/chronik/test/chronikbridge_tests.cpp.o
FAILED: src/test/CMakeFiles/test_bitcoin.dir/__/__/chronik/test/chronikbridge_tests.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DBOOST_AC_USE_STD_ATOMIC -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_SP_USE_STD_ATOMIC -DBOOST_TEST_DYN_LINK -DBOOST_THREAD_DYN_LINK -DBOOST_UNIT_TEST_FRAMEWORK_DYN_LINK -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I../../src/univalue/include -I../../src/. -Isrc -Isrc/crypto/.. -I../../src/secp256k1/include -I../../src/leveldb/include -I../../chronik -Icargo/build/x86_64-unknown-linux-gnu/cxxbridge -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -g -O2 -fPIE -fvisibility=hidden -fstack-reuse=none -fstack-protector-all -Wstack-protector -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wformat-security -Wredundant-move -Woverloaded-virtual -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-psabi -pthread -std=gnu++17 -MD -MT src/test/CMakeFiles/test_bitcoin.dir/__/__/chronik/test/chronikbridge_tests.cpp.o -MF src/test/CMakeFiles/test_bitcoin.dir/__/__/chronik/test/chronikbridge_tests.cpp.o.d -o src/test/CMakeFiles/test_bitcoin.dir/__/__/chronik/test/chronikbridge_tests.cpp.o -c ../../chronik/test/chronikbridge_tests.cpp
../../chronik/test/chronikbridge_tests.cpp: In member function ‘void chronikbridge_tests::test_find_fork::test_method()’:
../../chronik/test/chronikbridge_tests.cpp:74:54: error: no matching function for call to ‘chronik_bridge::ChronikBridge::ChronikBridge(node::NodeContext&)’
   74 |     const chronik_bridge::ChronikBridge bridge(m_node);
      |                                                      ^
In file included from cargo/build/x86_64-unknown-linux-gnu/cxxbridge/chronik-bridge/src/ffi.rs.h:3,
                 from ../../chronik/test/chronikbridge_tests.cpp:6:
../../chronik/chronik-cpp/chronik_bridge.h:47:5: note: candidate: ‘chronik_bridge::ChronikBridge::ChronikBridge(const Config&, const node::NodeContext&)’
   47 |     ChronikBridge(const Config &config, const node::NodeContext &node)
      |     ^~~~~~~~~~~~~
../../chronik/chronik-cpp/chronik_bridge.h:47:5: note:   candidate expects 2 arguments, 1 provided
../../chronik/chronik-cpp/chronik_bridge.h:42:7: note: candidate: ‘constexpr chronik_bridge::ChronikBridge::ChronikBridge(const chronik_bridge::ChronikBridge&)’
   42 | class ChronikBridge {
      |       ^~~~~~~~~~~~~
../../chronik/chronik-cpp/chronik_bridge.h:42:7: note:   no known conversion for argument 1 from ‘node::NodeContext’ to ‘const chronik_bridge::ChronikBridge&’
../../chronik/chronik-cpp/chronik_bridge.h:42:7: note: candidate: ‘constexpr chronik_bridge::ChronikBridge::ChronikBridge(chronik_bridge::ChronikBridge&&)’
../../chronik/chronik-cpp/chronik_bridge.h:42:7: note:   no known conversion for argument 1 from ‘node::NodeContext’ to ‘chronik_bridge::ChronikBridge&&’
[207/483] Running pow test suite
PASSED: pow test suite
[211/483] Running seeder test suite
PASSED: seeder test suite
[223/483] Running bitcoin-qt test suite
PASSED: bitcoin-qt test suite
[228/483] Running avalanche test suite
PASSED: avalanche test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-chronik failed with exit code 1

Tail of the build log:

wallet_disable.py                         | ✓ Passed  | 1 s
wallet_dump.py                            | ✓ Passed  | 5 s
wallet_encryption.py                      | ✓ Passed  | 5 s
wallet_encryption.py --descriptors        | ✓ Passed  | 5 s
wallet_groups.py                          | ✓ Passed  | 12 s
wallet_hd.py                              | ✓ Passed  | 6 s
wallet_hd.py --descriptors                | ✓ Passed  | 5 s
wallet_import_rescan.py                   | ✓ Passed  | 7 s
wallet_import_with_label.py               | ✓ Passed  | 1 s
wallet_importdescriptors.py               | ✓ Passed  | 6 s
wallet_importmulti.py                     | ✓ Passed  | 2 s
wallet_importprunedfunds.py               | ✓ Passed  | 2 s
wallet_importprunedfunds.py --descriptors | ✓ Passed  | 2 s
wallet_keypool.py                         | ✓ Passed  | 3 s
wallet_keypool_topup.py                   | ✓ Passed  | 4 s
wallet_keypool_topup.py --descriptors     | ✓ Passed  | 4 s
wallet_labels.py                          | ✓ Passed  | 1 s
wallet_labels.py --descriptors            | ✓ Passed  | 1 s
wallet_listreceivedby.py                  | ✓ Passed  | 5 s
wallet_listsinceblock.py                  | ✓ Passed  | 5 s
wallet_listsinceblock.py --descriptors    | ✓ Passed  | 6 s
wallet_listtransactions.py                | ✓ Passed  | 5 s
wallet_listtransactions.py --descriptors  | ✓ Passed  | 4 s
wallet_multiwallet.py                     | ✓ Passed  | 10 s
wallet_multiwallet.py --usecli            | ✓ Passed  | 9 s
wallet_reorgsrestore.py                   | ✓ Passed  | 3 s
wallet_resendwallettransactions.py        | ✓ Passed  | 2 s
wallet_send.py                            | ✓ Passed  | 7 s
wallet_startup.py                         | ✓ Passed  | 2 s
wallet_timelock.py                        | ✓ Passed  | 1 s
wallet_txn_clone.py                       | ✓ Passed  | 1 s
wallet_txn_clone.py --mineblock           | ✓ Passed  | 3 s
wallet_txn_doublespend.py                 | ✓ Passed  | 1 s
wallet_txn_doublespend.py --mineblock     | ✓ Passed  | 3 s
wallet_watchonly.py                       | ✓ Passed  | 1 s
wallet_watchonly.py --usecli              | ✓ Passed  | 1 s
interface_usdt_net.py                     | ○ Skipped | 0 s
interface_usdt_utxocache.py               | ○ Skipped | 0 s
interface_usdt_validation.py              | ○ Skipped | 0 s

ALL                                       | ✓ Passed  | 1308 s (accumulated) 
Runtime: 263 s

[190/483] Running avalanche test suite
PASSED: avalanche test suite
[211/483] Running seeder test suite
PASSED: seeder test suite
[215/483] Running pow test suite
PASSED: pow test suite
[220/483] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/script_tests.cpp.o
In file included from /usr/include/boost/test/unit_test.hpp:19,
                 from ../../src/test/script_tests.cpp:30:
../../src/test/script_tests.cpp: In member function ‘void script_tests::script_build::test_method()’:
../../src/test/script_tests.cpp:540:22: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
  540 | BOOST_AUTO_TEST_CASE(script_build) {
      |                      ^~~~~~~~~~~~
[228/483] Running bitcoin-qt test suite
PASSED: bitcoin-qt test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-chronik failed with exit code 1
Fabien requested changes to this revision.Mar 13 2023, 09:32

Log nits but otherwise lgtm

chronik/chronik-indexer/src/indexer.rs
108

Something like {height}/{tip_height} would be more useful

126

Also print the hash of the fork block so we can compare with the node easily

This revision now requires changes to proceed.Mar 13 2023, 09:32

Improve logging, also test logging. Add a test for CannotRewindChronik

Also test whether node without any blocks returns a chronik rewind error

remove some overfitted logging tests

This revision is now accepted and ready to land.Mar 13 2023, 15:59

move expect_unique_ptr to chronik_bridge::util, rebase from master

@bot build-linux64 build-linux-aarch64 build-linux-arm build-osx build-win64

This revision was automatically updated to reflect the committed changes.