Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyan-gupta committed Sep 20, 2024
1 parent 0500671 commit 963b4fb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
2 changes: 0 additions & 2 deletions neard/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ impl RunCmd {
rpc_servers,
cold_store_loop_handle,
mut state_sync_dumper,
flat_state_migration_handle,
resharding_handle,
..
} = nearcore::start_with_config_and_synchronization(
Expand All @@ -557,7 +556,6 @@ impl RunCmd {
}
state_sync_dumper.stop();
resharding_handle.stop();
flat_state_migration_handle.stop();
futures::future::join_all(rpc_servers.iter().map(|(name, server)| async move {
server.stop(true).await;
debug!(target: "neard", "{} server stopped", name);
Expand Down
30 changes: 1 addition & 29 deletions tools/flat-storage/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ use near_primitives::shard_layout::{account_id_to_shard_id, ShardVersion};
use near_primitives::state::FlatStateValue;
use near_primitives::types::{BlockHeight, ShardId};
use near_store::flat::{
inline_flat_state_values, store_helper, FlatStateChanges, FlatStateDelta,
FlatStateDeltaMetadata, FlatStorageManager, FlatStorageStatus,
store_helper, FlatStateChanges, FlatStateDelta, FlatStateDeltaMetadata, FlatStorageStatus,
};
use near_store::{DBCol, Mode, NodeStorage, ShardUId, Store, StoreOpener};
use nearcore::{load_config, NearConfig, NightshadeRuntime, NightshadeRuntimeExt};
use std::collections::{HashMap, HashSet};
use std::sync::atomic::AtomicBool;
use std::{path::PathBuf, sync::Arc, time::Duration};
use tqdm::tqdm;

Expand Down Expand Up @@ -45,9 +43,6 @@ enum SubCommand {
/// storage is enabled only during nightly with separate DB version).
SetStoreVersion(SetStoreVersionCmd),

/// Run FlatState value inininig migration
MigrateValueInlining(MigrateValueInliningCmd),

/// Construct and store trie in a separate directory from flat storage state for a given shard.
/// The trie is constructed for the block height equal to flat_head
ConstructTrieFromFlat(ConstructTriedFromFlatCmd),
Expand Down Expand Up @@ -376,26 +371,6 @@ impl FlatStorageCommand {
Ok(())
}

fn migrate_value_inlining(
&self,
cmd: &MigrateValueInliningCmd,
home_dir: &PathBuf,
near_config: &NearConfig,
opener: StoreOpener,
) -> anyhow::Result<()> {
let store =
Self::get_db(&opener, home_dir, &near_config, near_store::Mode::ReadWriteExisting).4;
let flat_storage_manager = FlatStorageManager::new(store.clone());
inline_flat_state_values(
store,
&flat_storage_manager,
&AtomicBool::new(true),
cmd.num_threads,
cmd.batch_size,
);
Ok(())
}

fn construct_trie_from_flat(
&self,
cmd: &ConstructTriedFromFlatCmd,
Expand Down Expand Up @@ -648,9 +623,6 @@ impl FlatStorageCommand {
SubCommand::Reset(cmd) => self.reset(cmd, home_dir, &near_config, opener),
SubCommand::Init(cmd) => self.init(cmd, home_dir, &near_config, opener),
SubCommand::Verify(cmd) => self.verify(cmd, home_dir, &near_config, opener),
SubCommand::MigrateValueInlining(cmd) => {
self.migrate_value_inlining(cmd, home_dir, &near_config, opener)
}
SubCommand::ConstructTrieFromFlat(cmd) => {
self.construct_trie_from_flat(cmd, home_dir, &near_config, opener)
}
Expand Down

0 comments on commit 963b4fb

Please sign in to comment.