Skip to content

Commit

Permalink
feat: remove flat storage creation params from the config (near#10671)
Browse files Browse the repository at this point in the history
At this point we expect flat storage to be created everywhere, so these
params are no longer needed.
We still keep it as part of `ClientConfig`, it will be removed
separately along with the rest of creation-related code.
  • Loading branch information
pugachAG authored Feb 27, 2024
1 parent 4785206 commit f80b7af
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 35 deletions.
29 changes: 0 additions & 29 deletions core/store/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use crate::trie::{
};
use crate::DBCol;
use near_primitives::shard_layout::ShardUId;
use std::time::Duration;
use std::{collections::HashMap, iter::FromIterator};

#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
Expand Down Expand Up @@ -91,22 +90,6 @@ pub struct StoreConfig {
#[serde(skip_serializing_if = "MigrationSnapshot::is_default")]
pub migration_snapshot: MigrationSnapshot,

/// Number of threads to execute storage background migrations.
/// Needed to create flat storage which need to happen in parallel
/// with block processing.
/// TODO (#8826): remove, because creation successfully happened in 1.34.
pub background_migration_threads: usize,

/// Enables background flat storage creation.
/// TODO (#8826): remove, because creation successfully happened in 1.34.
pub flat_storage_creation_enabled: bool,

/// Duration to perform background flat storage creation step. Defines how
/// frequently we check creation status and execute work related to it in
/// main thread (scheduling and collecting state parts, catching up blocks, etc.).
/// TODO (#8826): remove, because creation successfully happened in 1.34.
pub flat_storage_creation_period: Duration,

/// State Snapshot configuration
pub state_snapshot_config: StateSnapshotConfig,

Expand Down Expand Up @@ -284,18 +267,6 @@ impl Default for StoreConfig {

migration_snapshot: Default::default(),

// We checked that this number of threads doesn't impact
// regular block processing significantly.
background_migration_threads: 8,

flat_storage_creation_enabled: true,

// It shouldn't be very low, because on single flat storage creation step
// we do several disk reads from `FlatStateMisc` and `FlatStateDeltas`.
// One second should be enough to save deltas on start and catch up
// flat storage head quickly. State read work is much more expensive.
flat_storage_creation_period: Duration::from_secs(1),

state_snapshot_config: Default::default(),

// TODO: To be phased out in favor of state_snapshot_config
Expand Down
6 changes: 3 additions & 3 deletions nearcore/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,9 +669,9 @@ impl NearConfig {
trie_viewer_state_size_limit: config.trie_viewer_state_size_limit,
max_gas_burnt_view: config.max_gas_burnt_view,
enable_statistics_export: config.store.enable_statistics_export,
client_background_migration_threads: config.store.background_migration_threads,
flat_storage_creation_enabled: config.store.flat_storage_creation_enabled,
flat_storage_creation_period: config.store.flat_storage_creation_period,
client_background_migration_threads: 8,
flat_storage_creation_enabled: false,
flat_storage_creation_period: Duration::from_secs(1),
state_sync_enabled: config.state_sync_enabled,
state_sync: config.state_sync.unwrap_or_default(),
transaction_pool_size_limit: config.transaction_pool_size_limit,
Expand Down
3 changes: 0 additions & 3 deletions tools/fork-network/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ impl ForkNetworkCommand {
.await
.global();

if !near_config.config.store.flat_storage_creation_enabled {
panic!("Flat storage must be enabled");
}
near_config.config.store.state_snapshot_enabled = false;

match &self.command {
Expand Down

0 comments on commit f80b7af

Please sign in to comment.