Skip to content

Commit 1123fc6

Browse files
committed
disable zk loading
1 parent 2826ccf commit 1123fc6

File tree

1 file changed

+31
-30
lines changed

1 file changed

+31
-30
lines changed

cmd/migration-checker/main.go

+31-30
Original file line numberDiff line numberDiff line change
@@ -246,40 +246,41 @@ func loadMPT(mptRoot common.Hash, top bool) chan map[string][]byte {
246246
}
247247

248248
func loadZkTrie(zkRoot common.Hash, top, paranoid bool) chan map[string][]byte {
249-
parallelismCutoffDepth := 8
250-
zkLeafMap := make(map[string][]byte, 1000)
251-
var zkLeafMutex sync.Mutex
252249
zkDone := make(chan map[string][]byte)
253-
go func() {
254-
loaderDbs := <-trieLoaders
255-
defer func() {
256-
trieLoaders <- loaderDbs
257-
}()
250+
/*
251+
parallelismCutoffDepth := 8
252+
zkLeafMap := make(map[string][]byte, 1000)
253+
var zkLeafMutex sync.Mutex
254+
go func() {
255+
loaderDbs := <-trieLoaders
256+
defer func() {
257+
trieLoaders <- loaderDbs
258+
}()
258259
259-
zkTrie, err := trie.NewZkTrie(zkRoot, trie.NewZktrieDatabaseFromTriedb(trie.NewDatabaseWithConfig(loaderDbs.zkDb, &trie.Config{Preimages: true})))
260-
panicOnError(err, zkRoot.Hex(), "failed to create zk trie")
260+
zkTrie, err := trie.NewZkTrie(zkRoot, trie.NewZktrieDatabaseFromTriedb(trie.NewDatabaseWithConfig(loaderDbs.zkDb, &trie.Config{Preimages: true})))
261+
panicOnError(err, zkRoot.Hex(), "failed to create zk trie")
261262
262-
zkTrie.CountLeaves(func(key, value []byte) {
263-
preimageKey := zkTrie.GetKey(key)
264-
if len(preimageKey) == 0 {
265-
panic(fmt.Sprintf("preimage not found zk trie %s", hex.EncodeToString(key)))
266-
}
263+
zkTrie.CountLeaves(func(key, value []byte) {
264+
preimageKey := zkTrie.GetKey(key)
265+
if len(preimageKey) == 0 {
266+
panic(fmt.Sprintf("preimage not found zk trie %s", hex.EncodeToString(key)))
267+
}
267268
268-
zkLeafMutex.Lock()
269-
zkLeafMap[string(dup(preimageKey))] = value
270-
zkLeafMutex.Unlock()
269+
zkLeafMutex.Lock()
270+
zkLeafMap[string(dup(preimageKey))] = value
271+
zkLeafMutex.Unlock()
271272
272-
if top && len(zkLeafMap)%10000 == 0 {
273-
fmt.Println("ZK Accounts Loaded:", len(zkLeafMap))
274-
}
275-
}, func(f func()) {
276-
tempDb := <-trieLoaders
277-
go func() {
278-
trieLoaders <- tempDb
279-
f()
280-
}()
281-
}, parallelismCutoffDepth, paranoid)
282-
zkDone <- zkLeafMap
283-
}()
273+
if top && len(zkLeafMap)%10000 == 0 {
274+
fmt.Println("ZK Accounts Loaded:", len(zkLeafMap))
275+
}
276+
}, func(f func()) {
277+
tempDb := <-trieLoaders
278+
go func() {
279+
trieLoaders <- tempDb
280+
f()
281+
}()
282+
}, parallelismCutoffDepth, paranoid)
283+
zkDone <- zkLeafMap
284+
}()*/
284285
return zkDone
285286
}

0 commit comments

Comments
 (0)