Skip to content

Commit 4cd7cb3

Browse files
committed
resolve merge conflict
2 parents cf6a315 + 55a46c3 commit 4cd7cb3

File tree

93 files changed

+1101
-570
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+1101
-570
lines changed

accounts/usbwallet/trezor/trezor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
// This file contains the implementation for interacting with the Trezor hardware
1818
// wallets. The wire protocol spec can be found on the SatoshiLabs website:
19-
// https://wiki.trezor.io/Developers_guide-Message_Workflows
19+
// https://docs.trezor.io/trezor-firmware/common/message-workflows.html
2020

2121
// !!! STAHP !!!
2222
//

build/ci.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,13 @@ var (
121121
// Note: vivid is unsupported because there is no golang-1.6 package for it.
122122
// Note: the following Ubuntu releases have been officially deprecated on Launchpad:
123123
// wily, yakkety, zesty, artful, cosmic, disco, eoan, groovy, hirsuite, impish,
124-
// kinetic
124+
// kinetic, lunar
125125
debDistroGoBoots = map[string]string{
126126
"trusty": "golang-1.11", // 14.04, EOL: 04/2024
127127
"xenial": "golang-go", // 16.04, EOL: 04/2026
128128
"bionic": "golang-go", // 18.04, EOL: 04/2028
129129
"focal": "golang-go", // 20.04, EOL: 04/2030
130130
"jammy": "golang-go", // 22.04, EOL: 04/2032
131-
"lunar": "golang-go", // 23.04, EOL: 01/2024
132131
"mantic": "golang-go", // 23.10, EOL: 07/2024
133132
}
134133

cmd/evm/internal/t8ntool/execution.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import (
3636
"github.com/ethereum/go-ethereum/params"
3737
"github.com/ethereum/go-ethereum/rlp"
3838
"github.com/ethereum/go-ethereum/trie"
39+
"github.com/ethereum/go-ethereum/triedb"
3940
"github.com/holiman/uint256"
4041
"golang.org/x/crypto/sha3"
4142
)
@@ -364,7 +365,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
364365
}
365366

366367
func MakePreState(db ethdb.Database, accounts core.GenesisAlloc) *state.StateDB {
367-
sdb := state.NewDatabaseWithConfig(db, &trie.Config{Preimages: true})
368+
sdb := state.NewDatabaseWithConfig(db, &triedb.Config{Preimages: true})
368369
statedb, _ := state.New(types.EmptyRootHash, sdb, nil)
369370
for addr, a := range accounts {
370371
statedb.SetCode(addr, a.Code)

cmd/evm/runner.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ import (
3838
"github.com/ethereum/go-ethereum/eth/tracers/logger"
3939
"github.com/ethereum/go-ethereum/internal/flags"
4040
"github.com/ethereum/go-ethereum/params"
41-
"github.com/ethereum/go-ethereum/trie"
42-
"github.com/ethereum/go-ethereum/trie/triedb/hashdb"
41+
"github.com/ethereum/go-ethereum/triedb"
42+
"github.com/ethereum/go-ethereum/triedb/hashdb"
4343
"github.com/urfave/cli/v2"
4444
)
4545

@@ -148,7 +148,7 @@ func runCmd(ctx *cli.Context) error {
148148
}
149149

150150
db := rawdb.NewMemoryDatabase()
151-
triedb := trie.NewDatabase(db, &trie.Config{
151+
triedb := triedb.NewDatabase(db, &triedb.Config{
152152
Preimages: preimages,
153153
HashDB: hashdb.Defaults,
154154
})

cmd/utils/flags.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ import (
7070
"github.com/ethereum/go-ethereum/p2p/netutil"
7171
"github.com/ethereum/go-ethereum/params"
7272
"github.com/ethereum/go-ethereum/rpc"
73-
"github.com/ethereum/go-ethereum/trie"
74-
"github.com/ethereum/go-ethereum/trie/triedb/hashdb"
75-
"github.com/ethereum/go-ethereum/trie/triedb/pathdb"
73+
"github.com/ethereum/go-ethereum/triedb"
74+
"github.com/ethereum/go-ethereum/triedb/hashdb"
75+
"github.com/ethereum/go-ethereum/triedb/pathdb"
7676
pcsclite "github.com/gballet/go-libpcsclite"
7777
gopsutil "github.com/shirou/gopsutil/mem"
7878
"github.com/urfave/cli/v2"
@@ -2161,8 +2161,8 @@ func MakeConsolePreloads(ctx *cli.Context) []string {
21612161
}
21622162

21632163
// MakeTrieDatabase constructs a trie database based on the configured scheme.
2164-
func MakeTrieDatabase(ctx *cli.Context, disk ethdb.Database, preimage bool, readOnly bool, isVerkle bool) *trie.Database {
2165-
config := &trie.Config{
2164+
func MakeTrieDatabase(ctx *cli.Context, disk ethdb.Database, preimage bool, readOnly bool, isVerkle bool) *triedb.Database {
2165+
config := &triedb.Config{
21662166
Preimages: preimage,
21672167
IsVerkle: isVerkle,
21682168
}
@@ -2175,12 +2175,12 @@ func MakeTrieDatabase(ctx *cli.Context, disk ethdb.Database, preimage bool, read
21752175
// ignore the parameter silently. TODO(rjl493456442)
21762176
// please config it if read mode is implemented.
21772177
config.HashDB = hashdb.Defaults
2178-
return trie.NewDatabase(disk, config)
2178+
return triedb.NewDatabase(disk, config)
21792179
}
21802180
if readOnly {
21812181
config.PathDB = pathdb.ReadOnly
21822182
} else {
21832183
config.PathDB = pathdb.Defaults
21842184
}
2185-
return trie.NewDatabase(disk, config)
2185+
return triedb.NewDatabase(disk, config)
21862186
}

cmd/utils/history_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import (
3636
"github.com/ethereum/go-ethereum/internal/era"
3737
"github.com/ethereum/go-ethereum/params"
3838
"github.com/ethereum/go-ethereum/trie"
39+
"github.com/ethereum/go-ethereum/triedb"
3940
)
4041

4142
var (
@@ -134,7 +135,7 @@ func TestHistoryImportAndExport(t *testing.T) {
134135
for j := 0; it.Next(); j++ {
135136
n := i*int(step) + j
136137
if it.Error() != nil {
137-
t.Fatalf("error reading block entry %d: %v", n, err)
138+
t.Fatalf("error reading block entry %d: %v", n, it.Error())
138139
}
139140
block, receipts, err := it.BlockAndReceipts()
140141
if err != nil {
@@ -170,7 +171,7 @@ func TestHistoryImportAndExport(t *testing.T) {
170171
db2.Close()
171172
})
172173

173-
genesis.MustCommit(db2, trie.NewDatabase(db, trie.HashDefaults))
174+
genesis.MustCommit(db2, triedb.NewDatabase(db, triedb.HashDefaults))
174175
imported, err := core.NewBlockChain(db2, nil, genesis, nil, ethash.NewFaker(), vm.Config{}, nil, nil)
175176
if err != nil {
176177
t.Fatalf("unable to initialize chain: %v", err)

core/blockchain.go

+8-7
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ import (
4747
"github.com/ethereum/go-ethereum/metrics"
4848
"github.com/ethereum/go-ethereum/params"
4949
"github.com/ethereum/go-ethereum/rlp"
50-
"github.com/ethereum/go-ethereum/trie"
51-
"github.com/ethereum/go-ethereum/trie/triedb/hashdb"
52-
"github.com/ethereum/go-ethereum/trie/triedb/pathdb"
50+
"github.com/ethereum/go-ethereum/triedb"
51+
"github.com/ethereum/go-ethereum/triedb/hashdb"
52+
"github.com/ethereum/go-ethereum/triedb/pathdb"
5353
"golang.org/x/exp/slices"
5454
)
5555

@@ -149,8 +149,8 @@ type CacheConfig struct {
149149
}
150150

151151
// triedbConfig derives the configures for trie database.
152-
func (c *CacheConfig) triedbConfig() *trie.Config {
153-
config := &trie.Config{Preimages: c.Preimages}
152+
func (c *CacheConfig) triedbConfig() *triedb.Config {
153+
config := &triedb.Config{Preimages: c.Preimages}
154154
if c.StateScheme == rawdb.HashScheme {
155155
config.HashDB = &hashdb.Config{
156156
CleanCacheSize: c.TrieCleanLimit * 1024 * 1024,
@@ -235,7 +235,7 @@ type BlockChain struct {
235235
gcproc time.Duration // Accumulates canonical block processing for trie dumping
236236
lastWrite uint64 // Last block when the state was flushed
237237
flushInterval atomic.Int64 // Time interval (processing time) after which to flush a state
238-
triedb *trie.Database // The database handler for maintaining trie nodes.
238+
triedb *triedb.Database // The database handler for maintaining trie nodes.
239239
stateCache state.Database // State database to reuse between imports (contains state cache)
240240
txIndexer *txIndexer // Transaction indexer, might be nil if not enabled
241241

@@ -289,7 +289,7 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis
289289
cacheConfig = defaultCacheConfig
290290
}
291291
// Open trie database with provided config
292-
triedb := trie.NewDatabase(db, cacheConfig.triedbConfig())
292+
triedb := triedb.NewDatabase(db, cacheConfig.triedbConfig())
293293
var logger BlockchainLogger
294294
if vmConfig.Tracer != nil {
295295
l, ok := vmConfig.Tracer.(BlockchainLogger)
@@ -299,6 +299,7 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis
299299
log.Warn("only extended tracers are supported for live mode")
300300
}
301301
}
302+
302303
// Setup the genesis block, commit the provided genesis specification
303304
// to database if the genesis block is not present yet, or load the
304305
// stored one from database.

core/blockchain_reader.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
"github.com/ethereum/go-ethereum/event"
3131
"github.com/ethereum/go-ethereum/params"
3232
"github.com/ethereum/go-ethereum/rlp"
33-
"github.com/ethereum/go-ethereum/trie"
33+
"github.com/ethereum/go-ethereum/triedb"
3434
)
3535

3636
// CurrentHeader retrieves the current head header of the canonical chain. The
@@ -406,7 +406,7 @@ func (bc *BlockChain) TxIndexProgress() (TxIndexProgress, error) {
406406
}
407407

408408
// TrieDB retrieves the low level trie database used for data storage.
409-
func (bc *BlockChain) TrieDB() *trie.Database {
409+
func (bc *BlockChain) TrieDB() *triedb.Database {
410410
return bc.triedb
411411
}
412412

core/blockchain_sethead_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ import (
3434
"github.com/ethereum/go-ethereum/core/types"
3535
"github.com/ethereum/go-ethereum/core/vm"
3636
"github.com/ethereum/go-ethereum/params"
37-
"github.com/ethereum/go-ethereum/trie"
38-
"github.com/ethereum/go-ethereum/trie/triedb/hashdb"
39-
"github.com/ethereum/go-ethereum/trie/triedb/pathdb"
37+
"github.com/ethereum/go-ethereum/triedb"
38+
"github.com/ethereum/go-ethereum/triedb/hashdb"
39+
"github.com/ethereum/go-ethereum/triedb/pathdb"
4040
)
4141

4242
// rewindTest is a test case for chain rollback upon user request.
@@ -2033,13 +2033,13 @@ func testSetHeadWithScheme(t *testing.T, tt *rewindTest, snapshots bool, scheme
20332033
}
20342034
// Reopen the trie database without persisting in-memory dirty nodes.
20352035
chain.triedb.Close()
2036-
dbconfig := &trie.Config{}
2036+
dbconfig := &triedb.Config{}
20372037
if scheme == rawdb.PathScheme {
20382038
dbconfig.PathDB = pathdb.Defaults
20392039
} else {
20402040
dbconfig.HashDB = hashdb.Defaults
20412041
}
2042-
chain.triedb = trie.NewDatabase(chain.db, dbconfig)
2042+
chain.triedb = triedb.NewDatabase(chain.db, dbconfig)
20432043
chain.stateCache = state.NewDatabaseWithNodeDB(chain.db, chain.triedb)
20442044

20452045
// Force run a freeze cycle

core/chain_makers.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
"github.com/ethereum/go-ethereum/core/vm"
3232
"github.com/ethereum/go-ethereum/ethdb"
3333
"github.com/ethereum/go-ethereum/params"
34-
"github.com/ethereum/go-ethereum/trie"
34+
"github.com/ethereum/go-ethereum/triedb"
3535
"github.com/holiman/uint256"
3636
)
3737

@@ -312,7 +312,7 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, engine conse
312312
}
313313
cm := newChainMaker(parent, config, engine)
314314

315-
genblock := func(i int, parent *types.Block, triedb *trie.Database, statedb *state.StateDB) (*types.Block, types.Receipts) {
315+
genblock := func(i int, parent *types.Block, triedb *triedb.Database, statedb *state.StateDB) (*types.Block, types.Receipts) {
316316
b := &BlockGen{i: i, cm: cm, parent: parent, statedb: statedb, engine: engine}
317317
b.header = cm.makeHeader(parent, statedb, b.engine)
318318

@@ -362,7 +362,7 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, engine conse
362362
}
363363

364364
// Forcibly use hash-based state scheme for retaining all nodes in disk.
365-
triedb := trie.NewDatabase(db, trie.HashDefaults)
365+
triedb := triedb.NewDatabase(db, triedb.HashDefaults)
366366
defer triedb.Close()
367367

368368
for i := 0; i < n; i++ {
@@ -407,8 +407,7 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, engine conse
407407
// then generate chain on top.
408408
func GenerateChainWithGenesis(genesis *Genesis, engine consensus.Engine, n int, gen func(int, *BlockGen)) (ethdb.Database, []*types.Block, []types.Receipts) {
409409
db := rawdb.NewMemoryDatabase()
410-
411-
triedb := trie.NewDatabase(db, trie.HashDefaults)
410+
triedb := triedb.NewDatabase(db, triedb.HashDefaults)
412411
defer triedb.Close()
413412
_, err := genesis.Commit(db, triedb)
414413
if err != nil {

core/chain_makers_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
"github.com/ethereum/go-ethereum/core/vm"
3232
"github.com/ethereum/go-ethereum/crypto"
3333
"github.com/ethereum/go-ethereum/params"
34-
"github.com/ethereum/go-ethereum/trie"
34+
"github.com/ethereum/go-ethereum/triedb"
3535
)
3636

3737
func TestGeneratePOSChain(t *testing.T) {
@@ -81,7 +81,7 @@ func TestGeneratePOSChain(t *testing.T) {
8181
Storage: storage,
8282
Code: common.Hex2Bytes("600154600354"),
8383
}
84-
genesis := gspec.MustCommit(gendb, trie.NewDatabase(gendb, trie.HashDefaults))
84+
genesis := gspec.MustCommit(gendb, triedb.NewDatabase(gendb, triedb.HashDefaults))
8585

8686
genchain, genreceipts := GenerateChain(gspec.Config, genesis, beacon.NewFaker(), gendb, 4, func(i int, gen *BlockGen) {
8787
gen.SetParentBeaconRoot(common.Hash{byte(i + 1)})
@@ -204,7 +204,7 @@ func ExampleGenerateChain() {
204204
Config: &params.ChainConfig{HomesteadBlock: new(big.Int)},
205205
Alloc: GenesisAlloc{addr1: {Balance: big.NewInt(1000000)}},
206206
}
207-
genesis := gspec.MustCommit(genDb, trie.NewDatabase(genDb, trie.HashDefaults))
207+
genesis := gspec.MustCommit(genDb, triedb.NewDatabase(genDb, triedb.HashDefaults))
208208

209209
// This call generates a chain of 5 blocks. The function runs for
210210
// each block and adds different features to gen based on the

0 commit comments

Comments
 (0)