mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 15:51:12 +00:00
Configurable state cache size and enforce exact state cache size (#2314)
* Allow configuring state cache size via cli * Track used cache size * Expose memory counter to informant * Enforce max cache size constraint exactly * Default to 64 MiB Co-Authored-By: cmichi <mich@elmueller.net> * Remove self as parameter
This commit is contained in:
committed by
Gavin Wood
parent
3f06fe32f3
commit
c6d15e2cea
@@ -141,6 +141,8 @@ pub trait Backend<Block, H>: AuxStore + Send + Sync where
|
||||
fn finalize_block(&self, block: BlockId<Block>, justification: Option<Justification>) -> error::Result<()>;
|
||||
/// Returns reference to blockchain backend.
|
||||
fn blockchain(&self) -> &Self::Blockchain;
|
||||
/// Returns the used state cache, if existent.
|
||||
fn used_state_cache_size(&self) -> Option<usize>;
|
||||
/// Returns reference to changes trie storage.
|
||||
fn changes_trie_storage(&self) -> Option<&Self::ChangesTrieStorage>;
|
||||
/// Returns true if state for given block is available.
|
||||
|
||||
@@ -651,6 +651,10 @@ where
|
||||
&self.blockchain
|
||||
}
|
||||
|
||||
fn used_state_cache_size(&self) -> Option<usize> {
|
||||
None
|
||||
}
|
||||
|
||||
fn changes_trie_storage(&self) -> Option<&Self::ChangesTrieStorage> {
|
||||
Some(&self.changes_trie_storage)
|
||||
}
|
||||
|
||||
@@ -183,6 +183,10 @@ impl<S, F, Block, H> ClientBackend<Block, H> for Backend<S, F, H> where
|
||||
&self.blockchain
|
||||
}
|
||||
|
||||
fn used_state_cache_size(&self) -> Option<usize> {
|
||||
None
|
||||
}
|
||||
|
||||
fn changes_trie_storage(&self) -> Option<&Self::ChangesTrieStorage> {
|
||||
None
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user