mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
HTTP Beacon API: /eth/v1/validator/duties (#12810)
* impl * protos * remove apimiddleware from e2e * register endpoint * get epoch from vars * tests * test fixes * remove unused function * GetProposerDuties * proto * fix compilation * register * tests * GetSyncCommitteeDuties * protos * register * tests in progress * complete tests * check altair epoch * more testing * create variable --------- Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
This commit is contained in:
@@ -52,9 +52,6 @@ func (_ *BeaconEndpointFactory) Paths() []string {
|
||||
"/eth/v1/config/fork_schedule",
|
||||
"/eth/v1/config/spec",
|
||||
"/eth/v1/events",
|
||||
"/eth/v1/validator/duties/attester/{epoch}",
|
||||
"/eth/v1/validator/duties/proposer/{epoch}",
|
||||
"/eth/v1/validator/duties/sync/{epoch}",
|
||||
"/eth/v1/validator/blocks/{slot}",
|
||||
"/eth/v2/validator/blocks/{slot}",
|
||||
"/eth/v1/validator/blinded_blocks/{slot}",
|
||||
@@ -179,26 +176,6 @@ func (_ *BeaconEndpointFactory) Create(path string) (*apimiddleware.Endpoint, er
|
||||
endpoint.GetResponse = &SpecResponseJson{}
|
||||
case "/eth/v1/events":
|
||||
endpoint.CustomHandlers = []apimiddleware.CustomHandler{handleEvents}
|
||||
case "/eth/v1/validator/duties/attester/{epoch}":
|
||||
endpoint.PostRequest = &ValidatorIndicesJson{}
|
||||
endpoint.PostResponse = &AttesterDutiesResponseJson{}
|
||||
endpoint.RequestURLLiterals = []string{"epoch"}
|
||||
endpoint.Err = &NodeSyncDetailsErrorJson{}
|
||||
endpoint.Hooks = apimiddleware.HookCollection{
|
||||
OnPreDeserializeRequestBodyIntoContainer: wrapValidatorIndicesArray,
|
||||
}
|
||||
case "/eth/v1/validator/duties/proposer/{epoch}":
|
||||
endpoint.GetResponse = &ProposerDutiesResponseJson{}
|
||||
endpoint.RequestURLLiterals = []string{"epoch"}
|
||||
endpoint.Err = &NodeSyncDetailsErrorJson{}
|
||||
case "/eth/v1/validator/duties/sync/{epoch}":
|
||||
endpoint.PostRequest = &ValidatorIndicesJson{}
|
||||
endpoint.PostResponse = &SyncCommitteeDutiesResponseJson{}
|
||||
endpoint.RequestURLLiterals = []string{"epoch"}
|
||||
endpoint.Err = &NodeSyncDetailsErrorJson{}
|
||||
endpoint.Hooks = apimiddleware.HookCollection{
|
||||
OnPreDeserializeRequestBodyIntoContainer: wrapValidatorIndicesArray,
|
||||
}
|
||||
case "/eth/v1/validator/blocks/{slot}":
|
||||
endpoint.GetResponse = &ProduceBlockResponseJson{}
|
||||
endpoint.RequestURLLiterals = []string{"slot"}
|
||||
|
||||
@@ -211,23 +211,6 @@ type ValidatorIndicesJson struct {
|
||||
Index []string `json:"index"`
|
||||
}
|
||||
|
||||
type AttesterDutiesResponseJson struct {
|
||||
DependentRoot string `json:"dependent_root" hex:"true"`
|
||||
Data []*AttesterDutyJson `json:"data"`
|
||||
ExecutionOptimistic bool `json:"execution_optimistic"`
|
||||
}
|
||||
|
||||
type ProposerDutiesResponseJson struct {
|
||||
DependentRoot string `json:"dependent_root" hex:"true"`
|
||||
Data []*ProposerDutyJson `json:"data"`
|
||||
ExecutionOptimistic bool `json:"execution_optimistic"`
|
||||
}
|
||||
|
||||
type SyncCommitteeDutiesResponseJson struct {
|
||||
Data []*SyncCommitteeDuty `json:"data"`
|
||||
ExecutionOptimistic bool `json:"execution_optimistic"`
|
||||
}
|
||||
|
||||
type ProduceBlockResponseJson struct {
|
||||
Data *BeaconBlockJson `json:"data"`
|
||||
}
|
||||
@@ -1080,28 +1063,6 @@ type DepositContractJson struct {
|
||||
Address string `json:"address"`
|
||||
}
|
||||
|
||||
type AttesterDutyJson struct {
|
||||
Pubkey string `json:"pubkey" hex:"true"`
|
||||
ValidatorIndex string `json:"validator_index"`
|
||||
CommitteeIndex string `json:"committee_index"`
|
||||
CommitteeLength string `json:"committee_length"`
|
||||
CommitteesAtSlot string `json:"committees_at_slot"`
|
||||
ValidatorCommitteeIndex string `json:"validator_committee_index"`
|
||||
Slot string `json:"slot"`
|
||||
}
|
||||
|
||||
type ProposerDutyJson struct {
|
||||
Pubkey string `json:"pubkey" hex:"true"`
|
||||
ValidatorIndex string `json:"validator_index"`
|
||||
Slot string `json:"slot"`
|
||||
}
|
||||
|
||||
type SyncCommitteeDuty struct {
|
||||
Pubkey string `json:"pubkey" hex:"true"`
|
||||
ValidatorIndex string `json:"validator_index"`
|
||||
ValidatorSyncCommitteeIndices []string `json:"validator_sync_committee_indices"`
|
||||
}
|
||||
|
||||
type SignedAggregateAttestationAndProofJson struct {
|
||||
Message *AggregateAttestationAndProofJson `json:"message"`
|
||||
Signature string `json:"signature" hex:"true"`
|
||||
|
||||
@@ -45,6 +45,7 @@ go_library(
|
||||
"@com_github_ethereum_go_ethereum//common:go_default_library",
|
||||
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
|
||||
"@com_github_go_playground_validator_v10//:go_default_library",
|
||||
"@com_github_gorilla_mux//:go_default_library",
|
||||
"@com_github_pkg_errors//:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
"@io_opencensus_go//trace:go_default_library",
|
||||
@@ -99,6 +100,7 @@ go_test(
|
||||
"@com_github_ethereum_go_ethereum//common:go_default_library",
|
||||
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
|
||||
"@com_github_golang_mock//gomock:go_default_library",
|
||||
"@com_github_gorilla_mux//:go_default_library",
|
||||
"@com_github_pkg_errors//:go_default_library",
|
||||
"@com_github_sirupsen_logrus//hooks/test:go_default_library",
|
||||
],
|
||||
|
||||
@@ -7,12 +7,14 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"sort"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/go-playground/validator/v10"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/builder"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/cache"
|
||||
@@ -33,6 +35,8 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/v4/time/slots"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"go.opencensus.io/trace"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// GetAggregateAttestation aggregates all attestations matching the given attestation data root and slot, returning the aggregated result.
|
||||
@@ -630,3 +634,422 @@ func (s *Server) PrepareBeaconProposer(w http.ResponseWriter, r *http.Request) {
|
||||
"validatorIndices": validatorIndices,
|
||||
}).Info("Updated fee recipient addresses")
|
||||
}
|
||||
|
||||
// GetAttesterDuties requests the beacon node to provide a set of attestation duties,
|
||||
// which should be performed by validators, for a particular epoch.
|
||||
func (s *Server) GetAttesterDuties(w http.ResponseWriter, r *http.Request) {
|
||||
ctx, span := trace.StartSpan(r.Context(), "validator.GetAttesterDuties")
|
||||
defer span.End()
|
||||
|
||||
if shared.IsSyncing(ctx, w, s.SyncChecker, s.HeadFetcher, s.TimeFetcher, s.OptimisticModeFetcher) {
|
||||
return
|
||||
}
|
||||
|
||||
rawEpoch := mux.Vars(r)["epoch"]
|
||||
requestedEpochUint, valid := shared.ValidateUint(w, "Epoch", rawEpoch)
|
||||
if !valid {
|
||||
return
|
||||
}
|
||||
requestedEpoch := primitives.Epoch(requestedEpochUint)
|
||||
var req GetAttesterDutiesRequest
|
||||
err := json.NewDecoder(r.Body).Decode(&req.ValidatorIndices)
|
||||
switch {
|
||||
case err == io.EOF:
|
||||
http2.HandleError(w, "No data submitted", http.StatusBadRequest)
|
||||
return
|
||||
case err != nil:
|
||||
http2.HandleError(w, "Could not decode request body: "+err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
if len(req.ValidatorIndices) == 0 {
|
||||
http2.HandleError(w, "No data submitted", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
requestedValIndices := make([]primitives.ValidatorIndex, len(req.ValidatorIndices))
|
||||
for i, ix := range req.ValidatorIndices {
|
||||
valIx, valid := shared.ValidateUint(w, fmt.Sprintf("ValidatorIndices[%d]", i), ix)
|
||||
if !valid {
|
||||
return
|
||||
}
|
||||
requestedValIndices[i] = primitives.ValidatorIndex(valIx)
|
||||
}
|
||||
|
||||
cs := s.TimeFetcher.CurrentSlot()
|
||||
currentEpoch := slots.ToEpoch(cs)
|
||||
nextEpoch := currentEpoch + 1
|
||||
if requestedEpoch > nextEpoch {
|
||||
http2.HandleError(
|
||||
w,
|
||||
fmt.Sprintf("Request epoch %d can not be greater than next epoch %d", requestedEpoch, nextEpoch),
|
||||
http.StatusBadRequest,
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
var startSlot primitives.Slot
|
||||
if requestedEpoch == nextEpoch {
|
||||
startSlot, err = slots.EpochStart(currentEpoch)
|
||||
} else {
|
||||
startSlot, err = slots.EpochStart(requestedEpoch)
|
||||
}
|
||||
if err != nil {
|
||||
http2.HandleError(w, fmt.Sprintf("Could not get start slot from epoch %d: %v", requestedEpoch, err), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
st, err := s.Stater.StateBySlot(ctx, startSlot)
|
||||
if err != nil {
|
||||
http2.HandleError(w, "Could not get state: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
committeeAssignments, _, err := helpers.CommitteeAssignments(ctx, st, requestedEpoch)
|
||||
if err != nil {
|
||||
http2.HandleError(w, "Could not compute committee assignments: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
activeValidatorCount, err := helpers.ActiveValidatorCount(ctx, st, requestedEpoch)
|
||||
if err != nil {
|
||||
http2.HandleError(w, "Could not get active validator count: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
committeesAtSlot := helpers.SlotCommitteeCount(activeValidatorCount)
|
||||
|
||||
duties := make([]*AttesterDuty, 0, len(requestedValIndices))
|
||||
for _, index := range requestedValIndices {
|
||||
pubkey := st.PubkeyAtIndex(index)
|
||||
var zeroPubkey [fieldparams.BLSPubkeyLength]byte
|
||||
if bytes.Equal(pubkey[:], zeroPubkey[:]) {
|
||||
http2.HandleError(w, fmt.Sprintf("Invalid validator index %d", index), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
committee := committeeAssignments[index]
|
||||
if committee == nil {
|
||||
continue
|
||||
}
|
||||
var valIndexInCommittee int
|
||||
// valIndexInCommittee will be 0 in case we don't get a match. This is a potential false positive,
|
||||
// however it's an impossible condition because every validator must be assigned to a committee.
|
||||
for cIndex, vIndex := range committee.Committee {
|
||||
if vIndex == index {
|
||||
valIndexInCommittee = cIndex
|
||||
break
|
||||
}
|
||||
}
|
||||
duties = append(duties, &AttesterDuty{
|
||||
Pubkey: hexutil.Encode(pubkey[:]),
|
||||
ValidatorIndex: strconv.FormatUint(uint64(index), 10),
|
||||
CommitteeIndex: strconv.FormatUint(uint64(committee.CommitteeIndex), 10),
|
||||
CommitteeLength: strconv.Itoa(len(committee.Committee)),
|
||||
CommitteesAtSlot: strconv.FormatUint(committeesAtSlot, 10),
|
||||
ValidatorCommitteeIndex: strconv.Itoa(valIndexInCommittee),
|
||||
Slot: strconv.FormatUint(uint64(committee.AttesterSlot), 10),
|
||||
})
|
||||
}
|
||||
|
||||
dependentRoot, err := attestationDependentRoot(st, requestedEpoch)
|
||||
if err != nil {
|
||||
http2.HandleError(w, "Could not get dependent root: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
isOptimistic, err := s.OptimisticModeFetcher.IsOptimistic(ctx)
|
||||
if err != nil {
|
||||
http2.HandleError(w, "Could not check optimistic status: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
response := &GetAttesterDutiesResponse{
|
||||
DependentRoot: hexutil.Encode(dependentRoot),
|
||||
Data: duties,
|
||||
ExecutionOptimistic: isOptimistic,
|
||||
}
|
||||
http2.WriteJson(w, response)
|
||||
}
|
||||
|
||||
// GetProposerDuties requests beacon node to provide all validators that are scheduled to propose a block in the given epoch.
|
||||
func (s *Server) GetProposerDuties(w http.ResponseWriter, r *http.Request) {
|
||||
ctx, span := trace.StartSpan(r.Context(), "validator.GetProposerDuties")
|
||||
defer span.End()
|
||||
|
||||
if shared.IsSyncing(ctx, w, s.SyncChecker, s.HeadFetcher, s.TimeFetcher, s.OptimisticModeFetcher) {
|
||||
return
|
||||
}
|
||||
|
||||
rawEpoch := mux.Vars(r)["epoch"]
|
||||
requestedEpochUint, valid := shared.ValidateUint(w, "Epoch", rawEpoch)
|
||||
if !valid {
|
||||
return
|
||||
}
|
||||
requestedEpoch := primitives.Epoch(requestedEpochUint)
|
||||
|
||||
cs := s.TimeFetcher.CurrentSlot()
|
||||
currentEpoch := slots.ToEpoch(cs)
|
||||
nextEpoch := currentEpoch + 1
|
||||
var nextEpochLookahead bool
|
||||
if requestedEpoch > nextEpoch {
|
||||
http2.HandleError(
|
||||
w,
|
||||
fmt.Sprintf("Request epoch %d can not be greater than next epoch %d", requestedEpoch, currentEpoch+1),
|
||||
http.StatusBadRequest,
|
||||
)
|
||||
return
|
||||
} else if requestedEpoch == nextEpoch {
|
||||
// If the request is for the next epoch, we use the current epoch's state to compute duties.
|
||||
requestedEpoch = currentEpoch
|
||||
nextEpochLookahead = true
|
||||
}
|
||||
|
||||
epochStartSlot, err := slots.EpochStart(requestedEpoch)
|
||||
if err != nil {
|
||||
http2.HandleError(w, fmt.Sprintf("Could not get start slot of epoch %d: %v", requestedEpoch, err), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
st, err := s.Stater.StateBySlot(ctx, epochStartSlot)
|
||||
if err != nil {
|
||||
http2.HandleError(w, fmt.Sprintf("Could not get state for slot %d: %v ", epochStartSlot, err), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
var proposals map[primitives.ValidatorIndex][]primitives.Slot
|
||||
if nextEpochLookahead {
|
||||
_, proposals, err = helpers.CommitteeAssignments(ctx, st, nextEpoch)
|
||||
} else {
|
||||
_, proposals, err = helpers.CommitteeAssignments(ctx, st, requestedEpoch)
|
||||
}
|
||||
if err != nil {
|
||||
http2.HandleError(w, "Could not compute committee assignments: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
duties := make([]*ProposerDuty, 0)
|
||||
for index, proposalSlots := range proposals {
|
||||
val, err := st.ValidatorAtIndexReadOnly(index)
|
||||
if err != nil {
|
||||
http2.HandleError(w, fmt.Sprintf("Could not get validator at index %d: %v", index, err), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
pubkey48 := val.PublicKey()
|
||||
pubkey := pubkey48[:]
|
||||
for _, slot := range proposalSlots {
|
||||
s.ProposerSlotIndexCache.SetProposerAndPayloadIDs(slot, index, [8]byte{} /* payloadID */, [32]byte{} /* head root */)
|
||||
duties = append(duties, &ProposerDuty{
|
||||
Pubkey: hexutil.Encode(pubkey),
|
||||
ValidatorIndex: strconv.FormatUint(uint64(index), 10),
|
||||
Slot: strconv.FormatUint(uint64(slot), 10),
|
||||
})
|
||||
}
|
||||
}
|
||||
sort.Slice(duties, func(i, j int) bool {
|
||||
return duties[i].Slot < duties[j].Slot
|
||||
})
|
||||
|
||||
s.ProposerSlotIndexCache.PrunePayloadIDs(epochStartSlot)
|
||||
|
||||
dependentRoot, err := proposalDependentRoot(st, requestedEpoch)
|
||||
if err != nil {
|
||||
http2.HandleError(w, "Could not get dependent root: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
isOptimistic, err := s.OptimisticModeFetcher.IsOptimistic(ctx)
|
||||
if err != nil {
|
||||
http2.HandleError(w, "Could not check optimistic status: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
resp := &GetProposerDutiesResponse{
|
||||
DependentRoot: hexutil.Encode(dependentRoot),
|
||||
Data: duties,
|
||||
ExecutionOptimistic: isOptimistic,
|
||||
}
|
||||
http2.WriteJson(w, resp)
|
||||
}
|
||||
|
||||
// GetSyncCommitteeDuties provides a set of sync committee duties for a particular epoch.
|
||||
//
|
||||
// The logic for calculating epoch validity comes from https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Validator/getSyncCommitteeDuties
|
||||
// where `epoch` is described as `epoch // EPOCHS_PER_SYNC_COMMITTEE_PERIOD <= current_epoch // EPOCHS_PER_SYNC_COMMITTEE_PERIOD + 1`.
|
||||
//
|
||||
// Algorithm:
|
||||
// - Get the last valid epoch. This is the last epoch of the next sync committee period.
|
||||
// - Get the state for the requested epoch. If it's a future epoch from the current sync committee period
|
||||
// or an epoch from the next sync committee period, then get the current state.
|
||||
// - Get the state's current sync committee. If it's an epoch from the next sync committee period, then get the next sync committee.
|
||||
// - Get duties.
|
||||
func (s *Server) GetSyncCommitteeDuties(w http.ResponseWriter, r *http.Request) {
|
||||
ctx, span := trace.StartSpan(r.Context(), "validator.GetSyncCommitteeDuties")
|
||||
defer span.End()
|
||||
|
||||
if shared.IsSyncing(ctx, w, s.SyncChecker, s.HeadFetcher, s.TimeFetcher, s.OptimisticModeFetcher) {
|
||||
return
|
||||
}
|
||||
|
||||
rawEpoch := mux.Vars(r)["epoch"]
|
||||
requestedEpochUint, valid := shared.ValidateUint(w, "Epoch", rawEpoch)
|
||||
if !valid {
|
||||
return
|
||||
}
|
||||
requestedEpoch := primitives.Epoch(requestedEpochUint)
|
||||
if requestedEpoch < params.BeaconConfig().AltairForkEpoch {
|
||||
http2.HandleError(w, "Sync committees are not supported for Phase0", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
var req GetSyncCommitteeDutiesRequest
|
||||
err := json.NewDecoder(r.Body).Decode(&req.ValidatorIndices)
|
||||
switch {
|
||||
case err == io.EOF:
|
||||
http2.HandleError(w, "No data submitted", http.StatusBadRequest)
|
||||
return
|
||||
case err != nil:
|
||||
http2.HandleError(w, "Could not decode request body: "+err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
if len(req.ValidatorIndices) == 0 {
|
||||
http2.HandleError(w, "No data submitted", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
requestedValIndices := make([]primitives.ValidatorIndex, len(req.ValidatorIndices))
|
||||
for i, ix := range req.ValidatorIndices {
|
||||
valIx, valid := shared.ValidateUint(w, fmt.Sprintf("ValidatorIndices[%d]", i), ix)
|
||||
if !valid {
|
||||
return
|
||||
}
|
||||
requestedValIndices[i] = primitives.ValidatorIndex(valIx)
|
||||
}
|
||||
|
||||
currentEpoch := slots.ToEpoch(s.TimeFetcher.CurrentSlot())
|
||||
lastValidEpoch := syncCommitteeDutiesLastValidEpoch(currentEpoch)
|
||||
if requestedEpoch > lastValidEpoch {
|
||||
http2.HandleError(w, fmt.Sprintf("Epoch is too far in the future, maximum valid epoch is %d", lastValidEpoch), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
startingEpoch := requestedEpoch
|
||||
if startingEpoch > currentEpoch {
|
||||
startingEpoch = currentEpoch
|
||||
}
|
||||
slot, err := slots.EpochStart(startingEpoch)
|
||||
if err != nil {
|
||||
http2.HandleError(w, "Could not get sync committee slot: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
st, err := s.Stater.State(ctx, []byte(strconv.FormatUint(uint64(slot), 10)))
|
||||
if err != nil {
|
||||
http2.HandleError(w, "Could not get sync committee state: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
currentSyncCommitteeFirstEpoch, err := slots.SyncCommitteePeriodStartEpoch(startingEpoch)
|
||||
if err != nil {
|
||||
http2.HandleError(w, "Could not get sync committee period start epoch: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
nextSyncCommitteeFirstEpoch := currentSyncCommitteeFirstEpoch + params.BeaconConfig().EpochsPerSyncCommitteePeriod
|
||||
var committee *ethpbalpha.SyncCommittee
|
||||
if requestedEpoch >= nextSyncCommitteeFirstEpoch {
|
||||
committee, err = st.NextSyncCommittee()
|
||||
if err != nil {
|
||||
http2.HandleError(w, "Could not get sync committee: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
committee, err = st.CurrentSyncCommittee()
|
||||
if err != nil {
|
||||
http2.HandleError(w, "Could not get sync committee: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
}
|
||||
committeePubkeys := make(map[[fieldparams.BLSPubkeyLength]byte][]string)
|
||||
for j, pubkey := range committee.Pubkeys {
|
||||
pubkey48 := bytesutil.ToBytes48(pubkey)
|
||||
committeePubkeys[pubkey48] = append(committeePubkeys[pubkey48], strconv.FormatUint(uint64(j), 10))
|
||||
}
|
||||
duties, err := syncCommitteeDuties(requestedValIndices, st, committeePubkeys)
|
||||
if err != nil {
|
||||
http2.HandleError(w, err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
isOptimistic, err := s.OptimisticModeFetcher.IsOptimistic(ctx)
|
||||
if err != nil {
|
||||
http2.HandleError(w, "Could not check optimistic status: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
resp := &GetSyncCommitteeDutiesResponse{
|
||||
Data: duties,
|
||||
ExecutionOptimistic: isOptimistic,
|
||||
}
|
||||
http2.WriteJson(w, resp)
|
||||
}
|
||||
|
||||
// attestationDependentRoot is get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch - 1) - 1)
|
||||
// or the genesis block root in the case of underflow.
|
||||
func attestationDependentRoot(s state.BeaconState, epoch primitives.Epoch) ([]byte, error) {
|
||||
var dependentRootSlot primitives.Slot
|
||||
if epoch <= 1 {
|
||||
dependentRootSlot = 0
|
||||
} else {
|
||||
prevEpochStartSlot, err := slots.EpochStart(epoch.Sub(1))
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not obtain epoch's start slot: %v", err)
|
||||
}
|
||||
dependentRootSlot = prevEpochStartSlot.Sub(1)
|
||||
}
|
||||
root, err := helpers.BlockRootAtSlot(s, dependentRootSlot)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not get block root")
|
||||
}
|
||||
return root, nil
|
||||
}
|
||||
|
||||
// proposalDependentRoot is get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch) - 1)
|
||||
// or the genesis block root in the case of underflow.
|
||||
func proposalDependentRoot(s state.BeaconState, epoch primitives.Epoch) ([]byte, error) {
|
||||
var dependentRootSlot primitives.Slot
|
||||
if epoch == 0 {
|
||||
dependentRootSlot = 0
|
||||
} else {
|
||||
epochStartSlot, err := slots.EpochStart(epoch)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not obtain epoch's start slot: %v", err)
|
||||
}
|
||||
dependentRootSlot = epochStartSlot.Sub(1)
|
||||
}
|
||||
root, err := helpers.BlockRootAtSlot(s, dependentRootSlot)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not get block root")
|
||||
}
|
||||
return root, nil
|
||||
}
|
||||
|
||||
func syncCommitteeDutiesLastValidEpoch(currentEpoch primitives.Epoch) primitives.Epoch {
|
||||
currentSyncPeriodIndex := currentEpoch / params.BeaconConfig().EpochsPerSyncCommitteePeriod
|
||||
// Return the last epoch of the next sync committee.
|
||||
// To do this we go two periods ahead to find the first invalid epoch, and then subtract 1.
|
||||
return (currentSyncPeriodIndex+2)*params.BeaconConfig().EpochsPerSyncCommitteePeriod - 1
|
||||
}
|
||||
|
||||
func syncCommitteeDuties(
|
||||
valIndices []primitives.ValidatorIndex,
|
||||
st state.BeaconState,
|
||||
committeePubkeys map[[fieldparams.BLSPubkeyLength]byte][]string,
|
||||
) ([]*SyncCommitteeDuty, error) {
|
||||
duties := make([]*SyncCommitteeDuty, 0)
|
||||
for _, index := range valIndices {
|
||||
duty := &SyncCommitteeDuty{
|
||||
ValidatorIndex: strconv.FormatUint(uint64(index), 10),
|
||||
}
|
||||
valPubkey := st.PubkeyAtIndex(index)
|
||||
var zeroPubkey [fieldparams.BLSPubkeyLength]byte
|
||||
if bytes.Equal(valPubkey[:], zeroPubkey[:]) {
|
||||
return nil, errors.Errorf("Invalid validator index %d", index)
|
||||
}
|
||||
duty.Pubkey = hexutil.Encode(valPubkey[:])
|
||||
indices, ok := committeePubkeys[valPubkey]
|
||||
if ok {
|
||||
duty.ValidatorSyncCommitteeIndices = indices
|
||||
duties = append(duties, duty)
|
||||
}
|
||||
}
|
||||
return duties, nil
|
||||
}
|
||||
|
||||
@@ -15,10 +15,12 @@ import (
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/pkg/errors"
|
||||
mockChain "github.com/prysmaticlabs/prysm/v4/beacon-chain/blockchain/testing"
|
||||
builderTest "github.com/prysmaticlabs/prysm/v4/beacon-chain/builder/testing"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/cache"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/core/helpers"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/core/transition"
|
||||
dbutil "github.com/prysmaticlabs/prysm/v4/beacon-chain/db/testing"
|
||||
doublylinkedtree "github.com/prysmaticlabs/prysm/v4/beacon-chain/forkchoice/doubly-linked-tree"
|
||||
@@ -27,6 +29,8 @@ import (
|
||||
p2pmock "github.com/prysmaticlabs/prysm/v4/beacon-chain/p2p/testing"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/core"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/testutil"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/state"
|
||||
state_native "github.com/prysmaticlabs/prysm/v4/beacon-chain/state/state-native"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/state/stategen"
|
||||
mockSync "github.com/prysmaticlabs/prysm/v4/beacon-chain/sync/initial-sync/testing"
|
||||
@@ -1528,6 +1532,872 @@ func TestServer_RegisterValidator(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetAttesterDuties(t *testing.T) {
|
||||
helpers.ClearCache()
|
||||
|
||||
genesis := util.NewBeaconBlock()
|
||||
depChainStart := params.BeaconConfig().MinGenesisActiveValidatorCount
|
||||
deposits, _, err := util.DeterministicDepositsAndKeys(depChainStart)
|
||||
require.NoError(t, err)
|
||||
eth1Data, err := util.DeterministicEth1Data(len(deposits))
|
||||
require.NoError(t, err)
|
||||
bs, err := transition.GenesisBeaconState(context.Background(), deposits, 0, eth1Data)
|
||||
require.NoError(t, err, "Could not set up genesis state")
|
||||
// Set state to non-epoch start slot.
|
||||
require.NoError(t, bs.SetSlot(5))
|
||||
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))
|
||||
|
||||
// Deactivate last validator.
|
||||
vals := bs.Validators()
|
||||
vals[len(vals)-1].ExitEpoch = 0
|
||||
require.NoError(t, bs.SetValidators(vals))
|
||||
|
||||
pubKeys := make([][]byte, len(deposits))
|
||||
for i := 0; i < len(deposits); i++ {
|
||||
pubKeys[i] = deposits[i].Data.PublicKey
|
||||
}
|
||||
|
||||
// nextEpochState must not be used for committee calculations when requesting next epoch
|
||||
nextEpochState := bs.Copy()
|
||||
require.NoError(t, nextEpochState.SetSlot(params.BeaconConfig().SlotsPerEpoch))
|
||||
require.NoError(t, nextEpochState.SetValidators(vals[:512]))
|
||||
|
||||
chainSlot := primitives.Slot(0)
|
||||
chain := &mockChain.ChainService{
|
||||
State: bs, Root: genesisRoot[:], Slot: &chainSlot,
|
||||
}
|
||||
s := &Server{
|
||||
Stater: &testutil.MockStater{
|
||||
StatesBySlot: map[primitives.Slot]state.BeaconState{
|
||||
0: bs,
|
||||
params.BeaconConfig().SlotsPerEpoch: nextEpochState,
|
||||
},
|
||||
},
|
||||
TimeFetcher: chain,
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
OptimisticModeFetcher: chain,
|
||||
}
|
||||
|
||||
t.Run("single validator", func(t *testing.T) {
|
||||
var body bytes.Buffer
|
||||
_, err = body.WriteString("[\"0\"]")
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetAttesterDuties(writer, request)
|
||||
assert.Equal(t, http.StatusOK, writer.Code)
|
||||
resp := &GetAttesterDutiesResponse{}
|
||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp))
|
||||
assert.Equal(t, hexutil.Encode(genesisRoot[:]), resp.DependentRoot)
|
||||
require.Equal(t, 1, len(resp.Data))
|
||||
duty := resp.Data[0]
|
||||
assert.Equal(t, "1", duty.CommitteeIndex)
|
||||
assert.Equal(t, "0", duty.Slot)
|
||||
assert.Equal(t, "0", duty.ValidatorIndex)
|
||||
assert.Equal(t, hexutil.Encode(pubKeys[0]), duty.Pubkey)
|
||||
assert.Equal(t, "171", duty.CommitteeLength)
|
||||
assert.Equal(t, "3", duty.CommitteesAtSlot)
|
||||
assert.Equal(t, "80", duty.ValidatorCommitteeIndex)
|
||||
})
|
||||
t.Run("multiple validators", func(t *testing.T) {
|
||||
var body bytes.Buffer
|
||||
_, err = body.WriteString("[\"0\",\"1\"]")
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetAttesterDuties(writer, request)
|
||||
assert.Equal(t, http.StatusOK, writer.Code)
|
||||
resp := &GetAttesterDutiesResponse{}
|
||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp))
|
||||
require.Equal(t, 2, len(resp.Data))
|
||||
})
|
||||
t.Run("no body", func(t *testing.T) {
|
||||
request := httptest.NewRequest(http.MethodPost, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", nil)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetAttesterDuties(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.StringContains(t, "No data submitted", e.Message)
|
||||
})
|
||||
t.Run("empty", func(t *testing.T) {
|
||||
var body bytes.Buffer
|
||||
_, err := body.WriteString("[]")
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodPost, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetAttesterDuties(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.StringContains(t, "No data submitted", e.Message)
|
||||
})
|
||||
t.Run("invalid", func(t *testing.T) {
|
||||
var body bytes.Buffer
|
||||
_, err := body.WriteString("[\"foo\"]")
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodPost, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetAttesterDuties(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("next epoch", func(t *testing.T) {
|
||||
var body bytes.Buffer
|
||||
_, err = body.WriteString("[\"0\"]")
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": strconv.FormatUint(uint64(slots.ToEpoch(bs.Slot())+1), 10)})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetAttesterDuties(writer, request)
|
||||
assert.Equal(t, http.StatusOK, writer.Code)
|
||||
resp := &GetAttesterDutiesResponse{}
|
||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp))
|
||||
assert.Equal(t, hexutil.Encode(genesisRoot[:]), resp.DependentRoot)
|
||||
require.Equal(t, 1, len(resp.Data))
|
||||
duty := resp.Data[0]
|
||||
assert.Equal(t, "0", duty.CommitteeIndex)
|
||||
assert.Equal(t, "62", duty.Slot)
|
||||
assert.Equal(t, "0", duty.ValidatorIndex)
|
||||
assert.Equal(t, hexutil.Encode(pubKeys[0]), duty.Pubkey)
|
||||
assert.Equal(t, "170", duty.CommitteeLength)
|
||||
assert.Equal(t, "3", duty.CommitteesAtSlot)
|
||||
assert.Equal(t, "110", duty.ValidatorCommitteeIndex)
|
||||
})
|
||||
t.Run("epoch out of bounds", func(t *testing.T) {
|
||||
var body bytes.Buffer
|
||||
_, err = body.WriteString("[\"0\"]")
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", &body)
|
||||
currentEpoch := slots.ToEpoch(bs.Slot())
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": strconv.FormatUint(uint64(currentEpoch+2), 10)})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetAttesterDuties(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, fmt.Sprintf("Request epoch %d can not be greater than next epoch %d", currentEpoch+2, currentEpoch+1)))
|
||||
})
|
||||
t.Run("validator index out of bounds", func(t *testing.T) {
|
||||
var body bytes.Buffer
|
||||
_, err = body.WriteString(fmt.Sprintf("[\"%d\"]", len(pubKeys)))
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetAttesterDuties(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, fmt.Sprintf("Invalid validator index %d", len(pubKeys))))
|
||||
})
|
||||
t.Run("inactive validator - no duties", func(t *testing.T) {
|
||||
var body bytes.Buffer
|
||||
_, err = body.WriteString(fmt.Sprintf("[\"%d\"]", len(pubKeys)-1))
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetAttesterDuties(writer, request)
|
||||
assert.Equal(t, http.StatusOK, writer.Code)
|
||||
resp := &GetAttesterDutiesResponse{}
|
||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp))
|
||||
require.Equal(t, 0, len(resp.Data))
|
||||
})
|
||||
t.Run("execution optimistic", func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
parentRoot := [32]byte{'a'}
|
||||
blk := util.NewBeaconBlock()
|
||||
blk.Block.ParentRoot = parentRoot[:]
|
||||
blk.Block.Slot = 31
|
||||
root, err := blk.Block.HashTreeRoot()
|
||||
require.NoError(t, err)
|
||||
db := dbutil.SetupDB(t)
|
||||
util.SaveBlock(t, ctx, db, blk)
|
||||
require.NoError(t, db.SaveGenesisBlockRoot(ctx, root))
|
||||
|
||||
chainSlot := primitives.Slot(0)
|
||||
chain := &mockChain.ChainService{
|
||||
State: bs, Root: genesisRoot[:], Slot: &chainSlot, Optimistic: true,
|
||||
}
|
||||
s := &Server{
|
||||
Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{0: bs}},
|
||||
TimeFetcher: chain,
|
||||
OptimisticModeFetcher: chain,
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
}
|
||||
|
||||
var body bytes.Buffer
|
||||
_, err = body.WriteString("[\"0\"]")
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetAttesterDuties(writer, request)
|
||||
require.Equal(t, http.StatusOK, writer.Code)
|
||||
resp := &GetAttesterDutiesResponse{}
|
||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp))
|
||||
assert.Equal(t, true, resp.ExecutionOptimistic)
|
||||
})
|
||||
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.MethodGet, "http://www.example.com/eth/v1/validator/duties/attester/{epoch}", nil)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetAttesterDuties(writer, request)
|
||||
require.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)
|
||||
})
|
||||
}
|
||||
|
||||
func TestGetProposerDuties(t *testing.T) {
|
||||
helpers.ClearCache()
|
||||
|
||||
genesis := util.NewBeaconBlock()
|
||||
depChainStart := params.BeaconConfig().MinGenesisActiveValidatorCount
|
||||
deposits, _, err := util.DeterministicDepositsAndKeys(depChainStart)
|
||||
require.NoError(t, err)
|
||||
eth1Data, err := util.DeterministicEth1Data(len(deposits))
|
||||
require.NoError(t, err)
|
||||
genesisRoot, err := genesis.Block.HashTreeRoot()
|
||||
require.NoError(t, err)
|
||||
roots := make([][]byte, fieldparams.BlockRootsLength)
|
||||
roots[0] = genesisRoot[:]
|
||||
// We DON'T WANT this root to be returned when testing the next epoch
|
||||
roots[31] = []byte("next_epoch_dependent_root")
|
||||
|
||||
pubKeys := make([][]byte, len(deposits))
|
||||
for i := 0; i < len(deposits); i++ {
|
||||
pubKeys[i] = deposits[i].Data.PublicKey
|
||||
}
|
||||
|
||||
t.Run("ok", func(t *testing.T) {
|
||||
bs, err := transition.GenesisBeaconState(context.Background(), deposits, 0, eth1Data)
|
||||
require.NoError(t, err, "Could not set up genesis state")
|
||||
require.NoError(t, bs.SetSlot(params.BeaconConfig().SlotsPerEpoch))
|
||||
require.NoError(t, bs.SetBlockRoots(roots))
|
||||
chainSlot := primitives.Slot(0)
|
||||
chain := &mockChain.ChainService{
|
||||
State: bs, Root: genesisRoot[:], Slot: &chainSlot,
|
||||
}
|
||||
s := &Server{
|
||||
Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{0: bs}},
|
||||
HeadFetcher: chain,
|
||||
TimeFetcher: chain,
|
||||
OptimisticModeFetcher: chain,
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
ProposerSlotIndexCache: cache.NewProposerPayloadIDsCache(),
|
||||
}
|
||||
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/proposer/{epoch}", nil)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetProposerDuties(writer, request)
|
||||
assert.Equal(t, http.StatusOK, writer.Code)
|
||||
resp := &GetProposerDutiesResponse{}
|
||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp))
|
||||
assert.Equal(t, hexutil.Encode(genesisRoot[:]), resp.DependentRoot)
|
||||
assert.Equal(t, 31, len(resp.Data))
|
||||
// We expect a proposer duty for slot 11.
|
||||
var expectedDuty *ProposerDuty
|
||||
for _, duty := range resp.Data {
|
||||
if duty.Slot == "11" {
|
||||
expectedDuty = duty
|
||||
}
|
||||
}
|
||||
vid, _, has := s.ProposerSlotIndexCache.GetProposerPayloadIDs(11, [32]byte{})
|
||||
require.Equal(t, true, has)
|
||||
require.Equal(t, primitives.ValidatorIndex(12289), vid)
|
||||
require.NotNil(t, expectedDuty, "Expected duty for slot 11 not found")
|
||||
assert.Equal(t, "12289", expectedDuty.ValidatorIndex)
|
||||
assert.Equal(t, hexutil.Encode(pubKeys[12289]), expectedDuty.Pubkey)
|
||||
})
|
||||
t.Run("next epoch", func(t *testing.T) {
|
||||
bs, err := transition.GenesisBeaconState(context.Background(), deposits, 0, eth1Data)
|
||||
require.NoError(t, err, "Could not set up genesis state")
|
||||
require.NoError(t, bs.SetBlockRoots(roots))
|
||||
chainSlot := primitives.Slot(0)
|
||||
chain := &mockChain.ChainService{
|
||||
State: bs, Root: genesisRoot[:], Slot: &chainSlot,
|
||||
}
|
||||
s := &Server{
|
||||
Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{0: bs}},
|
||||
HeadFetcher: chain,
|
||||
TimeFetcher: chain,
|
||||
OptimisticModeFetcher: chain,
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
ProposerSlotIndexCache: cache.NewProposerPayloadIDsCache(),
|
||||
}
|
||||
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/proposer/{epoch}", nil)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "1"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetProposerDuties(writer, request)
|
||||
assert.Equal(t, http.StatusOK, writer.Code)
|
||||
resp := &GetProposerDutiesResponse{}
|
||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp))
|
||||
assert.Equal(t, hexutil.Encode(genesisRoot[:]), resp.DependentRoot)
|
||||
assert.Equal(t, 32, len(resp.Data))
|
||||
// We expect a proposer duty for slot 43.
|
||||
var expectedDuty *ProposerDuty
|
||||
for _, duty := range resp.Data {
|
||||
if duty.Slot == "43" {
|
||||
expectedDuty = duty
|
||||
}
|
||||
}
|
||||
vid, _, has := s.ProposerSlotIndexCache.GetProposerPayloadIDs(43, [32]byte{})
|
||||
require.Equal(t, true, has)
|
||||
require.Equal(t, primitives.ValidatorIndex(1360), vid)
|
||||
require.NotNil(t, expectedDuty, "Expected duty for slot 43 not found")
|
||||
assert.Equal(t, "1360", expectedDuty.ValidatorIndex)
|
||||
assert.Equal(t, hexutil.Encode(pubKeys[1360]), expectedDuty.Pubkey)
|
||||
})
|
||||
t.Run("prune payload ID cache", func(t *testing.T) {
|
||||
bs, err := transition.GenesisBeaconState(context.Background(), deposits, 0, eth1Data)
|
||||
require.NoError(t, err, "Could not set up genesis state")
|
||||
require.NoError(t, bs.SetSlot(params.BeaconConfig().SlotsPerEpoch))
|
||||
require.NoError(t, bs.SetBlockRoots(roots))
|
||||
chainSlot := params.BeaconConfig().SlotsPerEpoch
|
||||
chain := &mockChain.ChainService{
|
||||
State: bs, Root: genesisRoot[:], Slot: &chainSlot,
|
||||
}
|
||||
s := &Server{
|
||||
Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{params.BeaconConfig().SlotsPerEpoch: bs}},
|
||||
HeadFetcher: chain,
|
||||
TimeFetcher: chain,
|
||||
OptimisticModeFetcher: chain,
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
ProposerSlotIndexCache: cache.NewProposerPayloadIDsCache(),
|
||||
}
|
||||
|
||||
s.ProposerSlotIndexCache.SetProposerAndPayloadIDs(1, 1, [8]byte{1}, [32]byte{2})
|
||||
s.ProposerSlotIndexCache.SetProposerAndPayloadIDs(31, 2, [8]byte{2}, [32]byte{3})
|
||||
s.ProposerSlotIndexCache.SetProposerAndPayloadIDs(32, 4309, [8]byte{3}, [32]byte{4})
|
||||
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/proposer/{epoch}", nil)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "1"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetProposerDuties(writer, request)
|
||||
assert.Equal(t, http.StatusOK, writer.Code)
|
||||
vid, _, has := s.ProposerSlotIndexCache.GetProposerPayloadIDs(1, [32]byte{})
|
||||
require.Equal(t, false, has)
|
||||
require.Equal(t, primitives.ValidatorIndex(0), vid)
|
||||
vid, _, has = s.ProposerSlotIndexCache.GetProposerPayloadIDs(2, [32]byte{})
|
||||
require.Equal(t, false, has)
|
||||
require.Equal(t, primitives.ValidatorIndex(0), vid)
|
||||
vid, _, has = s.ProposerSlotIndexCache.GetProposerPayloadIDs(32, [32]byte{})
|
||||
require.Equal(t, true, has)
|
||||
require.Equal(t, primitives.ValidatorIndex(10565), vid)
|
||||
})
|
||||
t.Run("epoch out of bounds", func(t *testing.T) {
|
||||
bs, err := transition.GenesisBeaconState(context.Background(), deposits, 0, eth1Data)
|
||||
require.NoError(t, err, "Could not set up genesis state")
|
||||
// Set state to non-epoch start slot.
|
||||
require.NoError(t, bs.SetSlot(5))
|
||||
require.NoError(t, bs.SetBlockRoots(roots))
|
||||
chainSlot := primitives.Slot(0)
|
||||
chain := &mockChain.ChainService{
|
||||
State: bs, Root: genesisRoot[:], Slot: &chainSlot,
|
||||
}
|
||||
s := &Server{
|
||||
Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{0: bs}},
|
||||
HeadFetcher: chain,
|
||||
TimeFetcher: chain,
|
||||
OptimisticModeFetcher: chain,
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
ProposerSlotIndexCache: cache.NewProposerPayloadIDsCache(),
|
||||
}
|
||||
|
||||
currentEpoch := slots.ToEpoch(bs.Slot())
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/proposer/{epoch}", nil)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": strconv.FormatUint(uint64(currentEpoch+2), 10)})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetProposerDuties(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.StringContains(t, fmt.Sprintf("Request epoch %d can not be greater than next epoch %d", currentEpoch+2, currentEpoch+1), e.Message)
|
||||
})
|
||||
t.Run("execution optimistic", func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
bs, err := transition.GenesisBeaconState(context.Background(), deposits, 0, eth1Data)
|
||||
require.NoError(t, err, "Could not set up genesis state")
|
||||
// Set state to non-epoch start slot.
|
||||
require.NoError(t, bs.SetSlot(5))
|
||||
require.NoError(t, bs.SetBlockRoots(roots))
|
||||
parentRoot := [32]byte{'a'}
|
||||
blk := util.NewBeaconBlock()
|
||||
blk.Block.ParentRoot = parentRoot[:]
|
||||
blk.Block.Slot = 31
|
||||
root, err := blk.Block.HashTreeRoot()
|
||||
require.NoError(t, err)
|
||||
db := dbutil.SetupDB(t)
|
||||
util.SaveBlock(t, ctx, db, blk)
|
||||
require.NoError(t, db.SaveGenesisBlockRoot(ctx, root))
|
||||
|
||||
chainSlot := primitives.Slot(0)
|
||||
chain := &mockChain.ChainService{
|
||||
State: bs, Root: genesisRoot[:], Slot: &chainSlot, Optimistic: true,
|
||||
}
|
||||
s := &Server{
|
||||
Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{0: bs}},
|
||||
HeadFetcher: chain,
|
||||
TimeFetcher: chain,
|
||||
OptimisticModeFetcher: chain,
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
ProposerSlotIndexCache: cache.NewProposerPayloadIDsCache(),
|
||||
}
|
||||
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/proposer/{epoch}", nil)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetProposerDuties(writer, request)
|
||||
assert.Equal(t, http.StatusOK, writer.Code)
|
||||
resp := &GetProposerDutiesResponse{}
|
||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp))
|
||||
assert.Equal(t, true, resp.ExecutionOptimistic)
|
||||
})
|
||||
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.MethodGet, "http://www.example.com/eth/v1/validator/duties/proposer/{epoch}", nil)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetProposerDuties(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)
|
||||
})
|
||||
}
|
||||
|
||||
func TestGetSyncCommitteeDuties(t *testing.T) {
|
||||
helpers.ClearCache()
|
||||
params.SetupTestConfigCleanup(t)
|
||||
cfg := params.BeaconConfig()
|
||||
cfg.AltairForkEpoch = 0
|
||||
params.OverrideBeaconConfig(cfg)
|
||||
|
||||
genesisTime := time.Now()
|
||||
numVals := uint64(11)
|
||||
st, _ := util.DeterministicGenesisStateAltair(t, numVals)
|
||||
require.NoError(t, st.SetGenesisTime(uint64(genesisTime.Unix())))
|
||||
vals := st.Validators()
|
||||
currCommittee := ðpbalpha.SyncCommittee{}
|
||||
for i := 0; i < 5; i++ {
|
||||
currCommittee.Pubkeys = append(currCommittee.Pubkeys, vals[i].PublicKey)
|
||||
currCommittee.AggregatePubkey = make([]byte, 48)
|
||||
}
|
||||
// add one public key twice - this is needed for one of the test cases
|
||||
currCommittee.Pubkeys = append(currCommittee.Pubkeys, vals[0].PublicKey)
|
||||
require.NoError(t, st.SetCurrentSyncCommittee(currCommittee))
|
||||
nextCommittee := ðpbalpha.SyncCommittee{}
|
||||
for i := 5; i < 10; i++ {
|
||||
nextCommittee.Pubkeys = append(nextCommittee.Pubkeys, vals[i].PublicKey)
|
||||
nextCommittee.AggregatePubkey = make([]byte, 48)
|
||||
|
||||
}
|
||||
require.NoError(t, st.SetNextSyncCommittee(nextCommittee))
|
||||
|
||||
mockChainService := &mockChain.ChainService{Genesis: genesisTime}
|
||||
s := &Server{
|
||||
Stater: &testutil.MockStater{BeaconState: st},
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
TimeFetcher: mockChainService,
|
||||
HeadFetcher: mockChainService,
|
||||
OptimisticModeFetcher: mockChainService,
|
||||
}
|
||||
|
||||
t.Run("single validator", func(t *testing.T) {
|
||||
var body bytes.Buffer
|
||||
_, err := body.WriteString("[\"1\"]")
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetSyncCommitteeDuties(writer, request)
|
||||
assert.Equal(t, http.StatusOK, writer.Code)
|
||||
resp := &GetSyncCommitteeDutiesResponse{}
|
||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp))
|
||||
require.Equal(t, 1, len(resp.Data))
|
||||
duty := resp.Data[0]
|
||||
assert.Equal(t, hexutil.Encode(vals[1].PublicKey), duty.Pubkey)
|
||||
assert.Equal(t, "1", duty.ValidatorIndex)
|
||||
require.Equal(t, 1, len(duty.ValidatorSyncCommitteeIndices))
|
||||
assert.Equal(t, "1", duty.ValidatorSyncCommitteeIndices[0])
|
||||
})
|
||||
t.Run("multiple validators", func(t *testing.T) {
|
||||
var body bytes.Buffer
|
||||
_, err := body.WriteString("[\"1\",\"2\"]")
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetSyncCommitteeDuties(writer, request)
|
||||
assert.Equal(t, http.StatusOK, writer.Code)
|
||||
resp := &GetSyncCommitteeDutiesResponse{}
|
||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp))
|
||||
require.Equal(t, 2, len(resp.Data))
|
||||
})
|
||||
t.Run("no body", func(t *testing.T) {
|
||||
request := httptest.NewRequest(http.MethodPost, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", nil)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetSyncCommitteeDuties(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.StringContains(t, "No data submitted", e.Message)
|
||||
})
|
||||
t.Run("empty", func(t *testing.T) {
|
||||
var body bytes.Buffer
|
||||
_, err := body.WriteString("[]")
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodPost, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetSyncCommitteeDuties(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.StringContains(t, "No data submitted", e.Message)
|
||||
})
|
||||
t.Run("invalid", func(t *testing.T) {
|
||||
var body bytes.Buffer
|
||||
_, err := body.WriteString("[\"foo\"]")
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodPost, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetSyncCommitteeDuties(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("validator without duty not returned", func(t *testing.T) {
|
||||
var body bytes.Buffer
|
||||
_, err := body.WriteString("[\"1\",\"10\"]")
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetSyncCommitteeDuties(writer, request)
|
||||
assert.Equal(t, http.StatusOK, writer.Code)
|
||||
resp := &GetSyncCommitteeDutiesResponse{}
|
||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp))
|
||||
require.Equal(t, 1, len(resp.Data))
|
||||
assert.Equal(t, "1", resp.Data[0].ValidatorIndex)
|
||||
})
|
||||
t.Run("multiple indices for validator", func(t *testing.T) {
|
||||
var body bytes.Buffer
|
||||
_, err := body.WriteString("[\"0\"]")
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetSyncCommitteeDuties(writer, request)
|
||||
assert.Equal(t, http.StatusOK, writer.Code)
|
||||
resp := &GetSyncCommitteeDutiesResponse{}
|
||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp))
|
||||
duty := resp.Data[0]
|
||||
require.Equal(t, 2, len(duty.ValidatorSyncCommitteeIndices))
|
||||
assert.DeepEqual(t, []string{"0", "5"}, duty.ValidatorSyncCommitteeIndices)
|
||||
})
|
||||
t.Run("validator index out of bound", func(t *testing.T) {
|
||||
var body bytes.Buffer
|
||||
_, err := body.WriteString(fmt.Sprintf("[\"%d\"]", numVals))
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "0"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetSyncCommitteeDuties(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.StringContains(t, "Invalid validator index", e.Message)
|
||||
})
|
||||
t.Run("next sync committee period", func(t *testing.T) {
|
||||
var body bytes.Buffer
|
||||
_, err := body.WriteString("[\"5\"]")
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": strconv.FormatUint(uint64(params.BeaconConfig().EpochsPerSyncCommitteePeriod), 10)})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetSyncCommitteeDuties(writer, request)
|
||||
assert.Equal(t, http.StatusOK, writer.Code)
|
||||
resp := &GetSyncCommitteeDutiesResponse{}
|
||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp))
|
||||
require.Equal(t, 1, len(resp.Data))
|
||||
duty := resp.Data[0]
|
||||
assert.Equal(t, hexutil.Encode(vals[5].PublicKey), duty.Pubkey)
|
||||
assert.Equal(t, "5", duty.ValidatorIndex)
|
||||
require.Equal(t, 1, len(duty.ValidatorSyncCommitteeIndices))
|
||||
assert.Equal(t, "0", duty.ValidatorSyncCommitteeIndices[0])
|
||||
})
|
||||
t.Run("correct sync committee is fetched", func(t *testing.T) {
|
||||
// in this test we swap validators in the current and next sync committee inside the new state
|
||||
|
||||
newSyncPeriodStartSlot := primitives.Slot(uint64(params.BeaconConfig().EpochsPerSyncCommitteePeriod) * uint64(params.BeaconConfig().SlotsPerEpoch))
|
||||
newSyncPeriodSt, _ := util.DeterministicGenesisStateAltair(t, numVals)
|
||||
require.NoError(t, newSyncPeriodSt.SetSlot(newSyncPeriodStartSlot))
|
||||
require.NoError(t, newSyncPeriodSt.SetGenesisTime(uint64(genesisTime.Unix())))
|
||||
vals := newSyncPeriodSt.Validators()
|
||||
currCommittee := ðpbalpha.SyncCommittee{}
|
||||
for i := 5; i < 10; i++ {
|
||||
currCommittee.Pubkeys = append(currCommittee.Pubkeys, vals[i].PublicKey)
|
||||
currCommittee.AggregatePubkey = make([]byte, 48)
|
||||
}
|
||||
require.NoError(t, newSyncPeriodSt.SetCurrentSyncCommittee(currCommittee))
|
||||
nextCommittee := ðpbalpha.SyncCommittee{}
|
||||
for i := 0; i < 5; i++ {
|
||||
nextCommittee.Pubkeys = append(nextCommittee.Pubkeys, vals[i].PublicKey)
|
||||
nextCommittee.AggregatePubkey = make([]byte, 48)
|
||||
|
||||
}
|
||||
require.NoError(t, newSyncPeriodSt.SetNextSyncCommittee(nextCommittee))
|
||||
|
||||
stateFetchFn := func(slot primitives.Slot) state.BeaconState {
|
||||
if slot < newSyncPeriodStartSlot {
|
||||
return st
|
||||
} else {
|
||||
return newSyncPeriodSt
|
||||
}
|
||||
}
|
||||
mockChainService := &mockChain.ChainService{Genesis: genesisTime, Slot: &newSyncPeriodStartSlot}
|
||||
s := &Server{
|
||||
Stater: &testutil.MockStater{BeaconState: stateFetchFn(newSyncPeriodStartSlot)},
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
TimeFetcher: mockChainService,
|
||||
HeadFetcher: mockChainService,
|
||||
OptimisticModeFetcher: mockChainService,
|
||||
}
|
||||
|
||||
var body bytes.Buffer
|
||||
_, err := body.WriteString("[\"8\"]")
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": strconv.FormatUint(uint64(params.BeaconConfig().EpochsPerSyncCommitteePeriod), 10)})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetSyncCommitteeDuties(writer, request)
|
||||
assert.Equal(t, http.StatusOK, writer.Code)
|
||||
resp := &GetSyncCommitteeDutiesResponse{}
|
||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp))
|
||||
require.Equal(t, 1, len(resp.Data))
|
||||
duty := resp.Data[0]
|
||||
assert.Equal(t, hexutil.Encode(vals[8].PublicKey), duty.Pubkey)
|
||||
assert.Equal(t, "8", duty.ValidatorIndex)
|
||||
require.Equal(t, 1, len(duty.ValidatorSyncCommitteeIndices))
|
||||
assert.Equal(t, "3", duty.ValidatorSyncCommitteeIndices[0])
|
||||
})
|
||||
t.Run("epoch not at period start", func(t *testing.T) {
|
||||
var body bytes.Buffer
|
||||
_, err := body.WriteString("[\"1\"]")
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "1"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetSyncCommitteeDuties(writer, request)
|
||||
assert.Equal(t, http.StatusOK, writer.Code)
|
||||
resp := &GetSyncCommitteeDutiesResponse{}
|
||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp))
|
||||
require.Equal(t, 1, len(resp.Data))
|
||||
duty := resp.Data[0]
|
||||
assert.Equal(t, hexutil.Encode(vals[1].PublicKey), duty.Pubkey)
|
||||
assert.Equal(t, "1", duty.ValidatorIndex)
|
||||
require.Equal(t, 1, len(duty.ValidatorSyncCommitteeIndices))
|
||||
assert.Equal(t, "1", duty.ValidatorSyncCommitteeIndices[0])
|
||||
})
|
||||
t.Run("epoch too far in the future", func(t *testing.T) {
|
||||
var body bytes.Buffer
|
||||
_, err := body.WriteString("[\"5\"]")
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": strconv.FormatUint(uint64(params.BeaconConfig().EpochsPerSyncCommitteePeriod*2), 10)})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetSyncCommitteeDuties(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.StringContains(t, "Epoch is too far in the future", e.Message)
|
||||
})
|
||||
t.Run("execution optimistic", func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
db := dbutil.SetupDB(t)
|
||||
require.NoError(t, db.SaveStateSummary(ctx, ðpbalpha.StateSummary{Slot: 0, Root: []byte("root")}))
|
||||
require.NoError(t, db.SaveLastValidatedCheckpoint(ctx, ðpbalpha.Checkpoint{Epoch: 0, Root: []byte("root")}))
|
||||
|
||||
parentRoot := [32]byte{'a'}
|
||||
blk := util.NewBeaconBlock()
|
||||
blk.Block.ParentRoot = parentRoot[:]
|
||||
root, err := blk.Block.HashTreeRoot()
|
||||
require.NoError(t, err)
|
||||
util.SaveBlock(t, ctx, db, blk)
|
||||
require.NoError(t, db.SaveGenesisBlockRoot(ctx, root))
|
||||
|
||||
slot, err := slots.EpochStart(1)
|
||||
require.NoError(t, err)
|
||||
|
||||
st2, err := util.NewBeaconStateBellatrix()
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, st2.SetSlot(slot))
|
||||
|
||||
mockChainService := &mockChain.ChainService{
|
||||
Genesis: genesisTime,
|
||||
Optimistic: true,
|
||||
Slot: &slot,
|
||||
FinalizedCheckPoint: ðpbalpha.Checkpoint{
|
||||
Root: root[:],
|
||||
Epoch: 1,
|
||||
},
|
||||
State: st2,
|
||||
}
|
||||
s := &Server{
|
||||
Stater: &testutil.MockStater{BeaconState: st},
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
TimeFetcher: mockChainService,
|
||||
HeadFetcher: mockChainService,
|
||||
OptimisticModeFetcher: mockChainService,
|
||||
ChainInfoFetcher: mockChainService,
|
||||
BeaconDB: db,
|
||||
}
|
||||
|
||||
var body bytes.Buffer
|
||||
_, err = body.WriteString("[\"1\"]")
|
||||
require.NoError(t, err)
|
||||
request := httptest.NewRequest(http.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", &body)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "1"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetSyncCommitteeDuties(writer, request)
|
||||
assert.Equal(t, http.StatusOK, writer.Code)
|
||||
resp := &GetSyncCommitteeDutiesResponse{}
|
||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), resp))
|
||||
assert.Equal(t, true, resp.ExecutionOptimistic)
|
||||
})
|
||||
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.MethodGet, "http://www.example.com/eth/v1/validator/duties/sync/{epoch}", nil)
|
||||
request = mux.SetURLVars(request, map[string]string{"epoch": "1"})
|
||||
writer := httptest.NewRecorder()
|
||||
writer.Body = &bytes.Buffer{}
|
||||
|
||||
s.GetSyncCommitteeDuties(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)
|
||||
})
|
||||
}
|
||||
|
||||
func TestPrepareBeaconProposer(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
|
||||
@@ -34,6 +34,53 @@ type ProduceSyncCommitteeContributionResponse struct {
|
||||
Data *shared.SyncCommitteeContribution `json:"data"`
|
||||
}
|
||||
|
||||
type GetAttesterDutiesRequest struct {
|
||||
ValidatorIndices []string `json:"validator_indices"`
|
||||
}
|
||||
|
||||
type GetAttesterDutiesResponse struct {
|
||||
DependentRoot string `json:"dependent_root"`
|
||||
ExecutionOptimistic bool `json:"execution_optimistic"`
|
||||
Data []*AttesterDuty `json:"data"`
|
||||
}
|
||||
|
||||
type AttesterDuty struct {
|
||||
Pubkey string `json:"pubkey"`
|
||||
ValidatorIndex string `json:"validator_index"`
|
||||
CommitteeIndex string `json:"committee_index"`
|
||||
CommitteeLength string `json:"committee_length"`
|
||||
CommitteesAtSlot string `json:"committees_at_slot"`
|
||||
ValidatorCommitteeIndex string `json:"validator_committee_index"`
|
||||
Slot string `json:"slot"`
|
||||
}
|
||||
|
||||
type GetProposerDutiesResponse struct {
|
||||
DependentRoot string `json:"dependent_root"`
|
||||
ExecutionOptimistic bool `json:"execution_optimistic"`
|
||||
Data []*ProposerDuty `json:"data"`
|
||||
}
|
||||
|
||||
type ProposerDuty struct {
|
||||
Pubkey string `json:"pubkey"`
|
||||
ValidatorIndex string `json:"validator_index"`
|
||||
Slot string `json:"slot"`
|
||||
}
|
||||
|
||||
type GetSyncCommitteeDutiesRequest struct {
|
||||
ValidatorIndices []string `json:"validator_indices"`
|
||||
}
|
||||
|
||||
type GetSyncCommitteeDutiesResponse struct {
|
||||
ExecutionOptimistic bool `json:"execution_optimistic"`
|
||||
Data []*SyncCommitteeDuty `json:"data"`
|
||||
}
|
||||
|
||||
type SyncCommitteeDuty struct {
|
||||
Pubkey string `json:"pubkey"`
|
||||
ValidatorIndex string `json:"validator_index"`
|
||||
ValidatorSyncCommitteeIndices []string `json:"validator_sync_committee_indices"`
|
||||
}
|
||||
|
||||
// ProduceBlockV3Response is a wrapper json object for the returned block from the ProduceBlockV3 endpoint
|
||||
type ProduceBlockV3Response struct {
|
||||
Version string `json:"version"`
|
||||
|
||||
@@ -1,20 +1,12 @@
|
||||
package validator
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strconv"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/core/helpers"
|
||||
rpchelpers "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/helpers"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/state"
|
||||
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/encoding/bytesutil"
|
||||
ethpbv1 "github.com/prysmaticlabs/prysm/v4/proto/eth/v1"
|
||||
ethpbv2 "github.com/prysmaticlabs/prysm/v4/proto/eth/v2"
|
||||
"github.com/prysmaticlabs/prysm/v4/proto/migration"
|
||||
@@ -25,267 +17,8 @@ import (
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
var errInvalidValIndex = errors.New("invalid validator index")
|
||||
var errParticipation = status.Error(codes.Internal, "Could not obtain epoch participation")
|
||||
|
||||
// GetAttesterDuties requests the beacon node to provide a set of attestation duties,
|
||||
// which should be performed by validators, for a particular epoch.
|
||||
func (vs *Server) GetAttesterDuties(ctx context.Context, req *ethpbv1.AttesterDutiesRequest) (*ethpbv1.AttesterDutiesResponse, error) {
|
||||
ctx, span := trace.StartSpan(ctx, "validator.GetAttesterDuties")
|
||||
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
|
||||
}
|
||||
|
||||
cs := vs.TimeFetcher.CurrentSlot()
|
||||
currentEpoch := slots.ToEpoch(cs)
|
||||
if req.Epoch > currentEpoch+1 {
|
||||
return nil, status.Errorf(codes.InvalidArgument, "Request epoch %d can not be greater than next epoch %d", req.Epoch, currentEpoch+1)
|
||||
}
|
||||
|
||||
isOptimistic, err := vs.OptimisticModeFetcher.IsOptimistic(ctx)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not check optimistic status: %v", err)
|
||||
}
|
||||
|
||||
var startSlot primitives.Slot
|
||||
if req.Epoch == currentEpoch+1 {
|
||||
startSlot, err = slots.EpochStart(currentEpoch)
|
||||
} else {
|
||||
startSlot, err = slots.EpochStart(req.Epoch)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not get start slot from epoch %d: %v", req.Epoch, err)
|
||||
}
|
||||
|
||||
s, err := vs.Stater.StateBySlot(ctx, startSlot)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not get state: %v", err)
|
||||
}
|
||||
|
||||
committeeAssignments, _, err := helpers.CommitteeAssignments(ctx, s, req.Epoch)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not compute committee assignments: %v", err)
|
||||
}
|
||||
activeValidatorCount, err := helpers.ActiveValidatorCount(ctx, s, req.Epoch)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not get active validator count: %v", err)
|
||||
}
|
||||
committeesAtSlot := helpers.SlotCommitteeCount(activeValidatorCount)
|
||||
|
||||
duties := make([]*ethpbv1.AttesterDuty, 0, len(req.Index))
|
||||
for _, index := range req.Index {
|
||||
pubkey := s.PubkeyAtIndex(index)
|
||||
var zeroPubkey [fieldparams.BLSPubkeyLength]byte
|
||||
if bytes.Equal(pubkey[:], zeroPubkey[:]) {
|
||||
return nil, status.Errorf(codes.InvalidArgument, "Invalid validator index")
|
||||
}
|
||||
committee := committeeAssignments[index]
|
||||
if committee == nil {
|
||||
continue
|
||||
}
|
||||
var valIndexInCommittee primitives.CommitteeIndex
|
||||
// valIndexInCommittee will be 0 in case we don't get a match. This is a potential false positive,
|
||||
// however it's an impossible condition because every validator must be assigned to a committee.
|
||||
for cIndex, vIndex := range committee.Committee {
|
||||
if vIndex == index {
|
||||
valIndexInCommittee = primitives.CommitteeIndex(uint64(cIndex))
|
||||
break
|
||||
}
|
||||
}
|
||||
duties = append(duties, ðpbv1.AttesterDuty{
|
||||
Pubkey: pubkey[:],
|
||||
ValidatorIndex: index,
|
||||
CommitteeIndex: committee.CommitteeIndex,
|
||||
CommitteeLength: uint64(len(committee.Committee)),
|
||||
CommitteesAtSlot: committeesAtSlot,
|
||||
ValidatorCommitteeIndex: valIndexInCommittee,
|
||||
Slot: committee.AttesterSlot,
|
||||
})
|
||||
}
|
||||
|
||||
root, err := attestationDependentRoot(s, req.Epoch)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not get dependent root: %v", err)
|
||||
}
|
||||
|
||||
return ðpbv1.AttesterDutiesResponse{
|
||||
DependentRoot: root,
|
||||
Data: duties,
|
||||
ExecutionOptimistic: isOptimistic,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// GetProposerDuties requests beacon node to provide all validators that are scheduled to propose a block in the given epoch.
|
||||
func (vs *Server) GetProposerDuties(ctx context.Context, req *ethpbv1.ProposerDutiesRequest) (*ethpbv1.ProposerDutiesResponse, error) {
|
||||
ctx, span := trace.StartSpan(ctx, "validator.GetProposerDuties")
|
||||
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
|
||||
}
|
||||
|
||||
isOptimistic, err := vs.OptimisticModeFetcher.IsOptimistic(ctx)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not check optimistic status: %v", err)
|
||||
}
|
||||
|
||||
cs := vs.TimeFetcher.CurrentSlot()
|
||||
currentEpoch := slots.ToEpoch(cs)
|
||||
nextEpoch := currentEpoch + 1
|
||||
var nextEpochLookahead bool
|
||||
if req.Epoch > nextEpoch {
|
||||
return nil, status.Errorf(codes.InvalidArgument, "Request epoch %d can not be greater than next epoch %d", req.Epoch, currentEpoch+1)
|
||||
} else if req.Epoch == nextEpoch {
|
||||
// If the request is for the next epoch, we use the current epoch's state to compute duties.
|
||||
req.Epoch = currentEpoch
|
||||
nextEpochLookahead = true
|
||||
}
|
||||
|
||||
startSlot, err := slots.EpochStart(req.Epoch)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not get start slot from epoch %d: %v", req.Epoch, err)
|
||||
}
|
||||
s, err := vs.Stater.StateBySlot(ctx, startSlot)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not get state: %v", err)
|
||||
}
|
||||
|
||||
var proposals map[primitives.ValidatorIndex][]primitives.Slot
|
||||
if nextEpochLookahead {
|
||||
_, proposals, err = helpers.CommitteeAssignments(ctx, s, nextEpoch)
|
||||
} else {
|
||||
_, proposals, err = helpers.CommitteeAssignments(ctx, s, req.Epoch)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not compute committee assignments: %v", err)
|
||||
}
|
||||
|
||||
duties := make([]*ethpbv1.ProposerDuty, 0)
|
||||
for index, ss := range proposals {
|
||||
val, err := s.ValidatorAtIndexReadOnly(index)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not get validator: %v", err)
|
||||
}
|
||||
pubkey48 := val.PublicKey()
|
||||
pubkey := pubkey48[:]
|
||||
for _, s := range ss {
|
||||
vs.ProposerSlotIndexCache.SetProposerAndPayloadIDs(s, index, [8]byte{} /* payloadID */, [32]byte{} /* head root */)
|
||||
duties = append(duties, ðpbv1.ProposerDuty{
|
||||
Pubkey: pubkey,
|
||||
ValidatorIndex: index,
|
||||
Slot: s,
|
||||
})
|
||||
}
|
||||
}
|
||||
sort.Slice(duties, func(i, j int) bool {
|
||||
return duties[i].Slot < duties[j].Slot
|
||||
})
|
||||
|
||||
root, err := proposalDependentRoot(s, req.Epoch)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not get dependent root: %v", err)
|
||||
}
|
||||
|
||||
vs.ProposerSlotIndexCache.PrunePayloadIDs(startSlot)
|
||||
|
||||
return ðpbv1.ProposerDutiesResponse{
|
||||
DependentRoot: root,
|
||||
Data: duties,
|
||||
ExecutionOptimistic: isOptimistic,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// GetSyncCommitteeDuties provides a set of sync committee duties for a particular epoch.
|
||||
//
|
||||
// The logic for calculating epoch validity comes from https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Validator/getSyncCommitteeDuties
|
||||
// where `epoch` is described as `epoch // EPOCHS_PER_SYNC_COMMITTEE_PERIOD <= current_epoch // EPOCHS_PER_SYNC_COMMITTEE_PERIOD + 1`.
|
||||
//
|
||||
// Algorithm:
|
||||
// - Get the last valid epoch. This is the last epoch of the next sync committee period.
|
||||
// - Get the state for the requested epoch. If it's a future epoch from the current sync committee period
|
||||
// or an epoch from the next sync committee period, then get the current state.
|
||||
// - Get the state's current sync committee. If it's an epoch from the next sync committee period, then get the next sync committee.
|
||||
// - Get duties.
|
||||
func (vs *Server) GetSyncCommitteeDuties(ctx context.Context, req *ethpbv2.SyncCommitteeDutiesRequest) (*ethpbv2.SyncCommitteeDutiesResponse, error) {
|
||||
ctx, span := trace.StartSpan(ctx, "validator.GetSyncCommitteeDuties")
|
||||
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
|
||||
}
|
||||
|
||||
currentEpoch := slots.ToEpoch(vs.TimeFetcher.CurrentSlot())
|
||||
lastValidEpoch := syncCommitteeDutiesLastValidEpoch(currentEpoch)
|
||||
if req.Epoch > lastValidEpoch {
|
||||
return nil, status.Errorf(codes.InvalidArgument, "Epoch is too far in the future. Maximum valid epoch is %v.", lastValidEpoch)
|
||||
}
|
||||
|
||||
requestedEpoch := req.Epoch
|
||||
if requestedEpoch > currentEpoch {
|
||||
requestedEpoch = currentEpoch
|
||||
}
|
||||
slot, err := slots.EpochStart(requestedEpoch)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not get sync committee slot: %v", err)
|
||||
}
|
||||
st, err := vs.Stater.State(ctx, []byte(strconv.FormatUint(uint64(slot), 10)))
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not get sync committee state: %v", err)
|
||||
}
|
||||
|
||||
currentSyncCommitteeFirstEpoch, err := slots.SyncCommitteePeriodStartEpoch(requestedEpoch)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.InvalidArgument, "Could not get sync committee period start epoch: %v.", err)
|
||||
}
|
||||
nextSyncCommitteeFirstEpoch := currentSyncCommitteeFirstEpoch + params.BeaconConfig().EpochsPerSyncCommitteePeriod
|
||||
var committee *ethpbalpha.SyncCommittee
|
||||
if req.Epoch >= nextSyncCommitteeFirstEpoch {
|
||||
committee, err = st.NextSyncCommittee()
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not get sync committee: %v", err)
|
||||
}
|
||||
} else {
|
||||
committee, err = st.CurrentSyncCommittee()
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not get sync committee: %v", err)
|
||||
}
|
||||
}
|
||||
committeePubkeys := make(map[[fieldparams.BLSPubkeyLength]byte][]uint64)
|
||||
for j, pubkey := range committee.Pubkeys {
|
||||
pubkey48 := bytesutil.ToBytes48(pubkey)
|
||||
committeePubkeys[pubkey48] = append(committeePubkeys[pubkey48], uint64(j))
|
||||
}
|
||||
|
||||
duties, err := syncCommitteeDuties(req.Index, st, committeePubkeys)
|
||||
if errors.Is(err, errInvalidValIndex) {
|
||||
return nil, status.Error(codes.InvalidArgument, "Invalid validator index")
|
||||
} else if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not get duties: %v", err)
|
||||
}
|
||||
|
||||
isOptimistic, err := rpchelpers.IsOptimistic(
|
||||
ctx,
|
||||
[]byte(strconv.FormatUint(uint64(slot), 10)),
|
||||
vs.OptimisticModeFetcher,
|
||||
vs.Stater,
|
||||
vs.ChainInfoFetcher,
|
||||
vs.BeaconDB,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not check if slot's block is optimistic: %v", err)
|
||||
}
|
||||
|
||||
return ðpbv2.SyncCommitteeDutiesResponse{
|
||||
Data: duties,
|
||||
ExecutionOptimistic: isOptimistic,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// ProduceBlockV2 requests the beacon node to produce a valid unsigned beacon block, which can then be signed by a proposer and submitted.
|
||||
// By definition `/eth/v2/validator/blocks/{slot}`, does not produce block using mev-boost and relayer network.
|
||||
// The following endpoint states that the returned object is a BeaconBlock, not a BlindedBeaconBlock. As such, the block must return a full ExecutionPayload:
|
||||
@@ -849,76 +582,3 @@ func (vs *Server) GetLiveness(ctx context.Context, req *ethpbv2.GetLivenessReque
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
// attestationDependentRoot is get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch - 1) - 1)
|
||||
// or the genesis block root in the case of underflow.
|
||||
func attestationDependentRoot(s state.BeaconState, epoch primitives.Epoch) ([]byte, error) {
|
||||
var dependentRootSlot primitives.Slot
|
||||
if epoch <= 1 {
|
||||
dependentRootSlot = 0
|
||||
} else {
|
||||
prevEpochStartSlot, err := slots.EpochStart(epoch.Sub(1))
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not obtain epoch's start slot: %v", err)
|
||||
}
|
||||
dependentRootSlot = prevEpochStartSlot.Sub(1)
|
||||
}
|
||||
root, err := helpers.BlockRootAtSlot(s, dependentRootSlot)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not get block root")
|
||||
}
|
||||
return root, nil
|
||||
}
|
||||
|
||||
// proposalDependentRoot is get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch) - 1)
|
||||
// or the genesis block root in the case of underflow.
|
||||
func proposalDependentRoot(s state.BeaconState, epoch primitives.Epoch) ([]byte, error) {
|
||||
var dependentRootSlot primitives.Slot
|
||||
if epoch == 0 {
|
||||
dependentRootSlot = 0
|
||||
} else {
|
||||
epochStartSlot, err := slots.EpochStart(epoch)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not obtain epoch's start slot: %v", err)
|
||||
}
|
||||
dependentRootSlot = epochStartSlot.Sub(1)
|
||||
}
|
||||
root, err := helpers.BlockRootAtSlot(s, dependentRootSlot)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not get block root")
|
||||
}
|
||||
return root, nil
|
||||
}
|
||||
|
||||
func syncCommitteeDutiesLastValidEpoch(currentEpoch primitives.Epoch) primitives.Epoch {
|
||||
currentSyncPeriodIndex := currentEpoch / params.BeaconConfig().EpochsPerSyncCommitteePeriod
|
||||
// Return the last epoch of the next sync committee.
|
||||
// To do this we go two periods ahead to find the first invalid epoch, and then subtract 1.
|
||||
return (currentSyncPeriodIndex+2)*params.BeaconConfig().EpochsPerSyncCommitteePeriod - 1
|
||||
}
|
||||
|
||||
func syncCommitteeDuties(
|
||||
valIndices []primitives.ValidatorIndex,
|
||||
st state.BeaconState,
|
||||
committeePubkeys map[[fieldparams.BLSPubkeyLength]byte][]uint64,
|
||||
) ([]*ethpbv2.SyncCommitteeDuty, error) {
|
||||
duties := make([]*ethpbv2.SyncCommitteeDuty, 0)
|
||||
for _, index := range valIndices {
|
||||
duty := ðpbv2.SyncCommitteeDuty{
|
||||
ValidatorIndex: index,
|
||||
}
|
||||
valPubkey48 := st.PubkeyAtIndex(index)
|
||||
var zeroPubkey [fieldparams.BLSPubkeyLength]byte
|
||||
if bytes.Equal(valPubkey48[:], zeroPubkey[:]) {
|
||||
return nil, errInvalidValIndex
|
||||
}
|
||||
valPubkey := valPubkey48[:]
|
||||
duty.Pubkey = valPubkey
|
||||
indices, ok := committeePubkeys[valPubkey48]
|
||||
if ok {
|
||||
duty.ValidatorSyncCommitteeIndices = indices
|
||||
duties = append(duties, duty)
|
||||
}
|
||||
}
|
||||
return duties, nil
|
||||
}
|
||||
|
||||
@@ -2,24 +2,17 @@ package validator
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
mockChain "github.com/prysmaticlabs/prysm/v4/beacon-chain/blockchain/testing"
|
||||
builderTest "github.com/prysmaticlabs/prysm/v4/beacon-chain/builder/testing"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/cache"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/core/helpers"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/core/transition"
|
||||
dbutil "github.com/prysmaticlabs/prysm/v4/beacon-chain/db/testing"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/testutil"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/state"
|
||||
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/encoding/bytesutil"
|
||||
ethpbv1 "github.com/prysmaticlabs/prysm/v4/proto/eth/v1"
|
||||
ethpbv2 "github.com/prysmaticlabs/prysm/v4/proto/eth/v2"
|
||||
"github.com/prysmaticlabs/prysm/v4/proto/migration"
|
||||
@@ -28,679 +21,8 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/v4/testing/mock"
|
||||
"github.com/prysmaticlabs/prysm/v4/testing/require"
|
||||
"github.com/prysmaticlabs/prysm/v4/testing/util"
|
||||
"github.com/prysmaticlabs/prysm/v4/time/slots"
|
||||
)
|
||||
|
||||
func TestGetAttesterDuties(t *testing.T) {
|
||||
helpers.ClearCache()
|
||||
|
||||
ctx := context.Background()
|
||||
genesis := util.NewBeaconBlock()
|
||||
depChainStart := params.BeaconConfig().MinGenesisActiveValidatorCount
|
||||
deposits, _, err := util.DeterministicDepositsAndKeys(depChainStart)
|
||||
require.NoError(t, err)
|
||||
eth1Data, err := util.DeterministicEth1Data(len(deposits))
|
||||
require.NoError(t, err)
|
||||
bs, err := transition.GenesisBeaconState(context.Background(), deposits, 0, eth1Data)
|
||||
require.NoError(t, err, "Could not set up genesis state")
|
||||
// Set state to non-epoch start slot.
|
||||
require.NoError(t, bs.SetSlot(5))
|
||||
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))
|
||||
db := dbutil.SetupDB(t)
|
||||
|
||||
// Deactivate last validator.
|
||||
vals := bs.Validators()
|
||||
vals[len(vals)-1].ExitEpoch = 0
|
||||
require.NoError(t, bs.SetValidators(vals))
|
||||
|
||||
pubKeys := make([][]byte, len(deposits))
|
||||
for i := 0; i < len(deposits); i++ {
|
||||
pubKeys[i] = deposits[i].Data.PublicKey
|
||||
}
|
||||
|
||||
// nextEpochState must not be used for committee calculations when requesting next epoch
|
||||
nextEpochState := bs.Copy()
|
||||
require.NoError(t, nextEpochState.SetSlot(params.BeaconConfig().SlotsPerEpoch))
|
||||
require.NoError(t, nextEpochState.SetValidators(vals[:512]))
|
||||
|
||||
chainSlot := primitives.Slot(0)
|
||||
chain := &mockChain.ChainService{
|
||||
State: bs, Root: genesisRoot[:], Slot: &chainSlot,
|
||||
}
|
||||
vs := &Server{
|
||||
Stater: &testutil.MockStater{
|
||||
StatesBySlot: map[primitives.Slot]state.BeaconState{
|
||||
0: bs,
|
||||
params.BeaconConfig().SlotsPerEpoch: nextEpochState,
|
||||
},
|
||||
},
|
||||
TimeFetcher: chain,
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
OptimisticModeFetcher: chain,
|
||||
}
|
||||
|
||||
t.Run("Single validator", func(t *testing.T) {
|
||||
req := ðpbv1.AttesterDutiesRequest{
|
||||
Epoch: 0,
|
||||
Index: []primitives.ValidatorIndex{0},
|
||||
}
|
||||
resp, err := vs.GetAttesterDuties(ctx, req)
|
||||
require.NoError(t, err)
|
||||
assert.DeepEqual(t, genesisRoot[:], resp.DependentRoot)
|
||||
require.Equal(t, 1, len(resp.Data))
|
||||
duty := resp.Data[0]
|
||||
assert.Equal(t, primitives.CommitteeIndex(1), duty.CommitteeIndex)
|
||||
assert.Equal(t, primitives.Slot(0), duty.Slot)
|
||||
assert.Equal(t, primitives.ValidatorIndex(0), duty.ValidatorIndex)
|
||||
assert.DeepEqual(t, pubKeys[0], duty.Pubkey)
|
||||
assert.Equal(t, uint64(171), duty.CommitteeLength)
|
||||
assert.Equal(t, uint64(3), duty.CommitteesAtSlot)
|
||||
assert.Equal(t, primitives.CommitteeIndex(80), duty.ValidatorCommitteeIndex)
|
||||
})
|
||||
|
||||
t.Run("Multiple validators", func(t *testing.T) {
|
||||
req := ðpbv1.AttesterDutiesRequest{
|
||||
Epoch: 0,
|
||||
Index: []primitives.ValidatorIndex{0, 1},
|
||||
}
|
||||
resp, err := vs.GetAttesterDuties(ctx, req)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, 2, len(resp.Data))
|
||||
})
|
||||
|
||||
t.Run("Next epoch", func(t *testing.T) {
|
||||
req := ðpbv1.AttesterDutiesRequest{
|
||||
Epoch: slots.ToEpoch(bs.Slot()) + 1,
|
||||
Index: []primitives.ValidatorIndex{0},
|
||||
}
|
||||
resp, err := vs.GetAttesterDuties(ctx, req)
|
||||
require.NoError(t, err)
|
||||
assert.DeepEqual(t, genesisRoot[:], resp.DependentRoot)
|
||||
require.Equal(t, 1, len(resp.Data))
|
||||
duty := resp.Data[0]
|
||||
assert.Equal(t, primitives.CommitteeIndex(0), duty.CommitteeIndex)
|
||||
assert.Equal(t, primitives.Slot(62), duty.Slot)
|
||||
assert.Equal(t, primitives.ValidatorIndex(0), duty.ValidatorIndex)
|
||||
assert.DeepEqual(t, pubKeys[0], duty.Pubkey)
|
||||
assert.Equal(t, uint64(170), duty.CommitteeLength)
|
||||
assert.Equal(t, uint64(3), duty.CommitteesAtSlot)
|
||||
assert.Equal(t, primitives.CommitteeIndex(110), duty.ValidatorCommitteeIndex)
|
||||
})
|
||||
|
||||
t.Run("Epoch out of bound", func(t *testing.T) {
|
||||
currentEpoch := slots.ToEpoch(bs.Slot())
|
||||
req := ðpbv1.AttesterDutiesRequest{
|
||||
Epoch: currentEpoch + 2,
|
||||
Index: []primitives.ValidatorIndex{0},
|
||||
}
|
||||
_, err := vs.GetAttesterDuties(ctx, req)
|
||||
require.NotNil(t, err)
|
||||
assert.ErrorContains(t, fmt.Sprintf("Request epoch %d can not be greater than next epoch %d", currentEpoch+2, currentEpoch+1), err)
|
||||
})
|
||||
|
||||
t.Run("Validator index out of bound", func(t *testing.T) {
|
||||
req := ðpbv1.AttesterDutiesRequest{
|
||||
Epoch: 0,
|
||||
Index: []primitives.ValidatorIndex{primitives.ValidatorIndex(len(pubKeys))},
|
||||
}
|
||||
_, err := vs.GetAttesterDuties(ctx, req)
|
||||
require.NotNil(t, err)
|
||||
assert.ErrorContains(t, "Invalid validator index", err)
|
||||
})
|
||||
|
||||
t.Run("Inactive validator - no duties", func(t *testing.T) {
|
||||
req := ðpbv1.AttesterDutiesRequest{
|
||||
Epoch: 0,
|
||||
Index: []primitives.ValidatorIndex{primitives.ValidatorIndex(len(pubKeys) - 1)},
|
||||
}
|
||||
resp, err := vs.GetAttesterDuties(ctx, req)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, 0, len(resp.Data))
|
||||
})
|
||||
|
||||
t.Run("execution optimistic", func(t *testing.T) {
|
||||
parentRoot := [32]byte{'a'}
|
||||
blk := util.NewBeaconBlock()
|
||||
blk.Block.ParentRoot = parentRoot[:]
|
||||
blk.Block.Slot = 31
|
||||
root, err := blk.Block.HashTreeRoot()
|
||||
require.NoError(t, err)
|
||||
util.SaveBlock(t, ctx, db, blk)
|
||||
require.NoError(t, db.SaveGenesisBlockRoot(ctx, root))
|
||||
|
||||
chainSlot := primitives.Slot(0)
|
||||
chain := &mockChain.ChainService{
|
||||
State: bs, Root: genesisRoot[:], Slot: &chainSlot, Optimistic: true,
|
||||
}
|
||||
vs := &Server{
|
||||
Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{0: bs}},
|
||||
TimeFetcher: chain,
|
||||
OptimisticModeFetcher: chain,
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
}
|
||||
req := ðpbv1.AttesterDutiesRequest{
|
||||
Epoch: 0,
|
||||
Index: []primitives.ValidatorIndex{0},
|
||||
}
|
||||
resp, err := vs.GetAttesterDuties(ctx, req)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, true, resp.ExecutionOptimistic)
|
||||
})
|
||||
}
|
||||
|
||||
func TestGetAttesterDuties_SyncNotReady(t *testing.T) {
|
||||
helpers.ClearCache()
|
||||
|
||||
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.GetAttesterDuties(context.Background(), ðpbv1.AttesterDutiesRequest{})
|
||||
assert.ErrorContains(t, "Syncing to latest head, not ready to respond", err)
|
||||
}
|
||||
|
||||
func TestGetProposerDuties(t *testing.T) {
|
||||
helpers.ClearCache()
|
||||
|
||||
ctx := context.Background()
|
||||
genesis := util.NewBeaconBlock()
|
||||
depChainStart := params.BeaconConfig().MinGenesisActiveValidatorCount
|
||||
deposits, _, err := util.DeterministicDepositsAndKeys(depChainStart)
|
||||
require.NoError(t, err)
|
||||
eth1Data, err := util.DeterministicEth1Data(len(deposits))
|
||||
require.NoError(t, err)
|
||||
genesisRoot, err := genesis.Block.HashTreeRoot()
|
||||
require.NoError(t, err, "Could not get signing root")
|
||||
roots := make([][]byte, fieldparams.BlockRootsLength)
|
||||
roots[0] = genesisRoot[:]
|
||||
// We DON'T WANT this root to be returned when testing the next epoch
|
||||
roots[31] = []byte("next_epoch_dependent_root")
|
||||
db := dbutil.SetupDB(t)
|
||||
|
||||
pubKeys := make([][]byte, len(deposits))
|
||||
for i := 0; i < len(deposits); i++ {
|
||||
pubKeys[i] = deposits[i].Data.PublicKey
|
||||
}
|
||||
|
||||
t.Run("Ok", func(t *testing.T) {
|
||||
bs, err := transition.GenesisBeaconState(context.Background(), deposits, 0, eth1Data)
|
||||
require.NoError(t, err, "Could not set up genesis state")
|
||||
require.NoError(t, bs.SetSlot(params.BeaconConfig().SlotsPerEpoch))
|
||||
require.NoError(t, bs.SetBlockRoots(roots))
|
||||
chainSlot := primitives.Slot(0)
|
||||
chain := &mockChain.ChainService{
|
||||
State: bs, Root: genesisRoot[:], Slot: &chainSlot,
|
||||
}
|
||||
vs := &Server{
|
||||
Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{0: bs}},
|
||||
HeadFetcher: chain,
|
||||
TimeFetcher: chain,
|
||||
OptimisticModeFetcher: chain,
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
ProposerSlotIndexCache: cache.NewProposerPayloadIDsCache(),
|
||||
}
|
||||
|
||||
req := ðpbv1.ProposerDutiesRequest{
|
||||
Epoch: 0,
|
||||
}
|
||||
resp, err := vs.GetProposerDuties(ctx, req)
|
||||
require.NoError(t, err)
|
||||
assert.DeepEqual(t, genesisRoot[:], resp.DependentRoot)
|
||||
assert.Equal(t, 31, len(resp.Data))
|
||||
// We expect a proposer duty for slot 11.
|
||||
var expectedDuty *ethpbv1.ProposerDuty
|
||||
for _, duty := range resp.Data {
|
||||
if duty.Slot == 11 {
|
||||
expectedDuty = duty
|
||||
}
|
||||
}
|
||||
vid, _, has := vs.ProposerSlotIndexCache.GetProposerPayloadIDs(11, [32]byte{})
|
||||
require.Equal(t, true, has)
|
||||
require.Equal(t, primitives.ValidatorIndex(12289), vid)
|
||||
require.NotNil(t, expectedDuty, "Expected duty for slot 11 not found")
|
||||
assert.Equal(t, primitives.ValidatorIndex(12289), expectedDuty.ValidatorIndex)
|
||||
assert.DeepEqual(t, pubKeys[12289], expectedDuty.Pubkey)
|
||||
})
|
||||
|
||||
t.Run("Next epoch", func(t *testing.T) {
|
||||
bs, err := transition.GenesisBeaconState(context.Background(), deposits, 0, eth1Data)
|
||||
require.NoError(t, err, "Could not set up genesis state")
|
||||
require.NoError(t, bs.SetBlockRoots(roots))
|
||||
chainSlot := primitives.Slot(0)
|
||||
chain := &mockChain.ChainService{
|
||||
State: bs, Root: genesisRoot[:], Slot: &chainSlot,
|
||||
}
|
||||
vs := &Server{
|
||||
Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{0: bs}},
|
||||
HeadFetcher: chain,
|
||||
TimeFetcher: chain,
|
||||
OptimisticModeFetcher: chain,
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
ProposerSlotIndexCache: cache.NewProposerPayloadIDsCache(),
|
||||
}
|
||||
|
||||
req := ðpbv1.ProposerDutiesRequest{
|
||||
Epoch: 1,
|
||||
}
|
||||
resp, err := vs.GetProposerDuties(ctx, req)
|
||||
require.NoError(t, err)
|
||||
assert.DeepEqual(t, bytesutil.PadTo(genesisRoot[:], 32), resp.DependentRoot)
|
||||
assert.Equal(t, 32, len(resp.Data))
|
||||
// We expect a proposer duty for slot 43.
|
||||
var expectedDuty *ethpbv1.ProposerDuty
|
||||
for _, duty := range resp.Data {
|
||||
if duty.Slot == 43 {
|
||||
expectedDuty = duty
|
||||
}
|
||||
}
|
||||
vid, _, has := vs.ProposerSlotIndexCache.GetProposerPayloadIDs(43, [32]byte{})
|
||||
require.Equal(t, true, has)
|
||||
require.Equal(t, primitives.ValidatorIndex(1360), vid)
|
||||
require.NotNil(t, expectedDuty, "Expected duty for slot 43 not found")
|
||||
assert.Equal(t, primitives.ValidatorIndex(1360), expectedDuty.ValidatorIndex)
|
||||
assert.DeepEqual(t, pubKeys[1360], expectedDuty.Pubkey)
|
||||
})
|
||||
|
||||
t.Run("Prune payload ID cache ok", func(t *testing.T) {
|
||||
bs, err := transition.GenesisBeaconState(context.Background(), deposits, 0, eth1Data)
|
||||
require.NoError(t, err, "Could not set up genesis state")
|
||||
require.NoError(t, bs.SetSlot(params.BeaconConfig().SlotsPerEpoch))
|
||||
require.NoError(t, bs.SetBlockRoots(roots))
|
||||
chainSlot := params.BeaconConfig().SlotsPerEpoch
|
||||
chain := &mockChain.ChainService{
|
||||
State: bs, Root: genesisRoot[:], Slot: &chainSlot,
|
||||
}
|
||||
vs := &Server{
|
||||
Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{params.BeaconConfig().SlotsPerEpoch: bs}},
|
||||
HeadFetcher: chain,
|
||||
TimeFetcher: chain,
|
||||
OptimisticModeFetcher: chain,
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
ProposerSlotIndexCache: cache.NewProposerPayloadIDsCache(),
|
||||
}
|
||||
|
||||
req := ðpbv1.ProposerDutiesRequest{
|
||||
Epoch: 1,
|
||||
}
|
||||
vs.ProposerSlotIndexCache.SetProposerAndPayloadIDs(1, 1, [8]byte{1}, [32]byte{2})
|
||||
vs.ProposerSlotIndexCache.SetProposerAndPayloadIDs(31, 2, [8]byte{2}, [32]byte{3})
|
||||
vs.ProposerSlotIndexCache.SetProposerAndPayloadIDs(32, 4309, [8]byte{3}, [32]byte{4})
|
||||
|
||||
_, err = vs.GetProposerDuties(ctx, req)
|
||||
require.NoError(t, err)
|
||||
|
||||
vid, _, has := vs.ProposerSlotIndexCache.GetProposerPayloadIDs(1, [32]byte{})
|
||||
require.Equal(t, false, has)
|
||||
require.Equal(t, primitives.ValidatorIndex(0), vid)
|
||||
vid, _, has = vs.ProposerSlotIndexCache.GetProposerPayloadIDs(2, [32]byte{})
|
||||
require.Equal(t, false, has)
|
||||
require.Equal(t, primitives.ValidatorIndex(0), vid)
|
||||
vid, _, has = vs.ProposerSlotIndexCache.GetProposerPayloadIDs(32, [32]byte{})
|
||||
require.Equal(t, true, has)
|
||||
require.Equal(t, primitives.ValidatorIndex(10565), vid)
|
||||
})
|
||||
|
||||
t.Run("Epoch out of bound", func(t *testing.T) {
|
||||
bs, err := transition.GenesisBeaconState(context.Background(), deposits, 0, eth1Data)
|
||||
require.NoError(t, err, "Could not set up genesis state")
|
||||
// Set state to non-epoch start slot.
|
||||
require.NoError(t, bs.SetSlot(5))
|
||||
require.NoError(t, bs.SetBlockRoots(roots))
|
||||
chainSlot := primitives.Slot(0)
|
||||
chain := &mockChain.ChainService{
|
||||
State: bs, Root: genesisRoot[:], Slot: &chainSlot,
|
||||
}
|
||||
vs := &Server{
|
||||
Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{0: bs}},
|
||||
HeadFetcher: chain,
|
||||
TimeFetcher: chain,
|
||||
OptimisticModeFetcher: chain,
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
ProposerSlotIndexCache: cache.NewProposerPayloadIDsCache(),
|
||||
}
|
||||
|
||||
currentEpoch := slots.ToEpoch(bs.Slot())
|
||||
req := ðpbv1.ProposerDutiesRequest{
|
||||
Epoch: currentEpoch + 2,
|
||||
}
|
||||
_, err = vs.GetProposerDuties(ctx, req)
|
||||
require.NotNil(t, err)
|
||||
assert.ErrorContains(t, fmt.Sprintf("Request epoch %d can not be greater than next epoch %d", currentEpoch+2, currentEpoch+1), err)
|
||||
})
|
||||
|
||||
t.Run("execution optimistic", func(t *testing.T) {
|
||||
bs, err := transition.GenesisBeaconState(context.Background(), deposits, 0, eth1Data)
|
||||
require.NoError(t, err, "Could not set up genesis state")
|
||||
// Set state to non-epoch start slot.
|
||||
require.NoError(t, bs.SetSlot(5))
|
||||
require.NoError(t, bs.SetBlockRoots(roots))
|
||||
parentRoot := [32]byte{'a'}
|
||||
blk := util.NewBeaconBlock()
|
||||
blk.Block.ParentRoot = parentRoot[:]
|
||||
blk.Block.Slot = 31
|
||||
root, err := blk.Block.HashTreeRoot()
|
||||
require.NoError(t, err)
|
||||
util.SaveBlock(t, ctx, db, blk)
|
||||
require.NoError(t, db.SaveGenesisBlockRoot(ctx, root))
|
||||
|
||||
chainSlot := primitives.Slot(0)
|
||||
chain := &mockChain.ChainService{
|
||||
State: bs, Root: genesisRoot[:], Slot: &chainSlot, Optimistic: true,
|
||||
}
|
||||
vs := &Server{
|
||||
Stater: &testutil.MockStater{StatesBySlot: map[primitives.Slot]state.BeaconState{0: bs}},
|
||||
HeadFetcher: chain,
|
||||
TimeFetcher: chain,
|
||||
OptimisticModeFetcher: chain,
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
ProposerSlotIndexCache: cache.NewProposerPayloadIDsCache(),
|
||||
}
|
||||
req := ðpbv1.ProposerDutiesRequest{
|
||||
Epoch: 0,
|
||||
}
|
||||
resp, err := vs.GetProposerDuties(ctx, req)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, true, resp.ExecutionOptimistic)
|
||||
})
|
||||
}
|
||||
|
||||
func TestGetProposerDuties_SyncNotReady(t *testing.T) {
|
||||
helpers.ClearCache()
|
||||
|
||||
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.GetProposerDuties(context.Background(), ðpbv1.ProposerDutiesRequest{})
|
||||
assert.ErrorContains(t, "Syncing to latest head, not ready to respond", err)
|
||||
}
|
||||
|
||||
func TestGetSyncCommitteeDuties(t *testing.T) {
|
||||
helpers.ClearCache()
|
||||
|
||||
ctx := context.Background()
|
||||
genesisTime := time.Now()
|
||||
numVals := uint64(11)
|
||||
st, _ := util.DeterministicGenesisStateAltair(t, numVals)
|
||||
require.NoError(t, st.SetGenesisTime(uint64(genesisTime.Unix())))
|
||||
vals := st.Validators()
|
||||
currCommittee := ðpbalpha.SyncCommittee{}
|
||||
for i := 0; i < 5; i++ {
|
||||
currCommittee.Pubkeys = append(currCommittee.Pubkeys, vals[i].PublicKey)
|
||||
currCommittee.AggregatePubkey = make([]byte, 48)
|
||||
}
|
||||
// add one public key twice - this is needed for one of the test cases
|
||||
currCommittee.Pubkeys = append(currCommittee.Pubkeys, vals[0].PublicKey)
|
||||
require.NoError(t, st.SetCurrentSyncCommittee(currCommittee))
|
||||
nextCommittee := ðpbalpha.SyncCommittee{}
|
||||
for i := 5; i < 10; i++ {
|
||||
nextCommittee.Pubkeys = append(nextCommittee.Pubkeys, vals[i].PublicKey)
|
||||
nextCommittee.AggregatePubkey = make([]byte, 48)
|
||||
|
||||
}
|
||||
require.NoError(t, st.SetNextSyncCommittee(nextCommittee))
|
||||
|
||||
mockChainService := &mockChain.ChainService{Genesis: genesisTime}
|
||||
vs := &Server{
|
||||
Stater: &testutil.MockStater{BeaconState: st},
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
TimeFetcher: mockChainService,
|
||||
HeadFetcher: mockChainService,
|
||||
OptimisticModeFetcher: mockChainService,
|
||||
}
|
||||
|
||||
t.Run("Single validator", func(t *testing.T) {
|
||||
req := ðpbv2.SyncCommitteeDutiesRequest{
|
||||
Epoch: 0,
|
||||
Index: []primitives.ValidatorIndex{1},
|
||||
}
|
||||
resp, err := vs.GetSyncCommitteeDuties(ctx, req)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, resp)
|
||||
require.NotNil(t, resp.Data)
|
||||
require.Equal(t, 1, len(resp.Data))
|
||||
duty := resp.Data[0]
|
||||
assert.DeepEqual(t, vals[1].PublicKey, duty.Pubkey)
|
||||
assert.Equal(t, primitives.ValidatorIndex(1), duty.ValidatorIndex)
|
||||
require.Equal(t, 1, len(duty.ValidatorSyncCommitteeIndices))
|
||||
assert.Equal(t, uint64(1), duty.ValidatorSyncCommitteeIndices[0])
|
||||
})
|
||||
|
||||
t.Run("Epoch not at period start", func(t *testing.T) {
|
||||
req := ðpbv2.SyncCommitteeDutiesRequest{
|
||||
Epoch: 1,
|
||||
Index: []primitives.ValidatorIndex{1},
|
||||
}
|
||||
resp, err := vs.GetSyncCommitteeDuties(ctx, req)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, resp)
|
||||
require.NotNil(t, resp.Data)
|
||||
require.Equal(t, 1, len(resp.Data))
|
||||
duty := resp.Data[0]
|
||||
assert.DeepEqual(t, vals[1].PublicKey, duty.Pubkey)
|
||||
assert.Equal(t, primitives.ValidatorIndex(1), duty.ValidatorIndex)
|
||||
require.Equal(t, 1, len(duty.ValidatorSyncCommitteeIndices))
|
||||
assert.Equal(t, uint64(1), duty.ValidatorSyncCommitteeIndices[0])
|
||||
})
|
||||
|
||||
t.Run("Multiple validators", func(t *testing.T) {
|
||||
req := ðpbv2.SyncCommitteeDutiesRequest{
|
||||
Epoch: 0,
|
||||
Index: []primitives.ValidatorIndex{1, 2},
|
||||
}
|
||||
resp, err := vs.GetSyncCommitteeDuties(ctx, req)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, 2, len(resp.Data))
|
||||
})
|
||||
|
||||
t.Run("Validator without duty not returned", func(t *testing.T) {
|
||||
req := ðpbv2.SyncCommitteeDutiesRequest{
|
||||
Epoch: 0,
|
||||
Index: []primitives.ValidatorIndex{1, 10},
|
||||
}
|
||||
resp, err := vs.GetSyncCommitteeDuties(ctx, req)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, 1, len(resp.Data))
|
||||
assert.Equal(t, primitives.ValidatorIndex(1), resp.Data[0].ValidatorIndex)
|
||||
})
|
||||
|
||||
t.Run("Multiple indices for validator", func(t *testing.T) {
|
||||
req := ðpbv2.SyncCommitteeDutiesRequest{
|
||||
Epoch: 0,
|
||||
Index: []primitives.ValidatorIndex{0},
|
||||
}
|
||||
resp, err := vs.GetSyncCommitteeDuties(ctx, req)
|
||||
require.NoError(t, err)
|
||||
duty := resp.Data[0]
|
||||
require.Equal(t, 2, len(duty.ValidatorSyncCommitteeIndices))
|
||||
assert.DeepEqual(t, []uint64{0, 5}, duty.ValidatorSyncCommitteeIndices)
|
||||
})
|
||||
|
||||
t.Run("Validator index out of bound", func(t *testing.T) {
|
||||
req := ðpbv2.SyncCommitteeDutiesRequest{
|
||||
Epoch: 0,
|
||||
Index: []primitives.ValidatorIndex{primitives.ValidatorIndex(numVals)},
|
||||
}
|
||||
_, err := vs.GetSyncCommitteeDuties(ctx, req)
|
||||
require.NotNil(t, err)
|
||||
assert.ErrorContains(t, "Invalid validator index", err)
|
||||
})
|
||||
|
||||
t.Run("next sync committee period", func(t *testing.T) {
|
||||
req := ðpbv2.SyncCommitteeDutiesRequest{
|
||||
Epoch: params.BeaconConfig().EpochsPerSyncCommitteePeriod,
|
||||
Index: []primitives.ValidatorIndex{5},
|
||||
}
|
||||
resp, err := vs.GetSyncCommitteeDuties(ctx, req)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, resp)
|
||||
require.NotNil(t, resp.Data)
|
||||
require.Equal(t, 1, len(resp.Data))
|
||||
duty := resp.Data[0]
|
||||
assert.DeepEqual(t, vals[5].PublicKey, duty.Pubkey)
|
||||
assert.Equal(t, primitives.ValidatorIndex(5), duty.ValidatorIndex)
|
||||
require.Equal(t, 1, len(duty.ValidatorSyncCommitteeIndices))
|
||||
assert.Equal(t, uint64(0), duty.ValidatorSyncCommitteeIndices[0])
|
||||
})
|
||||
|
||||
t.Run("epoch too far in the future", func(t *testing.T) {
|
||||
req := ðpbv2.SyncCommitteeDutiesRequest{
|
||||
Epoch: params.BeaconConfig().EpochsPerSyncCommitteePeriod * 2,
|
||||
Index: []primitives.ValidatorIndex{5},
|
||||
}
|
||||
_, err := vs.GetSyncCommitteeDuties(ctx, req)
|
||||
require.NotNil(t, err)
|
||||
assert.ErrorContains(t, "Epoch is too far in the future", err)
|
||||
})
|
||||
|
||||
t.Run("correct sync committee is fetched", func(t *testing.T) {
|
||||
// in this test we swap validators in the current and next sync committee inside the new state
|
||||
|
||||
newSyncPeriodStartSlot := primitives.Slot(uint64(params.BeaconConfig().EpochsPerSyncCommitteePeriod) * uint64(params.BeaconConfig().SlotsPerEpoch))
|
||||
newSyncPeriodSt, _ := util.DeterministicGenesisStateAltair(t, numVals)
|
||||
require.NoError(t, newSyncPeriodSt.SetSlot(newSyncPeriodStartSlot))
|
||||
require.NoError(t, newSyncPeriodSt.SetGenesisTime(uint64(genesisTime.Unix())))
|
||||
vals := newSyncPeriodSt.Validators()
|
||||
currCommittee := ðpbalpha.SyncCommittee{}
|
||||
for i := 5; i < 10; i++ {
|
||||
currCommittee.Pubkeys = append(currCommittee.Pubkeys, vals[i].PublicKey)
|
||||
currCommittee.AggregatePubkey = make([]byte, 48)
|
||||
}
|
||||
require.NoError(t, newSyncPeriodSt.SetCurrentSyncCommittee(currCommittee))
|
||||
nextCommittee := ðpbalpha.SyncCommittee{}
|
||||
for i := 0; i < 5; i++ {
|
||||
nextCommittee.Pubkeys = append(nextCommittee.Pubkeys, vals[i].PublicKey)
|
||||
nextCommittee.AggregatePubkey = make([]byte, 48)
|
||||
|
||||
}
|
||||
require.NoError(t, newSyncPeriodSt.SetNextSyncCommittee(nextCommittee))
|
||||
|
||||
stateFetchFn := func(slot primitives.Slot) state.BeaconState {
|
||||
if slot < newSyncPeriodStartSlot {
|
||||
return st
|
||||
} else {
|
||||
return newSyncPeriodSt
|
||||
}
|
||||
}
|
||||
mockChainService := &mockChain.ChainService{Genesis: genesisTime, Slot: &newSyncPeriodStartSlot}
|
||||
vs := &Server{
|
||||
Stater: &testutil.MockStater{BeaconState: stateFetchFn(newSyncPeriodStartSlot)},
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
TimeFetcher: mockChainService,
|
||||
HeadFetcher: mockChainService,
|
||||
OptimisticModeFetcher: mockChainService,
|
||||
}
|
||||
|
||||
req := ðpbv2.SyncCommitteeDutiesRequest{
|
||||
Epoch: params.BeaconConfig().EpochsPerSyncCommitteePeriod,
|
||||
Index: []primitives.ValidatorIndex{8},
|
||||
}
|
||||
resp, err := vs.GetSyncCommitteeDuties(ctx, req)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, resp)
|
||||
require.NotNil(t, resp.Data)
|
||||
require.Equal(t, 1, len(resp.Data))
|
||||
duty := resp.Data[0]
|
||||
assert.DeepEqual(t, vals[8].PublicKey, duty.Pubkey)
|
||||
assert.Equal(t, primitives.ValidatorIndex(8), duty.ValidatorIndex)
|
||||
require.Equal(t, 1, len(duty.ValidatorSyncCommitteeIndices))
|
||||
assert.Equal(t, uint64(3), duty.ValidatorSyncCommitteeIndices[0])
|
||||
})
|
||||
|
||||
t.Run("execution optimistic", func(t *testing.T) {
|
||||
db := dbutil.SetupDB(t)
|
||||
require.NoError(t, db.SaveStateSummary(ctx, ðpbalpha.StateSummary{Slot: 0, Root: []byte("root")}))
|
||||
require.NoError(t, db.SaveLastValidatedCheckpoint(ctx, ðpbalpha.Checkpoint{Epoch: 0, Root: []byte("root")}))
|
||||
|
||||
parentRoot := [32]byte{'a'}
|
||||
blk := util.NewBeaconBlock()
|
||||
blk.Block.ParentRoot = parentRoot[:]
|
||||
root, err := blk.Block.HashTreeRoot()
|
||||
require.NoError(t, err)
|
||||
util.SaveBlock(t, ctx, db, blk)
|
||||
require.NoError(t, db.SaveGenesisBlockRoot(ctx, root))
|
||||
|
||||
slot, err := slots.EpochStart(1)
|
||||
require.NoError(t, err)
|
||||
|
||||
state, err := util.NewBeaconStateBellatrix()
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, state.SetSlot(slot))
|
||||
|
||||
mockChainService := &mockChain.ChainService{
|
||||
Genesis: genesisTime,
|
||||
Optimistic: true,
|
||||
Slot: &slot,
|
||||
FinalizedCheckPoint: ðpbalpha.Checkpoint{
|
||||
Root: root[:],
|
||||
Epoch: 1,
|
||||
},
|
||||
State: state,
|
||||
}
|
||||
vs := &Server{
|
||||
Stater: &testutil.MockStater{BeaconState: st},
|
||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||
TimeFetcher: mockChainService,
|
||||
HeadFetcher: mockChainService,
|
||||
OptimisticModeFetcher: mockChainService,
|
||||
ChainInfoFetcher: mockChainService,
|
||||
BeaconDB: db,
|
||||
}
|
||||
req := ðpbv2.SyncCommitteeDutiesRequest{
|
||||
Epoch: 1,
|
||||
Index: []primitives.ValidatorIndex{1},
|
||||
}
|
||||
resp, err := vs.GetSyncCommitteeDuties(ctx, req)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, true, resp.ExecutionOptimistic)
|
||||
})
|
||||
}
|
||||
|
||||
func TestGetSyncCommitteeDuties_SyncNotReady(t *testing.T) {
|
||||
helpers.ClearCache()
|
||||
|
||||
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.GetSyncCommitteeDuties(context.Background(), ðpbv2.SyncCommitteeDutiesRequest{})
|
||||
assert.ErrorContains(t, "Syncing to latest head, not ready to respond", err)
|
||||
}
|
||||
|
||||
func TestSyncCommitteeDutiesLastValidEpoch(t *testing.T) {
|
||||
helpers.ClearCache()
|
||||
|
||||
t.Run("first epoch of current period", func(t *testing.T) {
|
||||
assert.Equal(t, params.BeaconConfig().EpochsPerSyncCommitteePeriod*2-1, syncCommitteeDutiesLastValidEpoch(0))
|
||||
})
|
||||
t.Run("last epoch of current period", func(t *testing.T) {
|
||||
assert.Equal(
|
||||
t,
|
||||
params.BeaconConfig().EpochsPerSyncCommitteePeriod*2-1,
|
||||
syncCommitteeDutiesLastValidEpoch(params.BeaconConfig().EpochsPerSyncCommitteePeriod-1),
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
func TestProduceBlockV2(t *testing.T) {
|
||||
ctrl := gomock.NewController(t)
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -314,6 +314,9 @@ func (s *Service) Start() {
|
||||
s.cfg.Router.HandleFunc("/eth/v1/validator/beacon_committee_subscriptions", validatorServerV1.SubmitBeaconCommitteeSubscription).Methods(http.MethodPost)
|
||||
s.cfg.Router.HandleFunc("/eth/v1/validator/attestation_data", validatorServerV1.GetAttestationData).Methods(http.MethodGet)
|
||||
s.cfg.Router.HandleFunc("/eth/v1/validator/register_validator", validatorServerV1.RegisterValidator).Methods(http.MethodPost)
|
||||
s.cfg.Router.HandleFunc("/eth/v1/validator/duties/attester/{epoch}", validatorServerV1.GetAttesterDuties).Methods(http.MethodPost)
|
||||
s.cfg.Router.HandleFunc("/eth/v1/validator/duties/proposer/{epoch}", validatorServerV1.GetProposerDuties).Methods(http.MethodGet)
|
||||
s.cfg.Router.HandleFunc("/eth/v1/validator/duties/sync/{epoch}", validatorServerV1.GetSyncCommitteeDuties).Methods(http.MethodPost)
|
||||
s.cfg.Router.HandleFunc("/eth/v1/validator/prepare_beacon_proposer", validatorServerV1.PrepareBeaconProposer).Methods(http.MethodPost)
|
||||
|
||||
s.cfg.Router.HandleFunc("/eth/v3/validator/blocks/{slot}", validatorServerV1.ProduceBlockV3).Methods(http.MethodGet)
|
||||
|
||||
307
proto/eth/service/validator_service.pb.go
generated
307
proto/eth/service/validator_service.pb.go
generated
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.15.8
|
||||
// protoc v4.23.3
|
||||
// source: proto/eth/service/validator_service.proto
|
||||
|
||||
package service
|
||||
@@ -47,135 +47,92 @@ 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, 0x87, 0x0a, 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,
|
||||
0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e,
|
||||
0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x44,
|
||||
0x75, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x82,
|
||||
0xd3, 0xe4, 0x93, 0x02, 0x37, 0x3a, 0x01, 0x2a, 0x22, 0x32, 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, 0x64, 0x75, 0x74, 0x69, 0x65, 0x73, 0x2f, 0x61, 0x74, 0x74, 0x65,
|
||||
0x73, 0x74, 0x65, 0x72, 0x2f, 0x7b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x7d, 0x12, 0xa0, 0x01, 0x0a,
|
||||
0x11, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 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, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x44, 0x75, 0x74,
|
||||
0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x74, 0x68,
|
||||
0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f,
|
||||
0x70, 0x6f, 0x73, 0x65, 0x72, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 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, 0x64, 0x75, 0x74, 0x69, 0x65, 0x73, 0x2f, 0x70,
|
||||
0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2f, 0x7b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x7d, 0x12,
|
||||
0xae, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
|
||||
0x74, 0x74, 0x65, 0x65, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x12, 0x2b, 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, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 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, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x01, 0x2a,
|
||||
0x22, 0x2e, 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, 0x64, 0x75, 0x74,
|
||||
0x69, 0x65, 0x73, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x2f, 0x7b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x7d,
|
||||
0x12, 0x91, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63,
|
||||
0x6b, 0x56, 0x32, 0x12, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65,
|
||||
0x74, 0x6f, 0x32, 0x8d, 0x06, 0x0a, 0x0f, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x56, 0x61, 0x6c,
|
||||
0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x91, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x64, 0x75,
|
||||
0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x56, 0x32, 0x12, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65,
|
||||
0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x64,
|
||||
0x75, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76,
|
||||
0x32, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x32, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a,
|
||||
0x12, 0x28, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f,
|
||||
0x76, 0x32, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f,
|
||||
0x63, 0x6b, 0x73, 0x2f, 0x7b, 0x73, 0x6c, 0x6f, 0x74, 0x7d, 0x12, 0x8e, 0x01, 0x0a, 0x11, 0x50,
|
||||
0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x56, 0x32, 0x53, 0x53, 0x5a,
|
||||
0x12, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e,
|
||||
0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75,
|
||||
0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x53, 0x5a, 0x43, 0x6f, 0x6e, 0x74,
|
||||
0x61, 0x69, 0x6e, 0x65, 0x72, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f,
|
||||
0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x2f,
|
||||
0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73,
|
||||
0x2f, 0x7b, 0x73, 0x6c, 0x6f, 0x74, 0x7d, 0x2f, 0x73, 0x73, 0x7a, 0x12, 0xa3, 0x01, 0x0a, 0x13,
|
||||
0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x12, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65,
|
||||
0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x42, 0x6c, 0x6f,
|
||||
0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65,
|
||||
0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65,
|
||||
0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x64,
|
||||
0x75, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x56, 0x32, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x69, 0x6e, 0x74,
|
||||
0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x2f, 0x76, 0x61, 0x6c,
|
||||
0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x7b, 0x73,
|
||||
0x6c, 0x6f, 0x74, 0x7d, 0x12, 0x8e, 0x01, 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65,
|
||||
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x56, 0x32, 0x53, 0x53, 0x5a, 0x12, 0x24, 0x2e, 0x65, 0x74, 0x68,
|
||||
0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f,
|
||||
0x64, 0x75, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x1d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e,
|
||||
0x76, 0x32, 0x2e, 0x53, 0x53, 0x5a, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22,
|
||||
0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e,
|
||||
0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
|
||||
0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x7b, 0x73, 0x6c, 0x6f, 0x74,
|
||||
0x7d, 0x2f, 0x73, 0x73, 0x7a, 0x12, 0xa3, 0x01, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63,
|
||||
0x65, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x24, 0x2e,
|
||||
0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e,
|
||||
0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65,
|
||||
0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x42, 0x6c, 0x69,
|
||||
0x6e, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x69, 0x6e, 0x74, 0x65,
|
||||
0x75, 0x63, 0x65, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12,
|
||||
0x30, 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, 0x62, 0x6c, 0x69, 0x6e,
|
||||
0x64, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x7b, 0x73, 0x6c, 0x6f, 0x74,
|
||||
0x7d, 0x12, 0x9b, 0x01, 0x0a, 0x16, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x42, 0x6c, 0x69,
|
||||
0x6e, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x53, 0x5a, 0x12, 0x24, 0x2e, 0x65,
|
||||
0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x50,
|
||||
0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74,
|
||||
0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x53, 0x5a, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
||||
0x72, 0x22, 0x3c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x12, 0x34, 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, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x7b, 0x73, 0x6c, 0x6f, 0x74, 0x7d, 0x12, 0x9b, 0x01, 0x0a, 0x16,
|
||||
0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x53, 0x53, 0x5a, 0x12, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75,
|
||||
0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65,
|
||||
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65,
|
||||
0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53,
|
||||
0x53, 0x5a, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22, 0x3c, 0x82, 0xd3, 0xe4,
|
||||
0x93, 0x02, 0x36, 0x12, 0x34, 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,
|
||||
0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x7b,
|
||||
0x73, 0x6c, 0x6f, 0x74, 0x7d, 0x2f, 0x73, 0x73, 0x7a, 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,
|
||||
0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x7b, 0x73, 0x6c, 0x6f, 0x74, 0x7d, 0x2f, 0x73, 0x73, 0x7a, 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{}{
|
||||
(*v1.AttesterDutiesRequest)(nil), // 0: ethereum.eth.v1.AttesterDutiesRequest
|
||||
(*v1.ProposerDutiesRequest)(nil), // 1: ethereum.eth.v1.ProposerDutiesRequest
|
||||
(*v2.SyncCommitteeDutiesRequest)(nil), // 2: ethereum.eth.v2.SyncCommitteeDutiesRequest
|
||||
(*v1.ProduceBlockRequest)(nil), // 3: ethereum.eth.v1.ProduceBlockRequest
|
||||
(*v2.GetLivenessRequest)(nil), // 4: ethereum.eth.v2.GetLivenessRequest
|
||||
(*v1.AttesterDutiesResponse)(nil), // 5: ethereum.eth.v1.AttesterDutiesResponse
|
||||
(*v1.ProposerDutiesResponse)(nil), // 6: ethereum.eth.v1.ProposerDutiesResponse
|
||||
(*v2.SyncCommitteeDutiesResponse)(nil), // 7: ethereum.eth.v2.SyncCommitteeDutiesResponse
|
||||
(*v2.ProduceBlockResponseV2)(nil), // 8: ethereum.eth.v2.ProduceBlockResponseV2
|
||||
(*v2.SSZContainer)(nil), // 9: ethereum.eth.v2.SSZContainer
|
||||
(*v2.ProduceBlindedBlockResponse)(nil), // 10: ethereum.eth.v2.ProduceBlindedBlockResponse
|
||||
(*v2.GetLivenessResponse)(nil), // 11: ethereum.eth.v2.GetLivenessResponse
|
||||
(*v1.ProduceBlockRequest)(nil), // 0: ethereum.eth.v1.ProduceBlockRequest
|
||||
(*v2.GetLivenessRequest)(nil), // 1: ethereum.eth.v2.GetLivenessRequest
|
||||
(*v2.ProduceBlockResponseV2)(nil), // 2: ethereum.eth.v2.ProduceBlockResponseV2
|
||||
(*v2.SSZContainer)(nil), // 3: ethereum.eth.v2.SSZContainer
|
||||
(*v2.ProduceBlindedBlockResponse)(nil), // 4: ethereum.eth.v2.ProduceBlindedBlockResponse
|
||||
(*v2.GetLivenessResponse)(nil), // 5: 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
|
||||
1, // 1: ethereum.eth.service.BeaconValidator.GetProposerDuties:input_type -> ethereum.eth.v1.ProposerDutiesRequest
|
||||
2, // 2: ethereum.eth.service.BeaconValidator.GetSyncCommitteeDuties:input_type -> ethereum.eth.v2.SyncCommitteeDutiesRequest
|
||||
3, // 3: ethereum.eth.service.BeaconValidator.ProduceBlockV2:input_type -> ethereum.eth.v1.ProduceBlockRequest
|
||||
3, // 4: ethereum.eth.service.BeaconValidator.ProduceBlockV2SSZ:input_type -> ethereum.eth.v1.ProduceBlockRequest
|
||||
3, // 5: ethereum.eth.service.BeaconValidator.ProduceBlindedBlock:input_type -> ethereum.eth.v1.ProduceBlockRequest
|
||||
3, // 6: ethereum.eth.service.BeaconValidator.ProduceBlindedBlockSSZ:input_type -> ethereum.eth.v1.ProduceBlockRequest
|
||||
4, // 7: ethereum.eth.service.BeaconValidator.GetLiveness:input_type -> ethereum.eth.v2.GetLivenessRequest
|
||||
5, // 8: ethereum.eth.service.BeaconValidator.GetAttesterDuties:output_type -> ethereum.eth.v1.AttesterDutiesResponse
|
||||
6, // 9: ethereum.eth.service.BeaconValidator.GetProposerDuties:output_type -> ethereum.eth.v1.ProposerDutiesResponse
|
||||
7, // 10: ethereum.eth.service.BeaconValidator.GetSyncCommitteeDuties:output_type -> ethereum.eth.v2.SyncCommitteeDutiesResponse
|
||||
8, // 11: ethereum.eth.service.BeaconValidator.ProduceBlockV2:output_type -> ethereum.eth.v2.ProduceBlockResponseV2
|
||||
9, // 12: ethereum.eth.service.BeaconValidator.ProduceBlockV2SSZ:output_type -> ethereum.eth.v2.SSZContainer
|
||||
10, // 13: ethereum.eth.service.BeaconValidator.ProduceBlindedBlock:output_type -> ethereum.eth.v2.ProduceBlindedBlockResponse
|
||||
9, // 14: ethereum.eth.service.BeaconValidator.ProduceBlindedBlockSSZ:output_type -> ethereum.eth.v2.SSZContainer
|
||||
11, // 15: ethereum.eth.service.BeaconValidator.GetLiveness:output_type -> ethereum.eth.v2.GetLivenessResponse
|
||||
8, // [8:16] is the sub-list for method output_type
|
||||
0, // [0:8] 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
|
||||
0, // 0: ethereum.eth.service.BeaconValidator.ProduceBlockV2:input_type -> ethereum.eth.v1.ProduceBlockRequest
|
||||
0, // 1: ethereum.eth.service.BeaconValidator.ProduceBlockV2SSZ:input_type -> ethereum.eth.v1.ProduceBlockRequest
|
||||
0, // 2: ethereum.eth.service.BeaconValidator.ProduceBlindedBlock:input_type -> ethereum.eth.v1.ProduceBlockRequest
|
||||
0, // 3: ethereum.eth.service.BeaconValidator.ProduceBlindedBlockSSZ:input_type -> ethereum.eth.v1.ProduceBlockRequest
|
||||
1, // 4: ethereum.eth.service.BeaconValidator.GetLiveness:input_type -> ethereum.eth.v2.GetLivenessRequest
|
||||
2, // 5: ethereum.eth.service.BeaconValidator.ProduceBlockV2:output_type -> ethereum.eth.v2.ProduceBlockResponseV2
|
||||
3, // 6: ethereum.eth.service.BeaconValidator.ProduceBlockV2SSZ:output_type -> ethereum.eth.v2.SSZContainer
|
||||
4, // 7: ethereum.eth.service.BeaconValidator.ProduceBlindedBlock:output_type -> ethereum.eth.v2.ProduceBlindedBlockResponse
|
||||
3, // 8: ethereum.eth.service.BeaconValidator.ProduceBlindedBlockSSZ:output_type -> ethereum.eth.v2.SSZContainer
|
||||
5, // 9: ethereum.eth.service.BeaconValidator.GetLiveness:output_type -> ethereum.eth.v2.GetLivenessResponse
|
||||
5, // [5:10] is the sub-list for method output_type
|
||||
0, // [0:5] 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
|
||||
}
|
||||
|
||||
func init() { file_proto_eth_service_validator_service_proto_init() }
|
||||
@@ -214,9 +171,6 @@ const _ = grpc.SupportPackageIsVersion6
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type BeaconValidatorClient interface {
|
||||
GetAttesterDuties(ctx context.Context, in *v1.AttesterDutiesRequest, opts ...grpc.CallOption) (*v1.AttesterDutiesResponse, error)
|
||||
GetProposerDuties(ctx context.Context, in *v1.ProposerDutiesRequest, opts ...grpc.CallOption) (*v1.ProposerDutiesResponse, error)
|
||||
GetSyncCommitteeDuties(ctx context.Context, in *v2.SyncCommitteeDutiesRequest, opts ...grpc.CallOption) (*v2.SyncCommitteeDutiesResponse, error)
|
||||
ProduceBlockV2(ctx context.Context, in *v1.ProduceBlockRequest, opts ...grpc.CallOption) (*v2.ProduceBlockResponseV2, error)
|
||||
ProduceBlockV2SSZ(ctx context.Context, in *v1.ProduceBlockRequest, opts ...grpc.CallOption) (*v2.SSZContainer, error)
|
||||
ProduceBlindedBlock(ctx context.Context, in *v1.ProduceBlockRequest, opts ...grpc.CallOption) (*v2.ProduceBlindedBlockResponse, error)
|
||||
@@ -232,33 +186,6 @@ func NewBeaconValidatorClient(cc grpc.ClientConnInterface) BeaconValidatorClient
|
||||
return &beaconValidatorClient{cc}
|
||||
}
|
||||
|
||||
func (c *beaconValidatorClient) GetAttesterDuties(ctx context.Context, in *v1.AttesterDutiesRequest, opts ...grpc.CallOption) (*v1.AttesterDutiesResponse, error) {
|
||||
out := new(v1.AttesterDutiesResponse)
|
||||
err := c.cc.Invoke(ctx, "/ethereum.eth.service.BeaconValidator/GetAttesterDuties", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *beaconValidatorClient) GetProposerDuties(ctx context.Context, in *v1.ProposerDutiesRequest, opts ...grpc.CallOption) (*v1.ProposerDutiesResponse, error) {
|
||||
out := new(v1.ProposerDutiesResponse)
|
||||
err := c.cc.Invoke(ctx, "/ethereum.eth.service.BeaconValidator/GetProposerDuties", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *beaconValidatorClient) GetSyncCommitteeDuties(ctx context.Context, in *v2.SyncCommitteeDutiesRequest, opts ...grpc.CallOption) (*v2.SyncCommitteeDutiesResponse, error) {
|
||||
out := new(v2.SyncCommitteeDutiesResponse)
|
||||
err := c.cc.Invoke(ctx, "/ethereum.eth.service.BeaconValidator/GetSyncCommitteeDuties", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *beaconValidatorClient) ProduceBlockV2(ctx context.Context, in *v1.ProduceBlockRequest, opts ...grpc.CallOption) (*v2.ProduceBlockResponseV2, error) {
|
||||
out := new(v2.ProduceBlockResponseV2)
|
||||
err := c.cc.Invoke(ctx, "/ethereum.eth.service.BeaconValidator/ProduceBlockV2", in, out, opts...)
|
||||
@@ -306,9 +233,6 @@ func (c *beaconValidatorClient) GetLiveness(ctx context.Context, in *v2.GetLiven
|
||||
|
||||
// BeaconValidatorServer is the server API for BeaconValidator service.
|
||||
type BeaconValidatorServer interface {
|
||||
GetAttesterDuties(context.Context, *v1.AttesterDutiesRequest) (*v1.AttesterDutiesResponse, error)
|
||||
GetProposerDuties(context.Context, *v1.ProposerDutiesRequest) (*v1.ProposerDutiesResponse, error)
|
||||
GetSyncCommitteeDuties(context.Context, *v2.SyncCommitteeDutiesRequest) (*v2.SyncCommitteeDutiesResponse, error)
|
||||
ProduceBlockV2(context.Context, *v1.ProduceBlockRequest) (*v2.ProduceBlockResponseV2, error)
|
||||
ProduceBlockV2SSZ(context.Context, *v1.ProduceBlockRequest) (*v2.SSZContainer, error)
|
||||
ProduceBlindedBlock(context.Context, *v1.ProduceBlockRequest) (*v2.ProduceBlindedBlockResponse, error)
|
||||
@@ -320,15 +244,6 @@ type BeaconValidatorServer interface {
|
||||
type UnimplementedBeaconValidatorServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedBeaconValidatorServer) GetAttesterDuties(context.Context, *v1.AttesterDutiesRequest) (*v1.AttesterDutiesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetAttesterDuties not implemented")
|
||||
}
|
||||
func (*UnimplementedBeaconValidatorServer) GetProposerDuties(context.Context, *v1.ProposerDutiesRequest) (*v1.ProposerDutiesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetProposerDuties not implemented")
|
||||
}
|
||||
func (*UnimplementedBeaconValidatorServer) GetSyncCommitteeDuties(context.Context, *v2.SyncCommitteeDutiesRequest) (*v2.SyncCommitteeDutiesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetSyncCommitteeDuties not implemented")
|
||||
}
|
||||
func (*UnimplementedBeaconValidatorServer) ProduceBlockV2(context.Context, *v1.ProduceBlockRequest) (*v2.ProduceBlockResponseV2, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ProduceBlockV2 not implemented")
|
||||
}
|
||||
@@ -349,60 +264,6 @@ func RegisterBeaconValidatorServer(s *grpc.Server, srv BeaconValidatorServer) {
|
||||
s.RegisterService(&_BeaconValidator_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _BeaconValidator_GetAttesterDuties_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(v1.AttesterDutiesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BeaconValidatorServer).GetAttesterDuties(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ethereum.eth.service.BeaconValidator/GetAttesterDuties",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BeaconValidatorServer).GetAttesterDuties(ctx, req.(*v1.AttesterDutiesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BeaconValidator_GetProposerDuties_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(v1.ProposerDutiesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BeaconValidatorServer).GetProposerDuties(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ethereum.eth.service.BeaconValidator/GetProposerDuties",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BeaconValidatorServer).GetProposerDuties(ctx, req.(*v1.ProposerDutiesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BeaconValidator_GetSyncCommitteeDuties_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(v2.SyncCommitteeDutiesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BeaconValidatorServer).GetSyncCommitteeDuties(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ethereum.eth.service.BeaconValidator/GetSyncCommitteeDuties",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BeaconValidatorServer).GetSyncCommitteeDuties(ctx, req.(*v2.SyncCommitteeDutiesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BeaconValidator_ProduceBlockV2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(v1.ProduceBlockRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -497,18 +358,6 @@ var _BeaconValidator_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "ethereum.eth.service.BeaconValidator",
|
||||
HandlerType: (*BeaconValidatorServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetAttesterDuties",
|
||||
Handler: _BeaconValidator_GetAttesterDuties_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetProposerDuties",
|
||||
Handler: _BeaconValidator_GetProposerDuties_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetSyncCommitteeDuties",
|
||||
Handler: _BeaconValidator_GetSyncCommitteeDuties_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ProduceBlockV2",
|
||||
Handler: _BeaconValidator_ProduceBlockV2_Handler,
|
||||
|
||||
@@ -39,200 +39,6 @@ var _ = github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(0)
|
||||
var _ = emptypb.Empty{}
|
||||
var _ = empty.Empty{}
|
||||
|
||||
func request_BeaconValidator_GetAttesterDuties_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq v1.AttesterDutiesRequest
|
||||
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)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["epoch"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "epoch")
|
||||
}
|
||||
|
||||
epoch, err := runtime.Uint64(val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "epoch", err)
|
||||
}
|
||||
protoReq.Epoch = github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(epoch)
|
||||
|
||||
msg, err := client.GetAttesterDuties(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_BeaconValidator_GetAttesterDuties_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq v1.AttesterDutiesRequest
|
||||
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)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["epoch"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "epoch")
|
||||
}
|
||||
|
||||
epoch, err := runtime.Uint64(val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "epoch", err)
|
||||
}
|
||||
protoReq.Epoch = github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(epoch)
|
||||
|
||||
msg, err := server.GetAttesterDuties(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_BeaconValidator_GetProposerDuties_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq v1.ProposerDutiesRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["epoch"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "epoch")
|
||||
}
|
||||
|
||||
epoch, err := runtime.Uint64(val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "epoch", err)
|
||||
}
|
||||
protoReq.Epoch = github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(epoch)
|
||||
|
||||
msg, err := client.GetProposerDuties(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_BeaconValidator_GetProposerDuties_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq v1.ProposerDutiesRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["epoch"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "epoch")
|
||||
}
|
||||
|
||||
epoch, err := runtime.Uint64(val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "epoch", err)
|
||||
}
|
||||
protoReq.Epoch = github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(epoch)
|
||||
|
||||
msg, err := server.GetProposerDuties(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_BeaconValidator_GetSyncCommitteeDuties_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq eth.SyncCommitteeDutiesRequest
|
||||
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)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["epoch"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "epoch")
|
||||
}
|
||||
|
||||
epoch, err := runtime.Uint64(val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "epoch", err)
|
||||
}
|
||||
protoReq.Epoch = github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(epoch)
|
||||
|
||||
msg, err := client.GetSyncCommitteeDuties(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_BeaconValidator_GetSyncCommitteeDuties_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq eth.SyncCommitteeDutiesRequest
|
||||
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)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["epoch"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "epoch")
|
||||
}
|
||||
|
||||
epoch, err := runtime.Uint64(val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "epoch", err)
|
||||
}
|
||||
protoReq.Epoch = github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(epoch)
|
||||
|
||||
msg, err := server.GetSyncCommitteeDuties(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_BeaconValidator_ProduceBlockV2_0 = &utilities.DoubleArray{Encoding: map[string]int{"slot": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
|
||||
)
|
||||
@@ -597,75 +403,6 @@ func local_request_BeaconValidator_GetLiveness_0(ctx context.Context, marshaler
|
||||
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterBeaconValidatorHandlerFromEndpoint instead.
|
||||
func RegisterBeaconValidatorHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BeaconValidatorServer) error {
|
||||
|
||||
mux.Handle("POST", pattern_BeaconValidator_GetAttesterDuties_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/GetAttesterDuties")
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_BeaconValidator_GetAttesterDuties_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_GetAttesterDuties_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_BeaconValidator_GetProposerDuties_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/GetProposerDuties")
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_BeaconValidator_GetProposerDuties_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_GetProposerDuties_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_BeaconValidator_GetSyncCommitteeDuties_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/GetSyncCommitteeDuties")
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_BeaconValidator_GetSyncCommitteeDuties_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_GetSyncCommitteeDuties_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_BeaconValidator_ProduceBlockV2_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@@ -822,66 +559,6 @@ func RegisterBeaconValidatorHandler(ctx context.Context, mux *runtime.ServeMux,
|
||||
// "BeaconValidatorClient" to call the correct interceptors.
|
||||
func RegisterBeaconValidatorHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BeaconValidatorClient) error {
|
||||
|
||||
mux.Handle("POST", pattern_BeaconValidator_GetAttesterDuties_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/GetAttesterDuties")
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_BeaconValidator_GetAttesterDuties_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_GetAttesterDuties_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_BeaconValidator_GetProposerDuties_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/GetProposerDuties")
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_BeaconValidator_GetProposerDuties_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_GetProposerDuties_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_BeaconValidator_GetSyncCommitteeDuties_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/GetSyncCommitteeDuties")
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_BeaconValidator_GetSyncCommitteeDuties_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_GetSyncCommitteeDuties_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_BeaconValidator_ProduceBlockV2_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@@ -986,12 +663,6 @@ func RegisterBeaconValidatorHandlerClient(ctx context.Context, mux *runtime.Serv
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_BeaconValidator_GetAttesterDuties_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"internal", "eth", "v1", "validator", "duties", "attester", "epoch"}, ""))
|
||||
|
||||
pattern_BeaconValidator_GetProposerDuties_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"internal", "eth", "v1", "validator", "duties", "proposer", "epoch"}, ""))
|
||||
|
||||
pattern_BeaconValidator_GetSyncCommitteeDuties_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"internal", "eth", "v1", "validator", "duties", "sync", "epoch"}, ""))
|
||||
|
||||
pattern_BeaconValidator_ProduceBlockV2_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", "v2", "validator", "blocks", "slot"}, ""))
|
||||
|
||||
pattern_BeaconValidator_ProduceBlockV2SSZ_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"internal", "eth", "v2", "validator", "blocks", "slot", "ssz"}, ""))
|
||||
@@ -1004,12 +675,6 @@ var (
|
||||
)
|
||||
|
||||
var (
|
||||
forward_BeaconValidator_GetAttesterDuties_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_BeaconValidator_GetProposerDuties_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_BeaconValidator_GetSyncCommitteeDuties_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_BeaconValidator_ProduceBlockV2_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_BeaconValidator_ProduceBlockV2SSZ_0 = runtime.ForwardResponseMessage
|
||||
|
||||
@@ -36,53 +36,6 @@ option php_namespace = "Ethereum\\Eth\\Service";
|
||||
//
|
||||
// This service is defined in the upstream Ethereum consensus APIs repository (beacon-apis/apis/validator).
|
||||
service BeaconValidator {
|
||||
// GetAttesterDuties requests the beacon node to provide a set of attestation duties, which should be performed
|
||||
// by validators, for a particular epoch.
|
||||
//
|
||||
// HTTP response usage:
|
||||
// - 200: Successful response
|
||||
// - 400: Invalid epoch or index
|
||||
// - 500: Beacon node internal error
|
||||
// - 503: Beacon node is currently syncing, try again later
|
||||
//
|
||||
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/getAttesterDuties
|
||||
rpc GetAttesterDuties(v1.AttesterDutiesRequest) returns (v1.AttesterDutiesResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/internal/eth/v1/validator/duties/attester/{epoch}"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
|
||||
// GetProposerDuties requests beacon node to provide all validators that are scheduled to
|
||||
// propose a block in the given epoch.
|
||||
//
|
||||
// HTTP response usage:
|
||||
// - 200: Successful response
|
||||
// - 400: Invalid epoch
|
||||
// - 500: Beacon node internal error
|
||||
// - 503: Beacon node is currently syncing, try again later
|
||||
//
|
||||
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/getProposerDuties
|
||||
rpc GetProposerDuties(v1.ProposerDutiesRequest) returns (v1.ProposerDutiesResponse) {
|
||||
option (google.api.http) = { get: "/internal/eth/v1/validator/duties/proposer/{epoch}" };
|
||||
}
|
||||
|
||||
// GetSyncCommitteeDuties requests the beacon node to provide a set of sync committee duties for a particular epoch.
|
||||
//
|
||||
// HTTP response usage:
|
||||
// - 200: Successful response
|
||||
// - 400: Invalid epoch or index
|
||||
// - 500: Beacon node internal error
|
||||
// - 503: Beacon node is currently syncing, try again later
|
||||
//
|
||||
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/getSyncCommitteeDuties
|
||||
rpc GetSyncCommitteeDuties(v2.SyncCommitteeDutiesRequest) returns (v2.SyncCommitteeDutiesResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/internal/eth/v1/validator/duties/sync/{epoch}"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
|
||||
// ProduceBlockV2 requests the beacon node to produce a valid unsigned beacon block,
|
||||
// which can then be signed by a proposer and submitted.
|
||||
//
|
||||
|
||||
692
proto/eth/v1/validator.pb.go
generated
692
proto/eth/v1/validator.pb.go
generated
@@ -277,392 +277,6 @@ func (x *Validator) GetWithdrawableEpoch() github_com_prysmaticlabs_prysm_v4_con
|
||||
return github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(0)
|
||||
}
|
||||
|
||||
type AttesterDutiesRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Epoch github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Epoch"`
|
||||
Index []github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex `protobuf:"varint,2,rep,packed,name=index,proto3" json:"index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"`
|
||||
}
|
||||
|
||||
func (x *AttesterDutiesRequest) Reset() {
|
||||
*x = AttesterDutiesRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v1_validator_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AttesterDutiesRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AttesterDutiesRequest) ProtoMessage() {}
|
||||
|
||||
func (x *AttesterDutiesRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_eth_v1_validator_proto_msgTypes[2]
|
||||
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 AttesterDutiesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*AttesterDutiesRequest) Descriptor() ([]byte, []int) {
|
||||
return file_proto_eth_v1_validator_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *AttesterDutiesRequest) GetEpoch() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch {
|
||||
if x != nil {
|
||||
return x.Epoch
|
||||
}
|
||||
return github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(0)
|
||||
}
|
||||
|
||||
func (x *AttesterDutiesRequest) GetIndex() []github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex {
|
||||
if x != nil {
|
||||
return x.Index
|
||||
}
|
||||
return []github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex(nil)
|
||||
}
|
||||
|
||||
type AttesterDutiesResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
DependentRoot []byte `protobuf:"bytes,1,opt,name=dependent_root,json=dependentRoot,proto3" json:"dependent_root,omitempty" ssz-size:"32"`
|
||||
Data []*AttesterDuty `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"`
|
||||
ExecutionOptimistic bool `protobuf:"varint,3,opt,name=execution_optimistic,json=executionOptimistic,proto3" json:"execution_optimistic,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AttesterDutiesResponse) Reset() {
|
||||
*x = AttesterDutiesResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v1_validator_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AttesterDutiesResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AttesterDutiesResponse) ProtoMessage() {}
|
||||
|
||||
func (x *AttesterDutiesResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_eth_v1_validator_proto_msgTypes[3]
|
||||
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 AttesterDutiesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*AttesterDutiesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_proto_eth_v1_validator_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *AttesterDutiesResponse) GetDependentRoot() []byte {
|
||||
if x != nil {
|
||||
return x.DependentRoot
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AttesterDutiesResponse) GetData() []*AttesterDuty {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AttesterDutiesResponse) GetExecutionOptimistic() bool {
|
||||
if x != nil {
|
||||
return x.ExecutionOptimistic
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type AttesterDuty struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty" ssz-size:"48"`
|
||||
ValidatorIndex github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex `protobuf:"varint,2,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"`
|
||||
CommitteeIndex github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.CommitteeIndex `protobuf:"varint,3,opt,name=committee_index,json=committeeIndex,proto3" json:"committee_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.CommitteeIndex"`
|
||||
CommitteeLength uint64 `protobuf:"varint,4,opt,name=committee_length,json=committeeLength,proto3" json:"committee_length,omitempty"`
|
||||
CommitteesAtSlot uint64 `protobuf:"varint,5,opt,name=committees_at_slot,json=committeesAtSlot,proto3" json:"committees_at_slot,omitempty"`
|
||||
ValidatorCommitteeIndex github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.CommitteeIndex `protobuf:"varint,6,opt,name=validator_committee_index,json=validatorCommitteeIndex,proto3" json:"validator_committee_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.CommitteeIndex"`
|
||||
Slot github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot `protobuf:"varint,7,opt,name=slot,proto3" json:"slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"`
|
||||
}
|
||||
|
||||
func (x *AttesterDuty) Reset() {
|
||||
*x = AttesterDuty{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v1_validator_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AttesterDuty) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AttesterDuty) ProtoMessage() {}
|
||||
|
||||
func (x *AttesterDuty) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_eth_v1_validator_proto_msgTypes[4]
|
||||
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 AttesterDuty.ProtoReflect.Descriptor instead.
|
||||
func (*AttesterDuty) Descriptor() ([]byte, []int) {
|
||||
return file_proto_eth_v1_validator_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *AttesterDuty) GetPubkey() []byte {
|
||||
if x != nil {
|
||||
return x.Pubkey
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AttesterDuty) 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 *AttesterDuty) GetCommitteeIndex() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.CommitteeIndex {
|
||||
if x != nil {
|
||||
return x.CommitteeIndex
|
||||
}
|
||||
return github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.CommitteeIndex(0)
|
||||
}
|
||||
|
||||
func (x *AttesterDuty) GetCommitteeLength() uint64 {
|
||||
if x != nil {
|
||||
return x.CommitteeLength
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AttesterDuty) GetCommitteesAtSlot() uint64 {
|
||||
if x != nil {
|
||||
return x.CommitteesAtSlot
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AttesterDuty) GetValidatorCommitteeIndex() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.CommitteeIndex {
|
||||
if x != nil {
|
||||
return x.ValidatorCommitteeIndex
|
||||
}
|
||||
return github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.CommitteeIndex(0)
|
||||
}
|
||||
|
||||
func (x *AttesterDuty) GetSlot() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot {
|
||||
if x != nil {
|
||||
return x.Slot
|
||||
}
|
||||
return github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot(0)
|
||||
}
|
||||
|
||||
type ProposerDutiesRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Epoch github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Epoch"`
|
||||
}
|
||||
|
||||
func (x *ProposerDutiesRequest) Reset() {
|
||||
*x = ProposerDutiesRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v1_validator_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ProposerDutiesRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ProposerDutiesRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ProposerDutiesRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_eth_v1_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 ProposerDutiesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ProposerDutiesRequest) Descriptor() ([]byte, []int) {
|
||||
return file_proto_eth_v1_validator_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *ProposerDutiesRequest) GetEpoch() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch {
|
||||
if x != nil {
|
||||
return x.Epoch
|
||||
}
|
||||
return github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(0)
|
||||
}
|
||||
|
||||
type ProposerDutiesResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
DependentRoot []byte `protobuf:"bytes,1,opt,name=dependent_root,json=dependentRoot,proto3" json:"dependent_root,omitempty" ssz-size:"32"`
|
||||
Data []*ProposerDuty `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"`
|
||||
ExecutionOptimistic bool `protobuf:"varint,3,opt,name=execution_optimistic,json=executionOptimistic,proto3" json:"execution_optimistic,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ProposerDutiesResponse) Reset() {
|
||||
*x = ProposerDutiesResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v1_validator_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ProposerDutiesResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ProposerDutiesResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ProposerDutiesResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_eth_v1_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 ProposerDutiesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ProposerDutiesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_proto_eth_v1_validator_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *ProposerDutiesResponse) GetDependentRoot() []byte {
|
||||
if x != nil {
|
||||
return x.DependentRoot
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ProposerDutiesResponse) GetData() []*ProposerDuty {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ProposerDutiesResponse) GetExecutionOptimistic() bool {
|
||||
if x != nil {
|
||||
return x.ExecutionOptimistic
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type ProposerDuty struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty" ssz-size:"48"`
|
||||
ValidatorIndex github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex `protobuf:"varint,2,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"`
|
||||
Slot github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot `protobuf:"varint,3,opt,name=slot,proto3" json:"slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"`
|
||||
}
|
||||
|
||||
func (x *ProposerDuty) Reset() {
|
||||
*x = ProposerDuty{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v1_validator_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ProposerDuty) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ProposerDuty) ProtoMessage() {}
|
||||
|
||||
func (x *ProposerDuty) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_eth_v1_validator_proto_msgTypes[7]
|
||||
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 ProposerDuty.ProtoReflect.Descriptor instead.
|
||||
func (*ProposerDuty) Descriptor() ([]byte, []int) {
|
||||
return file_proto_eth_v1_validator_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *ProposerDuty) GetPubkey() []byte {
|
||||
if x != nil {
|
||||
return x.Pubkey
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ProposerDuty) 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 *ProposerDuty) GetSlot() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot {
|
||||
if x != nil {
|
||||
return x.Slot
|
||||
}
|
||||
return github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot(0)
|
||||
}
|
||||
|
||||
type ProduceBlockRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -676,7 +290,7 @@ type ProduceBlockRequest struct {
|
||||
func (x *ProduceBlockRequest) Reset() {
|
||||
*x = ProduceBlockRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v1_validator_proto_msgTypes[8]
|
||||
mi := &file_proto_eth_v1_validator_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -689,7 +303,7 @@ func (x *ProduceBlockRequest) String() string {
|
||||
func (*ProduceBlockRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ProduceBlockRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_eth_v1_validator_proto_msgTypes[8]
|
||||
mi := &file_proto_eth_v1_validator_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -702,7 +316,7 @@ func (x *ProduceBlockRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use ProduceBlockRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ProduceBlockRequest) Descriptor() ([]byte, []int) {
|
||||
return file_proto_eth_v1_validator_proto_rawDescGZIP(), []int{8}
|
||||
return file_proto_eth_v1_validator_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ProduceBlockRequest) GetSlot() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot {
|
||||
@@ -737,7 +351,7 @@ type ProduceBlockResponse struct {
|
||||
func (x *ProduceBlockResponse) Reset() {
|
||||
*x = ProduceBlockResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v1_validator_proto_msgTypes[9]
|
||||
mi := &file_proto_eth_v1_validator_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -750,7 +364,7 @@ func (x *ProduceBlockResponse) String() string {
|
||||
func (*ProduceBlockResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ProduceBlockResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_eth_v1_validator_proto_msgTypes[9]
|
||||
mi := &file_proto_eth_v1_validator_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -763,7 +377,7 @@ func (x *ProduceBlockResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use ProduceBlockResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ProduceBlockResponse) Descriptor() ([]byte, []int) {
|
||||
return file_proto_eth_v1_validator_proto_rawDescGZIP(), []int{9}
|
||||
return file_proto_eth_v1_validator_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *ProduceBlockResponse) GetData() *BeaconBlock {
|
||||
@@ -843,148 +457,50 @@ var file_proto_eth_v1_validator_proto_rawDesc = []byte{
|
||||
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, 0x11, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65,
|
||||
0x45, 0x70, 0x6f, 0x63, 0x68, 0x22, 0xdc, 0x01, 0x0a, 0x15, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74,
|
||||
0x65, 0x72, 0x44, 0x75, 0x74, 0x69, 0x65, 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, 0xad, 0x01, 0x0a, 0x16, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65,
|
||||
0x72, 0x44, 0x75, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
||||
0x2d, 0x0a, 0x0e, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f,
|
||||
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52,
|
||||
0x0d, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31,
|
||||
0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x65,
|
||||
0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x41,
|
||||
0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x44, 0x75, 0x74, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74,
|
||||
0x61, 0x12, 0x31, 0x0a, 0x14, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f,
|
||||
0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52,
|
||||
0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69,
|
||||
0x73, 0x74, 0x69, 0x63, 0x22, 0xe4, 0x04, 0x0a, 0x0c, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65,
|
||||
0x72, 0x44, 0x75, 0x74, 0x79, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70,
|
||||
0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
|
||||
0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 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,
|
||||
0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12,
|
||||
0x78, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64,
|
||||
0x65, 0x78, 0x18, 0x03, 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, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
|
||||
0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69,
|
||||
0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6d,
|
||||
0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x04, 0x20,
|
||||
0x01, 0x28, 0x04, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x4c, 0x65,
|
||||
0x6e, 0x67, 0x74, 0x68, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65,
|
||||
0x65, 0x73, 0x5f, 0x61, 0x74, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04,
|
||||
0x52, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x41, 0x74, 0x53, 0x6c,
|
||||
0x6f, 0x74, 0x12, 0x8b, 0x01, 0x0a, 0x19, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72,
|
||||
0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78,
|
||||
0x18, 0x06, 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, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74,
|
||||
0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
|
||||
0x6f, 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78,
|
||||
0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x07, 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, 0x22, 0x75, 0x0a, 0x15, 0x50,
|
||||
0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x44, 0x75, 0x74, 0x69, 0x65, 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, 0x22, 0xad, 0x01, 0x0a, 0x16, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x44,
|
||||
0x75, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a,
|
||||
0x0e, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x64,
|
||||
0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x04,
|
||||
0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x65, 0x74, 0x68,
|
||||
0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f,
|
||||
0x70, 0x6f, 0x73, 0x65, 0x72, 0x44, 0x75, 0x74, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12,
|
||||
0x31, 0x0a, 0x14, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74,
|
||||
0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65,
|
||||
0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74,
|
||||
0x69, 0x63, 0x22, 0x83, 0x02, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x44,
|
||||
0x75, 0x74, 0x79, 0x12, 0x1e, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62,
|
||||
0x6b, 0x65, 0x79, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72,
|
||||
0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 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, 0x0e, 0x76,
|
||||
0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x59, 0x0a,
|
||||
0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18,
|
||||
0x45, 0x70, 0x6f, 0x63, 0x68, 0x22, 0xd3, 0x01, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63,
|
||||
0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 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, 0x22, 0xd3, 0x01, 0x0a, 0x13, 0x50, 0x72, 0x6f,
|
||||
0x64, 0x75, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 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, 0x2b, 0x0a, 0x0d, 0x72,
|
||||
0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64,
|
||||
0x61, 0x6f, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x27, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66,
|
||||
0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02,
|
||||
0x33, 0x32, 0x48, 0x00, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x88, 0x01,
|
||||
0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x22, 0x48,
|
||||
0x0a, 0x14, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e,
|
||||
0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f,
|
||||
0x63, 0x6b, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x2a, 0x87, 0x02, 0x0a, 0x0f, 0x56, 0x61, 0x6c,
|
||||
0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x17, 0x0a, 0x13,
|
||||
0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x4c, 0x49,
|
||||
0x5a, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47,
|
||||
0x5f, 0x51, 0x55, 0x45, 0x55, 0x45, 0x44, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x43, 0x54,
|
||||
0x49, 0x56, 0x45, 0x5f, 0x4f, 0x4e, 0x47, 0x4f, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x12, 0x0a,
|
||||
0x0e, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x5f, 0x45, 0x58, 0x49, 0x54, 0x49, 0x4e, 0x47, 0x10,
|
||||
0x03, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x5f, 0x53, 0x4c, 0x41, 0x53,
|
||||
0x48, 0x45, 0x44, 0x10, 0x04, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x58, 0x49, 0x54, 0x45, 0x44, 0x5f,
|
||||
0x55, 0x4e, 0x53, 0x4c, 0x41, 0x53, 0x48, 0x45, 0x44, 0x10, 0x05, 0x12, 0x12, 0x0a, 0x0e, 0x45,
|
||||
0x58, 0x49, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x4c, 0x41, 0x53, 0x48, 0x45, 0x44, 0x10, 0x06, 0x12,
|
||||
0x17, 0x0a, 0x13, 0x57, 0x49, 0x54, 0x48, 0x44, 0x52, 0x41, 0x57, 0x41, 0x4c, 0x5f, 0x50, 0x4f,
|
||||
0x53, 0x53, 0x49, 0x42, 0x4c, 0x45, 0x10, 0x07, 0x12, 0x13, 0x0a, 0x0f, 0x57, 0x49, 0x54, 0x48,
|
||||
0x44, 0x52, 0x41, 0x57, 0x41, 0x4c, 0x5f, 0x44, 0x4f, 0x4e, 0x45, 0x10, 0x08, 0x12, 0x0a, 0x0a,
|
||||
0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x09, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x45, 0x4e,
|
||||
0x44, 0x49, 0x4e, 0x47, 0x10, 0x0a, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x58, 0x49, 0x54, 0x45, 0x44,
|
||||
0x10, 0x0b, 0x12, 0x0e, 0x0a, 0x0a, 0x57, 0x49, 0x54, 0x48, 0x44, 0x52, 0x41, 0x57, 0x41, 0x4c,
|
||||
0x10, 0x0c, 0x42, 0x7b, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65,
|
||||
0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64,
|
||||
0x61, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 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, 0x31, 0xaa, 0x02, 0x0f, 0x45, 0x74,
|
||||
0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f,
|
||||
0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64,
|
||||
0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42,
|
||||
0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52,
|
||||
0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x27, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74,
|
||||
0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x48,
|
||||
0x00, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x88, 0x01, 0x01, 0x42, 0x0b,
|
||||
0x0a, 0x09, 0x5f, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x22, 0x48, 0x0a, 0x14, 0x50,
|
||||
0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68,
|
||||
0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52,
|
||||
0x04, 0x64, 0x61, 0x74, 0x61, 0x2a, 0x87, 0x02, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61,
|
||||
0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x17, 0x0a, 0x13, 0x50, 0x45, 0x4e,
|
||||
0x44, 0x49, 0x4e, 0x47, 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x4c, 0x49, 0x5a, 0x45, 0x44,
|
||||
0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x51, 0x55,
|
||||
0x45, 0x55, 0x45, 0x44, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45,
|
||||
0x5f, 0x4f, 0x4e, 0x47, 0x4f, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x43,
|
||||
0x54, 0x49, 0x56, 0x45, 0x5f, 0x45, 0x58, 0x49, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x12,
|
||||
0x0a, 0x0e, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x5f, 0x53, 0x4c, 0x41, 0x53, 0x48, 0x45, 0x44,
|
||||
0x10, 0x04, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x58, 0x49, 0x54, 0x45, 0x44, 0x5f, 0x55, 0x4e, 0x53,
|
||||
0x4c, 0x41, 0x53, 0x48, 0x45, 0x44, 0x10, 0x05, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x58, 0x49, 0x54,
|
||||
0x45, 0x44, 0x5f, 0x53, 0x4c, 0x41, 0x53, 0x48, 0x45, 0x44, 0x10, 0x06, 0x12, 0x17, 0x0a, 0x13,
|
||||
0x57, 0x49, 0x54, 0x48, 0x44, 0x52, 0x41, 0x57, 0x41, 0x4c, 0x5f, 0x50, 0x4f, 0x53, 0x53, 0x49,
|
||||
0x42, 0x4c, 0x45, 0x10, 0x07, 0x12, 0x13, 0x0a, 0x0f, 0x57, 0x49, 0x54, 0x48, 0x44, 0x52, 0x41,
|
||||
0x57, 0x41, 0x4c, 0x5f, 0x44, 0x4f, 0x4e, 0x45, 0x10, 0x08, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43,
|
||||
0x54, 0x49, 0x56, 0x45, 0x10, 0x09, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e,
|
||||
0x47, 0x10, 0x0a, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x58, 0x49, 0x54, 0x45, 0x44, 0x10, 0x0b, 0x12,
|
||||
0x0e, 0x0a, 0x0a, 0x57, 0x49, 0x54, 0x48, 0x44, 0x52, 0x41, 0x57, 0x41, 0x4c, 0x10, 0x0c, 0x42,
|
||||
0x7b, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e,
|
||||
0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f,
|
||||
0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 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, 0x31, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72,
|
||||
0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68,
|
||||
0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -1000,32 +516,24 @@ func file_proto_eth_v1_validator_proto_rawDescGZIP() []byte {
|
||||
}
|
||||
|
||||
var file_proto_eth_v1_validator_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_proto_eth_v1_validator_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
|
||||
var file_proto_eth_v1_validator_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_proto_eth_v1_validator_proto_goTypes = []interface{}{
|
||||
(ValidatorStatus)(0), // 0: ethereum.eth.v1.ValidatorStatus
|
||||
(*ValidatorContainer)(nil), // 1: ethereum.eth.v1.ValidatorContainer
|
||||
(*Validator)(nil), // 2: ethereum.eth.v1.Validator
|
||||
(*AttesterDutiesRequest)(nil), // 3: ethereum.eth.v1.AttesterDutiesRequest
|
||||
(*AttesterDutiesResponse)(nil), // 4: ethereum.eth.v1.AttesterDutiesResponse
|
||||
(*AttesterDuty)(nil), // 5: ethereum.eth.v1.AttesterDuty
|
||||
(*ProposerDutiesRequest)(nil), // 6: ethereum.eth.v1.ProposerDutiesRequest
|
||||
(*ProposerDutiesResponse)(nil), // 7: ethereum.eth.v1.ProposerDutiesResponse
|
||||
(*ProposerDuty)(nil), // 8: ethereum.eth.v1.ProposerDuty
|
||||
(*ProduceBlockRequest)(nil), // 9: ethereum.eth.v1.ProduceBlockRequest
|
||||
(*ProduceBlockResponse)(nil), // 10: ethereum.eth.v1.ProduceBlockResponse
|
||||
(*BeaconBlock)(nil), // 11: ethereum.eth.v1.BeaconBlock
|
||||
(ValidatorStatus)(0), // 0: ethereum.eth.v1.ValidatorStatus
|
||||
(*ValidatorContainer)(nil), // 1: ethereum.eth.v1.ValidatorContainer
|
||||
(*Validator)(nil), // 2: ethereum.eth.v1.Validator
|
||||
(*ProduceBlockRequest)(nil), // 3: ethereum.eth.v1.ProduceBlockRequest
|
||||
(*ProduceBlockResponse)(nil), // 4: ethereum.eth.v1.ProduceBlockResponse
|
||||
(*BeaconBlock)(nil), // 5: ethereum.eth.v1.BeaconBlock
|
||||
}
|
||||
var file_proto_eth_v1_validator_proto_depIdxs = []int32{
|
||||
0, // 0: ethereum.eth.v1.ValidatorContainer.status:type_name -> ethereum.eth.v1.ValidatorStatus
|
||||
2, // 1: ethereum.eth.v1.ValidatorContainer.validator:type_name -> ethereum.eth.v1.Validator
|
||||
5, // 2: ethereum.eth.v1.AttesterDutiesResponse.data:type_name -> ethereum.eth.v1.AttesterDuty
|
||||
8, // 3: ethereum.eth.v1.ProposerDutiesResponse.data:type_name -> ethereum.eth.v1.ProposerDuty
|
||||
11, // 4: ethereum.eth.v1.ProduceBlockResponse.data:type_name -> ethereum.eth.v1.BeaconBlock
|
||||
5, // [5:5] is the sub-list for method output_type
|
||||
5, // [5:5] is the sub-list for method input_type
|
||||
5, // [5:5] is the sub-list for extension type_name
|
||||
5, // [5:5] is the sub-list for extension extendee
|
||||
0, // [0:5] is the sub-list for field type_name
|
||||
0, // 0: ethereum.eth.v1.ValidatorContainer.status:type_name -> ethereum.eth.v1.ValidatorStatus
|
||||
2, // 1: ethereum.eth.v1.ValidatorContainer.validator:type_name -> ethereum.eth.v1.Validator
|
||||
5, // 2: ethereum.eth.v1.ProduceBlockResponse.data:type_name -> ethereum.eth.v1.BeaconBlock
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_proto_eth_v1_validator_proto_init() }
|
||||
@@ -1060,78 +568,6 @@ func file_proto_eth_v1_validator_proto_init() {
|
||||
}
|
||||
}
|
||||
file_proto_eth_v1_validator_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AttesterDutiesRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_eth_v1_validator_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AttesterDutiesResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_eth_v1_validator_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AttesterDuty); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_eth_v1_validator_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ProposerDutiesRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_eth_v1_validator_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ProposerDutiesResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_eth_v1_validator_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ProposerDuty); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_eth_v1_validator_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ProduceBlockRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -1143,7 +579,7 @@ func file_proto_eth_v1_validator_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_eth_v1_validator_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_proto_eth_v1_validator_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ProduceBlockResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -1156,14 +592,14 @@ func file_proto_eth_v1_validator_proto_init() {
|
||||
}
|
||||
}
|
||||
}
|
||||
file_proto_eth_v1_validator_proto_msgTypes[8].OneofWrappers = []interface{}{}
|
||||
file_proto_eth_v1_validator_proto_msgTypes[2].OneofWrappers = []interface{}{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_proto_eth_v1_validator_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 10,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
||||
@@ -87,65 +87,6 @@ enum ValidatorStatus {
|
||||
WITHDRAWAL = 12;
|
||||
}
|
||||
|
||||
message AttesterDutiesRequest {
|
||||
// Epoch to request, should only be allowed 1 epoch ahead.
|
||||
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Epoch"];
|
||||
|
||||
// Validator indices to request duties for.
|
||||
repeated uint64 index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"];
|
||||
}
|
||||
|
||||
message AttesterDutiesResponse {
|
||||
bytes dependent_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
repeated AttesterDuty data = 2;
|
||||
bool execution_optimistic = 3;
|
||||
}
|
||||
|
||||
message AttesterDuty {
|
||||
// 48 byte BLS public key for the validator who's assigned to perform a duty.
|
||||
bytes pubkey = 1 [(ethereum.eth.ext.ssz_size) = "48"];
|
||||
|
||||
// The index of the validator in the beacon state.
|
||||
uint64 validator_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"];
|
||||
|
||||
// The index of the committee where the validator belongs to.
|
||||
uint64 committee_index = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.CommitteeIndex"];
|
||||
|
||||
// The length of the committee the validator belongs to.
|
||||
uint64 committee_length = 4;
|
||||
|
||||
// The total amount of committees for this slot.
|
||||
uint64 committees_at_slot = 5;
|
||||
|
||||
// The index of the validator in the committee.
|
||||
uint64 validator_committee_index = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.CommitteeIndex"];
|
||||
|
||||
// The slot this duty is for.
|
||||
uint64 slot = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"];
|
||||
}
|
||||
|
||||
message ProposerDutiesRequest {
|
||||
// Epoch to request duties for.
|
||||
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Epoch"];
|
||||
}
|
||||
|
||||
message ProposerDutiesResponse {
|
||||
bytes dependent_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
repeated ProposerDuty data = 2;
|
||||
bool execution_optimistic = 3;
|
||||
}
|
||||
|
||||
message ProposerDuty {
|
||||
// 48 byte BLS public key for the validator who's assigned to perform a duty.
|
||||
bytes pubkey = 1 [(ethereum.eth.ext.ssz_size) = "48"];
|
||||
|
||||
// The index of the validator in the beacon state.
|
||||
uint64 validator_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"];
|
||||
|
||||
// The slot this duty is for.
|
||||
uint64 slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"];
|
||||
}
|
||||
|
||||
message ProduceBlockRequest {
|
||||
// The slot to request a block for.
|
||||
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"];
|
||||
|
||||
548
proto/eth/v2/validator.pb.go
generated
548
proto/eth/v2/validator.pb.go
generated
@@ -24,179 +24,6 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type SyncCommitteeDutiesRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Epoch github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Epoch"`
|
||||
Index []github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex `protobuf:"varint,2,rep,packed,name=index,proto3" json:"index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"`
|
||||
}
|
||||
|
||||
func (x *SyncCommitteeDutiesRequest) Reset() {
|
||||
*x = SyncCommitteeDutiesRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SyncCommitteeDutiesRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SyncCommitteeDutiesRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SyncCommitteeDutiesRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[0]
|
||||
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 SyncCommitteeDutiesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SyncCommitteeDutiesRequest) Descriptor() ([]byte, []int) {
|
||||
return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *SyncCommitteeDutiesRequest) GetEpoch() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch {
|
||||
if x != nil {
|
||||
return x.Epoch
|
||||
}
|
||||
return github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(0)
|
||||
}
|
||||
|
||||
func (x *SyncCommitteeDutiesRequest) GetIndex() []github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex {
|
||||
if x != nil {
|
||||
return x.Index
|
||||
}
|
||||
return []github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex(nil)
|
||||
}
|
||||
|
||||
type SyncCommitteeDutiesResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Data []*SyncCommitteeDuty `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
|
||||
ExecutionOptimistic bool `protobuf:"varint,2,opt,name=execution_optimistic,json=executionOptimistic,proto3" json:"execution_optimistic,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SyncCommitteeDutiesResponse) Reset() {
|
||||
*x = SyncCommitteeDutiesResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SyncCommitteeDutiesResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SyncCommitteeDutiesResponse) ProtoMessage() {}
|
||||
|
||||
func (x *SyncCommitteeDutiesResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[1]
|
||||
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 SyncCommitteeDutiesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*SyncCommitteeDutiesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *SyncCommitteeDutiesResponse) GetData() []*SyncCommitteeDuty {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SyncCommitteeDutiesResponse) GetExecutionOptimistic() bool {
|
||||
if x != nil {
|
||||
return x.ExecutionOptimistic
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type SyncCommitteeDuty struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty" ssz-size:"48"`
|
||||
ValidatorIndex github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex `protobuf:"varint,2,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"`
|
||||
ValidatorSyncCommitteeIndices []uint64 `protobuf:"varint,3,rep,packed,name=validator_sync_committee_indices,json=validatorSyncCommitteeIndices,proto3" json:"validator_sync_committee_indices,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SyncCommitteeDuty) Reset() {
|
||||
*x = SyncCommitteeDuty{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SyncCommitteeDuty) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SyncCommitteeDuty) ProtoMessage() {}
|
||||
|
||||
func (x *SyncCommitteeDuty) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[2]
|
||||
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 SyncCommitteeDuty.ProtoReflect.Descriptor instead.
|
||||
func (*SyncCommitteeDuty) Descriptor() ([]byte, []int) {
|
||||
return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *SyncCommitteeDuty) GetPubkey() []byte {
|
||||
if x != nil {
|
||||
return x.Pubkey
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SyncCommitteeDuty) 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 *SyncCommitteeDuty) GetValidatorSyncCommitteeIndices() []uint64 {
|
||||
if x != nil {
|
||||
return x.ValidatorSyncCommitteeIndices
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ProduceBlockResponseV2 struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -209,7 +36,7 @@ type ProduceBlockResponseV2 struct {
|
||||
func (x *ProduceBlockResponseV2) Reset() {
|
||||
*x = ProduceBlockResponseV2{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[3]
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -222,7 +49,7 @@ func (x *ProduceBlockResponseV2) String() string {
|
||||
func (*ProduceBlockResponseV2) ProtoMessage() {}
|
||||
|
||||
func (x *ProduceBlockResponseV2) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[3]
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -235,7 +62,7 @@ func (x *ProduceBlockResponseV2) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use ProduceBlockResponseV2.ProtoReflect.Descriptor instead.
|
||||
func (*ProduceBlockResponseV2) Descriptor() ([]byte, []int) {
|
||||
return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{3}
|
||||
return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ProduceBlockResponseV2) GetVersion() Version {
|
||||
@@ -264,7 +91,7 @@ type ProduceBlindedBlockResponse struct {
|
||||
func (x *ProduceBlindedBlockResponse) Reset() {
|
||||
*x = ProduceBlindedBlockResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[4]
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -277,7 +104,7 @@ func (x *ProduceBlindedBlockResponse) String() string {
|
||||
func (*ProduceBlindedBlockResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ProduceBlindedBlockResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[4]
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -290,7 +117,7 @@ func (x *ProduceBlindedBlockResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use ProduceBlindedBlockResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ProduceBlindedBlockResponse) Descriptor() ([]byte, []int) {
|
||||
return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{4}
|
||||
return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *ProduceBlindedBlockResponse) GetVersion() Version {
|
||||
@@ -322,7 +149,7 @@ type SyncCommitteeContribution struct {
|
||||
func (x *SyncCommitteeContribution) Reset() {
|
||||
*x = SyncCommitteeContribution{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[5]
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -335,7 +162,7 @@ func (x *SyncCommitteeContribution) String() string {
|
||||
func (*SyncCommitteeContribution) ProtoMessage() {}
|
||||
|
||||
func (x *SyncCommitteeContribution) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[5]
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -348,7 +175,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{5}
|
||||
return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *SyncCommitteeContribution) GetSlot() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot {
|
||||
@@ -399,7 +226,7 @@ type ContributionAndProof struct {
|
||||
func (x *ContributionAndProof) Reset() {
|
||||
*x = ContributionAndProof{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[6]
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -412,7 +239,7 @@ func (x *ContributionAndProof) String() string {
|
||||
func (*ContributionAndProof) ProtoMessage() {}
|
||||
|
||||
func (x *ContributionAndProof) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[6]
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -425,7 +252,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{6}
|
||||
return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *ContributionAndProof) GetAggregatorIndex() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex {
|
||||
@@ -461,7 +288,7 @@ type SignedContributionAndProof struct {
|
||||
func (x *SignedContributionAndProof) Reset() {
|
||||
*x = SignedContributionAndProof{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[7]
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -474,7 +301,7 @@ func (x *SignedContributionAndProof) String() string {
|
||||
func (*SignedContributionAndProof) ProtoMessage() {}
|
||||
|
||||
func (x *SignedContributionAndProof) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[7]
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -487,7 +314,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{7}
|
||||
return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *SignedContributionAndProof) GetMessage() *ContributionAndProof {
|
||||
@@ -516,7 +343,7 @@ type GetLivenessRequest struct {
|
||||
func (x *GetLivenessRequest) Reset() {
|
||||
*x = GetLivenessRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[8]
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -529,7 +356,7 @@ func (x *GetLivenessRequest) String() string {
|
||||
func (*GetLivenessRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetLivenessRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[8]
|
||||
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 {
|
||||
@@ -542,7 +369,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{8}
|
||||
return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *GetLivenessRequest) GetEpoch() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch {
|
||||
@@ -570,7 +397,7 @@ type GetLivenessResponse struct {
|
||||
func (x *GetLivenessResponse) Reset() {
|
||||
*x = GetLivenessResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[9]
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -583,7 +410,7 @@ func (x *GetLivenessResponse) String() string {
|
||||
func (*GetLivenessResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetLivenessResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[9]
|
||||
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 {
|
||||
@@ -596,7 +423,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{9}
|
||||
return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *GetLivenessResponse) GetData() []*GetLivenessResponse_Liveness {
|
||||
@@ -618,7 +445,7 @@ type GetLivenessResponse_Liveness struct {
|
||||
func (x *GetLivenessResponse_Liveness) Reset() {
|
||||
*x = GetLivenessResponse_Liveness{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[10]
|
||||
mi := &file_proto_eth_v2_validator_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -631,7 +458,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[10]
|
||||
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 {
|
||||
@@ -644,7 +471,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{9, 0}
|
||||
return file_proto_eth_v2_validator_proto_rawDescGZIP(), []int{6, 0}
|
||||
}
|
||||
|
||||
func (x *GetLivenessResponse_Liveness) GetIndex() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex {
|
||||
@@ -672,8 +499,74 @@ var file_proto_eth_v2_validator_proto_rawDesc = []byte{
|
||||
0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f,
|
||||
0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x2f, 0x76, 0x65, 0x72, 0x73,
|
||||
0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe1, 0x01, 0x0a, 0x1a, 0x53, 0x79,
|
||||
0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x44, 0x75, 0x74, 0x69, 0x65,
|
||||
0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x89, 0x01, 0x0a, 0x16, 0x50, 0x72,
|
||||
0x6f, 0x64, 0x75, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x56, 0x32, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d,
|
||||
0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52,
|
||||
0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75,
|
||||
0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42,
|
||||
0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x56, 0x32, 0x52,
|
||||
0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x93, 0x01, 0x0a, 0x1b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63,
|
||||
0x65, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75,
|
||||
0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
|
||||
0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x04, 0x64, 0x61, 0x74,
|
||||
0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 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, 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,
|
||||
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,
|
||||
@@ -686,135 +579,30 @@ var file_proto_eth_v2_validator_proto_rawDesc = []byte{
|
||||
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, 0x88, 0x01,
|
||||
0x0a, 0x1b, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x44,
|
||||
0x75, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a,
|
||||
0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 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, 0x44, 0x75, 0x74, 0x79, 0x52,
|
||||
0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x31, 0x0a, 0x14, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70,
|
||||
0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x22, 0xf6, 0x01, 0x0a, 0x11, 0x53, 0x79, 0x6e,
|
||||
0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x44, 0x75, 0x74, 0x79, 0x12, 0x1e,
|
||||
0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06,
|
||||
0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x78,
|
||||
0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65,
|
||||
0x78, 0x18, 0x02, 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, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
|
||||
0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x47, 0x0a, 0x20, 0x76, 0x61, 0x6c, 0x69,
|
||||
0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69,
|
||||
0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03,
|
||||
0x28, 0x04, 0x52, 0x1d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x79, 0x6e,
|
||||
0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65,
|
||||
0x73, 0x22, 0x89, 0x01, 0x0a, 0x16, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x42, 0x6c, 0x6f,
|
||||
0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x32, 0x12, 0x32, 0x0a, 0x07,
|
||||
0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e,
|
||||
0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e,
|
||||
0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
|
||||
0x12, 0x3b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27,
|
||||
0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32,
|
||||
0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74,
|
||||
0x61, 0x69, 0x6e, 0x65, 0x72, 0x56, 0x32, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x93, 0x01,
|
||||
0x0a, 0x1b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64,
|
||||
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a,
|
||||
0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18,
|
||||
0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32,
|
||||
0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x12, 0x40, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
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, 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, 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,
|
||||
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,
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -829,37 +617,33 @@ 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, 11)
|
||||
var file_proto_eth_v2_validator_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
|
||||
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
|
||||
(*SyncCommitteeContribution)(nil), // 5: ethereum.eth.v2.SyncCommitteeContribution
|
||||
(*ContributionAndProof)(nil), // 6: ethereum.eth.v2.ContributionAndProof
|
||||
(*SignedContributionAndProof)(nil), // 7: ethereum.eth.v2.SignedContributionAndProof
|
||||
(*GetLivenessRequest)(nil), // 8: ethereum.eth.v2.GetLivenessRequest
|
||||
(*GetLivenessResponse)(nil), // 9: ethereum.eth.v2.GetLivenessResponse
|
||||
(*GetLivenessResponse_Liveness)(nil), // 10: ethereum.eth.v2.GetLivenessResponse.Liveness
|
||||
(Version)(0), // 11: ethereum.eth.v2.Version
|
||||
(*BeaconBlockContainerV2)(nil), // 12: ethereum.eth.v2.BeaconBlockContainerV2
|
||||
(*BlindedBeaconBlockContainer)(nil), // 13: ethereum.eth.v2.BlindedBeaconBlockContainer
|
||||
(*ProduceBlockResponseV2)(nil), // 0: ethereum.eth.v2.ProduceBlockResponseV2
|
||||
(*ProduceBlindedBlockResponse)(nil), // 1: ethereum.eth.v2.ProduceBlindedBlockResponse
|
||||
(*SyncCommitteeContribution)(nil), // 2: ethereum.eth.v2.SyncCommitteeContribution
|
||||
(*ContributionAndProof)(nil), // 3: ethereum.eth.v2.ContributionAndProof
|
||||
(*SignedContributionAndProof)(nil), // 4: ethereum.eth.v2.SignedContributionAndProof
|
||||
(*GetLivenessRequest)(nil), // 5: ethereum.eth.v2.GetLivenessRequest
|
||||
(*GetLivenessResponse)(nil), // 6: ethereum.eth.v2.GetLivenessResponse
|
||||
(*GetLivenessResponse_Liveness)(nil), // 7: ethereum.eth.v2.GetLivenessResponse.Liveness
|
||||
(Version)(0), // 8: ethereum.eth.v2.Version
|
||||
(*BeaconBlockContainerV2)(nil), // 9: ethereum.eth.v2.BeaconBlockContainerV2
|
||||
(*BlindedBeaconBlockContainer)(nil), // 10: 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
|
||||
11, // 1: ethereum.eth.v2.ProduceBlockResponseV2.version:type_name -> ethereum.eth.v2.Version
|
||||
12, // 2: ethereum.eth.v2.ProduceBlockResponseV2.data:type_name -> ethereum.eth.v2.BeaconBlockContainerV2
|
||||
11, // 3: ethereum.eth.v2.ProduceBlindedBlockResponse.version:type_name -> ethereum.eth.v2.Version
|
||||
13, // 4: ethereum.eth.v2.ProduceBlindedBlockResponse.data:type_name -> ethereum.eth.v2.BlindedBeaconBlockContainer
|
||||
5, // 5: ethereum.eth.v2.ContributionAndProof.contribution:type_name -> ethereum.eth.v2.SyncCommitteeContribution
|
||||
6, // 6: ethereum.eth.v2.SignedContributionAndProof.message:type_name -> ethereum.eth.v2.ContributionAndProof
|
||||
10, // 7: ethereum.eth.v2.GetLivenessResponse.data:type_name -> ethereum.eth.v2.GetLivenessResponse.Liveness
|
||||
8, // [8:8] is the sub-list for method output_type
|
||||
8, // [8:8] is the sub-list for method input_type
|
||||
8, // [8:8] is the sub-list for extension type_name
|
||||
8, // [8:8] is the sub-list for extension extendee
|
||||
0, // [0:8] is the sub-list for field type_name
|
||||
8, // 0: ethereum.eth.v2.ProduceBlockResponseV2.version:type_name -> ethereum.eth.v2.Version
|
||||
9, // 1: ethereum.eth.v2.ProduceBlockResponseV2.data:type_name -> ethereum.eth.v2.BeaconBlockContainerV2
|
||||
8, // 2: ethereum.eth.v2.ProduceBlindedBlockResponse.version:type_name -> ethereum.eth.v2.Version
|
||||
10, // 3: ethereum.eth.v2.ProduceBlindedBlockResponse.data:type_name -> ethereum.eth.v2.BlindedBeaconBlockContainer
|
||||
2, // 4: ethereum.eth.v2.ContributionAndProof.contribution:type_name -> ethereum.eth.v2.SyncCommitteeContribution
|
||||
3, // 5: ethereum.eth.v2.SignedContributionAndProof.message:type_name -> ethereum.eth.v2.ContributionAndProof
|
||||
7, // 6: ethereum.eth.v2.GetLivenessResponse.data:type_name -> ethereum.eth.v2.GetLivenessResponse.Liveness
|
||||
7, // [7:7] is the sub-list for method output_type
|
||||
7, // [7:7] is the sub-list for method input_type
|
||||
7, // [7:7] is the sub-list for extension type_name
|
||||
7, // [7:7] is the sub-list for extension extendee
|
||||
0, // [0:7] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_proto_eth_v2_validator_proto_init() }
|
||||
@@ -871,42 +655,6 @@ func file_proto_eth_v2_validator_proto_init() {
|
||||
file_proto_eth_v2_version_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_proto_eth_v2_validator_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SyncCommitteeDutiesRequest); 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[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SyncCommitteeDutiesResponse); 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[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SyncCommitteeDuty); 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[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ProduceBlockResponseV2); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -918,7 +666,7 @@ func file_proto_eth_v2_validator_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_eth_v2_validator_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_proto_eth_v2_validator_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ProduceBlindedBlockResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -930,7 +678,7 @@ func file_proto_eth_v2_validator_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_eth_v2_validator_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_proto_eth_v2_validator_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SyncCommitteeContribution); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -942,7 +690,7 @@ func file_proto_eth_v2_validator_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_eth_v2_validator_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_proto_eth_v2_validator_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ContributionAndProof); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -954,7 +702,7 @@ func file_proto_eth_v2_validator_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_eth_v2_validator_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_proto_eth_v2_validator_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SignedContributionAndProof); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -966,7 +714,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[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetLivenessRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -978,7 +726,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[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetLivenessResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -990,7 +738,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[7].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetLivenessResponse_Liveness); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -1009,7 +757,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: 11,
|
||||
NumMessages: 8,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
||||
@@ -26,30 +26,6 @@ option java_outer_classname = "ValidatorProto";
|
||||
option java_package = "org.ethereum.eth.v2";
|
||||
option php_namespace = "Ethereum\\Eth\\v2";
|
||||
|
||||
message SyncCommitteeDutiesRequest {
|
||||
// Must fulfill: epoch // EPOCHS_PER_SYNC_COMMITTEE_PERIOD <= current_epoch // EPOCHS_PER_SYNC_COMMITTEE_PERIOD + 1
|
||||
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Epoch"];
|
||||
|
||||
// Validator indices to request duties for.
|
||||
repeated uint64 index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"];
|
||||
}
|
||||
|
||||
message SyncCommitteeDutiesResponse {
|
||||
repeated SyncCommitteeDuty data = 1;
|
||||
bool execution_optimistic = 2;
|
||||
}
|
||||
|
||||
message SyncCommitteeDuty {
|
||||
// The validator's BLS public key, uniquely identifying them.
|
||||
bytes pubkey = 1 [(ethereum.eth.ext.ssz_size) = "48"];
|
||||
|
||||
// Index of validator in validator registry.
|
||||
uint64 validator_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"];
|
||||
|
||||
// The indices of the validator in the sync committee.
|
||||
repeated uint64 validator_sync_committee_indices = 3;
|
||||
}
|
||||
|
||||
message ProduceBlockResponseV2 {
|
||||
Version version = 1;
|
||||
BeaconBlockContainerV2 data = 2;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package evaluators
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
@@ -11,7 +10,6 @@ import (
|
||||
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
||||
"github.com/prysmaticlabs/prysm/v4/proto/eth/service"
|
||||
ethpbv1 "github.com/prysmaticlabs/prysm/v4/proto/eth/v1"
|
||||
ethpbv2 "github.com/prysmaticlabs/prysm/v4/proto/eth/v2"
|
||||
@@ -58,7 +56,6 @@ func apiMiddlewareVerify(_ *e2etypes.EvaluationContext, conns ...*grpc.ClientCon
|
||||
conn,
|
||||
withCompareValidatorsEth,
|
||||
withCompareSyncCommittee,
|
||||
withCompareAttesterDuties,
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -190,53 +187,6 @@ func withCompareSyncCommittee(beaconNodeIdx int, conn *grpc.ClientConn) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func withCompareAttesterDuties(beaconNodeIdx int, conn *grpc.ClientConn) error {
|
||||
type attesterDutyJson struct {
|
||||
Pubkey string `json:"pubkey" hex:"true"`
|
||||
ValidatorIndex string `json:"validator_index"`
|
||||
CommitteeIndex string `json:"committee_index"`
|
||||
CommitteeLength string `json:"committee_length"`
|
||||
CommitteesAtSlot string `json:"committees_at_slot"`
|
||||
ValidatorCommitteeIndex string `json:"validator_committee_index"`
|
||||
Slot string `json:"slot"`
|
||||
}
|
||||
type attesterDutiesResponseJson struct {
|
||||
DependentRoot string `json:"dependent_root" hex:"true"`
|
||||
Data []*attesterDutyJson `json:"data"`
|
||||
}
|
||||
ctx := context.Background()
|
||||
validatorClient := service.NewBeaconValidatorClient(conn)
|
||||
resp, err := validatorClient.GetAttesterDuties(ctx, ðpbv1.AttesterDutiesRequest{
|
||||
Epoch: helpers.AltairE2EForkEpoch,
|
||||
Index: []primitives.ValidatorIndex{0},
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// We post a top-level array, not an object, as per the spec.
|
||||
reqJSON := []string{"0"}
|
||||
respJSON := &attesterDutiesResponseJson{}
|
||||
if err := doMiddlewareJSONPostRequestV1(
|
||||
"/validator/duties/attester/"+strconv.Itoa(helpers.AltairE2EForkEpoch),
|
||||
beaconNodeIdx,
|
||||
reqJSON,
|
||||
respJSON,
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
if respJSON.DependentRoot != hexutil.Encode(resp.DependentRoot) {
|
||||
return buildFieldError("DependentRoot", string(resp.DependentRoot), respJSON.DependentRoot)
|
||||
}
|
||||
if len(respJSON.Data) != len(resp.Data) {
|
||||
return fmt.Errorf(
|
||||
"API Middleware number of duties %d does not match gRPC %d",
|
||||
len(respJSON.Data),
|
||||
len(resp.Data),
|
||||
)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func doMiddlewareJSONGetRequestV1(requestPath string, beaconNodeIdx int, dst interface{}) error {
|
||||
basePath := fmt.Sprintf(v1MiddlewarePathTemplate, params.TestParams.Ports.PrysmBeaconNodeGatewayPort+beaconNodeIdx)
|
||||
httpResp, err := http.Get(
|
||||
@@ -248,23 +198,6 @@ func doMiddlewareJSONGetRequestV1(requestPath string, beaconNodeIdx int, dst int
|
||||
return json.NewDecoder(httpResp.Body).Decode(&dst)
|
||||
}
|
||||
|
||||
func doMiddlewareJSONPostRequestV1(requestPath string, beaconNodeIdx int, postData, dst interface{}) error {
|
||||
b, err := json.Marshal(postData)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
basePath := fmt.Sprintf(v1MiddlewarePathTemplate, params.TestParams.Ports.PrysmBeaconNodeGatewayPort+beaconNodeIdx)
|
||||
httpResp, err := http.Post(
|
||||
basePath+requestPath,
|
||||
"application/json",
|
||||
bytes.NewBuffer(b),
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return json.NewDecoder(httpResp.Body).Decode(&dst)
|
||||
}
|
||||
|
||||
func buildFieldError(field, expected, actual string) error {
|
||||
return fmt.Errorf("value of '%s' was expected to be '%s' but was '%s'", field, expected, actual)
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ go_library(
|
||||
deps = [
|
||||
"//beacon-chain/rpc/apimiddleware:go_default_library",
|
||||
"//beacon-chain/rpc/eth/beacon:go_default_library",
|
||||
"//beacon-chain/rpc/eth/validator:go_default_library",
|
||||
"//config/params:go_default_library",
|
||||
"//consensus-types/primitives:go_default_library",
|
||||
"//proto/eth/service:go_default_library",
|
||||
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/apimiddleware"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/beacon"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/validator"
|
||||
"github.com/prysmaticlabs/prysm/v4/config/params"
|
||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
||||
"github.com/prysmaticlabs/prysm/v4/proto/eth/service"
|
||||
@@ -121,13 +122,13 @@ var beaconPathsAndObjects = map[string]metadata{
|
||||
return []string{fmt.Sprintf("%v", e)}
|
||||
},
|
||||
prysmResps: map[string]interface{}{
|
||||
"json": &apimiddleware.ProposerDutiesResponseJson{},
|
||||
"json": &validator.GetProposerDutiesResponse{},
|
||||
},
|
||||
lighthouseResps: map[string]interface{}{
|
||||
"json": &apimiddleware.ProposerDutiesResponseJson{},
|
||||
"json": &validator.GetProposerDutiesResponse{},
|
||||
},
|
||||
customEvaluation: func(prysmResp interface{}, lhouseResp interface{}) error {
|
||||
castedl, ok := lhouseResp.(*apimiddleware.ProposerDutiesResponseJson)
|
||||
castedl, ok := lhouseResp.(*validator.GetProposerDutiesResponse)
|
||||
if !ok {
|
||||
return errors.New("failed to cast type")
|
||||
}
|
||||
@@ -153,17 +154,17 @@ var beaconPathsAndObjects = map[string]metadata{
|
||||
return validatorIndices
|
||||
}(),
|
||||
prysmResps: map[string]interface{}{
|
||||
"json": &apimiddleware.AttesterDutiesResponseJson{},
|
||||
"json": &validator.GetAttesterDutiesResponse{},
|
||||
},
|
||||
lighthouseResps: map[string]interface{}{
|
||||
"json": &apimiddleware.AttesterDutiesResponseJson{},
|
||||
"json": &validator.GetAttesterDutiesResponse{},
|
||||
},
|
||||
customEvaluation: func(prysmResp interface{}, lhouseResp interface{}) error {
|
||||
castedp, ok := lhouseResp.(*apimiddleware.AttesterDutiesResponseJson)
|
||||
castedp, ok := lhouseResp.(*validator.GetAttesterDutiesResponse)
|
||||
if !ok {
|
||||
return errors.New("failed to cast type")
|
||||
}
|
||||
castedl, ok := lhouseResp.(*apimiddleware.AttesterDutiesResponseJson)
|
||||
castedl, ok := lhouseResp.(*validator.GetAttesterDutiesResponse)
|
||||
if !ok {
|
||||
return errors.New("failed to cast type")
|
||||
}
|
||||
@@ -376,7 +377,7 @@ func orderedEvaluationOnResponses(beaconPathsAndObjects map[string]metadata, gen
|
||||
return errors.New("failed to cast type")
|
||||
}
|
||||
proposerdutiesData := beaconPathsAndObjects["/validator/duties/proposer/{param1}"]
|
||||
prysmDuties, ok := proposerdutiesData.prysmResps["json"].(*apimiddleware.ProposerDutiesResponseJson)
|
||||
prysmDuties, ok := proposerdutiesData.prysmResps["json"].(*validator.GetProposerDutiesResponse)
|
||||
if !ok {
|
||||
return errors.New("failed to cast type")
|
||||
}
|
||||
|
||||
@@ -10,15 +10,16 @@ import (
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/apimiddleware"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/validator"
|
||||
"github.com/prysmaticlabs/prysm/v4/config/params"
|
||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
||||
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
||||
)
|
||||
|
||||
type dutiesProvider interface {
|
||||
GetAttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*apimiddleware.AttesterDutyJson, error)
|
||||
GetProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*apimiddleware.ProposerDutyJson, error)
|
||||
GetSyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*apimiddleware.SyncCommitteeDuty, error)
|
||||
GetAttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*validator.AttesterDuty, error)
|
||||
GetProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*validator.ProposerDuty, error)
|
||||
GetSyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*validator.SyncCommitteeDuty, error)
|
||||
GetCommittees(ctx context.Context, epoch primitives.Epoch) ([]*apimiddleware.CommitteeJson, error)
|
||||
}
|
||||
|
||||
@@ -68,14 +69,14 @@ func (c beaconApiValidatorClient) getDutiesForEpoch(
|
||||
return nil, errors.Wrapf(err, "failed to get attester duties for epoch `%d`", epoch)
|
||||
}
|
||||
|
||||
var syncDuties []*apimiddleware.SyncCommitteeDuty
|
||||
var syncDuties []*validator.SyncCommitteeDuty
|
||||
if fetchSyncDuties {
|
||||
if syncDuties, err = c.dutiesProvider.GetSyncDuties(ctx, epoch, multipleValidatorStatus.Indices); err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to get sync duties for epoch `%d`", epoch)
|
||||
}
|
||||
}
|
||||
|
||||
var proposerDuties []*apimiddleware.ProposerDutyJson
|
||||
var proposerDuties []*validator.ProposerDuty
|
||||
if proposerDuties, err = c.dutiesProvider.GetProposerDuties(ctx, epoch); err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to get proposer duties for epoch `%d`", epoch)
|
||||
}
|
||||
@@ -223,7 +224,7 @@ func (c beaconApiDutiesProvider) GetCommittees(ctx context.Context, epoch primit
|
||||
}
|
||||
|
||||
// GetAttesterDuties retrieves the attester duties for the given epoch and validatorIndices
|
||||
func (c beaconApiDutiesProvider) GetAttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*apimiddleware.AttesterDutyJson, error) {
|
||||
func (c beaconApiDutiesProvider) GetAttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*validator.AttesterDuty, error) {
|
||||
jsonValidatorIndices := make([]string, len(validatorIndices))
|
||||
for index, validatorIndex := range validatorIndices {
|
||||
jsonValidatorIndices[index] = strconv.FormatUint(uint64(validatorIndex), 10)
|
||||
@@ -234,7 +235,7 @@ func (c beaconApiDutiesProvider) GetAttesterDuties(ctx context.Context, epoch pr
|
||||
return nil, errors.Wrap(err, "failed to marshal validator indices")
|
||||
}
|
||||
|
||||
attesterDuties := &apimiddleware.AttesterDutiesResponseJson{}
|
||||
attesterDuties := &validator.GetAttesterDutiesResponse{}
|
||||
if _, err := c.jsonRestHandler.PostRestJson(ctx, fmt.Sprintf("/eth/v1/validator/duties/attester/%d", epoch), nil, bytes.NewBuffer(validatorIndicesBytes), attesterDuties); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to send POST data to REST endpoint")
|
||||
}
|
||||
@@ -249,8 +250,8 @@ func (c beaconApiDutiesProvider) GetAttesterDuties(ctx context.Context, epoch pr
|
||||
}
|
||||
|
||||
// GetProposerDuties retrieves the proposer duties for the given epoch
|
||||
func (c beaconApiDutiesProvider) GetProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*apimiddleware.ProposerDutyJson, error) {
|
||||
proposerDuties := apimiddleware.ProposerDutiesResponseJson{}
|
||||
func (c beaconApiDutiesProvider) GetProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*validator.ProposerDuty, error) {
|
||||
proposerDuties := validator.GetProposerDutiesResponse{}
|
||||
if _, err := c.jsonRestHandler.GetRestJsonResponse(ctx, fmt.Sprintf("/eth/v1/validator/duties/proposer/%d", epoch), &proposerDuties); err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to query proposer duties for epoch `%d`", epoch)
|
||||
}
|
||||
@@ -269,7 +270,7 @@ func (c beaconApiDutiesProvider) GetProposerDuties(ctx context.Context, epoch pr
|
||||
}
|
||||
|
||||
// GetSyncDuties retrieves the sync committee duties for the given epoch and validatorIndices
|
||||
func (c beaconApiDutiesProvider) GetSyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*apimiddleware.SyncCommitteeDuty, error) {
|
||||
func (c beaconApiDutiesProvider) GetSyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*validator.SyncCommitteeDuty, error) {
|
||||
jsonValidatorIndices := make([]string, len(validatorIndices))
|
||||
for index, validatorIndex := range validatorIndices {
|
||||
jsonValidatorIndices[index] = strconv.FormatUint(uint64(validatorIndex), 10)
|
||||
@@ -280,7 +281,7 @@ func (c beaconApiDutiesProvider) GetSyncDuties(ctx context.Context, epoch primit
|
||||
return nil, errors.Wrap(err, "failed to marshal validator indices")
|
||||
}
|
||||
|
||||
syncDuties := apimiddleware.SyncCommitteeDutiesResponseJson{}
|
||||
syncDuties := validator.GetSyncCommitteeDutiesResponse{}
|
||||
if _, err := c.jsonRestHandler.PostRestJson(ctx, fmt.Sprintf("/eth/v1/validator/duties/sync/%d", epoch), nil, bytes.NewBuffer(validatorIndicesBytes), &syncDuties); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to send POST data to REST endpoint")
|
||||
}
|
||||
|
||||
@@ -12,6 +12,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/validator"
|
||||
"github.com/prysmaticlabs/prysm/v4/config/params"
|
||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
||||
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
||||
@@ -32,8 +33,8 @@ func TestGetAttesterDuties_Valid(t *testing.T) {
|
||||
validatorIndicesBytes, err := json.Marshal(stringValidatorIndices)
|
||||
require.NoError(t, err)
|
||||
|
||||
expectedAttesterDuties := apimiddleware.AttesterDutiesResponseJson{
|
||||
Data: []*apimiddleware.AttesterDutyJson{
|
||||
expectedAttesterDuties := validator.GetAttesterDutiesResponse{
|
||||
Data: []*validator.AttesterDuty{
|
||||
{
|
||||
Pubkey: hexutil.Encode([]byte{1}),
|
||||
ValidatorIndex: "2",
|
||||
@@ -67,7 +68,7 @@ func TestGetAttesterDuties_Valid(t *testing.T) {
|
||||
fmt.Sprintf("%s/%d", getAttesterDutiesTestEndpoint, epoch),
|
||||
nil,
|
||||
bytes.NewBuffer(validatorIndicesBytes),
|
||||
&apimiddleware.AttesterDutiesResponseJson{},
|
||||
&validator.GetAttesterDutiesResponse{},
|
||||
).Return(
|
||||
nil,
|
||||
nil,
|
||||
@@ -128,8 +129,8 @@ func TestGetAttesterDuties_NilAttesterDuty(t *testing.T) {
|
||||
nil,
|
||||
).SetArg(
|
||||
4,
|
||||
apimiddleware.AttesterDutiesResponseJson{
|
||||
Data: []*apimiddleware.AttesterDutyJson{nil},
|
||||
validator.GetAttesterDutiesResponse{
|
||||
Data: []*validator.AttesterDuty{nil},
|
||||
},
|
||||
).Times(1)
|
||||
|
||||
@@ -141,8 +142,8 @@ func TestGetAttesterDuties_NilAttesterDuty(t *testing.T) {
|
||||
func TestGetProposerDuties_Valid(t *testing.T) {
|
||||
const epoch = primitives.Epoch(1)
|
||||
|
||||
expectedProposerDuties := apimiddleware.ProposerDutiesResponseJson{
|
||||
Data: []*apimiddleware.ProposerDutyJson{
|
||||
expectedProposerDuties := validator.GetProposerDutiesResponse{
|
||||
Data: []*validator.ProposerDuty{
|
||||
{
|
||||
Pubkey: hexutil.Encode([]byte{1}),
|
||||
ValidatorIndex: "2",
|
||||
@@ -165,7 +166,7 @@ func TestGetProposerDuties_Valid(t *testing.T) {
|
||||
jsonRestHandler.EXPECT().GetRestJsonResponse(
|
||||
ctx,
|
||||
fmt.Sprintf("%s/%d", getProposerDutiesTestEndpoint, epoch),
|
||||
&apimiddleware.ProposerDutiesResponseJson{},
|
||||
&validator.GetProposerDutiesResponse{},
|
||||
).Return(
|
||||
nil,
|
||||
nil,
|
||||
@@ -222,7 +223,7 @@ func TestGetProposerDuties_NilData(t *testing.T) {
|
||||
nil,
|
||||
).SetArg(
|
||||
2,
|
||||
apimiddleware.ProposerDutiesResponseJson{
|
||||
validator.GetProposerDutiesResponse{
|
||||
Data: nil,
|
||||
},
|
||||
).Times(1)
|
||||
@@ -250,8 +251,8 @@ func TestGetProposerDuties_NilProposerDuty(t *testing.T) {
|
||||
nil,
|
||||
).SetArg(
|
||||
2,
|
||||
apimiddleware.ProposerDutiesResponseJson{
|
||||
Data: []*apimiddleware.ProposerDutyJson{nil},
|
||||
validator.GetProposerDutiesResponse{
|
||||
Data: []*validator.ProposerDuty{nil},
|
||||
},
|
||||
).Times(1)
|
||||
|
||||
@@ -267,8 +268,8 @@ func TestGetSyncDuties_Valid(t *testing.T) {
|
||||
validatorIndicesBytes, err := json.Marshal(stringValidatorIndices)
|
||||
require.NoError(t, err)
|
||||
|
||||
expectedSyncDuties := apimiddleware.SyncCommitteeDutiesResponseJson{
|
||||
Data: []*apimiddleware.SyncCommitteeDuty{
|
||||
expectedSyncDuties := validator.GetSyncCommitteeDutiesResponse{
|
||||
Data: []*validator.SyncCommitteeDuty{
|
||||
{
|
||||
Pubkey: hexutil.Encode([]byte{1}),
|
||||
ValidatorIndex: "2",
|
||||
@@ -300,7 +301,7 @@ func TestGetSyncDuties_Valid(t *testing.T) {
|
||||
fmt.Sprintf("%s/%d", getSyncDutiesTestEndpoint, epoch),
|
||||
nil,
|
||||
bytes.NewBuffer(validatorIndicesBytes),
|
||||
&apimiddleware.SyncCommitteeDutiesResponseJson{},
|
||||
&validator.GetSyncCommitteeDutiesResponse{},
|
||||
).Return(
|
||||
nil,
|
||||
nil,
|
||||
@@ -361,7 +362,7 @@ func TestGetSyncDuties_NilData(t *testing.T) {
|
||||
nil,
|
||||
).SetArg(
|
||||
4,
|
||||
apimiddleware.SyncCommitteeDutiesResponseJson{
|
||||
validator.GetSyncCommitteeDutiesResponse{
|
||||
Data: nil,
|
||||
},
|
||||
).Times(1)
|
||||
@@ -391,8 +392,8 @@ func TestGetSyncDuties_NilSyncDuty(t *testing.T) {
|
||||
nil,
|
||||
).SetArg(
|
||||
4,
|
||||
apimiddleware.SyncCommitteeDutiesResponseJson{
|
||||
Data: []*apimiddleware.SyncCommitteeDuty{nil},
|
||||
validator.GetSyncCommitteeDutiesResponse{
|
||||
Data: []*validator.SyncCommitteeDuty{nil},
|
||||
},
|
||||
).Times(1)
|
||||
|
||||
@@ -540,11 +541,11 @@ func TestGetDutiesForEpoch_Error(t *testing.T) {
|
||||
testCases := []struct {
|
||||
name string
|
||||
expectedError string
|
||||
generateAttesterDuties func() []*apimiddleware.AttesterDutyJson
|
||||
generateAttesterDuties func() []*validator.AttesterDuty
|
||||
fetchAttesterDutiesError error
|
||||
generateProposerDuties func() []*apimiddleware.ProposerDutyJson
|
||||
generateProposerDuties func() []*validator.ProposerDuty
|
||||
fetchProposerDutiesError error
|
||||
generateSyncDuties func() []*apimiddleware.SyncCommitteeDuty
|
||||
generateSyncDuties func() []*validator.SyncCommitteeDuty
|
||||
fetchSyncDutiesError error
|
||||
generateCommittees func() []*apimiddleware.CommitteeJson
|
||||
fetchCommitteesError error
|
||||
@@ -573,7 +574,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) {
|
||||
{
|
||||
name: "bad attester validator index",
|
||||
expectedError: "failed to parse attester validator index `foo`",
|
||||
generateAttesterDuties: func() []*apimiddleware.AttesterDutyJson {
|
||||
generateAttesterDuties: func() []*validator.AttesterDuty {
|
||||
attesterDuties := generateValidAttesterDuties(pubkeys, validatorIndices, committeeIndices, committeeSlots)
|
||||
attesterDuties[0].ValidatorIndex = "foo"
|
||||
return attesterDuties
|
||||
@@ -582,7 +583,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) {
|
||||
{
|
||||
name: "bad attester slot",
|
||||
expectedError: "failed to parse attester slot `foo`",
|
||||
generateAttesterDuties: func() []*apimiddleware.AttesterDutyJson {
|
||||
generateAttesterDuties: func() []*validator.AttesterDuty {
|
||||
attesterDuties := generateValidAttesterDuties(pubkeys, validatorIndices, committeeIndices, committeeSlots)
|
||||
attesterDuties[0].Slot = "foo"
|
||||
return attesterDuties
|
||||
@@ -591,7 +592,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) {
|
||||
{
|
||||
name: "bad attester committee index",
|
||||
expectedError: "failed to parse attester committee index `foo`",
|
||||
generateAttesterDuties: func() []*apimiddleware.AttesterDutyJson {
|
||||
generateAttesterDuties: func() []*validator.AttesterDuty {
|
||||
attesterDuties := generateValidAttesterDuties(pubkeys, validatorIndices, committeeIndices, committeeSlots)
|
||||
attesterDuties[0].CommitteeIndex = "foo"
|
||||
return attesterDuties
|
||||
@@ -600,7 +601,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) {
|
||||
{
|
||||
name: "bad proposer validator index",
|
||||
expectedError: "failed to parse proposer validator index `foo`",
|
||||
generateProposerDuties: func() []*apimiddleware.ProposerDutyJson {
|
||||
generateProposerDuties: func() []*validator.ProposerDuty {
|
||||
proposerDuties := generateValidProposerDuties(pubkeys, validatorIndices, proposerSlots)
|
||||
proposerDuties[0].ValidatorIndex = "foo"
|
||||
return proposerDuties
|
||||
@@ -609,7 +610,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) {
|
||||
{
|
||||
name: "bad proposer slot",
|
||||
expectedError: "failed to parse proposer slot `foo`",
|
||||
generateProposerDuties: func() []*apimiddleware.ProposerDutyJson {
|
||||
generateProposerDuties: func() []*validator.ProposerDuty {
|
||||
proposerDuties := generateValidProposerDuties(pubkeys, validatorIndices, proposerSlots)
|
||||
proposerDuties[0].Slot = "foo"
|
||||
return proposerDuties
|
||||
@@ -618,7 +619,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) {
|
||||
{
|
||||
name: "bad sync validator index",
|
||||
expectedError: "failed to parse sync validator index `foo`",
|
||||
generateSyncDuties: func() []*apimiddleware.SyncCommitteeDuty {
|
||||
generateSyncDuties: func() []*validator.SyncCommitteeDuty {
|
||||
syncDuties := generateValidSyncDuties(pubkeys, validatorIndices)
|
||||
syncDuties[0].ValidatorIndex = "foo"
|
||||
return syncDuties
|
||||
@@ -654,7 +655,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) {
|
||||
{
|
||||
name: "committee index and slot not found in committees mapping",
|
||||
expectedError: "failed to find validators for committee index `1` and slot `2`",
|
||||
generateAttesterDuties: func() []*apimiddleware.AttesterDutyJson {
|
||||
generateAttesterDuties: func() []*validator.AttesterDuty {
|
||||
attesterDuties := generateValidAttesterDuties(pubkeys, validatorIndices, committeeIndices, committeeSlots)
|
||||
attesterDuties[0].CommitteeIndex = "1"
|
||||
attesterDuties[0].Slot = "2"
|
||||
@@ -673,21 +674,21 @@ func TestGetDutiesForEpoch_Error(t *testing.T) {
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
var attesterDuties []*apimiddleware.AttesterDutyJson
|
||||
var attesterDuties []*validator.AttesterDuty
|
||||
if testCase.generateAttesterDuties == nil {
|
||||
attesterDuties = generateValidAttesterDuties(pubkeys, validatorIndices, committeeIndices, committeeSlots)
|
||||
} else {
|
||||
attesterDuties = testCase.generateAttesterDuties()
|
||||
}
|
||||
|
||||
var proposerDuties []*apimiddleware.ProposerDutyJson
|
||||
var proposerDuties []*validator.ProposerDuty
|
||||
if testCase.generateProposerDuties == nil {
|
||||
proposerDuties = generateValidProposerDuties(pubkeys, validatorIndices, proposerSlots)
|
||||
} else {
|
||||
proposerDuties = testCase.generateProposerDuties()
|
||||
}
|
||||
|
||||
var syncDuties []*apimiddleware.SyncCommitteeDuty
|
||||
var syncDuties []*validator.SyncCommitteeDuty
|
||||
if testCase.generateSyncDuties == nil {
|
||||
syncDuties = generateValidSyncDuties(pubkeys, validatorIndices)
|
||||
} else {
|
||||
@@ -1396,8 +1397,8 @@ func generateValidCommittees(committeeIndices []primitives.CommitteeIndex, slots
|
||||
}
|
||||
}
|
||||
|
||||
func generateValidAttesterDuties(pubkeys [][]byte, validatorIndices []primitives.ValidatorIndex, committeeIndices []primitives.CommitteeIndex, slots []primitives.Slot) []*apimiddleware.AttesterDutyJson {
|
||||
return []*apimiddleware.AttesterDutyJson{
|
||||
func generateValidAttesterDuties(pubkeys [][]byte, validatorIndices []primitives.ValidatorIndex, committeeIndices []primitives.CommitteeIndex, slots []primitives.Slot) []*validator.AttesterDuty {
|
||||
return []*validator.AttesterDuty{
|
||||
{
|
||||
Pubkey: hexutil.Encode(pubkeys[0]),
|
||||
ValidatorIndex: strconv.FormatUint(uint64(validatorIndices[0]), 10),
|
||||
@@ -1437,8 +1438,8 @@ func generateValidAttesterDuties(pubkeys [][]byte, validatorIndices []primitives
|
||||
}
|
||||
}
|
||||
|
||||
func generateValidProposerDuties(pubkeys [][]byte, validatorIndices []primitives.ValidatorIndex, slots []primitives.Slot) []*apimiddleware.ProposerDutyJson {
|
||||
return []*apimiddleware.ProposerDutyJson{
|
||||
func generateValidProposerDuties(pubkeys [][]byte, validatorIndices []primitives.ValidatorIndex, slots []primitives.Slot) []*validator.ProposerDuty {
|
||||
return []*validator.ProposerDuty{
|
||||
{
|
||||
Pubkey: hexutil.Encode(pubkeys[4]),
|
||||
ValidatorIndex: strconv.FormatUint(uint64(validatorIndices[4]), 10),
|
||||
@@ -1482,8 +1483,8 @@ func generateValidProposerDuties(pubkeys [][]byte, validatorIndices []primitives
|
||||
}
|
||||
}
|
||||
|
||||
func generateValidSyncDuties(pubkeys [][]byte, validatorIndices []primitives.ValidatorIndex) []*apimiddleware.SyncCommitteeDuty {
|
||||
return []*apimiddleware.SyncCommitteeDuty{
|
||||
func generateValidSyncDuties(pubkeys [][]byte, validatorIndices []primitives.ValidatorIndex) []*validator.SyncCommitteeDuty {
|
||||
return []*validator.SyncCommitteeDuty{
|
||||
{
|
||||
Pubkey: hexutil.Encode(pubkeys[5]),
|
||||
ValidatorIndex: strconv.FormatUint(uint64(validatorIndices[5]), 10),
|
||||
|
||||
@@ -14,6 +14,7 @@ go_library(
|
||||
deps = [
|
||||
"//api/gateway/apimiddleware:go_default_library",
|
||||
"//beacon-chain/rpc/apimiddleware:go_default_library",
|
||||
"//beacon-chain/rpc/eth/validator:go_default_library",
|
||||
"//consensus-types/primitives:go_default_library",
|
||||
"//proto/prysm/v1alpha1:go_default_library",
|
||||
"@com_github_golang_mock//gomock:go_default_library",
|
||||
|
||||
13
validator/client/beacon-api/mock/duties_mock.go
generated
13
validator/client/beacon-api/mock/duties_mock.go
generated
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
apimiddleware "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/apimiddleware"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/validator"
|
||||
primitives "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
||||
)
|
||||
|
||||
@@ -37,10 +38,10 @@ func (m *MockdutiesProvider) EXPECT() *MockdutiesProviderMockRecorder {
|
||||
}
|
||||
|
||||
// GetAttesterDuties mocks base method.
|
||||
func (m *MockdutiesProvider) GetAttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*apimiddleware.AttesterDutyJson, error) {
|
||||
func (m *MockdutiesProvider) GetAttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*validator.AttesterDuty, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAttesterDuties", ctx, epoch, validatorIndices)
|
||||
ret0, _ := ret[0].([]*apimiddleware.AttesterDutyJson)
|
||||
ret0, _ := ret[0].([]*validator.AttesterDuty)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@@ -67,10 +68,10 @@ func (mr *MockdutiesProviderMockRecorder) GetCommittees(ctx, epoch interface{})
|
||||
}
|
||||
|
||||
// GetProposerDuties mocks base method.
|
||||
func (m *MockdutiesProvider) GetProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*apimiddleware.ProposerDutyJson, error) {
|
||||
func (m *MockdutiesProvider) GetProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*validator.ProposerDuty, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetProposerDuties", ctx, epoch)
|
||||
ret0, _ := ret[0].([]*apimiddleware.ProposerDutyJson)
|
||||
ret0, _ := ret[0].([]*validator.ProposerDuty)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@@ -82,10 +83,10 @@ func (mr *MockdutiesProviderMockRecorder) GetProposerDuties(ctx, epoch interface
|
||||
}
|
||||
|
||||
// GetSyncDuties mocks base method.
|
||||
func (m *MockdutiesProvider) GetSyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*apimiddleware.SyncCommitteeDuty, error) {
|
||||
func (m *MockdutiesProvider) GetSyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*validator.SyncCommitteeDuty, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetSyncDuties", ctx, epoch, validatorIndices)
|
||||
ret0, _ := ret[0].([]*apimiddleware.SyncCommitteeDuty)
|
||||
ret0, _ := ret[0].([]*validator.SyncCommitteeDuty)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ func TestSubmitAggregateSelectionProof(t *testing.T) {
|
||||
committeeIndex = primitives.CommitteeIndex(1)
|
||||
)
|
||||
|
||||
attesterDuties := []*apimiddleware.AttesterDutyJson{
|
||||
attesterDuties := []*validator.AttesterDuty{
|
||||
{
|
||||
Pubkey: pubkeyStr,
|
||||
ValidatorIndex: validatorIndex,
|
||||
@@ -69,7 +69,7 @@ func TestSubmitAggregateSelectionProof(t *testing.T) {
|
||||
dutiesErr error
|
||||
attestationDataErr error
|
||||
aggregateAttestationErr error
|
||||
duties []*apimiddleware.AttesterDutyJson
|
||||
duties []*validator.AttesterDuty
|
||||
validatorsCalled int
|
||||
attesterDutiesCalled int
|
||||
attestationDataCalled int
|
||||
@@ -129,7 +129,7 @@ func TestSubmitAggregateSelectionProof(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "validator is not an aggregator",
|
||||
duties: []*apimiddleware.AttesterDutyJson{
|
||||
duties: []*validator.AttesterDuty{
|
||||
{
|
||||
Pubkey: pubkeyStr,
|
||||
ValidatorIndex: validatorIndex,
|
||||
@@ -144,7 +144,7 @@ func TestSubmitAggregateSelectionProof(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "no attester duties",
|
||||
duties: []*apimiddleware.AttesterDutyJson{},
|
||||
duties: []*validator.AttesterDuty{},
|
||||
validatorsCalled: 1,
|
||||
attesterDutiesCalled: 1,
|
||||
expectedErrorMsg: fmt.Sprintf("no attester duty for the given slot %d", slot),
|
||||
@@ -204,10 +204,10 @@ func TestSubmitAggregateSelectionProof(t *testing.T) {
|
||||
fmt.Sprintf("%s/%d", attesterDutiesEndpoint, slots.ToEpoch(slot)),
|
||||
nil,
|
||||
bytes.NewBuffer(validatorIndicesBytes),
|
||||
&apimiddleware.AttesterDutiesResponseJson{},
|
||||
&validator.GetAttesterDutiesResponse{},
|
||||
).SetArg(
|
||||
4,
|
||||
apimiddleware.AttesterDutiesResponseJson{
|
||||
validator.GetAttesterDutiesResponse{
|
||||
Data: test.duties,
|
||||
},
|
||||
).Return(
|
||||
|
||||
@@ -10,6 +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/validator"
|
||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
||||
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
||||
"github.com/prysmaticlabs/prysm/v4/testing/assert"
|
||||
@@ -58,9 +59,9 @@ func TestSubscribeCommitteeSubnets_Valid(t *testing.T) {
|
||||
nil,
|
||||
).Times(1)
|
||||
|
||||
duties := make([]*apimiddleware.AttesterDutyJson, len(subscribeSlots))
|
||||
duties := make([]*validator.AttesterDuty, len(subscribeSlots))
|
||||
for index := range duties {
|
||||
duties[index] = &apimiddleware.AttesterDutyJson{
|
||||
duties[index] = &validator.AttesterDuty{
|
||||
ValidatorIndex: strconv.FormatUint(uint64(validatorIndices[index]), 10),
|
||||
CommitteeIndex: strconv.FormatUint(uint64(committeeIndices[index]), 10),
|
||||
CommitteesAtSlot: strconv.FormatUint(committeesAtSlot[index], 10),
|
||||
@@ -75,7 +76,7 @@ func TestSubscribeCommitteeSubnets_Valid(t *testing.T) {
|
||||
slots.ToEpoch(subscribeSlots[0]),
|
||||
validatorIndices,
|
||||
).Return(
|
||||
[]*apimiddleware.AttesterDutyJson{
|
||||
[]*validator.AttesterDuty{
|
||||
{
|
||||
CommitteesAtSlot: strconv.FormatUint(committeesAtSlot[0], 10),
|
||||
Slot: strconv.FormatUint(uint64(subscribeSlots[0]), 10),
|
||||
@@ -93,7 +94,7 @@ func TestSubscribeCommitteeSubnets_Valid(t *testing.T) {
|
||||
slots.ToEpoch(subscribeSlots[2]),
|
||||
validatorIndices,
|
||||
).Return(
|
||||
[]*apimiddleware.AttesterDutyJson{
|
||||
[]*validator.AttesterDuty{
|
||||
{
|
||||
CommitteesAtSlot: strconv.FormatUint(committeesAtSlot[2], 10),
|
||||
Slot: strconv.FormatUint(uint64(subscribeSlots[2]), 10),
|
||||
@@ -125,7 +126,7 @@ func TestSubscribeCommitteeSubnets_Error(t *testing.T) {
|
||||
name string
|
||||
subscribeRequest *ethpb.CommitteeSubnetsSubscribeRequest
|
||||
validatorIndices []primitives.ValidatorIndex
|
||||
attesterDuty *apimiddleware.AttesterDutyJson
|
||||
attesterDuty *validator.AttesterDuty
|
||||
dutiesError error
|
||||
expectGetDutiesQuery bool
|
||||
expectSubscribeRestCall bool
|
||||
@@ -196,7 +197,7 @@ func TestSubscribeCommitteeSubnets_Error(t *testing.T) {
|
||||
IsAggregator: []bool{false},
|
||||
},
|
||||
validatorIndices: []primitives.ValidatorIndex{3},
|
||||
attesterDuty: &apimiddleware.AttesterDutyJson{
|
||||
attesterDuty: &validator.AttesterDuty{
|
||||
Slot: "foo",
|
||||
CommitteesAtSlot: "1",
|
||||
},
|
||||
@@ -211,7 +212,7 @@ func TestSubscribeCommitteeSubnets_Error(t *testing.T) {
|
||||
IsAggregator: []bool{false},
|
||||
},
|
||||
validatorIndices: []primitives.ValidatorIndex{3},
|
||||
attesterDuty: &apimiddleware.AttesterDutyJson{
|
||||
attesterDuty: &validator.AttesterDuty{
|
||||
Slot: "1",
|
||||
CommitteesAtSlot: "foo",
|
||||
},
|
||||
@@ -226,7 +227,7 @@ func TestSubscribeCommitteeSubnets_Error(t *testing.T) {
|
||||
IsAggregator: []bool{false},
|
||||
},
|
||||
validatorIndices: []primitives.ValidatorIndex{3},
|
||||
attesterDuty: &apimiddleware.AttesterDutyJson{
|
||||
attesterDuty: &validator.AttesterDuty{
|
||||
Slot: "2",
|
||||
CommitteesAtSlot: "3",
|
||||
},
|
||||
@@ -241,7 +242,7 @@ func TestSubscribeCommitteeSubnets_Error(t *testing.T) {
|
||||
IsAggregator: []bool{false},
|
||||
},
|
||||
validatorIndices: []primitives.ValidatorIndex{3},
|
||||
attesterDuty: &apimiddleware.AttesterDutyJson{
|
||||
attesterDuty: &validator.AttesterDuty{
|
||||
Slot: "1",
|
||||
CommitteesAtSlot: "2",
|
||||
},
|
||||
@@ -265,7 +266,7 @@ func TestSubscribeCommitteeSubnets_Error(t *testing.T) {
|
||||
gomock.Any(),
|
||||
gomock.Any(),
|
||||
).Return(
|
||||
[]*apimiddleware.AttesterDutyJson{testCase.attesterDuty},
|
||||
[]*validator.AttesterDuty{testCase.attesterDuty},
|
||||
testCase.dutiesError,
|
||||
).Times(1)
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/apimiddleware"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared"
|
||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/validator"
|
||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
||||
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
||||
"github.com/prysmaticlabs/prysm/v4/testing/assert"
|
||||
@@ -269,7 +270,7 @@ func TestGetSyncSubCommitteeIndex(t *testing.T) {
|
||||
Indices: []primitives.CommitteeIndex{123, 456},
|
||||
}
|
||||
|
||||
syncDuties := []*apimiddleware.SyncCommitteeDuty{
|
||||
syncDuties := []*validator.SyncCommitteeDuty{
|
||||
{
|
||||
Pubkey: hexutil.Encode([]byte{1}),
|
||||
ValidatorIndex: validatorIndex,
|
||||
@@ -285,7 +286,7 @@ func TestGetSyncSubCommitteeIndex(t *testing.T) {
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
duties []*apimiddleware.SyncCommitteeDuty
|
||||
duties []*validator.SyncCommitteeDuty
|
||||
validatorsErr error
|
||||
dutiesErr error
|
||||
expectedErrorMsg string
|
||||
@@ -296,7 +297,7 @@ func TestGetSyncSubCommitteeIndex(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "no sync duties",
|
||||
duties: []*apimiddleware.SyncCommitteeDuty{},
|
||||
duties: []*validator.SyncCommitteeDuty{},
|
||||
expectedErrorMsg: fmt.Sprintf("no sync committee duty for the given slot %d", slot),
|
||||
},
|
||||
{
|
||||
@@ -350,10 +351,10 @@ func TestGetSyncSubCommitteeIndex(t *testing.T) {
|
||||
fmt.Sprintf("%s/%d", syncDutiesEndpoint, slots.ToEpoch(slot)),
|
||||
nil,
|
||||
bytes.NewBuffer(validatorIndicesBytes),
|
||||
&apimiddleware.SyncCommitteeDutiesResponseJson{},
|
||||
&validator.GetSyncCommitteeDutiesResponse{},
|
||||
).SetArg(
|
||||
4,
|
||||
apimiddleware.SyncCommitteeDutiesResponseJson{
|
||||
validator.GetSyncCommitteeDutiesResponse{
|
||||
Data: test.duties,
|
||||
},
|
||||
).Return(
|
||||
|
||||
Reference in New Issue
Block a user