Skip to content

Commit 354f16d

Browse files
committed
Merge commit '37c0e6992e02190c4e6a3bc9d70c19967f8931db' into merge-v1.15.5
2 parents 7a82af6 + 37c0e69 commit 354f16d

Some content is hidden

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

41 files changed

+438
-483
lines changed

Diff for: .golangci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
run:
44
timeout: 20m
55
tests: true
6-
# default is true. Enables skipping of directories:
7-
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
8-
skip-dirs-use-default: true
96

107
linters:
118
disable-all: true
@@ -54,6 +51,9 @@ linters-settings:
5451
exclude: [""]
5552

5653
issues:
54+
# default is true. Enables skipping of directories:
55+
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
56+
exclude-dirs-use-default: true
5757
exclude-files:
5858
- core/genesis_alloc.go
5959
exclude-rules:

Diff for: README.md

+9-116
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ on how you can run your own `geth` instance.
5454

5555
Minimum:
5656

57-
* CPU with 2+ cores
58-
* 4GB RAM
57+
* CPU with 4+ cores
58+
* 8GB RAM
5959
* 1TB free storage space to sync the Mainnet
6060
* 8 MBit/sec download Internet service
6161

6262
Recommended:
6363

64-
* Fast CPU with 4+ cores
64+
* Fast CPU with 8+ cores
6565
* 16GB+ RAM
6666
* High-performance SSD with at least 1TB of free space
6767
* 25+ MBit/sec download Internet service
@@ -138,8 +138,6 @@ export your existing configuration:
138138
$ geth --your-favourite-flags dumpconfig
139139
```
140140

141-
*Note: This works only with `geth` v1.6.0 and above.*
142-
143141
#### Docker quick start
144142

145143
One of the quickest ways to get Ethereum up and running on your machine is by using
@@ -187,7 +185,6 @@ HTTP based JSON-RPC API options:
187185
* `--ws.api` API's offered over the WS-RPC interface (default: `eth,net,web3`)
188186
* `--ws.origins` Origins from which to accept WebSocket requests
189187
* `--ipcdisable` Disable the IPC-RPC server
190-
* `--ipcapi` API's offered over the IPC-RPC interface (default: `admin,debug,eth,miner,net,personal,txpool,web3`)
191188
* `--ipcpath` Filename for IPC socket/pipe within the datadir (explicit paths escape it)
192189

193190
You'll need to use your own programming environments' capabilities (libraries, tools, etc) to
@@ -206,118 +203,14 @@ APIs!**
206203
Maintaining your own private network is more involved as a lot of configurations taken for
207204
granted in the official networks need to be manually set up.
208205

209-
#### Defining the private genesis state
210-
211-
First, you'll need to create the genesis state of your networks, which all nodes need to be
212-
aware of and agree upon. This consists of a small JSON file (e.g. call it `genesis.json`):
213-
214-
```json
215-
{
216-
"config": {
217-
"chainId": <arbitrary positive integer>,
218-
"homesteadBlock": 0,
219-
"eip150Block": 0,
220-
"eip155Block": 0,
221-
"eip158Block": 0,
222-
"byzantiumBlock": 0,
223-
"constantinopleBlock": 0,
224-
"petersburgBlock": 0,
225-
"istanbulBlock": 0,
226-
"berlinBlock": 0,
227-
"londonBlock": 0
228-
},
229-
"alloc": {},
230-
"coinbase": "0x0000000000000000000000000000000000000000",
231-
"difficulty": "0x20000",
232-
"extraData": "",
233-
"gasLimit": "0x2fefd8",
234-
"nonce": "0x0000000000000042",
235-
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
236-
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
237-
"timestamp": "0x00"
238-
}
239-
```
240-
241-
The above fields should be fine for most purposes, although we'd recommend changing
242-
the `nonce` to some random value so you prevent unknown remote nodes from being able
243-
to connect to you. If you'd like to pre-fund some accounts for easier testing, create
244-
the accounts and populate the `alloc` field with their addresses.
245-
246-
```json
247-
"alloc": {
248-
"0x0000000000000000000000000000000000000001": {
249-
"balance": "111111111"
250-
},
251-
"0x0000000000000000000000000000000000000002": {
252-
"balance": "222222222"
253-
}
254-
}
255-
```
256-
257-
With the genesis state defined in the above JSON file, you'll need to initialize **every**
258-
`geth` node with it prior to starting it up to ensure all blockchain parameters are correctly
259-
set:
260-
261-
```shell
262-
$ geth init path/to/genesis.json
263-
```
264-
265-
#### Creating the rendezvous point
266-
267-
With all nodes that you want to run initialized to the desired genesis state, you'll need to
268-
start a bootstrap node that others can use to find each other in your network and/or over
269-
the internet. The clean way is to configure and run a dedicated bootnode:
270-
271-
```shell
272-
# Use the devp2p tool to create a node file.
273-
# The devp2p tool is also part of the 'alltools' distribution bundle.
274-
$ devp2p key generate node1.key
275-
# file node1.key is created.
276-
$ devp2p key to-enr -ip 10.2.3.4 -udp 30303 -tcp 30303 node1.key
277-
# Prints the ENR for use in --bootnode flag of other nodes.
278-
# Note this method requires knowing the IP/ports ahead of time.
279-
$ geth --nodekey=node1.key
280-
```
281-
282-
With the bootnode online, it will display an [`enode` URL](https://ethereum.org/en/developers/docs/networking-layer/network-addresses/#enode)
283-
that other nodes can use to connect to it and exchange peer information. Make sure to
284-
replace the displayed IP address information (most probably `[::]`) with your externally
285-
accessible IP to get the actual `enode` URL.
286-
287-
*Note: You could previously use the `bootnode` utility to start a stripped down version of geth. This is not possible anymore.*
288-
289-
#### Starting up your member nodes
290-
291-
With the bootnode operational and externally reachable (you can try
292-
`telnet <ip> <port>` to ensure it's indeed reachable), start every subsequent `geth`
293-
node pointed to the bootnode for peer discovery via the `--bootnodes` flag. It will
294-
probably also be desirable to keep the data directory of your private network separated, so
295-
do also specify a custom `--datadir` flag.
296-
297-
```shell
298-
$ geth --datadir=path/to/custom/data/folder --bootnodes=<bootnode-enode-url-from-above>
299-
```
206+
Unfortunately since [the Merge](https://ethereum.org/en/roadmap/merge/) it is no longer possible
207+
to easily set up a network of geth nodes without also setting up a corresponding beacon chain.
300208

301-
*Note: Since your network will be completely cut off from the main and test networks, you'll
302-
also need to configure a miner to process transactions and create new blocks for you.*
303-
304-
#### Running a private miner
305-
306-
307-
In a private network setting a single CPU miner instance is more than enough for
308-
practical purposes as it can produce a stable stream of blocks at the correct intervals
309-
without needing heavy resources (consider running on a single thread, no need for multiple
310-
ones either). To start a `geth` instance for mining, run it with all your usual flags, extended
311-
by:
312-
313-
```shell
314-
$ geth <usual-flags> --mine --miner.threads=1 --miner.etherbase=0x0000000000000000000000000000000000000000
315-
```
209+
There are three different solutions depending on your use case:
316210

317-
Which will start mining blocks and transactions on a single CPU thread, crediting all
318-
proceedings to the account specified by `--miner.etherbase`. You can further tune the mining
319-
by changing the default gas limit blocks converge to (`--miner.targetgaslimit`) and the price
320-
transactions are accepted at (`--miner.gasprice`).
211+
* If you are looking for a simple way to test smart contracts from go in your CI, you can use the [Simulated Backend](https://geth.ethereum.org/docs/developers/dapp-developer/native-bindings#blockchain-simulator).
212+
* If you want a convenient single node environment for testing, you can use our [Dev Mode](https://geth.ethereum.org/docs/developers/dapp-developer/dev-mode).
213+
* If you are looking for a multiple node test network, you can set one up quite easily with [Kurtosis](https://geth.ethereum.org/docs/fundamentals/kurtosis).
321214

322215
## Contribution
323216

Diff for: build/checksums.txt

+30-30
Original file line numberDiff line numberDiff line change
@@ -56,37 +56,37 @@ fc77c0531406d092c5356167e45c05a22d16bea84e3fa555e0f03af085c11763 go1.23.4.windo
5656
8347c1aa4e1e67954d12830f88dbe44bd7ac0ec134bb472783dbfb5a3a8865d0 go1.23.4.windows-arm64.msi
5757
db69cae5006753c785345c3215ad941f8b6224e2f81fec471c42d6857bee0e6f go1.23.4.windows-arm64.zip
5858

59-
# version:golangci 1.61.0
59+
# version:golangci 1.63.4
6060
# https://github.com/golangci/golangci-lint/releases/
61-
# https://github.com/golangci/golangci-lint/releases/download/v1.61.0/
62-
5c280ef3284f80c54fd90d73dc39ca276953949da1db03eb9dd0fbf868cc6e55 golangci-lint-1.61.0-darwin-amd64.tar.gz
63-
544334890701e4e04a6e574bc010bea8945205c08c44cced73745a6378012d36 golangci-lint-1.61.0-darwin-arm64.tar.gz
64-
e885a6f561092055930ebd298914d80e8fd2e10d2b1e9942836c2c6a115301fa golangci-lint-1.61.0-freebsd-386.tar.gz
65-
b13f6a3f11f65e7ff66b734d7554df3bbae0f485768848424e7554ed289e19c2 golangci-lint-1.61.0-freebsd-amd64.tar.gz
66-
cd8e7bbe5b8f33ed1597aa1cc588da96a3b9f22e1b9ae60d93511eae1a0ee8c5 golangci-lint-1.61.0-freebsd-armv6.tar.gz
67-
7ade524dbd88bd250968f45e190af90e151fa5ee63dd6aa7f7bb90e8155db61d golangci-lint-1.61.0-freebsd-armv7.tar.gz
68-
0fe3cd8a1ed8d9f54f48670a5af3df056d6040d94017057f0f4d65c930660ad9 golangci-lint-1.61.0-illumos-amd64.tar.gz
69-
b463fc5053a612abd26393ebaff1d85d7d56058946f4f0f7bf25ed44ea899415 golangci-lint-1.61.0-linux-386.tar.gz
70-
77cb0af99379d9a21d5dc8c38364d060e864a01bd2f3e30b5e8cc550c3a54111 golangci-lint-1.61.0-linux-amd64.tar.gz
71-
af60ac05566d9351615cb31b4cc070185c25bf8cbd9b09c1873aa5ec6f3cc17e golangci-lint-1.61.0-linux-arm64.tar.gz
72-
1f307f2fcc5d7d674062a967a0d83a7091e300529aa237ec6ad2b3dd14c897f5 golangci-lint-1.61.0-linux-armv6.tar.gz
73-
3ad8cbaae75a547450844811300f99c4cd290277398e43d22b9eb1792d15af4c golangci-lint-1.61.0-linux-armv7.tar.gz
74-
9be2ca67d961d7699079739cf6f7c8291c5183d57e34d1677de21ca19d0bd3ed golangci-lint-1.61.0-linux-loong64.tar.gz
75-
90d005e1648115ebf0861b408eab9c936079a24763e883058b0a227cd3135d31 golangci-lint-1.61.0-linux-mips64.tar.gz
76-
6d2ed4f49407115460b8c10ccfc40fd177e0887a48864a2879dd16e84ba2a48c golangci-lint-1.61.0-linux-mips64le.tar.gz
77-
633089589af5a58b7430afb6eee107d4e9c99e8d91711ddc219eb13a07e8d3b8 golangci-lint-1.61.0-linux-ppc64le.tar.gz
78-
4c1a097d9e0d1b4a8144dae6a1f5583a38d662f3bdc1498c4e954b6ed856be98 golangci-lint-1.61.0-linux-riscv64.tar.gz
79-
30581d3c987d287b7064617f1a2694143e10dffc40bc25be6636006ee82d7e1c golangci-lint-1.61.0-linux-s390x.tar.gz
80-
42530bf8100bd43c07f5efe6d92148ba6c5a7a712d510c6f24be85af6571d5eb golangci-lint-1.61.0-netbsd-386.tar.gz
81-
b8bb07c920f6601edf718d5e82ec0784fd590b0992b42b6ec18da99f26013ed4 golangci-lint-1.61.0-netbsd-amd64.tar.gz
82-
353a51527c60bd0776b0891b03f247c791986f625fca689d121972c624e54198 golangci-lint-1.61.0-netbsd-arm64.tar.gz
83-
957a6272c3137910514225704c5dac0723b9c65eb7d9587366a997736e2d7580 golangci-lint-1.61.0-netbsd-armv6.tar.gz
84-
a89eb28ff7f18f5cd52b914739360fa95cf2f643de4adeca46e26bec3a07e8d8 golangci-lint-1.61.0-netbsd-armv7.tar.gz
85-
d8d74c43600b271393000717a4ed157d7a15bb85bab7db2efad9b63a694d4634 golangci-lint-1.61.0-windows-386.zip
86-
e7bc2a81929a50f830244d6d2e657cce4f19a59aff49fa9000176ff34fda64ce golangci-lint-1.61.0-windows-amd64.zip
87-
ed97c221596dd771e3dd9344872c140340bee2e819cd7a90afa1de752f1f2e0f golangci-lint-1.61.0-windows-arm64.zip
88-
4b365233948b13d02d45928a5c390045e00945e919747b9887b5f260247541ae golangci-lint-1.61.0-windows-armv6.zip
89-
595538fb64d152173959d28f6235227f9cd969a828e5af0c4e960d02af4ffd0e golangci-lint-1.61.0-windows-armv7.zip
61+
# https://github.com/golangci/golangci-lint/releases/download/v1.63.4/
62+
878d017cc360e4fb19510d39852c8189852e3c48e7ce0337577df73507c97d68 golangci-lint-1.63.4-darwin-amd64.tar.gz
63+
a2b630c2ac8466393f0ccbbede4462387b6c190697a70bc2298c6d2123f21bbf golangci-lint-1.63.4-darwin-arm64.tar.gz
64+
8938b74aa92888e561a1c5a4c175110b92f84e7d24733703e6d9ebc39e9cd5f8 golangci-lint-1.63.4-freebsd-386.tar.gz
65+
054903339d620df2e760b978920100986e3b03bcb058f669d520a71dac9c34ed golangci-lint-1.63.4-freebsd-amd64.tar.gz
66+
a19d499f961a02608348e8b626537a88edfaab6e1b6534f1eff742b5d6d750e4 golangci-lint-1.63.4-freebsd-armv6.tar.gz
67+
00d616f0fb275b780ce4d26604bdd7fdbfe6bc9c63acd5a0b31498e1f7511108 golangci-lint-1.63.4-freebsd-armv7.tar.gz
68+
d453688e0eabded3c1a97ff5a2777bb0df5a18851efdaaaf6b472e3e5713c33e golangci-lint-1.63.4-illumos-amd64.tar.gz
69+
6b1bec847fc9f347d53712d05606a49d55d0e3b5c1bacadfed2393f3503de0e9 golangci-lint-1.63.4-linux-386.tar.gz
70+
01abb14a4df47b5ca585eff3c34b105023cba92ec34ff17212dbb83855581690 golangci-lint-1.63.4-linux-amd64.tar.gz
71+
51f0c79d19a92353e0465fb30a4901a0644a975d34e6f399ad2eebc0160bbb24 golangci-lint-1.63.4-linux-arm64.tar.gz
72+
8d0a43f41e8424fbae10f7aa2dc29999f98112817c6dba63d7dc76832940a673 golangci-lint-1.63.4-linux-armv6.tar.gz
73+
1045a047b31e9302c9160c7b0f199f4ac1bd02a1b221a2d9521bd3507f0cf671 golangci-lint-1.63.4-linux-armv7.tar.gz
74+
933fe10ab50ce3bb0806e15a4ae69fe20f0549abf91dea0161236000ca706e67 golangci-lint-1.63.4-linux-loong64.tar.gz
75+
45798630cbad5642862766051199fa862ef3c33d569cab12f01cac4f68e2ddd5 golangci-lint-1.63.4-linux-mips64.tar.gz
76+
86ae25335ddb24975d2c915c1af0c7fad70dce99d0b4614fa4bee392de714aa2 golangci-lint-1.63.4-linux-mips64le.tar.gz
77+
33dabd11aaba4b602938da98bcf49aabab55019557e0115cdc3dbcc3009768fa golangci-lint-1.63.4-linux-ppc64le.tar.gz
78+
4e7a81230a663bcdf30bba5689ce96040abc76994dbc2003dce32c8dca8c06f3 golangci-lint-1.63.4-linux-riscv64.tar.gz
79+
21370b49c7c47f4d9b8f982c952f940b01e65710174c3b4dad7b6452d58f92ec golangci-lint-1.63.4-linux-s390x.tar.gz
80+
255866a6464c7e11bb7edd8e6e6ad54f11e1f01b82ba9ca229698ac788cd9724 golangci-lint-1.63.4-netbsd-386.tar.gz
81+
2798c040ac658bda97224f204795199c81ac97bb207b21c02b664aaed380d5d2 golangci-lint-1.63.4-netbsd-amd64.tar.gz
82+
b910eecffd0064103837e7e1abe870deb8ade22331e6dffe319f430d49399c8e golangci-lint-1.63.4-netbsd-arm64.tar.gz
83+
df2693ef37147b457c3e2089614537dd2ae2e18e53641e756a5b404f4c72d3fa golangci-lint-1.63.4-netbsd-armv6.tar.gz
84+
a28a533366974bd7834c4516cd6075bff3419a508d1ed7aa63ae8182768b352e golangci-lint-1.63.4-netbsd-armv7.tar.gz
85+
368932775fb5c620b324dabf018155f3365f5e33c5af5b26e9321db373f96eea golangci-lint-1.63.4-windows-386.zip
86+
184d13c2b8f5441576bec2a0d8ba7b2d45445595cf796b879a73bcc98c39f8c1 golangci-lint-1.63.4-windows-amd64.zip
87+
4fabf175d5b05ef0858ded49527948eebac50e9093814979fd84555a75fb80a6 golangci-lint-1.63.4-windows-arm64.zip
88+
e92be3f3ff30d4a849fb4b9a4c8d56837dee45269cb405a3ecad52fa034c781b golangci-lint-1.63.4-windows-armv6.zip
89+
c71d348653b8f7fbb109bb10c1a481722bc6b0b2b6e731b897f99ac869f7653e golangci-lint-1.63.4-windows-armv7.zip
9090

9191
# This is the builder on PPA that will build Go itself (inception-y), don't modify!
9292
#

Diff for: cmd/clef/rules.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ It enables usecases like the following:
77
* I want to auto-approve transactions with contract `CasinoDapp`, with up to `0.05 ether` in value to maximum `1 ether` per 24h period
88
* I want to auto-approve transaction to contract `EthAlarmClock` with `data`=`0xdeadbeef`, if `value=0`, `gas < 44k` and `gasPrice < 40Gwei`
99

10-
The two main features that are required for this to work well are;
10+
The two main features that are required for this to work well are:
1111

1212
1. Rule Implementation: how to create, manage, and interpret rules in a flexible but secure manner
1313
2. Credential management and credentials; how to provide auto-unlock without exposing keys unnecessarily.
@@ -29,10 +29,10 @@ function asBig(str) {
2929

3030
// Approve transactions to a certain contract if the value is below a certain limit
3131
function ApproveTx(req) {
32-
var limit = big.Newint("0xb1a2bc2ec50000")
32+
var limit = new BigNumber("0xb1a2bc2ec50000")
3333
var value = asBig(req.transaction.value);
3434

35-
if (req.transaction.to.toLowerCase() == "0xae967917c465db8578ca9024c205720b1a3651a9") && value.lt(limit)) {
35+
if (req.transaction.to.toLowerCase() == "0xae967917c465db8578ca9024c205720b1a3651a9" && value.lt(limit)) {
3636
return "Approve"
3737
}
3838
// If we return "Reject", it will be rejected.

Diff for: cmd/devp2p/dns_route53.go

+2-7
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package main
1818

1919
import (
20+
"cmp"
2021
"context"
2122
"errors"
2223
"fmt"
@@ -292,13 +293,7 @@ func sortChanges(changes []types.Change) {
292293
if a.Action == b.Action {
293294
return strings.Compare(*a.ResourceRecordSet.Name, *b.ResourceRecordSet.Name)
294295
}
295-
if score[string(a.Action)] < score[string(b.Action)] {
296-
return -1
297-
}
298-
if score[string(a.Action)] > score[string(b.Action)] {
299-
return 1
300-
}
301-
return 0
296+
return cmp.Compare(score[string(a.Action)], score[string(b.Action)])
302297
})
303298
}
304299

Diff for: cmd/devp2p/internal/ethtest/chain.go

+3-22
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
"os"
2929
"path/filepath"
3030
"slices"
31-
"sort"
3231
"strings"
3332

3433
"github.com/ethereum/go-ethereum/common"
@@ -41,6 +40,7 @@ import (
4140
"github.com/ethereum/go-ethereum/eth/protocols/eth"
4241
"github.com/ethereum/go-ethereum/params"
4342
"github.com/ethereum/go-ethereum/rlp"
43+
"golang.org/x/exp/maps"
4444
)
4545

4646
// Chain is a lightweight blockchain-like store which can read a hivechain
@@ -166,11 +166,8 @@ func (c *Chain) RootAt(height int) common.Hash {
166166
// GetSender returns the address associated with account at the index in the
167167
// pre-funded accounts list.
168168
func (c *Chain) GetSender(idx int) (common.Address, uint64) {
169-
var accounts Addresses
170-
for addr := range c.senders {
171-
accounts = append(accounts, addr)
172-
}
173-
sort.Sort(accounts)
169+
accounts := maps.Keys(c.senders)
170+
slices.SortFunc(accounts, common.Address.Cmp)
174171
addr := accounts[idx]
175172
return addr, c.senders[addr].Nonce
176173
}
@@ -260,22 +257,6 @@ func loadGenesis(genesisFile string) (core.Genesis, error) {
260257
return gen, nil
261258
}
262259

263-
type Addresses []common.Address
264-
265-
func (a Addresses) Len() int {
266-
return len(a)
267-
}
268-
269-
func (a Addresses) Less(i, j int) bool {
270-
return bytes.Compare(a[i][:], a[j][:]) < 0
271-
}
272-
273-
func (a Addresses) Swap(i, j int) {
274-
tmp := a[i]
275-
a[i] = a[j]
276-
a[j] = tmp
277-
}
278-
279260
func blocksFromFile(chainfile string, gblock *types.Block) ([]*types.Block, error) {
280261
// Load chain.rlp.
281262
fh, err := os.Open(chainfile)

Diff for: cmd/devp2p/nodeset.go

+2-7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package main
1818

1919
import (
2020
"bytes"
21+
"cmp"
2122
"encoding/json"
2223
"fmt"
2324
"os"
@@ -104,13 +105,7 @@ func (ns nodeSet) topN(n int) nodeSet {
104105
byscore = append(byscore, v)
105106
}
106107
slices.SortFunc(byscore, func(a, b nodeJSON) int {
107-
if a.Score > b.Score {
108-
return -1
109-
}
110-
if a.Score < b.Score {
111-
return 1
112-
}
113-
return 0
108+
return cmp.Compare(b.Score, a.Score)
114109
})
115110
result := make(nodeSet, n)
116111
for _, v := range byscore[:n] {

Diff for: cmd/geth/chaincmd.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,10 @@ func initGenesis(ctx *cli.Context) error {
230230
triedb := utils.MakeTrieDatabase(ctx, chaindb, ctx.Bool(utils.CachePreimagesFlag.Name), false, genesis.IsVerkle())
231231
defer triedb.Close()
232232

233-
_, hash, err := core.SetupGenesisBlockWithOverride(chaindb, triedb, genesis, &overrides)
233+
_, hash, _, err := core.SetupGenesisBlockWithOverride(chaindb, triedb, genesis, &overrides)
234234
if err != nil {
235235
utils.Fatalf("Failed to write genesis block: %v", err)
236236
}
237-
238237
log.Info("Successfully wrote genesis state", "database", "chaindata", "hash", hash)
239238

240239
return nil

Diff for: cmd/utils/history_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func TestHistoryImportAndExport(t *testing.T) {
170170
db2.Close()
171171
})
172172

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

0 commit comments

Comments
 (0)