Skip to content

Commit

Permalink
Fix Merkle tree recovery load test
Browse files Browse the repository at this point in the history
  • Loading branch information
slowli committed Oct 23, 2023
1 parent 46df9cd commit 5a23e95
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions core/lib/merkle_tree/examples/recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use zksync_merkle_tree::{
recovery::{MerkleTreeRecovery, RecoveryEntry},
HashTree, Key, PatchSet, PruneDatabase, RocksDBWrapper, ValueHash,
};
use zksync_storage::RocksDB;
use zksync_storage::{RocksDB, RocksDBOptions};

/// CLI for load-testing Merkle tree recovery.
#[derive(Debug, Parser)]
Expand Down Expand Up @@ -60,12 +60,14 @@ impl Cli {
"Created temp dir for RocksDB: {}",
dir.path().to_string_lossy()
);
rocksdb = if let Some(block_cache_capacity) = self.block_cache {
let db = RocksDB::with_cache(dir.path(), Some(block_cache_capacity));
RocksDBWrapper::from(db)
} else {
RocksDBWrapper::new(dir.path())
};
let db = RocksDB::with_options(
dir.path(),
RocksDBOptions {
block_cache_capacity: self.block_cache,
..RocksDBOptions::default()
},
);
rocksdb = RocksDBWrapper::from(db);
_temp_dir = Some(dir);
&mut rocksdb
};
Expand Down

0 comments on commit 5a23e95

Please sign in to comment.