Page MenuHomePhabricator

[Chronik] Upgrade to axum 0.7
ClosedPublic

Authored by tobias_ruck on Feb 19 2024, 11:41.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCddfdd6ff1b46: [Chronik] Upgrade to axum 0.7
Summary

It's good to keep up with development, and this version will use the recently 1.0 stabilized crates for http and hyper.

Axum 0.7 changes quite a few things, but luckily for us it's impact is limited to only a few files.

The upgrade guide for axum 0.7 can be found here: https://tokio.rs/blog/2023-11-27-announcing-axum-0-7-0

This version also makes it convenient to use our own custom std::net::TcpListener, which allows us to use SO_REUSEADDR.

Test Plan

ninja check-functional

Diff Detail

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

Event Timeline

Tail of the build log:

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::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::token::tests::test_batch_vault::test_batch_vault ... ok
test io::group_utxos::tests::test_value_group_utxos ... 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

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

     Running unittests src/lib.rs (abc-ci-builds/build-chronik/cargo/build/debug/deps/chronik_http-b44fcdd6d21532e0)

running 2 tests
test error::tests::test_report_error ... ok
test protobuf::tests::test_protobuf ... FAILED

failures:

---- protobuf::tests::test_protobuf stdout ----
thread 'protobuf::tests::test_protobuf' panicked at 'assertion failed: `(left == right)`
  left: `Error { msg: "400: Invalid body: Test bad body error" }`,
 right: `Error { msg: "400: Invalid body: error reading a body from connection: Test bad body error" }`', chronik/chronik-http/src/protobuf.rs:208:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    protobuf::tests::test_protobuf

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

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

Tail of the build log:

    Checking pin-project v1.1.3
    Checking http-body-util v0.1.0
    Checking bimap v0.6.3
    Checking bitcoinsuite-slp v0.1.0 (/work/chronik/bitcoinsuite-slp)
    Checking seahash v4.1.0
    Checking mime v0.3.17
    Checking smallvec v1.13.1
    Checking sync_wrapper v0.1.2
    Checking topo_sort v0.4.0
    Checking serde_urlencoded v0.7.1
    Checking axum-core v0.4.3
    Checking serde_json v1.0.105
   Compiling pyo3 v0.20.2
    Checking parking_lot_core v0.9.9
    Checking futures-executor v0.3.28
    Checking serde_path_to_error v0.1.14
    Checking matchit v0.7.2
    Checking base64 v0.21.2
    Checking futures v0.3.28
    Checking parking_lot v0.12.1
   Compiling prost-build v0.11.9
    Checking memoffset v0.9.0
    Checking unindent v0.2.3
    Checking chronik-plugin v0.1.0 (/work/chronik/chronik-plugin)
    Checking tokio-util v0.7.10
    Checking tokio-tungstenite v0.21.0
    Checking tower v0.4.13
   Compiling chronik-bridge v0.1.0 (/work/chronik/chronik-bridge)
   Compiling chronik-lib v0.1.0 (/work/chronik/chronik-lib)
    Checking h2 v0.4.2
   Compiling chronik-proto v0.1.0 (/work/chronik/chronik-proto)
   Compiling librocksdb-sys v0.11.0+8.1.1
    Checking chronik-plugin-impl v0.1.0 (/work/chronik/chronik-plugin-impl)
    Checking hyper v1.1.0
    Checking hyper-util v0.1.3
    Checking axum v0.7.4
    Checking rocksdb v0.21.0
    Checking chronik-db v0.1.0 (/work/chronik/chronik-db)
    Checking chronik-indexer v0.1.0 (/work/chronik/chronik-indexer)
    Checking chronik-http v0.1.0 (/work/chronik/chronik-http)
    Finished dev [unoptimized + debuginfo] target(s) in 4m 37s
[6/6] cd /work && /usr/bin/cmake -E env CARGO_TARGET_DIR="/work/abc-ci-builds/build-chronik-plugins/cargo/build" CARGO_BUILD_RUSTC="/root/.rustup/toolchains/1.72.0-x86_64-unknown-linux-gnu/bin/rustc" CARGO_BUILD_RUSTDOC="/root/.rustup/toolchains/1.72.0-x86_64-unknown-linux-gnu/bin/rustdoc" /root/.rustup/toolchains/1.72.0-x86_64-unknown-linux-gnu/bin/cargo --locked clippy --package bitcoinsuite-* -- -D warnings
warning: some crates are on edition 2021 which defaults to `resolver = "2"`, but virtual workspaces default to `resolver = "1"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on build directory
    Checking either v1.9.0
    Checking serde v1.0.185
    Checking thiserror v1.0.47
    Checking itertools v0.10.5
    Checking bytes v1.5.0
    Checking bitcoinsuite-core v0.1.0 (/work/chronik/bitcoinsuite-core)
    Checking bitcoinsuite-slp v0.1.0 (/work/chronik/bitcoinsuite-slp)
    Finished dev [unoptimized + debuginfo] target(s) in 4m 40s
ninja: build stopped: cannot make progress due to previous errors.
Build build-chronik-plugins failed with exit code 1
Fabien requested changes to this revision.Feb 19 2024, 11:53

this impacts some tests

This revision now requires changes to proceed.Feb 19 2024, 11:53
This revision is now accepted and ready to land.Feb 19 2024, 12:20
This revision was automatically updated to reflect the committed changes.