Skip to content

go.mod: fix module path for v2 tags#2720

Open
nkryuchkov wants to merge 20 commits into
stagefrom
fix-go-v2-module
Open

go.mod: fix module path for v2 tags#2720
nkryuchkov wants to merge 20 commits into
stagefrom
fix-go-v2-module

Conversation

@nkryuchkov
Copy link
Copy Markdown
Contributor

@nkryuchkov nkryuchkov commented Mar 13, 2026

This fixes the Go module path so v2.x tags can actually be consumed as a library.

Currently, since our major release versions are v2.x, external go get fails for tags due to the module not being declared with the /v2 suffix

Closes ssvlabs/ssv-node-board#1060

@nkryuchkov nkryuchkov requested review from a team as code owners March 13, 2026 11:57
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.3%. Comparing base (7622b38) to head (e9dfbeb).

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nkryuchkov nkryuchkov requested a review from iurii-ssv March 13, 2026 12:45
Copy link
Copy Markdown
Contributor

@iurii-ssv iurii-ssv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good if it works.

iurii-ssv
iurii-ssv previously approved these changes Mar 13, 2026
@nkryuchkov
Copy link
Copy Markdown
Contributor Author

nkryuchkov commented Mar 13, 2026

Looks good if it works.

% tmpdir="$(mktemp -d)"
cd "$tmpdir"
go mod init verifyrelease
GOPROXY=direct GOSUMDB=off go get github.com/ssvlabs/ssv/protocol/v2/types@v2.4.2

go: creating new go.mod: module verifyrelease
go: github.com/ssvlabs/ssv/protocol/v2/types@v2.4.2: github.com/ssvlabs/ssv@v2.4.2: invalid version: module contains a go.mod file, so module path must match major version ("github.com/ssvlabs/ssv/v2")
% 

% tmpdir="$(mktemp -d)"
cd "$tmpdir"
go mod init verifyfix
GOPROXY=direct GOSUMDB=off go get github.com/ssvlabs/ssv/v2/protocol/v2/types@fix-go-v2-module

go build github.com/ssvlabs/ssv/v2/protocol/v2/types
go: creating new go.mod: module verifyfix
go: added github.com/attestantio/go-eth2-client v0.27.0
(...)
go: added gopkg.in/yaml.v2 v2.4.0
% 

The proper testing would require creating a version, though

# Conflicts:
#	network/p2p/p2p_discovery.go
#	operator/duties/attester.go
#	operator/duties/scheduler.go
#	operator/duties/sync_committee.go
#	protocol/v2/queue/worker/message_worker.go
iurii-ssv
iurii-ssv previously approved these changes Mar 25, 2026
Copy link
Copy Markdown
Contributor

@oleg-ssvlabs oleg-ssvlabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was quite boring person and went through all 400 files.
Left couple of comments. There is no need to add V2 to github URLs. I believe it will result in 404

Comment thread beacon/goclient/proposer.go Outdated
Comment thread cli/operator/node.go Outdated
Comment thread eth/eventsyncer/event_syncer.go Outdated
Comment thread message/validation/validation.go Outdated
Comment thread network/discovery/dv5_service.go Outdated
Comment thread network/p2p/p2p.go Outdated
Comment thread network/topics/scoring.go
Comment thread protocol/v2/ssv/validator/committee_queue_test.go
Comment thread utils/hashmap/hashmap_test.go Outdated
Comment thread utils/ttl/map_test.go Outdated
@nkryuchkov
Copy link
Copy Markdown
Contributor Author

I was quite boring person and went through all 400 files. Left couple of comments. There is no need to add V2 to github URLs. I believe it will result in 404

Thanks for the thorough review. Well spotted!

oleg-ssvlabs
oleg-ssvlabs previously approved these changes Mar 25, 2026
Copy link
Copy Markdown
Contributor

@oleg-ssvlabs oleg-ssvlabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

iurii-ssv
iurii-ssv previously approved these changes Mar 25, 2026
momosh-ssv
momosh-ssv previously approved these changes Mar 26, 2026
Copy link
Copy Markdown

@momosh-ssv momosh-ssv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a well played mechanical import path rename — no logic changes.

@nkryuchkov nkryuchkov dismissed stale reviews from momosh-ssv, iurii-ssv, and oleg-ssvlabs via b73085a March 26, 2026 09:46
@nkryuchkov nkryuchkov dismissed stale reviews from ljuba-ssv and iurii-ssv via 516c66a April 14, 2026 17:49
ljuba-ssv
ljuba-ssv previously approved these changes Apr 15, 2026
oleg-ssvlabs
oleg-ssvlabs previously approved these changes Apr 15, 2026
…-module

# Conflicts:
#	api/handlers/node/node.go
#	api/handlers/node/node_test.go
#	cli/operator/node.go
#	cli/operator/prober.go
#	go.mod
#	network/p2p/p2p_discovery.go
#	network/p2p/p2p_discovery_test.go
#	nodeprobe/nodeprobe.go
#	nodeprobe/nodeprobe_test.go
#	ssvsigner/client.go
#	ssvsigner/cmd/purge-keys/purge-keys.go
#	ssvsigner/e2e/common/beacon_config.go
#	ssvsigner/e2e/testenv/environment.go
#	ssvsigner/e2e/testenv/key_managers.go
#	ssvsigner/ekm/key_manager.go
#	ssvsigner/ekm/local_key_manager.go
#	ssvsigner/ekm/local_key_manager_test.go
#	ssvsigner/ekm/mock.go
#	ssvsigner/ekm/remote_key_manager.go
#	ssvsigner/ekm/remote_key_manager_test.go
#	ssvsigner/ekm/signer_storage.go
#	ssvsigner/ekm/signer_storage_test.go
#	ssvsigner/ekm/slashing_protector.go
#	ssvsigner/ekm/slashing_protector_test.go
#	ssvsigner/go.mod
#	ssvsigner/observability.go
#	ssvsigner/server.go
@nkryuchkov nkryuchkov dismissed stale reviews from oleg-ssvlabs and ljuba-ssv via 3a05870 April 17, 2026 18:09
…-module

# Conflicts:
#	protocol/v2/qbft/config.go
#	protocol/v2/qbft/spectest/msg_processing_type.go
#	protocol/v2/qbft/spectest/qbft_mapping_test.go
#	protocol/v2/ssv/runner/committee_test.go
#	protocol/v2/ssv/runner/proposer_test.go
#	protocol/v2/ssv/runner/timer.go
#	protocol/v2/ssv/spectest/msg_processing_type.go
#	protocol/v2/ssv/spectest/multi_start_new_runner_duty_type.go
#	protocol/v2/testing/utils.go
iurii-ssv
iurii-ssv previously approved these changes Apr 20, 2026
oleg-ssvlabs
oleg-ssvlabs previously approved these changes Apr 20, 2026
Copy link
Copy Markdown

@ljuba-ssv ljuba-ssv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After merge, the two go test invocations in .github/workflows/dutytracer-bench.yml will fail — the file isn't in this PR's diff so I couldn't anchor inline, but the lines are:

  • L29: go test -benchmem -run=^$ -bench ^BenchmarkTracer$ github.com/ssvlabs/ssv/operator/dutytracer -v
  • L34: go test -tags lfs -timeout 5s -run ^TestEviction$ github.com/ssvlabs/ssv/operator/dutytracer -v

Both use the old github.com/ssvlabs/ssv/operator/dutytracer path. Once the module is renamed to github.com/ssvlabs/ssv/v2 this no longer resolves. Verified on this branch:

$ go test -list '.*' github.com/ssvlabs/ssv/operator/dutytracer
# github.com/ssvlabs/ssv/operator/dutytracer
no required module provides package github.com/ssvlabs/ssv/operator/dutytracer
FAIL    github.com/ssvlabs/ssv/operator/dutytracer [setup failed]
exit=1

github.com/ssvlabs/ssv/v2/operator/dutytracer resolves cleanly. The workflow will break on the next workflow_dispatch or push to feat/exporter-v2. Two-line fix: add /v2/ to both test paths.

oleg-ssvlabs
oleg-ssvlabs previously approved these changes Apr 24, 2026
momosh-ssv added 3 commits May 8, 2026 17:10
# Conflicts:
#	go.mod
#	message/validation/consensus_validation.go
#	message/validation/consensus_validation_test.go
#	protocol/v2/qbft/controller/controller_test.go
#	protocol/v2/qbft/controller/decided.go
#	protocol/v2/qbft/instance/test_helpers_test.go
#	protocol/v2/qbft/spectest/controller_type.go
#	protocol/v2/qbft/spectest/msg_processing_type.go
#	protocol/v2/qbft/spectest/qbft_mapping_test.go
#	protocol/v2/ssv/runner/committee_test.go
#	protocol/v2/ssv/runner/timer.go
#	protocol/v2/ssv/spectest/msg_processing_type.go
#	protocol/v2/ssv/spectest/multi_start_new_runner_duty_type.go
#	protocol/v2/ssv/spectest/ssv_mapping_test.go
#	protocol/v2/ssv/validator/committee_queue_test.go
#	protocol/v2/ssv/validator/timer.go
These two files were added on stage with `github.com/ssvlabs/ssv/...` imports
and slipped through the v2 path rewrite during the merge from stage. Update
them to use the `github.com/ssvlabs/ssv/v2/...` paths the module declares.
Bumps go.opentelemetry.io/otel, otel/metric, and otel/trace from v1.38.0 to
v1.41.0 to match the versions stage already pulls in transitively. Run via
`go mod tidy`.
Copy link
Copy Markdown
Contributor

@iurii-ssv iurii-ssv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@momosh-ssv
Copy link
Copy Markdown

Deferring to v2.4.4 so we can verify properly.

Per @nkryuchkov's test note: the branch-based go get …@fix-go-v2-module works, but Go only enforces the major-version-suffix rule on semver-tagged versions, so the fix can't be fully validated until a real tag is published. Since tags are immutable on proxy.golang.org, we don't want to discover a problem post-cut for v2.4.3.

Plan for v2.4.4:

  1. Merge this PR after v2.4.3 ships.
  2. Cut v2.4.4-rc1 (or similar) and verify go get github.com/ssvlabs/ssv/v2/...@v2.4.4-rc1 resolves cleanly.
  3. Promote to v2.4.4 once green.

Tracking issue moved to milestone v2.4.4: ssvlabs/ssv-node-board#1060.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants