Skip to content

Commit

Permalink
chore: remove metadata (#513)
Browse files Browse the repository at this point in the history
  • Loading branch information
renancloudwalk authored Apr 3, 2024
1 parent 14af786 commit ad6b8f6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/eth/storage/hybrid/hybrid_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ pub struct HybridStorageState {
pub blocks_by_number: Arc<RocksDb<BlockNumber, Block>>,
pub blocks_by_hash: Arc<RocksDb<Hash, BlockNumber>>,
pub logs: Arc<RocksDb<(Hash, Index), LogMined>>,
pub metadata: Arc<RocksDb<String, String>>,
}

impl HybridStorageState {
Expand All @@ -82,7 +81,6 @@ impl HybridStorageState {
blocks_by_number: Arc::new(RocksDb::new("./data/blocks_by_number.rocksdb", DbConfig::LargeSSTFiles).unwrap()),
blocks_by_hash: Arc::new(RocksDb::new("./data/blocks_by_hash.rocksdb", DbConfig::LargeSSTFiles).unwrap()), //XXX this is not needed we can afford to have blocks_by_hash pointing into blocks_by_number
logs: Arc::new(RocksDb::new("./data/logs.rocksdb", DbConfig::LargeSSTFiles).unwrap()),
metadata: Arc::new(RocksDb::new("./data/metadata.rocksdb", DbConfig::Default).unwrap()),
}
}

Expand Down
4 changes: 0 additions & 4 deletions src/eth/storage/hybrid/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,10 @@ impl PermanentStorage for HybridPermanentStorage {
let hash = block.hash().clone();

let blocks_by_number = Arc::clone(&self.state.blocks_by_number);
let metadata = Arc::clone(&self.state.metadata);
let blocks_by_hash = Arc::clone(&self.state.blocks_by_hash);
let block_clone = block.clone();
let hash_clone = hash.clone();
futures.push(tokio::task::spawn_blocking(move || blocks_by_number.insert(number, block_clone)));
futures.push(tokio::task::spawn_blocking(move || {
metadata.insert("current_block_number".to_string(), number.as_u64().to_string());
}));
futures.push(tokio::task::spawn_blocking(move || blocks_by_hash.insert(hash_clone, number)));

futures.append(
Expand Down

0 comments on commit ad6b8f6

Please sign in to comment.