Skip to content

Commit

Permalink
fix: Add test for gc and remove all panics.
Browse files Browse the repository at this point in the history
  • Loading branch information
vldm committed Feb 11, 2025
1 parent 4d83bb4 commit bbe2b80
Show file tree
Hide file tree
Showing 17 changed files with 238 additions and 72 deletions.
2 changes: 1 addition & 1 deletion core/src/replay_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use {
block_error::BlockError,
blockstore::Blockstore,
blockstore_processor::{self, BlockstoreProcessorError, TransactionStatusSender},
evm::recoreder::EvmArchiveManagerSender,
evm::recorder::EvmArchiveManagerSender,
leader_schedule_cache::LeaderScheduleCache,
leader_schedule_utils::first_of_consecutive_leader_slots,
},
Expand Down
2 changes: 1 addition & 1 deletion core/src/tvu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use {
solana_gossip::cluster_info::ClusterInfo,
solana_ledger::{
blockstore::Blockstore, blockstore_processor::TransactionStatusSender,
evm::recoreder::EvmArchiveManagerSender, leader_schedule_cache::LeaderScheduleCache,
evm::recorder::EvmArchiveManagerSender, leader_schedule_cache::LeaderScheduleCache,
},
solana_poh::poh_recorder::PohRecorder,
solana_rpc::{
Expand Down
2 changes: 1 addition & 1 deletion core/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use {
blockstore_db::{BlockstoreOptions, BlockstoreRecoveryMode, LedgerColumnOptions},
blockstore_processor::{self, TransactionStatusSender},
evm::{
recoreder::{
recorder::{
EvmArchiveManagerReceiver, EvmArchiveManagerSender, EvmArchiveManagerService,
},
EvmArchive, EvmArchiveInner, EvmArchiveType,
Expand Down
3 changes: 1 addition & 2 deletions evm-utils/evm-state/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ impl EvmBackend<Incomming> {
}
}

pub fn set_initial(
pub fn init_accounts_without_commit(
&mut self,
accounts: impl IntoIterator<Item = (H160, evm::backend::MemoryAccount)>,
) {
Expand All @@ -298,7 +298,6 @@ impl EvmBackend<Incomming> {
self.set_account_state(address, account_state);
self.ext_storage(address, storage);
}
self.flush_changes()
}

pub fn new_incomming_for_root(mut self, root: H256) -> Option<Self> {
Expand Down
8 changes: 5 additions & 3 deletions evm-utils/evm-state/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ impl StorageSecondary {
}

fn open(location: Location, gc_enabled: bool) -> Result<Self> {
log::warn!("gc_enabled {}", gc_enabled);
log::debug!("gc_enabled {}", gc_enabled);
let db_opts = default_db_opts()?;

let descriptors = Descriptors::secondary_descriptors(gc_enabled);
Expand Down Expand Up @@ -321,7 +321,7 @@ impl Storage<OptimisticTransactionDB> {
}

fn open(location: Location, gc_enabled: bool) -> Result<Self> {
log::warn!("gc_enabled {}", gc_enabled);
log::debug!("gc_enabled {}", gc_enabled);
log::info!("location is {:?}", location);
let db_opts = default_db_opts()?;

Expand All @@ -332,7 +332,7 @@ impl Storage<OptimisticTransactionDB> {

let descriptors = Descriptors::compute(exist_cfs, &db_opts, gc_enabled);
let db = {
warn!("Trying as primary at : {:?}", &location);
info!("Trying as primary at : {:?}", &location);
let mut db = DB::open_cf_descriptors(&db_opts, &location, descriptors.all)?;

for removed_cf in descriptors.cleanup_cfs {
Expand Down Expand Up @@ -888,6 +888,8 @@ pub struct RootCleanup<'a> {
}

impl<'a> RootCleanup<'a> {
// cleanup nodes from trie,
// remove only nodes that already has zero parents.
pub fn new(storage: &'a Storage, roots: Vec<H256>) -> Self {
Self {
elems: roots,
Expand Down
3 changes: 2 additions & 1 deletion evm-utils/subchain-manager/src/implementation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ impl genesis_json::GenesisConfig {
let simulation = client.simulate_transaction(&transaction)?;
if let Some(err) = simulation.value.err {
return Err(color_eyre::eyre::Error::msg(format!(
"Simulation error: {err}"
"Simulation error: {err}, logs: {:?}",
simulation.value.logs
)));
}

Expand Down
2 changes: 1 addition & 1 deletion ledger/src/bank_forks_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use {
self, BlockstoreProcessorError, CacheBlockMetaSender, ProcessOptions,
TransactionStatusSender,
},
evm::recoreder::EvmArchiveManagerSender,
evm::recorder::EvmArchiveManagerSender,
leader_schedule_cache::LeaderScheduleCache,
},
crossbeam_channel::unbounded,
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/blockstore_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use {
blockstore::Blockstore,
blockstore_db::BlockstoreError,
blockstore_meta::SlotMeta,
evm::recoreder::{EvmArchiveManagerRequest, EvmArchiveManagerSender, RecorderEntry},
evm::recorder::{EvmArchiveManagerRequest, EvmArchiveManagerSender, RecorderEntry},
leader_schedule_cache::LeaderScheduleCache,
token_balances::collect_token_balances,
},
Expand Down
Loading

0 comments on commit bbe2b80

Please sign in to comment.