Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["crates/*"]
resolver = "2"

[workspace.package]
version = "0.8.0"
version = "0.8.1"
edition = "2024"
rust-version = "1.92"
authors = ["init4"]
Expand Down Expand Up @@ -35,13 +35,13 @@ incremental = false

[workspace.dependencies]
# internal
signet-hot = { version = "0.8.0", path = "./crates/hot" }
signet-hot-mdbx = { version = "0.8.0", path = "./crates/hot-mdbx" }
signet-cold = { version = "0.8.0", path = "./crates/cold" }
signet-cold-mdbx = { version = "0.8.0", path = "./crates/cold-mdbx" }
signet-cold-sql = { version = "0.8.0", path = "./crates/cold-sql" }
signet-storage = { version = "0.8.0", path = "./crates/storage" }
signet-storage-types = { version = "0.8.0", path = "./crates/types" }
signet-hot = { version = "0.8.1", path = "./crates/hot" }
signet-hot-mdbx = { version = "0.8.1", path = "./crates/hot-mdbx" }
signet-cold = { version = "0.8.1", path = "./crates/cold" }
signet-cold-mdbx = { version = "0.8.1", path = "./crates/cold-mdbx" }
signet-cold-sql = { version = "0.8.1", path = "./crates/cold-sql" }
signet-storage = { version = "0.8.1", path = "./crates/storage" }
signet-storage-types = { version = "0.8.1", path = "./crates/types" }

# External, in-house
signet-libmdbx = { version = "0.8.0" }
Expand Down
30 changes: 28 additions & 2 deletions crates/cold/src/conformance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
//! a custom backend, call the test functions with your backend instance.

use crate::{
BlockData, ColdResult, ColdStorage, ColdStorageBackend, ColdStorageError, Filter,
HeaderSpecifier, ReceiptSpecifier, RpcLog, TransactionSpecifier,
BlockData, ColdResult, ColdStorage, ColdStorageBackend, ColdStorageError, ErasedBackend,
Filter, HeaderSpecifier, ReceiptSpecifier, RpcLog, TransactionSpecifier,
};
use alloy::{
consensus::{
Expand Down Expand Up @@ -43,6 +43,32 @@ pub async fn conformance<B: ColdStorageBackend>(backend: B) -> ColdResult<()> {
Ok(())
}

/// Run the conformance suite against `backend` after erasing it
/// through [`crate::DynColdStorageBackend`].
///
/// Exercises the same contract as [`conformance`] but routes every
/// call through [`ErasedBackend`], validating that the erased
/// dispatch path upholds the trait contract.
pub async fn conformance_erased<B: ColdStorageBackend>(backend: B) -> ColdResult<()> {
let erased = ErasedBackend::new(backend);
let cancel = CancellationToken::new();
let handle = ColdStorage::new(erased, cancel.clone());
test_empty_storage(&handle).await?;
test_append_and_read_header(&handle).await?;
test_header_hash_lookup(&handle).await?;
test_transaction_lookups(&handle).await?;
test_receipt_lookups(&handle).await?;
test_truncation(&handle).await?;
test_batch_append(&handle).await?;
test_confirmation_metadata(&handle).await?;
test_cold_receipt_metadata(&handle).await?;
test_get_logs(&handle).await?;
test_stream_logs(&handle).await?;
test_drain_above(&handle).await?;
cancel.cancel();
Ok(())
}

/// Create test block data for conformance tests.
///
/// Creates a minimal valid block with the given block number.
Expand Down
Loading