fix linter

This commit is contained in:
Guillaume Ballet 2026-04-13 09:49:11 +02:00
parent f0f1752249
commit 6098c40dfa
11 changed files with 25 additions and 27 deletions

View file

@ -82,8 +82,8 @@ func TestBintrieConvert(t *testing.T) {
defer srcTriedb2.Close() defer srcTriedb2.Close()
destTriedb := triedb.NewDatabase(chaindb, &triedb.Config{ destTriedb := triedb.NewDatabase(chaindb, &triedb.Config{
IsUBT: true, IsUBT: true,
PathDB: pathdb.Defaults, PathDB: pathdb.Defaults,
}) })
defer destTriedb.Close() defer destTriedb.Close()
@ -190,8 +190,8 @@ func TestBintrieConvertDeleteSource(t *testing.T) {
}) })
destTriedb := triedb.NewDatabase(chaindb, &triedb.Config{ destTriedb := triedb.NewDatabase(chaindb, &triedb.Config{
IsUBT: true, IsUBT: true,
PathDB: pathdb.Defaults, PathDB: pathdb.Defaults,
}) })
bt, err := bintrie.NewBinaryTrie(types.EmptyBinaryHash, destTriedb) bt, err := bintrie.NewBinaryTrie(types.EmptyBinaryHash, destTriedb)

View file

@ -51,9 +51,9 @@ var (
LondonBlock: big.NewInt(0), LondonBlock: big.NewInt(0),
Ethash: new(params.EthashConfig), Ethash: new(params.EthashConfig),
ShanghaiTime: u64(0), ShanghaiTime: u64(0),
UBTTime: u64(0), UBTTime: u64(0),
TerminalTotalDifficulty: common.Big0, TerminalTotalDifficulty: common.Big0,
EnableUBTAtGenesis: true, EnableUBTAtGenesis: true,
BlobScheduleConfig: &params.BlobScheduleConfig{ BlobScheduleConfig: &params.BlobScheduleConfig{
Verkle: params.DefaultPragueBlobConfig, Verkle: params.DefaultPragueBlobConfig,
}, },

View file

@ -261,7 +261,7 @@ func (cfg BlockChainConfig) WithNoAsyncFlush(on bool) *BlockChainConfig {
func (cfg *BlockChainConfig) triedbConfig(isUBT bool) *triedb.Config { func (cfg *BlockChainConfig) triedbConfig(isUBT bool) *triedb.Config {
config := &triedb.Config{ config := &triedb.Config{
Preimages: cfg.Preimages, Preimages: cfg.Preimages,
IsUBT: isUBT, IsUBT: isUBT,
} }
if cfg.StateScheme == rawdb.HashScheme { if cfg.StateScheme == rawdb.HashScheme {
config.HashDB = &hashdb.Config{ config.HashDB = &hashdb.Config{

View file

@ -136,8 +136,8 @@ func hashAlloc(ga *types.GenesisAlloc, isUBT bool) (common.Hash, error) {
var config *triedb.Config var config *triedb.Config
if isUBT { if isUBT {
config = &triedb.Config{ config = &triedb.Config{
PathDB: pathdb.Defaults, PathDB: pathdb.Defaults,
IsUBT: true, IsUBT: true,
} }
} }
// Create an ephemeral in-memory database for computing hash, // 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. // ChainOverrides contains the changes to chain config.
type ChainOverrides struct { type ChainOverrides struct {
OverrideOsaka *uint64 OverrideOsaka *uint64
OverrideBPO1 *uint64 OverrideBPO1 *uint64
OverrideBPO2 *uint64 OverrideBPO2 *uint64
OverrideUBT *uint64 OverrideUBT *uint64
} }
// apply applies the chain overrides on the supplied chain config. // apply applies the chain overrides on the supplied chain config.

View file

@ -285,9 +285,9 @@ func TestVerkleGenesisCommit(t *testing.T) {
CancunTime: &verkleTime, CancunTime: &verkleTime,
PragueTime: &verkleTime, PragueTime: &verkleTime,
OsakaTime: &verkleTime, OsakaTime: &verkleTime,
UBTTime: &verkleTime, UBTTime: &verkleTime,
TerminalTotalDifficulty: big.NewInt(0), TerminalTotalDifficulty: big.NewInt(0),
EnableUBTAtGenesis: true, EnableUBTAtGenesis: true,
Ethash: nil, Ethash: nil,
Clique: nil, Clique: nil,
BlobScheduleConfig: &params.BlobScheduleConfig{ BlobScheduleConfig: &params.BlobScheduleConfig{
@ -320,8 +320,8 @@ func TestVerkleGenesisCommit(t *testing.T) {
config.NoAsyncFlush = true config.NoAsyncFlush = true
triedb := triedb.NewDatabase(db, &triedb.Config{ triedb := triedb.NewDatabase(db, &triedb.Config{
IsUBT: true, IsUBT: true,
PathDB: &config, PathDB: &config,
}) })
block := genesis.MustCommit(db, triedb) block := genesis.MustCommit(db, triedb)
if !bytes.Equal(block.Root().Bytes(), expected) { if !bytes.Equal(block.Root().Bytes(), expected) {

View file

@ -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. // This file is part of the go-ethereum library.
// //
// The go-ethereum library is free software: you can redistribute it and/or modify // 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. // 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 { type UBTDB struct {
triedb *triedb.Database triedb *triedb.Database
codedb *CodeDB codedb *CodeDB

View file

@ -64,7 +64,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
OverrideOsaka *uint64 `toml:",omitempty"` OverrideOsaka *uint64 `toml:",omitempty"`
OverrideBPO1 *uint64 `toml:",omitempty"` OverrideBPO1 *uint64 `toml:",omitempty"`
OverrideBPO2 *uint64 `toml:",omitempty"` OverrideBPO2 *uint64 `toml:",omitempty"`
OverrideUBT *uint64 `toml:",omitempty"` OverrideUBT *uint64 `toml:",omitempty"`
TxSyncDefaultTimeout time.Duration `toml:",omitempty"` TxSyncDefaultTimeout time.Duration `toml:",omitempty"`
TxSyncMaxTimeout time.Duration `toml:",omitempty"` TxSyncMaxTimeout time.Duration `toml:",omitempty"`
RangeLimit uint64 `toml:",omitempty"` RangeLimit uint64 `toml:",omitempty"`
@ -174,7 +174,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
OverrideOsaka *uint64 `toml:",omitempty"` OverrideOsaka *uint64 `toml:",omitempty"`
OverrideBPO1 *uint64 `toml:",omitempty"` OverrideBPO1 *uint64 `toml:",omitempty"`
OverrideBPO2 *uint64 `toml:",omitempty"` OverrideBPO2 *uint64 `toml:",omitempty"`
OverrideUBT *uint64 `toml:",omitempty"` OverrideUBT *uint64 `toml:",omitempty"`
TxSyncDefaultTimeout *time.Duration `toml:",omitempty"` TxSyncDefaultTimeout *time.Duration `toml:",omitempty"`
TxSyncMaxTimeout *time.Duration `toml:",omitempty"` TxSyncMaxTimeout *time.Duration `toml:",omitempty"`
RangeLimit *uint64 `toml:",omitempty"` RangeLimit *uint64 `toml:",omitempty"`

View file

@ -126,7 +126,7 @@ func (t *BlockTest) Run(snapshotter bool, scheme string, witness bool, tracer *t
db = rawdb.NewMemoryDatabase() db = rawdb.NewMemoryDatabase()
tconf = &triedb.Config{ tconf = &triedb.Config{
Preimages: true, 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 { if scheme == rawdb.PathScheme || tconf.IsUBT {

View file

@ -774,7 +774,7 @@ var Forks = map[string]*params.ChainConfig{
MergeNetsplitBlock: big.NewInt(0), MergeNetsplitBlock: big.NewInt(0),
TerminalTotalDifficulty: big.NewInt(0), TerminalTotalDifficulty: big.NewInt(0),
ShanghaiTime: u64(0), ShanghaiTime: u64(0),
UBTTime: u64(0), UBTTime: u64(0),
}, },
} }

View file

@ -127,7 +127,7 @@ type Database struct {
// the shutdown to reject all following unexpected mutations. // the shutdown to reject all following unexpected mutations.
readOnly bool // Flag if database is opened in read only mode readOnly bool // Flag if database is opened in read only mode
waitSync bool // Flag if database is deactivated due to initial state sync 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 hasher nodeHasher // Trie node hasher
config *Config // Configuration for database config *Config // Configuration for database
@ -154,7 +154,7 @@ func New(diskdb ethdb.Database, config *Config, isUBT bool) *Database {
db := &Database{ db := &Database{
readOnly: config.ReadOnly, readOnly: config.ReadOnly,
isUBT: isUBT, isUBT: isUBT,
config: config, config: config,
diskdb: diskdb, diskdb: diskdb,
hasher: merkleNodeHasher, hasher: merkleNodeHasher,

View file

@ -143,7 +143,7 @@ type testerConfig struct {
layers int // Number of state transitions to generate for layers int // Number of state transitions to generate for
enableIndex bool // Enable state history indexing or not enableIndex bool // Enable state history indexing or not
journalDir string // Directory path for persisting journal files 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 writeBuffer *int // Optional, the size of memory allocated for write buffer
trieCache *int // Optional, the size of memory allocated for trie cache trieCache *int // Optional, the size of memory allocated for trie cache