Page MenuHomePhabricator

[Chronik] Add `MempoolGroupHistory`
ClosedPublic

Authored by tobias_ruck on Mar 29 2023, 19:48.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC1cb52ea50f7a: [Chronik] Add `MempoolGroupHistory`
Summary

The equivalent of GroupHistoryWriter/-Reader but for the mempool.

We store the transactions by serialized group member. Txs within a member are sorted by time_first_seen first and then by txid, which makes it very easy to read the data in chronological order.

We don't employ any pagination because it wouldn't add any benefit (the data is already in RAM), and BTreeSet itself is a hierarchical structure already.

Depends on D13500.

Test Plan

ninja check-crates

Diff Detail

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

Event Timeline

Rebase on chronik-group-txs

Remove as u64 which broke the build

Tail of the build log:

    Checking chronik-indexer v0.1.0 (/work/chronik/chronik-indexer)
    Checking axum v0.6.0
    Checking chronik-http v0.1.0 (/work/chronik/chronik-http)
    Finished dev [unoptimized + debuginfo] target(s) in 2m 05s
[5/6] cd /work && /usr/bin/cmake -E env CARGO_TARGET_DIR="/work/abc-ci-builds/build-chronik/cargo/build" CARGO_BUILD_RUSTC="/root/.rustup/toolchains/1.67.1-x86_64-unknown-linux-gnu/bin/rustc" CARGO_BUILD_RUSTDOC="/root/.rustup/toolchains/1.67.1-x86_64-unknown-linux-gnu/bin/rustdoc" /root/.rustup/toolchains/1.67.1-x86_64-unknown-linux-gnu/bin/cargo --locked clippy --package bitcoinsuite-* -- -D warnings
    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 thiserror v1.0.31
    Checking bitcoinsuite-core v0.1.0 (/work/chronik/bitcoinsuite-core)
    Finished dev [unoptimized + debuginfo] target(s) in 2m 05s
[6/6] cd /work && /usr/bin/cmake -E env CARGO_TARGET_DIR="/work/abc-ci-builds/build-chronik/cargo/build" CARGO_BUILD_RUSTC="/root/.rustup/toolchains/1.67.1-x86_64-unknown-linux-gnu/bin/rustc" CARGO_BUILD_RUSTDOC="/root/.rustup/toolchains/1.67.1-x86_64-unknown-linux-gnu/bin/rustdoc" /root/.rustup/toolchains/1.67.1-x86_64-unknown-linux-gnu/bin/cargo --locked test --package abc-rust-*
    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
   Compiling memchr v2.5.0
   Compiling libc v0.2.139
   Compiling abc-rust-lint v0.1.0 (/work/chronik/abc-rust-lint)
   Compiling object v0.29.0
   Compiling backtrace v0.3.66
   Compiling stable-eyre v0.2.2
   Compiling abc-rust-error v0.1.0 (/work/chronik/abc-rust-error)
    Finished test [unoptimized + debuginfo] target(s) in 2m 07s
     Running unittests src/lib.rs (abc-ci-builds/build-chronik/cargo/build/debug/deps/abc_rust_error-eec6582b4b0e9875)

running 0 tests

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

     Running tests/test_error.rs (abc-ci-builds/build-chronik/cargo/build/debug/deps/test_error-ad65b1b6998d5ffe)

running 1 test
test test_error ... ok

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

     Running unittests src/lib.rs (abc-ci-builds/build-chronik/cargo/build/debug/deps/abc_rust_lint-7244a5015e74dfbb)

running 0 tests

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

   Doc-tests abc-rust-error

running 1 test
test src/http_status.rs - http_status::parse_error_status (line 10) ... ok

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

   Doc-tests abc-rust-lint

running 1 test
test src/lib.rs - lint (line 13) ... ok

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

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 29 2023, 21:12
This revision was automatically updated to reflect the committed changes.