Blockchain cache pruning strategy (#3395)

* blockchain cache pruning strategy

* added some internal docs to cache_pruning_strategy

* Update core/client/db/src/cache/mod.rs

Co-Authored-By: DemiMarie-parity <48690212+DemiMarie-parity@users.noreply.github.com>
This commit is contained in:
Svyatoslav Nikolsky
2019-09-20 09:49:15 +03:00
committed by GitHub
parent d105d3f3a1
commit eba6dd73c6
20 changed files with 161 additions and 104 deletions
+15 -1
View File
@@ -21,7 +21,6 @@ use std::sync::Arc;
use sr_primitives::traits::{Block as BlockT, Header as HeaderT, NumberFor};
use sr_primitives::generic::BlockId;
use sr_primitives::Justification;
use consensus::well_known_cache_keys;
use crate::error::{Error, Result};
@@ -254,3 +253,18 @@ pub fn tree_route<Block: BlockT, F: Fn(BlockId<Block>) -> Result<<Block as Block
pivot,
})
}
/// A list of all well known keys in the blockchain cache.
pub mod well_known_cache_keys {
/// The type representing cache keys.
pub type Id = consensus::import_queue::CacheKeyId;
/// A list of authorities.
pub const AUTHORITIES: Id = *b"auth";
/// Current Epoch data.
pub const EPOCH: Id = *b"epch";
/// Changes trie configuration.
pub const CHANGES_TRIE_CONFIG: Id = *b"chtr";
}