Skip to content

Commit

Permalink
chore: remove redis permanent storage (#1917)
Browse files Browse the repository at this point in the history
  • Loading branch information
carneiro-cw authored Dec 13, 2024
1 parent c42f360 commit 37c4617
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 464 deletions.
30 changes: 0 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ tracing-subscriber = { version = "=0.3.18", features = ["env-filter", "json"] }
tracing-serde = "=0.1.3"

# storage
redis = "=0.26.0"
rocksdb = { version = "=0.22.0", features = ["multi-threaded-cf"] }
sqlx = { version = "=0.8.2", features = [
"runtime-tokio",
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Welcome to Stratus, the cutting-edge EVM executor and JSON-RPC server with custo
## Current storage implementations

- In Memory
- Redis
- RocksDB (default)

## Performance Landscape
Expand Down
17 changes: 1 addition & 16 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,7 @@ services:
- manual

# ----------------------------------------------------------------------------
# Redis
# ----------------------------------------------------------------------------
redis:
image: redis:7.2.5
ports:
- "6379:6379"

redis-commander:
image: rediscommander/redis-commander:latest
ports:
- "8081:8081"
environment:
- REDIS_HOSTS=local:redis:6379

# ----------------------------------------------------------------------------
# PromethMeus
# Prometheus
# ----------------------------------------------------------------------------
prometheus:
image: prom/prometheus
Expand Down
14 changes: 0 additions & 14 deletions src/eth/storage/permanent/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
pub use self::inmemory::InMemoryPermanentStorage;
pub use self::redis::RedisPermanentStorage;
pub use self::rocks::RocksPermanentStorage;
pub use self::rocks::RocksStorageState;

mod inmemory;
mod redis;
pub mod rocks;

use std::str::FromStr;
Expand All @@ -27,7 +25,6 @@ use crate::eth::primitives::Slot;
use crate::eth::primitives::SlotIndex;
use crate::eth::primitives::TransactionMined;
use crate::ext::parse_duration;
use crate::log_and_err;

/// Permanent (committed) storage operations.
pub trait PermanentStorage: Send + Sync + 'static {
Expand Down Expand Up @@ -121,9 +118,6 @@ pub enum PermanentStorageKind {
#[serde(rename = "inmemory")]
InMemory,

#[serde(rename = "redis")]
Redis,

#[serde(rename = "rocks")]
Rocks,
}
Expand All @@ -136,13 +130,6 @@ impl PermanentStorageConfig {
let perm: Box<dyn PermanentStorage> = match self.perm_storage_kind {
PermanentStorageKind::InMemory => Box::<InMemoryPermanentStorage>::default(),

PermanentStorageKind::Redis => {
let Some(url) = self.perm_storage_url.as_deref() else {
return log_and_err!("redis connection url not provided when it was expected to be present");
};
Box::new(RedisPermanentStorage::new(url)?)
}

PermanentStorageKind::Rocks => Box::new(RocksPermanentStorage::new(
self.rocks_path_prefix.clone(),
self.rocks_shutdown_timeout,
Expand All @@ -160,7 +147,6 @@ impl FromStr for PermanentStorageKind {
fn from_str(s: &str) -> anyhow::Result<Self, Self::Err> {
match s {
"inmemory" => Ok(Self::InMemory),
"redis" => Ok(Self::Redis),
"rocks" => Ok(Self::Rocks),
s => Err(anyhow!("unknown permanent storage: {}", s)),
}
Expand Down
Loading

0 comments on commit 37c4617

Please sign in to comment.