Page MenuHomePhabricator

[Chronik] Add `ChronikBridge::load_block`
ClosedPublic

Authored by tobias_ruck on Mar 11 2023, 12:59.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCbdac4cb57968: [Chronik] Add `ChronikBridge::load_block`
Summary

Loads a CBlock from disk given a CBlockIndex. We need this to index the existing tx data from the node.

Depends on D13292.

Test Plan

ninja test_bitcoin && ./src/test/test_bitcoin -t chronikbridge_tests

Diff Detail

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

Event Timeline

tobias_ruck edited the test plan for this revision. (Show Details)

Tail of the build log:

wallet_listsinceblock.py                  | ✓ Passed  | 6 s
wallet_listsinceblock.py --descriptors    | ✓ Passed  | 7 s
wallet_listtransactions.py                | ✓ Passed  | 4 s
wallet_listtransactions.py --descriptors  | ✓ Passed  | 4 s
wallet_multiwallet.py                     | ✓ Passed  | 39 s
wallet_multiwallet.py --usecli            | ✓ Passed  | 10 s
wallet_reorgsrestore.py                   | ✓ Passed  | 3 s
wallet_resendwallettransactions.py        | ✓ Passed  | 9 s
wallet_send.py                            | ✓ Passed  | 6 s
wallet_startup.py                         | ✓ Passed  | 2 s
wallet_timelock.py                        | ✓ Passed  | 1 s
wallet_txn_clone.py                       | ✓ Passed  | 2 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  | 1391 s (accumulated) 
Runtime: 279 s

[131/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) {
      |                      ^~~~~~~~~~~~
[208/483] Running seeder test suite
PASSED: seeder test suite
[211/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&&’
[219/483] Running pow test suite
PASSED: pow 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
chronik/chronik-cpp/chronik_bridge.h
43 ↗(On Diff #38433)

If all you need are the chain params, why not only store that instead of the config ? Is this going to be used at a later stage ?

Use Consensus::Params instead of Config

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

This revision is now accepted and ready to land.Mar 13 2023, 18:29