Skip to content

Commit 386c3de

Browse files
committed
Merge branch 'master' into release/1.16
2 parents 737ffd1 + 044828e commit 386c3de

Some content is hidden

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

78 files changed

+2004
-472
lines changed

.gitea/workflows/release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,27 @@ jobs:
122122
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
123123
AZURE_BLOBSTORE_TOKEN: ${{ secrets.AZURE_BLOBSTORE_TOKEN }}
124124

125+
keeper:
126+
name: Keeper Build
127+
runs-on: ubuntu-latest
128+
steps:
129+
- uses: actions/checkout@v4
130+
131+
- name: Set up Go
132+
uses: actions/setup-go@v5
133+
with:
134+
go-version: 1.24
135+
cache: false
136+
137+
- name: Install cross toolchain
138+
run: |
139+
apt-get update
140+
apt-get -yq --no-install-suggests --no-install-recommends install gcc-multilib
141+
142+
- name: Build (amd64)
143+
run: |
144+
go run build/ci.go keeper -dlgo
145+
125146
windows:
126147
name: Windows Build
127148
runs-on: "win-11"

.github/workflows/go.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,47 @@ jobs:
3434
go run build/ci.go check_generate
3535
go run build/ci.go check_baddeps
3636
37+
keeper:
38+
name: Keeper Builds
39+
needs: test
40+
runs-on: [self-hosted-ghr, size-l-x64]
41+
steps:
42+
- uses: actions/checkout@v4
43+
with:
44+
submodules: true
45+
46+
- name: Set up Go
47+
uses: actions/setup-go@v5
48+
with:
49+
go-version: '1.25'
50+
cache: false
51+
52+
- name: Build
53+
run: go run build/ci.go keeper
54+
55+
test-32bit:
56+
name: "32bit tests"
57+
needs: test
58+
runs-on: [self-hosted-ghr, size-l-x64]
59+
steps:
60+
- uses: actions/checkout@v4
61+
with:
62+
submodules: false
63+
64+
- name: Set up Go
65+
uses: actions/setup-go@v5
66+
with:
67+
go-version: '1.25'
68+
cache: false
69+
70+
- name: Install cross toolchain
71+
run: |
72+
apt-get update
73+
apt-get -yq --no-install-suggests --no-install-recommends install gcc-multilib
74+
75+
- name: Build
76+
run: go run build/ci.go test -arch 386 -short -p 8
77+
3778
test:
3879
name: Test
3980
needs: lint

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,5 @@ cmd/ethkey/ethkey
5555
cmd/evm/evm
5656
cmd/geth/geth
5757
cmd/rlpdump/rlpdump
58-
cmd/workload/workload
58+
cmd/workload/workload
59+
cmd/keeper/keeper

accounts/abi/bind/v2/util_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,9 @@ func TestWaitDeployedCornerCases(t *testing.T) {
144144
done := make(chan struct{})
145145
go func() {
146146
defer close(done)
147-
want := errors.New("context canceled")
148147
_, err := bind.WaitDeployed(ctx, backend.Client(), tx.Hash())
149-
if err == nil || errors.Is(want, err) {
150-
t.Errorf("error mismatch: want %v, got %v", want, err)
148+
if !errors.Is(err, context.Canceled) {
149+
t.Errorf("error mismatch: want %v, got %v", context.Canceled, err)
151150
}
152151
}()
153152

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ for:
3636
- go run build/ci.go archive -arch %GETH_ARCH% -type zip -signer WINDOWS_SIGNING_KEY -upload gethstore/builds
3737
- go run build/ci.go nsis -arch %GETH_ARCH% -signer WINDOWS_SIGNING_KEY -upload gethstore/builds
3838
test_script:
39-
- go run build/ci.go test -dlgo -arch %GETH_ARCH% -cc %GETH_CC% -short -skip-spectests
39+
- go run build/ci.go test -dlgo -arch %GETH_ARCH% -cc %GETH_CC% -short

beacon/params/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ func (c *ChainConfig) LoadForks(file []byte) error {
108108
switch version := value.(type) {
109109
case int:
110110
versions[name] = new(big.Int).SetUint64(uint64(version)).FillBytes(make([]byte, 4))
111+
case int64:
112+
versions[name] = new(big.Int).SetUint64(uint64(version)).FillBytes(make([]byte, 4))
111113
case uint64:
112114
versions[name] = new(big.Int).SetUint64(version).FillBytes(make([]byte, 4))
113115
case string:
@@ -125,6 +127,8 @@ func (c *ChainConfig) LoadForks(file []byte) error {
125127
switch epoch := value.(type) {
126128
case int:
127129
epochs[name] = uint64(epoch)
130+
case int64:
131+
epochs[name] = uint64(epoch)
128132
case uint64:
129133
epochs[name] = epoch
130134
case string:

build/ci.go

Lines changed: 106 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ Available commands are:
3131
install [ -arch architecture ] [ -cc compiler ] [ packages... ] -- builds packages and executables
3232
test [ -coverage ] [ packages... ] -- runs the tests
3333
34+
keeper [ -dlgo ]
35+
keeper-archive [ -signer key-envvar ] [ -signify key-envvar ] [ -upload dest ]
36+
3437
archive [ -arch architecture ] [ -type zip|tar ] [ -signer key-envvar ] [ -signify key-envvar ] [ -upload dest ] -- archives build artifacts
3538
importkeys -- imports signing keys from env
3639
debsrc [ -signer key-id ] [ -upload dest ] -- creates a debian source package
@@ -86,6 +89,30 @@ var (
8689
executablePath("clef"),
8790
}
8891

92+
// Keeper build targets with their configurations
93+
keeperTargets = []struct {
94+
Name string
95+
GOOS string
96+
GOARCH string
97+
CC string
98+
Tags string
99+
Env map[string]string
100+
}{
101+
{
102+
Name: "ziren",
103+
GOOS: "linux",
104+
GOARCH: "mipsle",
105+
// enable when cgo works
106+
// CC: "mipsel-linux-gnu-gcc",
107+
Tags: "ziren",
108+
Env: map[string]string{"GOMIPS": "softfloat", "CGO_ENABLED": "0"},
109+
},
110+
{
111+
Name: "example",
112+
Tags: "example",
113+
},
114+
}
115+
89116
// A debian package is created for all executables listed here.
90117
debExecutables = []debExecutable{
91118
{
@@ -178,6 +205,10 @@ func main() {
178205
doPurge(os.Args[2:])
179206
case "sanitycheck":
180207
doSanityCheck()
208+
case "keeper":
209+
doInstallKeeper(os.Args[2:])
210+
case "keeper-archive":
211+
doKeeperArchive(os.Args[2:])
181212
default:
182213
log.Fatal("unknown command ", os.Args[1])
183214
}
@@ -212,9 +243,6 @@ func doInstall(cmdline []string) {
212243
// Configure the build.
213244
gobuild := tc.Go("build", buildFlags(env, *staticlink, buildTags)...)
214245

215-
// We use -trimpath to avoid leaking local paths into the built executables.
216-
gobuild.Args = append(gobuild.Args, "-trimpath")
217-
218246
// Show packages during build.
219247
gobuild.Args = append(gobuild.Args, "-v")
220248

@@ -234,6 +262,43 @@ func doInstall(cmdline []string) {
234262
}
235263
}
236264

265+
// doInstallKeeper builds keeper binaries for all supported targets.
266+
func doInstallKeeper(cmdline []string) {
267+
var dlgo = flag.Bool("dlgo", false, "Download Go and build with it")
268+
269+
flag.CommandLine.Parse(cmdline)
270+
env := build.Env()
271+
272+
// Configure the toolchain.
273+
tc := build.GoToolchain{}
274+
if *dlgo {
275+
csdb := download.MustLoadChecksums("build/checksums.txt")
276+
tc.Root = build.DownloadGo(csdb)
277+
}
278+
279+
for _, target := range keeperTargets {
280+
log.Printf("Building keeper-%s", target.Name)
281+
282+
// Configure the build.
283+
tc.GOARCH = target.GOARCH
284+
tc.GOOS = target.GOOS
285+
tc.CC = target.CC
286+
gobuild := tc.Go("build", buildFlags(env, true, []string{target.Tags})...)
287+
gobuild.Dir = "./cmd/keeper"
288+
gobuild.Args = append(gobuild.Args, "-v")
289+
290+
for key, value := range target.Env {
291+
gobuild.Env = append(gobuild.Env, key+"="+value)
292+
}
293+
outputName := fmt.Sprintf("keeper-%s", target.Name)
294+
295+
args := slices.Clone(gobuild.Args)
296+
args = append(args, "-o", executablePath(outputName))
297+
args = append(args, ".")
298+
build.MustRun(&exec.Cmd{Path: gobuild.Path, Args: args, Env: gobuild.Env})
299+
}
300+
}
301+
237302
// buildFlags returns the go tool flags for building.
238303
func buildFlags(env build.Environment, staticLinking bool, buildTags []string) (flags []string) {
239304
var ld []string
@@ -272,6 +337,8 @@ func buildFlags(env build.Environment, staticLinking bool, buildTags []string) (
272337
if len(buildTags) > 0 {
273338
flags = append(flags, "-tags", strings.Join(buildTags, ","))
274339
}
340+
// We use -trimpath to avoid leaking local paths into the built executables.
341+
flags = append(flags, "-trimpath")
275342
return flags
276343
}
277344

@@ -281,24 +348,23 @@ func buildFlags(env build.Environment, staticLinking bool, buildTags []string) (
281348

282349
func doTest(cmdline []string) {
283350
var (
284-
dlgo = flag.Bool("dlgo", false, "Download Go and build with it")
285-
arch = flag.String("arch", "", "Run tests for given architecture")
286-
cc = flag.String("cc", "", "Sets C compiler binary")
287-
coverage = flag.Bool("coverage", false, "Whether to record code coverage")
288-
verbose = flag.Bool("v", false, "Whether to log verbosely")
289-
race = flag.Bool("race", false, "Execute the race detector")
290-
short = flag.Bool("short", false, "Pass the 'short'-flag to go test")
291-
cachedir = flag.String("cachedir", "./build/cache", "directory for caching downloads")
292-
skipspectests = flag.Bool("skip-spectests", false, "Skip downloading execution-spec-tests fixtures")
293-
threads = flag.Int("p", 1, "Number of CPU threads to use for testing")
351+
dlgo = flag.Bool("dlgo", false, "Download Go and build with it")
352+
arch = flag.String("arch", "", "Run tests for given architecture")
353+
cc = flag.String("cc", "", "Sets C compiler binary")
354+
coverage = flag.Bool("coverage", false, "Whether to record code coverage")
355+
verbose = flag.Bool("v", false, "Whether to log verbosely")
356+
race = flag.Bool("race", false, "Execute the race detector")
357+
short = flag.Bool("short", false, "Pass the 'short'-flag to go test")
358+
cachedir = flag.String("cachedir", "./build/cache", "directory for caching downloads")
359+
threads = flag.Int("p", 1, "Number of CPU threads to use for testing")
294360
)
295361
flag.CommandLine.Parse(cmdline)
296362

297363
// Load checksums file (needed for both spec tests and dlgo)
298364
csdb := download.MustLoadChecksums("build/checksums.txt")
299365

300366
// Get test fixtures.
301-
if !*skipspectests {
367+
if !*short {
302368
downloadSpecTestFixtures(csdb, *cachedir)
303369
}
304370

@@ -630,6 +696,32 @@ func doArchive(cmdline []string) {
630696
}
631697
}
632698

699+
func doKeeperArchive(cmdline []string) {
700+
var (
701+
signer = flag.String("signer", "", `Environment variable holding the signing key (e.g. LINUX_SIGNING_KEY)`)
702+
signify = flag.String("signify", "", `Environment variable holding the signify key (e.g. LINUX_SIGNIFY_KEY)`)
703+
upload = flag.String("upload", "", `Destination to upload the archives (usually "gethstore/builds")`)
704+
)
705+
flag.CommandLine.Parse(cmdline)
706+
707+
var (
708+
env = build.Env()
709+
vsn = version.Archive(env.Commit)
710+
keeper = "keeper-" + vsn + ".tar.gz"
711+
)
712+
maybeSkipArchive(env)
713+
files := []string{"COPYING"}
714+
for _, target := range keeperTargets {
715+
files = append(files, executablePath(fmt.Sprintf("keeper-%s", target.Name)))
716+
}
717+
if err := build.WriteArchive(keeper, files); err != nil {
718+
log.Fatal(err)
719+
}
720+
if err := archiveUpload(keeper, *upload, *signer, *signify); err != nil {
721+
log.Fatal(err)
722+
}
723+
}
724+
633725
func archiveBasename(arch string, archiveVersion string) string {
634726
platform := runtime.GOOS + "-" + arch
635727
if arch == "arm" {

cmd/devp2p/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ with our test chain. The chain files are located in `./cmd/devp2p/internal/ethte
121121
--nat=none \
122122
--networkid 3503995874084926 \
123123
--verbosity 5 \
124-
--authrpc.jwtsecret 0x7365637265747365637265747365637265747365637265747365637265747365
124+
--authrpc.jwtsecret jwt.secret
125125

126126
Note that the tests also require access to the engine API.
127127
The test suite can now be executed using the devp2p tool.
@@ -130,7 +130,7 @@ The test suite can now be executed using the devp2p tool.
130130
--chain internal/ethtest/testdata \
131131
--node enode://.... \
132132
--engineapi http://127.0.0.1:8551 \
133-
--jwtsecret 0x7365637265747365637265747365637265747365637265747365637265747365
133+
--jwtsecret $(cat jwt.secret)
134134

135135
Repeat the above process (re-initialising the node) in order to run the Eth Protocol test suite again.
136136

cmd/devp2p/rlpxcmd.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@ type testParams struct {
143143

144144
func cliTestParams(ctx *cli.Context) *testParams {
145145
nodeStr := ctx.String(testNodeFlag.Name)
146-
if nodeStr == "" {
147-
exit(fmt.Errorf("missing -%s", testNodeFlag.Name))
148-
}
149146
node, err := parseNode(nodeStr)
150147
if err != nil {
151148
exit(err)
@@ -156,14 +153,5 @@ func cliTestParams(ctx *cli.Context) *testParams {
156153
jwt: ctx.String(testNodeJWTFlag.Name),
157154
chainDir: ctx.String(testChainDirFlag.Name),
158155
}
159-
if p.engineAPI == "" {
160-
exit(fmt.Errorf("missing -%s", testNodeEngineFlag.Name))
161-
}
162-
if p.jwt == "" {
163-
exit(fmt.Errorf("missing -%s", testNodeJWTFlag.Name))
164-
}
165-
if p.chainDir == "" {
166-
exit(fmt.Errorf("missing -%s", testChainDirFlag.Name))
167-
}
168156
return &p
169157
}

cmd/devp2p/runtest.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,26 +39,29 @@ var (
3939
}
4040

4141
// for eth/snap tests
42-
testChainDirFlag = &cli.StringFlag{
42+
testChainDirFlag = &cli.PathFlag{
4343
Name: "chain",
4444
Usage: "Test chain directory (required)",
4545
Category: flags.TestingCategory,
46+
Required: true,
4647
}
4748
testNodeFlag = &cli.StringFlag{
4849
Name: "node",
4950
Usage: "Peer-to-Peer endpoint (ENR) of the test node (required)",
5051
Category: flags.TestingCategory,
52+
Required: true,
5153
}
5254
testNodeJWTFlag = &cli.StringFlag{
5355
Name: "jwtsecret",
5456
Usage: "JWT secret for the engine API of the test node (required)",
5557
Category: flags.TestingCategory,
56-
Value: "0x7365637265747365637265747365637265747365637265747365637265747365",
58+
Required: true,
5759
}
5860
testNodeEngineFlag = &cli.StringFlag{
5961
Name: "engineapi",
6062
Usage: "Engine API endpoint of the test node (required)",
6163
Category: flags.TestingCategory,
64+
Required: true,
6265
}
6366

6467
// These two are specific to the discovery tests.

0 commit comments

Comments
 (0)