diff --git a/core/state/database.go b/core/state/database.go index 34a4c355ae..4b344bd1d2 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -164,9 +164,9 @@ func NewDatabaseWithConfig(db ethdb.Database, config *triedb.Config) Database { wasmdb, wasmTag := db.WasmDataBase() cdb := &cachingDB{ // Arbitrum only - activatedAsmCache: lru.NewSizeConstrainedCache[activatedAsmCacheKey, []byte](activatedWasmCacheSize), - wasmTag: wasmTag, - wasmTargetsRetriever: db, + activatedAsmCache: lru.NewSizeConstrainedCache[activatedAsmCacheKey, []byte](activatedWasmCacheSize), + wasmTag: wasmTag, + wasmDatabaseRetriever: db, disk: db, wasmdb: wasmdb, @@ -182,9 +182,9 @@ func NewDatabaseWithNodeDB(db ethdb.Database, triedb *triedb.Database) Database wasmdb, wasmTag := db.WasmDataBase() cdb := &cachingDB{ // Arbitrum only - activatedAsmCache: lru.NewSizeConstrainedCache[activatedAsmCacheKey, []byte](activatedWasmCacheSize), - wasmTag: wasmTag, - wasmTargetsRetriever: db, + activatedAsmCache: lru.NewSizeConstrainedCache[activatedAsmCacheKey, []byte](activatedWasmCacheSize), + wasmTag: wasmTag, + wasmDatabaseRetriever: db, disk: db, wasmdb: wasmdb, @@ -202,9 +202,9 @@ type activatedAsmCacheKey struct { type cachingDB struct { // Arbitrum - activatedAsmCache *lru.SizeConstrainedCache[activatedAsmCacheKey, []byte] - wasmTag uint32 - wasmTargetsRetriever ethdb.WasmTargetsRetriever + activatedAsmCache *lru.SizeConstrainedCache[activatedAsmCacheKey, []byte] + wasmTag uint32 + wasmDatabaseRetriever ethdb.WasmDataBaseRetriever disk ethdb.KeyValueStore wasmdb ethdb.KeyValueStore @@ -222,7 +222,7 @@ func (db *cachingDB) WasmCacheTag() uint32 { } func (db *cachingDB) WasmTargets() []ethdb.WasmTarget { - return db.wasmTargetsRetriever.WasmTargets() + return db.wasmDatabaseRetriever.WasmTargets() } // OpenTrie opens the main account trie at a specific root hash. diff --git a/ethdb/database.go b/ethdb/database.go index 14b60cc674..e846767243 100644 --- a/ethdb/database.go +++ b/ethdb/database.go @@ -178,12 +178,9 @@ type AncientStore interface { io.Closer } +type WasmTarget string type WasmDataBaseRetriever interface { WasmDataBase() (KeyValueStore, uint32) -} - -type WasmTarget string -type WasmTargetsRetriever interface { WasmTargets() []WasmTarget } @@ -199,5 +196,4 @@ type Database interface { Snapshotter io.Closer WasmDataBaseRetriever - WasmTargetsRetriever }