@@ -237,12 +237,28 @@ impl Default for RocksdbConfigs {
237237 }
238238}
239239
240+ #[ derive( Clone , Copy , Debug , Eq , PartialEq , Serialize , Deserialize ) ]
241+ pub struct HotStateConfig {
242+ /// Max number of items in each shard.
243+ pub max_items_per_shard : usize ,
244+ }
245+
246+ impl Default for HotStateConfig {
247+ fn default ( ) -> Self {
248+ Self {
249+ max_items_per_shard : 250_000 ,
250+ }
251+ }
252+ }
253+
240254#[ derive( Clone , Debug , Deserialize , PartialEq , Serialize ) ]
241255#[ serde( default , deny_unknown_fields) ]
242256pub struct StorageConfig {
243257 pub backup_service_address : SocketAddr ,
244258 /// Top level directory to store the RocksDB
245259 pub dir : PathBuf ,
260+ /// Hot state configuration
261+ pub hot_state_config : HotStateConfig ,
246262 /// Storage pruning configuration
247263 pub storage_pruner_config : PrunerConfig ,
248264 /// Subdirectory for storage in tests only
@@ -406,6 +422,7 @@ impl Default for StorageConfig {
406422 StorageConfig {
407423 backup_service_address : SocketAddr :: new ( IpAddr :: V4 ( Ipv4Addr :: LOCALHOST ) , 6186 ) ,
408424 dir : PathBuf :: from ( "db" ) ,
425+ hot_state_config : HotStateConfig :: default ( ) ,
409426 // The prune window must at least out live a RPC request because its sub requests are
410427 // to return a consistent view of the DB at exactly same version. Considering a few
411428 // thousand TPS we are potentially going to achieve, and a few minutes a consistent view
0 commit comments