core, ethdb, trie: mode dirty data to clean cache on flush (#19307)

This PR is a more advanced form of the dirty-to-clean cacher (#18995),
where we reuse previous database write batches as datasets to uncache,
saving a dirty-trie-iteration and a dirty-trie-rlp-reencoding per block.
This commit is contained in:
Martin Holst Swende
2019-03-26 15:48:31 +01:00
committed by Felix Lange
parent df717abc99
commit 59e1953246
12 changed files with 156 additions and 67 deletions

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// Package database defines the interfaces for an Ethereum data store.
// Package ethdb defines the interfaces for an Ethereum data store.
package ethdb
import "io"
@ -32,10 +32,7 @@ type Reader interface {
type Writer interface {
// Put inserts the given value into the key-value data store.
Put(key []byte, value []byte) error
}
// Deleter wraps the Delete method of a backing data store.
type Deleter interface {
// Delete removes the key from the key-value data store.
Delete(key []byte) error
}
@ -63,7 +60,6 @@ type Compacter interface {
type KeyValueStore interface {
Reader
Writer
Deleter
Batcher
Iteratee
Stater
@ -76,7 +72,6 @@ type KeyValueStore interface {
type Database interface {
Reader
Writer
Deleter
Batcher
Iteratee
Stater