Page MenuHomePhabricator

[chronik] add a get_headers_by_range
AbandonedPublicDraft

Authored by PiRK on Jul 31 2024, 09:56.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

This will be useful to ensure we get consistent chain by holding cs_main for the entire duration of fetching headers. This will be useful for D16526 (fetching up to 500 headers on request) and in future diff we will also need to fetch the entire chain to compute a merkle tree.

Test Plan

tbd

Event Timeline

Tail of the build log:

    Checking bitcoinsuite-slp v0.1.0 (/work/chronik/bitcoinsuite-slp)
    Checking pin-project v1.1.5
    Checking postcard v1.0.8
    Checking parking_lot_core v0.9.9
    Checking tungstenite v0.21.0
    Checking toml_datetime v0.6.6
    Checking serde_spanned v0.6.6
   Compiling pyo3 v0.20.3
   Compiling pyo3-macros-backend v0.20.3
    Checking mime v0.3.17
    Checking seahash v4.1.0
    Checking bimap v0.6.3
    Checking winnow v0.6.13
    Checking sync_wrapper v0.1.2
   Compiling prost-build v0.11.9
    Checking topo_sort v0.4.0
    Checking axum-core v0.4.3
    Checking parking_lot v0.12.1
    Checking memoffset v0.9.1
    Checking hyper v1.2.0
    Checking tokio-tungstenite v0.21.0
    Checking tower v0.4.13
    Checking portable-atomic v1.6.0
    Checking serde_json v1.0.115
    Checking hyper-util v0.1.3
    Checking serde_urlencoded v0.7.1
    Checking toml_edit v0.22.14
    Checking chronik-plugin-common v0.1.0 (/work/chronik/chronik-plugin-common)
    Checking futures-executor v0.3.30
    Checking serde_path_to_error v0.1.16
    Checking itertools v0.13.0
    Checking unicode-segmentation v1.11.0
   Compiling chronik-proto v0.1.0 (/work/chronik/chronik-proto)
    Checking unindent v0.2.3
    Checking matchit v0.7.3
    Checking sync_wrapper v1.0.1
   Compiling chronik-bridge v0.1.0 (/work/chronik/chronik-bridge)
    Checking base64 v0.21.7
    Checking tower-http v0.5.2
    Checking convert_case v0.6.0
    Checking futures v0.3.30
    Checking chronik-plugin v0.1.0 (/work/chronik/chronik-plugin)
    Checking axum v0.7.5
   Compiling pyo3-macros v0.20.3
    Checking toml v0.8.14
    Checking versions v6.3.0
   Compiling librocksdb-sys v0.11.0+8.1.1
error: missing documentation for a method
  --> chronik/chronik-bridge/src/ffi.rs:10:1
   |
10 | #[cxx::bridge(namespace = "chronik_bridge")]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `-D missing-docs` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(missing_docs)]`

error: could not compile `chronik-bridge` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
ninja: build stopped: cannot make progress due to previous errors.
Build build-chronik failed with exit code 1

Tail of the build log:

[394/581] Building C object src/secp256k1/CMakeFiles/ecmult-bench.dir/src/bench_ecmult.c.o
[395/581] Linking CXX static library src/libscript.a
[396/581] Linking C executable src/secp256k1/ecmult-bench
[397/581] Linking CXX static library src/libbitcoinconsensus.a
[398/581] Linking CXX shared library src/libbitcoinconsensus.so.0.29.9
[399/581] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[400/581] Building CXX object src/CMakeFiles/bitcoin-cli.dir/bitcoin-cli.cpp.o
[401/581] Building CXX object src/CMakeFiles/server.dir/rpc/rawtransaction.cpp.o
[402/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockindex.cpp.o
[403/581] Linking CXX executable src/bitcoin-cli
[404/581] Building C object src/secp256k1/CMakeFiles/internal-bench.dir/src/bench_internal.c.o
[405/581] Linking C executable src/secp256k1/internal-bench
[406/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/coins.cpp.o
[407/581] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[408/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[409/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[410/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[411/581] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[412/581] Linking CXX executable src/bitcoin-tx
[413/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[414/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[415/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[416/581] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
[417/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[418/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[419/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[420/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[421/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[422/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/txmempool.cpp.o
[423/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[424/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[425/581] Building CXX object src/CMakeFiles/server.dir/rpc/blockchain.cpp.o
[426/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[427/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[428/581] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[429/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[430/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[431/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[432/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[433/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[434/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[435/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[436/581] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[437/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[438/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[439/581] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[440/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[441/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[442/581] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[443/581] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
[444/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[445/581] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[446/581] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[447/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[448/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[449/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[450/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[451/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build chronik-client-integration-tests failed with exit code 1
chronik/chronik-bridge/src/ffi.rs
132 ↗(On Diff #48946)

fixme: copy-pasta artifact

Tail of the build log:

[394/581] Linking C executable src/secp256k1/verify-bench
[395/581] Linking CXX static library src/libscript.a
[396/581] Building CXX object src/CMakeFiles/bitcoin-cli.dir/bitcoin-cli.cpp.o
[397/581] Linking C executable src/secp256k1/sign-bench
[398/581] Linking CXX static library src/libbitcoinconsensus.a
[399/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockindex.cpp.o
[400/581] Linking CXX shared library src/libbitcoinconsensus.so.0.29.9
[401/581] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[402/581] Building CXX object src/CMakeFiles/server.dir/rpc/rawtransaction.cpp.o
[403/581] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[404/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[405/581] Linking CXX executable src/bitcoin-cli
[406/581] Building C object src/secp256k1/CMakeFiles/internal-bench.dir/src/bench_internal.c.o
[407/581] Linking C executable src/secp256k1/internal-bench
[408/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/coins.cpp.o
[409/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[410/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[411/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[412/581] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[413/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[414/581] Linking CXX executable src/bitcoin-tx
[415/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[416/581] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
[417/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[418/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[419/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[420/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[421/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[422/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[423/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/txmempool.cpp.o
[424/581] Building CXX object src/CMakeFiles/server.dir/rpc/blockchain.cpp.o
[425/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[426/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[427/581] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[428/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[429/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[430/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[431/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[432/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[433/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[434/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[435/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[436/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[437/581] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[438/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[439/581] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[440/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[441/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[442/581] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[443/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[444/581] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
[445/581] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[446/581] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[447/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[448/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[449/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[450/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[451/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build ecash-agora-integration-tests failed with exit code 1

Tail of the build log:

[394/581] Linking C executable src/secp256k1/sign-bench
[395/581] Linking CXX static library src/libscript.a
[396/581] Linking C executable src/secp256k1/internal-bench
[397/581] Linking CXX static library src/libbitcoinconsensus.a
[398/581] Building C object src/secp256k1/CMakeFiles/ecmult-bench.dir/src/bench_ecmult.c.o
[399/581] Linking C executable src/secp256k1/ecmult-bench
[400/581] Linking CXX shared library src/libbitcoinconsensus.so.0.29.9
[401/581] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[402/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockindex.cpp.o
[403/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[404/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/coins.cpp.o
[405/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[406/581] Building CXX object src/CMakeFiles/server.dir/rpc/rawtransaction.cpp.o
[407/581] Building CXX object src/CMakeFiles/bitcoin-cli.dir/bitcoin-cli.cpp.o
[408/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[409/581] Linking CXX executable src/bitcoin-cli
[410/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[411/581] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[412/581] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[413/581] Linking CXX executable src/bitcoin-tx
[414/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[415/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[416/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[417/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[418/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[419/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[420/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[421/581] Building CXX object src/CMakeFiles/server.dir/rpc/blockchain.cpp.o
[422/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[423/581] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
[424/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/txmempool.cpp.o
[425/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[426/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[427/581] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[428/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[429/581] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[430/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[431/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[432/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[433/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[434/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[435/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[436/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[437/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[438/581] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[439/581] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[440/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[441/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[442/581] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[443/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[444/581] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[445/581] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[446/581] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
[447/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[448/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[449/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[450/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[451/581] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build ecash-lib-integration-tests failed with exit code 1

Tail of the build log:

   Doc-tests chronik-bridge

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-db

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-http

running 1 test
test chronik/chronik-http/src/protobuf.rs - protobuf::Protobuf (line 29) ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.32s

   Doc-tests chronik-indexer

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-plugin

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-plugin-common

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-plugin-impl

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-proto

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests chronik-util

running 2 tests
test chronik/chronik-util/src/log.rs - log::log (line 65) ... ignored
test chronik/chronik-util/src/log.rs - log::log_chronik (line 87) ... ignored

test result: ok. 0 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.00s

ninja: build stopped: cannot make progress due to previous errors.
Build build-chronik-plugins failed with exit code 1

return a rust::Vec instead of a std::vector