mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 10:50:44 +00:00
fix linter
This commit is contained in:
parent
1ffd8a1bcb
commit
9c1bb17859
3 changed files with 10 additions and 25 deletions
|
|
@ -262,8 +262,8 @@ func (cfg BlockChainConfig) WithNoAsyncFlush(on bool) *BlockChainConfig {
|
||||||
// triedbConfig derives the configures for trie database.
|
// triedbConfig derives the configures for trie database.
|
||||||
func (cfg *BlockChainConfig) triedbConfig(isVerkle bool) *triedb.Config {
|
func (cfg *BlockChainConfig) triedbConfig(isVerkle bool) *triedb.Config {
|
||||||
config := &triedb.Config{
|
config := &triedb.Config{
|
||||||
Preimages: cfg.Preimages,
|
Preimages: cfg.Preimages,
|
||||||
IsVerkle: isVerkle,
|
IsVerkle: isVerkle,
|
||||||
BinTrieGroupDepth: cfg.BinTrieGroupDepth,
|
BinTrieGroupDepth: cfg.BinTrieGroupDepth,
|
||||||
}
|
}
|
||||||
if cfg.StateScheme == rawdb.HashScheme {
|
if cfg.StateScheme == rawdb.HashScheme {
|
||||||
|
|
|
||||||
|
|
@ -332,21 +332,6 @@ func compareTreesWithResolver(t *testing.T, original, deserialized BinaryNode, r
|
||||||
return nil
|
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
|
// buildDeepTreeUnique builds a tree where each leaf has a unique hash based on its position
|
||||||
func buildDeepTreeUnique(depth, maxDepth, position int) BinaryNode {
|
func buildDeepTreeUnique(depth, maxDepth, position int) BinaryNode {
|
||||||
if depth == maxDepth {
|
if depth == maxDepth {
|
||||||
|
|
|
||||||
|
|
@ -31,11 +31,11 @@ import (
|
||||||
|
|
||||||
// Config defines all necessary options for database.
|
// Config defines all necessary options for database.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Preimages bool // Flag whether the preimage of node key is recorded
|
Preimages bool // Flag whether the preimage of node key is recorded
|
||||||
IsVerkle bool // Flag whether the db is holding a verkle tree
|
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)
|
BinTrieGroupDepth int // Number of levels per serialized group in binary trie (1-8, default 8)
|
||||||
HashDB *hashdb.Config // Configs for hash-based scheme
|
HashDB *hashdb.Config // Configs for hash-based scheme
|
||||||
PathDB *pathdb.Config // Configs for experimental path-based scheme
|
PathDB *pathdb.Config // Configs for experimental path-based scheme
|
||||||
}
|
}
|
||||||
|
|
||||||
// HashDefaults represents a config for using hash-based scheme with
|
// 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
|
// VerkleDefaults represents a config for holding verkle trie data
|
||||||
// using path-based scheme with default settings.
|
// using path-based scheme with default settings.
|
||||||
var VerkleDefaults = &Config{
|
var VerkleDefaults = &Config{
|
||||||
Preimages: false,
|
Preimages: false,
|
||||||
IsVerkle: true,
|
IsVerkle: true,
|
||||||
BinTrieGroupDepth: 8, // Default to byte-aligned groups
|
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
|
// backend defines the methods needed to access/update trie nodes in different
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue