@@ -21,6 +21,7 @@ import (
21
21
"github.com/scroll-tech/go-ethereum/ethdb/leveldb"
22
22
"github.com/scroll-tech/go-ethereum/rlp"
23
23
"github.com/scroll-tech/go-ethereum/trie"
24
+ "github.com/syndtr/goleveldb/leveldb/opt"
24
25
)
25
26
26
27
var accountsDone atomic.Uint64
@@ -46,9 +47,25 @@ func main() {
46
47
log .Println (http .ListenAndServe ("0.0.0.0:6060" , nil ))
47
48
}()
48
49
49
- zkDb , err := leveldb .New (* zkDbPath , 1024 , 128 , "" , true )
50
+ zkDb , err := leveldb .NewCustom (* zkDbPath , "zkDb" , func (options * opt.Options ) {
51
+ // Set default options
52
+ options .ReadOnly = true
53
+ options .BlockCacher = opt .NoCacher
54
+ options .BlockCacheCapacity = 0
55
+ options .OpenFilesCacher = opt .NoCacher
56
+ options .OpenFilesCacheCapacity = 0
57
+ options .DisableBlockCache = true
58
+ })
50
59
panicOnError (err , "" , "failed to open zk db" )
51
- mptDb , err := leveldb .New (* mptDbPath , 1024 , 128 , "" , true )
60
+ mptDb , err := leveldb .NewCustom (* mptDbPath , "mptDb" , func (options * opt.Options ) {
61
+ // Set default options
62
+ options .ReadOnly = true
63
+ options .BlockCacher = opt .NoCacher
64
+ options .BlockCacheCapacity = 0
65
+ options .OpenFilesCacher = opt .NoCacher
66
+ options .OpenFilesCacheCapacity = 0
67
+ options .DisableBlockCache = true
68
+ })
52
69
panicOnError (err , "" , "failed to open mpt db" )
53
70
54
71
zkRootHash := common .HexToHash (* zkRoot )
@@ -209,7 +226,7 @@ func checkStorageEquality(label string, _ *dbs, zkStorageBytes, mptStorageBytes
209
226
210
227
func loadMPT (mptTrie * trie.SecureTrie , parallel bool ) chan map [string ][]byte {
211
228
startKey := make ([]byte , 32 )
212
- workers := 1 << 5
229
+ workers := 1 << 6
213
230
if ! parallel {
214
231
workers = 1
215
232
}
0 commit comments