Skip to content

Commit c933b5c

Browse files
committed
progress
1 parent 08a049b commit c933b5c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmd/migration-checker/main.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
)
2121

2222
var accountsDone atomic.Uint64
23+
var totalAccounts int
2324
var trieCheckers chan struct{}
2425

2526
type dbs struct {
@@ -115,6 +116,8 @@ func checkTrieEquality(dbs *dbs, zkRoot, mptRoot common.Hash, label string, leaf
115116

116117
if len(mptLeafs) != len(zkLeafs) {
117118
panic(fmt.Sprintf("%s MPT and ZK trie leaf count mismatch: MPT: %d, ZK: %d", label, len(mptLeafs), len(zkLeafs)))
119+
} else if top {
120+
totalAccounts = len(mptLeafs)
118121
}
119122

120123
for index, zkKv := range zkLeafs {
@@ -157,12 +160,12 @@ func checkAccountEquality(label string, dbs *dbs, zkAccountBytes, mptAccountByte
157160

158161
checkTrieEquality(dbs, zkRoot, mptRoot, label, checkStorageEquality, false, paranoid)
159162
accountsDone.Add(1)
160-
fmt.Println("Accounts done:", accountsDone.Load())
163+
fmt.Println("Accounts done:", accountsDone.Load(), "/", totalAccounts)
161164
trieCheckers <- struct{}{}
162165
}()
163166
} else {
164167
accountsDone.Add(1)
165-
fmt.Println("Accounts done:", accountsDone.Load())
168+
fmt.Println("Accounts done:", accountsDone.Load(), "/", totalAccounts)
166169
}
167170
}
168171

0 commit comments

Comments
 (0)