Bump MSRV to 1.85 & update RocksDB to 9.10.0

Support Debian 13 (trixie) / Ubuntu 25.04 (plucky).
This commit is contained in:
Roman Zeyde 2024-12-18 09:07:46 +02:00
parent c86204f7ff
commit 55c8e772c2
No known key found for this signature in database
GPG key ID: 87CAE5FA46917CBB
10 changed files with 277 additions and 335 deletions

View file

@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
build-args:
[
--locked --no-default-features,
@ -35,6 +35,9 @@ jobs:
- name: Install Rust
run: rustup component add rustfmt clippy
- name: Install other dependencies
run: sudo apt install build-essential libclang-dev
- name: Format
run: cargo fmt --all -- --check

560
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -10,7 +10,7 @@ keywords = ["bitcoin", "electrum", "server", "index", "database"]
documentation = "https://docs.rs/electrs/"
readme = "README.md"
edition = "2021"
rust-version = "1.63.0"
rust-version = "1.85.0"
build = "build.rs"
[features]
@ -45,8 +45,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.36"
default-features = false
# ZSTD is used for data compression

View file

@ -2,13 +2,13 @@
# 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:trixie-slim AS base
RUN apt-get update -qqy
RUN apt-get install -qqy librocksdb-dev curl
### Electrum Rust Server ###
FROM base AS electrs-build
RUN apt-get install -qqy cargo clang cmake
RUN apt-get install -qqy cargo build-essential libclang-dev
# Install electrs
WORKDIR /build/electrs

View file

@ -2,13 +2,13 @@
# 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:trixie-slim AS base
RUN apt-get update -qqy
RUN apt-get install -qqy librocksdb-dev wget
### Electrum Rust Server ###
FROM base AS electrs-build
RUN apt-get install -qqy cargo clang cmake
RUN apt-get install -qqy cargo build-essential libclang-dev
# Install electrs
WORKDIR /build/electrs
@ -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/ && \

View file

@ -1,3 +1,11 @@
# 0.11.0 (TBD)
* Update MSRV to 1.85
* Support Debian 13 (trixie) / Ubuntu 25.04 (plucky)
* Update RocksDB crate to `rust-rocksdb` 0.36
- [Dynamic linking with RocksDB](doc/install.md) now requires [RocksDB 9.10.0](https://packages.debian.org/trixie/librocksdb-dev) (instead of 7.8.3).
- Old electrs versions won't be able to read the new RocksDB database format (requiring reindex).
# 0.10.10 (Jul 19 2025)
* Update documentation links and typos.

View file

@ -1,11 +1,11 @@
## Quickstart
<details>
<summary>Building from source on an Ubuntu 21.10 VM:</summary>
<summary>Building from source on an Ubuntu 25.04 / Debian 13:</summary>
```bash
$ sudo apt update
$ sudo apt install -y clang cmake build-essential git cargo
$ sudo apt install -y build-essential libclang-dev git cargo
$ git clone https://github.com/romanz/electrs
$ cd electrs
$ cargo build --locked --release
@ -25,14 +25,14 @@ $ ./target/release/electrs --version # should print the latest version
Note for Raspberry Pi 4 owners: the old versions of OS/toolchains produce broken binaries.
Make sure to use latest OS! (see #226)
Install [recent Rust](https://rustup.rs/) (1.63.0+, `apt install cargo` is preferred for Debian 12),
Install [recent Rust](https://rustup.rs/) (1.85.0+, `apt install cargo` is preferred for Debian 13),
[latest Bitcoin Core](https://bitcoincore.org/en/download/) (0.21+)
and [latest Electrum wallet](https://electrum.org/#download) (4.0+).
Also, install the following packages (on Debian or Ubuntu):
```bash
$ sudo apt update
$ sudo apt install clang cmake build-essential # for building 'rust-rocksdb'
$ sudo apt install build-essential libclang-dev # for building 'rust-rocksdb'
```
There are two ways to compile `electrs`: by statically linking to `librocksdb` or dynamically linking.
@ -52,18 +52,18 @@ The advantages of dynamic linking:
* Cross compilation is more reliable
* If another application is also using `rocksdb`, you don't store it on disk and in RAM twice
If you decided to use dynamic linking, you will also need to install the library ([7.8.3 release](https://github.com/facebook/rocksdb/releases/tag/v7.8.3) is required).
On [Debian 12 (bookworm)](https://packages.debian.org/bookworm/librocksdb-dev) and [Ubuntu 23.04 (lunar)](https://packages.ubuntu.com/lunar/librocksdb-dev):
If you decided to use dynamic linking, you will also need to install the library ([9.10.0 release](https://github.com/facebook/rocksdb/releases/tag/v9.10.0) is required).
On [Debian 13 (trixie)](https://packages.debian.org/bookworm/librocksdb-dev) and [Ubuntu 25.04 (plucky)](https://packages.ubuntu.com/plucky/librocksdb-dev):
```bash
$ sudo apt install librocksdb-dev=7.8.3-2
$ sudo apt install librocksdb-dev=9.10.0-1
```
For other versions of Debian or Ubuntu, you can build librocksdb and install inside `/usr/local` directory using following command.
```bash
$ sudo apt install -y libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev
$ git clone -b v7.8.3 --depth 1 https://github.com/facebook/rocksdb && cd rocksdb
$ git clone -b v9.10.0 --depth 1 https://github.com/facebook/rocksdb && cd rocksdb
$ make shared_lib -j $(nproc) && sudo make install-shared
$ cd .. && rm -r rocksdb
```
@ -149,7 +149,7 @@ sudo chroot debootstrap-buster /bin/bash
apt install curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
apt install clang cmake build-essential
apt install build-essential libclang-dev
# install target specific cross compiler (armhf/gnueabihf)
apt install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-dev-armhf-cross

View file

@ -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")?;

View file

@ -17,6 +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(unused_imports)]
include!(concat!(env!("OUT_DIR"), "/configure_me_config.rs"));
}

View file

@ -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};