From 4180fdca9c9bb87886183222a3c98c1b61387f20 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Tue, 17 Dec 2024 21:13:04 +0200 Subject: [PATCH] Test on Debian Trixie & update RocksDB to 9.3.1 Also bump MSRV to 1.83 for Trixie. --- Cargo.lock | 92 ++++++++++++++++++--------------------- Cargo.toml | 4 +- Dockerfile | 2 +- Dockerfile.ci | 4 +- examples/tx_collisions.rs | 2 +- rust-toolchain.toml | 2 +- src/config.rs | 5 +-- src/db.rs | 2 +- 8 files changed, 51 insertions(+), 62 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 72601f52d..bb62373fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -59,22 +59,22 @@ checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" [[package]] name = "bindgen" -version = "0.63.0" +version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36d860121800b2a9a94f9b5604b332d5cffb234ce17609ea479d723dbc9d3885" +checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "cexpr", "clang-sys", + "itertools", "lazy_static", "lazycell", - "peeking_take_while", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 1.0.109", + "syn", ] [[package]] @@ -410,13 +410,13 @@ dependencies = [ "crossbeam-channel", "ctrlc", "dirs-next", - "electrs-rocksdb", "env_logger", "hex_lit", "log", "parking_lot", "prometheus", "rayon", + "rust-rocksdb", "serde", "serde_derive", "serde_json", @@ -425,31 +425,6 @@ dependencies = [ "tiny_http", ] -[[package]] -name = "electrs-librocksdb-sys" -version = "0.9.0-e3+7.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b34c24ce2a4d41fe320cea3a9b703b50efea6c2dd4a6d5b0cdbb6ee81636932f" -dependencies = [ - "bindgen", - "bzip2-sys", - "cc", - "glob", - "libc", - "libz-sys", - "zstd-sys", -] - -[[package]] -name = "electrs-rocksdb" -version = "0.19.0-e3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f33e74754aaacc3ff9ace8d3278a7f1be1173104d1960ea18f36386f0feec1e" -dependencies = [ - "electrs-librocksdb-sys", - "libc", -] - [[package]] name = "env_logger" version = "0.10.2" @@ -595,6 +570,15 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.10" @@ -797,12 +781,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14248cc8eced350e20122a291613de29e4fa129ba2731818c4cdbb44fccd3e55" -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - [[package]] name = "pkg-config" version = "0.3.28" @@ -968,6 +946,31 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +[[package]] +name = "rust-librocksdb-sys" +version = "0.23.1+9.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d4528f6183c0ed71fd1b34a669f1cdbca5007514dcd29be4e5932e39c476fb5" +dependencies = [ + "bindgen", + "bzip2-sys", + "cc", + "glob", + "libc", + "libz-sys", + "zstd-sys", +] + +[[package]] +name = "rust-rocksdb" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d3450dd11b7f375a235161bfb529b16c1b6420d771983030ace053e570ded52" +dependencies = [ + "libc", + "rust-librocksdb-sys", +] + [[package]] name = "rustc-hash" version = "1.1.0" @@ -1051,7 +1054,7 @@ checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn", ] [[package]] @@ -1116,17 +1119,6 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "syn" version = "2.0.42" @@ -1177,7 +1169,7 @@ checksum = "268026685b2be38d7103e9e507c938a1fcb3d7e6eb15e87870b617bf37b6d581" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 65f9158b6..466d2bdd8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,8 +44,8 @@ ctrlc = "=3.4.2" [target.'cfg(not(windows))'.dependencies] signal-hook = "0.3" -[dependencies.electrs-rocksdb] -version = "0.19.0-e3" +[dependencies.rust-rocksdb] +version = "0.27.1" default-features = false # ZSTD is used for data compression diff --git a/Dockerfile b/Dockerfile index c8ec506e3..1be1f81d4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # The maintainers of electrs are not deeply familiar with Docker, so you should DYOR. # If you are not familiar with Docker either it's probably be safer to NOT use it. -FROM debian:bookworm-slim AS base +FROM debian:testing-slim AS base RUN apt-get update -qqy RUN apt-get install -qqy librocksdb-dev curl diff --git a/Dockerfile.ci b/Dockerfile.ci index 18806c7f1..b17387288 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -2,7 +2,7 @@ # The maintainers of electrs are not deeply familiar with Docker, so you should DYOR. # If you are not familiar with Docker either it's probably be safer to NOT use it. -FROM debian:bookworm-slim as base +FROM debian:testing-slim as base RUN apt-get update -qqy RUN apt-get install -qqy librocksdb-dev wget @@ -37,7 +37,7 @@ RUN bitcoind -version && bitcoin-cli -version ### Electrum ### # Clone latest Electrum wallet and a few test tools WORKDIR /build/ -RUN apt-get install -qqy git libsecp256k1-1 python3-cryptography python3-setuptools python3-venv python3-pip jq curl +RUN apt-get install -qqy git libsecp256k1-2 python3-cryptography python3-setuptools python3-venv python3-pip jq curl RUN git clone --recurse-submodules https://github.com/spesmilo/electrum/ && cd electrum/ && git log -1 RUN python3 -m venv --system-site-packages venv && \ ELECTRUM_ECC_DONT_COMPILE=1 venv/bin/pip install -e electrum/ && \ diff --git a/examples/tx_collisions.rs b/examples/tx_collisions.rs index 839a508a7..0b7fd581f 100644 --- a/examples/tx_collisions.rs +++ b/examples/tx_collisions.rs @@ -1,5 +1,5 @@ use anyhow::{Context, Result}; -use electrs_rocksdb::{ColumnFamilyDescriptor, IteratorMode, Options, DB}; +use rust_rocksdb::{ColumnFamilyDescriptor, IteratorMode, Options, DB}; fn main() -> Result<()> { let path = std::env::args().nth(1).context("missing DB path")?; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 07d72a900..937a0c0ae 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.63.0" +channel = "1.83.0" components = [ "rustfmt" ] diff --git a/src/config.rs b/src/config.rs index 430e9aebc..5d9c8b0e0 100644 --- a/src/config.rs +++ b/src/config.rs @@ -17,10 +17,7 @@ pub const ELECTRS_VERSION: &str = env!("CARGO_PKG_VERSION"); const DEFAULT_SERVER_ADDRESS: [u8; 4] = [127, 0, 0, 1]; // by default, serve on IPv4 localhost mod internal { - #![allow(clippy::enum_variant_names)] - #![allow(clippy::unnecessary_lazy_evaluations)] - #![allow(clippy::useless_conversion)] - + #![allow(unused_imports)] include!(concat!(env!("OUT_DIR"), "/configure_me_config.rs")); } diff --git a/src/db.rs b/src/db.rs index 414504c5c..954d80743 100644 --- a/src/db.rs +++ b/src/db.rs @@ -1,5 +1,5 @@ use anyhow::{Context, Result}; -use electrs_rocksdb as rocksdb; +use rust_rocksdb as rocksdb; use std::path::Path; use std::sync::atomic::{AtomicBool, Ordering};