mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 01:41:36 +00:00
fix linter
This commit is contained in:
parent
f0f1752249
commit
6098c40dfa
11 changed files with 25 additions and 27 deletions
|
|
@ -82,8 +82,8 @@ func TestBintrieConvert(t *testing.T) {
|
|||
defer srcTriedb2.Close()
|
||||
|
||||
destTriedb := triedb.NewDatabase(chaindb, &triedb.Config{
|
||||
IsUBT: true,
|
||||
PathDB: pathdb.Defaults,
|
||||
IsUBT: true,
|
||||
PathDB: pathdb.Defaults,
|
||||
})
|
||||
defer destTriedb.Close()
|
||||
|
||||
|
|
@ -190,8 +190,8 @@ func TestBintrieConvertDeleteSource(t *testing.T) {
|
|||
})
|
||||
|
||||
destTriedb := triedb.NewDatabase(chaindb, &triedb.Config{
|
||||
IsUBT: true,
|
||||
PathDB: pathdb.Defaults,
|
||||
IsUBT: true,
|
||||
PathDB: pathdb.Defaults,
|
||||
})
|
||||
|
||||
bt, err := bintrie.NewBinaryTrie(types.EmptyBinaryHash, destTriedb)
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@ var (
|
|||
LondonBlock: big.NewInt(0),
|
||||
Ethash: new(params.EthashConfig),
|
||||
ShanghaiTime: u64(0),
|
||||
UBTTime: u64(0),
|
||||
UBTTime: u64(0),
|
||||
TerminalTotalDifficulty: common.Big0,
|
||||
EnableUBTAtGenesis: true,
|
||||
EnableUBTAtGenesis: true,
|
||||
BlobScheduleConfig: ¶ms.BlobScheduleConfig{
|
||||
Verkle: params.DefaultPragueBlobConfig,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ func (cfg BlockChainConfig) WithNoAsyncFlush(on bool) *BlockChainConfig {
|
|||
func (cfg *BlockChainConfig) triedbConfig(isUBT bool) *triedb.Config {
|
||||
config := &triedb.Config{
|
||||
Preimages: cfg.Preimages,
|
||||
IsUBT: isUBT,
|
||||
IsUBT: isUBT,
|
||||
}
|
||||
if cfg.StateScheme == rawdb.HashScheme {
|
||||
config.HashDB = &hashdb.Config{
|
||||
|
|
|
|||
|
|
@ -136,8 +136,8 @@ func hashAlloc(ga *types.GenesisAlloc, isUBT bool) (common.Hash, error) {
|
|||
var config *triedb.Config
|
||||
if isUBT {
|
||||
config = &triedb.Config{
|
||||
PathDB: pathdb.Defaults,
|
||||
IsUBT: true,
|
||||
PathDB: pathdb.Defaults,
|
||||
IsUBT: true,
|
||||
}
|
||||
}
|
||||
// Create an ephemeral in-memory database for computing hash,
|
||||
|
|
@ -276,10 +276,10 @@ func (e *GenesisMismatchError) Error() string {
|
|||
|
||||
// ChainOverrides contains the changes to chain config.
|
||||
type ChainOverrides struct {
|
||||
OverrideOsaka *uint64
|
||||
OverrideBPO1 *uint64
|
||||
OverrideBPO2 *uint64
|
||||
OverrideUBT *uint64
|
||||
OverrideOsaka *uint64
|
||||
OverrideBPO1 *uint64
|
||||
OverrideBPO2 *uint64
|
||||
OverrideUBT *uint64
|
||||
}
|
||||
|
||||
// apply applies the chain overrides on the supplied chain config.
|
||||
|
|
|
|||
|
|
@ -285,9 +285,9 @@ func TestVerkleGenesisCommit(t *testing.T) {
|
|||
CancunTime: &verkleTime,
|
||||
PragueTime: &verkleTime,
|
||||
OsakaTime: &verkleTime,
|
||||
UBTTime: &verkleTime,
|
||||
UBTTime: &verkleTime,
|
||||
TerminalTotalDifficulty: big.NewInt(0),
|
||||
EnableUBTAtGenesis: true,
|
||||
EnableUBTAtGenesis: true,
|
||||
Ethash: nil,
|
||||
Clique: nil,
|
||||
BlobScheduleConfig: ¶ms.BlobScheduleConfig{
|
||||
|
|
@ -320,8 +320,8 @@ func TestVerkleGenesisCommit(t *testing.T) {
|
|||
config.NoAsyncFlush = true
|
||||
|
||||
triedb := triedb.NewDatabase(db, &triedb.Config{
|
||||
IsUBT: true,
|
||||
PathDB: &config,
|
||||
IsUBT: true,
|
||||
PathDB: &config,
|
||||
})
|
||||
block := genesis.MustCommit(db, triedb)
|
||||
if !bytes.Equal(block.Root().Bytes(), expected) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2017 The go-ethereum Authors
|
||||
// Copyright 2026 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
|
|
@ -26,8 +26,6 @@ import (
|
|||
)
|
||||
|
||||
// UBTDB is an implementation of Database interface for Universal Binary Tries.
|
||||
// It provides the same functionality as MPTDB but uses binary tries for state
|
||||
// storage instead of Merkle Patricia Tries.
|
||||
type UBTDB struct {
|
||||
triedb *triedb.Database
|
||||
codedb *CodeDB
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
|
|||
OverrideOsaka *uint64 `toml:",omitempty"`
|
||||
OverrideBPO1 *uint64 `toml:",omitempty"`
|
||||
OverrideBPO2 *uint64 `toml:",omitempty"`
|
||||
OverrideUBT *uint64 `toml:",omitempty"`
|
||||
OverrideUBT *uint64 `toml:",omitempty"`
|
||||
TxSyncDefaultTimeout time.Duration `toml:",omitempty"`
|
||||
TxSyncMaxTimeout time.Duration `toml:",omitempty"`
|
||||
RangeLimit uint64 `toml:",omitempty"`
|
||||
|
|
@ -174,7 +174,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
|
|||
OverrideOsaka *uint64 `toml:",omitempty"`
|
||||
OverrideBPO1 *uint64 `toml:",omitempty"`
|
||||
OverrideBPO2 *uint64 `toml:",omitempty"`
|
||||
OverrideUBT *uint64 `toml:",omitempty"`
|
||||
OverrideUBT *uint64 `toml:",omitempty"`
|
||||
TxSyncDefaultTimeout *time.Duration `toml:",omitempty"`
|
||||
TxSyncMaxTimeout *time.Duration `toml:",omitempty"`
|
||||
RangeLimit *uint64 `toml:",omitempty"`
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ func (t *BlockTest) Run(snapshotter bool, scheme string, witness bool, tracer *t
|
|||
db = rawdb.NewMemoryDatabase()
|
||||
tconf = &triedb.Config{
|
||||
Preimages: true,
|
||||
IsUBT: gspec.Config.UBTTime != nil && *gspec.Config.UBTTime <= gspec.Timestamp,
|
||||
IsUBT: gspec.Config.UBTTime != nil && *gspec.Config.UBTTime <= gspec.Timestamp,
|
||||
}
|
||||
)
|
||||
if scheme == rawdb.PathScheme || tconf.IsUBT {
|
||||
|
|
|
|||
|
|
@ -774,7 +774,7 @@ var Forks = map[string]*params.ChainConfig{
|
|||
MergeNetsplitBlock: big.NewInt(0),
|
||||
TerminalTotalDifficulty: big.NewInt(0),
|
||||
ShanghaiTime: u64(0),
|
||||
UBTTime: u64(0),
|
||||
UBTTime: u64(0),
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ type Database struct {
|
|||
// the shutdown to reject all following unexpected mutations.
|
||||
readOnly bool // Flag if database is opened in read only mode
|
||||
waitSync bool // Flag if database is deactivated due to initial state sync
|
||||
isUBT bool // Flag if database is used for verkle tree
|
||||
isUBT bool // Flag if database is used for verkle tree
|
||||
hasher nodeHasher // Trie node hasher
|
||||
|
||||
config *Config // Configuration for database
|
||||
|
|
@ -154,7 +154,7 @@ func New(diskdb ethdb.Database, config *Config, isUBT bool) *Database {
|
|||
|
||||
db := &Database{
|
||||
readOnly: config.ReadOnly,
|
||||
isUBT: isUBT,
|
||||
isUBT: isUBT,
|
||||
config: config,
|
||||
diskdb: diskdb,
|
||||
hasher: merkleNodeHasher,
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ type testerConfig struct {
|
|||
layers int // Number of state transitions to generate for
|
||||
enableIndex bool // Enable state history indexing or not
|
||||
journalDir string // Directory path for persisting journal files
|
||||
isUBT bool // Enables Verkle trie mode if true
|
||||
isUBT bool // Enables Verkle trie mode if true
|
||||
|
||||
writeBuffer *int // Optional, the size of memory allocated for write buffer
|
||||
trieCache *int // Optional, the size of memory allocated for trie cache
|
||||
|
|
|
|||
Loading…
Reference in a new issue