Skip to content

Commit

Permalink
feat: remove LegacyHistory store version (ethereum#1674)
Browse files Browse the repository at this point in the history
  • Loading branch information
morph-dev authored and Omar Carey committed Feb 13, 2025
1 parent 4791bd8 commit 9d18a08
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 268 deletions.
179 changes: 0 additions & 179 deletions crates/storage/src/versioned/id_indexed_v1/migration.rs

This file was deleted.

1 change: 0 additions & 1 deletion crates/storage/src/versioned/id_indexed_v1/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
mod config;
mod migration;
mod pruning_strategy;
pub(super) mod sql;
mod store;
Expand Down
12 changes: 3 additions & 9 deletions crates/storage/src/versioned/id_indexed_v1/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ use rusqlite::{named_params, types::Type, OptionalExtension};
use tracing::{debug, error, warn};
use trin_metrics::storage::StorageMetricsReporter;

use super::{
migration::migrate_legacy_history_store, pruning_strategy::PruningStrategy, sql,
IdIndexedV1StoreConfig,
};
use super::{pruning_strategy::PruningStrategy, sql, IdIndexedV1StoreConfig};
use crate::{
error::ContentStoreError,
utils::get_total_size_of_directory_in_bytes,
Expand Down Expand Up @@ -63,13 +60,10 @@ impl<TContentKey: OverlayContentKey> VersionedContentStore for IdIndexedV1Store<
}

fn migrate_from(
content_type: &ContentType,
_content_type: &ContentType,
old_version: StoreVersion,
config: &Self::Config,
_config: &Self::Config,
) -> Result<(), ContentStoreError> {
if content_type == &ContentType::History && old_version == StoreVersion::LegacyHistory {
return migrate_legacy_history_store(config);
}
Err(ContentStoreError::UnsupportedStoreMigration {
old_version,
new_version: Self::version(),
Expand Down
7 changes: 4 additions & 3 deletions crates/storage/src/versioned/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ pub enum ContentType {
#[derive(Clone, Debug, Display, Eq, PartialEq, EnumString, AsRefStr)]
#[strum(serialize_all = "snake_case")]
pub enum StoreVersion {
/// The mock content store that can be used for tests. Implementation:
/// [utils::MockContentStore].
MockContentStore,
/// The store designed for content-id, content-key and content-value objects.
/// The content from different subnetwork (expressed with `ContentType`)
/// uses different table. NOTE: implementation is in progress.
/// uses different table. Implementation: [IdIndexedV1Store].
IdIndexedV1,
/// The original SQLite version of the history storage store.
LegacyHistory,
}

impl FromSql for StoreVersion {
Expand Down
Loading

0 comments on commit 9d18a08

Please # to comment.