mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 20:31:13 +00:00
Document more TODOs as tickets (#1418)
Went through the TODOs, removed a bunch, which are outdated or nothing more than a regular comment, documented a bunch more as actual tickets and made them FIXMEs and unified their structure (`FIXME #TICKETNO DESC` for local tickets, `FIXME: DESC LINK` for external tickets) for easier in-editor support. Further more remove unnecessary remarks and related old code that I noticed in that instance.
This commit is contained in:
committed by
GitHub
parent
d2cfd7b9dc
commit
15ae7cfef6
@@ -307,7 +307,6 @@ where Block: BlockT<Hash=H256>,
|
||||
}
|
||||
|
||||
fn reset_storage(&mut self, mut top: StorageMap, children: ChildrenStorageMap) -> Result<H256, client::error::Error> {
|
||||
// TODO: wipe out existing trie.
|
||||
|
||||
if top.iter().any(|(k, _)| well_known_keys::is_child_storage_key(k)) {
|
||||
return Err(client::error::ErrorKind::GenesisInvalid.into());
|
||||
@@ -384,7 +383,7 @@ struct DbGenesisStorage(pub H256);
|
||||
impl DbGenesisStorage {
|
||||
pub fn new() -> Self {
|
||||
let mut root = H256::default();
|
||||
let mut mdb = MemoryDB::<Blake2Hasher>::default(); // TODO: use new() to make it more correct
|
||||
let mut mdb = MemoryDB::<Blake2Hasher>::default();
|
||||
state_machine::TrieDBMut::<Blake2Hasher>::new(&mut mdb, &mut root);
|
||||
DbGenesisStorage(root)
|
||||
}
|
||||
@@ -1024,7 +1023,7 @@ mod tests {
|
||||
|
||||
fn prepare_changes(changes: Vec<(Vec<u8>, Vec<u8>)>) -> (H256, MemoryDB<Blake2Hasher>) {
|
||||
let mut changes_root = H256::default();
|
||||
let mut changes_trie_update = MemoryDB::<Blake2Hasher>::default(); // TODO: change to new() to make more correct
|
||||
let mut changes_trie_update = MemoryDB::<Blake2Hasher>::default();
|
||||
{
|
||||
let mut trie = TrieDBMut::<Blake2Hasher>::new(
|
||||
&mut changes_trie_update,
|
||||
|
||||
@@ -341,7 +341,6 @@ impl<Block> LightBlockchainStorage<Block> for LightStorage<Block>
|
||||
// update block number to hash lookup entries.
|
||||
for retracted in tree_route.retracted() {
|
||||
if retracted.hash == meta.finalized_hash {
|
||||
// TODO: can we recover here?
|
||||
warn!("Safety failure: reverting finalized block {:?}",
|
||||
(&retracted.number, &retracted.hash));
|
||||
}
|
||||
@@ -438,7 +437,6 @@ impl<Block> LightBlockchainStorage<Block> for LightStorage<Block>
|
||||
fn finalize_header(&self, id: BlockId<Block>) -> ClientResult<()> {
|
||||
if let Some(header) = self.header(id)? {
|
||||
let mut transaction = DBTransaction::new();
|
||||
// TODO: ensure best chain contains this block.
|
||||
let hash = header.hash();
|
||||
let number = *header.number();
|
||||
self.note_finalized(&mut transaction, &header, hash.clone())?;
|
||||
|
||||
@@ -45,7 +45,7 @@ pub type SharedCache<B, H> = Arc<Mutex<Cache<B, H>>>;
|
||||
|
||||
/// Create new shared cache instance with given max memory usage.
|
||||
pub fn new_shared_cache<B: Block, H: Hasher>(shared_cache_size: usize) -> SharedCache<B, H> {
|
||||
let cache_items = shared_cache_size / 100; // Estimated average item size. TODO: more accurate tracking
|
||||
let cache_items = shared_cache_size / 100; // Guestimate, potentially inaccurate
|
||||
Arc::new(Mutex::new(Cache {
|
||||
storage: LruCache::new(cache_items),
|
||||
hashes: LruCache::new(cache_items),
|
||||
|
||||
Reference in New Issue
Block a user