From a28cc28badbdcdea6a1f4ee212aa56879128dcf9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Aug 2026 16:52:52 +0000 Subject: [PATCH 1/3] build(deps): Bump the docker-dependencies group across 2 directories with 1 update Bumps the docker-dependencies group with 1 update in the / directory: golang. Bumps the docker-dependencies group with 1 update in the /testutil/promrated directory: golang. Updates `golang` from 1.26.6-trixie to 1.27.0-trixie Updates `golang` from 1.26.6-trixie to 1.27.0-trixie Updates `golang` from 1.26.6-alpine to 1.27.0-alpine Updates `golang` from 1.26.6-alpine to 1.27.0-alpine --- updated-dependencies: - dependency-name: golang dependency-version: 1.27.0-alpine dependency-type: direct:production update-type: version-update:semver-minor dependency-group: docker-dependencies - dependency-name: golang dependency-version: 1.27.0-trixie dependency-type: direct:production update-type: version-update:semver-minor dependency-group: docker-dependencies ... Signed-off-by: dependabot[bot] --- Dockerfile | 2 +- testutil/promrated/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c9cc3b819..22b9ad471 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Container for building Go binary. -FROM golang:1.26.6-trixie AS builder +FROM golang:1.27.0-trixie AS builder # Install dependencies RUN apt-get update && apt-get install -y --no-install-recommends build-essential git diff --git a/testutil/promrated/Dockerfile b/testutil/promrated/Dockerfile index b7029fff2..7bd79c098 100644 --- a/testutil/promrated/Dockerfile +++ b/testutil/promrated/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.26.6-alpine AS builder +FROM golang:1.27.0-alpine AS builder # Install dependencies RUN apk add --no-cache build-base git From 50cdddda2ee79db1bd768eb9b8fe8f87706f7140 Mon Sep 17 00:00:00 2001 From: kalo <24719519+KaloyanTanev@users.noreply.github.com> Date: Tue, 1 Sep 2026 18:37:42 +0300 Subject: [PATCH 2/3] bump go to 1.27 --- .github/actions/setup-go/action.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/golangci-lint.yml | 2 +- .golangci.yml | 3 +- .pre-commit-config.yaml | 2 +- CLAUDE.md | 2 +- app/obolapi/exit_model_test.go | 12 +- cmd/feerecipientfetch_internal_test.go | 72 ++++---- cmd/feerecipientlist_internal_test.go | 170 ++++++++----------- cmd/feerecipientsign_internal_test.go | 90 +++++----- cmd/testbeacon_internal_test.go | 4 +- cmd/testinfra_internal_test.go | 4 +- cmd/testmev_internal_test.go | 4 +- cmd/testvalidator_internal_test.go | 4 +- core/aggsigdb/memory.go | 2 +- core/dutydb/memory_test.go | 14 +- core/fetcher/graffiti.go | 2 +- core/tracker/tracker_internal_test.go | 10 +- core/validatorapi/router_internal_test.go | 42 +++-- dkg/dkg.go | 2 +- go.mod | 2 +- testutil/fuzz.go | 12 +- testutil/integration/infosync_test.go | 4 +- testutil/integration/ping_test.go | 8 +- testutil/obolapimock/deposit.go | 8 +- testutil/random.go | 198 +++++++++------------- 26 files changed, 282 insertions(+), 395 deletions(-) diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml index 373ad7233..cefb86d53 100644 --- a/.github/actions/setup-go/action.yml +++ b/.github/actions/setup-go/action.yml @@ -13,7 +13,7 @@ runs: uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 with: check-latest: true - go-version: "1.26" + go-version: "1.27" - name: Verify setup shell: bash diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 35f3a67f5..8f37c65a1 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -21,7 +21,7 @@ on: - cron: "18 19 * * 6" env: - GOLANG_VERSION: "1.26" + GOLANG_VERSION: "1.27" jobs: analyze: diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 2c5be5724..e9ff62534 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -19,4 +19,4 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 with: - version: v2.12.2 + version: v2.13.2 diff --git a/.golangci.yml b/.golangci.yml index efac98b42..4b61e995d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,6 @@ version: "2" run: - go: "1.26" + go: "1.27" linters: default: all disable: @@ -9,6 +9,7 @@ linters: - cyclop - err113 - exhaustruct + - exhaustruct_v5 - forcetypeassert - funlen - funcorder diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 10f97f369..679670679 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: rev: v0.0.6 hooks: - id: check-go-version - args: [-v=go1.26] # Only check minor version locally + args: [-v=go1.27] # Only check minor version locally pass_filenames: false additional_dependencies: [packaging] - id: check-licence-header diff --git a/CLAUDE.md b/CLAUDE.md index 60c486d57..5abb111b3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -127,7 +127,7 @@ testutil/ # Test utilities, mocks, golden files ## Code Style and Guidelines ### Go Version -Requires Go 1.26 (enforced by pre-commit hooks) +Requires Go 1.27 (enforced by pre-commit hooks) ### Core Principles (from [docs/goguidelines.md](docs/goguidelines.md)) 1. **Functions over methods**: Prefer stateless functions over stateful objects diff --git a/app/obolapi/exit_model_test.go b/app/obolapi/exit_model_test.go index e2ce32b9e..c664ca1dd 100644 --- a/app/obolapi/exit_model_test.go +++ b/app/obolapi/exit_model_test.go @@ -16,15 +16,13 @@ import ( func TestPartialExitRequest(t *testing.T) { pr := obolapi.PartialExitRequest{ - UnsignedPartialExitRequest: obolapi.UnsignedPartialExitRequest{ - PartialExits: []obolapi.ExitBlob{ - { - PublicKey: string(testutil.RandomCorePubKey(t)), - SignedExitMessage: *testutil.RandomExit(), - }, + PartialExits: []obolapi.ExitBlob{ + { + PublicKey: string(testutil.RandomCorePubKey(t)), + SignedExitMessage: *testutil.RandomExit(), }, - ShareIdx: 0, }, + ShareIdx: 0, Signature: testutil.RandomSecp256k1Signature(), } diff --git a/cmd/feerecipientfetch_internal_test.go b/cmd/feerecipientfetch_internal_test.go index 5d81d331f..f8340ecd4 100644 --- a/cmd/feerecipientfetch_internal_test.go +++ b/cmd/feerecipientfetch_internal_test.go @@ -74,16 +74,14 @@ func signConfigForOperator(c feeRecipientTestCluster, opIdx int, validatorPubkey baseDir := filepath.Join(c.root, fmt.Sprintf("op%d", opIdx)) return feerecipientSignConfig{ - feerecipientConfig: feerecipientConfig{ - ValidatorPublicKeys: []string{validatorPubkey}, - PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), - LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), - PublishAddress: c.srvURL, - PublishTimeout: 10 * time.Second, - }, - ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), - FeeRecipient: feeRecipient, - Timestamp: timestamp, + ValidatorPublicKeys: []string{validatorPubkey}, + PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), + LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), + PublishAddress: c.srvURL, + PublishTimeout: 10 * time.Second, + ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), + FeeRecipient: feeRecipient, + Timestamp: timestamp, } } @@ -102,13 +100,11 @@ func fetchFeeRecipient(ctx context.Context, t *testing.T, c feeRecipientTestClus t.Helper() fetchConfig := feerecipientFetchConfig{ - feerecipientConfig: feerecipientConfig{ - ValidatorPublicKeys: validatorPubkeys, - LockFilePath: filepath.Join(c.root, "op0", "cluster-lock.json"), - OverridesFilePath: overridesFile, - PublishAddress: c.srvURL, - PublishTimeout: 10 * time.Second, - }, + ValidatorPublicKeys: validatorPubkeys, + LockFilePath: filepath.Join(c.root, "op0", "cluster-lock.json"), + OverridesFilePath: overridesFile, + PublishAddress: c.srvURL, + PublishTimeout: 10 * time.Second, } require.NoError(t, runFeeRecipientFetch(ctx, fetchConfig)) @@ -287,11 +283,9 @@ func TestFeeRecipientFetchSkipsInvalidSignature(t *testing.T) { func TestFeeRecipientFetchInvalidLockFile(t *testing.T) { config := feerecipientFetchConfig{ - feerecipientConfig: feerecipientConfig{ - LockFilePath: "nonexistent-lock.json", - PublishAddress: "http://localhost:0", - PublishTimeout: time.Second, - }, + LockFilePath: "nonexistent-lock.json", + PublishAddress: "http://localhost:0", + PublishTimeout: time.Second, } err := runFeeRecipientFetch(t.Context(), config) @@ -308,11 +302,9 @@ func TestFeeRecipientFetchAPIUnreachable(t *testing.T) { srv.Close() config := feerecipientFetchConfig{ - feerecipientConfig: feerecipientConfig{ - LockFilePath: filepath.Join(c.root, "op0", "cluster-lock.json"), - PublishAddress: srv.URL, - PublishTimeout: time.Second, - }, + LockFilePath: filepath.Join(c.root, "op0", "cluster-lock.json"), + PublishAddress: srv.URL, + PublishTimeout: time.Second, } err := runFeeRecipientFetch(ctx, config) @@ -357,15 +349,13 @@ func TestFeeRecipientFetchNoQuorum(t *testing.T) { baseDir := filepath.Join(root, "op0") signConfig := feerecipientSignConfig{ - feerecipientConfig: feerecipientConfig{ - ValidatorPublicKeys: []string{validatorPubkey}, - PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), - LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), - PublishAddress: srv.URL, - PublishTimeout: 10 * time.Second, - }, - ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), - FeeRecipient: newFeeRecipient, + ValidatorPublicKeys: []string{validatorPubkey}, + PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), + LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), + PublishAddress: srv.URL, + PublishTimeout: 10 * time.Second, + ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), + FeeRecipient: newFeeRecipient, } require.NoError(t, runFeeRecipientSign(ctx, signConfig)) @@ -374,12 +364,10 @@ func TestFeeRecipientFetchNoQuorum(t *testing.T) { overridesFile := filepath.Join(root, "output", "builder_registrations_overrides.json") fetchConfig := feerecipientFetchConfig{ - feerecipientConfig: feerecipientConfig{ - LockFilePath: filepath.Join(root, "op0", "cluster-lock.json"), - OverridesFilePath: overridesFile, - PublishAddress: srv.URL, - PublishTimeout: 10 * time.Second, - }, + LockFilePath: filepath.Join(root, "op0", "cluster-lock.json"), + OverridesFilePath: overridesFile, + PublishAddress: srv.URL, + PublishTimeout: 10 * time.Second, } require.NoError(t, runFeeRecipientFetch(ctx, fetchConfig)) diff --git a/cmd/feerecipientlist_internal_test.go b/cmd/feerecipientlist_internal_test.go index 9d91ab891..81b736504 100644 --- a/cmd/feerecipientlist_internal_test.go +++ b/cmd/feerecipientlist_internal_test.go @@ -49,12 +49,10 @@ func TestFeeRecipientListValid(t *testing.T) { require.NoError(t, os.WriteFile(lockFile, lockJSON, 0o644)) config := feerecipientListConfig{ - feerecipientConfig: feerecipientConfig{ - LockFilePath: lockFile, - OverridesFilePath: filepath.Join(t.TempDir(), "nonexistent-overrides.json"), - PublishAddress: "http://127.0.0.1:0", - PublishTimeout: 500 * time.Millisecond, - }, + LockFilePath: lockFile, + OverridesFilePath: filepath.Join(t.TempDir(), "nonexistent-overrides.json"), + PublishAddress: "http://127.0.0.1:0", + PublishTimeout: 500 * time.Millisecond, } require.NoError(t, runFeeRecipientList(t.Context(), config)) @@ -75,13 +73,11 @@ func TestFeeRecipientListWithFilter(t *testing.T) { require.NoError(t, os.WriteFile(lockFile, lockJSON, 0o644)) config := feerecipientListConfig{ - feerecipientConfig: feerecipientConfig{ - ValidatorPublicKeys: []string{lock.Validators[0].PublicKeyHex()}, - LockFilePath: lockFile, - OverridesFilePath: filepath.Join(t.TempDir(), "nonexistent-overrides.json"), - PublishAddress: "http://127.0.0.1:0", - PublishTimeout: 500 * time.Millisecond, - }, + ValidatorPublicKeys: []string{lock.Validators[0].PublicKeyHex()}, + LockFilePath: lockFile, + OverridesFilePath: filepath.Join(t.TempDir(), "nonexistent-overrides.json"), + PublishAddress: "http://127.0.0.1:0", + PublishTimeout: 500 * time.Millisecond, } require.NoError(t, runFeeRecipientList(t.Context(), config)) @@ -102,11 +98,9 @@ func TestFeeRecipientListInvalidPubkey(t *testing.T) { require.NoError(t, os.WriteFile(lockFile, lockJSON, 0o644)) config := feerecipientListConfig{ - feerecipientConfig: feerecipientConfig{ - ValidatorPublicKeys: []string{"0x" + strings.Repeat("ab", 48)}, - LockFilePath: lockFile, - OverridesFilePath: filepath.Join(t.TempDir(), "nonexistent-overrides.json"), - }, + ValidatorPublicKeys: []string{"0x" + strings.Repeat("ab", 48)}, + LockFilePath: lockFile, + OverridesFilePath: filepath.Join(t.TempDir(), "nonexistent-overrides.json"), } err = runFeeRecipientList(t.Context(), config) @@ -115,10 +109,8 @@ func TestFeeRecipientListInvalidPubkey(t *testing.T) { func TestFeeRecipientListInvalidLockFile(t *testing.T) { config := feerecipientListConfig{ - feerecipientConfig: feerecipientConfig{ - LockFilePath: "nonexistent-lock.json", - OverridesFilePath: filepath.Join(t.TempDir(), "nonexistent-overrides.json"), - }, + LockFilePath: "nonexistent-lock.json", + OverridesFilePath: filepath.Join(t.TempDir(), "nonexistent-overrides.json"), } err := runFeeRecipientList(t.Context(), config) @@ -153,12 +145,10 @@ func TestFeeRecipientListWithOverrides(t *testing.T) { require.NoError(t, os.WriteFile(overridesFile, overridesJSON, 0o644)) config := feerecipientListConfig{ - feerecipientConfig: feerecipientConfig{ - LockFilePath: lockFile, - OverridesFilePath: overridesFile, - PublishAddress: "http://127.0.0.1:0", - PublishTimeout: 500 * time.Millisecond, - }, + LockFilePath: lockFile, + OverridesFilePath: overridesFile, + PublishAddress: "http://127.0.0.1:0", + PublishTimeout: 500 * time.Millisecond, } require.NoError(t, runFeeRecipientList(t.Context(), config)) @@ -463,15 +453,13 @@ func TestFeeRecipientListFetchesRemote(t *testing.T) { baseDir := filepath.Join(root, fmt.Sprintf("op%d", opIdx)) signConfig := feerecipientSignConfig{ - feerecipientConfig: feerecipientConfig{ - ValidatorPublicKeys: []string{validatorPubkey}, - PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), - LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), - PublishAddress: srv.URL, - PublishTimeout: 10 * time.Second, - }, - ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), - FeeRecipient: newFeeRecipient, + ValidatorPublicKeys: []string{validatorPubkey}, + PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), + LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), + PublishAddress: srv.URL, + PublishTimeout: 10 * time.Second, + ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), + FeeRecipient: newFeeRecipient, } require.NoError(t, runFeeRecipientSign(ctx, signConfig), "operator %d submit feerecipient sign", opIdx) @@ -480,12 +468,10 @@ func TestFeeRecipientListFetchesRemote(t *testing.T) { overridesFile := filepath.Join(root, "output", "builder_registrations_overrides.json") listConfig := feerecipientListConfig{ - feerecipientConfig: feerecipientConfig{ - LockFilePath: filepath.Join(root, "op0", "cluster-lock.json"), - OverridesFilePath: overridesFile, - PublishAddress: srv.URL, - PublishTimeout: 10 * time.Second, - }, + LockFilePath: filepath.Join(root, "op0", "cluster-lock.json"), + OverridesFilePath: overridesFile, + PublishAddress: srv.URL, + PublishTimeout: 10 * time.Second, } require.NoError(t, runFeeRecipientList(ctx, listConfig)) @@ -532,26 +518,22 @@ func TestFeeRecipientListRemoteOnlyTriggersSuggestion(t *testing.T) { for opIdx := range lock.Threshold { baseDir := filepath.Join(root, fmt.Sprintf("op%d", opIdx)) signConfig := feerecipientSignConfig{ - feerecipientConfig: feerecipientConfig{ - ValidatorPublicKeys: []string{validatorPubkey}, - PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), - LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), - PublishAddress: srv.URL, - PublishTimeout: 10 * time.Second, - }, - ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), - FeeRecipient: newFeeRecipient, + ValidatorPublicKeys: []string{validatorPubkey}, + PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), + LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), + PublishAddress: srv.URL, + PublishTimeout: 10 * time.Second, + ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), + FeeRecipient: newFeeRecipient, } require.NoError(t, runFeeRecipientSign(ctx, signConfig)) } listConfig := feerecipientListConfig{ - feerecipientConfig: feerecipientConfig{ - LockFilePath: filepath.Join(root, "op0", "cluster-lock.json"), - OverridesFilePath: filepath.Join(t.TempDir(), "nonexistent-overrides.json"), - PublishAddress: srv.URL, - PublishTimeout: 10 * time.Second, - }, + LockFilePath: filepath.Join(root, "op0", "cluster-lock.json"), + OverridesFilePath: filepath.Join(t.TempDir(), "nonexistent-overrides.json"), + PublishAddress: srv.URL, + PublishTimeout: 10 * time.Second, } require.NoError(t, runFeeRecipientList(ctx, listConfig)) @@ -602,15 +584,13 @@ func TestFeeRecipientListOverridesMatchRemote(t *testing.T) { for opIdx := range lock.Threshold { baseDir := filepath.Join(root, fmt.Sprintf("op%d", opIdx)) signConfig := feerecipientSignConfig{ - feerecipientConfig: feerecipientConfig{ - ValidatorPublicKeys: []string{validatorPubkey}, - PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), - LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), - PublishAddress: srv.URL, - PublishTimeout: 10 * time.Second, - }, - ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), - FeeRecipient: newFeeRecipient, + ValidatorPublicKeys: []string{validatorPubkey}, + PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), + LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), + PublishAddress: srv.URL, + PublishTimeout: 10 * time.Second, + ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), + FeeRecipient: newFeeRecipient, } require.NoError(t, runFeeRecipientSign(ctx, signConfig)) } @@ -619,22 +599,18 @@ func TestFeeRecipientListOverridesMatchRemote(t *testing.T) { require.NoError(t, os.MkdirAll(filepath.Dir(overridesFile), 0o755)) fetchConfig := feerecipientFetchConfig{ - feerecipientConfig: feerecipientConfig{ - LockFilePath: filepath.Join(root, "op0", "cluster-lock.json"), - OverridesFilePath: overridesFile, - PublishAddress: srv.URL, - PublishTimeout: 10 * time.Second, - }, + LockFilePath: filepath.Join(root, "op0", "cluster-lock.json"), + OverridesFilePath: overridesFile, + PublishAddress: srv.URL, + PublishTimeout: 10 * time.Second, } require.NoError(t, runFeeRecipientFetch(ctx, fetchConfig)) listConfig := feerecipientListConfig{ - feerecipientConfig: feerecipientConfig{ - LockFilePath: filepath.Join(root, "op0", "cluster-lock.json"), - OverridesFilePath: overridesFile, - PublishAddress: srv.URL, - PublishTimeout: 10 * time.Second, - }, + LockFilePath: filepath.Join(root, "op0", "cluster-lock.json"), + OverridesFilePath: overridesFile, + PublishAddress: srv.URL, + PublishTimeout: 10 * time.Second, } require.NoError(t, runFeeRecipientList(ctx, listConfig)) @@ -668,12 +644,10 @@ func TestFeeRecipientListRemoteUnreachable(t *testing.T) { srv.Close() listConfig := feerecipientListConfig{ - feerecipientConfig: feerecipientConfig{ - LockFilePath: lockFile, - OverridesFilePath: filepath.Join(t.TempDir(), "nonexistent-overrides.json"), - PublishAddress: srv.URL, - PublishTimeout: 500 * time.Millisecond, - }, + LockFilePath: lockFile, + OverridesFilePath: filepath.Join(t.TempDir(), "nonexistent-overrides.json"), + PublishAddress: srv.URL, + PublishTimeout: 500 * time.Millisecond, } require.NoError(t, runFeeRecipientList(ctx, listConfig)) @@ -726,26 +700,22 @@ func TestFeeRecipientListIncompleteNoQuorum(t *testing.T) { for opIdx := range lock.Threshold - 1 { baseDir := filepath.Join(root, fmt.Sprintf("op%d", opIdx)) signConfig := feerecipientSignConfig{ - feerecipientConfig: feerecipientConfig{ - ValidatorPublicKeys: []string{validatorPubkey}, - PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), - LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), - PublishAddress: srv.URL, - PublishTimeout: 10 * time.Second, - }, - ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), - FeeRecipient: newFeeRecipient, + ValidatorPublicKeys: []string{validatorPubkey}, + PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), + LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), + PublishAddress: srv.URL, + PublishTimeout: 10 * time.Second, + ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), + FeeRecipient: newFeeRecipient, } require.NoError(t, runFeeRecipientSign(ctx, signConfig)) } listConfig := feerecipientListConfig{ - feerecipientConfig: feerecipientConfig{ - LockFilePath: filepath.Join(root, "op0", "cluster-lock.json"), - OverridesFilePath: filepath.Join(t.TempDir(), "nonexistent-overrides.json"), - PublishAddress: srv.URL, - PublishTimeout: 10 * time.Second, - }, + LockFilePath: filepath.Join(root, "op0", "cluster-lock.json"), + OverridesFilePath: filepath.Join(t.TempDir(), "nonexistent-overrides.json"), + PublishAddress: srv.URL, + PublishTimeout: 10 * time.Second, } require.NoError(t, runFeeRecipientList(ctx, listConfig)) diff --git a/cmd/feerecipientsign_internal_test.go b/cmd/feerecipientsign_internal_test.go index cd100fbdd..fe44b0618 100644 --- a/cmd/feerecipientsign_internal_test.go +++ b/cmd/feerecipientsign_internal_test.go @@ -67,15 +67,13 @@ func TestFeeRecipientSignValid(t *testing.T) { baseDir := filepath.Join(root, fmt.Sprintf("op%d", idx)) signConfig := feerecipientSignConfig{ - feerecipientConfig: feerecipientConfig{ - ValidatorPublicKeys: []string{lock.Validators[0].PublicKeyHex()}, - PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), - LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), - PublishAddress: srv.URL, - PublishTimeout: 10 * time.Second, - }, - ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), - FeeRecipient: "0x0000000000000000000000000000000000001234", + ValidatorPublicKeys: []string{lock.Validators[0].PublicKeyHex()}, + PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), + LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), + PublishAddress: srv.URL, + PublishTimeout: 10 * time.Second, + ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), + FeeRecipient: "0x0000000000000000000000000000000000001234", } require.NoError(t, runFeeRecipientSign(ctx, signConfig), "operator index submit feerecipient sign: %v", idx) @@ -122,16 +120,14 @@ func TestFeeRecipientSignWithTimestamp(t *testing.T) { baseDir := filepath.Join(root, fmt.Sprintf("op%d", opIdx)) signConfig := feerecipientSignConfig{ - feerecipientConfig: feerecipientConfig{ - ValidatorPublicKeys: []string{validatorPubkey}, - PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), - LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), - PublishAddress: srv.URL, - PublishTimeout: 10 * time.Second, - }, - ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), - FeeRecipient: newFeeRecipient, - Timestamp: fixedTimestamp, + ValidatorPublicKeys: []string{validatorPubkey}, + PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), + LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), + PublishAddress: srv.URL, + PublishTimeout: 10 * time.Second, + ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), + FeeRecipient: newFeeRecipient, + Timestamp: fixedTimestamp, } require.NoError(t, runFeeRecipientSign(ctx, signConfig), "operator %d sign with timestamp", opIdx) @@ -140,13 +136,11 @@ func TestFeeRecipientSignWithTimestamp(t *testing.T) { func TestFeeRecipientSignInvalidFeeRecipient(t *testing.T) { config := feerecipientSignConfig{ - feerecipientConfig: feerecipientConfig{ - PrivateKeyPath: "nonexistent", - LockFilePath: "nonexistent", - PublishAddress: "http://localhost:0", - PublishTimeout: time.Second, - }, - FeeRecipient: "not-an-address", + PrivateKeyPath: "nonexistent", + LockFilePath: "nonexistent", + PublishAddress: "http://localhost:0", + PublishTimeout: time.Second, + FeeRecipient: "not-an-address", } err := runFeeRecipientSign(t.Context(), config) @@ -255,13 +249,11 @@ func TestFeeRecipientSignAdoptsInProgressTimestamp(t *testing.T) { func TestFeeRecipientSignInvalidLockFile(t *testing.T) { config := feerecipientSignConfig{ - feerecipientConfig: feerecipientConfig{ - PrivateKeyPath: "nonexistent", - LockFilePath: "nonexistent-lock.json", - PublishAddress: "http://localhost:0", - PublishTimeout: time.Second, - }, - FeeRecipient: "0x0000000000000000000000000000000000001234", + PrivateKeyPath: "nonexistent", + LockFilePath: "nonexistent-lock.json", + PublishAddress: "http://localhost:0", + PublishTimeout: time.Second, + FeeRecipient: "0x0000000000000000000000000000000000001234", } err := runFeeRecipientSign(t.Context(), config) @@ -299,15 +291,13 @@ func TestFeeRecipientSignAPIUnreachable(t *testing.T) { baseDir := filepath.Join(root, "op0") config := feerecipientSignConfig{ - feerecipientConfig: feerecipientConfig{ - ValidatorPublicKeys: []string{lock.Validators[0].PublicKeyHex()}, - PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), - LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), - PublishAddress: srv.URL, - PublishTimeout: time.Second, - }, - ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), - FeeRecipient: "0x0000000000000000000000000000000000001234", + ValidatorPublicKeys: []string{lock.Validators[0].PublicKeyHex()}, + PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), + LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), + PublishAddress: srv.URL, + PublishTimeout: time.Second, + ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), + FeeRecipient: "0x0000000000000000000000000000000000001234", } err = runFeeRecipientSign(ctx, config) @@ -348,15 +338,13 @@ func TestFeeRecipientSignPubkeyNotInCluster(t *testing.T) { baseDir := filepath.Join(root, "op0") config := feerecipientSignConfig{ - feerecipientConfig: feerecipientConfig{ - ValidatorPublicKeys: []string{"0x" + strings.Repeat("ab", 48)}, - PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), - LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), - PublishAddress: srv.URL, - PublishTimeout: 10 * time.Second, - }, - ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), - FeeRecipient: "0x0000000000000000000000000000000000001234", + ValidatorPublicKeys: []string{"0x" + strings.Repeat("ab", 48)}, + PrivateKeyPath: filepath.Join(baseDir, "charon-enr-private-key"), + LockFilePath: filepath.Join(baseDir, "cluster-lock.json"), + PublishAddress: srv.URL, + PublishTimeout: 10 * time.Second, + ValidatorKeysDir: filepath.Join(baseDir, "validator_keys"), + FeeRecipient: "0x0000000000000000000000000000000000001234", } err = runFeeRecipientSign(ctx, config) diff --git a/cmd/testbeacon_internal_test.go b/cmd/testbeacon_internal_test.go index ed448e8c2..f90095f7f 100644 --- a/cmd/testbeacon_internal_test.go +++ b/cmd/testbeacon_internal_test.go @@ -277,9 +277,7 @@ func TestBeaconTestTimeoutAlwaysProducesResults(t *testing.T) { var buf bytes.Buffer res, err := runTestBeacon(context.Background(), &buf, testBeaconConfig{ - testConfig: testConfig{ - Timeout: time.Nanosecond, - }, + Timeout: time.Nanosecond, Endpoints: endpoints, }) require.NoError(t, err) diff --git a/cmd/testinfra_internal_test.go b/cmd/testinfra_internal_test.go index 30a5ca7bf..1cecdf151 100644 --- a/cmd/testinfra_internal_test.go +++ b/cmd/testinfra_internal_test.go @@ -247,9 +247,7 @@ func TestInfraTestTimeoutAlwaysProducesResults(t *testing.T) { var buf bytes.Buffer res, err := runTestInfra(context.Background(), &buf, testInfraConfig{ - testConfig: testConfig{ - Timeout: time.Nanosecond, - }, + Timeout: time.Nanosecond, DiskTestTool: DiskTestToolMock{}, }) require.NoError(t, err) diff --git a/cmd/testmev_internal_test.go b/cmd/testmev_internal_test.go index f4576e406..cdfcb1f3f 100644 --- a/cmd/testmev_internal_test.go +++ b/cmd/testmev_internal_test.go @@ -277,9 +277,7 @@ func TestMEVTestTimeoutAlwaysProducesResults(t *testing.T) { var buf bytes.Buffer res, err := runTestMEV(context.Background(), &buf, testMEVConfig{ - testConfig: testConfig{ - Timeout: time.Nanosecond, - }, + Timeout: time.Nanosecond, Endpoints: endpoints, }) require.NoError(t, err) diff --git a/cmd/testvalidator_internal_test.go b/cmd/testvalidator_internal_test.go index 837721715..d7c249106 100644 --- a/cmd/testvalidator_internal_test.go +++ b/cmd/testvalidator_internal_test.go @@ -211,9 +211,7 @@ func TestValidatorTestTimeoutAlwaysProducesResults(t *testing.T) { var buf bytes.Buffer res, err := runTestValidator(context.Background(), &buf, testValidatorConfig{ - testConfig: testConfig{ - Timeout: time.Nanosecond, - }, + Timeout: time.Nanosecond, APIAddress: fmt.Sprintf("localhost:%v", testutil.GetFreePort(t)), }) require.NoError(t, err) diff --git a/core/aggsigdb/memory.go b/core/aggsigdb/memory.go index c3ae95f83..cee0be629 100644 --- a/core/aggsigdb/memory.go +++ b/core/aggsigdb/memory.go @@ -95,7 +95,7 @@ func (db *MemDB) Await(ctx context.Context, duty core.Duty, pubKey core.PubKey, response := make(chan core.SignedData, 1) query := readQuery{ - memDBKey: memDBKey{duty: duty, pubKey: pubKey, subcommIdx: subcommIdx}, + duty: duty, pubKey: pubKey, subcommIdx: subcommIdx, response: response, cancel: cancel, } diff --git a/core/dutydb/memory_test.go b/core/dutydb/memory_test.go index d3c5a2997..07a0bca36 100644 --- a/core/dutydb/memory_test.go +++ b/core/dutydb/memory_test.go @@ -270,14 +270,12 @@ func TestMemDBAggregatorElectraMultiCommittee(t *testing.T) { bits.SetBitAt(uint64(commIdx), true) return core.VersionedAggregatedAttestation{ - VersionedAttestation: eth2spec.VersionedAttestation{ - Version: eth2spec.DataVersionElectra, - Electra: &electra.Attestation{ - AggregationBits: testutil.RandomBitList(64), - Data: attData, - Signature: testutil.RandomEth2Signature(), - CommitteeBits: bits, - }, + Version: eth2spec.DataVersionElectra, + Electra: &electra.Attestation{ + AggregationBits: testutil.RandomBitList(64), + Data: attData, + Signature: testutil.RandomEth2Signature(), + CommitteeBits: bits, }, } } diff --git a/core/fetcher/graffiti.go b/core/fetcher/graffiti.go index 9cb387788..548c7d456 100644 --- a/core/fetcher/graffiti.go +++ b/core/fetcher/graffiti.go @@ -113,7 +113,7 @@ func fetchBeaconNodeToken(eth2Cl eth2wrap.Client) string { return "" } - productToken := strings.Split(eth2Resp.Data, "/")[0] + productToken, _, _ := strings.Cut(eth2Resp.Data, "/") token, ok := ClientGraffitiMappings()[productToken] if !ok { diff --git a/core/tracker/tracker_internal_test.go b/core/tracker/tracker_internal_test.go index 6601b38a5..dcc7fbb81 100644 --- a/core/tracker/tracker_internal_test.go +++ b/core/tracker/tracker_internal_test.go @@ -1394,18 +1394,14 @@ func TestSubmittedProposals(t *testing.T) { require.NotPanics(t, func() { // Not blinded err = ic.Submitted(core.NewProposerDuty(42), testutil.RandomCorePubKey(t), core.VersionedSignedProposal{ - VersionedSignedProposal: eth2api.VersionedSignedProposal{ - Version: eth2spec.DataVersionDeneb, - }, + Version: eth2spec.DataVersionDeneb, }, 1*time.Millisecond) require.ErrorContains(t, err, "could not determine if proposal was synthetic or not") // Blinded err = ic.Submitted(core.NewProposerDuty(42), testutil.RandomCorePubKey(t), core.VersionedSignedProposal{ - VersionedSignedProposal: eth2api.VersionedSignedProposal{ - Blinded: true, - Version: eth2spec.DataVersionDeneb, - }, + Blinded: true, + Version: eth2spec.DataVersionDeneb, }, 1*time.Millisecond) require.ErrorContains(t, err, "could not determine if proposal was synthetic or not") }) diff --git a/core/validatorapi/router_internal_test.go b/core/validatorapi/router_internal_test.go index 6ba8babfa..b3e349205 100644 --- a/core/validatorapi/router_internal_test.go +++ b/core/validatorapi/router_internal_test.go @@ -2461,31 +2461,29 @@ func (h testHandler) newBeaconHandler(t *testing.T) http.Handler { func TestUnmarshalSSZ(t *testing.T) { phase0Proposal := core.VersionedSignedProposal{ - VersionedSignedProposal: eth2api.VersionedSignedProposal{ - Version: eth2spec.DataVersionPhase0, - Phase0: ð2p0.SignedBeaconBlock{ - Message: ð2p0.BeaconBlock{ - Slot: 1, - ProposerIndex: 2, - ParentRoot: eth2p0.Root{0x01}, - StateRoot: eth2p0.Root{0x02}, - Body: ð2p0.BeaconBlockBody{ - RANDAOReveal: eth2p0.BLSSignature{0xAA}, - ETH1Data: ð2p0.ETH1Data{ - DepositRoot: eth2p0.Root{0x03}, - DepositCount: 5, - BlockHash: append([]byte{0x04}, make([]byte, 31)...), - }, - Graffiti: [32]byte{0x05}, - ProposerSlashings: []*eth2p0.ProposerSlashing{}, - AttesterSlashings: []*eth2p0.AttesterSlashing{}, - Attestations: []*eth2p0.Attestation{}, - Deposits: []*eth2p0.Deposit{}, - VoluntaryExits: []*eth2p0.SignedVoluntaryExit{}, + Version: eth2spec.DataVersionPhase0, + Phase0: ð2p0.SignedBeaconBlock{ + Message: ð2p0.BeaconBlock{ + Slot: 1, + ProposerIndex: 2, + ParentRoot: eth2p0.Root{0x01}, + StateRoot: eth2p0.Root{0x02}, + Body: ð2p0.BeaconBlockBody{ + RANDAOReveal: eth2p0.BLSSignature{0xAA}, + ETH1Data: ð2p0.ETH1Data{ + DepositRoot: eth2p0.Root{0x03}, + DepositCount: 5, + BlockHash: append([]byte{0x04}, make([]byte, 31)...), }, + Graffiti: [32]byte{0x05}, + ProposerSlashings: []*eth2p0.ProposerSlashing{}, + AttesterSlashings: []*eth2p0.AttesterSlashing{}, + Attestations: []*eth2p0.Attestation{}, + Deposits: []*eth2p0.Deposit{}, + VoluntaryExits: []*eth2p0.SignedVoluntaryExit{}, }, - Signature: eth2p0.BLSSignature{0xBB}, }, + Signature: eth2p0.BLSSignature{0xBB}, }, } diff --git a/dkg/dkg.go b/dkg/dkg.go index e1c9fa9d8..b391d5676 100644 --- a/dkg/dkg.go +++ b/dkg/dkg.go @@ -526,7 +526,7 @@ func startSyncProtocol(ctx context.Context, p2pNode host.Host, key *k1.PrivateKe ) (stepSyncFunc func(context.Context) error, shutdownFunc func(context.Context) error, fatalFunc func() error, err error) { // Sign definition hash with charon-enr-private-key // Note: libp2p signing does another hash of the defHash. - hashSig, err := ((*libp2pcrypto.Secp256k1PrivateKey)(key)).Sign(defHash) + hashSig, err := (*libp2pcrypto.Secp256k1PrivateKey)(key).Sign(defHash) if err != nil { return nil, nil, nil, errors.Wrap(err, "sign definition hash") } diff --git a/go.mod b/go.mod index dc10e6e66..9632b1aab 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/obolnetwork/charon -go 1.26 +go 1.27 require ( github.com/OffchainLabs/go-bitfield v0.0.0-20251031151322-f427d04d8506 diff --git a/testutil/fuzz.go b/testutil/fuzz.go index 37563f038..4e0200974 100644 --- a/testutil/fuzz.go +++ b/testutil/fuzz.go @@ -133,9 +133,9 @@ func NewEth2Fuzzer(t *testing.T, seed int64) *fuzz.Fuzzer { }, // Populate one of the versions of these VersionedSignedProposal types. func(e *core.VersionedSignedProposal, c fuzz.Continue) { - e.Version = allVersions[(c.Intn(len(allVersions)))] + e.Version = allVersions[c.Intn(len(allVersions))] if e.Blinded { - e.Version = blindedVersions[(c.Intn(len(blindedVersions)))] + e.Version = blindedVersions[c.Intn(len(blindedVersions))] } version, err := eth2util.DataVersionFromETH2(e.Version) @@ -270,7 +270,7 @@ func NewEth2Fuzzer(t *testing.T, seed int64) *fuzz.Fuzzer { } }, func(e *core.VersionedProposal, c fuzz.Continue) { - e.Version = allVersions[(c.Intn(len(allVersions)))] + e.Version = allVersions[c.Intn(len(allVersions))] version, err := eth2util.DataVersionFromETH2(e.Version) require.NoError(t, err) @@ -353,7 +353,7 @@ func NewEth2Fuzzer(t *testing.T, seed int64) *fuzz.Fuzzer { } }, func(e *core.VersionedAttestation, c fuzz.Continue) { - e.Version = allVersions[(c.Intn(len(allVersions)))] + e.Version = allVersions[c.Intn(len(allVersions))] version, err := eth2util.DataVersionFromETH2(e.Version) require.NoError(t, err) @@ -383,7 +383,7 @@ func NewEth2Fuzzer(t *testing.T, seed int64) *fuzz.Fuzzer { e.CommitteeBits = bits }, func(e *core.VersionedAggregatedAttestation, c fuzz.Continue) { - e.Version = allVersions[(c.Intn(len(allVersions)))] + e.Version = allVersions[c.Intn(len(allVersions))] version, err := eth2util.DataVersionFromETH2(e.Version) require.NoError(t, err) @@ -391,7 +391,7 @@ func NewEth2Fuzzer(t *testing.T, seed int64) *fuzz.Fuzzer { c.Fuzz(val) }, func(e *core.VersionedSignedAggregateAndProof, c fuzz.Continue) { - e.Version = allVersions[(c.Intn(len(allVersions)))] + e.Version = allVersions[c.Intn(len(allVersions))] version, err := eth2util.DataVersionFromETH2(e.Version) require.NoError(t, err) diff --git a/testutil/integration/infosync_test.go b/testutil/integration/infosync_test.go index 1de4efe7f..0ecb28280 100644 --- a/testutil/integration/infosync_test.go +++ b/testutil/integration/infosync_test.go @@ -39,8 +39,8 @@ func TestInfoSync(t *testing.T) { lock, p2pKeys, _ := cluster.NewForT(t, 1, n, n, seed, random) asserter := &priorityAsserter{ - asserter: asserter{Timeout: time.Second * 10}, - N: n, + Timeout: time.Second * 10, + N: n, } p2pNodeCallback := testutil.NewP2PNodeCallback(t, priority.Protocols()...) diff --git a/testutil/integration/ping_test.go b/testutil/integration/ping_test.go index 902a1df58..22c10b743 100644 --- a/testutil/integration/ping_test.go +++ b/testutil/integration/ping_test.go @@ -85,11 +85,9 @@ func pingCluster(t *testing.T, test pingTest) { random := rand.New(rand.NewSource(int64(seed))) lock, p2pKeys, _ := cluster.NewForT(t, 1, n, n, seed, random) asserter := &pingAsserter{ - asserter: asserter{ - Timeout: time.Second * 10, - }, - N: n, - Lock: lock, + Timeout: time.Second * 10, + N: n, + Lock: lock, } var eg errgroup.Group diff --git a/testutil/obolapimock/deposit.go b/testutil/obolapimock/deposit.go index e45389d25..51d3fce86 100644 --- a/testutil/obolapimock/deposit.go +++ b/testutil/obolapimock/deposit.go @@ -140,11 +140,9 @@ func (ts *testServer) HandleSubmitPartialDeposit(writer http.ResponseWriter, req } ts.partialDeposits[depositData.PublicKey.String()] = depositBlob{ - FullDepositResponse: obolapi.FullDepositResponse{ - PublicKey: depositData.PublicKey.String(), - WithdrawalCredentials: hex.EncodeToString(depositData.WithdrawalCredentials), - Amounts: amounts, - }, + PublicKey: depositData.PublicKey.String(), + WithdrawalCredentials: hex.EncodeToString(depositData.WithdrawalCredentials), + Amounts: amounts, } } diff --git a/testutil/random.go b/testutil/random.go index 1769d7291..b79ad4cec 100644 --- a/testutil/random.go +++ b/testutil/random.go @@ -144,11 +144,9 @@ func RandomDenebCoreVersionedAttestation() core.VersionedAttestation { vIdx := eth2p0.ValidatorIndex(0) return core.VersionedAttestation{ - VersionedAttestation: eth2spec.VersionedAttestation{ - Version: eth2spec.DataVersionDeneb, - ValidatorIndex: &vIdx, - Deneb: RandomPhase0Attestation(), - }, + Version: eth2spec.DataVersionDeneb, + ValidatorIndex: &vIdx, + Deneb: RandomPhase0Attestation(), } } @@ -156,11 +154,9 @@ func RandomElectraCoreVersionedAttestation() core.VersionedAttestation { vIdx := RandomVIdx() return core.VersionedAttestation{ - VersionedAttestation: eth2spec.VersionedAttestation{ - Version: eth2spec.DataVersionElectra, - ValidatorIndex: &vIdx, - Electra: RandomElectraAttestation(), - }, + Version: eth2spec.DataVersionElectra, + ValidatorIndex: &vIdx, + Electra: RandomElectraAttestation(), } } @@ -168,11 +164,9 @@ func RandomFuluCoreVersionedAttestation() core.VersionedAttestation { vIdx := RandomVIdx() return core.VersionedAttestation{ - VersionedAttestation: eth2spec.VersionedAttestation{ - Version: eth2spec.DataVersionFulu, - ValidatorIndex: &vIdx, - Fulu: RandomElectraAttestation(), - }, + Version: eth2spec.DataVersionFulu, + ValidatorIndex: &vIdx, + Fulu: RandomElectraAttestation(), } } @@ -207,13 +201,11 @@ func RandomAggregateAttestation() *eth2p0.Attestation { func RandomDenebCoreVersionedAggregateAttestation() core.VersionedAggregatedAttestation { return core.VersionedAggregatedAttestation{ - VersionedAttestation: eth2spec.VersionedAttestation{ - Version: eth2spec.DataVersionDeneb, - Deneb: ð2p0.Attestation{ - AggregationBits: RandomBitList(64), - Data: RandomAttestationDataPhase0(), - Signature: RandomEth2Signature(), - }, + Version: eth2spec.DataVersionDeneb, + Deneb: ð2p0.Attestation{ + AggregationBits: RandomBitList(64), + Data: RandomAttestationDataPhase0(), + Signature: RandomEth2Signature(), }, } } @@ -380,90 +372,76 @@ func RandomCapellaExecutionPayload() *capella.ExecutionPayload { func RandomBellatrixCoreVersionedProposal() core.VersionedProposal { return core.VersionedProposal{ - VersionedProposal: eth2api.VersionedProposal{ - Version: eth2spec.DataVersionBellatrix, - Bellatrix: RandomBellatrixBeaconBlock(), - }, + Version: eth2spec.DataVersionBellatrix, + Bellatrix: RandomBellatrixBeaconBlock(), } } func RandomCapellaCoreVersionedProposal() core.VersionedProposal { return core.VersionedProposal{ - VersionedProposal: eth2api.VersionedProposal{ - Version: eth2spec.DataVersionCapella, - Capella: RandomCapellaBeaconBlock(), - }, + Version: eth2spec.DataVersionCapella, + Capella: RandomCapellaBeaconBlock(), } } func RandomBellatrixCoreVersionedSignedProposal() core.VersionedSignedProposal { return core.VersionedSignedProposal{ - VersionedSignedProposal: eth2api.VersionedSignedProposal{ - Version: eth2spec.DataVersionBellatrix, - Bellatrix: &bellatrix.SignedBeaconBlock{ - Message: RandomBellatrixBeaconBlock(), - Signature: RandomEth2Signature(), - }, + Version: eth2spec.DataVersionBellatrix, + Bellatrix: &bellatrix.SignedBeaconBlock{ + Message: RandomBellatrixBeaconBlock(), + Signature: RandomEth2Signature(), }, } } func RandomCapellaCoreVersionedSignedProposal() core.VersionedSignedProposal { return core.VersionedSignedProposal{ - VersionedSignedProposal: eth2api.VersionedSignedProposal{ - Version: eth2spec.DataVersionCapella, - Capella: &capella.SignedBeaconBlock{ - Message: RandomCapellaBeaconBlock(), - Signature: RandomEth2Signature(), - }, + Version: eth2spec.DataVersionCapella, + Capella: &capella.SignedBeaconBlock{ + Message: RandomCapellaBeaconBlock(), + Signature: RandomEth2Signature(), }, } } func RandomDenebCoreVersionedSignedProposal() core.VersionedSignedProposal { return core.VersionedSignedProposal{ - VersionedSignedProposal: eth2api.VersionedSignedProposal{ - Version: eth2spec.DataVersionDeneb, - Deneb: ð2deneb.SignedBlockContents{ - SignedBlock: &deneb.SignedBeaconBlock{ - Message: RandomDenebBeaconBlock(), - Signature: RandomEth2Signature(), - }, - KZGProofs: []deneb.KZGProof{}, - Blobs: []deneb.Blob{}, + Version: eth2spec.DataVersionDeneb, + Deneb: ð2deneb.SignedBlockContents{ + SignedBlock: &deneb.SignedBeaconBlock{ + Message: RandomDenebBeaconBlock(), + Signature: RandomEth2Signature(), }, + KZGProofs: []deneb.KZGProof{}, + Blobs: []deneb.Blob{}, }, } } func RandomElectraCoreVersionedSignedProposal() core.VersionedSignedProposal { return core.VersionedSignedProposal{ - VersionedSignedProposal: eth2api.VersionedSignedProposal{ - Version: eth2spec.DataVersionElectra, - Electra: ð2electra.SignedBlockContents{ - SignedBlock: &electra.SignedBeaconBlock{ - Message: RandomElectraBeaconBlock(), - Signature: RandomEth2Signature(), - }, - KZGProofs: []deneb.KZGProof{}, - Blobs: []deneb.Blob{}, + Version: eth2spec.DataVersionElectra, + Electra: ð2electra.SignedBlockContents{ + SignedBlock: &electra.SignedBeaconBlock{ + Message: RandomElectraBeaconBlock(), + Signature: RandomEth2Signature(), }, + KZGProofs: []deneb.KZGProof{}, + Blobs: []deneb.Blob{}, }, } } func RandomFuluCoreVersionedSignedProposal() core.VersionedSignedProposal { return core.VersionedSignedProposal{ - VersionedSignedProposal: eth2api.VersionedSignedProposal{ - Version: eth2spec.DataVersionFulu, - Fulu: ð2fulu.SignedBlockContents{ - SignedBlock: &electra.SignedBeaconBlock{ - Message: RandomElectraBeaconBlock(), - Signature: RandomEth2Signature(), - }, - KZGProofs: []deneb.KZGProof{}, - Blobs: []deneb.Blob{}, + Version: eth2spec.DataVersionFulu, + Fulu: ð2fulu.SignedBlockContents{ + SignedBlock: &electra.SignedBeaconBlock{ + Message: RandomElectraBeaconBlock(), + Signature: RandomEth2Signature(), }, + KZGProofs: []deneb.KZGProof{}, + Blobs: []deneb.Blob{}, }, } } @@ -673,85 +651,71 @@ func RandomCapellaBlindedBeaconBlockBody() *eth2capella.BlindedBeaconBlockBody { func RandomBellatrixVersionedBlindedProposal() core.VersionedProposal { return core.VersionedProposal{ - VersionedProposal: eth2api.VersionedProposal{ - Version: eth2spec.DataVersionBellatrix, - Blinded: true, - BellatrixBlinded: RandomBellatrixBlindedBeaconBlock(), - }, + Version: eth2spec.DataVersionBellatrix, + Blinded: true, + BellatrixBlinded: RandomBellatrixBlindedBeaconBlock(), } } func RandomCapellaVersionedBlindedProposal() core.VersionedProposal { return core.VersionedProposal{ - VersionedProposal: eth2api.VersionedProposal{ - Version: eth2spec.DataVersionCapella, - Blinded: true, - CapellaBlinded: RandomCapellaBlindedBeaconBlock(), - }, + Version: eth2spec.DataVersionCapella, + Blinded: true, + CapellaBlinded: RandomCapellaBlindedBeaconBlock(), } } func RandomBellatrixVersionedSignedBlindedProposal() core.VersionedSignedProposal { return core.VersionedSignedProposal{ - VersionedSignedProposal: eth2api.VersionedSignedProposal{ - Blinded: true, - Version: eth2spec.DataVersionBellatrix, - BellatrixBlinded: ð2bellatrix.SignedBlindedBeaconBlock{ - Message: RandomBellatrixBlindedBeaconBlock(), - Signature: RandomEth2Signature(), - }, + Blinded: true, + Version: eth2spec.DataVersionBellatrix, + BellatrixBlinded: ð2bellatrix.SignedBlindedBeaconBlock{ + Message: RandomBellatrixBlindedBeaconBlock(), + Signature: RandomEth2Signature(), }, } } func RandomCapellaVersionedSignedBlindedProposal() core.VersionedSignedProposal { return core.VersionedSignedProposal{ - VersionedSignedProposal: eth2api.VersionedSignedProposal{ - Blinded: true, - Version: eth2spec.DataVersionCapella, - CapellaBlinded: ð2capella.SignedBlindedBeaconBlock{ - Message: RandomCapellaBlindedBeaconBlock(), - Signature: RandomEth2Signature(), - }, + Blinded: true, + Version: eth2spec.DataVersionCapella, + CapellaBlinded: ð2capella.SignedBlindedBeaconBlock{ + Message: RandomCapellaBlindedBeaconBlock(), + Signature: RandomEth2Signature(), }, } } func RandomDenebVersionedSignedBlindedProposal() core.VersionedSignedProposal { return core.VersionedSignedProposal{ - VersionedSignedProposal: eth2api.VersionedSignedProposal{ - Blinded: true, - Version: eth2spec.DataVersionDeneb, - DenebBlinded: ð2deneb.SignedBlindedBeaconBlock{ - Message: RandomDenebBlindedBeaconBlock(), - Signature: RandomEth2Signature(), - }, + Blinded: true, + Version: eth2spec.DataVersionDeneb, + DenebBlinded: ð2deneb.SignedBlindedBeaconBlock{ + Message: RandomDenebBlindedBeaconBlock(), + Signature: RandomEth2Signature(), }, } } func RandomElectraVersionedSignedBlindedProposal() core.VersionedSignedProposal { return core.VersionedSignedProposal{ - VersionedSignedProposal: eth2api.VersionedSignedProposal{ - Blinded: true, - Version: eth2spec.DataVersionElectra, - ElectraBlinded: ð2electra.SignedBlindedBeaconBlock{ - Message: RandomElectraBlindedBeaconBlock(), - Signature: RandomEth2Signature(), - }, + Blinded: true, + Version: eth2spec.DataVersionElectra, + ElectraBlinded: ð2electra.SignedBlindedBeaconBlock{ + Message: RandomElectraBlindedBeaconBlock(), + Signature: RandomEth2Signature(), }, } } func RandomFuluVersionedSignedBlindedProposal() core.VersionedSignedProposal { return core.VersionedSignedProposal{ - VersionedSignedProposal: eth2api.VersionedSignedProposal{ - Blinded: true, - Version: eth2spec.DataVersionFulu, - FuluBlinded: ð2electra.SignedBlindedBeaconBlock{ - Message: RandomElectraBlindedBeaconBlock(), - Signature: RandomEth2Signature(), - }, + Blinded: true, + Version: eth2spec.DataVersionFulu, + FuluBlinded: ð2electra.SignedBlindedBeaconBlock{ + Message: RandomElectraBlindedBeaconBlock(), + Signature: RandomEth2Signature(), }, } } @@ -918,10 +882,8 @@ func RandomCoreVersionedSignedValidatorRegistration(t *testing.T) core.Versioned t.Helper() return core.VersionedSignedValidatorRegistration{ - VersionedSignedValidatorRegistration: eth2api.VersionedSignedValidatorRegistration{ - Version: eth2spec.BuilderVersionV1, - V1: RandomSignedValidatorRegistration(t), - }, + Version: eth2spec.BuilderVersionV1, + V1: RandomSignedValidatorRegistration(t), } } From 395a7d2507a2264d9855608915bfa03b768d2bd6 Mon Sep 17 00:00:00 2001 From: kalo <24719519+KaloyanTanev@users.noreply.github.com> Date: Wed, 2 Sep 2026 12:07:49 +0300 Subject: [PATCH 3/3] bump cockroachdb/swiss for go1.27 support --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9632b1aab..263df6e07 100644 --- a/go.mod +++ b/go.mod @@ -103,7 +103,7 @@ require ( github.com/cockroachdb/pebble v1.1.5 // indirect github.com/cockroachdb/pebble/v2 v2.1.4 // indirect github.com/cockroachdb/redact v1.1.6 // indirect - github.com/cockroachdb/swiss v0.0.0-20251224182025-b0f6560f979b // indirect + github.com/cockroachdb/swiss v0.0.0-20260820225851-333444432258 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/consensys/gnark-crypto v0.19.2 // indirect github.com/containerd/errdefs v1.0.0 // indirect diff --git a/go.sum b/go.sum index 312364b88..10ea983cd 100644 --- a/go.sum +++ b/go.sum @@ -119,8 +119,8 @@ github.com/cockroachdb/pebble/v2 v2.1.4 h1:j9wPgMDbkErFdAKYFGhsoCcvzcjR+6zrJ4jhK github.com/cockroachdb/pebble/v2 v2.1.4/go.mod h1:Reo1RTniv1UjVTAu/Fv74y5i3kJ5gmVrPhO9UtFiKn8= github.com/cockroachdb/redact v1.1.6 h1:zXJBwDZ84xJNlHl1rMyCojqyIxv+7YUpQiJLQ7n4314= github.com/cockroachdb/redact v1.1.6/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/swiss v0.0.0-20251224182025-b0f6560f979b h1:VXvSNzmr8hMj8XTuY0PT9Ane9qZGul/p67vGYwl9BFI= -github.com/cockroachdb/swiss v0.0.0-20251224182025-b0f6560f979b/go.mod h1:yBRu/cnL4ks9bgy4vAASdjIW+/xMlFwuHKqtmh3GZQg= +github.com/cockroachdb/swiss v0.0.0-20260820225851-333444432258 h1:IJ+uNItEm0qx9FE2AgIc1PMsCUtk8nbSIzhQE1t5GWw= +github.com/cockroachdb/swiss v0.0.0-20260820225851-333444432258/go.mod h1:yBRu/cnL4ks9bgy4vAASdjIW+/xMlFwuHKqtmh3GZQg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/consensys/gnark-crypto v0.19.2 h1:qrEAIXq3T4egxqiliFFoNrepkIWVEeIYwt3UL0fvS80=