cmd, core, eth, trie: get rid of trie cache generations (#19262)

* cmd, core, eth, trie: get rid of trie cache generations

* core, trie: get rid of remainder of cache gen boilerplate
This commit is contained in:
Péter Szilágyi
2019-03-14 15:25:12 +02:00
committed by GitHub
parent e270a753be
commit 91eec1251c
21 changed files with 100 additions and 332 deletions

View File

@@ -133,7 +133,7 @@ func testIterativeSync(t *testing.T, batch int) {
queue = append(queue[:0], sched.Missing(batch)...)
}
// Cross check that the two tries are in sync
checkTrieContents(t, triedb, srcTrie.Root(), srcData)
checkTrieContents(t, triedb, srcTrie.Hash().Bytes(), srcData)
}
// Tests that the trie scheduler can correctly reconstruct the state even if only
@@ -167,7 +167,7 @@ func TestIterativeDelayedSync(t *testing.T) {
queue = append(queue[len(results):], sched.Missing(10000)...)
}
// Cross check that the two tries are in sync
checkTrieContents(t, triedb, srcTrie.Root(), srcData)
checkTrieContents(t, triedb, srcTrie.Hash().Bytes(), srcData)
}
// Tests that given a root hash, a trie can sync iteratively on a single thread,
@@ -212,7 +212,7 @@ func testIterativeRandomSync(t *testing.T, batch int) {
}
}
// Cross check that the two tries are in sync
checkTrieContents(t, triedb, srcTrie.Root(), srcData)
checkTrieContents(t, triedb, srcTrie.Hash().Bytes(), srcData)
}
// Tests that the trie scheduler can correctly reconstruct the state even if only
@@ -259,7 +259,7 @@ func TestIterativeRandomDelayedSync(t *testing.T) {
}
}
// Cross check that the two tries are in sync
checkTrieContents(t, triedb, srcTrie.Root(), srcData)
checkTrieContents(t, triedb, srcTrie.Hash().Bytes(), srcData)
}
// Tests that a trie sync will not request nodes multiple times, even if they
@@ -299,7 +299,7 @@ func TestDuplicateAvoidanceSync(t *testing.T) {
queue = append(queue[:0], sched.Missing(0)...)
}
// Cross check that the two tries are in sync
checkTrieContents(t, triedb, srcTrie.Root(), srcData)
checkTrieContents(t, triedb, srcTrie.Hash().Bytes(), srcData)
}
// Tests that at any point in time during a sync, only complete sub-tries are in