From 37752f6c495c6c53c49403688d8054660f9a0cd7 Mon Sep 17 00:00:00 2001 From: olegshmuelov <45327364+olegshmuelov@users.noreply.github.com> Date: Mon, 29 Jul 2024 19:16:45 +0300 Subject: [PATCH] draft --- beacon/goclient/goclient.go | 2 - beacon/goclient/proposer.go | 165 ++----------------- beacon/goclient/validator.go | 7 +- cli/operator/node.go | 7 +- config/config.example.yaml | 4 - docs/EXTERNAL_BUILDERS.md | 3 - e2e/config/config.yaml | 2 - e2e/go.mod | 18 +- e2e/go.sum | 8 + ekm/eth_key_manager_signer.go | 43 ++--- ekm/signer_key_manager_test.go | 2 +- eth/ethtest/utils_test.go | 2 +- eth/eventhandler/event_handler_test.go | 2 +- eth/eventsyncer/event_syncer_test.go | 2 +- go.mod | 23 +-- go.sum | 47 +++--- logging/fields/fields.go | 5 - operator/duties/scheduler.go | 7 +- operator/duties/scheduler_test.go | 4 - operator/node.go | 1 - operator/validator/controller.go | 3 - operator/validator/controller_test.go | 2 +- protocol/v2/ssv/runner/proposer.go | 18 +- protocol/v2/ssv/spectest/ssv_mapping_test.go | 8 + protocol/v2/ssv/testing/runner.go | 11 -- protocol/v2/ssv/validator/opts.go | 1 - 26 files changed, 116 insertions(+), 281 deletions(-) diff --git a/beacon/goclient/goclient.go b/beacon/goclient/goclient.go index 65163b089b..0cb944dd76 100644 --- a/beacon/goclient/goclient.go +++ b/beacon/goclient/goclient.go @@ -119,8 +119,6 @@ type Client interface { eth2client.NodeSyncingProvider eth2client.ProposalProvider eth2client.ProposalSubmitter - eth2client.BlindedProposalProvider - eth2client.V3ProposalProvider eth2client.BlindedProposalSubmitter eth2client.DomainProvider eth2client.SyncCommitteeMessagesSubmitter diff --git a/beacon/goclient/proposer.go b/beacon/goclient/proposer.go index 3be45e37f7..2baa692573 100644 --- a/beacon/goclient/proposer.go +++ b/beacon/goclient/proposer.go @@ -102,157 +102,8 @@ func (gc *goClient) GetBeaconBlock(slot phase0.Slot, graffitiBytes, randao []byt } } -func (gc *goClient) GetBlindedBeaconBlock(slot phase0.Slot, graffitiBytes, randao []byte) (ssz.Marshaler, spec.DataVersion, error) { - if gc.nodeClient == NodePrysm { - gc.log.Debug("using V3 endpoint for prysm blinded block") - return gc.V3Proposal(slot, graffitiBytes, randao) - } - return gc.DefaultGetBlindedBeaconBlock(slot, graffitiBytes, randao) -} - -// GetBlindedBeaconBlock returns blinded beacon block by the given slot, graffiti, and randao. -func (gc *goClient) DefaultGetBlindedBeaconBlock(slot phase0.Slot, graffitiBytes, randao []byte) (ssz.Marshaler, spec.DataVersion, error) { - sig := phase0.BLSSignature{} - copy(sig[:], randao[:]) - - graffiti := [32]byte{} - copy(graffiti[:], graffitiBytes[:]) - - reqStart := time.Now() - blindedProposalResp, err := gc.client.BlindedProposal(gc.ctx, &api.BlindedProposalOpts{ - Slot: slot, - RandaoReveal: sig, - Graffiti: graffiti, - SkipRandaoVerification: false, - }) - if err != nil { - return nil, DataVersionNil, fmt.Errorf("failed to get blinded proposal: %w", err) - } - if blindedProposalResp == nil { - return nil, DataVersionNil, fmt.Errorf("blinded proposal response is nil") - } - if blindedProposalResp.Data == nil { - return nil, DataVersionNil, fmt.Errorf("blinded proposal data is nil") - } - - metricsProposerDataRequest.Observe(time.Since(reqStart).Seconds()) - beaconBlock := blindedProposalResp.Data - - switch beaconBlock.Version { - case spec.DataVersionCapella: - if beaconBlock.Capella == nil { - return nil, DataVersionNil, fmt.Errorf("capella block is nil") - } - if beaconBlock.Capella.Body == nil { - return nil, DataVersionNil, fmt.Errorf("capella block body is nil") - } - if beaconBlock.Capella.Body.ExecutionPayloadHeader == nil { - return nil, DataVersionNil, fmt.Errorf("capella block execution payload header is nil") - } - return beaconBlock.Capella, beaconBlock.Version, nil - case spec.DataVersionDeneb: - if beaconBlock.Deneb == nil { - return nil, DataVersionNil, fmt.Errorf("deneb block contents is nil") - } - if beaconBlock.Deneb.Body == nil { - return nil, DataVersionNil, fmt.Errorf("deneb block body is nil") - } - if beaconBlock.Deneb.Body.ExecutionPayloadHeader == nil { - return nil, DataVersionNil, fmt.Errorf("deneb block execution payload header is nil") - } - return beaconBlock.Deneb, beaconBlock.Version, nil - default: - return nil, DataVersionNil, fmt.Errorf("beacon block version %s not supported", beaconBlock.Version) - } -} - -func (gc *goClient) V3Proposal(slot phase0.Slot, graffitiBytes, randao []byte) (ssz.Marshaler, spec.DataVersion, error) { - sig := phase0.BLSSignature{} - copy(sig[:], randao[:]) - - graffiti := [32]byte{} - copy(graffiti[:], graffitiBytes[:]) - - reqStart := time.Now() - v3ProposalResp, err := gc.client.V3Proposal(gc.ctx, &api.V3ProposalOpts{ - Slot: slot, - RandaoReveal: sig, - Graffiti: graffiti, - SkipRandaoVerification: false, - }) - if err != nil { - return nil, DataVersionNil, fmt.Errorf("failed to get v3 proposal: %w", err) - } - if v3ProposalResp == nil { - return nil, DataVersionNil, fmt.Errorf("v3 proposal response is nil") - } - if v3ProposalResp.Data == nil { - return nil, DataVersionNil, fmt.Errorf("v3 proposal data is nil") - } - - metricsProposerDataRequest.Observe(time.Since(reqStart).Seconds()) - beaconBlock := v3ProposalResp.Data - - if beaconBlock.ExecutionPayloadBlinded { - switch beaconBlock.Version { - case spec.DataVersionCapella: - if beaconBlock.BlindedCapella == nil { - return nil, DataVersionNil, fmt.Errorf("capella blinded block is nil") - } - if beaconBlock.BlindedCapella.Body == nil { - return nil, DataVersionNil, fmt.Errorf("capella blinded block body is nil") - } - if beaconBlock.BlindedCapella.Body.ExecutionPayloadHeader == nil { - return nil, DataVersionNil, fmt.Errorf("capella blinded block execution payload header is nil") - } - return beaconBlock.BlindedCapella, beaconBlock.Version, nil - case spec.DataVersionDeneb: - if beaconBlock.BlindedDeneb == nil { - return nil, DataVersionNil, fmt.Errorf("deneb blinded block contents is nil") - } - if beaconBlock.BlindedDeneb.Body == nil { - return nil, DataVersionNil, fmt.Errorf("deneb blinded block body is nil") - } - if beaconBlock.BlindedDeneb.Body.ExecutionPayloadHeader == nil { - return nil, DataVersionNil, fmt.Errorf("deneb blinded block execution payload header is nil") - } - return beaconBlock.BlindedDeneb, beaconBlock.Version, nil - default: - return nil, DataVersionNil, fmt.Errorf("beacon blinded block version %s not supported", beaconBlock.Version) - } - } - - switch beaconBlock.Version { - case spec.DataVersionCapella: - if beaconBlock.Capella == nil { - return nil, DataVersionNil, fmt.Errorf("capella block is nil") - } - if beaconBlock.Capella.Body == nil { - return nil, DataVersionNil, fmt.Errorf("capella block body is nil") - } - if beaconBlock.Capella.Body.ExecutionPayload == nil { - return nil, DataVersionNil, fmt.Errorf("capella block execution payload is nil") - } - return beaconBlock.Capella, beaconBlock.Version, nil - case spec.DataVersionDeneb: - if beaconBlock.Deneb == nil { - return nil, DataVersionNil, fmt.Errorf("deneb block contents is nil") - } - if beaconBlock.Deneb.Block == nil { - return nil, DataVersionNil, fmt.Errorf("deneb block is nil") - } - if beaconBlock.Deneb.Block.Body == nil { - return nil, DataVersionNil, fmt.Errorf("deneb block body is nil") - } - if beaconBlock.Deneb.Block.Body.ExecutionPayload == nil { - return nil, DataVersionNil, fmt.Errorf("deneb block execution payload is nil") - } - return beaconBlock.Deneb, beaconBlock.Version, nil - - default: - return nil, DataVersionNil, fmt.Errorf("beacon block version %s not supported", beaconBlock.Version) - } - +func (gc *goClient) GetBlindedBeaconBlock(slot phase0.Slot, graffiti, randao []byte) (ssz.Marshaler, spec.DataVersion, error) { + return gc.GetBeaconBlock(slot, graffiti, randao) } func (gc *goClient) SubmitBlindedBeaconBlock(block *api.VersionedBlindedProposal, sig phase0.BLSSignature) error { @@ -286,7 +137,11 @@ func (gc *goClient) SubmitBlindedBeaconBlock(block *api.VersionedBlindedProposal return fmt.Errorf("unknown block version") } - return gc.client.SubmitBlindedProposal(gc.ctx, signedBlock) + opts := &api.SubmitBlindedProposalOpts{ + Proposal: signedBlock, + } + + return gc.client.SubmitBlindedProposal(gc.ctx, opts) } // SubmitBeaconBlock submit the block to the node @@ -328,7 +183,11 @@ func (gc *goClient) SubmitBeaconBlock(block *api.VersionedProposal, sig phase0.B return fmt.Errorf("unknown block version") } - return gc.client.SubmitProposal(gc.ctx, signedBlock) + opts := &api.SubmitProposalOpts{ + Proposal: signedBlock, + } + + return gc.client.SubmitProposal(gc.ctx, opts) } func (gc *goClient) SubmitValidatorRegistration(pubkey []byte, feeRecipient bellatrix.ExecutionAddress, sig phase0.BLSSignature) error { diff --git a/beacon/goclient/validator.go b/beacon/goclient/validator.go index 612289bcea..3171f81c3b 100644 --- a/beacon/goclient/validator.go +++ b/beacon/goclient/validator.go @@ -11,10 +11,9 @@ import ( // GetValidatorData returns metadata (balance, index, status, more) for each pubkey from the node func (gc *goClient) GetValidatorData(validatorPubKeys []phase0.BLSPubKey) (map[phase0.ValidatorIndex]*eth2apiv1.Validator, error) { resp, err := gc.client.Validators(gc.ctx, &api.ValidatorsOpts{ - State: "head", // TODO maybe need to get the chainId (head) as var - PubKeys: validatorPubKeys, - WithoutBeaconState: true, - Common: api.CommonOpts{Timeout: gc.longTimeout}, + State: "head", // TODO maybe need to get the chainId (head) as var + PubKeys: validatorPubKeys, + Common: api.CommonOpts{Timeout: gc.longTimeout}, }) if err != nil { return nil, fmt.Errorf("failed to obtain validators: %w", err) diff --git a/cli/operator/node.go b/cli/operator/node.go index 71f18c4ca1..d24435c1ed 100644 --- a/cli/operator/node.go +++ b/cli/operator/node.go @@ -169,7 +169,7 @@ var StartNodeCmd = &cobra.Command{ logger.Fatal("could not get operator private key hash", zap.Error(err)) } - keyManager, err := ekm.NewETHKeyManagerSigner(logger, db, networkConfig, cfg.SSVOptions.ValidatorOptions.BuilderProposals, ekmHashedKey) + keyManager, err := ekm.NewETHKeyManagerSigner(logger, db, networkConfig, ekmHashedKey) if err != nil { logger.Fatal("could not create new eth-key-manager signer", zap.Error(err)) } @@ -564,16 +564,11 @@ func setupSSVNetwork(logger *zap.Logger) (networkconfig.NetworkConfig, error) { if cfg.SSVOptions.ValidatorOptions.FullNode { nodeType = "full" } - builderProposals := "disabled" - if cfg.SSVOptions.ValidatorOptions.BuilderProposals { - builderProposals = "enabled" - } logger.Info("setting ssv network", fields.Network(networkConfig.Name), fields.Domain(networkConfig.Domain), zap.String("nodeType", nodeType), - zap.String("builderProposals(MEV)", builderProposals), zap.Any("beaconNetwork", networkConfig.Beacon.GetNetwork().BeaconNetwork), zap.Uint64("genesisEpoch", uint64(networkConfig.GenesisEpoch)), zap.String("registryContract", networkConfig.RegistryContractAddr), diff --git a/config/config.example.yaml b/config/config.example.yaml index 04e65a3a91..655b7c1481 100644 --- a/config/config.example.yaml +++ b/config/config.example.yaml @@ -19,10 +19,6 @@ eth2: # HTTP URL of the Beacon node to connect to. BeaconNodeAddr: http://example.url:5052 - ValidatorOptions: - # Whether to enable MEV block production. Requires the connected Beacon node to be MEV-enabled. - BuilderProposals: false - eth1: # WebSocket URL of the Eth1 node to connect to. ETH1Addr: ws://example.url:8546/ws diff --git a/docs/EXTERNAL_BUILDERS.md b/docs/EXTERNAL_BUILDERS.md index a95e629d75..a971df0504 100644 --- a/docs/EXTERNAL_BUILDERS.md +++ b/docs/EXTERNAL_BUILDERS.md @@ -5,9 +5,6 @@ 1. Configure your beacon node to use an external builder - Lighthouse: https://lighthouse-book.sigmaprime.io/builders.html - Prysm: https://docs.prylabs.network/docs/prysm-usage/parameters -2. Enable builder proposals for SSV node by setting an according variable to `true`: - - YAML config: `BuilderProposals` - - environment variable: `BUILDER_PROPOSALS` ## How it works diff --git a/e2e/config/config.yaml b/e2e/config/config.yaml index 1a5b76f036..18f1294f15 100644 --- a/e2e/config/config.yaml +++ b/e2e/config/config.yaml @@ -26,8 +26,6 @@ p2p: ssv: Network: holesky-e2e - ValidatorOptions: - BuilderProposals: false #bootnode: # PrivateKey: 3b503a31004ae799fe93e547a96a27630d74f2555892e6c5190135e50d8f3bf1 diff --git a/e2e/go.mod b/e2e/go.mod index 2b5531ed1d..f036f144b8 100644 --- a/e2e/go.mod +++ b/e2e/go.mod @@ -3,11 +3,11 @@ module github.com/bloxapp/ssv/e2e go 1.20 require ( - github.com/attestantio/go-eth2-client v0.19.11-0.20240129201044-9d799aaab2bd + github.com/attestantio/go-eth2-client v0.21.9 github.com/bloxapp/ssv v1.2.1-0.20240204104853-e3a662984cac github.com/go-chi/chi/v5 v5.0.10 github.com/pkg/errors v0.9.1 - github.com/rs/zerolog v1.31.0 + github.com/rs/zerolog v1.32.0 github.com/sourcegraph/conc v0.3.0 go.uber.org/zap v1.26.0 ) @@ -17,17 +17,17 @@ require ( github.com/ferranbt/fastssz v0.1.3 // indirect github.com/goccy/go-yaml v1.11.0 // indirect github.com/holiman/uint256 v1.2.4 // indirect - github.com/klauspost/cpuid/v2 v2.2.6 // indirect + github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/mattn/go-colorable v0.1.13 github.com/mattn/go-isatty v0.0.20 // indirect github.com/minio/sha256-simd v1.0.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 // indirect + github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e // indirect github.com/r3labs/sse/v2 v2.10.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.18.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.16.0 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/net v0.21.0 // indirect + golang.org/x/sys v0.20.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect @@ -116,7 +116,7 @@ require ( go.opentelemetry.io/otel/metric v1.16.0 // indirect go.opentelemetry.io/otel/trace v1.16.0 // indirect golang.org/x/mod v0.11.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/text v0.15.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.9.1 // indirect google.golang.org/protobuf v1.30.0 // indirect @@ -125,5 +125,3 @@ require ( gotest.tools/v3 v3.5.1 // indirect lukechampine.com/blake3 v1.2.1 // indirect ) - -replace github.com/attestantio/go-eth2-client => github.com/moshe-blox/go-eth2-client v0.7.2-0.20240204094454-17f5c145f39f diff --git a/e2e/go.sum b/e2e/go.sum index f144b898ae..8a1eccbafe 100644 --- a/e2e/go.sum +++ b/e2e/go.sum @@ -9,6 +9,7 @@ github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2o github.com/alecthomas/kong v0.8.1 h1:acZdn3m4lLRobeh3Zi2S2EpnXTd1mOL6U7xVml+vfkY= github.com/alecthomas/kong v0.8.1/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U= github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE= +github.com/attestantio/go-eth2-client v0.21.9/go.mod h1:d7ZPNrMX8jLfIgML5u7QZxFo2AukLM+5m08iMaLdqb8= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= @@ -189,6 +190,7 @@ github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/d github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/koron/go-ssdp v0.0.4 h1:1IDwrghSKYM7yLf7XCzbByg2sJ/JcNOZRXS2jczTwz0= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -293,6 +295,7 @@ github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+Pymzi github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 h1:0tVE4tdWQK9ZpYygoV7+vS6QkDvQVySboMVEIxBJmXw= github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7/go.mod h1:wmuf/mdK4VMD+jA9ThwcUKjg3a2XWM9cVfFYjDyY4j4= +github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e/go.mod h1:wmuf/mdK4VMD+jA9ThwcUKjg3a2XWM9cVfFYjDyY4j4= github.com/prysmaticlabs/prysm/v4 v4.0.8 h1:F6Rt5gpaxbW50aP63jMmSXE16JW42HaEzUT55L9laaM= github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= github.com/quic-go/qtls-go1-19 v0.3.3 h1:wznEHvJwd+2X3PqftRha0SUKmGsnb6dfArMhy9PeJVE= @@ -307,6 +310,7 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A= github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= @@ -375,6 +379,7 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20230810033253-352e893a4cad h1:g0bG7Z4uG+OgH2QDODnjp6ggkk1bJDsINcuWmJN1iJU= golang.org/x/exp v0.0.0-20230810033253-352e893a4cad/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= @@ -404,6 +409,7 @@ golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -444,6 +450,7 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -454,6 +461,7 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/ekm/eth_key_manager_signer.go b/ekm/eth_key_manager_signer.go index b6afdaf042..495f9a60ea 100644 --- a/ekm/eth_key_manager_signer.go +++ b/ekm/eth_key_manager_signer.go @@ -47,7 +47,6 @@ type ethKeyManagerSigner struct { storage Storage domain spectypes.DomainType slashingProtector core.SlashingProtector - builderProposals bool } // StorageProvider provides the underlying KeyManager storage. @@ -59,7 +58,7 @@ type StorageProvider interface { } // NewETHKeyManagerSigner returns a new instance of ethKeyManagerSigner -func NewETHKeyManagerSigner(logger *zap.Logger, db basedb.Database, network networkconfig.NetworkConfig, builderProposals bool, encryptionKey string) (spectypes.KeyManager, error) { +func NewETHKeyManagerSigner(logger *zap.Logger, db basedb.Database, network networkconfig.NetworkConfig, encryptionKey string) (spectypes.KeyManager, error) { signerStore := NewSignerStorage(db, network.Beacon, logger) if encryptionKey != "" { err := signerStore.SetEncryptionKey(encryptionKey) @@ -96,7 +95,6 @@ func NewETHKeyManagerSigner(logger *zap.Logger, db basedb.Database, network netw storage: signerStore, domain: network.Domain, slashingProtector: slashingProtector, - builderProposals: builderProposals, }, nil } @@ -134,41 +132,34 @@ func (km *ethKeyManagerSigner) signBeaconObject(obj ssz.HashRoot, domain phase0. } return km.signer.SignBeaconAttestation(data, domain, pk) case spectypes.DomainProposer: - if km.builderProposals { - var vBlindedBlock *api.VersionedBlindedBeaconBlock - switch v := obj.(type) { - case *apiv1capella.BlindedBeaconBlock: - vBlindedBlock = &api.VersionedBlindedBeaconBlock{ - Version: spec.DataVersionCapella, - Capella: v, - } - return km.signer.SignBlindedBeaconBlock(vBlindedBlock, domain, pk) - case *apiv1deneb.BlindedBeaconBlock: - vBlindedBlock = &api.VersionedBlindedBeaconBlock{ - Version: spec.DataVersionDeneb, - Deneb: v, - } - return km.signer.SignBlindedBeaconBlock(vBlindedBlock, domain, pk) - } - } - - var vBlock *spec.VersionedBeaconBlock switch v := obj.(type) { case *capella.BeaconBlock: - vBlock = &spec.VersionedBeaconBlock{ + vBlock := &spec.VersionedBeaconBlock{ Version: spec.DataVersionCapella, Capella: v, } + return km.signer.SignBeaconBlock(vBlock, domain, pk) case *deneb.BeaconBlock: - vBlock = &spec.VersionedBeaconBlock{ + vBlock := &spec.VersionedBeaconBlock{ + Version: spec.DataVersionDeneb, + Deneb: v, + } + return km.signer.SignBeaconBlock(vBlock, domain, pk) + case *apiv1capella.BlindedBeaconBlock: + vBlindedBlock := &api.VersionedBlindedBeaconBlock{ + Version: spec.DataVersionCapella, + Capella: v, + } + return km.signer.SignBlindedBeaconBlock(vBlindedBlock, domain, pk) + case *apiv1deneb.BlindedBeaconBlock: + vBlindedBlock := &api.VersionedBlindedBeaconBlock{ Version: spec.DataVersionDeneb, Deneb: v, } + return km.signer.SignBlindedBeaconBlock(vBlindedBlock, domain, pk) default: return nil, nil, fmt.Errorf("obj type is unknown: %T", obj) } - - return km.signer.SignBeaconBlock(vBlock, domain, pk) case spectypes.DomainVoluntaryExit: data, ok := obj.(*phase0.VoluntaryExit) if !ok { diff --git a/ekm/signer_key_manager_test.go b/ekm/signer_key_manager_test.go index 5089b912bd..b4d7914222 100644 --- a/ekm/signer_key_manager_test.go +++ b/ekm/signer_key_manager_test.go @@ -48,7 +48,7 @@ func testKeyManager(t *testing.T, network *networkconfig.NetworkConfig) spectype } } - km, err := NewETHKeyManagerSigner(logger, db, *network, true, "") + km, err := NewETHKeyManagerSigner(logger, db, *network, "") require.NoError(t, err) sk1 := &bls.SecretKey{} diff --git a/eth/ethtest/utils_test.go b/eth/ethtest/utils_test.go index 452930c287..ef99d995b4 100644 --- a/eth/ethtest/utils_test.go +++ b/eth/ethtest/utils_test.go @@ -163,7 +163,7 @@ func setupEventHandler( operatorDataStore := operatordatastore.New(operatorData) testNetworkConfig := networkconfig.TestNetwork - keyManager, err := ekm.NewETHKeyManagerSigner(logger, db, testNetworkConfig, true, "") + keyManager, err := ekm.NewETHKeyManagerSigner(logger, db, testNetworkConfig, "") if err != nil { return nil, nil, nil, nil, err } diff --git a/eth/eventhandler/event_handler_test.go b/eth/eventhandler/event_handler_test.go index f487afd140..5ab3071778 100644 --- a/eth/eventhandler/event_handler_test.go +++ b/eth/eventhandler/event_handler_test.go @@ -1290,7 +1290,7 @@ func setupEventHandler(t *testing.T, ctx context.Context, logger *zap.Logger, ne } } - keyManager, err := ekm.NewETHKeyManagerSigner(logger, db, *network, true, "") + keyManager, err := ekm.NewETHKeyManagerSigner(logger, db, *network, "") if err != nil { return nil, nil, err } diff --git a/eth/eventsyncer/event_syncer_test.go b/eth/eventsyncer/event_syncer_test.go index 81c99c6359..8745f71f8b 100644 --- a/eth/eventsyncer/event_syncer_test.go +++ b/eth/eventsyncer/event_syncer_test.go @@ -148,7 +148,7 @@ func setupEventHandler(t *testing.T, ctx context.Context, logger *zap.Logger) *e operatorDataStore := operatordatastore.New(operatorData) testNetworkConfig := networkconfig.TestNetwork - keyManager, err := ekm.NewETHKeyManagerSigner(logger, db, testNetworkConfig, true, "") + keyManager, err := ekm.NewETHKeyManagerSigner(logger, db, testNetworkConfig, "") if err != nil { logger.Fatal("could not create new eth-key-manager signer", zap.Error(err)) } diff --git a/go.mod b/go.mod index 0b7e4bccc8..5cf4ff56e6 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/aquasecurity/table v1.8.0 - github.com/attestantio/go-eth2-client v0.19.11-0.20240129201044-9d799aaab2bd + github.com/attestantio/go-eth2-client v0.21.9 github.com/bloxapp/eth2-key-manager v1.4.0 github.com/bloxapp/ssv-spec v0.3.7 github.com/btcsuite/btcd/btcec/v2 v2.3.2 @@ -33,21 +33,22 @@ require ( github.com/patrickmn/go-cache v2.1.0+incompatible github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.16.0 - github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 + github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e github.com/prysmaticlabs/prysm/v4 v4.0.8 - github.com/rs/zerolog v1.29.1 + github.com/rs/zerolog v1.32.0 github.com/sourcegraph/conc v0.3.0 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 github.com/wealdtech/go-eth2-types/v2 v2.8.1 github.com/wealdtech/go-eth2-util v1.8.1 github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4 v1.1.3 + go.uber.org/mock v0.4.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.24.0 golang.org/x/exp v0.0.0-20230905200255-921286631fa9 golang.org/x/mod v0.12.0 golang.org/x/sync v0.3.0 - golang.org/x/text v0.14.0 + golang.org/x/text v0.15.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 gopkg.in/yaml.v3 v3.0.1 ) @@ -128,7 +129,7 @@ require ( github.com/jbenet/goprocess v0.1.4 // indirect github.com/joho/godotenv v1.4.0 // indirect github.com/klauspost/compress v1.16.5 // indirect - github.com/klauspost/cpuid/v2 v2.2.6 // indirect + github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/koron/go-ssdp v0.0.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect @@ -170,6 +171,7 @@ require ( github.com/opencontainers/runtime-spec v1.0.2 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect + github.com/pk910/dynamic-ssz v0.0.3 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/polydawn/refmt v0.89.0 // indirect github.com/prometheus/client_model v0.4.0 // indirect @@ -208,15 +210,16 @@ require ( go.uber.org/atomic v1.11.0 // indirect go.uber.org/dig v1.17.0 // indirect go.uber.org/fx v1.19.2 // indirect - golang.org/x/crypto v0.18.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.16.0 // indirect - golang.org/x/term v0.16.0 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/net v0.21.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/term v0.20.0 // indirect golang.org/x/time v0.3.0 // indirect golang.org/x/tools v0.13.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect gonum.org/v1/gonum v0.11.0 // indirect google.golang.org/protobuf v1.30.0 // indirect + gopkg.in/Knetic/govaluate.v3 v3.0.0 // indirect gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect lukechampine.com/blake3 v1.2.1 // indirect @@ -227,5 +230,3 @@ require ( replace github.com/google/flatbuffers => github.com/google/flatbuffers v1.11.0 replace github.com/dgraph-io/ristretto => github.com/dgraph-io/ristretto v0.1.1-0.20211108053508-297c39e6640f - -replace github.com/attestantio/go-eth2-client => github.com/ssvlabs/go-eth2-client v0.0.0-20240702122821-2c345f4fc90f diff --git a/go.sum b/go.sum index 9f22be2d8c..f87cacb8d2 100644 --- a/go.sum +++ b/go.sum @@ -43,6 +43,8 @@ github.com/aristanetworks/goarista v0.0.0-20200805130819-fd197cf57d96 h1:XJH0YfV github.com/aristanetworks/goarista v0.0.0-20200805130819-fd197cf57d96/go.mod h1:QZe5Yh80Hp1b6JxQdpfSEEe8X7hTyTEZSosSrFf/oJE= github.com/aristanetworks/splunk-hec-go v0.3.3/go.mod h1:1VHO9r17b0K7WmOlLb9nTk/2YanvOEnLMUgsFrxBROc= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/attestantio/go-eth2-client v0.21.9 h1:NX5GmbAyx2ZtKEsKk6JsxPcaGR1E0vugMEb4kVsY0XU= +github.com/attestantio/go-eth2-client v0.21.9/go.mod h1:d7ZPNrMX8jLfIgML5u7QZxFo2AukLM+5m08iMaLdqb8= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/bazelbuild/rules_go v0.23.2 h1:Wxu7JjqnF78cKZbsBsARLSXx/jlGaSLCnUV3mTlyHvM= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -422,8 +424,8 @@ github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/d github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= -github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= +github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/klauspost/reedsolomon v1.9.3/go.mod h1:CwCi+NUr9pqSVktrkN+Ondf06rkhYZ/pcNv7fu+8Un4= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/koron/go-ssdp v0.0.4 h1:1IDwrghSKYM7yLf7XCzbByg2sJ/JcNOZRXS2jczTwz0= @@ -487,7 +489,6 @@ github.com/mattn/go-colorable v0.0.10-0.20170816031813-ad5389df28cd/go.mod h1:9v github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.2/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= @@ -497,6 +498,7 @@ github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2y github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= @@ -621,6 +623,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= +github.com/pk910/dynamic-ssz v0.0.3 h1:fCWzFowq9P6SYCc7NtJMkZcIHk+r5hSVD+32zVi6Aio= +github.com/pk910/dynamic-ssz v0.0.3/go.mod h1:b6CrLaB2X7pYA+OSEEbkgXDEcRnjLOZIxZTsMuO/Y9c= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -655,8 +659,8 @@ github.com/prometheus/procfs v0.0.10/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+G github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/prysmaticlabs/fastssz v0.0.0-20220628121656-93dfe28febab h1:Y3PcvUrnneMWLuypZpwPz8P70/DQsz6KgV9JveKpyZs= -github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 h1:0tVE4tdWQK9ZpYygoV7+vS6QkDvQVySboMVEIxBJmXw= -github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7/go.mod h1:wmuf/mdK4VMD+jA9ThwcUKjg3a2XWM9cVfFYjDyY4j4= +github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e h1:ATgOe+abbzfx9kCPeXIW4fiWyDdxlwHw07j8UGhdTd4= +github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e/go.mod h1:wmuf/mdK4VMD+jA9ThwcUKjg3a2XWM9cVfFYjDyY4j4= github.com/prysmaticlabs/gohashtree v0.0.3-alpha h1:1EVinCWdb3Lorq7xn8DYQHf48nCcdAM3Vb18KsFlRWY= github.com/prysmaticlabs/prysm/v4 v4.0.8 h1:F6Rt5gpaxbW50aP63jMmSXE16JW42HaEzUT55L9laaM= github.com/prysmaticlabs/prysm/v4 v4.0.8/go.mod h1:m01QCZ2qwuTpUQRfYj5gMkvEP+j6mPcMydG8mNcnYDY= @@ -686,9 +690,9 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= +github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= @@ -754,8 +758,6 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.0.0/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/ssvlabs/go-eth2-client v0.0.0-20240702122821-2c345f4fc90f h1:ZaokUqygFE81zqNd8mQmdrX2B8AkhYmt0i6gs9RDXi0= -github.com/ssvlabs/go-eth2-client v0.0.0-20240702122821-2c345f4fc90f/go.mod h1:TTz7YF6w4z6ahvxKiHuGPn6DbQn7gH6HPuWm/DEQeGE= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -860,6 +862,8 @@ go.uber.org/fx v1.19.2 h1:SyFgYQFr1Wl0AYstE8vyYIzP4bFz2URrScjwC4cwUvY= go.uber.org/fx v1.19.2/go.mod h1:43G1VcqSzbIv77y00p1DRAsyZS8WdzuYdhZXmEUkMyQ= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -889,8 +893,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= @@ -942,8 +946,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/oauth2 v0.0.0-20170912212905-13449ad91cb2/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1013,13 +1017,14 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= -golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -1027,8 +1032,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20170424234030-8be79e1e0910/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1119,6 +1124,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/Knetic/govaluate.v3 v3.0.0 h1:18mUyIt4ZlRlFZAAfVetz4/rzlJs9yhN+U02F4u1AOc= +gopkg.in/Knetic/govaluate.v3 v3.0.0/go.mod h1:csKLBORsPbafmSCGTEh3U7Ozmsuq8ZSIlKk1bcqph0E= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610= gopkg.in/cenkalti/backoff.v1 v1.1.0 h1:Arh75ttbsvlpVA7WtVpH4u9h6Zl46xuptxqLxPiSo4Y= diff --git a/logging/fields/fields.go b/logging/fields/fields.go index bde9d90618..7189e74721 100644 --- a/logging/fields/fields.go +++ b/logging/fields/fields.go @@ -38,7 +38,6 @@ const ( FieldBlockHash = "block_hash" FieldBlockVersion = "block_version" FieldBlockCacheMetrics = "block_cache_metrics_field" - FieldBuilderProposals = "builder_proposals" FieldClusterIndex = "cluster_index" FieldConfig = "config" FieldConnectionID = "connection_id" @@ -317,10 +316,6 @@ func FeeRecipient(pubKey []byte) zap.Field { return zap.Stringer(FieldFeeRecipient, stringer.HexStringer{Val: pubKey}) } -func BuilderProposals(v bool) zap.Field { - return zap.Bool(FieldBuilderProposals, v) -} - func FormatDutyID(epoch phase0.Epoch, duty *spectypes.Duty) string { return fmt.Sprintf("%v-e%v-s%v-v%v", duty.Type.String(), epoch, duty.Slot, duty.ValidatorIndex) } diff --git a/operator/duties/scheduler.go b/operator/duties/scheduler.go index f1987b501a..7191f424c9 100644 --- a/operator/duties/scheduler.go +++ b/operator/duties/scheduler.go @@ -86,7 +86,6 @@ type SchedulerOptions struct { IndicesChg chan struct{} ValidatorExitCh <-chan ExitDescriptor SlotTickerProvider slotticker.Provider - BuilderProposals bool DutyStore *dutystore.Store } @@ -97,7 +96,6 @@ type Scheduler struct { validatorController ValidatorController slotTickerProvider slotticker.Provider executeDuty ExecuteDutyFunc - builderProposals bool handlers []dutyHandler blockPropagateDelay time.Duration @@ -127,7 +125,6 @@ func NewScheduler(opts *SchedulerOptions) *Scheduler { slotTickerProvider: opts.SlotTickerProvider, executeDuty: opts.ExecuteDuty, validatorController: opts.ValidatorController, - builderProposals: opts.BuilderProposals, indicesChg: opts.IndicesChg, blockPropagateDelay: blockPropagationDelay, @@ -136,15 +133,13 @@ func NewScheduler(opts *SchedulerOptions) *Scheduler { NewProposerHandler(dutyStore.Proposer), NewSyncCommitteeHandler(dutyStore.SyncCommittee), NewVoluntaryExitHandler(opts.ValidatorExitCh), + NewValidatorRegistrationHandler(), }, ticker: opts.SlotTickerProvider(), reorg: make(chan ReorgEvent), waitCond: sync.NewCond(&sync.Mutex{}), } - if s.builderProposals { - s.handlers = append(s.handlers, NewValidatorRegistrationHandler()) - } return s } diff --git a/operator/duties/scheduler_test.go b/operator/duties/scheduler_test.go index 7d99205504..333ab84866 100644 --- a/operator/duties/scheduler_test.go +++ b/operator/duties/scheduler_test.go @@ -108,7 +108,6 @@ func setupSchedulerAndMocks(t *testing.T, handler dutyHandler, currentSlot *Slot mockSlotService.Subscribe(ticker.Subscribe()) return ticker }, - BuilderProposals: false, } s := NewScheduler(opts) @@ -267,7 +266,6 @@ func TestScheduler_Run(t *testing.T) { BeaconNode: mockBeaconNode, Network: networkconfig.TestNetwork, ValidatorController: mockValidatorController, - BuilderProposals: false, SlotTickerProvider: func() slotticker.SlotTicker { return mockTicker }, @@ -320,8 +318,6 @@ func TestScheduler_Regression_IndicesChangeStuck(t *testing.T) { return mockTicker }, IndicesChg: make(chan struct{}), - - BuilderProposals: true, } s := NewScheduler(opts) diff --git a/operator/node.go b/operator/node.go index 16f965c413..d559220d14 100644 --- a/operator/node.go +++ b/operator/node.go @@ -105,7 +105,6 @@ func New(logger *zap.Logger, opts Options, slotTickerProvider slotticker.Provide IndicesChg: opts.ValidatorController.IndicesChangeChan(), ValidatorExitCh: opts.ValidatorController.ValidatorExitChan(), ExecuteDuty: opts.ValidatorController.ExecuteDuty, - BuilderProposals: opts.ValidatorOptions.BuilderProposals, DutyStore: opts.DutyStore, SlotTickerProvider: slotTickerProvider, }), diff --git a/operator/validator/controller.go b/operator/validator/controller.go index c83ce3df8b..154dd62652 100644 --- a/operator/validator/controller.go +++ b/operator/validator/controller.go @@ -68,7 +68,6 @@ type ControllerOptions struct { Beacon beaconprotocol.BeaconNode FullNode bool `yaml:"FullNode" env:"FULLNODE" env-default:"false" env-description:"Save decided history rather than just highest messages"` Exporter bool `yaml:"Exporter" env:"EXPORTER" env-default:"false" env-description:""` - BuilderProposals bool `yaml:"BuilderProposals" env:"BUILDER_PROPOSALS" env-default:"false" env-description:"Use external builders to produce blocks"` KeyManager spectypes.KeyManager OperatorDataStore operatordatastore.OperatorDataStore RegistryStorage nodestorage.Storage @@ -205,7 +204,6 @@ func NewController(logger *zap.Logger, options ControllerOptions) Controller { NewDecidedHandler: options.NewDecidedHandler, FullNode: options.FullNode, Exporter: options.Exporter, - BuilderProposals: options.BuilderProposals, GasLimit: options.GasLimit, MessageValidator: options.MessageValidator, Metrics: options.Metrics, @@ -940,7 +938,6 @@ func SetupRunners(ctx context.Context, logger *zap.Logger, options validator.Opt proposedValueCheck := specssv.ProposerValueCheckF(options.Signer, options.BeaconNetwork.GetBeaconNetwork(), options.SSVShare.Share.ValidatorPubKey, options.SSVShare.BeaconMetadata.Index, options.SSVShare.SharePubKey) qbftCtrl := buildController(spectypes.BNRoleProposer, proposedValueCheck) runners[role] = runner.NewProposerRunner(options.BeaconNetwork.GetBeaconNetwork(), &options.SSVShare.Share, qbftCtrl, options.Beacon, options.Network, options.Signer, proposedValueCheck, 0) - runners[role].(*runner.ProposerRunner).ProducesBlindedBlocks = options.BuilderProposals // apply blinded block flag case spectypes.BNRoleAggregator: aggregatorValueCheckF := specssv.AggregatorValueCheckF(options.Signer, options.BeaconNetwork.GetBeaconNetwork(), options.SSVShare.Share.ValidatorPubKey, options.SSVShare.BeaconMetadata.Index) qbftCtrl := buildController(spectypes.BNRoleAggregator, aggregatorValueCheckF) diff --git a/operator/validator/controller_test.go b/operator/validator/controller_test.go index e8c33e912f..b0291d562e 100644 --- a/operator/validator/controller_test.go +++ b/operator/validator/controller_test.go @@ -1193,7 +1193,7 @@ func setupCommonTestComponents(t *testing.T) (*gomock.Controller, *zap.Logger, * db, err := getBaseStorage(logger) require.NoError(t, err) - km, err := ekm.NewETHKeyManagerSigner(logger, db, networkconfig.TestNetwork, true, "") + km, err := ekm.NewETHKeyManagerSigner(logger, db, networkconfig.TestNetwork, "") require.NoError(t, err) return ctrl, logger, sharesStorage, network, km, recipientStorage, bc } diff --git a/protocol/v2/ssv/runner/proposer.go b/protocol/v2/ssv/runner/proposer.go index f98210d3dd..33b762ef12 100644 --- a/protocol/v2/ssv/runner/proposer.go +++ b/protocol/v2/ssv/runner/proposer.go @@ -424,13 +424,13 @@ func summarizeBlock(block any) (summary blockSummary, err error) { return summary, fmt.Errorf("block is nil") } switch b := block.(type) { - case *api.VersionedV3Proposal: - if b.ExecutionPayloadBlinded { + case *api.VersionedProposal: + if b.Blinded { switch b.Version { case spec.DataVersionCapella: - return summarizeBlock(b.BlindedCapella) + return summarizeBlock(b.CapellaBlinded) case spec.DataVersionDeneb: - return summarizeBlock(b.BlindedDeneb) + return summarizeBlock(b.DenebBlinded) default: return summary, fmt.Errorf("unsupported blinded block version %d", b.Version) } @@ -447,6 +447,16 @@ func summarizeBlock(block any) (summary blockSummary, err error) { return summary, fmt.Errorf("unsupported block version %d", b.Version) } + case *api.VersionedBlindedProposal: + switch b.Version { + case spec.DataVersionCapella: + return summarizeBlock(b.Capella) + case spec.DataVersionDeneb: + return summarizeBlock(b.Deneb) + default: + return summary, fmt.Errorf("unsupported blinded block version %d", b.Version) + } + case *capella.BeaconBlock: if b == nil || b.Body == nil || b.Body.ExecutionPayload == nil { return summary, fmt.Errorf("block, body or execution payload is nil") diff --git a/protocol/v2/ssv/spectest/ssv_mapping_test.go b/protocol/v2/ssv/spectest/ssv_mapping_test.go index 0f8cb876b6..6165f442a7 100644 --- a/protocol/v2/ssv/spectest/ssv_mapping_test.go +++ b/protocol/v2/ssv/spectest/ssv_mapping_test.go @@ -2,6 +2,7 @@ package spectest import ( "encoding/json" + "fmt" "os" "reflect" "strings" @@ -44,6 +45,11 @@ func TestSSVMapping(t *testing.T) { for name, test := range untypedTests { name, test := name, test + + //if strings.Split(name, "_")[1] != "post consensus too many roots" { + // continue + //} + r := prepareTest(t, logger, name, test) if r != nil { t.Run(r.name, func(t *testing.T) { @@ -63,6 +69,8 @@ func prepareTest(t *testing.T, logger *zap.Logger, name string, test interface{} testName := strings.Split(name, "_")[1] testType := strings.Split(name, "_")[0] + fmt.Println(testType, testName) + switch testType { case reflect.TypeOf(&tests.MsgProcessingSpecTest{}).String(): byts, err := json.Marshal(test) diff --git a/protocol/v2/ssv/testing/runner.go b/protocol/v2/ssv/testing/runner.go index 7689d10073..0b15290031 100644 --- a/protocol/v2/ssv/testing/runner.go +++ b/protocol/v2/ssv/testing/runner.go @@ -26,17 +26,6 @@ var ProposerRunner = func(logger *zap.Logger, keySet *spectestingutils.TestKeySe return baseRunner(logger, spectypes.BNRoleProposer, specssv.ProposerValueCheckF(spectestingutils.NewTestingKeyManager(), spectypes.BeaconTestNetwork, spectestingutils.TestingValidatorPubKey[:], spectestingutils.TestingValidatorIndex, nil), keySet) } -var ProposerBlindedBlockRunner = func(logger *zap.Logger, keySet *spectestingutils.TestKeySet) runner.Runner { - ret := baseRunner( - logger, - spectypes.BNRoleProposer, - specssv.ProposerValueCheckF(spectestingutils.NewTestingKeyManager(), spectypes.BeaconTestNetwork, spectestingutils.TestingValidatorPubKey[:], spectestingutils.TestingValidatorIndex, nil), - keySet, - ) - ret.(*runner.ProposerRunner).ProducesBlindedBlocks = true - return ret -} - var AggregatorRunner = func(logger *zap.Logger, keySet *spectestingutils.TestKeySet) runner.Runner { return baseRunner(logger, spectypes.BNRoleAggregator, specssv.AggregatorValueCheckF(spectestingutils.NewTestingKeyManager(), spectypes.BeaconTestNetwork, spectestingutils.TestingValidatorPubKey[:], spectestingutils.TestingValidatorIndex), keySet) } diff --git a/protocol/v2/ssv/validator/opts.go b/protocol/v2/ssv/validator/opts.go index 8b32cfe0fa..c8937c51bb 100644 --- a/protocol/v2/ssv/validator/opts.go +++ b/protocol/v2/ssv/validator/opts.go @@ -29,7 +29,6 @@ type Options struct { NewDecidedHandler qbftctrl.NewDecidedHandler FullNode bool Exporter bool - BuilderProposals bool QueueSize int GasLimit uint64 MessageValidator validation.MessageValidator