Skip to content

networkconfig: narrow config usage #2172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

nkryuchkov
Copy link
Contributor

Use SSV/Beacon configs instead of NetworkConfig where possible

Part of PRs that will replace #1308

Depends on #2145

Copy link

codecov bot commented Apr 24, 2025

Codecov Report

Attention: Patch coverage is 65.21739% with 16 lines in your changes missing coverage. Please review.

Project coverage is 49.6%. Comparing base (7ce717a) to head (fdce5f2).
Report is 2 commits behind head on networkconfig-extract-beacon-params.

Files with missing lines Patch % Lines
network/discovery/dv5_bootnode.go 0.0% 4 Missing ⚠️
cli/operator/node.go 0.0% 3 Missing ⚠️
doppelganger/doppelganger.go 50.0% 2 Missing ⚠️
exporter/api/decided/stream.go 0.0% 2 Missing ⚠️
network/p2p/config.go 0.0% 2 Missing ⚠️
network/p2p/p2p.go 0.0% 2 Missing ⚠️
network/p2p/test_utils.go 50.0% 1 Missing ⚠️

☔ 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.

…-narrow-configs

# Conflicts:
#	network/discovery/dv5_service_test.go
#	network/discovery/service_test.go
@nkryuchkov nkryuchkov requested review from y0sher, kchojn and iurii-ssv May 13, 2025 00:20
Copy link
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

…-narrow-configs

# Conflicts:
#	cli/bootnode/boot_node.go
#	network/discovery/dv5_service.go
#	network/p2p/p2p_setup.go
#	utils/boot_node/node.go
…-narrow-configs

# Conflicts:
#	network/discovery/util_test.go
#	utils/boot_node/node.go
@MatusKysel MatusKysel merged commit 6bfa93b into networkconfig-extract-beacon-params May 27, 2025
7 checks passed
@MatusKysel MatusKysel deleted the networkconfig-narrow-configs branch May 27, 2025 14:05
MatusKysel added a commit that referenced this pull request May 28, 2025
… interface (#2145)

* networkconfig: split beacon and ssv configs

* move most parameters outside of BeaconNetwork interface

* get rid of BeaconNetwork interface

* some leftovers

* fix linter

* fix message validation tests

* fix linter again

* leftovers after merging

* fix issues after merging

* fix network name bug

* code review comments

* fix issues after merging

* update go.mod

* fix ekm tests

* remove unused import

* update go.mod

* fix issues after merging

* format/imports

* revert preparationSlots type change

* use uint64 for amount of slots and epochs

* use github.com/ssvlabs/eth2-key-manager@v1.5.5

* spec-alignment

* feat(networkconfig,beacon/goclient): get beacon config from beacon node (#2153)

* beacon/goclient: get beacon config from beacon node

* use beacon config obtained from beacon node

* log config as JSON

* delete a comment

* use Stringer to log node

* guard beacon config reads with mutex

* add a timeout log

* delete hardcoded beacon configs

* Revert "delete hardcoded beacon configs"

This reverts commit c2e2f8f.

* fix issues after merging

* code review comments

* unexport supportedSSVConfigs

* fix a context bug

* pass network config name

* feat(networkconfig): CLI for custom SSV config generation (#2156)

* networkconfig: CLI for custom SSV config generation

* implement JSON marshaling and YAML marshaling/unmarshaling

* remove TotalEthereumValidators

* simplify marshaling/unmarshaling logic

* fix markdown formatting

* use yaml@v3

* add tests

* simplify unmarshaling

* fix linter

* add missing fields to LocalTestnet

* update go.mod

* networkconfig: make hardcoded values configurable (#2164)

* beacon/goclient: get beacon config from beacon node

* use beacon config obtained from beacon node

* log config as JSON

* networkconfig: CLI for custom SSV config generation

* implement JSON marshaling and YAML marshaling/unmarshaling

* remove TotalEthereumValidators

* simplify marshaling/unmarshaling logic

* fix markdown formatting

* use yaml@v3

* add tests

* simplify unmarshaling

* delete a comment

* use Stringer to log node

* guard beacon config reads with mutex

* add a timeout log

* delete hardcoded beacon configs

* Revert "delete hardcoded beacon configs"

This reverts commit c2e2f8f.

* networkconfig: make hardcoded values configurable

* fix issues after merging

* code review comments

* fix issues after merging

* delete outer metrics for genesisForClient

* rewrite modulo calculation

* code review comments

* unexport supportedSSVConfigs

* revert the modulo calculation

* add EpochDuration mock

* G115

* fill missing fields in configs

* add a comment about eth spec

* fix error text

* use genesis validators root from config in computeVoluntaryExitDomain

* fix linter

* fix a typo

* remove redundant comments

* fix a context bug

* fix issues after merging

* pass network config name

* networkconfig: narrow config usage (#2172)

* use SSV/Beacon configs instead of NetworkConfig where possible

* fix linter

* fix a comment

* fix issues after merging

* fix issues after merging

* beacon,networkconfig: move fork handling from beacon to networkconfig (#2178)

* beacon/goclient: get beacon config from beacon node

* use beacon config obtained from beacon node

* log config as JSON

* networkconfig: CLI for custom SSV config generation

* implement JSON marshaling and YAML marshaling/unmarshaling

* remove TotalEthereumValidators

* simplify marshaling/unmarshaling logic

* fix markdown formatting

* use yaml@v3

* add tests

* simplify unmarshaling

* delete a comment

* use Stringer to log node

* guard beacon config reads with mutex

* add a timeout log

* delete hardcoded beacon configs

* Revert "delete hardcoded beacon configs"

This reverts commit c2e2f8f.

* networkconfig: make hardcoded values configurable

* fix issues after merging

* code review comments

* fix issues after merging

* delete outer metrics for genesisForClient

* rewrite modulo calculation

* code review comments

* unexport supportedSSVConfigs

* revert the modulo calculation

* add EpochDuration mock

* G115

* fill missing fields in configs

* add a comment about eth spec

* fix error text

* use genesis validators root from config in computeVoluntaryExitDomain

* beacon,networkconfig: move forks from beacon to networkconfig

* get rid of using Genesis method

* use ForkAtEpoch instead of DataVersion

* generate mocks

* fix linter

* fix beacon tests

* beacon: delete ForkAtEpoch

* fix ekm tests

* update go.mod

* fix some TODOs

* fix linter

* fix a typo

* remove redundant comments

* remove Spec method

* delete a comment

* uncomment config print

* fix a context bug

* fix issues after merging

* pass network config name

* update go.mod

* fix issues after merging

* networkconfig: delete hardcoded beacon configs (#2183)

* beacon/goclient: get beacon config from beacon node

* use beacon config obtained from beacon node

* log config as JSON

* networkconfig: CLI for custom SSV config generation

* implement JSON marshaling and YAML marshaling/unmarshaling

* remove TotalEthereumValidators

* simplify marshaling/unmarshaling logic

* fix markdown formatting

* use yaml@v3

* add tests

* simplify unmarshaling

* delete a comment

* use Stringer to log node

* guard beacon config reads with mutex

* add a timeout log

* delete hardcoded beacon configs

* Revert "delete hardcoded beacon configs"

This reverts commit c2e2f8f.

* networkconfig: make hardcoded values configurable

* fix issues after merging

* code review comments

* fix issues after merging

* delete outer metrics for genesisForClient

* rewrite modulo calculation

* code review comments

* unexport supportedSSVConfigs

* revert the modulo calculation

* add EpochDuration mock

* G115

* fill missing fields in configs

* add a comment about eth spec

* fix error text

* use genesis validators root from config in computeVoluntaryExitDomain

* beacon,networkconfig: move forks from beacon to networkconfig

* get rid of using Genesis method

* use ForkAtEpoch instead of DataVersion

* generate mocks

* fix linter

* fix beacon tests

* beacon: delete ForkAtEpoch

* fix ekm tests

* update go.mod

* fix some TODOs

* networkconfig: delete mainnet beacon config

* networkconfig: delete rest of configs

* replace TestRealNetwork with TestNetwork

* fix linter

* fix a typo

* remove redundant comments

* remove Spec method

* delete a comment

* uncomment config print

* fix a context bug

* fix issues after merging

* delete TestRealNetwork

* pass network config name

* update go.mod

* fix issues after merging

* fix issues after merging

* rename BeaconName to NetworkName

* refactor getting spec parameters

* update go.mod

* fix type assertion

* fix spec align

---------

Co-authored-by: y0sher <lyosher@gmail.com>
Co-authored-by: Matus Kysel <matus@ssvlabs.io>
nkryuchkov added a commit that referenced this pull request Jun 4, 2025
… interface (#2145)

* networkconfig: split beacon and ssv configs

* move most parameters outside of BeaconNetwork interface

* get rid of BeaconNetwork interface

* some leftovers

* fix linter

* fix message validation tests

* fix linter again

* leftovers after merging

* fix issues after merging

* fix network name bug

* code review comments

* fix issues after merging

* update go.mod

* fix ekm tests

* remove unused import

* update go.mod

* fix issues after merging

* format/imports

* revert preparationSlots type change

* use uint64 for amount of slots and epochs

* use github.com/ssvlabs/eth2-key-manager@v1.5.5

* spec-alignment

* feat(networkconfig,beacon/goclient): get beacon config from beacon node (#2153)

* beacon/goclient: get beacon config from beacon node

* use beacon config obtained from beacon node

* log config as JSON

* delete a comment

* use Stringer to log node

* guard beacon config reads with mutex

* add a timeout log

* delete hardcoded beacon configs

* Revert "delete hardcoded beacon configs"

This reverts commit c2e2f8f.

* fix issues after merging

* code review comments

* unexport supportedSSVConfigs

* fix a context bug

* pass network config name

* feat(networkconfig): CLI for custom SSV config generation (#2156)

* networkconfig: CLI for custom SSV config generation

* implement JSON marshaling and YAML marshaling/unmarshaling

* remove TotalEthereumValidators

* simplify marshaling/unmarshaling logic

* fix markdown formatting

* use yaml@v3

* add tests

* simplify unmarshaling

* fix linter

* add missing fields to LocalTestnet

* update go.mod

* networkconfig: make hardcoded values configurable (#2164)

* beacon/goclient: get beacon config from beacon node

* use beacon config obtained from beacon node

* log config as JSON

* networkconfig: CLI for custom SSV config generation

* implement JSON marshaling and YAML marshaling/unmarshaling

* remove TotalEthereumValidators

* simplify marshaling/unmarshaling logic

* fix markdown formatting

* use yaml@v3

* add tests

* simplify unmarshaling

* delete a comment

* use Stringer to log node

* guard beacon config reads with mutex

* add a timeout log

* delete hardcoded beacon configs

* Revert "delete hardcoded beacon configs"

This reverts commit c2e2f8f.

* networkconfig: make hardcoded values configurable

* fix issues after merging

* code review comments

* fix issues after merging

* delete outer metrics for genesisForClient

* rewrite modulo calculation

* code review comments

* unexport supportedSSVConfigs

* revert the modulo calculation

* add EpochDuration mock

* G115

* fill missing fields in configs

* add a comment about eth spec

* fix error text

* use genesis validators root from config in computeVoluntaryExitDomain

* fix linter

* fix a typo

* remove redundant comments

* fix a context bug

* fix issues after merging

* pass network config name

* networkconfig: narrow config usage (#2172)

* use SSV/Beacon configs instead of NetworkConfig where possible

* fix linter

* fix a comment

* fix issues after merging

* fix issues after merging

* beacon,networkconfig: move fork handling from beacon to networkconfig (#2178)

* beacon/goclient: get beacon config from beacon node

* use beacon config obtained from beacon node

* log config as JSON

* networkconfig: CLI for custom SSV config generation

* implement JSON marshaling and YAML marshaling/unmarshaling

* remove TotalEthereumValidators

* simplify marshaling/unmarshaling logic

* fix markdown formatting

* use yaml@v3

* add tests

* simplify unmarshaling

* delete a comment

* use Stringer to log node

* guard beacon config reads with mutex

* add a timeout log

* delete hardcoded beacon configs

* Revert "delete hardcoded beacon configs"

This reverts commit c2e2f8f.

* networkconfig: make hardcoded values configurable

* fix issues after merging

* code review comments

* fix issues after merging

* delete outer metrics for genesisForClient

* rewrite modulo calculation

* code review comments

* unexport supportedSSVConfigs

* revert the modulo calculation

* add EpochDuration mock

* G115

* fill missing fields in configs

* add a comment about eth spec

* fix error text

* use genesis validators root from config in computeVoluntaryExitDomain

* beacon,networkconfig: move forks from beacon to networkconfig

* get rid of using Genesis method

* use ForkAtEpoch instead of DataVersion

* generate mocks

* fix linter

* fix beacon tests

* beacon: delete ForkAtEpoch

* fix ekm tests

* update go.mod

* fix some TODOs

* fix linter

* fix a typo

* remove redundant comments

* remove Spec method

* delete a comment

* uncomment config print

* fix a context bug

* fix issues after merging

* pass network config name

* update go.mod

* fix issues after merging

* networkconfig: delete hardcoded beacon configs (#2183)

* beacon/goclient: get beacon config from beacon node

* use beacon config obtained from beacon node

* log config as JSON

* networkconfig: CLI for custom SSV config generation

* implement JSON marshaling and YAML marshaling/unmarshaling

* remove TotalEthereumValidators

* simplify marshaling/unmarshaling logic

* fix markdown formatting

* use yaml@v3

* add tests

* simplify unmarshaling

* delete a comment

* use Stringer to log node

* guard beacon config reads with mutex

* add a timeout log

* delete hardcoded beacon configs

* Revert "delete hardcoded beacon configs"

This reverts commit c2e2f8f.

* networkconfig: make hardcoded values configurable

* fix issues after merging

* code review comments

* fix issues after merging

* delete outer metrics for genesisForClient

* rewrite modulo calculation

* code review comments

* unexport supportedSSVConfigs

* revert the modulo calculation

* add EpochDuration mock

* G115

* fill missing fields in configs

* add a comment about eth spec

* fix error text

* use genesis validators root from config in computeVoluntaryExitDomain

* beacon,networkconfig: move forks from beacon to networkconfig

* get rid of using Genesis method

* use ForkAtEpoch instead of DataVersion

* generate mocks

* fix linter

* fix beacon tests

* beacon: delete ForkAtEpoch

* fix ekm tests

* update go.mod

* fix some TODOs

* networkconfig: delete mainnet beacon config

* networkconfig: delete rest of configs

* replace TestRealNetwork with TestNetwork

* fix linter

* fix a typo

* remove redundant comments

* remove Spec method

* delete a comment

* uncomment config print

* fix a context bug

* fix issues after merging

* delete TestRealNetwork

* pass network config name

* update go.mod

* fix issues after merging

* fix issues after merging

* rename BeaconName to NetworkName

* refactor getting spec parameters

* update go.mod

* fix type assertion

* fix spec align

---------

Co-authored-by: y0sher <lyosher@gmail.com>
Co-authored-by: Matus Kysel <matus@ssvlabs.io>
nkryuchkov added a commit that referenced this pull request Jun 4, 2025
… interface (#2145)

* networkconfig: split beacon and ssv configs

* move most parameters outside of BeaconNetwork interface

* get rid of BeaconNetwork interface

* some leftovers

* fix linter

* fix message validation tests

* fix linter again

* leftovers after merging

* fix issues after merging

* fix network name bug

* code review comments

* fix issues after merging

* update go.mod

* fix ekm tests

* remove unused import

* update go.mod

* fix issues after merging

* format/imports

* revert preparationSlots type change

* use uint64 for amount of slots and epochs

* use github.com/ssvlabs/eth2-key-manager@v1.5.5

* spec-alignment

* feat(networkconfig,beacon/goclient): get beacon config from beacon node (#2153)

* beacon/goclient: get beacon config from beacon node

* use beacon config obtained from beacon node

* log config as JSON

* delete a comment

* use Stringer to log node

* guard beacon config reads with mutex

* add a timeout log

* delete hardcoded beacon configs

* Revert "delete hardcoded beacon configs"

This reverts commit c2e2f8f.

* fix issues after merging

* code review comments

* unexport supportedSSVConfigs

* fix a context bug

* pass network config name

* feat(networkconfig): CLI for custom SSV config generation (#2156)

* networkconfig: CLI for custom SSV config generation

* implement JSON marshaling and YAML marshaling/unmarshaling

* remove TotalEthereumValidators

* simplify marshaling/unmarshaling logic

* fix markdown formatting

* use yaml@v3

* add tests

* simplify unmarshaling

* fix linter

* add missing fields to LocalTestnet

* update go.mod

* networkconfig: make hardcoded values configurable (#2164)

* beacon/goclient: get beacon config from beacon node

* use beacon config obtained from beacon node

* log config as JSON

* networkconfig: CLI for custom SSV config generation

* implement JSON marshaling and YAML marshaling/unmarshaling

* remove TotalEthereumValidators

* simplify marshaling/unmarshaling logic

* fix markdown formatting

* use yaml@v3

* add tests

* simplify unmarshaling

* delete a comment

* use Stringer to log node

* guard beacon config reads with mutex

* add a timeout log

* delete hardcoded beacon configs

* Revert "delete hardcoded beacon configs"

This reverts commit c2e2f8f.

* networkconfig: make hardcoded values configurable

* fix issues after merging

* code review comments

* fix issues after merging

* delete outer metrics for genesisForClient

* rewrite modulo calculation

* code review comments

* unexport supportedSSVConfigs

* revert the modulo calculation

* add EpochDuration mock

* G115

* fill missing fields in configs

* add a comment about eth spec

* fix error text

* use genesis validators root from config in computeVoluntaryExitDomain

* fix linter

* fix a typo

* remove redundant comments

* fix a context bug

* fix issues after merging

* pass network config name

* networkconfig: narrow config usage (#2172)

* use SSV/Beacon configs instead of NetworkConfig where possible

* fix linter

* fix a comment

* fix issues after merging

* fix issues after merging

* beacon,networkconfig: move fork handling from beacon to networkconfig (#2178)

* beacon/goclient: get beacon config from beacon node

* use beacon config obtained from beacon node

* log config as JSON

* networkconfig: CLI for custom SSV config generation

* implement JSON marshaling and YAML marshaling/unmarshaling

* remove TotalEthereumValidators

* simplify marshaling/unmarshaling logic

* fix markdown formatting

* use yaml@v3

* add tests

* simplify unmarshaling

* delete a comment

* use Stringer to log node

* guard beacon config reads with mutex

* add a timeout log

* delete hardcoded beacon configs

* Revert "delete hardcoded beacon configs"

This reverts commit c2e2f8f.

* networkconfig: make hardcoded values configurable

* fix issues after merging

* code review comments

* fix issues after merging

* delete outer metrics for genesisForClient

* rewrite modulo calculation

* code review comments

* unexport supportedSSVConfigs

* revert the modulo calculation

* add EpochDuration mock

* G115

* fill missing fields in configs

* add a comment about eth spec

* fix error text

* use genesis validators root from config in computeVoluntaryExitDomain

* beacon,networkconfig: move forks from beacon to networkconfig

* get rid of using Genesis method

* use ForkAtEpoch instead of DataVersion

* generate mocks

* fix linter

* fix beacon tests

* beacon: delete ForkAtEpoch

* fix ekm tests

* update go.mod

* fix some TODOs

* fix linter

* fix a typo

* remove redundant comments

* remove Spec method

* delete a comment

* uncomment config print

* fix a context bug

* fix issues after merging

* pass network config name

* update go.mod

* fix issues after merging

* networkconfig: delete hardcoded beacon configs (#2183)

* beacon/goclient: get beacon config from beacon node

* use beacon config obtained from beacon node

* log config as JSON

* networkconfig: CLI for custom SSV config generation

* implement JSON marshaling and YAML marshaling/unmarshaling

* remove TotalEthereumValidators

* simplify marshaling/unmarshaling logic

* fix markdown formatting

* use yaml@v3

* add tests

* simplify unmarshaling

* delete a comment

* use Stringer to log node

* guard beacon config reads with mutex

* add a timeout log

* delete hardcoded beacon configs

* Revert "delete hardcoded beacon configs"

This reverts commit c2e2f8f.

* networkconfig: make hardcoded values configurable

* fix issues after merging

* code review comments

* fix issues after merging

* delete outer metrics for genesisForClient

* rewrite modulo calculation

* code review comments

* unexport supportedSSVConfigs

* revert the modulo calculation

* add EpochDuration mock

* G115

* fill missing fields in configs

* add a comment about eth spec

* fix error text

* use genesis validators root from config in computeVoluntaryExitDomain

* beacon,networkconfig: move forks from beacon to networkconfig

* get rid of using Genesis method

* use ForkAtEpoch instead of DataVersion

* generate mocks

* fix linter

* fix beacon tests

* beacon: delete ForkAtEpoch

* fix ekm tests

* update go.mod

* fix some TODOs

* networkconfig: delete mainnet beacon config

* networkconfig: delete rest of configs

* replace TestRealNetwork with TestNetwork

* fix linter

* fix a typo

* remove redundant comments

* remove Spec method

* delete a comment

* uncomment config print

* fix a context bug

* fix issues after merging

* delete TestRealNetwork

* pass network config name

* update go.mod

* fix issues after merging

* fix issues after merging

* rename BeaconName to NetworkName

* refactor getting spec parameters

* update go.mod

* fix type assertion

* fix spec align

---------

Co-authored-by: y0sher <lyosher@gmail.com>
Co-authored-by: Matus Kysel <matus@ssvlabs.io>
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.

5 participants