@@ -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,23 @@ 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
+ })
50
58
panicOnError (err , "" , "failed to open zk db" )
51
- mptDb , err := leveldb .New (* mptDbPath , 1024 , 128 , "" , true )
59
+ mptDb , err := leveldb .NewCustom (* mptDbPath , "mptDb" , func (options * opt.Options ) {
60
+ // Set default options
61
+ options .ReadOnly = true
62
+ options .BlockCacher = opt .NoCacher
63
+ options .BlockCacheCapacity = 0
64
+ options .OpenFilesCacher = opt .NoCacher
65
+ options .OpenFilesCacheCapacity = 0
66
+ })
52
67
panicOnError (err , "" , "failed to open mpt db" )
53
68
54
69
zkRootHash := common .HexToHash (* zkRoot )
@@ -209,7 +224,7 @@ func checkStorageEquality(label string, _ *dbs, zkStorageBytes, mptStorageBytes
209
224
210
225
func loadMPT (mptTrie * trie.SecureTrie , parallel bool ) chan map [string ][]byte {
211
226
startKey := make ([]byte , 32 )
212
- workers := 1 << 5
227
+ workers := 1 << 6
213
228
if ! parallel {
214
229
workers = 1
215
230
}
0 commit comments