diff --git a/cmd/geth/bintrie_convert_test.go b/cmd/geth/bintrie_convert_test.go index 5a5fa495fa..50ae752358 100644 --- a/cmd/geth/bintrie_convert_test.go +++ b/cmd/geth/bintrie_convert_test.go @@ -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) diff --git a/core/bintrie_witness_test.go b/core/bintrie_witness_test.go index 492fbdb833..110ea6759e 100644 --- a/core/bintrie_witness_test.go +++ b/core/bintrie_witness_test.go @@ -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, }, diff --git a/core/blockchain.go b/core/blockchain.go index e448bb3f3d..b01d56307b 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -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{ diff --git a/core/genesis.go b/core/genesis.go index 8c20cf1e8f..616945633d 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -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. diff --git a/core/genesis_test.go b/core/genesis_test.go index bb061b987b..92d1ee1a27 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -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) { diff --git a/core/state/database_ubt.go b/core/state/database_ubt.go index 3b2926c062..5a1e90f250 100644 --- a/core/state/database_ubt.go +++ b/core/state/database_ubt.go @@ -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 diff --git a/eth/ethconfig/gen_config.go b/eth/ethconfig/gen_config.go index 68a479ae62..ed85562f44 100644 --- a/eth/ethconfig/gen_config.go +++ b/eth/ethconfig/gen_config.go @@ -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"` diff --git a/tests/block_test_util.go b/tests/block_test_util.go index ee53aa60ed..bece8ae610 100644 --- a/tests/block_test_util.go +++ b/tests/block_test_util.go @@ -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 { diff --git a/tests/init.go b/tests/init.go index dc155d90e2..3db988a993 100644 --- a/tests/init.go +++ b/tests/init.go @@ -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), }, } diff --git a/triedb/pathdb/database.go b/triedb/pathdb/database.go index ec6f101a35..ffb1089aa7 100644 --- a/triedb/pathdb/database.go +++ b/triedb/pathdb/database.go @@ -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, diff --git a/triedb/pathdb/database_test.go b/triedb/pathdb/database_test.go index 4416670dac..8ceb22eaba 100644 --- a/triedb/pathdb/database_test.go +++ b/triedb/pathdb/database_test.go @@ -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