@@ -237,12 +237,29 @@ impl Default for RocksdbConfigs {
237237 }
238238}
239239
240+ #[ derive( Clone , Copy , Debug , Eq , PartialEq , Serialize , Deserialize ) ]
241+ #[ serde( default , deny_unknown_fields) ]
242+ pub struct HotStateConfig {
243+ /// Max number of items in each shard.
244+ pub max_items_per_shard : usize ,
245+ }
246+
247+ impl Default for HotStateConfig {
248+ fn default ( ) -> Self {
249+ Self {
250+ max_items_per_shard : 250_000 ,
251+ }
252+ }
253+ }
254+
240255#[ derive( Clone , Debug , Deserialize , PartialEq , Serialize ) ]
241256#[ serde( default , deny_unknown_fields) ]
242257pub struct StorageConfig {
243258 pub backup_service_address : SocketAddr ,
244259 /// Top level directory to store the RocksDB
245260 pub dir : PathBuf ,
261+ /// Hot state configuration
262+ pub hot_state_config : HotStateConfig ,
246263 /// Storage pruning configuration
247264 pub storage_pruner_config : PrunerConfig ,
248265 /// Subdirectory for storage in tests only
@@ -406,6 +423,7 @@ impl Default for StorageConfig {
406423 StorageConfig {
407424 backup_service_address : SocketAddr :: new ( IpAddr :: V4 ( Ipv4Addr :: LOCALHOST ) , 6186 ) ,
408425 dir : PathBuf :: from ( "db" ) ,
426+ hot_state_config : HotStateConfig :: default ( ) ,
409427 // The prune window must at least out live a RPC request because its sub requests are
410428 // to return a consistent view of the DB at exactly same version. Considering a few
411429 // thousand TPS we are potentially going to achieve, and a few minutes a consistent view
0 commit comments