Skip to main content

xenith_read/
lib.rs

1//! Multi-chain parallel storage read layer for xenith.
2//!
3//! Provides [`MultiChainReader`], which issues concurrent EVM storage reads and
4//! contract calls across many chains and reports slot-level divergence. Depends
5//! on [`xenith_core`] for error types and chain identifiers. Enable the
6//! `live-rpc` feature to use the alloy-backed `AlloyProvider` against real
7//! JSON-RPC nodes; [`MockProvider`] is always available for tests.
8//!
9//! ```rust,no_run
10//! use std::collections::HashMap;
11//! use xenith_core::ChainId;
12//! use xenith_read::MultiChainReader;
13//!
14//! # async fn example() {
15//! let reader = MultiChainReader::new(HashMap::new());
16//! let report = reader
17//!     .check_divergence(vec![ChainId::from(1)], [0u8; 20], [0u8; 32])
18//!     .await;
19//! # }
20//! ```
21//!
22//! See the [xenith_core] crate for core types and traits.
23
24#[cfg(feature = "live-rpc")]
25pub mod alloy_provider;
26pub mod provider;
27pub mod reader;
28
29#[cfg(feature = "live-rpc")]
30pub use alloy_provider::AlloyProvider;
31pub use provider::{ChainProvider, MockProvider};
32pub use reader::{DivergenceReport, MultiChainReader};