mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
fix linter
This commit is contained in:
parent
ce97e11b94
commit
48a53146f1
3 changed files with 10 additions and 25 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue