refactor(networkconfig): extract beacon parameters from BeaconNetwork interface#2145
Merged
MatusKysel merged 46 commits intostagefrom May 28, 2025
Merged
refactor(networkconfig): extract beacon parameters from BeaconNetwork interface#2145MatusKysel merged 46 commits intostagefrom
MatusKysel merged 46 commits intostagefrom
Conversation
# Conflicts: # network/discovery/util_test.go # networkconfig/config.go # networkconfig/holesky-e2e.go # networkconfig/holesky-stage.go # networkconfig/holesky.go # networkconfig/hoodi-stage.go # networkconfig/hoodi.go # networkconfig/local-testnet.go # networkconfig/mainnet.go # networkconfig/sepolia.go # networkconfig/test-network.go
…act-beacon-params # Conflicts: # cli/operator/node.go # network/discovery/util_test.go # networkconfig/beacon.go # networkconfig/holesky-e2e.go # networkconfig/holesky-stage.go # networkconfig/holesky.go # networkconfig/hoodi-stage.go # networkconfig/hoodi.go # networkconfig/local-testnet.go # networkconfig/mainnet.go # networkconfig/sepolia.go # networkconfig/test-network.go
iurii-ssv
reviewed
Apr 17, 2025
# Conflicts: # beacon/goclient/attest_test.go # ekm/signer_key_manager_test.go # eth/eventhandler/event_handler_test.go # message/validation/validation_test.go # network/discovery/dv5_service_test.go # network/discovery/util_test.go # networkconfig/beacon.go # networkconfig/config.go # networkconfig/holesky-e2e.go # networkconfig/holesky-stage.go # networkconfig/holesky.go # networkconfig/hoodi-stage.go # networkconfig/hoodi.go # networkconfig/local-testnet.go # networkconfig/mainnet.go # networkconfig/sepolia.go # networkconfig/ssv.go # networkconfig/test-network.go # operator/duties/scheduler_test.go # protocol/v2/blockchain/beacon/client.go
iurii-ssv
approved these changes
Apr 18, 2025
Contributor
iurii-ssv
left a comment
There was a problem hiding this comment.
LGTM (not sure about this though - #2145 (comment) - maybe somebody else can chime in on that)
Also, spec-alignment pipeline seems to be failing
# Conflicts: # cli/operator/node.go # ekm/eth_key_manager_signer.go # ekm/signer_key_manager_test.go # ekm/signer_storage_test.go # eth/eventhandler/event_handler_test.go # go.mod # go.sum # message/validation/validation.go # message/validation/validation_test.go # migrations/migrations.go # operator/duties/committee.go # operator/duties/sync_committee.go # operator/duties/validatorregistration.go # operator/validator/controller.go # operator/validator/metadata/syncer.go # operator/validator/metadata/syncer_test.go # protocol/v2/ssv/runner/proposer.go # protocol/v2/ssv/runner/runner_signatures.go # protocol/v2/ssv/testing/runner.go # protocol/v2/ssv/value_check.go # ssvsigner/ekm/signer_storage.go
# Conflicts: # beacon/goclient/attest_test.go # beacon/goclient/current_fork_test.go # beacon/goclient/events_test.go # beacon/goclient/genesis_test.go # beacon/goclient/goclient.go # beacon/goclient/goclient_test.go # beacon/goclient/options.go # beacon/goclient/signing_test.go # beacon/goclient/spec_test.go # cli/operator/node.go # message/validation/validation.go # message/validation/validation_test.go # operator/duties/scheduler.go # operator/fee_recipient/controller_test.go # protocol/v2/blockchain/beacon/client.go # protocol/v2/ssv/runner/runner_signatures.go # protocol/v2/ssv/runner/runner_validations.go # protocol/v2/ssv/runner/sync_committee_aggregator.go
# Conflicts: # operator/validator/metadata/syncer_test.go
y0sher
approved these changes
May 26, 2025
…de (#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
# Conflicts: # cli/operator/node.go # go.mod # go.sum # protocol/v2/qbft/roundtimer/timer_test.go # ssvsigner/go.mod # ssvsigner/go.sum
MatusKysel
approved these changes
May 27, 2025
* 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
* use SSV/Beacon configs instead of NetworkConfig where possible * fix linter * fix a comment * fix issues after merging
Contributor
oleg-ssvlabs
left a comment
There was a problem hiding this comment.
Great job!
Left few minor comments
…#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
* 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
oleg-ssvlabs
approved these changes
May 28, 2025
iurii-ssv
approved these changes
May 28, 2025
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of PRs that will replace #1308
Based on #2144
Depends on ssvlabs/eth2-key-manager#106
Required as a preparation to pull those parameters from the beacon node