Skip to content

Commit

Permalink
Merge pull request #30456 from ethereum/master
Browse files Browse the repository at this point in the history
Merge branch 'master' into release/1.14
  • Loading branch information
karalabe authored Sep 18, 2024
2 parents a9523b6 + f321dfa commit c350d3a
Show file tree
Hide file tree
Showing 215 changed files with 6,881 additions and 2,960 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.4
go-version: 1.23.0
cache: false
- name: Run tests
run: go test -short ./...
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ build/_vendor/pkg
/build/bin/
/geth*.zip

# used by the build/ci.go archive + upload tool
/geth*.tar.gz
/geth*.tar.gz.sig
/geth*.tar.gz.asc
/geth*.zip.sig
/geth*.zip.asc


# travis
profile.tmp
profile.cov
Expand Down
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ issues:
- path: crypto/bn256/
linters:
- revive
- path: cmd/utils/flags.go
text: "SA1019: cfg.TxLookupLimit is deprecated: use 'TransactionHistory' instead."
- path: cmd/utils/flags.go
text: "SA1019: ethconfig.Defaults.TxLookupLimit is deprecated: use 'TransactionHistory' instead."
- path: internal/build/pgp.go
text: 'SA1019: "golang.org/x/crypto/openpgp" is deprecated: this package is unmaintained except for security fixes.'
- path: core/vm/contracts.go
Expand Down
35 changes: 18 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
if: type = push
os: linux
arch: amd64
dist: noble
go: 1.22.x
dist: focal
go: 1.23.x
env:
- docker
services:
Expand All @@ -32,8 +32,8 @@ jobs:
if: type = push
os: linux
arch: arm64
dist: noble
go: 1.22.x
dist: focal
go: 1.23.x
env:
- docker
services:
Expand All @@ -49,9 +49,9 @@ jobs:
- stage: build
if: type = push
os: linux
dist: noble
dist: focal
sudo: required
go: 1.22.x
go: 1.23.x
env:
- azure-linux
git:
Expand All @@ -63,6 +63,7 @@ jobs:

# build 386
- sudo -E apt-get -yq --no-install-suggests --no-install-recommends install gcc-multilib
- git status --porcelain
- go run build/ci.go install -dlgo -arch 386
- go run build/ci.go archive -arch 386 -type tar -signer LINUX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds

Expand All @@ -84,7 +85,7 @@ jobs:
if: type = push
os: osx
osx_image: xcode14.2
go: 1.22.x
go: 1.23.x
env:
- azure-osx
git:
Expand All @@ -100,25 +101,25 @@ jobs:
if: type = push
os: linux
arch: amd64
dist: noble
go: 1.22.x
dist: focal
go: 1.23.x
script:
- travis_wait 45 go run build/ci.go test $TEST_PACKAGES

- stage: build
if: type = push
os: linux
dist: noble
go: 1.21.x
dist: focal
go: 1.22.x
script:
- travis_wait 45 go run build/ci.go test $TEST_PACKAGES

# This builder does the Ubuntu PPA nightly uploads
- stage: build
if: type = cron || (type = push && tag ~= /^v[0-9]/)
os: linux
dist: noble
go: 1.22.x
dist: focal
go: 1.23.x
env:
- ubuntu-ppa
git:
Expand All @@ -133,8 +134,8 @@ jobs:
- stage: build
if: type = cron
os: linux
dist: noble
go: 1.22.x
dist: focal
go: 1.23.x
env:
- azure-purge
git:
Expand All @@ -146,8 +147,8 @@ jobs:
- stage: build
if: type = cron
os: linux
dist: noble
go: 1.22.x
dist: focal
go: 1.23.x
env:
- racetests
script:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG VERSION=""
ARG BUILDNUM=""

# Build Geth in a stock Go builder container
FROM golang:1.22-alpine as builder
FROM golang:1.23-alpine as builder

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

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.alltools
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG VERSION=""
ARG BUILDNUM=""

# Build Geth in a stock Go builder container
FROM golang:1.22-alpine as builder
FROM golang:1.23-alpine as builder

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

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ archives are published at https://geth.ethereum.org/downloads/.

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

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

```shell
Expand Down Expand Up @@ -89,7 +89,7 @@ This command will:
This tool is optional and if you leave it out you can always attach it to an already running
`geth` instance with `geth attach`.

### A Full node on the Görli test network
### A Full node on the Holesky test network

Transitioning towards developers, if you'd like to play around with creating Ethereum
contracts, you almost certainly would like to do that without any real money involved until
Expand All @@ -98,23 +98,23 @@ network, you want to join the **test** network with your node, which is fully eq
the main network, but with play-Ether only.

```shell
$ geth --goerli console
$ geth --holesky console
```

The `console` subcommand has the same meaning as above and is equally
useful on the testnet too.

Specifying the `--goerli` flag, however, will reconfigure your `geth` instance a bit:
Specifying the `--holesky` flag, however, will reconfigure your `geth` instance a bit:

* Instead of connecting to the main Ethereum network, the client will connect to the Görli
* Instead of connecting to the main Ethereum network, the client will connect to the Holesky
test network, which uses different P2P bootnodes, different network IDs and genesis
states.
* Instead of using the default data directory (`~/.ethereum` on Linux for example), `geth`
will nest itself one level deeper into a `goerli` subfolder (`~/.ethereum/goerli` on
will nest itself one level deeper into a `holesky` subfolder (`~/.ethereum/holesky` on
Linux). Note, on OSX and Linux this also means that attaching to a running testnet node
requires the use of a custom endpoint since `geth attach` will try to attach to a
production node endpoint by default, e.g.,
`geth attach <datadir>/goerli/geth.ipc`. Windows users are not affected by
`geth attach <datadir>/holesky/geth.ipc`. Windows users are not affected by
this.

*Note: Although some internal protective measures prevent transactions from
Expand Down
7 changes: 7 additions & 0 deletions accounts/abi/abi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1218,3 +1218,10 @@ func TestUnpackRevert(t *testing.T) {
})
}
}

func TestInternalContractType(t *testing.T) {
jsonData := `[{"inputs":[{"components":[{"internalType":"uint256","name":"dailyLimit","type":"uint256"},{"internalType":"uint256","name":"txLimit","type":"uint256"},{"internalType":"uint256","name":"accountDailyLimit","type":"uint256"},{"internalType":"uint256","name":"minAmount","type":"uint256"},{"internalType":"bool","name":"onlyWhitelisted","type":"bool"}],"internalType":"struct IMessagePassingBridge.BridgeLimits","name":"bridgeLimits","type":"tuple"},{"components":[{"internalType":"uint256","name":"lastTransferReset","type":"uint256"},{"internalType":"uint256","name":"bridged24Hours","type":"uint256"}],"internalType":"struct IMessagePassingBridge.AccountLimit","name":"accountDailyLimit","type":"tuple"},{"components":[{"internalType":"uint256","name":"lastTransferReset","type":"uint256"},{"internalType":"uint256","name":"bridged24Hours","type":"uint256"}],"internalType":"struct IMessagePassingBridge.BridgeDailyLimit","name":"bridgeDailyLimit","type":"tuple"},{"internalType":"contract INameService","name":"nameService","type":"INameService"},{"internalType":"bool","name":"isClosed","type":"bool"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"canBridge","outputs":[{"internalType":"bool","name":"isWithinLimit","type":"bool"},{"internalType":"string","name":"error","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"name":"normalizeFrom18ToTokenDecimals","outputs":[{"internalType":"uint256","name":"normalized","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"name":"normalizeFromTokenTo18Decimals","outputs":[{"internalType":"uint256","name":"normalized","type":"uint256"}],"stateMutability":"pure","type":"function"}]`
if _, err := JSON(strings.NewReader(jsonData)); err != nil {
t.Fatal(err)
}
}
12 changes: 9 additions & 3 deletions accounts/abi/bind/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ func TestWaitDeployed(t *testing.T) {
}()

// Send and mine the transaction.
backend.Client().SendTransaction(ctx, tx)
if err := backend.Client().SendTransaction(ctx, tx); err != nil {
t.Errorf("test %q: failed to send transaction: %v", name, err)
}
backend.Commit()

select {
Expand Down Expand Up @@ -116,7 +118,9 @@ func TestWaitDeployedCornerCases(t *testing.T) {
tx, _ = types.SignTx(tx, types.LatestSigner(params.AllDevChainProtocolChanges), testKey)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
backend.Client().SendTransaction(ctx, tx)
if err := backend.Client().SendTransaction(ctx, tx); err != nil {
t.Errorf("failed to send transaction: %q", err)
}
backend.Commit()
notContractCreation := errors.New("tx is not contract creation")
if _, err := bind.WaitDeployed(ctx, backend.Client(), tx); err.Error() != notContractCreation.Error() {
Expand All @@ -134,6 +138,8 @@ func TestWaitDeployedCornerCases(t *testing.T) {
}
}()

backend.Client().SendTransaction(ctx, tx)
if err := backend.Client().SendTransaction(ctx, tx); err != nil {
t.Errorf("failed to send transaction: %q", err)
}
cancel()
}
7 changes: 6 additions & 1 deletion accounts/abi/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,12 @@ func NewType(t string, internalType string, components []ArgumentMarshaling) (ty
typ.T = FunctionTy
typ.Size = 24
default:
return Type{}, fmt.Errorf("unsupported arg type: %s", t)
if strings.HasPrefix(internalType, "contract ") {
typ.Size = 20
typ.T = AddressTy
} else {
return Type{}, fmt.Errorf("unsupported arg type: %s", t)
}
}

return
Expand Down
5 changes: 4 additions & 1 deletion beacon/blsync/block_sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ func TestBlockSync(t *testing.T) {
t.Helper()
var expNumber, headNumber uint64
if expHead != nil {
p, _ := expHead.ExecutionPayload()
p, err := expHead.ExecutionPayload()
if err != nil {
t.Fatalf("expHead.ExecutionPayload() failed: %v", err)
}
expNumber = p.NumberU64()
}
select {
Expand Down
17 changes: 1 addition & 16 deletions beacon/blsync/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,32 +56,17 @@ var (
AddFork("DENEB", 132608, []byte{144, 0, 0, 115}),
Checkpoint: common.HexToHash("0x1005a6d9175e96bfbce4d35b80f468e9bff0b674e1e861d16e09e10005a58e81"),
}

GoerliConfig = lightClientConfig{
ChainConfig: (&types.ChainConfig{
GenesisValidatorsRoot: common.HexToHash("0x043db0d9a83813551ee2f33450d23797757d430911a9320530ad8a0eabc43efb"),
GenesisTime: 1614588812,
}).
AddFork("GENESIS", 0, []byte{0, 0, 16, 32}).
AddFork("ALTAIR", 36660, []byte{1, 0, 16, 32}).
AddFork("BELLATRIX", 112260, []byte{2, 0, 16, 32}).
AddFork("CAPELLA", 162304, []byte{3, 0, 16, 32}).
AddFork("DENEB", 231680, []byte{4, 0, 16, 32}),
Checkpoint: common.HexToHash("0x53a0f4f0a378e2c4ae0a9ee97407eb69d0d737d8d8cd0a5fb1093f42f7b81c49"),
}
)

func makeChainConfig(ctx *cli.Context) lightClientConfig {
var config lightClientConfig
customConfig := ctx.IsSet(utils.BeaconConfigFlag.Name)
utils.CheckExclusive(ctx, utils.MainnetFlag, utils.GoerliFlag, utils.SepoliaFlag, utils.BeaconConfigFlag)
utils.CheckExclusive(ctx, utils.MainnetFlag, utils.SepoliaFlag, utils.BeaconConfigFlag)
switch {
case ctx.Bool(utils.MainnetFlag.Name):
config = MainnetConfig
case ctx.Bool(utils.SepoliaFlag.Name):
config = SepoliaConfig
case ctx.Bool(utils.GoerliFlag.Name):
config = GoerliConfig
default:
if !customConfig {
config = MainnetConfig
Expand Down
Loading

0 comments on commit c350d3a

Please sign in to comment.