Clarified counters

This commit is contained in:
arkpar 2016-02-07 11:50:56 +01:00
parent f2ed89be46
commit b2f69a08ca

View File

@ -106,10 +106,12 @@ impl JournalDB {
// we remove all of its removes assuming it is canonical and all // we remove all of its removes assuming it is canonical and all
// of its inserts otherwise. // of its inserts otherwise.
// //
// we also keep track of the counters for each key inserted in the journal to handle the following cases: // we also keep track of the counters for each key inserted in the journal to handle
// key K is removed in block A(N) and re-inserted in block B(N + C) (where C < H). K must not be deleted from the DB. // the following cases where key K must not be deleted from the DB:
// key K is added in block A(N) and reverted in block B(N + C) (where C < H). K must be deleted // Given H is the journal size in eras, 0 <= C <= H.
// key K is added in blocks A(N) and A'(N) and is reverted in block B(N + C ) (where C < H). K must not be deleted // Key K is removed in era A(N) and re-inserted in canonical era B(N + C).
// Key K is removed in era A(N) and re-inserted in non-canonical era B`(N + C).
// Key K is added in canonical era A(N) and non-canonicnal B'(N + C).
// record new commit's details. // record new commit's details.
let batch = WriteBatch::new(); let batch = WriteBatch::new();