diff --git a/beacon-chain/rpc/apimiddleware/BUILD.bazel b/beacon-chain/rpc/apimiddleware/BUILD.bazel index 3a62eec0e3..d9710bb1ff 100644 --- a/beacon-chain/rpc/apimiddleware/BUILD.bazel +++ b/beacon-chain/rpc/apimiddleware/BUILD.bazel @@ -16,7 +16,7 @@ go_library( "//api/gateway/apimiddleware:go_default_library", "//api/grpc:go_default_library", "//beacon-chain/rpc/eth/events:go_default_library", - "//beacon-chain/rpc/eth/helpers:go_default_library", + "//beacon-chain/rpc/eth/shared:go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", "//proto/eth/v2:go_default_library", diff --git a/beacon-chain/rpc/apimiddleware/custom_hooks.go b/beacon-chain/rpc/apimiddleware/custom_hooks.go index 1a1d6a14a4..ae9f8e9307 100644 --- a/beacon-chain/rpc/apimiddleware/custom_hooks.go +++ b/beacon-chain/rpc/apimiddleware/custom_hooks.go @@ -152,28 +152,6 @@ func wrapBeaconCommitteeSubscriptionsArray( return true, nil } -// https://ethereum.github.io/beacon-APIs/#/Validator/prepareSyncCommitteeSubnets expects posting a top-level array. -// We make it more proto-friendly by wrapping it in a struct with a 'data' field. -func wrapSyncCommitteeSubscriptionsArray( - endpoint *apimiddleware.Endpoint, - _ http.ResponseWriter, - req *http.Request, -) (apimiddleware.RunDefault, apimiddleware.ErrorJson) { - if _, ok := endpoint.PostRequest.(*SubmitSyncCommitteeSubscriptionRequestJson); ok { - data := make([]*SyncCommitteeSubscriptionJson, 0) - if err := json.NewDecoder(req.Body).Decode(&data); err != nil { - return false, apimiddleware.InternalServerErrorWithMessage(err, "could not decode body") - } - j := &SubmitSyncCommitteeSubscriptionRequestJson{Data: data} - b, err := json.Marshal(j) - if err != nil { - return false, apimiddleware.InternalServerErrorWithMessage(err, "could not marshal wrapped body") - } - req.Body = io.NopCloser(bytes.NewReader(b)) - } - return true, nil -} - // https://ethereum.github.io/beacon-APIs/#/Beacon/submitPoolSyncCommitteeSignatures expects posting a top-level array. // We make it more proto-friendly by wrapping it in a struct with a 'data' field. func wrapSyncCommitteeSignaturesArray( diff --git a/beacon-chain/rpc/apimiddleware/custom_hooks_test.go b/beacon-chain/rpc/apimiddleware/custom_hooks_test.go index d0b8fb76c6..9786635740 100644 --- a/beacon-chain/rpc/apimiddleware/custom_hooks_test.go +++ b/beacon-chain/rpc/apimiddleware/custom_hooks_test.go @@ -190,61 +190,6 @@ func TestWrapBeaconCommitteeSubscriptionsArray(t *testing.T) { }) } -func TestWrapSyncCommitteeSubscriptionsArray(t *testing.T) { - t.Run("ok", func(t *testing.T) { - endpoint := &apimiddleware.Endpoint{ - PostRequest: &SubmitSyncCommitteeSubscriptionRequestJson{}, - } - unwrappedSubs := []*SyncCommitteeSubscriptionJson{ - { - ValidatorIndex: "1", - SyncCommitteeIndices: []string{"1", "2"}, - UntilEpoch: "1", - }, - { - ValidatorIndex: "2", - SyncCommitteeIndices: []string{"3", "4"}, - UntilEpoch: "2", - }, - } - unwrappedSubsJson, err := json.Marshal(unwrappedSubs) - require.NoError(t, err) - - var body bytes.Buffer - _, err = body.Write(unwrappedSubsJson) - require.NoError(t, err) - request := httptest.NewRequest("POST", "http://foo.example", &body) - - runDefault, errJson := wrapSyncCommitteeSubscriptionsArray(endpoint, nil, request) - require.Equal(t, true, errJson == nil) - assert.Equal(t, apimiddleware.RunDefault(true), runDefault) - wrappedSubs := &SubmitSyncCommitteeSubscriptionRequestJson{} - require.NoError(t, json.NewDecoder(request.Body).Decode(wrappedSubs)) - require.Equal(t, 2, len(wrappedSubs.Data), "wrong number of wrapped items") - assert.Equal(t, "1", wrappedSubs.Data[0].ValidatorIndex) - require.Equal(t, 2, len(wrappedSubs.Data[0].SyncCommitteeIndices), "wrong number of committee indices") - assert.Equal(t, "1", wrappedSubs.Data[0].SyncCommitteeIndices[0]) - assert.Equal(t, "2", wrappedSubs.Data[0].SyncCommitteeIndices[1]) - assert.Equal(t, "1", wrappedSubs.Data[0].UntilEpoch) - }) - - t.Run("invalid_body", func(t *testing.T) { - endpoint := &apimiddleware.Endpoint{ - PostRequest: &SubmitSyncCommitteeSubscriptionRequestJson{}, - } - var body bytes.Buffer - _, err := body.Write([]byte("invalid")) - require.NoError(t, err) - request := httptest.NewRequest("POST", "http://foo.example", &body) - - runDefault, errJson := wrapSyncCommitteeSubscriptionsArray(endpoint, nil, request) - require.Equal(t, false, errJson == nil) - assert.Equal(t, apimiddleware.RunDefault(false), runDefault) - assert.Equal(t, true, strings.Contains(errJson.Msg(), "could not decode body")) - assert.Equal(t, http.StatusInternalServerError, errJson.StatusCode()) - }) -} - func TestWrapSyncCommitteeSignaturesArray(t *testing.T) { t.Run("ok", func(t *testing.T) { endpoint := &apimiddleware.Endpoint{ diff --git a/beacon-chain/rpc/apimiddleware/endpoint_factory.go b/beacon-chain/rpc/apimiddleware/endpoint_factory.go index de98ed33bd..44af3ba3e1 100644 --- a/beacon-chain/rpc/apimiddleware/endpoint_factory.go +++ b/beacon-chain/rpc/apimiddleware/endpoint_factory.go @@ -67,7 +67,6 @@ func (_ *BeaconEndpointFactory) Paths() []string { "/eth/v1/validator/blinded_blocks/{slot}", "/eth/v1/validator/attestation_data", "/eth/v1/validator/beacon_committee_subscriptions", - "/eth/v1/validator/sync_committee_subscriptions", "/eth/v1/validator/sync_committee_contribution", "/eth/v1/validator/prepare_beacon_proposer", "/eth/v1/validator/register_validator", @@ -266,12 +265,6 @@ func (_ *BeaconEndpointFactory) Create(path string) (*apimiddleware.Endpoint, er endpoint.Hooks = apimiddleware.HookCollection{ OnPreDeserializeRequestBodyIntoContainer: wrapBeaconCommitteeSubscriptionsArray, } - case "/eth/v1/validator/sync_committee_subscriptions": - endpoint.PostRequest = &SubmitSyncCommitteeSubscriptionRequestJson{} - endpoint.Err = &NodeSyncDetailsErrorJson{} - endpoint.Hooks = apimiddleware.HookCollection{ - OnPreDeserializeRequestBodyIntoContainer: wrapSyncCommitteeSubscriptionsArray, - } case "/eth/v1/validator/sync_committee_contribution": endpoint.GetResponse = &ProduceSyncCommitteeContributionResponseJson{} endpoint.RequestQueryParams = []apimiddleware.QueryParam{{Name: "slot"}, {Name: "subcommittee_index"}, {Name: "beacon_block_root", Hex: true}} diff --git a/beacon-chain/rpc/apimiddleware/structs.go b/beacon-chain/rpc/apimiddleware/structs.go index 41592d2b45..2c529586ba 100644 --- a/beacon-chain/rpc/apimiddleware/structs.go +++ b/beacon-chain/rpc/apimiddleware/structs.go @@ -4,7 +4,7 @@ import ( "strings" "github.com/prysmaticlabs/prysm/v4/api/gateway/apimiddleware" - "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/helpers" + "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared" ethpbv2 "github.com/prysmaticlabs/prysm/v4/proto/eth/v2" ) @@ -199,7 +199,7 @@ type VersionResponseJson struct { } type SyncingResponseJson struct { - Data *helpers.SyncDetailsJson `json:"data"` + Data *shared.SyncDetails `json:"data"` } type BeaconStateResponseJson struct { @@ -288,16 +288,6 @@ type BeaconCommitteeSubscribeJson struct { IsAggregator bool `json:"is_aggregator"` } -type SubmitSyncCommitteeSubscriptionRequestJson struct { - Data []*SyncCommitteeSubscriptionJson `json:"data"` -} - -type SyncCommitteeSubscriptionJson struct { - ValidatorIndex string `json:"validator_index"` - SyncCommitteeIndices []string `json:"sync_committee_indices"` - UntilEpoch string `json:"until_epoch"` -} - type ProduceSyncCommitteeContributionResponseJson struct { Data *SyncCommitteeContributionJson `json:"data"` } @@ -1211,7 +1201,7 @@ type SingleIndexedVerificationFailureJson struct { type NodeSyncDetailsErrorJson struct { apimiddleware.DefaultErrorJson - SyncDetails helpers.SyncDetailsJson `json:"sync_details"` + SyncDetails shared.SyncDetails `json:"sync_details"` } type EventErrorJson struct { diff --git a/beacon-chain/rpc/eth/beacon/BUILD.bazel b/beacon-chain/rpc/eth/beacon/BUILD.bazel index 668eba714c..0b45bb98b9 100644 --- a/beacon-chain/rpc/eth/beacon/BUILD.bazel +++ b/beacon-chain/rpc/eth/beacon/BUILD.bazel @@ -37,6 +37,7 @@ go_library( "//beacon-chain/operations/voluntaryexits:go_default_library", "//beacon-chain/p2p:go_default_library", "//beacon-chain/rpc/eth/helpers:go_default_library", + "//beacon-chain/rpc/eth/shared:go_default_library", "//beacon-chain/rpc/lookup:go_default_library", "//beacon-chain/rpc/prysm/v1alpha1/validator:go_default_library", "//beacon-chain/state:go_default_library", diff --git a/beacon-chain/rpc/eth/beacon/handlers.go b/beacon-chain/rpc/eth/beacon/handlers.go index 8e5ee6f313..f171c8e2db 100644 --- a/beacon-chain/rpc/eth/beacon/handlers.go +++ b/beacon-chain/rpc/eth/beacon/handlers.go @@ -11,7 +11,7 @@ import ( "github.com/go-playground/validator/v10" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v4/beacon-chain/core/transition" - "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/helpers" + "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared" "github.com/prysmaticlabs/prysm/v4/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v4/consensus-types/interfaces" http2 "github.com/prysmaticlabs/prysm/v4/network/http" @@ -38,7 +38,7 @@ const ( // a `SignedBeaconBlock`. The broadcast behaviour may be adjusted via the `broadcast_validation` // query parameter. func (bs *Server) PublishBlindedBlockV2(w http.ResponseWriter, r *http.Request) { - if ok := bs.checkSync(r.Context(), w); !ok { + if shared.IsSyncing(r.Context(), w, bs.SyncChecker, bs.HeadFetcher, bs.TimeFetcher, bs.OptimisticModeFetcher) { return } isSSZ, err := http2.SszRequested(r) @@ -302,7 +302,7 @@ func publishBlindedBlockV2(bs *Server, w http.ResponseWriter, r *http.Request) { // successfully broadcast but failed integration. The broadcast behaviour may be adjusted via the // `broadcast_validation` query parameter. func (bs *Server) PublishBlockV2(w http.ResponseWriter, r *http.Request) { - if ok := bs.checkSync(r.Context(), w); !ok { + if shared.IsSyncing(r.Context(), w, bs.SyncChecker, bs.HeadFetcher, bs.TimeFetcher, bs.OptimisticModeFetcher) { return } isSSZ, err := http2.SszRequested(r) @@ -631,29 +631,3 @@ func (bs *Server) validateEquivocation(blk interfaces.ReadOnlyBeaconBlock) error } return nil } - -func (bs *Server) checkSync(ctx context.Context, w http.ResponseWriter) bool { - isSyncing, syncDetails, err := helpers.ValidateSyncHTTP(ctx, bs.SyncChecker, bs.HeadFetcher, bs.TimeFetcher, bs.OptimisticModeFetcher) - if err != nil { - errJson := &http2.DefaultErrorJson{ - Message: "Could not check if node is syncing: " + err.Error(), - Code: http.StatusInternalServerError, - } - http2.WriteError(w, errJson) - return false - } - if isSyncing { - msg := "Beacon node is currently syncing and not serving request on that endpoint" - details, err := json.Marshal(syncDetails) - if err == nil { - msg += " Details: " + string(details) - } - errJson := &http2.DefaultErrorJson{ - Message: msg, - Code: http.StatusServiceUnavailable, - } - http2.WriteError(w, errJson) - return false - } - return true -} diff --git a/beacon-chain/rpc/eth/helpers/BUILD.bazel b/beacon-chain/rpc/eth/helpers/BUILD.bazel index b72a4950bc..76231f6c4f 100644 --- a/beacon-chain/rpc/eth/helpers/BUILD.bazel +++ b/beacon-chain/rpc/eth/helpers/BUILD.bazel @@ -13,6 +13,7 @@ go_library( "//api/grpc:go_default_library", "//beacon-chain/blockchain:go_default_library", "//beacon-chain/db:go_default_library", + "//beacon-chain/rpc/eth/shared:go_default_library", "//beacon-chain/rpc/lookup:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/stategen:go_default_library", diff --git a/beacon-chain/rpc/eth/helpers/sync.go b/beacon-chain/rpc/eth/helpers/sync.go index ca975d9277..a54405d321 100644 --- a/beacon-chain/rpc/eth/helpers/sync.go +++ b/beacon-chain/rpc/eth/helpers/sync.go @@ -10,6 +10,7 @@ import ( "github.com/prysmaticlabs/prysm/v4/api/grpc" "github.com/prysmaticlabs/prysm/v4/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v4/beacon-chain/db" + "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared" "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/lookup" "github.com/prysmaticlabs/prysm/v4/beacon-chain/sync" "github.com/prysmaticlabs/prysm/v4/config/params" @@ -38,8 +39,8 @@ func ValidateSyncGRPC( return status.Errorf(codes.Internal, "Could not check optimistic status: %v", err) } - syncDetailsContainer := &SyncDetailsContainer{ - Data: &SyncDetailsJson{ + syncDetailsContainer := &shared.SyncDetailsContainer{ + Data: &shared.SyncDetails{ HeadSlot: strconv.FormatUint(uint64(headSlot), 10), SyncDistance: strconv.FormatUint(uint64(timeFetcher.CurrentSlot()-headSlot), 10), IsSyncing: true, @@ -58,35 +59,6 @@ func ValidateSyncGRPC( return status.Error(codes.Unavailable, "Syncing to latest head, not ready to respond") } -// ValidateSyncHTTP checks whether the node is currently syncing and returns sync information. -// It returns information whether the node is currently syncing along with sync details. -func ValidateSyncHTTP( - ctx context.Context, - syncChecker sync.Checker, - headFetcher blockchain.HeadFetcher, - timeFetcher blockchain.TimeFetcher, - optimisticModeFetcher blockchain.OptimisticModeFetcher, -) (bool, *SyncDetailsContainer, error) { - if !syncChecker.Syncing() { - return false, nil, nil - } - - headSlot := headFetcher.HeadSlot() - isOptimistic, err := optimisticModeFetcher.IsOptimistic(ctx) - if err != nil { - return true, nil, errors.Wrap(err, "could not check optimistic status") - } - syncDetails := &SyncDetailsContainer{ - Data: &SyncDetailsJson{ - HeadSlot: strconv.FormatUint(uint64(headSlot), 10), - SyncDistance: strconv.FormatUint(uint64(timeFetcher.CurrentSlot()-headSlot), 10), - IsSyncing: true, - IsOptimistic: isOptimistic, - }, - } - return true, syncDetails, nil -} - // IsOptimistic checks whether the beacon state's block is optimistic. func IsOptimistic( ctx context.Context, @@ -216,17 +188,3 @@ func isStateRootOptimistic( // No block matching requested state root, return true. return true, nil } - -// SyncDetailsJson contains information about node sync status. -type SyncDetailsJson struct { - HeadSlot string `json:"head_slot"` - SyncDistance string `json:"sync_distance"` - IsSyncing bool `json:"is_syncing"` - IsOptimistic bool `json:"is_optimistic"` - ElOffline bool `json:"el_offline"` -} - -// SyncDetailsContainer is a wrapper for Data. -type SyncDetailsContainer struct { - Data *SyncDetailsJson `json:"data"` -} diff --git a/beacon-chain/rpc/eth/shared/BUILD.bazel b/beacon-chain/rpc/eth/shared/BUILD.bazel index 51c11f0fdb..eb02a88e09 100644 --- a/beacon-chain/rpc/eth/shared/BUILD.bazel +++ b/beacon-chain/rpc/eth/shared/BUILD.bazel @@ -10,7 +10,10 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared", visibility = ["//visibility:public"], deps = [ + "//beacon-chain/blockchain:go_default_library", + "//beacon-chain/sync:go_default_library", "//consensus-types/primitives:go_default_library", + "//consensus-types/validator:go_default_library", "//encoding/bytesutil:go_default_library", "//network/http:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/beacon-chain/rpc/eth/shared/request.go b/beacon-chain/rpc/eth/shared/request.go index 9526567a0e..c0193f6a2c 100644 --- a/beacon-chain/rpc/eth/shared/request.go +++ b/beacon-chain/rpc/eth/shared/request.go @@ -1,9 +1,13 @@ package shared import ( + "context" + "encoding/json" "net/http" "strconv" + "github.com/prysmaticlabs/prysm/v4/beacon-chain/blockchain" + "github.com/prysmaticlabs/prysm/v4/beacon-chain/sync" "github.com/prysmaticlabs/prysm/v4/encoding/bytesutil" http2 "github.com/prysmaticlabs/prysm/v4/network/http" ) @@ -48,3 +52,47 @@ func ValidateUint(w http.ResponseWriter, name string, s string) (uint64, bool) { } return v, true } + +// IsSyncing checks whether the beacon node is currently syncing and writes out the sync status. +func IsSyncing( + ctx context.Context, + w http.ResponseWriter, + syncChecker sync.Checker, + headFetcher blockchain.HeadFetcher, + timeFetcher blockchain.TimeFetcher, + optimisticModeFetcher blockchain.OptimisticModeFetcher, +) bool { + if !syncChecker.Syncing() { + return false + } + + headSlot := headFetcher.HeadSlot() + isOptimistic, err := optimisticModeFetcher.IsOptimistic(ctx) + if err != nil { + errJson := &http2.DefaultErrorJson{ + Message: "Could not check optimistic status: " + err.Error(), + Code: http.StatusInternalServerError, + } + http2.WriteError(w, errJson) + return true + } + syncDetails := &SyncDetailsContainer{ + Data: &SyncDetails{ + HeadSlot: strconv.FormatUint(uint64(headSlot), 10), + SyncDistance: strconv.FormatUint(uint64(timeFetcher.CurrentSlot()-headSlot), 10), + IsSyncing: true, + IsOptimistic: isOptimistic, + }, + } + + msg := "Beacon node is currently syncing and not serving request on that endpoint" + details, err := json.Marshal(syncDetails) + if err == nil { + msg += " Details: " + string(details) + } + errJson := &http2.DefaultErrorJson{ + Message: msg, + Code: http.StatusServiceUnavailable} + http2.WriteError(w, errJson) + return true +} diff --git a/beacon-chain/rpc/eth/shared/structs.go b/beacon-chain/rpc/eth/shared/structs.go index 08bf85fd4b..b53776448b 100644 --- a/beacon-chain/rpc/eth/shared/structs.go +++ b/beacon-chain/rpc/eth/shared/structs.go @@ -1,10 +1,12 @@ package shared import ( + "fmt" "strconv" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v4/consensus-types/validator" eth "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1" ) @@ -57,6 +59,12 @@ type AggregateAttestationAndProof struct { SelectionProof string `json:"selection_proof" validate:"required,hexadecimal"` } +type SyncCommitteeSubscription struct { + ValidatorIndex string `json:"validator_index" validate:"required,number,gte=0"` + SyncCommitteeIndices []string `json:"sync_committee_indices" validate:"required,dive,number,gte=0"` + UntilEpoch string `json:"until_epoch" validate:"required,number,gte=0"` +} + func (s *SignedContributionAndProof) ToConsensus() (*eth.SignedContributionAndProof, error) { msg, err := s.Message.ToConsensus() if err != nil { @@ -228,3 +236,41 @@ func (c *Checkpoint) ToConsensus() (*eth.Checkpoint, error) { Root: root, }, nil } + +func (s *SyncCommitteeSubscription) ToConsensus() (*validator.SyncCommitteeSubscription, error) { + index, err := strconv.ParseUint(s.ValidatorIndex, 10, 64) + if err != nil { + return nil, NewDecodeError(err, "ValidatorIndex") + } + scIndices := make([]uint64, len(s.SyncCommitteeIndices)) + for i, ix := range s.SyncCommitteeIndices { + scIndices[i], err = strconv.ParseUint(ix, 10, 64) + if err != nil { + return nil, NewDecodeError(err, fmt.Sprintf("SyncCommitteeIndices[%d]", i)) + } + } + epoch, err := strconv.ParseUint(s.UntilEpoch, 10, 64) + if err != nil { + return nil, NewDecodeError(err, "UntilEpoch") + } + + return &validator.SyncCommitteeSubscription{ + ValidatorIndex: primitives.ValidatorIndex(index), + SyncCommitteeIndices: scIndices, + UntilEpoch: primitives.Epoch(epoch), + }, nil +} + +// SyncDetails contains information about node sync status. +type SyncDetails struct { + HeadSlot string `json:"head_slot"` + SyncDistance string `json:"sync_distance"` + IsSyncing bool `json:"is_syncing"` + IsOptimistic bool `json:"is_optimistic"` + ElOffline bool `json:"el_offline"` +} + +// SyncDetailsContainer is a wrapper for Data. +type SyncDetailsContainer struct { + Data *SyncDetails `json:"data"` +} diff --git a/beacon-chain/rpc/eth/validator/BUILD.bazel b/beacon-chain/rpc/eth/validator/BUILD.bazel index 915cb4a498..fcefa14507 100644 --- a/beacon-chain/rpc/eth/validator/BUILD.bazel +++ b/beacon-chain/rpc/eth/validator/BUILD.bazel @@ -31,6 +31,7 @@ go_library( "//config/fieldparams:go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", + "//consensus-types/validator:go_default_library", "//encoding/bytesutil:go_default_library", "//network/http:go_default_library", "//proto/eth/v1:go_default_library", diff --git a/beacon-chain/rpc/eth/validator/handlers.go b/beacon-chain/rpc/eth/validator/handlers.go index d9fbbd8636..b67d65397f 100644 --- a/beacon-chain/rpc/eth/validator/handlers.go +++ b/beacon-chain/rpc/eth/validator/handlers.go @@ -3,20 +3,33 @@ package validator import ( "bytes" "encoding/json" + "fmt" "net/http" "strconv" + "time" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/go-playground/validator/v10" + "github.com/prysmaticlabs/prysm/v4/beacon-chain/cache" "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/core" + rpchelpers "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/helpers" "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared" + "github.com/prysmaticlabs/prysm/v4/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v4/config/params" "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives" + validator2 "github.com/prysmaticlabs/prysm/v4/consensus-types/validator" http2 "github.com/prysmaticlabs/prysm/v4/network/http" + ethpbv1 "github.com/prysmaticlabs/prysm/v4/proto/eth/v1" ethpbalpha "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v4/time/slots" + "go.opencensus.io/trace" ) // GetAggregateAttestation aggregates all attestations matching the given attestation data root and slot, returning the aggregated result. func (s *Server) GetAggregateAttestation(w http.ResponseWriter, r *http.Request) { + ctx, span := trace.StartSpan(r.Context(), "validator.GetAggregateAttestation") + defer span.End() + attDataRoot := r.URL.Query().Get("attestation_data_root") valid := shared.ValidateHex(w, "Attestation data root", attDataRoot) if !valid { @@ -28,7 +41,7 @@ func (s *Server) GetAggregateAttestation(w http.ResponseWriter, r *http.Request) return } - if err := s.AttestationsPool.AggregateUnaggregatedAttestations(r.Context()); err != nil { + if err := s.AttestationsPool.AggregateUnaggregatedAttestations(ctx); err != nil { http2.HandleError(w, "Could not aggregate unaggregated attestations: "+err.Error(), http.StatusBadRequest) return } @@ -82,17 +95,22 @@ func (s *Server) GetAggregateAttestation(w http.ResponseWriter, r *http.Request) // SubmitContributionAndProofs publishes multiple signed sync committee contribution and proofs. func (s *Server) SubmitContributionAndProofs(w http.ResponseWriter, r *http.Request) { + ctx, span := trace.StartSpan(r.Context(), "validator.SubmitContributionAndProofs") + defer span.End() + if r.Body == http.NoBody { http2.HandleError(w, "No data submitted", http.StatusBadRequest) return } - var req SubmitContributionAndProofsRequest if err := json.NewDecoder(r.Body).Decode(&req.Data); err != nil { http2.HandleError(w, "Could not decode request body: "+err.Error(), http.StatusBadRequest) return } - + if len(req.Data) == 0 { + http2.HandleError(w, "No data submitted", http.StatusBadRequest) + return + } validate := validator.New() if err := validate.Struct(req); err != nil { http2.HandleError(w, err.Error(), http.StatusBadRequest) @@ -105,7 +123,7 @@ func (s *Server) SubmitContributionAndProofs(w http.ResponseWriter, r *http.Requ http2.HandleError(w, "Could not convert request contribution to consensus contribution: "+err.Error(), http.StatusBadRequest) return } - rpcError := s.CoreService.SubmitSignedContributionAndProof(r.Context(), consensusItem) + rpcError := s.CoreService.SubmitSignedContributionAndProof(ctx, consensusItem) if rpcError != nil { http2.HandleError(w, rpcError.Err.Error(), core.ErrorReasonToHTTP(rpcError.Reason)) } @@ -114,17 +132,22 @@ func (s *Server) SubmitContributionAndProofs(w http.ResponseWriter, r *http.Requ // SubmitAggregateAndProofs verifies given aggregate and proofs and publishes them on appropriate gossipsub topic. func (s *Server) SubmitAggregateAndProofs(w http.ResponseWriter, r *http.Request) { + ctx, span := trace.StartSpan(r.Context(), "validator.SubmitAggregateAndProofs") + defer span.End() + if r.Body == http.NoBody { http2.HandleError(w, "No data submitted", http.StatusBadRequest) return } - var req SubmitAggregateAndProofsRequest if err := json.NewDecoder(r.Body).Decode(&req.Data); err != nil { http2.HandleError(w, "Could not decode request body: "+err.Error(), http.StatusBadRequest) return } - + if len(req.Data) == 0 { + http2.HandleError(w, "No data submitted", http.StatusBadRequest) + return + } validate := validator.New() if err := validate.Struct(req); err != nil { http2.HandleError(w, err.Error(), http.StatusBadRequest) @@ -139,7 +162,7 @@ func (s *Server) SubmitAggregateAndProofs(w http.ResponseWriter, r *http.Request return } rpcError := s.CoreService.SubmitSignedAggregateSelectionProof( - r.Context(), + ctx, ðpbalpha.SignedAggregateSubmitRequest{SignedAggregateAndProof: consensusItem}, ) if rpcError != nil { @@ -157,3 +180,120 @@ func (s *Server) SubmitAggregateAndProofs(w http.ResponseWriter, r *http.Request http2.HandleError(w, "Could not broadcast one or more signed aggregated attestations", http.StatusInternalServerError) } } + +// SubmitSyncCommitteeSubscription subscribe to a number of sync committee subnets. +// +// Subscribing to sync committee subnets is an action performed by VC to enable +// network participation, and only required if the VC has an active +// validator in an active sync committee. +func (s *Server) SubmitSyncCommitteeSubscription(w http.ResponseWriter, r *http.Request) { + ctx, span := trace.StartSpan(r.Context(), "validator.SubmitSyncCommitteeSubscription") + defer span.End() + + if shared.IsSyncing(ctx, w, s.SyncChecker, s.HeadFetcher, s.TimeFetcher, s.OptimisticModeFetcher) { + return + } + + if r.Body == http.NoBody { + http2.HandleError(w, "No data submitted", http.StatusBadRequest) + return + } + var req SubmitSyncCommitteeSubscriptionsRequest + if err := json.NewDecoder(r.Body).Decode(&req.Data); err != nil { + http2.HandleError(w, "Could not decode request body: "+err.Error(), http.StatusBadRequest) + return + } + if len(req.Data) == 0 { + http2.HandleError(w, "No data submitted", http.StatusBadRequest) + return + } + validate := validator.New() + if err := validate.Struct(req); err != nil { + http2.HandleError(w, err.Error(), http.StatusBadRequest) + return + } + + st, err := s.HeadFetcher.HeadStateReadOnly(ctx) + if err != nil { + http2.HandleError(w, "Could not get head state: "+err.Error(), http.StatusInternalServerError) + return + } + currEpoch := slots.ToEpoch(st.Slot()) + validators := make([]state.ReadOnlyValidator, len(req.Data)) + subscriptions := make([]*validator2.SyncCommitteeSubscription, len(req.Data)) + for i, item := range req.Data { + consensusItem, err := item.ToConsensus() + if err != nil { + http2.HandleError(w, "Could not convert request subscription to consensus subscription: "+err.Error(), http.StatusBadRequest) + return + } + subscriptions[i] = consensusItem + val, err := st.ValidatorAtIndexReadOnly(consensusItem.ValidatorIndex) + if err != nil { + http2.HandleError( + w, + fmt.Sprintf("Could not get validator at index %d: %s", consensusItem.ValidatorIndex, err.Error()), + http.StatusInternalServerError, + ) + return + } + valStatus, err := rpchelpers.ValidatorSubStatus(val, currEpoch) + if err != nil { + http2.HandleError( + w, + fmt.Sprintf("Could not get validator status at index %d: %s", consensusItem.ValidatorIndex, err.Error()), + http.StatusInternalServerError, + ) + return + } + if valStatus != ethpbv1.ValidatorStatus_ACTIVE_ONGOING && valStatus != ethpbv1.ValidatorStatus_ACTIVE_EXITING { + http2.HandleError( + w, + fmt.Sprintf("Validator at index %d is not active or exiting", consensusItem.ValidatorIndex), + http.StatusBadRequest, + ) + return + } + validators[i] = val + } + + startEpoch, err := slots.SyncCommitteePeriodStartEpoch(currEpoch) + if err != nil { + http2.HandleError(w, "Could not get sync committee period start epoch: "+err.Error(), http.StatusInternalServerError) + return + } + + for i, sub := range subscriptions { + if sub.UntilEpoch <= currEpoch { + http2.HandleError( + w, + fmt.Sprintf("Epoch for subscription at index %d is in the past. It must be at least %d", i, currEpoch+1), + http.StatusBadRequest, + ) + return + } + maxValidUntilEpoch := startEpoch + params.BeaconConfig().EpochsPerSyncCommitteePeriod*2 + if sub.UntilEpoch > maxValidUntilEpoch { + http2.HandleError( + w, + fmt.Sprintf("Epoch for subscription at index %d is too far in the future. It can be at most %d", i, maxValidUntilEpoch), + http.StatusBadRequest, + ) + return + } + } + + for i, sub := range subscriptions { + pubkey48 := validators[i].PublicKey() + // Handle overflow in the event current epoch is less than end epoch. + // This is an impossible condition, so it is a defensive check. + epochsToWatch, err := sub.UntilEpoch.SafeSub(uint64(startEpoch)) + if err != nil { + epochsToWatch = 0 + } + epochDuration := time.Duration(params.BeaconConfig().SlotsPerEpoch.Mul(params.BeaconConfig().SecondsPerSlot)) * time.Second + totalDuration := epochDuration * time.Duration(epochsToWatch) + + cache.SyncSubnetIDs.AddSyncCommitteeSubnets(pubkey48[:], startEpoch, sub.SyncCommitteeIndices, totalDuration) + } +} diff --git a/beacon-chain/rpc/eth/validator/handlers_test.go b/beacon-chain/rpc/eth/validator/handlers_test.go index 72b835ee8f..ecdc295951 100644 --- a/beacon-chain/rpc/eth/validator/handlers_test.go +++ b/beacon-chain/rpc/eth/validator/handlers_test.go @@ -2,7 +2,9 @@ package validator import ( "bytes" + "context" "encoding/json" + "fmt" "net/http" "net/http/httptest" "strings" @@ -10,17 +12,22 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" mockChain "github.com/prysmaticlabs/prysm/v4/beacon-chain/blockchain/testing" + "github.com/prysmaticlabs/prysm/v4/beacon-chain/cache" "github.com/prysmaticlabs/prysm/v4/beacon-chain/operations/attestations" "github.com/prysmaticlabs/prysm/v4/beacon-chain/operations/synccommittee" p2pmock "github.com/prysmaticlabs/prysm/v4/beacon-chain/p2p/testing" "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/core" + mockSync "github.com/prysmaticlabs/prysm/v4/beacon-chain/sync/initial-sync/testing" fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams" + "github.com/prysmaticlabs/prysm/v4/config/params" + "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v4/crypto/bls" "github.com/prysmaticlabs/prysm/v4/encoding/bytesutil" http2 "github.com/prysmaticlabs/prysm/v4/network/http" ethpbalpha "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v4/testing/assert" "github.com/prysmaticlabs/prysm/v4/testing/require" + "github.com/prysmaticlabs/prysm/v4/testing/util" ) func TestGetAggregateAttestation(t *testing.T) { @@ -313,7 +320,6 @@ func TestSubmitContributionAndProofs(t *testing.T) { require.NoError(t, err) assert.Equal(t, 1, len(contributions)) }) - t.Run("multiple", func(t *testing.T) { broadcaster := &p2pmock.MockBroadcaster{} c.Broadcaster = broadcaster @@ -333,7 +339,35 @@ func TestSubmitContributionAndProofs(t *testing.T) { require.NoError(t, err) assert.Equal(t, 2, len(contributions)) }) + t.Run("no body", func(t *testing.T) { + s.SyncCommitteePool = synccommittee.NewStore() + request := httptest.NewRequest(http.MethodPost, "http://example.com", nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.SubmitContributionAndProofs(writer, request) + assert.Equal(t, http.StatusBadRequest, writer.Code) + e := &http2.DefaultErrorJson{} + require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e)) + assert.Equal(t, http.StatusBadRequest, e.Code) + assert.Equal(t, true, strings.Contains(e.Message, "No data submitted")) + }) + t.Run("empty", func(t *testing.T) { + var body bytes.Buffer + _, err := body.WriteString("[]") + require.NoError(t, err) + request := httptest.NewRequest(http.MethodPost, "http://example.com", &body) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.SubmitContributionAndProofs(writer, request) + assert.Equal(t, http.StatusBadRequest, writer.Code) + e := &http2.DefaultErrorJson{} + require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e)) + assert.Equal(t, http.StatusBadRequest, e.Code) + assert.Equal(t, true, strings.Contains(e.Message, "No data submitted")) + }) t.Run("invalid", func(t *testing.T) { c.SyncCommitteePool = synccommittee.NewStore() @@ -391,7 +425,6 @@ func TestSubmitAggregateAndProofs(t *testing.T) { assert.Equal(t, http.StatusOK, writer.Code) assert.Equal(t, 1, len(broadcaster.BroadcastMessages)) }) - t.Run("multiple", func(t *testing.T) { broadcaster := &p2pmock.MockBroadcaster{} c.Broadcaster = broadcaster @@ -408,7 +441,33 @@ func TestSubmitAggregateAndProofs(t *testing.T) { assert.Equal(t, http.StatusOK, writer.Code) assert.Equal(t, 2, len(broadcaster.BroadcastMessages)) }) + t.Run("no body", func(t *testing.T) { + request := httptest.NewRequest(http.MethodPost, "http://example.com", nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + s.SubmitAggregateAndProofs(writer, request) + assert.Equal(t, http.StatusBadRequest, writer.Code) + e := &http2.DefaultErrorJson{} + require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e)) + assert.Equal(t, http.StatusBadRequest, e.Code) + assert.Equal(t, true, strings.Contains(e.Message, "No data submitted")) + }) + t.Run("empty", func(t *testing.T) { + var body bytes.Buffer + _, err := body.WriteString("[]") + require.NoError(t, err) + request := httptest.NewRequest(http.MethodPost, "http://example.com", &body) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.SubmitAggregateAndProofs(writer, request) + assert.Equal(t, http.StatusBadRequest, writer.Code) + e := &http2.DefaultErrorJson{} + require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e)) + assert.Equal(t, http.StatusBadRequest, e.Code) + assert.Equal(t, true, strings.Contains(e.Message, "No data submitted")) + }) t.Run("invalid", func(t *testing.T) { var body bytes.Buffer _, err := body.WriteString(invalidAggregate) @@ -423,22 +482,179 @@ func TestSubmitAggregateAndProofs(t *testing.T) { require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e)) assert.Equal(t, http.StatusBadRequest, e.Code) }) +} +func TestSubmitSyncCommitteeSubscription(t *testing.T) { + genesis := util.NewBeaconBlock() + deposits, _, err := util.DeterministicDepositsAndKeys(64) + require.NoError(t, err) + eth1Data, err := util.DeterministicEth1Data(len(deposits)) + require.NoError(t, err) + bs, err := util.GenesisBeaconState(context.Background(), deposits, 0, eth1Data) + require.NoError(t, err, "Could not set up genesis state") + genesisRoot, err := genesis.Block.HashTreeRoot() + require.NoError(t, err, "Could not get signing root") + roots := make([][]byte, fieldparams.BlockRootsLength) + roots[0] = genesisRoot[:] + require.NoError(t, bs.SetBlockRoots(roots)) + + pubkeys := make([][]byte, len(deposits)) + for i := 0; i < len(deposits); i++ { + pubkeys[i] = deposits[i].Data.PublicKey + } + + chainSlot := primitives.Slot(0) + chain := &mockChain.ChainService{ + State: bs, Root: genesisRoot[:], Slot: &chainSlot, + } + s := &Server{ + HeadFetcher: chain, + SyncChecker: &mockSync.Sync{IsSyncing: false}, + } + + t.Run("single", func(t *testing.T) { + cache.SyncSubnetIDs.EmptyAllCaches() + + var body bytes.Buffer + _, err := body.WriteString(singleSyncCommitteeSubscription) + require.NoError(t, err) + request := httptest.NewRequest(http.MethodPost, "http://example.com", &body) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.SubmitSyncCommitteeSubscription(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + subnets, _, _, _ := cache.SyncSubnetIDs.GetSyncCommitteeSubnets(pubkeys[1], 0) + require.Equal(t, 2, len(subnets)) + assert.Equal(t, uint64(0), subnets[0]) + assert.Equal(t, uint64(2), subnets[1]) + }) + t.Run("multiple", func(t *testing.T) { + cache.SyncSubnetIDs.EmptyAllCaches() + + var body bytes.Buffer + _, err := body.WriteString(multipleSyncCommitteeSubscription) + require.NoError(t, err) + request := httptest.NewRequest(http.MethodPost, "http://example.com", &body) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.SubmitSyncCommitteeSubscription(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + subnets, _, _, _ := cache.SyncSubnetIDs.GetSyncCommitteeSubnets(pubkeys[0], 0) + require.Equal(t, 1, len(subnets)) + assert.Equal(t, uint64(0), subnets[0]) + subnets, _, _, _ = cache.SyncSubnetIDs.GetSyncCommitteeSubnets(pubkeys[1], 0) + require.Equal(t, 1, len(subnets)) + assert.Equal(t, uint64(2), subnets[0]) + }) t.Run("no body", func(t *testing.T) { request := httptest.NewRequest(http.MethodPost, "http://example.com", nil) writer := httptest.NewRecorder() writer.Body = &bytes.Buffer{} - s.SubmitAggregateAndProofs(writer, request) + s.SubmitSyncCommitteeSubscription(writer, request) assert.Equal(t, http.StatusBadRequest, writer.Code) e := &http2.DefaultErrorJson{} require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e)) assert.Equal(t, http.StatusBadRequest, e.Code) assert.Equal(t, true, strings.Contains(e.Message, "No data submitted")) }) + t.Run("empty", func(t *testing.T) { + var body bytes.Buffer + _, err := body.WriteString("[]") + require.NoError(t, err) + request := httptest.NewRequest(http.MethodPost, "http://example.com", &body) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.SubmitSyncCommitteeSubscription(writer, request) + assert.Equal(t, http.StatusBadRequest, writer.Code) + e := &http2.DefaultErrorJson{} + require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e)) + assert.Equal(t, http.StatusBadRequest, e.Code) + assert.Equal(t, true, strings.Contains(e.Message, "No data submitted")) + }) + t.Run("invalid", func(t *testing.T) { + var body bytes.Buffer + _, err := body.WriteString(invalidSyncCommitteeSubscription) + require.NoError(t, err) + request := httptest.NewRequest(http.MethodPost, "http://example.com", &body) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.SubmitSyncCommitteeSubscription(writer, request) + assert.Equal(t, http.StatusBadRequest, writer.Code) + e := &http2.DefaultErrorJson{} + require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e)) + assert.Equal(t, http.StatusBadRequest, e.Code) + }) + t.Run("epoch in the past", func(t *testing.T) { + var body bytes.Buffer + _, err := body.WriteString(singleSyncCommitteeSubscription2) + require.NoError(t, err) + request := httptest.NewRequest(http.MethodPost, "http://example.com", &body) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.SubmitSyncCommitteeSubscription(writer, request) + assert.Equal(t, http.StatusBadRequest, writer.Code) + e := &http2.DefaultErrorJson{} + require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e)) + assert.Equal(t, http.StatusBadRequest, e.Code) + assert.Equal(t, true, strings.Contains(e.Message, "Epoch for subscription at index 0 is in the past")) + }) + t.Run("first epoch after the next sync committee is valid", func(t *testing.T) { + var body bytes.Buffer + _, err := body.WriteString(singleSyncCommitteeSubscription3) + require.NoError(t, err) + request := httptest.NewRequest(http.MethodPost, "http://example.com", &body) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.SubmitSyncCommitteeSubscription(writer, request) + assert.Equal(t, http.StatusOK, writer.Code) + }) + t.Run("epoch too far in the future", func(t *testing.T) { + var body bytes.Buffer + _, err := body.WriteString(singleSyncCommitteeSubscription4) + require.NoError(t, err) + request := httptest.NewRequest(http.MethodPost, "http://example.com", &body) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.SubmitSyncCommitteeSubscription(writer, request) + assert.Equal(t, http.StatusBadRequest, writer.Code) + e := &http2.DefaultErrorJson{} + require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e)) + assert.Equal(t, http.StatusBadRequest, e.Code) + assert.Equal(t, true, strings.Contains(e.Message, "Epoch for subscription at index 0 is too far in the future")) + }) + t.Run("sync not ready", func(t *testing.T) { + st, err := util.NewBeaconState() + require.NoError(t, err) + chainService := &mockChain.ChainService{State: st} + s := &Server{ + SyncChecker: &mockSync.Sync{IsSyncing: true}, + HeadFetcher: chainService, + TimeFetcher: chainService, + OptimisticModeFetcher: chainService, + } + + request := httptest.NewRequest(http.MethodPost, "http://example.com", nil) + writer := httptest.NewRecorder() + writer.Body = &bytes.Buffer{} + + s.SubmitSyncCommitteeSubscription(writer, request) + assert.Equal(t, http.StatusServiceUnavailable, writer.Code) + e := &http2.DefaultErrorJson{} + require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e)) + assert.Equal(t, http.StatusServiceUnavailable, e.Code) + assert.Equal(t, true, strings.Contains(e.Message, "Beacon node is currently syncing")) + }) } -const ( +var ( singleContribution = `[ { "message": { @@ -605,5 +821,72 @@ const ( }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } +]` + singleSyncCommitteeSubscription = `[ + { + "validator_index": "1", + "sync_committee_indices": [ + "0", + "2" + ], + "until_epoch": "1" + } +]` + singleSyncCommitteeSubscription2 = `[ + { + "validator_index": "0", + "sync_committee_indices": [ + "0", + "2" + ], + "until_epoch": "0" + } +]` + singleSyncCommitteeSubscription3 = fmt.Sprintf(`[ + { + "validator_index": "0", + "sync_committee_indices": [ + "0", + "2" + ], + "until_epoch": "%d" + } +]`, 2*params.BeaconConfig().EpochsPerSyncCommitteePeriod) + singleSyncCommitteeSubscription4 = fmt.Sprintf(`[ + { + "validator_index": "0", + "sync_committee_indices": [ + "0", + "2" + ], + "until_epoch": "%d" + } +]`, 2*params.BeaconConfig().EpochsPerSyncCommitteePeriod+1) + multipleSyncCommitteeSubscription = `[ + { + "validator_index": "0", + "sync_committee_indices": [ + "0" + ], + "until_epoch": "1" + }, + { + "validator_index": "1", + "sync_committee_indices": [ + "2" + ], + "until_epoch": "1" + } +]` + // validator_index is invalid + invalidSyncCommitteeSubscription = `[ + { + "validator_index": "foo", + "sync_committee_indices": [ + "0", + "2" + ], + "until_epoch": "1" + } ]` ) diff --git a/beacon-chain/rpc/eth/validator/structs.go b/beacon-chain/rpc/eth/validator/structs.go index 96f6e652e0..17bbd35a87 100644 --- a/beacon-chain/rpc/eth/validator/structs.go +++ b/beacon-chain/rpc/eth/validator/structs.go @@ -7,9 +7,13 @@ type AggregateAttestationResponse struct { } type SubmitContributionAndProofsRequest struct { - Data []*shared.SignedContributionAndProof `json:"data" validate:"required"` + Data []*shared.SignedContributionAndProof `json:"data" validate:"required,dive"` } type SubmitAggregateAndProofsRequest struct { - Data []*shared.SignedAggregateAttestationAndProof `json:"data" validate:"required"` + Data []*shared.SignedAggregateAttestationAndProof `json:"data" validate:"required,dive"` +} + +type SubmitSyncCommitteeSubscriptionsRequest struct { + Data []*shared.SyncCommitteeSubscription `json:"data" validate:"required,dive"` } diff --git a/beacon-chain/rpc/eth/validator/validator.go b/beacon-chain/rpc/eth/validator/validator.go index 37653b569c..dd9fdd93fd 100644 --- a/beacon-chain/rpc/eth/validator/validator.go +++ b/beacon-chain/rpc/eth/validator/validator.go @@ -6,7 +6,6 @@ import ( "fmt" "sort" "strconv" - "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -881,81 +880,6 @@ func (vs *Server) SubmitBeaconCommitteeSubscription(ctx context.Context, req *et return &emptypb.Empty{}, nil } -// SubmitSyncCommitteeSubscription subscribe to a number of sync committee subnets. -// -// Subscribing to sync committee subnets is an action performed by VC to enable -// network participation in Altair networks, and only required if the VC has an active -// validator in an active sync committee. -func (vs *Server) SubmitSyncCommitteeSubscription(ctx context.Context, req *ethpbv2.SubmitSyncCommitteeSubscriptionsRequest) (*empty.Empty, error) { - ctx, span := trace.StartSpan(ctx, "validator.SubmitSyncCommitteeSubscription") - defer span.End() - - if err := rpchelpers.ValidateSyncGRPC(ctx, vs.SyncChecker, vs.HeadFetcher, vs.TimeFetcher, vs.OptimisticModeFetcher); err != nil { - // We simply return the error because it's already a gRPC error. - return nil, err - } - - if len(req.Data) == 0 { - return nil, status.Error(codes.InvalidArgument, "No subscriptions provided") - } - s, err := vs.HeadFetcher.HeadStateReadOnly(ctx) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not get head state: %v", err) - } - currEpoch := slots.ToEpoch(s.Slot()) - validators := make([]state.ReadOnlyValidator, len(req.Data)) - for i, sub := range req.Data { - val, err := s.ValidatorAtIndexReadOnly(sub.ValidatorIndex) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not get validator at index %d: %v", sub.ValidatorIndex, err) - } - valStatus, err := rpchelpers.ValidatorSubStatus(val, currEpoch) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not get validator status at index %d: %v", sub.ValidatorIndex, err) - } - if valStatus != ethpbv1.ValidatorStatus_ACTIVE_ONGOING && valStatus != ethpbv1.ValidatorStatus_ACTIVE_EXITING { - return nil, status.Errorf(codes.InvalidArgument, "Validator at index %d is not active or exiting: %v", sub.ValidatorIndex, err) - } - validators[i] = val - } - - startEpoch, err := slots.SyncCommitteePeriodStartEpoch(currEpoch) - if err != nil { - return nil, status.Errorf(codes.Internal, "Could not get sync committee period start epoch: %v.", err) - } - - for i, sub := range req.Data { - if sub.UntilEpoch <= currEpoch { - return nil, status.Errorf(codes.InvalidArgument, "Epoch for subscription at index %d is in the past. It must be at least %d", i, currEpoch+1) - } - maxValidUntilEpoch := startEpoch + params.BeaconConfig().EpochsPerSyncCommitteePeriod*2 - if sub.UntilEpoch > maxValidUntilEpoch { - return nil, status.Errorf( - codes.InvalidArgument, - "Epoch for subscription at index %d is too far in the future. It can be at most %d", - i, - maxValidUntilEpoch, - ) - } - } - - for i, sub := range req.Data { - pubkey48 := validators[i].PublicKey() - // Handle overflow in the event current epoch is less than end epoch. - // This is an impossible condition, so it is a defensive check. - epochsToWatch, err := sub.UntilEpoch.SafeSub(uint64(startEpoch)) - if err != nil { - epochsToWatch = 0 - } - epochDuration := time.Duration(params.BeaconConfig().SlotsPerEpoch.Mul(params.BeaconConfig().SecondsPerSlot)) * time.Second - totalDuration := epochDuration * time.Duration(epochsToWatch) - - cache.SyncSubnetIDs.AddSyncCommitteeSubnets(pubkey48[:], startEpoch, sub.SyncCommitteeIndices, totalDuration) - } - - return &empty.Empty{}, nil -} - // ProduceSyncCommitteeContribution requests that the beacon node produce a sync committee contribution. func (vs *Server) ProduceSyncCommitteeContribution( ctx context.Context, diff --git a/beacon-chain/rpc/eth/validator/validator_test.go b/beacon-chain/rpc/eth/validator/validator_test.go index 5dc1df04da..ae0762cff5 100644 --- a/beacon-chain/rpc/eth/validator/validator_test.go +++ b/beacon-chain/rpc/eth/validator/validator_test.go @@ -1450,165 +1450,6 @@ func TestSubmitBeaconCommitteeSubscription_SyncNotReady(t *testing.T) { assert.ErrorContains(t, "Syncing to latest head, not ready to respond", err) } -func TestSubmitSyncCommitteeSubscription(t *testing.T) { - ctx := context.Background() - genesis := util.NewBeaconBlock() - deposits, _, err := util.DeterministicDepositsAndKeys(64) - require.NoError(t, err) - eth1Data, err := util.DeterministicEth1Data(len(deposits)) - require.NoError(t, err) - bs, err := util.GenesisBeaconState(context.Background(), deposits, 0, eth1Data) - require.NoError(t, err, "Could not set up genesis state") - genesisRoot, err := genesis.Block.HashTreeRoot() - require.NoError(t, err, "Could not get signing root") - roots := make([][]byte, fieldparams.BlockRootsLength) - roots[0] = genesisRoot[:] - require.NoError(t, bs.SetBlockRoots(roots)) - - pubkeys := make([][]byte, len(deposits)) - for i := 0; i < len(deposits); i++ { - pubkeys[i] = deposits[i].Data.PublicKey - } - - chainSlot := primitives.Slot(0) - chain := &mockChain.ChainService{ - State: bs, Root: genesisRoot[:], Slot: &chainSlot, - } - vs := &Server{ - HeadFetcher: chain, - TimeFetcher: chain, - SyncChecker: &mockSync.Sync{IsSyncing: false}, - V1Alpha1Server: &v1alpha1validator.Server{}, - } - - t.Run("Single subscription", func(t *testing.T) { - cache.SyncSubnetIDs.EmptyAllCaches() - req := ðpbv2.SubmitSyncCommitteeSubscriptionsRequest{ - Data: []*ethpbv2.SyncCommitteeSubscription{ - { - ValidatorIndex: 0, - SyncCommitteeIndices: []uint64{0, 2}, - UntilEpoch: 1, - }, - }, - } - _, err = vs.SubmitSyncCommitteeSubscription(ctx, req) - require.NoError(t, err) - subnets, _, _, _ := cache.SyncSubnetIDs.GetSyncCommitteeSubnets(pubkeys[0], 0) - require.Equal(t, 2, len(subnets)) - assert.Equal(t, uint64(0), subnets[0]) - assert.Equal(t, uint64(2), subnets[1]) - }) - - t.Run("Multiple subscriptions", func(t *testing.T) { - cache.SyncSubnetIDs.EmptyAllCaches() - req := ðpbv2.SubmitSyncCommitteeSubscriptionsRequest{ - Data: []*ethpbv2.SyncCommitteeSubscription{ - { - ValidatorIndex: 0, - SyncCommitteeIndices: []uint64{0}, - UntilEpoch: 1, - }, - { - ValidatorIndex: 1, - SyncCommitteeIndices: []uint64{2}, - UntilEpoch: 1, - }, - }, - } - _, err = vs.SubmitSyncCommitteeSubscription(ctx, req) - require.NoError(t, err) - subnets, _, _, _ := cache.SyncSubnetIDs.GetSyncCommitteeSubnets(pubkeys[0], 0) - require.Equal(t, 1, len(subnets)) - assert.Equal(t, uint64(0), subnets[0]) - subnets, _, _, _ = cache.SyncSubnetIDs.GetSyncCommitteeSubnets(pubkeys[1], 0) - require.Equal(t, 1, len(subnets)) - assert.Equal(t, uint64(2), subnets[0]) - }) - - t.Run("No subscriptions", func(t *testing.T) { - req := ðpbv2.SubmitSyncCommitteeSubscriptionsRequest{ - Data: make([]*ethpbv2.SyncCommitteeSubscription, 0), - } - _, err = vs.SubmitSyncCommitteeSubscription(ctx, req) - require.NotNil(t, err) - assert.ErrorContains(t, "No subscriptions provided", err) - }) - - t.Run("Invalid validator index", func(t *testing.T) { - req := ðpbv2.SubmitSyncCommitteeSubscriptionsRequest{ - Data: []*ethpbv2.SyncCommitteeSubscription{ - { - ValidatorIndex: 99, - SyncCommitteeIndices: []uint64{}, - UntilEpoch: 1, - }, - }, - } - _, err = vs.SubmitSyncCommitteeSubscription(ctx, req) - require.NotNil(t, err) - assert.ErrorContains(t, "Could not get validator at index 99", err) - }) - - t.Run("Epoch in the past", func(t *testing.T) { - req := ðpbv2.SubmitSyncCommitteeSubscriptionsRequest{ - Data: []*ethpbv2.SyncCommitteeSubscription{ - { - ValidatorIndex: 0, - SyncCommitteeIndices: []uint64{}, - UntilEpoch: 0, - }, - }, - } - _, err = vs.SubmitSyncCommitteeSubscription(ctx, req) - require.NotNil(t, err) - assert.ErrorContains(t, "Epoch for subscription at index 0 is in the past", err) - }) - - t.Run("First epoch after the next sync committee is valid", func(t *testing.T) { - req := ðpbv2.SubmitSyncCommitteeSubscriptionsRequest{ - Data: []*ethpbv2.SyncCommitteeSubscription{ - { - ValidatorIndex: 0, - SyncCommitteeIndices: []uint64{}, - UntilEpoch: 2 * params.BeaconConfig().EpochsPerSyncCommitteePeriod, - }, - }, - } - _, err = vs.SubmitSyncCommitteeSubscription(ctx, req) - require.NoError(t, err) - }) - - t.Run("Epoch too far in the future", func(t *testing.T) { - req := ðpbv2.SubmitSyncCommitteeSubscriptionsRequest{ - Data: []*ethpbv2.SyncCommitteeSubscription{ - { - ValidatorIndex: 0, - SyncCommitteeIndices: []uint64{}, - UntilEpoch: 2*params.BeaconConfig().EpochsPerSyncCommitteePeriod + 1, - }, - }, - } - _, err = vs.SubmitSyncCommitteeSubscription(ctx, req) - require.NotNil(t, err) - assert.ErrorContains(t, "Epoch for subscription at index 0 is too far in the future", err) - }) -} - -func TestSubmitSyncCommitteeSubscription_SyncNotReady(t *testing.T) { - st, err := util.NewBeaconState() - require.NoError(t, err) - chainService := &mockChain.ChainService{State: st} - vs := &Server{ - SyncChecker: &mockSync.Sync{IsSyncing: true}, - HeadFetcher: chainService, - TimeFetcher: chainService, - OptimisticModeFetcher: chainService, - } - _, err = vs.SubmitSyncCommitteeSubscription(context.Background(), ðpbv2.SubmitSyncCommitteeSubscriptionsRequest{}) - assert.ErrorContains(t, "Syncing to latest head, not ready to respond", err) -} - func TestProduceSyncCommitteeContribution(t *testing.T) { ctx := context.Background() root := bytesutil.PadTo([]byte("root"), 32) diff --git a/beacon-chain/rpc/service.go b/beacon-chain/rpc/service.go index 0080552b3c..099f232b86 100644 --- a/beacon-chain/rpc/service.go +++ b/beacon-chain/rpc/service.go @@ -300,6 +300,7 @@ func (s *Service) Start() { s.cfg.Router.HandleFunc("/eth/v1/validator/aggregate_attestation", validatorServerV1.GetAggregateAttestation).Methods(http.MethodGet) s.cfg.Router.HandleFunc("/eth/v1/validator/contribution_and_proofs", validatorServerV1.SubmitContributionAndProofs).Methods(http.MethodPost) s.cfg.Router.HandleFunc("/eth/v1/validator/aggregate_and_proofs", validatorServerV1.SubmitAggregateAndProofs).Methods(http.MethodPost) + s.cfg.Router.HandleFunc("/eth/v1/validator/sync_committee_subscriptions", validatorServerV1.SubmitSyncCommitteeSubscription).Methods(http.MethodPost) nodeServer := &nodev1alpha1.Server{ LogsStreamer: logs.NewStreamServer(), diff --git a/consensus-types/validator/BUILD.bazel b/consensus-types/validator/BUILD.bazel index 0ad6984336..59e0b67c27 100644 --- a/consensus-types/validator/BUILD.bazel +++ b/consensus-types/validator/BUILD.bazel @@ -2,9 +2,13 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", - srcs = ["custom_types.go"], + srcs = [ + "custom_types.go", + "types.go", + ], importpath = "github.com/prysmaticlabs/prysm/v4/consensus-types/validator", visibility = ["//visibility:public"], + deps = ["//consensus-types/primitives:go_default_library"], ) go_test( diff --git a/consensus-types/validator/types.go b/consensus-types/validator/types.go new file mode 100644 index 0000000000..8a04b8a6de --- /dev/null +++ b/consensus-types/validator/types.go @@ -0,0 +1,11 @@ +package validator + +import ( + "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives" +) + +type SyncCommitteeSubscription struct { + ValidatorIndex primitives.ValidatorIndex + SyncCommitteeIndices []uint64 + UntilEpoch primitives.Epoch +} diff --git a/proto/eth/service/validator_service.pb.go b/proto/eth/service/validator_service.pb.go index 7deb39451a..9f4ebeda66 100755 --- a/proto/eth/service/validator_service.pb.go +++ b/proto/eth/service/validator_service.pb.go @@ -47,7 +47,7 @@ var file_proto_eth_service_validator_service_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x73, 0x7a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x32, 0xd4, 0x12, 0x0a, 0x0f, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x56, 0x61, 0x6c, + 0x74, 0x6f, 0x32, 0x9a, 0x11, 0x0a, 0x0f, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0xa3, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x12, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x41, @@ -162,51 +162,39 @@ var file_proto_eth_service_validator_service_proto_rawDesc = []byte{ 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0xb7, 0x01, 0x0a, 0x1f, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x79, 0x6e, - 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, - 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x75, 0x62, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x42, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3c, - 0x3a, 0x01, 0x2a, 0x22, 0x37, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, - 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, - 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x73, - 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xd7, 0x01, 0x0a, - 0x20, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x38, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x6e, 0x73, 0x12, 0xd7, 0x01, 0x0a, 0x20, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x53, 0x79, + 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, + 0x65, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x39, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, - 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x12, 0x36, - 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, - 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x90, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4c, 0x69, - 0x76, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x23, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x76, 0x65, - 0x6e, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, - 0x74, 0x4c, 0x69, 0x76, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x3a, 0x01, 0x2a, 0x22, 0x2b, 0x2f, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6e, 0x65, 0x73, - 0x73, 0x2f, 0x7b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x7d, 0x42, 0x96, 0x01, 0x0a, 0x18, 0x6f, 0x72, - 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x15, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x34, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0xaa, 0x02, 0x14, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x45, 0x74, 0x68, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xca, 0x02, 0x14, 0x45, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x38, 0x12, 0x36, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x90, 0x01, 0x0a, + 0x0b, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x76, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x23, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x47, + 0x65, 0x74, 0x4c, 0x69, 0x76, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x76, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x3a, + 0x01, 0x2a, 0x22, 0x2b, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, + 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x6c, + 0x69, 0x76, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x7b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x7d, 0x42, + 0x96, 0x01, 0x0a, 0x18, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x15, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, + 0x74, 0x68, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xaa, 0x02, 0x14, 0x45, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0xca, 0x02, 0x14, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, + 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_proto_eth_service_validator_service_proto_goTypes = []interface{}{ @@ -218,19 +206,18 @@ var file_proto_eth_service_validator_service_proto_goTypes = []interface{}{ (*v1.SubmitValidatorRegistrationsRequest)(nil), // 5: ethereum.eth.v1.SubmitValidatorRegistrationsRequest (*v1.ProduceAttestationDataRequest)(nil), // 6: ethereum.eth.v1.ProduceAttestationDataRequest (*v1.SubmitBeaconCommitteeSubscriptionsRequest)(nil), // 7: ethereum.eth.v1.SubmitBeaconCommitteeSubscriptionsRequest - (*v2.SubmitSyncCommitteeSubscriptionsRequest)(nil), // 8: ethereum.eth.v2.SubmitSyncCommitteeSubscriptionsRequest - (*v2.ProduceSyncCommitteeContributionRequest)(nil), // 9: ethereum.eth.v2.ProduceSyncCommitteeContributionRequest - (*v2.GetLivenessRequest)(nil), // 10: ethereum.eth.v2.GetLivenessRequest - (*v1.AttesterDutiesResponse)(nil), // 11: ethereum.eth.v1.AttesterDutiesResponse - (*v1.ProposerDutiesResponse)(nil), // 12: ethereum.eth.v1.ProposerDutiesResponse - (*v2.SyncCommitteeDutiesResponse)(nil), // 13: ethereum.eth.v2.SyncCommitteeDutiesResponse - (*v2.ProduceBlockResponseV2)(nil), // 14: ethereum.eth.v2.ProduceBlockResponseV2 - (*v2.SSZContainer)(nil), // 15: ethereum.eth.v2.SSZContainer - (*v2.ProduceBlindedBlockResponse)(nil), // 16: ethereum.eth.v2.ProduceBlindedBlockResponse - (*empty.Empty)(nil), // 17: google.protobuf.Empty - (*v1.ProduceAttestationDataResponse)(nil), // 18: ethereum.eth.v1.ProduceAttestationDataResponse - (*v2.ProduceSyncCommitteeContributionResponse)(nil), // 19: ethereum.eth.v2.ProduceSyncCommitteeContributionResponse - (*v2.GetLivenessResponse)(nil), // 20: ethereum.eth.v2.GetLivenessResponse + (*v2.ProduceSyncCommitteeContributionRequest)(nil), // 8: ethereum.eth.v2.ProduceSyncCommitteeContributionRequest + (*v2.GetLivenessRequest)(nil), // 9: ethereum.eth.v2.GetLivenessRequest + (*v1.AttesterDutiesResponse)(nil), // 10: ethereum.eth.v1.AttesterDutiesResponse + (*v1.ProposerDutiesResponse)(nil), // 11: ethereum.eth.v1.ProposerDutiesResponse + (*v2.SyncCommitteeDutiesResponse)(nil), // 12: ethereum.eth.v2.SyncCommitteeDutiesResponse + (*v2.ProduceBlockResponseV2)(nil), // 13: ethereum.eth.v2.ProduceBlockResponseV2 + (*v2.SSZContainer)(nil), // 14: ethereum.eth.v2.SSZContainer + (*v2.ProduceBlindedBlockResponse)(nil), // 15: ethereum.eth.v2.ProduceBlindedBlockResponse + (*empty.Empty)(nil), // 16: google.protobuf.Empty + (*v1.ProduceAttestationDataResponse)(nil), // 17: ethereum.eth.v1.ProduceAttestationDataResponse + (*v2.ProduceSyncCommitteeContributionResponse)(nil), // 18: ethereum.eth.v2.ProduceSyncCommitteeContributionResponse + (*v2.GetLivenessResponse)(nil), // 19: ethereum.eth.v2.GetLivenessResponse } var file_proto_eth_service_validator_service_proto_depIdxs = []int32{ 0, // 0: ethereum.eth.service.BeaconValidator.GetAttesterDuties:input_type -> ethereum.eth.v1.AttesterDutiesRequest @@ -244,25 +231,23 @@ var file_proto_eth_service_validator_service_proto_depIdxs = []int32{ 5, // 8: ethereum.eth.service.BeaconValidator.SubmitValidatorRegistration:input_type -> ethereum.eth.v1.SubmitValidatorRegistrationsRequest 6, // 9: ethereum.eth.service.BeaconValidator.ProduceAttestationData:input_type -> ethereum.eth.v1.ProduceAttestationDataRequest 7, // 10: ethereum.eth.service.BeaconValidator.SubmitBeaconCommitteeSubscription:input_type -> ethereum.eth.v1.SubmitBeaconCommitteeSubscriptionsRequest - 8, // 11: ethereum.eth.service.BeaconValidator.SubmitSyncCommitteeSubscription:input_type -> ethereum.eth.v2.SubmitSyncCommitteeSubscriptionsRequest - 9, // 12: ethereum.eth.service.BeaconValidator.ProduceSyncCommitteeContribution:input_type -> ethereum.eth.v2.ProduceSyncCommitteeContributionRequest - 10, // 13: ethereum.eth.service.BeaconValidator.GetLiveness:input_type -> ethereum.eth.v2.GetLivenessRequest - 11, // 14: ethereum.eth.service.BeaconValidator.GetAttesterDuties:output_type -> ethereum.eth.v1.AttesterDutiesResponse - 12, // 15: ethereum.eth.service.BeaconValidator.GetProposerDuties:output_type -> ethereum.eth.v1.ProposerDutiesResponse - 13, // 16: ethereum.eth.service.BeaconValidator.GetSyncCommitteeDuties:output_type -> ethereum.eth.v2.SyncCommitteeDutiesResponse - 14, // 17: ethereum.eth.service.BeaconValidator.ProduceBlockV2:output_type -> ethereum.eth.v2.ProduceBlockResponseV2 - 15, // 18: ethereum.eth.service.BeaconValidator.ProduceBlockV2SSZ:output_type -> ethereum.eth.v2.SSZContainer - 16, // 19: ethereum.eth.service.BeaconValidator.ProduceBlindedBlock:output_type -> ethereum.eth.v2.ProduceBlindedBlockResponse - 15, // 20: ethereum.eth.service.BeaconValidator.ProduceBlindedBlockSSZ:output_type -> ethereum.eth.v2.SSZContainer - 17, // 21: ethereum.eth.service.BeaconValidator.PrepareBeaconProposer:output_type -> google.protobuf.Empty - 17, // 22: ethereum.eth.service.BeaconValidator.SubmitValidatorRegistration:output_type -> google.protobuf.Empty - 18, // 23: ethereum.eth.service.BeaconValidator.ProduceAttestationData:output_type -> ethereum.eth.v1.ProduceAttestationDataResponse - 17, // 24: ethereum.eth.service.BeaconValidator.SubmitBeaconCommitteeSubscription:output_type -> google.protobuf.Empty - 17, // 25: ethereum.eth.service.BeaconValidator.SubmitSyncCommitteeSubscription:output_type -> google.protobuf.Empty - 19, // 26: ethereum.eth.service.BeaconValidator.ProduceSyncCommitteeContribution:output_type -> ethereum.eth.v2.ProduceSyncCommitteeContributionResponse - 20, // 27: ethereum.eth.service.BeaconValidator.GetLiveness:output_type -> ethereum.eth.v2.GetLivenessResponse - 14, // [14:28] is the sub-list for method output_type - 0, // [0:14] is the sub-list for method input_type + 8, // 11: ethereum.eth.service.BeaconValidator.ProduceSyncCommitteeContribution:input_type -> ethereum.eth.v2.ProduceSyncCommitteeContributionRequest + 9, // 12: ethereum.eth.service.BeaconValidator.GetLiveness:input_type -> ethereum.eth.v2.GetLivenessRequest + 10, // 13: ethereum.eth.service.BeaconValidator.GetAttesterDuties:output_type -> ethereum.eth.v1.AttesterDutiesResponse + 11, // 14: ethereum.eth.service.BeaconValidator.GetProposerDuties:output_type -> ethereum.eth.v1.ProposerDutiesResponse + 12, // 15: ethereum.eth.service.BeaconValidator.GetSyncCommitteeDuties:output_type -> ethereum.eth.v2.SyncCommitteeDutiesResponse + 13, // 16: ethereum.eth.service.BeaconValidator.ProduceBlockV2:output_type -> ethereum.eth.v2.ProduceBlockResponseV2 + 14, // 17: ethereum.eth.service.BeaconValidator.ProduceBlockV2SSZ:output_type -> ethereum.eth.v2.SSZContainer + 15, // 18: ethereum.eth.service.BeaconValidator.ProduceBlindedBlock:output_type -> ethereum.eth.v2.ProduceBlindedBlockResponse + 14, // 19: ethereum.eth.service.BeaconValidator.ProduceBlindedBlockSSZ:output_type -> ethereum.eth.v2.SSZContainer + 16, // 20: ethereum.eth.service.BeaconValidator.PrepareBeaconProposer:output_type -> google.protobuf.Empty + 16, // 21: ethereum.eth.service.BeaconValidator.SubmitValidatorRegistration:output_type -> google.protobuf.Empty + 17, // 22: ethereum.eth.service.BeaconValidator.ProduceAttestationData:output_type -> ethereum.eth.v1.ProduceAttestationDataResponse + 16, // 23: ethereum.eth.service.BeaconValidator.SubmitBeaconCommitteeSubscription:output_type -> google.protobuf.Empty + 18, // 24: ethereum.eth.service.BeaconValidator.ProduceSyncCommitteeContribution:output_type -> ethereum.eth.v2.ProduceSyncCommitteeContributionResponse + 19, // 25: ethereum.eth.service.BeaconValidator.GetLiveness:output_type -> ethereum.eth.v2.GetLivenessResponse + 13, // [13:26] is the sub-list for method output_type + 0, // [0:13] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name @@ -315,7 +300,6 @@ type BeaconValidatorClient interface { SubmitValidatorRegistration(ctx context.Context, in *v1.SubmitValidatorRegistrationsRequest, opts ...grpc.CallOption) (*empty.Empty, error) ProduceAttestationData(ctx context.Context, in *v1.ProduceAttestationDataRequest, opts ...grpc.CallOption) (*v1.ProduceAttestationDataResponse, error) SubmitBeaconCommitteeSubscription(ctx context.Context, in *v1.SubmitBeaconCommitteeSubscriptionsRequest, opts ...grpc.CallOption) (*empty.Empty, error) - SubmitSyncCommitteeSubscription(ctx context.Context, in *v2.SubmitSyncCommitteeSubscriptionsRequest, opts ...grpc.CallOption) (*empty.Empty, error) ProduceSyncCommitteeContribution(ctx context.Context, in *v2.ProduceSyncCommitteeContributionRequest, opts ...grpc.CallOption) (*v2.ProduceSyncCommitteeContributionResponse, error) GetLiveness(ctx context.Context, in *v2.GetLivenessRequest, opts ...grpc.CallOption) (*v2.GetLivenessResponse, error) } @@ -427,15 +411,6 @@ func (c *beaconValidatorClient) SubmitBeaconCommitteeSubscription(ctx context.Co return out, nil } -func (c *beaconValidatorClient) SubmitSyncCommitteeSubscription(ctx context.Context, in *v2.SubmitSyncCommitteeSubscriptionsRequest, opts ...grpc.CallOption) (*empty.Empty, error) { - out := new(empty.Empty) - err := c.cc.Invoke(ctx, "/ethereum.eth.service.BeaconValidator/SubmitSyncCommitteeSubscription", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *beaconValidatorClient) ProduceSyncCommitteeContribution(ctx context.Context, in *v2.ProduceSyncCommitteeContributionRequest, opts ...grpc.CallOption) (*v2.ProduceSyncCommitteeContributionResponse, error) { out := new(v2.ProduceSyncCommitteeContributionResponse) err := c.cc.Invoke(ctx, "/ethereum.eth.service.BeaconValidator/ProduceSyncCommitteeContribution", in, out, opts...) @@ -467,7 +442,6 @@ type BeaconValidatorServer interface { SubmitValidatorRegistration(context.Context, *v1.SubmitValidatorRegistrationsRequest) (*empty.Empty, error) ProduceAttestationData(context.Context, *v1.ProduceAttestationDataRequest) (*v1.ProduceAttestationDataResponse, error) SubmitBeaconCommitteeSubscription(context.Context, *v1.SubmitBeaconCommitteeSubscriptionsRequest) (*empty.Empty, error) - SubmitSyncCommitteeSubscription(context.Context, *v2.SubmitSyncCommitteeSubscriptionsRequest) (*empty.Empty, error) ProduceSyncCommitteeContribution(context.Context, *v2.ProduceSyncCommitteeContributionRequest) (*v2.ProduceSyncCommitteeContributionResponse, error) GetLiveness(context.Context, *v2.GetLivenessRequest) (*v2.GetLivenessResponse, error) } @@ -509,9 +483,6 @@ func (*UnimplementedBeaconValidatorServer) ProduceAttestationData(context.Contex func (*UnimplementedBeaconValidatorServer) SubmitBeaconCommitteeSubscription(context.Context, *v1.SubmitBeaconCommitteeSubscriptionsRequest) (*empty.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitBeaconCommitteeSubscription not implemented") } -func (*UnimplementedBeaconValidatorServer) SubmitSyncCommitteeSubscription(context.Context, *v2.SubmitSyncCommitteeSubscriptionsRequest) (*empty.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubmitSyncCommitteeSubscription not implemented") -} func (*UnimplementedBeaconValidatorServer) ProduceSyncCommitteeContribution(context.Context, *v2.ProduceSyncCommitteeContributionRequest) (*v2.ProduceSyncCommitteeContributionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ProduceSyncCommitteeContribution not implemented") } @@ -721,24 +692,6 @@ func _BeaconValidator_SubmitBeaconCommitteeSubscription_Handler(srv interface{}, return interceptor(ctx, in, info, handler) } -func _BeaconValidator_SubmitSyncCommitteeSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(v2.SubmitSyncCommitteeSubscriptionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BeaconValidatorServer).SubmitSyncCommitteeSubscription(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ethereum.eth.service.BeaconValidator/SubmitSyncCommitteeSubscription", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BeaconValidatorServer).SubmitSyncCommitteeSubscription(ctx, req.(*v2.SubmitSyncCommitteeSubscriptionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _BeaconValidator_ProduceSyncCommitteeContribution_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(v2.ProduceSyncCommitteeContributionRequest) if err := dec(in); err != nil { @@ -823,10 +776,6 @@ var _BeaconValidator_serviceDesc = grpc.ServiceDesc{ MethodName: "SubmitBeaconCommitteeSubscription", Handler: _BeaconValidator_SubmitBeaconCommitteeSubscription_Handler, }, - { - MethodName: "SubmitSyncCommitteeSubscription", - Handler: _BeaconValidator_SubmitSyncCommitteeSubscription_Handler, - }, { MethodName: "ProduceSyncCommitteeContribution", Handler: _BeaconValidator_ProduceSyncCommitteeContribution_Handler, diff --git a/proto/eth/service/validator_service.pb.gw.go b/proto/eth/service/validator_service.pb.gw.go index f4825efced..46fa0bbd1f 100755 --- a/proto/eth/service/validator_service.pb.gw.go +++ b/proto/eth/service/validator_service.pb.gw.go @@ -659,40 +659,6 @@ func local_request_BeaconValidator_SubmitBeaconCommitteeSubscription_0(ctx conte } -func request_BeaconValidator_SubmitSyncCommitteeSubscription_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq eth.SubmitSyncCommitteeSubscriptionsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitSyncCommitteeSubscription(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconValidator_SubmitSyncCommitteeSubscription_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq eth.SubmitSyncCommitteeSubscriptionsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitSyncCommitteeSubscription(ctx, &protoReq) - return msg, metadata, err - -} - var ( filter_BeaconValidator_ProduceSyncCommitteeContribution_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -1058,29 +1024,6 @@ func RegisterBeaconValidatorHandlerServer(ctx context.Context, mux *runtime.Serv }) - mux.Handle("POST", pattern_BeaconValidator_SubmitSyncCommitteeSubscription_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.service.BeaconValidator/SubmitSyncCommitteeSubscription") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconValidator_SubmitSyncCommitteeSubscription_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconValidator_SubmitSyncCommitteeSubscription_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_BeaconValidator_ProduceSyncCommitteeContribution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1388,26 +1331,6 @@ func RegisterBeaconValidatorHandlerClient(ctx context.Context, mux *runtime.Serv }) - mux.Handle("POST", pattern_BeaconValidator_SubmitSyncCommitteeSubscription_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.service.BeaconValidator/SubmitSyncCommitteeSubscription") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconValidator_SubmitSyncCommitteeSubscription_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconValidator_SubmitSyncCommitteeSubscription_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_BeaconValidator_ProduceSyncCommitteeContribution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1474,8 +1397,6 @@ var ( pattern_BeaconValidator_SubmitBeaconCommitteeSubscription_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"internal", "eth", "v1", "validator", "beacon_committee_subscriptions"}, "")) - pattern_BeaconValidator_SubmitSyncCommitteeSubscription_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"internal", "eth", "v1", "validator", "sync_committee_subscriptions"}, "")) - pattern_BeaconValidator_ProduceSyncCommitteeContribution_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"internal", "eth", "v1", "validator", "sync_committee_contribution"}, "")) pattern_BeaconValidator_GetLiveness_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"internal", "eth", "v1", "validator", "liveness", "epoch"}, "")) @@ -1504,8 +1425,6 @@ var ( forward_BeaconValidator_SubmitBeaconCommitteeSubscription_0 = runtime.ForwardResponseMessage - forward_BeaconValidator_SubmitSyncCommitteeSubscription_0 = runtime.ForwardResponseMessage - forward_BeaconValidator_ProduceSyncCommitteeContribution_0 = runtime.ForwardResponseMessage forward_BeaconValidator_GetLiveness_0 = runtime.ForwardResponseMessage diff --git a/proto/eth/service/validator_service.proto b/proto/eth/service/validator_service.proto index f00a6247a9..c5aa1e10c0 100644 --- a/proto/eth/service/validator_service.proto +++ b/proto/eth/service/validator_service.proto @@ -222,21 +222,6 @@ service BeaconValidator { }; } - // SubmitSyncCommitteeSubscription subscribes to a number of sync committee subnets - // - // Response usage: - // - 200: Successful response - // - 400: Invalid request syntax - // - 500: Beacon node internal error - // - // Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/prepareSyncCommitteeSubnets - rpc SubmitSyncCommitteeSubscription(v2.SubmitSyncCommitteeSubscriptionsRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/internal/eth/v1/validator/sync_committee_subscriptions" - body: "*" - }; - } - // ProduceSyncCommitteeContribution requests that the beacon node produces a sync committee contribution. // // HTTP response usage: diff --git a/proto/eth/v2/validator.pb.go b/proto/eth/v2/validator.pb.go index ed4a6240ed..45fb8b1f00 100755 --- a/proto/eth/v2/validator.pb.go +++ b/proto/eth/v2/validator.pb.go @@ -307,116 +307,6 @@ func (x *ProduceBlindedBlockResponse) GetData() *BlindedBeaconBlockContainer { return nil } -type SubmitSyncCommitteeSubscriptionsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Data []*SyncCommitteeSubscription `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` -} - -func (x *SubmitSyncCommitteeSubscriptionsRequest) Reset() { - *x = SubmitSyncCommitteeSubscriptionsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_validator_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SubmitSyncCommitteeSubscriptionsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubmitSyncCommitteeSubscriptionsRequest) ProtoMessage() {} - -func (x *SubmitSyncCommitteeSubscriptionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_validator_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubmitSyncCommitteeSubscriptionsRequest.ProtoReflect.Descriptor instead. -func (*SubmitSyncCommitteeSubscriptionsRequest) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{5} -} - -func (x *SubmitSyncCommitteeSubscriptionsRequest) GetData() []*SyncCommitteeSubscription { - if x != nil { - return x.Data - } - return nil -} - -type SyncCommitteeSubscription struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ValidatorIndex github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"` - SyncCommitteeIndices []uint64 `protobuf:"varint,2,rep,packed,name=sync_committee_indices,json=syncCommitteeIndices,proto3" json:"sync_committee_indices,omitempty"` - UntilEpoch github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch `protobuf:"varint,3,opt,name=until_epoch,json=untilEpoch,proto3" json:"until_epoch,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Epoch"` -} - -func (x *SyncCommitteeSubscription) Reset() { - *x = SyncCommitteeSubscription{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_validator_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SyncCommitteeSubscription) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncCommitteeSubscription) ProtoMessage() {} - -func (x *SyncCommitteeSubscription) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_validator_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SyncCommitteeSubscription.ProtoReflect.Descriptor instead. -func (*SyncCommitteeSubscription) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{6} -} - -func (x *SyncCommitteeSubscription) GetValidatorIndex() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex { - if x != nil { - return x.ValidatorIndex - } - return github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex(0) -} - -func (x *SyncCommitteeSubscription) GetSyncCommitteeIndices() []uint64 { - if x != nil { - return x.SyncCommitteeIndices - } - return nil -} - -func (x *SyncCommitteeSubscription) GetUntilEpoch() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch { - if x != nil { - return x.UntilEpoch - } - return github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(0) -} - type ProduceSyncCommitteeContributionRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -430,7 +320,7 @@ type ProduceSyncCommitteeContributionRequest struct { func (x *ProduceSyncCommitteeContributionRequest) Reset() { *x = ProduceSyncCommitteeContributionRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_validator_proto_msgTypes[7] + mi := &file_proto_eth_v2_validator_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -443,7 +333,7 @@ func (x *ProduceSyncCommitteeContributionRequest) String() string { func (*ProduceSyncCommitteeContributionRequest) ProtoMessage() {} func (x *ProduceSyncCommitteeContributionRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_validator_proto_msgTypes[7] + mi := &file_proto_eth_v2_validator_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -456,7 +346,7 @@ func (x *ProduceSyncCommitteeContributionRequest) ProtoReflect() protoreflect.Me // Deprecated: Use ProduceSyncCommitteeContributionRequest.ProtoReflect.Descriptor instead. func (*ProduceSyncCommitteeContributionRequest) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{7} + return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{5} } func (x *ProduceSyncCommitteeContributionRequest) GetSlot() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot { @@ -491,7 +381,7 @@ type ProduceSyncCommitteeContributionResponse struct { func (x *ProduceSyncCommitteeContributionResponse) Reset() { *x = ProduceSyncCommitteeContributionResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_validator_proto_msgTypes[8] + mi := &file_proto_eth_v2_validator_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -504,7 +394,7 @@ func (x *ProduceSyncCommitteeContributionResponse) String() string { func (*ProduceSyncCommitteeContributionResponse) ProtoMessage() {} func (x *ProduceSyncCommitteeContributionResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_validator_proto_msgTypes[8] + mi := &file_proto_eth_v2_validator_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -517,7 +407,7 @@ func (x *ProduceSyncCommitteeContributionResponse) ProtoReflect() protoreflect.M // Deprecated: Use ProduceSyncCommitteeContributionResponse.ProtoReflect.Descriptor instead. func (*ProduceSyncCommitteeContributionResponse) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{8} + return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{6} } func (x *ProduceSyncCommitteeContributionResponse) GetData() *SyncCommitteeContribution { @@ -542,7 +432,7 @@ type SyncCommitteeContribution struct { func (x *SyncCommitteeContribution) Reset() { *x = SyncCommitteeContribution{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_validator_proto_msgTypes[9] + mi := &file_proto_eth_v2_validator_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -555,7 +445,7 @@ func (x *SyncCommitteeContribution) String() string { func (*SyncCommitteeContribution) ProtoMessage() {} func (x *SyncCommitteeContribution) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_validator_proto_msgTypes[9] + mi := &file_proto_eth_v2_validator_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -568,7 +458,7 @@ func (x *SyncCommitteeContribution) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncCommitteeContribution.ProtoReflect.Descriptor instead. func (*SyncCommitteeContribution) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{9} + return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{7} } func (x *SyncCommitteeContribution) GetSlot() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot { @@ -619,7 +509,7 @@ type ContributionAndProof struct { func (x *ContributionAndProof) Reset() { *x = ContributionAndProof{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_validator_proto_msgTypes[10] + mi := &file_proto_eth_v2_validator_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -632,7 +522,7 @@ func (x *ContributionAndProof) String() string { func (*ContributionAndProof) ProtoMessage() {} func (x *ContributionAndProof) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_validator_proto_msgTypes[10] + mi := &file_proto_eth_v2_validator_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -645,7 +535,7 @@ func (x *ContributionAndProof) ProtoReflect() protoreflect.Message { // Deprecated: Use ContributionAndProof.ProtoReflect.Descriptor instead. func (*ContributionAndProof) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{10} + return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{8} } func (x *ContributionAndProof) GetAggregatorIndex() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex { @@ -681,7 +571,7 @@ type SignedContributionAndProof struct { func (x *SignedContributionAndProof) Reset() { *x = SignedContributionAndProof{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_validator_proto_msgTypes[11] + mi := &file_proto_eth_v2_validator_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -694,7 +584,7 @@ func (x *SignedContributionAndProof) String() string { func (*SignedContributionAndProof) ProtoMessage() {} func (x *SignedContributionAndProof) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_validator_proto_msgTypes[11] + mi := &file_proto_eth_v2_validator_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -707,7 +597,7 @@ func (x *SignedContributionAndProof) ProtoReflect() protoreflect.Message { // Deprecated: Use SignedContributionAndProof.ProtoReflect.Descriptor instead. func (*SignedContributionAndProof) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{11} + return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{9} } func (x *SignedContributionAndProof) GetMessage() *ContributionAndProof { @@ -736,7 +626,7 @@ type GetLivenessRequest struct { func (x *GetLivenessRequest) Reset() { *x = GetLivenessRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_validator_proto_msgTypes[12] + mi := &file_proto_eth_v2_validator_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -749,7 +639,7 @@ func (x *GetLivenessRequest) String() string { func (*GetLivenessRequest) ProtoMessage() {} func (x *GetLivenessRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_validator_proto_msgTypes[12] + mi := &file_proto_eth_v2_validator_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -762,7 +652,7 @@ func (x *GetLivenessRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetLivenessRequest.ProtoReflect.Descriptor instead. func (*GetLivenessRequest) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{12} + return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{10} } func (x *GetLivenessRequest) GetEpoch() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch { @@ -790,7 +680,7 @@ type GetLivenessResponse struct { func (x *GetLivenessResponse) Reset() { *x = GetLivenessResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_validator_proto_msgTypes[13] + mi := &file_proto_eth_v2_validator_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -803,7 +693,7 @@ func (x *GetLivenessResponse) String() string { func (*GetLivenessResponse) ProtoMessage() {} func (x *GetLivenessResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_validator_proto_msgTypes[13] + mi := &file_proto_eth_v2_validator_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -816,7 +706,7 @@ func (x *GetLivenessResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetLivenessResponse.ProtoReflect.Descriptor instead. func (*GetLivenessResponse) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{13} + return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{11} } func (x *GetLivenessResponse) GetData() []*GetLivenessResponse_Liveness { @@ -838,7 +728,7 @@ type GetLivenessResponse_Liveness struct { func (x *GetLivenessResponse_Liveness) Reset() { *x = GetLivenessResponse_Liveness{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_validator_proto_msgTypes[14] + mi := &file_proto_eth_v2_validator_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -851,7 +741,7 @@ func (x *GetLivenessResponse_Liveness) String() string { func (*GetLivenessResponse_Liveness) ProtoMessage() {} func (x *GetLivenessResponse_Liveness) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_validator_proto_msgTypes[14] + mi := &file_proto_eth_v2_validator_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -864,7 +754,7 @@ func (x *GetLivenessResponse_Liveness) ProtoReflect() protoreflect.Message { // Deprecated: Use GetLivenessResponse_Liveness.ProtoReflect.Descriptor instead. func (*GetLivenessResponse_Liveness) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{13, 0} + return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{11, 0} } func (x *GetLivenessResponse_Liveness) GetIndex() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex { @@ -949,139 +839,113 @@ var file_proto_eth_v2_validator_proto_rawDesc = []byte{ 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x22, 0x69, 0x0a, 0x27, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x79, 0x6e, - 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, - 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, - 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x53, 0x75, 0x62, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xb4, - 0x02, 0x0a, 0x19, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, - 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x78, 0x0a, 0x0f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x61, 0x74, 0x61, 0x22, 0xe7, 0x01, 0x0a, 0x27, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x53, + 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, + 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, + 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x73, 0x75, + 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x73, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x32, 0x0a, 0x11, 0x62, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x62, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x6a, 0x0a, + 0x28, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xe7, 0x02, 0x0a, 0x19, 0x53, 0x79, + 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x34, 0x0a, 0x16, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x52, 0x14, 0x73, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x67, 0x0a, 0x0b, - 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x0a, 0x75, 0x6e, 0x74, 0x69, 0x6c, - 0x45, 0x70, 0x6f, 0x63, 0x68, 0x22, 0xe7, 0x01, 0x0a, 0x27, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, - 0x65, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, - 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, - 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x2d, 0x0a, 0x12, - 0x73, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x73, 0x75, 0x62, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x32, 0x0a, 0x11, 0x62, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, - 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x22, - 0x6a, 0x0a, 0x28, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xe7, 0x02, 0x0a, 0x19, - 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, - 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x32, 0x0a, 0x11, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x73, 0x75, 0x62, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x73, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, - 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x66, 0x0a, 0x10, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x3b, 0x82, 0xb5, 0x18, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, 0x74, 0x76, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x31, 0x32, 0x38, 0x8a, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0f, - 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x12, - 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x93, 0x02, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x7a, - 0x0a, 0x10, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, + 0x6f, 0x74, 0x12, 0x32, 0x0a, 0x11, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x73, 0x75, 0x62, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x11, 0x73, 0x75, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x66, 0x0a, 0x10, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x3b, 0x82, 0xb5, 0x18, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, + 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, 0x74, 0x76, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x31, 0x32, 0x38, 0x8a, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0f, 0x61, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x12, 0x24, 0x0a, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x22, 0x93, 0x02, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x7a, 0x0a, 0x10, + 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x4e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, + 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x0f, 0x73, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0e, 0x73, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x83, 0x01, 0x0a, 0x1a, 0x53, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x3f, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, + 0xd9, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x76, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xe5, 0x01, 0x0a, 0x13, + 0x47, 0x65, 0x74, 0x4c, 0x69, 0x76, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x76, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4c, 0x69, 0x76, 0x65, 0x6e, 0x65, 0x73, 0x73, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x8a, 0x01, 0x0a, 0x08, 0x4c, 0x69, 0x76, 0x65, 0x6e, + 0x65, 0x73, 0x73, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, + 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, + 0x5f, 0x6c, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x4c, + 0x69, 0x76, 0x65, 0x42, 0x7f, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x42, 0x0e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x4e, 0x0a, 0x0c, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x0f, 0x73, 0x65, - 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0e, 0x73, 0x65, 0x6c, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x83, 0x01, 0x0a, 0x1a, - 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x3f, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, - 0x6f, 0x66, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x22, 0xd9, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x76, 0x65, 0x6e, 0x65, 0x73, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, - 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, - 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xe5, 0x01, - 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x76, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x76, 0x65, 0x6e, 0x65, 0x73, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4c, 0x69, 0x76, 0x65, 0x6e, 0x65, - 0x73, 0x73, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x8a, 0x01, 0x0a, 0x08, 0x4c, 0x69, 0x76, - 0x65, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x17, 0x0a, 0x07, - 0x69, 0x73, 0x5f, 0x6c, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, - 0x73, 0x4c, 0x69, 0x76, 0x65, 0x42, 0x7f, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x42, 0x0e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x34, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x3b, 0x65, - 0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, - 0x68, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, - 0x45, 0x74, 0x68, 0x5c, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x74, 0x68, + 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, + 0x56, 0x32, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, + 0x68, 0x5c, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1096,43 +960,40 @@ func file_proto_eth_v2_validator_proto_rawDescGZIP() []byte { return file_proto_eth_v2_validator_proto_rawDescData } -var file_proto_eth_v2_validator_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_proto_eth_v2_validator_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_proto_eth_v2_validator_proto_goTypes = []interface{}{ (*SyncCommitteeDutiesRequest)(nil), // 0: ethereum.eth.v2.SyncCommitteeDutiesRequest (*SyncCommitteeDutiesResponse)(nil), // 1: ethereum.eth.v2.SyncCommitteeDutiesResponse (*SyncCommitteeDuty)(nil), // 2: ethereum.eth.v2.SyncCommitteeDuty (*ProduceBlockResponseV2)(nil), // 3: ethereum.eth.v2.ProduceBlockResponseV2 (*ProduceBlindedBlockResponse)(nil), // 4: ethereum.eth.v2.ProduceBlindedBlockResponse - (*SubmitSyncCommitteeSubscriptionsRequest)(nil), // 5: ethereum.eth.v2.SubmitSyncCommitteeSubscriptionsRequest - (*SyncCommitteeSubscription)(nil), // 6: ethereum.eth.v2.SyncCommitteeSubscription - (*ProduceSyncCommitteeContributionRequest)(nil), // 7: ethereum.eth.v2.ProduceSyncCommitteeContributionRequest - (*ProduceSyncCommitteeContributionResponse)(nil), // 8: ethereum.eth.v2.ProduceSyncCommitteeContributionResponse - (*SyncCommitteeContribution)(nil), // 9: ethereum.eth.v2.SyncCommitteeContribution - (*ContributionAndProof)(nil), // 10: ethereum.eth.v2.ContributionAndProof - (*SignedContributionAndProof)(nil), // 11: ethereum.eth.v2.SignedContributionAndProof - (*GetLivenessRequest)(nil), // 12: ethereum.eth.v2.GetLivenessRequest - (*GetLivenessResponse)(nil), // 13: ethereum.eth.v2.GetLivenessResponse - (*GetLivenessResponse_Liveness)(nil), // 14: ethereum.eth.v2.GetLivenessResponse.Liveness - (Version)(0), // 15: ethereum.eth.v2.Version - (*BeaconBlockContainerV2)(nil), // 16: ethereum.eth.v2.BeaconBlockContainerV2 - (*BlindedBeaconBlockContainer)(nil), // 17: ethereum.eth.v2.BlindedBeaconBlockContainer + (*ProduceSyncCommitteeContributionRequest)(nil), // 5: ethereum.eth.v2.ProduceSyncCommitteeContributionRequest + (*ProduceSyncCommitteeContributionResponse)(nil), // 6: ethereum.eth.v2.ProduceSyncCommitteeContributionResponse + (*SyncCommitteeContribution)(nil), // 7: ethereum.eth.v2.SyncCommitteeContribution + (*ContributionAndProof)(nil), // 8: ethereum.eth.v2.ContributionAndProof + (*SignedContributionAndProof)(nil), // 9: ethereum.eth.v2.SignedContributionAndProof + (*GetLivenessRequest)(nil), // 10: ethereum.eth.v2.GetLivenessRequest + (*GetLivenessResponse)(nil), // 11: ethereum.eth.v2.GetLivenessResponse + (*GetLivenessResponse_Liveness)(nil), // 12: ethereum.eth.v2.GetLivenessResponse.Liveness + (Version)(0), // 13: ethereum.eth.v2.Version + (*BeaconBlockContainerV2)(nil), // 14: ethereum.eth.v2.BeaconBlockContainerV2 + (*BlindedBeaconBlockContainer)(nil), // 15: ethereum.eth.v2.BlindedBeaconBlockContainer } var file_proto_eth_v2_validator_proto_depIdxs = []int32{ 2, // 0: ethereum.eth.v2.SyncCommitteeDutiesResponse.data:type_name -> ethereum.eth.v2.SyncCommitteeDuty - 15, // 1: ethereum.eth.v2.ProduceBlockResponseV2.version:type_name -> ethereum.eth.v2.Version - 16, // 2: ethereum.eth.v2.ProduceBlockResponseV2.data:type_name -> ethereum.eth.v2.BeaconBlockContainerV2 - 15, // 3: ethereum.eth.v2.ProduceBlindedBlockResponse.version:type_name -> ethereum.eth.v2.Version - 17, // 4: ethereum.eth.v2.ProduceBlindedBlockResponse.data:type_name -> ethereum.eth.v2.BlindedBeaconBlockContainer - 6, // 5: ethereum.eth.v2.SubmitSyncCommitteeSubscriptionsRequest.data:type_name -> ethereum.eth.v2.SyncCommitteeSubscription - 9, // 6: ethereum.eth.v2.ProduceSyncCommitteeContributionResponse.data:type_name -> ethereum.eth.v2.SyncCommitteeContribution - 9, // 7: ethereum.eth.v2.ContributionAndProof.contribution:type_name -> ethereum.eth.v2.SyncCommitteeContribution - 10, // 8: ethereum.eth.v2.SignedContributionAndProof.message:type_name -> ethereum.eth.v2.ContributionAndProof - 14, // 9: ethereum.eth.v2.GetLivenessResponse.data:type_name -> ethereum.eth.v2.GetLivenessResponse.Liveness - 10, // [10:10] is the sub-list for method output_type - 10, // [10:10] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 13, // 1: ethereum.eth.v2.ProduceBlockResponseV2.version:type_name -> ethereum.eth.v2.Version + 14, // 2: ethereum.eth.v2.ProduceBlockResponseV2.data:type_name -> ethereum.eth.v2.BeaconBlockContainerV2 + 13, // 3: ethereum.eth.v2.ProduceBlindedBlockResponse.version:type_name -> ethereum.eth.v2.Version + 15, // 4: ethereum.eth.v2.ProduceBlindedBlockResponse.data:type_name -> ethereum.eth.v2.BlindedBeaconBlockContainer + 7, // 5: ethereum.eth.v2.ProduceSyncCommitteeContributionResponse.data:type_name -> ethereum.eth.v2.SyncCommitteeContribution + 7, // 6: ethereum.eth.v2.ContributionAndProof.contribution:type_name -> ethereum.eth.v2.SyncCommitteeContribution + 8, // 7: ethereum.eth.v2.SignedContributionAndProof.message:type_name -> ethereum.eth.v2.ContributionAndProof + 12, // 8: ethereum.eth.v2.GetLivenessResponse.data:type_name -> ethereum.eth.v2.GetLivenessResponse.Liveness + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_proto_eth_v2_validator_proto_init() } @@ -1204,30 +1065,6 @@ func file_proto_eth_v2_validator_proto_init() { } } file_proto_eth_v2_validator_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubmitSyncCommitteeSubscriptionsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_eth_v2_validator_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncCommitteeSubscription); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_eth_v2_validator_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ProduceSyncCommitteeContributionRequest); i { case 0: return &v.state @@ -1239,7 +1076,7 @@ func file_proto_eth_v2_validator_proto_init() { return nil } } - file_proto_eth_v2_validator_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_proto_eth_v2_validator_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ProduceSyncCommitteeContributionResponse); i { case 0: return &v.state @@ -1251,7 +1088,7 @@ func file_proto_eth_v2_validator_proto_init() { return nil } } - file_proto_eth_v2_validator_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_proto_eth_v2_validator_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SyncCommitteeContribution); i { case 0: return &v.state @@ -1263,7 +1100,7 @@ func file_proto_eth_v2_validator_proto_init() { return nil } } - file_proto_eth_v2_validator_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_proto_eth_v2_validator_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ContributionAndProof); i { case 0: return &v.state @@ -1275,7 +1112,7 @@ func file_proto_eth_v2_validator_proto_init() { return nil } } - file_proto_eth_v2_validator_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_proto_eth_v2_validator_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignedContributionAndProof); i { case 0: return &v.state @@ -1287,7 +1124,7 @@ func file_proto_eth_v2_validator_proto_init() { return nil } } - file_proto_eth_v2_validator_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_proto_eth_v2_validator_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetLivenessRequest); i { case 0: return &v.state @@ -1299,7 +1136,7 @@ func file_proto_eth_v2_validator_proto_init() { return nil } } - file_proto_eth_v2_validator_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_proto_eth_v2_validator_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetLivenessResponse); i { case 0: return &v.state @@ -1311,7 +1148,7 @@ func file_proto_eth_v2_validator_proto_init() { return nil } } - file_proto_eth_v2_validator_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_proto_eth_v2_validator_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetLivenessResponse_Liveness); i { case 0: return &v.state @@ -1330,7 +1167,7 @@ func file_proto_eth_v2_validator_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_eth_v2_validator_proto_rawDesc, NumEnums: 0, - NumMessages: 15, + NumMessages: 13, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/eth/v2/validator.proto b/proto/eth/v2/validator.proto index 1144b56e76..0dbc118c12 100644 --- a/proto/eth/v2/validator.proto +++ b/proto/eth/v2/validator.proto @@ -60,21 +60,6 @@ message ProduceBlindedBlockResponse { BlindedBeaconBlockContainer data = 2; } -message SubmitSyncCommitteeSubscriptionsRequest { - repeated SyncCommitteeSubscription data = 1; -} - -message SyncCommitteeSubscription { - // The validator index to subscribe for. - uint64 validator_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"]; - - // The sync committee indices to be subscribed to. - repeated uint64 sync_committee_indices = 2; - - // The final epoch (exclusive value) that the specified validator requires the subscription for. - uint64 until_epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Epoch"]; -} - message ProduceSyncCommitteeContributionRequest { // The slot for which a sync committee contribution should be created. uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"]; diff --git a/validator/client/beacon-api/BUILD.bazel b/validator/client/beacon-api/BUILD.bazel index abfcf4be5a..87c0410870 100644 --- a/validator/client/beacon-api/BUILD.bazel +++ b/validator/client/beacon-api/BUILD.bazel @@ -106,7 +106,7 @@ go_test( deps = [ "//api/gateway/apimiddleware:go_default_library", "//beacon-chain/rpc/apimiddleware:go_default_library", - "//beacon-chain/rpc/eth/helpers:go_default_library", + "//beacon-chain/rpc/eth/shared:go_default_library", "//beacon-chain/rpc/prysm/validator:go_default_library", "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", diff --git a/validator/client/beacon-api/beacon_api_helpers_test.go b/validator/client/beacon-api/beacon_api_helpers_test.go index 7e7d1ddf47..3a722641d6 100644 --- a/validator/client/beacon-api/beacon_api_helpers_test.go +++ b/validator/client/beacon-api/beacon_api_helpers_test.go @@ -10,7 +10,7 @@ import ( "github.com/golang/mock/gomock" "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/apimiddleware" - "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/helpers" + "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared" "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v4/testing/assert" "github.com/prysmaticlabs/prysm/v4/testing/require" @@ -326,7 +326,7 @@ func TestGetIsSyncing_Nominal(t *testing.T) { jsonRestHandler := mock.NewMockjsonRestHandler(ctrl) expected := apimiddleware.SyncingResponseJson{ - Data: &helpers.SyncDetailsJson{ + Data: &shared.SyncDetails{ IsSyncing: testCase.isSyncing, }, } diff --git a/validator/client/beacon-api/beacon_api_node_client_test.go b/validator/client/beacon-api/beacon_api_node_client_test.go index 4c00ac5f94..a7f9e807e0 100644 --- a/validator/client/beacon-api/beacon_api_node_client_test.go +++ b/validator/client/beacon-api/beacon_api_node_client_test.go @@ -8,7 +8,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/golang/mock/gomock" "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/apimiddleware" - "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/helpers" + "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared" ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v4/testing/assert" "github.com/prysmaticlabs/prysm/v4/validator/client/beacon-api/mock" @@ -176,7 +176,7 @@ func TestGetSyncStatus(t *testing.T) { { name: "returns false syncing status", restEndpointResponse: apimiddleware.SyncingResponseJson{ - Data: &helpers.SyncDetailsJson{ + Data: &shared.SyncDetails{ IsSyncing: false, }, }, @@ -187,7 +187,7 @@ func TestGetSyncStatus(t *testing.T) { { name: "returns true syncing status", restEndpointResponse: apimiddleware.SyncingResponseJson{ - Data: &helpers.SyncDetailsJson{ + Data: &shared.SyncDetails{ IsSyncing: true, }, }, diff --git a/validator/client/beacon-api/doppelganger_test.go b/validator/client/beacon-api/doppelganger_test.go index 0a0478fd4f..c0db77829c 100644 --- a/validator/client/beacon-api/doppelganger_test.go +++ b/validator/client/beacon-api/doppelganger_test.go @@ -10,7 +10,7 @@ import ( "github.com/golang/mock/gomock" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/apimiddleware" - "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/helpers" + "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared" ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v4/testing/assert" "github.com/prysmaticlabs/prysm/v4/testing/require" @@ -108,7 +108,7 @@ func TestCheckDoppelGanger_Nominal(t *testing.T) { }, }, getSyncingOutput: &apimiddleware.SyncingResponseJson{ - Data: &helpers.SyncDetailsJson{ + Data: &shared.SyncDetails{ IsSyncing: false, }, }, @@ -143,7 +143,7 @@ func TestCheckDoppelGanger_Nominal(t *testing.T) { }, }, getSyncingOutput: &apimiddleware.SyncingResponseJson{ - Data: &helpers.SyncDetailsJson{ + Data: &shared.SyncDetails{ IsSyncing: false, }, }, @@ -189,7 +189,7 @@ func TestCheckDoppelGanger_Nominal(t *testing.T) { }, }, getSyncingOutput: &apimiddleware.SyncingResponseJson{ - Data: &helpers.SyncDetailsJson{ + Data: &shared.SyncDetails{ IsSyncing: false, }, }, @@ -414,7 +414,7 @@ func TestCheckDoppelGanger_Errors(t *testing.T) { } standardGetSyncingOutput := &apimiddleware.SyncingResponseJson{ - Data: &helpers.SyncDetailsJson{ + Data: &shared.SyncDetails{ IsSyncing: false, }, } @@ -494,7 +494,7 @@ func TestCheckDoppelGanger_Errors(t *testing.T) { expectedErrorMessage: "beacon node not synced", inputValidatorRequests: standardInputValidatorRequests, getSyncingOutput: &apimiddleware.SyncingResponseJson{ - Data: &helpers.SyncDetailsJson{ + Data: &shared.SyncDetails{ IsSyncing: true, }, }, diff --git a/validator/client/beacon-api/submit_aggregate_selection_proof_test.go b/validator/client/beacon-api/submit_aggregate_selection_proof_test.go index adfd5a2a4e..1b680f3d96 100644 --- a/validator/client/beacon-api/submit_aggregate_selection_proof_test.go +++ b/validator/client/beacon-api/submit_aggregate_selection_proof_test.go @@ -11,7 +11,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/golang/mock/gomock" "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/apimiddleware" - "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/helpers" + "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared" "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v4/testing/assert" @@ -163,7 +163,7 @@ func TestSubmitAggregateSelectionProof(t *testing.T) { ).SetArg( 2, apimiddleware.SyncingResponseJson{ - Data: &helpers.SyncDetailsJson{ + Data: &shared.SyncDetails{ IsOptimistic: test.isOptimistic, }, },