diff --git a/core/blockchain.go b/core/blockchain.go index b7329cad66..f8edbc3000 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -256,8 +256,8 @@ func (cfg BlockChainConfig) WithNoAsyncFlush(on bool) *BlockChainConfig { // triedbConfig derives the configures for trie database. func (cfg *BlockChainConfig) triedbConfig(isVerkle bool) *triedb.Config { config := &triedb.Config{ - Preimages: cfg.Preimages, - IsVerkle: isVerkle, + Preimages: cfg.Preimages, + IsVerkle: isVerkle, BinTrieGroupDepth: cfg.BinTrieGroupDepth, } if cfg.StateScheme == rawdb.HashScheme { diff --git a/trie/bintrie/group_debug_test.go b/trie/bintrie/group_debug_test.go index 87a8d6ea43..051d71daf1 100644 --- a/trie/bintrie/group_debug_test.go +++ b/trie/bintrie/group_debug_test.go @@ -332,21 +332,6 @@ func compareTreesWithResolver(t *testing.T, original, deserialized BinaryNode, r return nil } -func buildDeepTree(depth, maxDepth int) BinaryNode { - if depth == maxDepth { - // Create a unique hash for this leaf position - var h common.Hash - h[0] = byte(depth) - h[1] = byte(depth >> 8) - return HashedNode(h) - } - return &InternalNode{ - depth: depth, - left: buildDeepTree(depth+1, maxDepth), - right: buildDeepTree(depth+1, maxDepth), - } -} - // buildDeepTreeUnique builds a tree where each leaf has a unique hash based on its position func buildDeepTreeUnique(depth, maxDepth, position int) BinaryNode { if depth == maxDepth { diff --git a/triedb/database.go b/triedb/database.go index 5ea3c62e6c..b0e218044d 100644 --- a/triedb/database.go +++ b/triedb/database.go @@ -31,11 +31,11 @@ import ( // Config defines all necessary options for database. type Config struct { - Preimages bool // Flag whether the preimage of node key is recorded - IsVerkle bool // Flag whether the db is holding a verkle tree - BinTrieGroupDepth int // Number of levels per serialized group in binary trie (1-8, default 8) - HashDB *hashdb.Config // Configs for hash-based scheme - PathDB *pathdb.Config // Configs for experimental path-based scheme + Preimages bool // Flag whether the preimage of node key is recorded + IsVerkle bool // Flag whether the db is holding a verkle tree + BinTrieGroupDepth int // Number of levels per serialized group in binary trie (1-8, default 8) + HashDB *hashdb.Config // Configs for hash-based scheme + PathDB *pathdb.Config // Configs for experimental path-based scheme } // HashDefaults represents a config for using hash-based scheme with @@ -49,10 +49,10 @@ var HashDefaults = &Config{ // VerkleDefaults represents a config for holding verkle trie data // using path-based scheme with default settings. var VerkleDefaults = &Config{ - Preimages: false, - IsVerkle: true, + Preimages: false, + IsVerkle: true, BinTrieGroupDepth: 8, // Default to byte-aligned groups - PathDB: pathdb.Defaults, + PathDB: pathdb.Defaults, } // backend defines the methods needed to access/update trie nodes in different