Skip to content

Commit f3c696f

Browse files
authored
all: release go-ethereum v1.13.8
Release 1.14.11
2 parents 1015a42 + f14f13b commit f3c696f

File tree

120 files changed

+136
-397
lines changed

Some content is hidden

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

120 files changed

+136
-397
lines changed

.travis.yml

+2-20
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ jobs:
99
- azure-osx
1010

1111
include:
12-
# These builders create the Docker sub-images for multi-arch push and each
13-
# will attempt to push the multi-arch image if they are the last builder
12+
# This builder create and push the Docker images for all architectures
1413
- stage: build
1514
if: type = push
1615
os: linux
@@ -26,24 +25,7 @@ jobs:
2625
before_install:
2726
- export DOCKER_CLI_EXPERIMENTAL=enabled
2827
script:
29-
- go run build/ci.go docker -image -manifest amd64,arm64 -upload ethereum/client-go
30-
31-
- stage: build
32-
if: type = push
33-
os: linux
34-
arch: arm64
35-
dist: focal
36-
go: 1.23.x
37-
env:
38-
- docker
39-
services:
40-
- docker
41-
git:
42-
submodules: false # avoid cloning ethereum/tests
43-
before_install:
44-
- export DOCKER_CLI_EXPERIMENTAL=enabled
45-
script:
46-
- go run build/ci.go docker -image -manifest amd64,arm64 -upload ethereum/client-go
28+
- go run build/ci.go dockerx -platform "linux/amd64,linux/arm64" -upload ethereum/client-go
4729

4830
# This builder does the Linux Azure uploads
4931
- stage: build

Dockerfile

+1-1
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.23-alpine as builder
7+
FROM golang:1.23-alpine AS builder
88

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

Dockerfile.alltools

+8-1
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.23-alpine as builder
7+
FROM golang:1.23-alpine AS builder
88

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

@@ -14,6 +14,13 @@ COPY go.sum /go-ethereum/
1414
RUN cd /go-ethereum && go mod download
1515

1616
ADD . /go-ethereum
17+
18+
# This is not strictly necessary, but it matches the "Dockerfile" steps, thus
19+
# makes it so that under certain circumstances, the docker layer can be cached,
20+
# and the builder can jump to the next (build all) command, with the go cache fully loaded.
21+
#
22+
RUN cd /go-ethereum && go run build/ci.go install -static ./cmd/geth
23+
1724
RUN cd /go-ethereum && go run build/ci.go install -static
1825

1926
# Pull all binaries into a second stage deploy alpine container

build/ci.go

+24-129
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ import (
5050
"path"
5151
"path/filepath"
5252
"runtime"
53-
"strconv"
5453
"strings"
5554
"time"
5655

@@ -159,8 +158,8 @@ func main() {
159158
doLint(os.Args[2:])
160159
case "archive":
161160
doArchive(os.Args[2:])
162-
case "docker":
163-
doDocker(os.Args[2:])
161+
case "dockerx":
162+
doDockerBuildx(os.Args[2:])
164163
case "debsrc":
165164
doDebianSource(os.Args[2:])
166165
case "nsis":
@@ -723,10 +722,9 @@ func maybeSkipArchive(env build.Environment) {
723722
}
724723

725724
// Builds the docker images and optionally uploads them to Docker Hub.
726-
func doDocker(cmdline []string) {
725+
func doDockerBuildx(cmdline []string) {
727726
var (
728-
image = flag.Bool("image", false, `Whether to build and push an arch specific docker image`)
729-
manifest = flag.String("manifest", "", `Push a multi-arch docker image for the specified architectures (usually "amd64,arm64")`)
727+
platform = flag.String("platform", "", `Push a multi-arch docker image for the specified architectures (usually "linux/amd64,linux/arm64")`)
730728
upload = flag.String("upload", "", `Where to upload the docker image (usually "ethereum/client-go")`)
731729
)
732730
flag.CommandLine.Parse(cmdline)
@@ -761,129 +759,26 @@ func doDocker(cmdline []string) {
761759
case strings.HasPrefix(env.Tag, "v1."):
762760
tags = []string{"stable", fmt.Sprintf("release-1.%d", params.VersionMinor), "v" + params.Version}
763761
}
764-
// If architecture specific image builds are requested, build and push them
765-
if *image {
766-
build.MustRunCommand("docker", "build", "--build-arg", "COMMIT="+env.Commit, "--build-arg", "VERSION="+params.VersionWithMeta, "--build-arg", "BUILDNUM="+env.Buildnum, "--tag", fmt.Sprintf("%s:TAG", *upload), ".")
767-
build.MustRunCommand("docker", "build", "--build-arg", "COMMIT="+env.Commit, "--build-arg", "VERSION="+params.VersionWithMeta, "--build-arg", "BUILDNUM="+env.Buildnum, "--tag", fmt.Sprintf("%s:alltools-TAG", *upload), "-f", "Dockerfile.alltools", ".")
768-
769-
// Tag and upload the images to Docker Hub
770-
for _, tag := range tags {
771-
gethImage := fmt.Sprintf("%s:%s-%s", *upload, tag, runtime.GOARCH)
772-
toolImage := fmt.Sprintf("%s:alltools-%s-%s", *upload, tag, runtime.GOARCH)
773-
774-
// If the image already exists (non version tag), check the build
775-
// number to prevent overwriting a newer commit if concurrent builds
776-
// are running. This is still a tiny bit racey if two published are
777-
// done at the same time, but that's extremely unlikely even on the
778-
// master branch.
779-
for _, img := range []string{gethImage, toolImage} {
780-
if exec.Command("docker", "pull", img).Run() != nil {
781-
continue // Generally the only failure is a missing image, which is good
782-
}
783-
buildnum, err := exec.Command("docker", "inspect", "--format", "{{index .Config.Labels \"buildnum\"}}", img).CombinedOutput()
784-
if err != nil {
785-
log.Fatalf("Failed to inspect container: %v\nOutput: %s", err, string(buildnum))
786-
}
787-
buildnum = bytes.TrimSpace(buildnum)
788-
789-
if len(buildnum) > 0 && len(env.Buildnum) > 0 {
790-
oldnum, err := strconv.Atoi(string(buildnum))
791-
if err != nil {
792-
log.Fatalf("Failed to parse old image build number: %v", err)
793-
}
794-
newnum, err := strconv.Atoi(env.Buildnum)
795-
if err != nil {
796-
log.Fatalf("Failed to parse current build number: %v", err)
797-
}
798-
if oldnum > newnum {
799-
log.Fatalf("Current build number %d not newer than existing %d", newnum, oldnum)
800-
} else {
801-
log.Printf("Updating %s from build %d to %d", img, oldnum, newnum)
802-
}
803-
}
804-
}
805-
build.MustRunCommand("docker", "image", "tag", fmt.Sprintf("%s:TAG", *upload), gethImage)
806-
build.MustRunCommand("docker", "image", "tag", fmt.Sprintf("%s:alltools-TAG", *upload), toolImage)
807-
build.MustRunCommand("docker", "push", gethImage)
808-
build.MustRunCommand("docker", "push", toolImage)
809-
}
810-
}
811-
// If multi-arch image manifest push is requested, assemble it
812-
if len(*manifest) != 0 {
813-
// Since different architectures are pushed by different builders, wait
814-
// until all required images are updated.
815-
var mismatch bool
816-
for i := 0; i < 2; i++ { // 2 attempts, second is race check
817-
mismatch = false // hope there's no mismatch now
818-
819-
for _, tag := range tags {
820-
for _, arch := range strings.Split(*manifest, ",") {
821-
gethImage := fmt.Sprintf("%s:%s-%s", *upload, tag, arch)
822-
toolImage := fmt.Sprintf("%s:alltools-%s-%s", *upload, tag, arch)
823-
824-
for _, img := range []string{gethImage, toolImage} {
825-
if out, err := exec.Command("docker", "pull", img).CombinedOutput(); err != nil {
826-
log.Printf("Required image %s unavailable: %v\nOutput: %s", img, err, out)
827-
mismatch = true
828-
break
829-
}
830-
buildnum, err := exec.Command("docker", "inspect", "--format", "{{index .Config.Labels \"buildnum\"}}", img).CombinedOutput()
831-
if err != nil {
832-
log.Fatalf("Failed to inspect container: %v\nOutput: %s", err, string(buildnum))
833-
}
834-
buildnum = bytes.TrimSpace(buildnum)
835-
836-
if string(buildnum) != env.Buildnum {
837-
log.Printf("Build number mismatch on %s: want %s, have %s", img, env.Buildnum, buildnum)
838-
mismatch = true
839-
break
840-
}
841-
}
842-
if mismatch {
843-
break
844-
}
845-
}
846-
if mismatch {
847-
break
848-
}
849-
}
850-
if mismatch {
851-
// Build numbers mismatching, retry in a short time to
852-
// avoid concurrent fails in both publisher images. If
853-
// however the retry failed too, it means the concurrent
854-
// builder is still crunching, let that do the publish.
855-
if i == 0 {
856-
time.Sleep(30 * time.Second)
857-
}
858-
continue
859-
}
860-
break
861-
}
862-
if mismatch {
863-
log.Println("Relinquishing publish to other builder")
864-
return
865-
}
866-
// Assemble and push the Geth manifest image
867-
for _, tag := range tags {
868-
gethImage := fmt.Sprintf("%s:%s", *upload, tag)
869-
870-
var gethSubImages []string
871-
for _, arch := range strings.Split(*manifest, ",") {
872-
gethSubImages = append(gethSubImages, gethImage+"-"+arch)
873-
}
874-
build.MustRunCommand("docker", append([]string{"manifest", "create", gethImage}, gethSubImages...)...)
875-
build.MustRunCommand("docker", "manifest", "push", gethImage)
876-
}
877-
// Assemble and push the alltools manifest image
878-
for _, tag := range tags {
879-
toolImage := fmt.Sprintf("%s:alltools-%s", *upload, tag)
880-
881-
var toolSubImages []string
882-
for _, arch := range strings.Split(*manifest, ",") {
883-
toolSubImages = append(toolSubImages, toolImage+"-"+arch)
884-
}
885-
build.MustRunCommand("docker", append([]string{"manifest", "create", toolImage}, toolSubImages...)...)
886-
build.MustRunCommand("docker", "manifest", "push", toolImage)
762+
// Need to create a mult-arch builder
763+
build.MustRunCommand("docker", "buildx", "create", "--use", "--name", "multi-arch-builder", "--platform", *platform)
764+
765+
for _, spec := range []struct {
766+
file string
767+
base string
768+
}{
769+
{file: "Dockerfile", base: fmt.Sprintf("%s:", *upload)},
770+
{file: "Dockerfile.alltools", base: fmt.Sprintf("%s:alltools-", *upload)},
771+
} {
772+
for _, tag := range tags { // latest, stable etc
773+
gethImage := fmt.Sprintf("%s%s", spec.base, tag)
774+
build.MustRunCommand("docker", "buildx", "build",
775+
"--build-arg", "COMMIT="+env.Commit,
776+
"--build-arg", "VERSION="+params.VersionWithMeta,
777+
"--build-arg", "BUILDNUM="+env.Buildnum,
778+
"--tag", gethImage,
779+
"--platform", *platform,
780+
"--push",
781+
"--file", spec.file, ".")
887782
}
888783
}
889784
}

cmd/geth/chaincmd.go

+28-34
Original file line numberDiff line numberDiff line change
@@ -221,22 +221,23 @@ func initGenesis(ctx *cli.Context) error {
221221
v := ctx.Uint64(utils.OverrideVerkle.Name)
222222
overrides.OverrideVerkle = &v
223223
}
224-
for _, name := range []string{"chaindata", "lightchaindata"} {
225-
chaindb, err := stack.OpenDatabaseWithFreezer(name, 0, 0, ctx.String(utils.AncientFlag.Name), "", false)
226-
if err != nil {
227-
utils.Fatalf("Failed to open database: %v", err)
228-
}
229-
defer chaindb.Close()
230224

231-
triedb := utils.MakeTrieDatabase(ctx, chaindb, ctx.Bool(utils.CachePreimagesFlag.Name), false, genesis.IsVerkle())
232-
defer triedb.Close()
225+
chaindb, err := stack.OpenDatabaseWithFreezer("chaindata", 0, 0, ctx.String(utils.AncientFlag.Name), "", false)
226+
if err != nil {
227+
utils.Fatalf("Failed to open database: %v", err)
228+
}
229+
defer chaindb.Close()
230+
231+
triedb := utils.MakeTrieDatabase(ctx, chaindb, ctx.Bool(utils.CachePreimagesFlag.Name), false, genesis.IsVerkle())
232+
defer triedb.Close()
233233

234-
_, hash, err := core.SetupGenesisBlockWithOverride(chaindb, triedb, genesis, &overrides)
235-
if err != nil {
236-
utils.Fatalf("Failed to write genesis block: %v", err)
237-
}
238-
log.Info("Successfully wrote genesis state", "database", name, "hash", hash)
234+
_, hash, err := core.SetupGenesisBlockWithOverride(chaindb, triedb, genesis, &overrides)
235+
if err != nil {
236+
utils.Fatalf("Failed to write genesis block: %v", err)
239237
}
238+
239+
log.Info("Successfully wrote genesis state", "database", "chaindata", "hash", hash)
240+
240241
return nil
241242
}
242243

@@ -258,29 +259,22 @@ func dumpGenesis(ctx *cli.Context) error {
258259

259260
// dump whatever already exists in the datadir
260261
stack, _ := makeConfigNode(ctx)
261-
for _, name := range []string{"chaindata", "lightchaindata"} {
262-
db, err := stack.OpenDatabase(name, 0, 0, "", true)
263-
if err != nil {
264-
if !os.IsNotExist(err) {
265-
return err
266-
}
267-
continue
268-
}
269-
genesis, err := core.ReadGenesis(db)
270-
if err != nil {
271-
utils.Fatalf("failed to read genesis: %s", err)
272-
}
273-
db.Close()
274262

275-
if err := json.NewEncoder(os.Stdout).Encode(*genesis); err != nil {
276-
utils.Fatalf("could not encode stored genesis: %s", err)
277-
}
278-
return nil
263+
db, err := stack.OpenDatabase("chaindata", 0, 0, "", true)
264+
if err != nil {
265+
return err
279266
}
280-
if ctx.IsSet(utils.DataDirFlag.Name) {
281-
utils.Fatalf("no existing datadir at %s", stack.Config().DataDir)
267+
defer db.Close()
268+
269+
genesis, err = core.ReadGenesis(db)
270+
if err != nil {
271+
utils.Fatalf("failed to read genesis: %s", err)
282272
}
283-
utils.Fatalf("no network preset provided, and no genesis exists in the default datadir")
273+
274+
if err := json.NewEncoder(os.Stdout).Encode(*genesis); err != nil {
275+
utils.Fatalf("could not encode stored genesis: %s", err)
276+
}
277+
284278
return nil
285279
}
286280

@@ -557,7 +551,7 @@ func parseDumpConfig(ctx *cli.Context, db ethdb.Database) (*state.DumpConfig, co
557551
default:
558552
return nil, common.Hash{}, fmt.Errorf("invalid start argument: %x. 20 or 32 hex-encoded bytes required", startArg)
559553
}
560-
var conf = &state.DumpConfig{
554+
conf := &state.DumpConfig{
561555
SkipCode: ctx.Bool(utils.ExcludeCodeFlag.Name),
562556
SkipStorage: ctx.Bool(utils.ExcludeStorageFlag.Name),
563557
OnlyWithAddresses: !ctx.Bool(utils.IncludeIncompletesFlag.Name),

cmd/utils/flags.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -1925,7 +1925,7 @@ func SetDNSDiscoveryDefaults(cfg *ethconfig.Config, genesis common.Hash) {
19251925

19261926
// RegisterEthService adds an Ethereum client to the stack.
19271927
// The second return value is the full node instance.
1928-
func RegisterEthService(stack *node.Node, cfg *ethconfig.Config) (ethapi.Backend, *eth.Ethereum) {
1928+
func RegisterEthService(stack *node.Node, cfg *ethconfig.Config) (*eth.EthAPIBackend, *eth.Ethereum) {
19291929
backend, err := eth.New(stack, cfg)
19301930
if err != nil {
19311931
Fatalf("Failed to register the Ethereum service: %v", err)
@@ -1935,7 +1935,7 @@ func RegisterEthService(stack *node.Node, cfg *ethconfig.Config) (ethapi.Backend
19351935
}
19361936

19371937
// RegisterEthStatsService configures the Ethereum Stats daemon and adds it to the node.
1938-
func RegisterEthStatsService(stack *node.Node, backend ethapi.Backend, url string) {
1938+
func RegisterEthStatsService(stack *node.Node, backend *eth.EthAPIBackend, url string) {
19391939
if err := ethstats.New(stack, backend, backend.Engine(), url); err != nil {
19401940
Fatalf("Failed to register the Ethereum Stats service: %v", err)
19411941
}
@@ -2061,8 +2061,6 @@ func MakeChainDatabase(ctx *cli.Context, stack *node.Node, readonly bool) ethdb.
20612061
break
20622062
}
20632063
chainDb = remotedb.New(client)
2064-
case ctx.String(SyncModeFlag.Name) == "light":
2065-
chainDb, err = stack.OpenDatabase("lightchaindata", cache, handles, "", readonly)
20662064
default:
20672065
chainDb, err = stack.OpenDatabaseWithFreezer("chaindata", cache, handles, ctx.String(AncientFlag.Name), "", readonly)
20682066
}

0 commit comments

Comments
 (0)