You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since no functions in trie\database.go are used as the current middle layer for MT to submit data to Disk, all instances of TrieDB are theoretically useless.
Also, since the structure of MT nodes is different from that of the original MPT, the functions of reference counting in trie\database.go are invalid.
But there are still a lot of functions calls to trie\database.go in the codebase.
For example, in the core/blockchain.go , NewBlockChain function creates an instance of trie\database.go\Database. And this instance is called multiple times in the core/blockchain.go , such as:
Fortunately, since MT has not submitted any data to this instance, its dirties array is always empty. Therefore, the relevant call is always a direct return, which is why the current code works without problems.
If we want to support both MPT and MT, these areas may need some attention.
The text was updated successfully, but these errors were encountered:
trie\database.go
are used as the current middle layer for MT to submit data to Disk, all instances of TrieDB are theoretically useless.trie\database.go
are invalid.But there are still a lot of functions calls to
trie\database.go
in the codebase.For example, in the
core/blockchain.go
,NewBlockChain
function creates an instance oftrie\database.go\Database
. And this instance is called multiple times in thecore/blockchain.go
, such as:triedb := bc.stateCache.TrieDB()
Even some function about reference counting of nodes is called, we can find it in this line: https://github.com/scroll-tech/go-ethereum/blob/zkrollup-smt/core/blockchain.go#L1243.
Fortunately, since MT has not submitted any data to this instance, its dirties array is always empty. Therefore, the relevant call is always a direct return, which is why the current code works without problems.
If we want to support both MPT and MT, these areas may need some attention.
The text was updated successfully, but these errors were encountered: