Skip to content

Commit 98047fd

Browse files
Merge branch 'master' into remove-advancestateuptoblock-func
2 parents f9b447d + cccbae5 commit 98047fd

File tree

516 files changed

+17665
-11006
lines changed

Some content is hidden

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

516 files changed

+17665
-11006
lines changed

.github/workflows/ci.yml

-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ jobs:
2121
uses: actions/setup-go@v4
2222
with:
2323
go-version: 1.21.4
24-
2524
- name: Test
2625
run: make test
2726

@@ -37,6 +36,5 @@ jobs:
3736
uses: actions/setup-go@v4
3837
with:
3938
go-version: 1.21.4
40-
4139
- name: Test
4240
run: make lint

.mailmap

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ Diederik Loerakker <[email protected]>
5656
Dimitry Khokhlov <[email protected]>
5757

5858
Domino Valdano <[email protected]>
59-
6059

6160
Edgar Aroutiounian <[email protected]>
6261

.travis.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
os: linux
1717
arch: amd64
1818
dist: bionic
19-
go: 1.21.x
19+
go: 1.22.x
2020
env:
2121
- docker
2222
services:
@@ -33,7 +33,7 @@ jobs:
3333
os: linux
3434
arch: arm64
3535
dist: bionic
36-
go: 1.21.x
36+
go: 1.22.x
3737
env:
3838
- docker
3939
services:
@@ -51,7 +51,7 @@ jobs:
5151
os: linux
5252
dist: bionic
5353
sudo: required
54-
go: 1.21.x
54+
go: 1.22.x
5555
env:
5656
- azure-linux
5757
git:
@@ -85,7 +85,7 @@ jobs:
8585
if: type = push
8686
os: osx
8787
osx_image: xcode14.2
88-
go: 1.21.x
88+
go: 1.22.x
8989
env:
9090
- azure-osx
9191
git:
@@ -101,7 +101,7 @@ jobs:
101101
os: linux
102102
arch: amd64
103103
dist: bionic
104-
go: 1.21.x
104+
go: 1.22.x
105105
script:
106106
- travis_wait 30 go run build/ci.go test $TEST_PACKAGES
107107

@@ -110,14 +110,14 @@ jobs:
110110
os: linux
111111
arch: arm64
112112
dist: bionic
113-
go: 1.20.x
113+
go: 1.21.x
114114
script:
115115
- travis_wait 30 go run build/ci.go test $TEST_PACKAGES
116116

117117
- stage: build
118118
os: linux
119119
dist: bionic
120-
go: 1.20.x
120+
go: 1.21.x
121121
script:
122122
- travis_wait 30 go run build/ci.go test $TEST_PACKAGES
123123

@@ -126,7 +126,7 @@ jobs:
126126
if: type = cron || (type = push && tag ~= /^v[0-9]/)
127127
os: linux
128128
dist: bionic
129-
go: 1.21.x
129+
go: 1.22.x
130130
env:
131131
- ubuntu-ppa
132132
git:
@@ -149,7 +149,7 @@ jobs:
149149
if: type = cron
150150
os: linux
151151
dist: bionic
152-
go: 1.21.x
152+
go: 1.22.x
153153
env:
154154
- azure-purge
155155
git:
@@ -162,7 +162,7 @@ jobs:
162162
if: type = cron
163163
os: linux
164164
dist: bionic
165-
go: 1.21.x
165+
go: 1.22.x
166166
script:
167167
- travis_wait 30 go run build/ci.go test -race $TEST_PACKAGES
168168

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG VERSION=""
44
ARG BUILDNUM=""
55

66
# Build Geth in a stock Go builder container
7-
FROM golang:1.21-alpine as builder
7+
FROM golang:1.22-alpine as builder
88

99
RUN apk add --no-cache gcc musl-dev linux-headers git
1010

@@ -25,7 +25,7 @@ COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/
2525
EXPOSE 8545 8546 30303 30303/udp
2626
ENTRYPOINT ["geth"]
2727

28-
# Add some metadata labels to help programatic image consumption
28+
# Add some metadata labels to help programmatic image consumption
2929
ARG COMMIT=""
3030
ARG VERSION=""
3131
ARG BUILDNUM=""

Dockerfile.alltools

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG VERSION=""
44
ARG BUILDNUM=""
55

66
# Build Geth in a stock Go builder container
7-
FROM golang:1.21-alpine as builder
7+
FROM golang:1.22-alpine as builder
88

99
RUN apk add --no-cache gcc musl-dev linux-headers git
1010

@@ -24,7 +24,7 @@ COPY --from=builder /go-ethereum/build/bin/* /usr/local/bin/
2424

2525
EXPOSE 8545 8546 30303 30303/udp
2626

27-
# Add some metadata labels to help programatic image consumption
27+
# Add some metadata labels to help programmatic image consumption
2828
ARG COMMIT=""
2929
ARG VERSION=""
3030
ARG BUILDNUM=""

Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# with Go source code. If you know what GOPATH is then you probably
33
# don't need to bother with make.
44

5-
.PHONY: geth android ios evm all test clean
5+
.PHONY: geth all test lint clean devtools help
66

77
GOBIN = ./build/bin
88
GO ?= latest
@@ -47,4 +47,3 @@ devtools:
4747
help: Makefile
4848
@echo " Choose a command run in go-ethereum:"
4949
@sed -n 's/^#?//p' $< | column -t -s ':' | sort | sed -e 's/^/ /'
50-
.PHONY: help

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ archives are published at https://geth.ethereum.org/downloads/.
1616

1717
For prerequisites and detailed build instructions please read the [Installation Instructions](https://geth.ethereum.org/docs/getting-started/installing-geth).
1818

19-
Building `geth` requires both a Go (version 1.19 or later) and a C compiler. You can install
19+
Building `geth` requires both a Go (version 1.21 or later) and a C compiler. You can install
2020
them using your favourite package manager. Once the dependencies are installed, run
2121

2222
```shell

accounts/abi/argument.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func (arguments Arguments) Copy(v interface{}, values []interface{}) error {
127127
return arguments.copyAtomic(v, values[0])
128128
}
129129

130-
// unpackAtomic unpacks ( hexdata -> go ) a single value
130+
// copyAtomic copies ( hexdata -> go ) a single value
131131
func (arguments Arguments) copyAtomic(v interface{}, marshalledValues interface{}) error {
132132
dst := reflect.ValueOf(v).Elem()
133133
src := reflect.ValueOf(marshalledValues)

accounts/abi/bind/auth.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ func NewKeyStoreTransactorWithChainID(keystore *keystore.KeyStore, account accou
142142
// NewKeyedTransactorWithChainID is a utility method to easily create a transaction signer
143143
// from a single private key.
144144
func NewKeyedTransactorWithChainID(key *ecdsa.PrivateKey, chainID *big.Int) (*TransactOpts, error) {
145-
keyAddr := crypto.PubkeyToAddress(key.PublicKey)
146145
if chainID == nil {
147146
return nil, ErrNoChainID
148147
}
148+
keyAddr := crypto.PubkeyToAddress(key.PublicKey)
149149
signer := types.LatestSignerForChainID(chainID)
150150
return &TransactOpts{
151151
From: keyAddr,

accounts/abi/bind/base.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ func (c *BoundContract) FilterLogs(opts *FilterOpts, name string, query ...[]int
514514
if err != nil {
515515
return nil, nil, err
516516
}
517-
sub, err := event.NewSubscription(func(quit <-chan struct{}) error {
517+
sub := event.NewSubscription(func(quit <-chan struct{}) error {
518518
for _, log := range buff {
519519
select {
520520
case logs <- log:
@@ -523,11 +523,8 @@ func (c *BoundContract) FilterLogs(opts *FilterOpts, name string, query ...[]int
523523
}
524524
}
525525
return nil
526-
}), nil
526+
})
527527

528-
if err != nil {
529-
return nil, nil, err
530-
}
531528
return logs, sub, nil
532529
}
533530

accounts/abi/reflect.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"strings"
2525
)
2626

27-
// ConvertType converts an interface of a runtime type into a interface of the
27+
// ConvertType converts an interface of a runtime type into an interface of the
2828
// given type, e.g. turn this code:
2929
//
3030
// var fields []reflect.StructField
@@ -33,7 +33,7 @@ import (
3333
// Name: "X",
3434
// Type: reflect.TypeOf(new(big.Int)),
3535
// Tag: reflect.StructTag("json:\"" + "x" + "\""),
36-
// }
36+
// })
3737
//
3838
// into:
3939
//

accounts/abi/type.go

-3
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,6 @@ func NewType(t string, internalType string, components []ArgumentMarshaling) (ty
179179
return Type{}, errors.New("abi: purely anonymous or underscored field is not supported")
180180
}
181181
fieldName := ResolveNameConflict(name, func(s string) bool { return used[s] })
182-
if err != nil {
183-
return Type{}, err
184-
}
185182
used[fieldName] = true
186183
if !isValidFieldName(fieldName) {
187184
return Type{}, fmt.Errorf("field %d has invalid name", idx)

accounts/abi/type_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"github.com/ethereum/go-ethereum/common"
2626
)
2727

28-
// typeWithoutStringer is a alias for the Type type which simply doesn't implement
28+
// typeWithoutStringer is an alias for the Type type which simply doesn't implement
2929
// the stringer interface to allow printing type details in the tests below.
3030
type typeWithoutStringer Type
3131

accounts/accounts.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func TextHash(data []byte) []byte {
195195
//
196196
// This gives context to the signed message and prevents signing of transactions.
197197
func TextAndHash(data []byte) ([]byte, string) {
198-
msg := fmt.Sprintf("\x19Ethereum Signed Message:\n%d%s", len(data), string(data))
198+
msg := fmt.Sprintf("\x19Ethereum Signed Message:\n%d%s", len(data), data)
199199
hasher := sha3.NewLegacyKeccak256()
200200
hasher.Write([]byte(msg))
201201
return hasher.Sum(nil), msg

accounts/external/backend.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ func (api *ExternalSigner) SignTx(account accounts.Account, tx *types.Transactio
239239
args.BlobHashes = tx.BlobHashes()
240240
sidecar := tx.BlobTxSidecar()
241241
if sidecar == nil {
242-
return nil, fmt.Errorf("blobs must be present for signing")
242+
return nil, errors.New("blobs must be present for signing")
243243
}
244244
args.Blobs = sidecar.Blobs
245245
args.Commitments = sidecar.Commitments

accounts/keystore/account_cache.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"fmt"
2323
"os"
2424
"path/filepath"
25+
"slices"
2526
"sort"
2627
"strings"
2728
"sync"
@@ -31,7 +32,6 @@ import (
3132
"github.com/ethereum/go-ethereum/accounts"
3233
"github.com/ethereum/go-ethereum/common"
3334
"github.com/ethereum/go-ethereum/log"
34-
"golang.org/x/exp/slices"
3535
)
3636

3737
// Minimum amount of time between cache reloads. This limit applies if the platform does

accounts/keystore/account_cache_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ import (
2323
"os"
2424
"path/filepath"
2525
"reflect"
26+
"slices"
2627
"testing"
2728
"time"
2829

2930
"github.com/cespare/cp"
3031
"github.com/davecgh/go-spew/spew"
3132
"github.com/ethereum/go-ethereum/accounts"
3233
"github.com/ethereum/go-ethereum/common"
33-
"golang.org/x/exp/slices"
3434
)
3535

3636
var (
@@ -51,7 +51,7 @@ var (
5151
}
5252
)
5353

54-
// waitWatcherStarts waits up to 1s for the keystore watcher to start.
54+
// waitWatcherStart waits up to 1s for the keystore watcher to start.
5555
func waitWatcherStart(ks *KeyStore) bool {
5656
// On systems where file watch is not supported, just return "ok".
5757
if !ks.cache.watcher.enabled() {
@@ -86,7 +86,7 @@ func waitForAccounts(wantAccounts []accounts.Account, ks *KeyStore) error {
8686
func TestWatchNewFile(t *testing.T) {
8787
t.Parallel()
8888

89-
dir, ks := tmpKeyStore(t, false)
89+
dir, ks := tmpKeyStore(t)
9090

9191
// Ensure the watcher is started before adding any files.
9292
ks.Accounts()

accounts/keystore/keystore.go

+1-12
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,6 @@ func NewKeyStore(keydir string, scryptN, scryptP int) *KeyStore {
8787
return ks
8888
}
8989

90-
// NewPlaintextKeyStore creates a keystore for the given directory.
91-
// Deprecated: Use NewKeyStore.
92-
func NewPlaintextKeyStore(keydir string) *KeyStore {
93-
keydir, _ = filepath.Abs(keydir)
94-
ks := &KeyStore{storage: &keyStorePlain{keydir}}
95-
ks.init(keydir)
96-
return ks
97-
}
98-
9990
func (ks *KeyStore) init(keydir string) {
10091
// Lock the mutex since the account cache might call back with events
10192
ks.mu.Lock()
@@ -509,7 +500,5 @@ func (ks *KeyStore) isUpdating() bool {
509500
// zeroKey zeroes a private key in memory.
510501
func zeroKey(k *ecdsa.PrivateKey) {
511502
b := k.D.Bits()
512-
for i := range b {
513-
b[i] = 0
514-
}
503+
clear(b)
515504
}

0 commit comments

Comments
 (0)