This repository was archived by the owner on Nov 6, 2020. It is now read-only.
Commit 59167f3 1 parent 0f80b7b commit 59167f3 Copy full SHA for 59167f3
File tree 2 files changed +8
-6
lines changed
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -538,7 +538,7 @@ impl State {
538
538
let mut addresses = self . cache . borrow_mut ( ) ;
539
539
trace ! ( "Committing cache {:?} entries" , addresses. len( ) ) ;
540
540
for ( address, a) in addresses. drain ( ) . filter ( |& ( _, ref a) | a. state == AccountState :: Committed || a. state == AccountState :: CleanFresh ) {
541
- self . db . cache_account ( address, a. account , a. state == AccountState :: Committed ) ;
541
+ self . db . add_to_account_cache ( address, a. account , a. state == AccountState :: Committed ) ;
542
542
}
543
543
}
544
544
Original file line number Diff line number Diff line change @@ -38,7 +38,8 @@ pub const ACCOUNT_BLOOM_HASHCOUNT_KEY: &'static [u8] = b"account_hash_count";
38
38
struct AccountCache {
39
39
/// DB Account cache. `None` indicates that account is known to be missing.
40
40
accounts : LruCache < Address , Option < Account > > ,
41
- /// Accounts changed in recently committed blocks. Ordered by block number.
41
+ /// Information on the modifications in recently committed blocks; specifically which addresses
42
+ /// changed in which block. Ordered by block number.
42
43
modifications : VecDeque < BlockChanges > ,
43
44
}
44
45
@@ -69,11 +70,12 @@ struct BlockChanges {
69
70
}
70
71
71
72
/// State database abstraction.
72
- /// Manages shared global state cache.
73
+ /// Manages shared global state cache which reflects the canonical
74
+ /// state as it is on the disk. All the entries in the cache are clean.
73
75
/// A clone of `StateDB` may be created as canonical or not.
74
- /// For canonical clones cache changes are accumulated and applied
75
- /// on commit.
76
- /// For non-canonical clones cache is cleared on commit .
76
+ /// For canonical clones local cache is accumulated and applied
77
+ /// in `sync_cache`
78
+ /// For non-canonical clones local cache is dropped .
77
79
///
78
80
/// Global cache propagation.
79
81
/// After a `State` object has been committed to the trie it
You can’t perform that action at this time.
0 commit comments