Remove deprecated items (#13600)

* Remove deprecated items

* missed test

* add back deprecated fields

* Preston's review

* remove tests

---------

Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
This commit is contained in:
Radosław Kapka
2024-02-15 16:23:31 +01:00
committed by GitHub
parent 5a66807989
commit 6c5351c3a2
43 changed files with 2762 additions and 7510 deletions

View File

@@ -30,9 +30,6 @@ You can use `bazel run //tools/genesis-state-gen` to create a deterministic gene
- **--output-ssz** string: Output filename of the SSZ marshaling of the generated genesis state - **--output-ssz** string: Output filename of the SSZ marshaling of the generated genesis state
- **--config-name=interop** string: name of the beacon chain config to use when generating the state. ex mainnet|minimal|interop - **--config-name=interop** string: name of the beacon chain config to use when generating the state. ex mainnet|minimal|interop
**deprecated flag: use --config-name instead**
- **--mainnet-config** bool: Select whether genesis state should be generated with mainnet or minimal (default) params
The example below creates 64 validator keys, instantiates a genesis state with those 64 validators and with genesis unix timestamp 1567542540, The example below creates 64 validator keys, instantiates a genesis state with those 64 validators and with genesis unix timestamp 1567542540,
and finally writes a ssz encoded output to ~/Desktop/genesis.ssz. This file can be used to kickstart the beacon chain in the next section. When using the `--interop-*` flags, the beacon node will assume the `interop` config should be used, unless a different config is specified on the command line. and finally writes a ssz encoded output to ~/Desktop/genesis.ssz. This file can be used to kickstart the beacon chain in the next section. When using the `--interop-*` flags, the beacon node will assume the `interop` config should be used, unless a different config is specified on the command line.

View File

@@ -173,7 +173,7 @@ func TestGetSpec(t *testing.T) {
data, ok := resp.Data.(map[string]interface{}) data, ok := resp.Data.(map[string]interface{})
require.Equal(t, true, ok) require.Equal(t, true, ok)
assert.Equal(t, 132, len(data)) assert.Equal(t, 130, len(data))
for k, v := range data { for k, v := range data {
switch k { switch k {
case "CONFIG_NAME": case "CONFIG_NAME":

View File

@@ -12,19 +12,15 @@ go_library(
"server.go", "server.go",
"slashings.go", "slashings.go",
"validators.go", "validators.go",
"validators_stream.go",
], ],
importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/prysm/v1alpha1/beacon", importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/prysm/v1alpha1/beacon",
visibility = ["//beacon-chain:__subpackages__"], visibility = ["//beacon-chain:__subpackages__"],
deps = [ deps = [
"//api/pagination:go_default_library", "//api/pagination:go_default_library",
"//async/event:go_default_library",
"//beacon-chain/blockchain:go_default_library", "//beacon-chain/blockchain:go_default_library",
"//beacon-chain/cache:go_default_library", "//beacon-chain/cache:go_default_library",
"//beacon-chain/core/altair:go_default_library", "//beacon-chain/core/altair:go_default_library",
"//beacon-chain/core/blocks:go_default_library",
"//beacon-chain/core/epoch/precompute:go_default_library", "//beacon-chain/core/epoch/precompute:go_default_library",
"//beacon-chain/core/feed:go_default_library",
"//beacon-chain/core/feed/block:go_default_library", "//beacon-chain/core/feed/block:go_default_library",
"//beacon-chain/core/feed/operation:go_default_library", "//beacon-chain/core/feed/operation:go_default_library",
"//beacon-chain/core/feed/state:go_default_library", "//beacon-chain/core/feed/state:go_default_library",
@@ -44,7 +40,6 @@ go_library(
"//beacon-chain/sync:go_default_library", "//beacon-chain/sync:go_default_library",
"//cmd:go_default_library", "//cmd:go_default_library",
"//config/features:go_default_library", "//config/features:go_default_library",
"//config/fieldparams:go_default_library",
"//config/params:go_default_library", "//config/params:go_default_library",
"//consensus-types/blocks:go_default_library", "//consensus-types/blocks:go_default_library",
"//consensus-types/interfaces:go_default_library", "//consensus-types/interfaces:go_default_library",
@@ -53,13 +48,9 @@ go_library(
"//encoding/bytesutil:go_default_library", "//encoding/bytesutil:go_default_library",
"//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1:go_default_library",
"//proto/prysm/v1alpha1/attestation:go_default_library", "//proto/prysm/v1alpha1/attestation:go_default_library",
"//proto/prysm/v1alpha1/attestation/aggregation/attestations:go_default_library",
"//runtime/version:go_default_library", "//runtime/version:go_default_library",
"//time/slots:go_default_library", "//time/slots:go_default_library",
"@com_github_patrickmn_go_cache//:go_default_library",
"@com_github_pkg_errors//:go_default_library", "@com_github_pkg_errors//:go_default_library",
"@com_github_prometheus_client_golang//prometheus:go_default_library",
"@com_github_prometheus_client_golang//prometheus/promauto:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library", "@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//status:go_default_library", "@org_golang_google_grpc//status:go_default_library",
@@ -78,7 +69,6 @@ go_test(
"config_test.go", "config_test.go",
"init_test.go", "init_test.go",
"slashings_test.go", "slashings_test.go",
"validators_stream_test.go",
"validators_test.go", "validators_test.go",
], ],
embed = [":go_default_library"], embed = [":go_default_library"],
@@ -89,12 +79,7 @@ go_test(
"//beacon-chain/blockchain/testing:go_default_library", "//beacon-chain/blockchain/testing:go_default_library",
"//beacon-chain/core/altair:go_default_library", "//beacon-chain/core/altair:go_default_library",
"//beacon-chain/core/epoch/precompute:go_default_library", "//beacon-chain/core/epoch/precompute:go_default_library",
"//beacon-chain/core/feed:go_default_library",
"//beacon-chain/core/feed/block:go_default_library",
"//beacon-chain/core/feed/operation:go_default_library",
"//beacon-chain/core/feed/state:go_default_library",
"//beacon-chain/core/helpers:go_default_library", "//beacon-chain/core/helpers:go_default_library",
"//beacon-chain/core/signing:go_default_library",
"//beacon-chain/core/time:go_default_library", "//beacon-chain/core/time:go_default_library",
"//beacon-chain/core/transition:go_default_library", "//beacon-chain/core/transition:go_default_library",
"//beacon-chain/db:go_default_library", "//beacon-chain/db:go_default_library",
@@ -121,14 +106,11 @@ go_test(
"//encoding/bytesutil:go_default_library", "//encoding/bytesutil:go_default_library",
"//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1:go_default_library",
"//proto/prysm/v1alpha1/attestation:go_default_library", "//proto/prysm/v1alpha1/attestation:go_default_library",
"//proto/prysm/v1alpha1/attestation/aggregation/attestations:go_default_library",
"//testing/assert:go_default_library", "//testing/assert:go_default_library",
"//testing/mock:go_default_library",
"//testing/require:go_default_library", "//testing/require:go_default_library",
"//testing/util:go_default_library", "//testing/util:go_default_library",
"//time:go_default_library", "//time:go_default_library",
"//time/slots:go_default_library", "//time/slots:go_default_library",
"@com_github_golang_mock//gomock:go_default_library",
"@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library",
"@in_gopkg_d4l3k_messagediff_v1//:go_default_library", "@in_gopkg_d4l3k_messagediff_v1//:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library", "@org_golang_google_protobuf//proto:go_default_library",

View File

@@ -7,8 +7,6 @@ import (
"strings" "strings"
"github.com/prysmaticlabs/prysm/v5/api/pagination" "github.com/prysmaticlabs/prysm/v5/api/pagination"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/operation"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filters" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filters"
"github.com/prysmaticlabs/prysm/v5/cmd" "github.com/prysmaticlabs/prysm/v5/cmd"
@@ -17,11 +15,8 @@ import (
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation"
attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations"
"github.com/prysmaticlabs/prysm/v5/time/slots"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/emptypb"
) )
// sortableAttestations implements the Sort interface to sort attestations // sortableAttestations implements the Sort interface to sort attestations
@@ -198,187 +193,6 @@ func (bs *Server) ListIndexedAttestations(
}, nil }, nil
} }
// StreamAttestations to clients at the end of every slot. This method retrieves the
// aggregated attestations currently in the pool at the start of a slot and sends
// them over a gRPC stream.
// DEPRECATED: This endpoint is superseded by the /eth/v1/events Beacon API endpoint
func (bs *Server) StreamAttestations(
_ *emptypb.Empty, stream ethpb.BeaconChain_StreamAttestationsServer,
) error {
attestationsChannel := make(chan *feed.Event, 1)
attSub := bs.AttestationNotifier.OperationFeed().Subscribe(attestationsChannel)
defer attSub.Unsubscribe()
for {
select {
case event := <-attestationsChannel:
if event.Type == operation.UnaggregatedAttReceived {
data, ok := event.Data.(*operation.UnAggregatedAttReceivedData)
if !ok {
// Got bad data over the stream.
continue
}
if data.Attestation == nil {
// One nil attestation shouldn't stop the stream.
continue
}
if err := stream.Send(data.Attestation); err != nil {
return status.Errorf(codes.Unavailable, "Could not send over stream: %v", err)
}
}
case <-bs.Ctx.Done():
return status.Error(codes.Canceled, "Context canceled")
case <-stream.Context().Done():
return status.Error(codes.Canceled, "Context canceled")
}
}
}
// StreamIndexedAttestations to clients at the end of every slot. This method retrieves the
// aggregated attestations currently in the pool, converts them into indexed form, and
// sends them over a gRPC stream.
// DEPRECATED: This endpoint is superseded by the /eth/v1/events Beacon API endpoint
func (bs *Server) StreamIndexedAttestations(
_ *emptypb.Empty, stream ethpb.BeaconChain_StreamIndexedAttestationsServer,
) error {
attestationsChannel := make(chan *feed.Event, 1)
attSub := bs.AttestationNotifier.OperationFeed().Subscribe(attestationsChannel)
defer attSub.Unsubscribe()
go bs.collectReceivedAttestations(stream.Context())
for {
select {
case event, ok := <-attestationsChannel:
if !ok {
log.Error("Indexed attestations stream channel closed")
continue
}
if event.Type == operation.UnaggregatedAttReceived {
data, ok := event.Data.(*operation.UnAggregatedAttReceivedData)
if !ok {
// Got bad data over the stream.
log.Warningf("Indexed attestations stream got data of wrong type on stream expected *UnAggregatedAttReceivedData, received %T", event.Data)
continue
}
if data.Attestation == nil {
// One nil attestation shouldn't stop the stream.
log.Debug("Indexed attestations stream got a nil attestation")
continue
}
bs.ReceivedAttestationsBuffer <- data.Attestation
} else if event.Type == operation.AggregatedAttReceived {
data, ok := event.Data.(*operation.AggregatedAttReceivedData)
if !ok {
// Got bad data over the stream.
log.Warningf("Indexed attestations stream got data of wrong type on stream expected *AggregatedAttReceivedData, received %T", event.Data)
continue
}
if data.Attestation == nil || data.Attestation.Aggregate == nil {
// One nil attestation shouldn't stop the stream.
log.Debug("Indexed attestations stream got nil attestation or nil attestation aggregate")
continue
}
bs.ReceivedAttestationsBuffer <- data.Attestation.Aggregate
}
case aggAtts, ok := <-bs.CollectedAttestationsBuffer:
if !ok {
log.Error("Indexed attestations stream collected attestations channel closed")
continue
}
if len(aggAtts) == 0 {
continue
}
// All attestations we receive have the same target epoch given they
// have the same data root, so we just use the target epoch from
// the first one to determine committees for converting into indexed
// form.
targetRoot := aggAtts[0].Data.Target.Root
targetEpoch := aggAtts[0].Data.Target.Epoch
committeesBySlot, _, err := bs.retrieveCommitteesForRoot(stream.Context(), targetRoot)
if err != nil {
return status.Errorf(
codes.Internal,
"Could not retrieve committees for target root %#x: %v",
targetRoot,
err,
)
}
// We use the retrieved committees for the epoch to convert all attestations
// into indexed form effectively.
startSlot, err := slots.EpochStart(targetEpoch)
if err != nil {
log.Error(err)
continue
}
endSlot := startSlot + params.BeaconConfig().SlotsPerEpoch
for _, att := range aggAtts {
// Out of range check, the attestation slot cannot be greater
// the last slot of the requested epoch or smaller than its start slot
// given committees are accessed as a map of slot -> committees list, where there are
// SLOTS_PER_EPOCH keys in the map.
if att.Data.Slot < startSlot || att.Data.Slot > endSlot {
continue
}
committeesForSlot, ok := committeesBySlot[att.Data.Slot]
if !ok || committeesForSlot.Committees == nil {
continue
}
committee := committeesForSlot.Committees[att.Data.CommitteeIndex]
idxAtt, err := attestation.ConvertToIndexed(stream.Context(), att, committee.ValidatorIndices)
if err != nil {
continue
}
if err := stream.Send(idxAtt); err != nil {
return status.Errorf(codes.Unavailable, "Could not send over stream: %v", err)
}
}
case <-bs.Ctx.Done():
return status.Error(codes.Canceled, "Context canceled")
case <-stream.Context().Done():
return status.Error(codes.Canceled, "Context canceled")
}
}
}
// already being done by the attestation pool in the operations service.
func (bs *Server) collectReceivedAttestations(ctx context.Context) {
attsByRoot := make(map[[32]byte][]*ethpb.Attestation)
twoThirdsASlot := 2 * slots.DivideSlotBy(3) /* 2/3 slot duration */
ticker := slots.NewSlotTickerWithOffset(bs.GenesisTimeFetcher.GenesisTime(), twoThirdsASlot, params.BeaconConfig().SecondsPerSlot)
for {
select {
case <-ticker.C():
aggregatedAttsByTarget := make(map[[32]byte][]*ethpb.Attestation)
for root, atts := range attsByRoot {
// We aggregate the received attestations, we know they all have the same data root.
aggAtts, err := attaggregation.Aggregate(atts)
if err != nil {
log.WithError(err).Error("Could not aggregate attestations")
continue
}
if len(aggAtts) == 0 {
continue
}
targetRoot := bytesutil.ToBytes32(atts[0].Data.Target.Root)
aggregatedAttsByTarget[targetRoot] = append(aggregatedAttsByTarget[targetRoot], aggAtts...)
attsByRoot[root] = make([]*ethpb.Attestation, 0)
}
for _, atts := range aggregatedAttsByTarget {
bs.CollectedAttestationsBuffer <- atts
}
case att := <-bs.ReceivedAttestationsBuffer:
attDataRoot, err := att.Data.HashTreeRoot()
if err != nil {
log.WithError(err).Error("Could not hash tree root attestation data")
continue
}
attsByRoot[attDataRoot] = append(attsByRoot[attDataRoot], att)
case <-ctx.Done():
return
case <-bs.Ctx.Done():
return
}
}
}
// AttestationPool retrieves pending attestations. // AttestationPool retrieves pending attestations.
// //
// The server returns a list of attestations that have been seen but not // The server returns a list of attestations that have been seen but not

View File

@@ -8,13 +8,9 @@ import (
"testing" "testing"
"time" "time"
"github.com/golang/mock/gomock"
"github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/go-bitfield"
chainMock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" chainMock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/operation"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing"
dbTest "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" dbTest "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing"
doublylinkedtree "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/doubly-linked-tree" doublylinkedtree "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/doubly-linked-tree"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations" "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations"
@@ -29,14 +25,11 @@ import (
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation"
attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations"
"github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/assert"
"github.com/prysmaticlabs/prysm/v5/testing/mock"
"github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/require"
"github.com/prysmaticlabs/prysm/v5/testing/util" "github.com/prysmaticlabs/prysm/v5/testing/util"
"github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/prysmaticlabs/prysm/v5/time/slots"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/emptypb"
) )
func TestServer_ListAttestations_NoResults(t *testing.T) { func TestServer_ListAttestations_NoResults(t *testing.T) {
@@ -824,239 +817,3 @@ func TestServer_AttestationPool_Pagination_CustomPageSize(t *testing.T) {
assert.Equal(t, tt.res.NextPageToken, res.NextPageToken, "Unexpected next page token") assert.Equal(t, tt.res.NextPageToken, res.NextPageToken, "Unexpected next page token")
} }
} }
func TestServer_StreamIndexedAttestations_ContextCanceled(t *testing.T) {
ctx := context.Background()
ctx, cancel := context.WithCancel(ctx)
chainService := &chainMock.ChainService{}
server := &Server{
Ctx: ctx,
AttestationNotifier: chainService.OperationNotifier(),
GenesisTimeFetcher: &chainMock.ChainService{
Genesis: time.Now(),
},
}
exitRoutine := make(chan bool)
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockStream := mock.NewMockBeaconChain_StreamIndexedAttestationsServer(ctrl)
mockStream.EXPECT().Context().Return(ctx).AnyTimes()
go func(tt *testing.T) {
err := server.StreamIndexedAttestations(&emptypb.Empty{}, mockStream)
assert.ErrorContains(t, "Context canceled", err)
<-exitRoutine
}(t)
cancel()
exitRoutine <- true
}
func TestServer_StreamIndexedAttestations_OK(t *testing.T) {
params.SetupTestConfigCleanup(t)
params.OverrideBeaconConfig(params.BeaconConfig())
db := dbTest.SetupDB(t)
exitRoutine := make(chan bool)
ctrl := gomock.NewController(t)
defer ctrl.Finish()
ctx := context.Background()
numValidators := 64
headState, privKeys := util.DeterministicGenesisState(t, uint64(numValidators))
b := util.NewBeaconBlock()
util.SaveBlock(t, ctx, db, b)
gRoot, err := b.Block.HashTreeRoot()
require.NoError(t, err)
require.NoError(t, db.SaveGenesisBlockRoot(ctx, gRoot))
require.NoError(t, db.SaveState(ctx, headState, gRoot))
activeIndices, err := helpers.ActiveValidatorIndices(ctx, headState, 0)
require.NoError(t, err)
epoch := primitives.Epoch(0)
attesterSeed, err := helpers.Seed(headState, epoch, params.BeaconConfig().DomainBeaconAttester)
require.NoError(t, err)
committees, err := computeCommittees(context.Background(), params.BeaconConfig().SlotsPerEpoch.Mul(uint64(epoch)), activeIndices, attesterSeed)
require.NoError(t, err)
count := params.BeaconConfig().SlotsPerEpoch
// We generate attestations for each validator per slot per epoch.
atts := make(map[[32]byte][]*ethpb.Attestation)
for i := primitives.Slot(0); i < count; i++ {
comms := committees[i].Committees
for j := 0; j < numValidators; j++ {
var indexInCommittee uint64
var committeeIndex primitives.CommitteeIndex
var committeeLength int
var found bool
for comIndex, item := range comms {
for n, idx := range item.ValidatorIndices {
if primitives.ValidatorIndex(j) == idx {
indexInCommittee = uint64(n)
committeeIndex = primitives.CommitteeIndex(comIndex)
committeeLength = len(item.ValidatorIndices)
found = true
break
}
}
}
if !found {
continue
}
attExample := &ethpb.Attestation{
Data: &ethpb.AttestationData{
BeaconBlockRoot: bytesutil.PadTo([]byte("root"), 32),
Slot: i,
Source: &ethpb.Checkpoint{
Epoch: 0,
Root: gRoot[:],
},
Target: &ethpb.Checkpoint{
Epoch: 0,
Root: gRoot[:],
},
},
}
domain, err := signing.Domain(headState.Fork(), 0, params.BeaconConfig().DomainBeaconAttester, headState.GenesisValidatorsRoot())
require.NoError(t, err)
encoded, err := signing.ComputeSigningRoot(attExample.Data, domain)
require.NoError(t, err)
sig := privKeys[j].Sign(encoded[:])
attExample.Signature = sig.Marshal()
attExample.Data.CommitteeIndex = committeeIndex
aggregationBitfield := bitfield.NewBitlist(uint64(committeeLength))
aggregationBitfield.SetBitAt(indexInCommittee, true)
attExample.AggregationBits = aggregationBitfield
atts[encoded] = append(atts[encoded], attExample)
}
}
chainService := &chainMock.ChainService{}
server := &Server{
BeaconDB: db,
Ctx: context.Background(),
HeadFetcher: &chainMock.ChainService{
State: headState,
},
GenesisTimeFetcher: &chainMock.ChainService{
Genesis: time.Now(),
},
AttestationNotifier: chainService.OperationNotifier(),
CollectedAttestationsBuffer: make(chan []*ethpb.Attestation, 1),
StateGen: stategen.New(db, doublylinkedtree.New()),
}
for dataRoot, sameDataAtts := range atts {
aggAtts, err := attaggregation.Aggregate(sameDataAtts)
require.NoError(t, err)
atts[dataRoot] = aggAtts
}
// Next up we convert the test attestations to indexed form.
attsByTarget := make(map[[32]byte][]*ethpb.Attestation)
for _, dataRootAtts := range atts {
targetRoot := bytesutil.ToBytes32(dataRootAtts[0].Data.Target.Root)
attsByTarget[targetRoot] = append(attsByTarget[targetRoot], dataRootAtts...)
}
allAtts := make([]*ethpb.Attestation, 0)
indexedAtts := make(map[[32]byte][]*ethpb.IndexedAttestation)
for dataRoot, aggAtts := range attsByTarget {
allAtts = append(allAtts, aggAtts...)
for _, att := range aggAtts {
committee := committees[att.Data.Slot].Committees[att.Data.CommitteeIndex]
idxAtt, err := attestation.ConvertToIndexed(ctx, att, committee.ValidatorIndices)
require.NoError(t, err)
indexedAtts[dataRoot] = append(indexedAtts[dataRoot], idxAtt)
}
}
attsSent := 0
mockStream := mock.NewMockBeaconChain_StreamIndexedAttestationsServer(ctrl)
for _, atts := range indexedAtts {
for _, att := range atts {
if attsSent == len(allAtts)-1 {
mockStream.EXPECT().Send(att).Do(func(arg0 interface{}) {
exitRoutine <- true
})
t.Log("cancelled")
} else {
mockStream.EXPECT().Send(att)
attsSent++
}
}
}
mockStream.EXPECT().Context().Return(ctx).AnyTimes()
go func(tt *testing.T) {
assert.NoError(tt, server.StreamIndexedAttestations(&emptypb.Empty{}, mockStream), "Could not call RPC method")
}(t)
server.CollectedAttestationsBuffer <- allAtts
<-exitRoutine
}
func TestServer_StreamAttestations_ContextCanceled(t *testing.T) {
ctx := context.Background()
ctx, cancel := context.WithCancel(ctx)
chainService := &chainMock.ChainService{}
server := &Server{
Ctx: ctx,
AttestationNotifier: chainService.OperationNotifier(),
}
exitRoutine := make(chan bool)
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockStream := mock.NewMockBeaconChain_StreamAttestationsServer(ctrl)
mockStream.EXPECT().Context().Return(ctx)
go func(tt *testing.T) {
err := server.StreamAttestations(
&emptypb.Empty{},
mockStream,
)
assert.ErrorContains(tt, "Context canceled", err)
<-exitRoutine
}(t)
cancel()
exitRoutine <- true
}
func TestServer_StreamAttestations_OnSlotTick(t *testing.T) {
exitRoutine := make(chan bool)
ctrl := gomock.NewController(t)
defer ctrl.Finish()
ctx := context.Background()
chainService := &chainMock.ChainService{}
server := &Server{
Ctx: ctx,
AttestationNotifier: chainService.OperationNotifier(),
}
atts := []*ethpb.Attestation{
util.HydrateAttestation(&ethpb.Attestation{Data: &ethpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}),
util.HydrateAttestation(&ethpb.Attestation{Data: &ethpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}}),
util.HydrateAttestation(&ethpb.Attestation{Data: &ethpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}}),
}
mockStream := mock.NewMockBeaconChain_StreamAttestationsServer(ctrl)
mockStream.EXPECT().Send(atts[0])
mockStream.EXPECT().Send(atts[1])
mockStream.EXPECT().Send(atts[2]).Do(func(arg0 interface{}) {
exitRoutine <- true
})
mockStream.EXPECT().Context().Return(ctx).AnyTimes()
go func(tt *testing.T) {
assert.NoError(tt, server.StreamAttestations(&emptypb.Empty{}, mockStream), "Could not call RPC method")
}(t)
for i := 0; i < len(atts); i++ {
// Send in a loop to ensure it is delivered (busy wait for the service to subscribe to the state feed).
for sent := 0; sent == 0; {
sent = server.AttestationNotifier.OperationFeed().Send(&feed.Event{
Type: operation.UnaggregatedAttReceived,
Data: &operation.UnAggregatedAttReceivedData{Attestation: atts[i]},
})
}
}
<-exitRoutine
}

View File

@@ -6,11 +6,6 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/prysmaticlabs/prysm/v5/api/pagination" "github.com/prysmaticlabs/prysm/v5/api/pagination"
"github.com/prysmaticlabs/prysm/v5/async/event"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed"
blockfeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/block"
statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filters" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filters"
"github.com/prysmaticlabs/prysm/v5/cmd" "github.com/prysmaticlabs/prysm/v5/cmd"
"github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/config/params"
@@ -285,113 +280,6 @@ func (bs *Server) GetChainHead(ctx context.Context, _ *emptypb.Empty) (*ethpb.Ch
return bs.chainHeadRetrieval(ctx) return bs.chainHeadRetrieval(ctx)
} }
// StreamBlocks to clients every single time a block is received by the beacon node.
// DEPRECATED: This endpoint is superseded by the /eth/v1/events Beacon API endpoint
func (bs *Server) StreamBlocks(req *ethpb.StreamBlocksRequest, stream ethpb.BeaconChain_StreamBlocksServer) error {
blocksChannel := make(chan *feed.Event, 1)
var blockSub event.Subscription
if req.VerifiedOnly {
blockSub = bs.StateNotifier.StateFeed().Subscribe(blocksChannel)
} else {
blockSub = bs.BlockNotifier.BlockFeed().Subscribe(blocksChannel)
}
defer blockSub.Unsubscribe()
for {
select {
case blockEvent := <-blocksChannel:
if req.VerifiedOnly {
if blockEvent.Type == statefeed.BlockProcessed {
data, ok := blockEvent.Data.(*statefeed.BlockProcessedData)
if !ok || data == nil {
continue
}
phBlk, err := data.SignedBlock.PbPhase0Block()
if err != nil {
log.Error(err)
continue
}
if err := stream.Send(phBlk); err != nil {
return status.Errorf(codes.Unavailable, "Could not send over stream: %v", err)
}
}
} else {
if blockEvent.Type == blockfeed.ReceivedBlock {
data, ok := blockEvent.Data.(*blockfeed.ReceivedBlockData)
if !ok {
// Got bad data over the stream.
continue
}
if data.SignedBlock == nil {
// One nil block shouldn't stop the stream.
continue
}
headState, err := bs.HeadFetcher.HeadStateReadOnly(bs.Ctx)
if err != nil {
log.WithError(err).WithField("blockSlot", data.SignedBlock.Block().Slot()).Error("Could not get head state")
continue
}
signed := data.SignedBlock
sig := signed.Signature()
if err := blocks.VerifyBlockSignature(headState, signed.Block().ProposerIndex(), sig[:], signed.Block().HashTreeRoot); err != nil {
log.WithError(err).WithField("blockSlot", data.SignedBlock.Block().Slot()).Error("Could not verify block signature")
continue
}
phBlk, err := signed.PbPhase0Block()
if err != nil {
log.Error(err)
continue
}
if err := stream.Send(phBlk); err != nil {
return status.Errorf(codes.Unavailable, "Could not send over stream: %v", err)
}
}
}
case <-blockSub.Err():
return status.Error(codes.Aborted, "Subscriber closed, exiting goroutine")
case <-bs.Ctx.Done():
return status.Error(codes.Canceled, "Context canceled")
case <-stream.Context().Done():
return status.Error(codes.Canceled, "Context canceled")
}
}
}
// StreamChainHead to clients every single time the head block and state of the chain change.
// DEPRECATED: This endpoint is superseded by the /eth/v1/events Beacon API endpoint
func (bs *Server) StreamChainHead(_ *emptypb.Empty, stream ethpb.BeaconChain_StreamChainHeadServer) error {
stateChannel := make(chan *feed.Event, 4)
stateSub := bs.StateNotifier.StateFeed().Subscribe(stateChannel)
defer stateSub.Unsubscribe()
for {
select {
case stateEvent := <-stateChannel:
// In the event our node is in sync mode
// we do not send the chainhead to the caller
// due to the possibility of deadlocks when retrieving
// all the chain related data.
if bs.SyncChecker.Syncing() {
continue
}
if stateEvent.Type == statefeed.BlockProcessed {
res, err := bs.chainHeadRetrieval(stream.Context())
if err != nil {
return status.Errorf(codes.Internal, "Could not retrieve chain head: %v", err)
}
if err := stream.Send(res); err != nil {
return status.Errorf(codes.Unavailable, "Could not send over stream: %v", err)
}
}
case <-stateSub.Err():
return status.Error(codes.Aborted, "Subscriber closed, exiting goroutine")
case <-bs.Ctx.Done():
return status.Error(codes.Canceled, "Context canceled")
case <-stream.Context().Done():
return status.Error(codes.Canceled, "Context canceled")
}
}
}
// Retrieve chain head information from the DB and the current beacon state. // Retrieve chain head information from the DB and the current beacon state.
func (bs *Server) chainHeadRetrieval(ctx context.Context) (*ethpb.ChainHead, error) { func (bs *Server) chainHeadRetrieval(ctx context.Context) (*ethpb.ChainHead, error) {
headBlock, err := bs.HeadFetcher.HeadBlock(ctx) headBlock, err := bs.HeadFetcher.HeadBlock(ctx)

View File

@@ -6,14 +6,9 @@ import (
"strconv" "strconv"
"testing" "testing"
"github.com/golang/mock/gomock"
chainMock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" chainMock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed"
blockfeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/block"
statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state"
dbTest "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" dbTest "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing"
state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native"
mockSync "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync/initial-sync/testing"
"github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/config/features"
fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams"
"github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/config/params"
@@ -23,12 +18,10 @@ import (
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/assert"
"github.com/prysmaticlabs/prysm/v5/testing/mock"
"github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/require"
"github.com/prysmaticlabs/prysm/v5/testing/util" "github.com/prysmaticlabs/prysm/v5/testing/util"
"github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/prysmaticlabs/prysm/v5/time/slots"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/emptypb"
) )
// ensures that if any of the checkpoints are zero-valued, an error will be generated without genesis being present // ensures that if any of the checkpoints are zero-valued, an error will be generated without genesis being present
@@ -202,271 +195,6 @@ func TestServer_GetChainHead(t *testing.T) {
assert.Equal(t, false, head.OptimisticStatus) assert.Equal(t, false, head.OptimisticStatus)
} }
func TestServer_StreamChainHead_ContextCanceled(t *testing.T) {
db := dbTest.SetupDB(t)
ctx := context.Background()
ctx, cancel := context.WithCancel(ctx)
chainService := &chainMock.ChainService{}
server := &Server{
Ctx: ctx,
StateNotifier: chainService.StateNotifier(),
BeaconDB: db,
}
exitRoutine := make(chan bool)
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockStream := mock.NewMockBeaconChain_StreamChainHeadServer(ctrl)
mockStream.EXPECT().Context().Return(ctx)
go func(tt *testing.T) {
assert.ErrorContains(tt, "Context canceled", server.StreamChainHead(&emptypb.Empty{}, mockStream))
<-exitRoutine
}(t)
cancel()
exitRoutine <- true
}
func TestServer_StreamChainHead_OnHeadUpdated(t *testing.T) {
params.SetupTestConfigCleanup(t)
params.OverrideBeaconConfig(params.MainnetConfig())
db := dbTest.SetupDB(t)
genBlock := util.NewBeaconBlock()
genBlock.Block.ParentRoot = bytesutil.PadTo([]byte{'G'}, fieldparams.RootLength)
util.SaveBlock(t, context.Background(), db, genBlock)
gRoot, err := genBlock.Block.HashTreeRoot()
require.NoError(t, err)
require.NoError(t, db.SaveGenesisBlockRoot(context.Background(), gRoot))
finalizedBlock := util.NewBeaconBlock()
finalizedBlock.Block.Slot = 32
finalizedBlock.Block.ParentRoot = bytesutil.PadTo([]byte{'A'}, fieldparams.RootLength)
util.SaveBlock(t, context.Background(), db, finalizedBlock)
fRoot, err := finalizedBlock.Block.HashTreeRoot()
require.NoError(t, err)
justifiedBlock := util.NewBeaconBlock()
justifiedBlock.Block.Slot = 64
justifiedBlock.Block.ParentRoot = bytesutil.PadTo([]byte{'B'}, fieldparams.RootLength)
util.SaveBlock(t, context.Background(), db, justifiedBlock)
jRoot, err := justifiedBlock.Block.HashTreeRoot()
require.NoError(t, err)
prevJustifiedBlock := util.NewBeaconBlock()
prevJustifiedBlock.Block.Slot = 96
prevJustifiedBlock.Block.ParentRoot = bytesutil.PadTo([]byte{'C'}, fieldparams.RootLength)
util.SaveBlock(t, context.Background(), db, prevJustifiedBlock)
pjRoot, err := prevJustifiedBlock.Block.HashTreeRoot()
require.NoError(t, err)
s, err := state_native.InitializeFromProtoPhase0(&ethpb.BeaconState{
Slot: 1,
PreviousJustifiedCheckpoint: &ethpb.Checkpoint{Epoch: 3, Root: pjRoot[:]},
CurrentJustifiedCheckpoint: &ethpb.Checkpoint{Epoch: 2, Root: jRoot[:]},
FinalizedCheckpoint: &ethpb.Checkpoint{Epoch: 1, Root: fRoot[:]},
})
require.NoError(t, err)
b := util.NewBeaconBlock()
b.Block.Slot, err = slots.EpochStart(s.PreviousJustifiedCheckpoint().Epoch)
require.NoError(t, err)
hRoot, err := b.Block.HashTreeRoot()
require.NoError(t, err)
chainService := &chainMock.ChainService{}
ctx := context.Background()
wsb, err := blocks.NewSignedBeaconBlock(b)
require.NoError(t, err)
server := &Server{
Ctx: ctx,
HeadFetcher: &chainMock.ChainService{Block: wsb, State: s},
BeaconDB: db,
StateNotifier: chainService.StateNotifier(),
FinalizationFetcher: &chainMock.ChainService{
FinalizedCheckPoint: s.FinalizedCheckpoint(),
CurrentJustifiedCheckPoint: s.CurrentJustifiedCheckpoint(),
PreviousJustifiedCheckPoint: s.PreviousJustifiedCheckpoint()},
OptimisticModeFetcher: &chainMock.ChainService{},
SyncChecker: &mockSync.Sync{IsSyncing: false},
}
exitRoutine := make(chan bool)
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockStream := mock.NewMockBeaconChain_StreamChainHeadServer(ctrl)
mockStream.EXPECT().Send(
&ethpb.ChainHead{
HeadSlot: b.Block.Slot,
HeadEpoch: slots.ToEpoch(b.Block.Slot),
HeadBlockRoot: hRoot[:],
FinalizedSlot: 32,
FinalizedEpoch: 1,
FinalizedBlockRoot: fRoot[:],
JustifiedSlot: 64,
JustifiedEpoch: 2,
JustifiedBlockRoot: jRoot[:],
PreviousJustifiedSlot: 96,
PreviousJustifiedEpoch: 3,
PreviousJustifiedBlockRoot: pjRoot[:],
},
).Do(func(arg0 interface{}) {
exitRoutine <- true
})
mockStream.EXPECT().Context().Return(ctx).AnyTimes()
go func(tt *testing.T) {
assert.NoError(tt, server.StreamChainHead(&emptypb.Empty{}, mockStream), "Could not call RPC method")
}(t)
// Send in a loop to ensure it is delivered (busy wait for the service to subscribe to the state feed).
for sent := 0; sent == 0; {
sent = server.StateNotifier.StateFeed().Send(&feed.Event{
Type: statefeed.BlockProcessed,
Data: &statefeed.BlockProcessedData{},
})
}
<-exitRoutine
}
func TestServer_StreamBlocksVerified_ContextCanceled(t *testing.T) {
db := dbTest.SetupDB(t)
ctx := context.Background()
chainService := &chainMock.ChainService{}
ctx, cancel := context.WithCancel(ctx)
server := &Server{
Ctx: ctx,
StateNotifier: chainService.StateNotifier(),
HeadFetcher: chainService,
BeaconDB: db,
}
exitRoutine := make(chan bool)
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockStream := mock.NewMockBeaconChain_StreamBlocksServer(ctrl)
mockStream.EXPECT().Context().Return(ctx)
go func(tt *testing.T) {
assert.ErrorContains(tt, "Context canceled", server.StreamBlocks(&ethpb.StreamBlocksRequest{
VerifiedOnly: true,
}, mockStream))
<-exitRoutine
}(t)
cancel()
exitRoutine <- true
}
func TestServer_StreamBlocks_ContextCanceled(t *testing.T) {
db := dbTest.SetupDB(t)
ctx := context.Background()
chainService := &chainMock.ChainService{}
ctx, cancel := context.WithCancel(ctx)
server := &Server{
Ctx: ctx,
BlockNotifier: chainService.BlockNotifier(),
HeadFetcher: chainService,
BeaconDB: db,
}
exitRoutine := make(chan bool)
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockStream := mock.NewMockBeaconChain_StreamBlocksServer(ctrl)
mockStream.EXPECT().Context().Return(ctx)
go func(tt *testing.T) {
assert.ErrorContains(tt, "Context canceled", server.StreamBlocks(&ethpb.StreamBlocksRequest{}, mockStream))
<-exitRoutine
}(t)
cancel()
exitRoutine <- true
}
func TestServer_StreamBlocks_OnHeadUpdated(t *testing.T) {
params.SetupTestConfigCleanup(t)
params.OverrideBeaconConfig(params.BeaconConfig())
ctx := context.Background()
beaconState, privs := util.DeterministicGenesisState(t, 32)
b, err := util.GenerateFullBlock(beaconState, privs, util.DefaultBlockGenConfig(), 1)
require.NoError(t, err)
chainService := &chainMock.ChainService{State: beaconState}
server := &Server{
Ctx: ctx,
BlockNotifier: chainService.BlockNotifier(),
HeadFetcher: chainService,
}
exitRoutine := make(chan bool)
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockStream := mock.NewMockBeaconChain_StreamBlocksServer(ctrl)
mockStream.EXPECT().Send(b).Do(func(arg0 interface{}) {
exitRoutine <- true
})
mockStream.EXPECT().Context().Return(ctx).AnyTimes()
go func(tt *testing.T) {
assert.NoError(tt, server.StreamBlocks(&ethpb.StreamBlocksRequest{}, mockStream), "Could not call RPC method")
}(t)
// Send in a loop to ensure it is delivered (busy wait for the service to subscribe to the state feed).
for sent := 0; sent == 0; {
wsb, err := blocks.NewSignedBeaconBlock(b)
require.NoError(t, err)
sent = server.BlockNotifier.BlockFeed().Send(&feed.Event{
Type: blockfeed.ReceivedBlock,
Data: &blockfeed.ReceivedBlockData{SignedBlock: wsb},
})
}
<-exitRoutine
}
func TestServer_StreamBlocksVerified_OnHeadUpdated(t *testing.T) {
params.SetupTestConfigCleanup(t)
params.OverrideBeaconConfig(params.BeaconConfig())
db := dbTest.SetupDB(t)
ctx := context.Background()
beaconState, privs := util.DeterministicGenesisState(t, 32)
b, err := util.GenerateFullBlock(beaconState, privs, util.DefaultBlockGenConfig(), 1)
require.NoError(t, err)
r, err := b.Block.HashTreeRoot()
require.NoError(t, err)
util.SaveBlock(t, ctx, db, b)
chainService := &chainMock.ChainService{State: beaconState}
server := &Server{
Ctx: ctx,
StateNotifier: chainService.StateNotifier(),
HeadFetcher: chainService,
BeaconDB: db,
}
exitRoutine := make(chan bool)
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockStream := mock.NewMockBeaconChain_StreamBlocksServer(ctrl)
mockStream.EXPECT().Send(b).Do(func(arg0 interface{}) {
exitRoutine <- true
})
mockStream.EXPECT().Context().Return(ctx).AnyTimes()
go func(tt *testing.T) {
assert.NoError(tt, server.StreamBlocks(&ethpb.StreamBlocksRequest{
VerifiedOnly: true,
}, mockStream), "Could not call RPC method")
}(t)
// Send in a loop to ensure it is delivered (busy wait for the service to subscribe to the state feed).
for sent := 0; sent == 0; {
wsb, err := blocks.NewSignedBeaconBlock(b)
require.NoError(t, err)
sent = server.StateNotifier.StateFeed().Send(&feed.Event{
Type: statefeed.BlockProcessed,
Data: &statefeed.BlockProcessedData{Slot: b.Block.Slot, BlockRoot: r, SignedBlock: wsb},
})
}
<-exitRoutine
}
func TestServer_ListBeaconBlocks_NoResults(t *testing.T) { func TestServer_ListBeaconBlocks_NoResults(t *testing.T) {
db := dbTest.SetupDB(t) db := dbTest.SetupDB(t)
ctx := context.Background() ctx := context.Background()

View File

@@ -1,566 +0,0 @@
package beacon
import (
"context"
"errors"
"fmt"
"io"
"math/big"
"sort"
"sync"
"time"
"github.com/patrickmn/go-cache"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prysmaticlabs/prysm/v5/async/event"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain"
depositCache "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed"
statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers"
coreTime "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/db"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/execution"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/runtime/version"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
// infostream is a struct for each instance of the infostream created by a client connection.
type infostream struct {
ctx context.Context
headFetcher blockchain.HeadFetcher
depositFetcher depositCache.DepositFetcher
blockFetcher execution.POWBlockFetcher
beaconDB db.ReadOnlyDatabase
pubKeys [][]byte
pubKeysMutex *sync.RWMutex
stateChannel chan *feed.Event
stateSub event.Subscription
eth1Deposits *cache.Cache
eth1DepositsMutex *sync.RWMutex
eth1Blocktimes *cache.Cache
eth1BlocktimesMutex *sync.RWMutex
currentEpoch primitives.Epoch
stream ethpb.BeaconChain_StreamValidatorsInfoServer
genesisTime uint64
}
// eth1Deposit contains information about a deposit made on the Ethereum 1 chain.
type eth1Deposit struct {
block *big.Int
data *ethpb.Deposit_Data
}
var (
eth1DepositCacheHits = promauto.NewCounter(
prometheus.CounterOpts{
Name: "infostream_eth1_deposit_cache_hits",
Help: "The number of times the infostream Ethereum 1 deposit cache is hit.",
},
)
eth1DepositCacheMisses = promauto.NewCounter(
prometheus.CounterOpts{
Name: "infostream_eth1_deposit_cache_misses",
Help: "The number of times the infostream Ethereum 1 deposit cache is missed.",
},
)
eth1BlocktimeCacheHits = promauto.NewCounter(
prometheus.CounterOpts{
Name: "infostream_eth1_blocktime_cache_hits",
Help: "The number of times the infostream Ethereum 1 block time cache is hit.",
},
)
eth1BlocktimeCacheMisses = promauto.NewCounter(
prometheus.CounterOpts{
Name: "infostream_eth1_blocktime_cache_misses",
Help: "The number of times the infostream Ethereum 1 block time cache is missed.",
},
)
)
// StreamValidatorsInfo returns a stream of information for given validators.
// Validators are supplied dynamically by the client, and can be added, removed and reset at any time.
// Information about the current set of validators is supplied as soon as the end-of-epoch accounting has been processed,
// providing a near real-time view of the state of the validators.
// Note that this will stream information whilst syncing; this is intended, to allow for complete validator state capture
// over time. If this is not required then the client can either wait until the beacon node is synced, or filter results
// based on the epoch value in the returned validator info.
// DEPRECATED: Streaming Validator Info is no longer supported.
// The Beacon API /eth/v1/beacon/states/{state_id}/validators will provide validator info in unstreamed format.
func (bs *Server) StreamValidatorsInfo(stream ethpb.BeaconChain_StreamValidatorsInfoServer) error {
stateChannel := make(chan *feed.Event, params.BeaconConfig().SlotsPerEpoch)
epochDuration := time.Duration(params.BeaconConfig().SlotsPerEpoch.Mul(params.BeaconConfig().SecondsPerSlot)) * time.Second
// Fetch our current epoch.
headState, err := bs.HeadFetcher.HeadState(bs.Ctx)
if err != nil {
return status.Error(codes.Internal, "Could not access head state")
}
if headState == nil || headState.IsNil() {
return status.Error(codes.Internal, "Not ready to serve information")
}
// Create an infostream struct. This will track relevant state for the stream.
infostream := &infostream{
ctx: bs.Ctx,
headFetcher: bs.HeadFetcher,
depositFetcher: bs.DepositFetcher,
blockFetcher: bs.BlockFetcher,
beaconDB: bs.BeaconDB,
pubKeys: make([][]byte, 0),
pubKeysMutex: &sync.RWMutex{},
stateChannel: stateChannel,
stateSub: bs.StateNotifier.StateFeed().Subscribe(stateChannel),
eth1Deposits: cache.New(epochDuration, epochDuration*2),
eth1DepositsMutex: &sync.RWMutex{},
eth1Blocktimes: cache.New(epochDuration*12, epochDuration*24),
eth1BlocktimesMutex: &sync.RWMutex{},
currentEpoch: primitives.Epoch(headState.Slot() / params.BeaconConfig().SlotsPerEpoch),
stream: stream,
genesisTime: headState.GenesisTime(),
}
defer infostream.stateSub.Unsubscribe()
return infostream.handleConnection()
}
// handleConnection handles the two-way connection between client and server.
func (is *infostream) handleConnection() error {
// Handle messages from client.
go func() {
for {
msg, err := is.stream.Recv()
if errors.Is(err, io.EOF) {
return
}
if err != nil {
// Errors handle elsewhere
select {
case <-is.stream.Context().Done():
return
case <-is.ctx.Done():
return
case <-is.stateSub.Err():
return
default:
}
log.WithError(err).Debug("Receive from validators stream listener failed; client probably closed connection")
return
}
is.handleMessage(msg)
}
}()
// Send responses at the end of every epoch.
for {
select {
case stateEvent := <-is.stateChannel:
if stateEvent.Type == statefeed.BlockProcessed {
is.handleBlockProcessed()
}
case <-is.stateSub.Err():
return status.Error(codes.Aborted, "Subscriber closed")
case <-is.ctx.Done():
return status.Error(codes.Canceled, "Service context canceled")
case <-is.stream.Context().Done():
return status.Error(codes.Canceled, "Stream context canceled")
}
}
}
// handleMessage handles a message from the infostream client, updating the list of keys.
func (is *infostream) handleMessage(msg *ethpb.ValidatorChangeSet) {
var err error
switch msg.Action {
case ethpb.SetAction_ADD_VALIDATOR_KEYS:
err = is.handleAddValidatorKeys(msg.PublicKeys)
case ethpb.SetAction_REMOVE_VALIDATOR_KEYS:
is.handleRemoveValidatorKeys(msg.PublicKeys)
case ethpb.SetAction_SET_VALIDATOR_KEYS:
err = is.handleSetValidatorKeys(msg.PublicKeys)
}
if err != nil {
log.WithError(err).Debug("Error handling request; closing stream")
is.stream.Context().Done()
}
}
// handleAddValidatorKeys handles a request to add validator keys.
func (is *infostream) handleAddValidatorKeys(reqPubKeys [][]byte) error {
is.pubKeysMutex.Lock()
// Create existence map to ensure we don't duplicate keys.
pubKeysMap := make(map[[fieldparams.BLSPubkeyLength]byte]bool, len(is.pubKeys))
for _, pubKey := range is.pubKeys {
pubKeysMap[bytesutil.ToBytes48(pubKey)] = true
}
addedPubKeys := make([][]byte, 0, len(reqPubKeys))
for _, pubKey := range reqPubKeys {
if _, exists := pubKeysMap[bytesutil.ToBytes48(pubKey)]; !exists {
is.pubKeys = append(is.pubKeys, pubKey)
addedPubKeys = append(addedPubKeys, pubKey)
}
}
is.pubKeysMutex.Unlock()
// Send immediate info for the new validators.
return is.sendValidatorsInfo(addedPubKeys)
}
// handleSetValidatorKeys handles a request to set validator keys.
func (is *infostream) handleSetValidatorKeys(reqPubKeys [][]byte) error {
is.pubKeysMutex.Lock()
is.pubKeys = make([][]byte, 0, len(reqPubKeys))
is.pubKeys = append(is.pubKeys, reqPubKeys...)
is.pubKeysMutex.Unlock()
// Send immediate info for the new validators.
return is.sendValidatorsInfo(is.pubKeys)
}
// handleRemoveValidatorKeys handles a request to remove validator keys.
func (is *infostream) handleRemoveValidatorKeys(reqPubKeys [][]byte) {
is.pubKeysMutex.Lock()
// Create existence map to track what we have to delete.
pubKeysMap := make(map[[fieldparams.BLSPubkeyLength]byte]bool, len(reqPubKeys))
for _, pubKey := range reqPubKeys {
pubKeysMap[bytesutil.ToBytes48(pubKey)] = true
}
max := len(is.pubKeys)
for i := 0; i < max; i++ {
if _, exists := pubKeysMap[bytesutil.ToBytes48(is.pubKeys[i])]; exists {
copy(is.pubKeys[i:], is.pubKeys[i+1:])
is.pubKeys = is.pubKeys[:len(is.pubKeys)-1]
i--
max--
}
}
is.pubKeysMutex.Unlock()
}
// sendValidatorsInfo sends validator info for a specific set of public keys.
func (is *infostream) sendValidatorsInfo(pubKeys [][]byte) error {
validators, err := is.generateValidatorsInfo(pubKeys)
if err != nil {
return err
}
for _, validator := range validators {
if err := is.stream.Send(validator); err != nil {
return err
}
}
return nil
}
// generateValidatorsInfo generates the validator info for a set of public keys.
func (is *infostream) generateValidatorsInfo(pubKeys [][]byte) ([]*ethpb.ValidatorInfo, error) {
if is.headFetcher == nil {
return nil, status.Error(codes.Internal, "No head fetcher")
}
headState, err := is.headFetcher.HeadState(is.ctx)
if err != nil {
return nil, status.Error(codes.Internal, "Could not access head state")
}
if headState == nil || headState.IsNil() {
return nil, status.Error(codes.Internal, "Not ready to serve information")
}
epoch := primitives.Epoch(headState.Slot() / params.BeaconConfig().SlotsPerEpoch)
if epoch == 0 {
// Not reporting, but no error.
return nil, nil
}
// We are reporting on the state at the end of the *previous* epoch.
epoch--
res := make([]*ethpb.ValidatorInfo, 0, len(pubKeys))
for _, pubKey := range pubKeys {
i, e := headState.ValidatorIndexByPubkey(bytesutil.ToBytes48(pubKey))
if !e {
return nil, errors.New("could not find public key")
}
v, err := headState.ValidatorAtIndexReadOnly(i)
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not retrieve validator: %v", err)
}
info, err := is.generateValidatorInfo(pubKey, v, headState, epoch)
if err != nil {
return nil, err
}
res = append(res, info)
}
// Calculate activation time for pending validators (if there are any).
if err := is.calculateActivationTimeForPendingValidators(res, headState, epoch); err != nil {
return nil, err
}
return res, nil
}
// generateValidatorInfo generates the validator info for a public key.
func (is *infostream) generateValidatorInfo(
pubKey []byte,
validator state.ReadOnlyValidator,
headState state.ReadOnlyBeaconState,
epoch primitives.Epoch,
) (*ethpb.ValidatorInfo, error) {
info := &ethpb.ValidatorInfo{
PublicKey: pubKey,
Epoch: epoch,
Status: ethpb.ValidatorStatus_UNKNOWN_STATUS,
}
// Index
var ok bool
info.Index, ok = headState.ValidatorIndexByPubkey(bytesutil.ToBytes48(pubKey))
if !ok {
// We don't know of this validator; it's either a pending deposit or totally unknown.
return is.generatePendingValidatorInfo(info)
}
// Status and progression timestamp
info.Status, info.TransitionTimestamp = is.calculateStatusAndTransition(validator, coreTime.CurrentEpoch(headState))
// Balance
if balance, err := headState.BalanceAtIndex(info.Index); err != nil {
return nil, err
} else {
info.Balance = balance
}
// Effective balance (for attesting states)
if info.Status == ethpb.ValidatorStatus_ACTIVE ||
info.Status == ethpb.ValidatorStatus_SLASHING ||
info.Status == ethpb.ValidatorStatus_EXITING {
info.EffectiveBalance = validator.EffectiveBalance()
}
return info, nil
}
// generatePendingValidatorInfo generates the validator info for a pending (or unknown) key.
func (is *infostream) generatePendingValidatorInfo(info *ethpb.ValidatorInfo) (*ethpb.ValidatorInfo, error) {
key := string(info.PublicKey)
var deposit *eth1Deposit
is.eth1DepositsMutex.Lock()
if fetchedDeposit, exists := is.eth1Deposits.Get(key); exists {
eth1DepositCacheHits.Inc()
var ok bool
deposit, ok = fetchedDeposit.(*eth1Deposit)
if !ok {
is.eth1DepositsMutex.Unlock()
return nil, errors.New("cached eth1 deposit is not type *eth1Deposit")
}
} else {
eth1DepositCacheMisses.Inc()
fetchedDeposit, eth1BlockNumber := is.depositFetcher.DepositByPubkey(is.ctx, info.PublicKey)
if fetchedDeposit == nil {
deposit = &eth1Deposit{}
is.eth1Deposits.Set(key, deposit, cache.DefaultExpiration)
} else {
deposit = &eth1Deposit{
block: eth1BlockNumber,
data: fetchedDeposit.Data,
}
is.eth1Deposits.Set(key, deposit, cache.DefaultExpiration)
}
}
is.eth1DepositsMutex.Unlock()
if deposit.block != nil {
info.Status = ethpb.ValidatorStatus_DEPOSITED
if queueTimestamp, err := is.depositQueueTimestamp(deposit.block); err != nil {
log.WithError(err).Error("Could not obtain queue activation timestamp")
} else {
info.TransitionTimestamp = queueTimestamp
}
info.Balance = deposit.data.Amount
}
return info, nil
}
func (is *infostream) calculateActivationTimeForPendingValidators(res []*ethpb.ValidatorInfo, headState state.ReadOnlyBeaconState, epoch primitives.Epoch) error {
// pendingValidatorsMap is map from the validator pubkey to the index in our return array
pendingValidatorsMap := make(map[[fieldparams.BLSPubkeyLength]byte]int)
for i, info := range res {
if info.Status == ethpb.ValidatorStatus_PENDING {
pendingValidatorsMap[bytesutil.ToBytes48(info.PublicKey)] = i
}
}
if len(pendingValidatorsMap) == 0 {
// Nothing to do.
return nil
}
// Fetch the list of pending validators; count the number of attesting validators.
numAttestingValidators := uint64(0)
pendingValidators := make([]primitives.ValidatorIndex, 0, headState.NumValidators())
err := headState.ReadFromEveryValidator(func(idx int, val state.ReadOnlyValidator) error {
if val.IsNil() {
return errors.New("nil validator in state")
}
if helpers.IsEligibleForActivationUsingTrie(headState, val) {
pubKey := val.PublicKey()
validatorIndex, ok := headState.ValidatorIndexByPubkey(pubKey)
if ok {
pendingValidators = append(pendingValidators, validatorIndex)
}
}
if helpers.IsActiveValidatorUsingTrie(val, epoch) {
numAttestingValidators++
}
return nil
})
if err != nil {
return err
}
sortableIndices := &indicesSorter{
indices: pendingValidators,
}
sort.Sort(sortableIndices)
sortedIndices := sortableIndices.indices
// Loop over epochs, roughly simulating progression.
for curEpoch := epoch + 1; len(sortedIndices) > 0 && len(pendingValidators) > 0; curEpoch++ {
toProcess := helpers.ValidatorActivationChurnLimit(numAttestingValidators)
if headState.Version() >= version.Deneb {
toProcess = helpers.ValidatorActivationChurnLimitDeneb(numAttestingValidators)
}
if toProcess > uint64(len(sortedIndices)) {
toProcess = uint64(len(sortedIndices))
}
for i := uint64(0); i < toProcess; i++ {
validator, err := headState.ValidatorAtIndexReadOnly(sortedIndices[i])
if err != nil {
return err
}
if index, exists := pendingValidatorsMap[validator.PublicKey()]; exists {
res[index].TransitionTimestamp = is.epochToTimestamp(helpers.ActivationExitEpoch(curEpoch))
delete(pendingValidatorsMap, validator.PublicKey())
}
numAttestingValidators++
}
sortedIndices = sortedIndices[toProcess:]
}
return nil
}
// handleBlockProcessed handles the situation where a block has been processed by the Prysm server.
func (is *infostream) handleBlockProcessed() {
headState, err := is.headFetcher.HeadState(is.ctx)
if err != nil {
log.Warn("Could not access head state for infostream")
return
}
if headState == nil || headState.IsNil() {
// We aren't ready to serve information
return
}
blockEpoch := primitives.Epoch(headState.Slot() / params.BeaconConfig().SlotsPerEpoch)
if blockEpoch == is.currentEpoch {
// Epoch hasn't changed, nothing to report yet.
return
}
is.currentEpoch = blockEpoch
if err := is.sendValidatorsInfo(is.pubKeys); err != nil {
// Client probably disconnected.
log.WithError(err).Debug("Could not send infostream response")
}
}
type indicesSorter struct {
indices []primitives.ValidatorIndex
}
// Len is the number of elements in the collection.
func (s indicesSorter) Len() int { return len(s.indices) }
// Swap swaps the elements with indexes i and j.
func (s indicesSorter) Swap(i, j int) { s.indices[i], s.indices[j] = s.indices[j], s.indices[i] }
// Less reports whether the element with index i must sort before the element with index j.
func (s indicesSorter) Less(i, j int) bool {
return s.indices[i] < s.indices[j]
}
func (is *infostream) calculateStatusAndTransition(validator state.ReadOnlyValidator, currentEpoch primitives.Epoch) (ethpb.ValidatorStatus, uint64) {
farFutureEpoch := params.BeaconConfig().FarFutureEpoch
if validator.IsNil() {
return ethpb.ValidatorStatus_UNKNOWN_STATUS, 0
}
if currentEpoch < validator.ActivationEligibilityEpoch() {
if validator.EffectiveBalance() == 0 {
return ethpb.ValidatorStatus_PENDING, 0
}
if helpers.IsEligibleForActivationQueueUsingTrie(validator) {
return ethpb.ValidatorStatus_DEPOSITED, is.epochToTimestamp(validator.ActivationEligibilityEpoch())
}
return ethpb.ValidatorStatus_DEPOSITED, 0
}
if currentEpoch < validator.ActivationEpoch() {
return ethpb.ValidatorStatus_PENDING, is.epochToTimestamp(validator.ActivationEpoch())
}
if validator.ExitEpoch() == farFutureEpoch {
return ethpb.ValidatorStatus_ACTIVE, 0
}
if currentEpoch < validator.ExitEpoch() {
if validator.Slashed() {
return ethpb.ValidatorStatus_SLASHING, is.epochToTimestamp(validator.ExitEpoch())
}
return ethpb.ValidatorStatus_EXITING, is.epochToTimestamp(validator.ExitEpoch())
}
return ethpb.ValidatorStatus_EXITED, is.epochToTimestamp(validator.WithdrawableEpoch())
}
// epochToTimestamp converts an epoch number to a timestamp.
func (is *infostream) epochToTimestamp(epoch primitives.Epoch) uint64 {
return is.genesisTime + params.BeaconConfig().SecondsPerSlot*uint64(params.BeaconConfig().SlotsPerEpoch.Mul(uint64(epoch)))
}
// depositQueueTimestamp calculates the timestamp for exit of the validator from the deposit queue.
func (is *infostream) depositQueueTimestamp(eth1BlockNumber *big.Int) (uint64, error) {
var blockTimestamp uint64
key := fmt.Sprintf("%v", eth1BlockNumber)
is.eth1BlocktimesMutex.Lock()
if cachedTimestamp, exists := is.eth1Blocktimes.Get(key); exists {
eth1BlocktimeCacheHits.Inc()
var ok bool
blockTimestamp, ok = cachedTimestamp.(uint64)
if !ok {
is.eth1BlocktimesMutex.Unlock()
return 0, errors.New("cached timestamp is not type uint64")
}
} else {
eth1BlocktimeCacheMisses.Inc()
var err error
blockTimestamp, err = is.blockFetcher.BlockTimeByHeight(is.ctx, eth1BlockNumber)
if err != nil {
is.eth1BlocktimesMutex.Unlock()
return 0, err
}
is.eth1Blocktimes.Set(key, blockTimestamp, cache.DefaultExpiration)
}
is.eth1BlocktimesMutex.Unlock()
followTime := time.Duration(params.BeaconConfig().Eth1FollowDistance*params.BeaconConfig().SecondsPerETH1Block) * time.Second
eth1UnixTime := time.Unix(int64(blockTimestamp), 0).Add(followTime) // lint:ignore uintcast -- timestamp will not exceed int64 in your lifetime
period := uint64(params.BeaconConfig().EpochsPerEth1VotingPeriod.Mul(uint64(params.BeaconConfig().SlotsPerEpoch)))
votingPeriod := time.Duration(period*params.BeaconConfig().SecondsPerSlot) * time.Second
activationTime := eth1UnixTime.Add(votingPeriod)
eth2Genesis := time.Unix(int64(is.genesisTime), 0)
if eth2Genesis.After(activationTime) {
return is.genesisTime, nil
}
return uint64(activationTime.Unix()), nil
}

View File

@@ -1,185 +0,0 @@
package beacon
import (
"sync"
"testing"
mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/testing/assert"
"github.com/prysmaticlabs/prysm/v5/testing/require"
"github.com/prysmaticlabs/prysm/v5/testing/util"
)
func TestInfostream_EpochToTimestamp(t *testing.T) {
params.SetupTestConfigCleanup(t)
params.OverrideBeaconConfig(params.MainnetConfig())
tests := []struct {
name string
epoch primitives.Epoch
timestamp uint64
}{
{
name: "Genesis",
epoch: 0,
timestamp: 0,
},
{
name: "One",
epoch: 1,
timestamp: 384,
},
{
name: "Two",
epoch: 2,
timestamp: 768,
},
{
name: "OneHundred",
epoch: 100,
timestamp: 38400,
},
}
is := &infostream{}
for _, test := range tests {
timestamp := is.epochToTimestamp(test.epoch)
assert.Equal(t, test.timestamp, timestamp, "Incorrect timestamp")
}
}
func TestInfostream_HandleSetValidatorKeys(t *testing.T) {
params.SetupTestConfigCleanup(t)
params.OverrideBeaconConfig(params.BeaconConfig())
tests := []struct {
name string
reqPubKeys [][]byte
}{
{
name: "None",
},
{
name: "One",
reqPubKeys: [][]byte{{0x01}},
},
{
name: "Two",
reqPubKeys: [][]byte{{0x01}, {0x02}},
},
}
s, err := util.NewBeaconState()
require.NoError(t, err)
is := &infostream{
pubKeysMutex: &sync.RWMutex{},
pubKeys: make([][]byte, 0),
headFetcher: &mock.ChainService{
State: s,
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
assert.NoError(t, is.handleSetValidatorKeys(test.reqPubKeys))
assert.Equal(t, len(test.reqPubKeys), len(is.pubKeys), "Incorrect number of keys")
})
}
}
func TestInfostream_HandleAddValidatorKeys(t *testing.T) {
params.SetupTestConfigCleanup(t)
params.OverrideBeaconConfig(params.BeaconConfig())
tests := []struct {
name string
initialPubKeys [][]byte
reqPubKeys [][]byte
finalLen int
}{
{
name: "None",
finalLen: 0,
},
{
name: "NoneAddOne",
reqPubKeys: [][]byte{{0x01}},
finalLen: 1,
},
{
name: "OneAddOne",
initialPubKeys: [][]byte{{0x01}},
reqPubKeys: [][]byte{{0x02}},
finalLen: 2,
},
{
name: "Duplicate",
initialPubKeys: [][]byte{{0x01}},
reqPubKeys: [][]byte{{0x01}},
finalLen: 1,
},
}
s, err := util.NewBeaconState()
require.NoError(t, err)
is := &infostream{
pubKeysMutex: &sync.RWMutex{},
pubKeys: make([][]byte, 0),
headFetcher: &mock.ChainService{
State: s,
},
}
for _, test := range tests {
assert.NoError(t, is.handleSetValidatorKeys(test.initialPubKeys))
assert.NoError(t, is.handleAddValidatorKeys(test.reqPubKeys))
assert.Equal(t, test.finalLen, len(is.pubKeys), "Incorrect number of keys")
}
}
func TestInfostream_HandleRemoveValidatorKeys(t *testing.T) {
params.SetupTestConfigCleanup(t)
params.OverrideBeaconConfig(params.BeaconConfig())
tests := []struct {
name string
initialPubKeys [][]byte
reqPubKeys [][]byte
finalLen int
}{
{
name: "None",
finalLen: 0,
},
{
name: "OneRemoveNone",
initialPubKeys: [][]byte{{0x01}},
finalLen: 1,
},
{
name: "NoneRemoveOne",
initialPubKeys: [][]byte{},
reqPubKeys: [][]byte{{0x01}},
finalLen: 0,
},
{
name: "TwoRemoveOne",
initialPubKeys: [][]byte{{0x01, 0x02}},
reqPubKeys: [][]byte{{0x01}},
finalLen: 1,
},
}
s, err := util.NewBeaconState()
require.NoError(t, err)
is := &infostream{
pubKeysMutex: &sync.RWMutex{},
pubKeys: make([][]byte, 0),
headFetcher: &mock.ChainService{
State: s,
},
}
for _, test := range tests {
assert.NoError(t, is.handleSetValidatorKeys(test.initialPubKeys))
is.handleRemoveValidatorKeys(test.reqPubKeys)
assert.Equal(t, test.finalLen, len(is.pubKeys), "Incorrect number of keys")
}
}

View File

@@ -3,18 +3,12 @@ package validator
import ( import (
"context" "context"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed"
statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers"
coreTime "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" coreTime "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
ethpbv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
prysmTime "github.com/prysmaticlabs/prysm/v5/time"
"github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/prysmaticlabs/prysm/v5/time/slots"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
@@ -30,78 +24,6 @@ func (vs *Server) GetDuties(ctx context.Context, req *ethpb.DutiesRequest) (*eth
return vs.duties(ctx, req) return vs.duties(ctx, req)
} }
// StreamDuties returns the duties assigned to a list of validators specified
// in the request object via a server-side stream. The stream sends out new assignments in case
// a chain re-org occurred.
func (vs *Server) StreamDuties(req *ethpb.DutiesRequest, stream ethpb.BeaconNodeValidator_StreamDutiesServer) error {
if vs.SyncChecker.Syncing() {
return status.Error(codes.Unavailable, "Syncing to latest head, not ready to respond")
}
// If we are post-genesis time, then set the current epoch to
// the number epochs since the genesis time, otherwise 0 by default.
genesisTime := vs.TimeFetcher.GenesisTime()
if genesisTime.IsZero() {
return status.Error(codes.Unavailable, "genesis time is not set")
}
var currentEpoch primitives.Epoch
if genesisTime.Before(prysmTime.Now()) {
currentEpoch = slots.EpochsSinceGenesis(vs.TimeFetcher.GenesisTime())
}
req.Epoch = currentEpoch
res, err := vs.duties(stream.Context(), req)
if err != nil {
return status.Errorf(codes.Internal, "Could not compute validator duties: %v", err)
}
if err := stream.Send(res); err != nil {
return status.Errorf(codes.Internal, "Could not send response over stream: %v", err)
}
// We start a for loop which ticks on every epoch or a chain reorg.
stateChannel := make(chan *feed.Event, 1)
stateSub := vs.StateNotifier.StateFeed().Subscribe(stateChannel)
defer stateSub.Unsubscribe()
secondsPerEpoch := params.BeaconConfig().SecondsPerSlot * uint64(params.BeaconConfig().SlotsPerEpoch)
epochTicker := slots.NewSlotTicker(vs.TimeFetcher.GenesisTime(), secondsPerEpoch)
for {
select {
// Ticks every epoch to submit assignments to connected validator clients.
case slot := <-epochTicker.C():
req.Epoch = primitives.Epoch(slot)
res, err := vs.duties(stream.Context(), req)
if err != nil {
return status.Errorf(codes.Internal, "Could not compute validator duties: %v", err)
}
if err := stream.Send(res); err != nil {
return status.Errorf(codes.Internal, "Could not send response over stream: %v", err)
}
case ev := <-stateChannel:
// If a reorg occurred, we recompute duties for the connected validator clients
// and send another response over the server stream right away.
currentEpoch = slots.EpochsSinceGenesis(vs.TimeFetcher.GenesisTime())
if ev.Type == statefeed.Reorg {
data, ok := ev.Data.(*ethpbv1.EventChainReorg)
if !ok {
return status.Errorf(codes.Internal, "Received incorrect data type over reorg feed: %v", data)
}
req.Epoch = currentEpoch
res, err := vs.duties(stream.Context(), req)
if err != nil {
return status.Errorf(codes.Internal, "Could not compute validator duties: %v", err)
}
if err := stream.Send(res); err != nil {
return status.Errorf(codes.Internal, "Could not send response over stream: %v", err)
}
}
case <-stream.Context().Done():
return status.Error(codes.Canceled, "Stream context canceled")
case <-vs.Ctx.Done():
return status.Error(codes.Canceled, "RPC context canceled")
}
}
}
// Compute the validator duties from the head state's corresponding epoch // Compute the validator duties from the head state's corresponding epoch
// for validators public key / indices requested. // for validators public key / indices requested.
func (vs *Server) duties(ctx context.Context, req *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { func (vs *Server) duties(ctx context.Context, req *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) {
@@ -220,7 +142,6 @@ func (vs *Server) duties(ctx context.Context, req *ethpb.DutiesRequest) (*ethpb.
nextValidatorAssignments = append(nextValidatorAssignments, nextAssignment) nextValidatorAssignments = append(nextValidatorAssignments, nextAssignment)
} }
return &ethpb.DutiesResponse{ return &ethpb.DutiesResponse{
Duties: validatorAssignments,
CurrentEpochDuties: validatorAssignments, CurrentEpochDuties: validatorAssignments,
NextEpochDuties: nextValidatorAssignments, NextEpochDuties: nextValidatorAssignments,
}, nil }, nil

View File

@@ -6,14 +6,11 @@ import (
"testing" "testing"
"time" "time"
"github.com/golang/mock/gomock"
mockChain "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" mockChain "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositcache" "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache/depositcache"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/execution" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/execution"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed"
statefeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/state"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition"
mockExecution "github.com/prysmaticlabs/prysm/v5/beacon-chain/execution/testing" mockExecution "github.com/prysmaticlabs/prysm/v5/beacon-chain/execution/testing"
@@ -22,10 +19,8 @@ import (
"github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
ethpbv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/assert"
"github.com/prysmaticlabs/prysm/v5/testing/mock"
"github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/require"
"github.com/prysmaticlabs/prysm/v5/testing/util" "github.com/prysmaticlabs/prysm/v5/testing/util"
) )
@@ -468,141 +463,6 @@ func TestGetDuties_SyncNotReady(t *testing.T) {
assert.ErrorContains(t, "Syncing to latest head", err) assert.ErrorContains(t, "Syncing to latest head", err)
} }
func TestStreamDuties_SyncNotReady(t *testing.T) {
vs := &Server{
SyncChecker: &mockSync.Sync{IsSyncing: true},
}
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockStream := mock.NewMockBeaconNodeValidator_StreamDutiesServer(ctrl)
assert.ErrorContains(t, "Syncing to latest head", vs.StreamDuties(&ethpb.DutiesRequest{}, mockStream))
}
func TestStreamDuties_OK(t *testing.T) {
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 setup genesis bs")
genesisRoot, err := genesis.Block.HashTreeRoot()
require.NoError(t, err, "Could not get signing root")
pubKeys := make([][]byte, len(deposits))
indices := make([]uint64, len(deposits))
for i := 0; i < len(deposits); i++ {
pubKeys[i] = deposits[i].Data.PublicKey
indices[i] = uint64(i)
}
pubkeysAs48ByteType := make([][fieldparams.BLSPubkeyLength]byte, len(pubKeys))
for i, pk := range pubKeys {
pubkeysAs48ByteType[i] = bytesutil.ToBytes48(pk)
}
ctx, cancel := context.WithCancel(context.Background())
c := &mockChain.ChainService{
Genesis: time.Now(),
}
vs := &Server{
Ctx: ctx,
HeadFetcher: &mockChain.ChainService{State: bs, Root: genesisRoot[:]},
SyncChecker: &mockSync.Sync{IsSyncing: false},
TimeFetcher: c,
StateNotifier: &mockChain.MockStateNotifier{},
PayloadIDCache: cache.NewPayloadIDCache(),
}
// Test the first validator in registry.
req := &ethpb.DutiesRequest{
PublicKeys: [][]byte{deposits[0].Data.PublicKey},
}
wantedRes, err := vs.duties(ctx, req)
require.NoError(t, err)
ctrl := gomock.NewController(t)
defer ctrl.Finish()
exitRoutine := make(chan bool)
mockStream := mock.NewMockBeaconNodeValidator_StreamDutiesServer(ctrl)
mockStream.EXPECT().Send(wantedRes).Do(func(arg0 interface{}) {
exitRoutine <- true
})
mockStream.EXPECT().Context().Return(ctx).AnyTimes()
go func(tt *testing.T) {
assert.ErrorContains(t, "context canceled", vs.StreamDuties(req, mockStream))
}(t)
<-exitRoutine
cancel()
}
func TestStreamDuties_OK_ChainReorg(t *testing.T) {
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 setup genesis bs")
genesisRoot, err := genesis.Block.HashTreeRoot()
require.NoError(t, err, "Could not get signing root")
pubKeys := make([][]byte, len(deposits))
indices := make([]uint64, len(deposits))
for i := 0; i < len(deposits); i++ {
pubKeys[i] = deposits[i].Data.PublicKey
indices[i] = uint64(i)
}
pubkeysAs48ByteType := make([][fieldparams.BLSPubkeyLength]byte, len(pubKeys))
for i, pk := range pubKeys {
pubkeysAs48ByteType[i] = bytesutil.ToBytes48(pk)
}
ctx, cancel := context.WithCancel(context.Background())
c := &mockChain.ChainService{
Genesis: time.Now(),
}
vs := &Server{
Ctx: ctx,
HeadFetcher: &mockChain.ChainService{State: bs, Root: genesisRoot[:]},
SyncChecker: &mockSync.Sync{IsSyncing: false},
TimeFetcher: c,
StateNotifier: &mockChain.MockStateNotifier{},
PayloadIDCache: cache.NewPayloadIDCache(),
}
// Test the first validator in registry.
req := &ethpb.DutiesRequest{
PublicKeys: [][]byte{deposits[0].Data.PublicKey},
}
wantedRes, err := vs.duties(ctx, req)
require.NoError(t, err)
ctrl := gomock.NewController(t)
defer ctrl.Finish()
exitRoutine := make(chan bool)
mockStream := mock.NewMockBeaconNodeValidator_StreamDutiesServer(ctrl)
mockStream.EXPECT().Send(wantedRes).Return(nil)
mockStream.EXPECT().Send(wantedRes).Do(func(arg0 interface{}) {
exitRoutine <- true
})
mockStream.EXPECT().Context().Return(ctx).AnyTimes()
go func(tt *testing.T) {
assert.ErrorContains(t, "context canceled", vs.StreamDuties(req, mockStream))
}(t)
// Fire a reorg event. This needs to trigger
// a recomputation and resending of duties over the stream.
for sent := 0; sent == 0; {
sent = vs.StateNotifier.StateFeed().Send(&feed.Event{
Type: statefeed.Reorg,
Data: &ethpbv1.EventChainReorg{Depth: uint64(params.BeaconConfig().SlotsPerEpoch), Slot: 0},
})
}
<-exitRoutine
cancel()
}
func BenchmarkCommitteeAssignment(b *testing.B) { func BenchmarkCommitteeAssignment(b *testing.B) {
genesis := util.NewBeaconBlock() genesis := util.NewBeaconBlock()

View File

@@ -10,7 +10,6 @@ go_library(
deps = [ deps = [
"//cmd/prysmctl/checkpointsync:go_default_library", "//cmd/prysmctl/checkpointsync:go_default_library",
"//cmd/prysmctl/db:go_default_library", "//cmd/prysmctl/db:go_default_library",
"//cmd/prysmctl/deprecated:go_default_library",
"//cmd/prysmctl/p2p:go_default_library", "//cmd/prysmctl/p2p:go_default_library",
"//cmd/prysmctl/testnet:go_default_library", "//cmd/prysmctl/testnet:go_default_library",
"//cmd/prysmctl/validator:go_default_library", "//cmd/prysmctl/validator:go_default_library",

View File

@@ -1,12 +0,0 @@
load("@prysm//tools/go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["cmd.go"],
importpath = "github.com/prysmaticlabs/prysm/v5/cmd/prysmctl/deprecated",
visibility = ["//visibility:public"],
deps = [
"//cmd/prysmctl/deprecated/checkpoint:go_default_library",
"@com_github_urfave_cli_v2//:go_default_library",
],
)

View File

@@ -1,13 +0,0 @@
load("@prysm//tools/go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"checkpoint.go",
"latest.go",
"save.go",
],
importpath = "github.com/prysmaticlabs/prysm/v5/cmd/prysmctl/deprecated/checkpoint",
visibility = ["//visibility:public"],
deps = ["@com_github_urfave_cli_v2//:go_default_library"],
)

View File

@@ -1,15 +0,0 @@
package checkpoint
import "github.com/urfave/cli/v2"
var Commands = []*cli.Command{
{
Name: "checkpoint",
Aliases: []string{"cpt"},
Usage: "deprecated",
Subcommands: []*cli.Command{
checkpointCmd,
saveCmd,
},
},
}

View File

@@ -1,17 +0,0 @@
package checkpoint
import (
"fmt"
"github.com/urfave/cli/v2"
)
var checkpointCmd = &cli.Command{
Name: "latest",
Usage: "deprecated - please use 'prysmctl weak-subjectivity checkpoint' instead!",
Action: cliDeprecatedLatest,
}
func cliDeprecatedLatest(_ *cli.Context) error {
return fmt.Errorf("this command has moved. Please use 'prysmctl weak-subjectivity checkpoint' instead")
}

View File

@@ -1,17 +0,0 @@
package checkpoint
import (
"fmt"
"github.com/urfave/cli/v2"
)
var saveCmd = &cli.Command{
Name: "save",
Usage: "deprecated - please use 'prysmctl checkpoint-sync download' instead!",
Action: cliActionDeprecatedSave,
}
func cliActionDeprecatedSave(_ *cli.Context) error {
return fmt.Errorf("this command has moved. Please use 'prysmctl checkpoint-sync download' instead")
}

View File

@@ -1,12 +0,0 @@
package deprecated
import (
"github.com/prysmaticlabs/prysm/v5/cmd/prysmctl/deprecated/checkpoint"
"github.com/urfave/cli/v2"
)
var Commands []*cli.Command
func init() {
Commands = append(Commands, checkpoint.Commands...)
}

View File

@@ -5,7 +5,6 @@ import (
"github.com/prysmaticlabs/prysm/v5/cmd/prysmctl/checkpointsync" "github.com/prysmaticlabs/prysm/v5/cmd/prysmctl/checkpointsync"
"github.com/prysmaticlabs/prysm/v5/cmd/prysmctl/db" "github.com/prysmaticlabs/prysm/v5/cmd/prysmctl/db"
"github.com/prysmaticlabs/prysm/v5/cmd/prysmctl/deprecated"
"github.com/prysmaticlabs/prysm/v5/cmd/prysmctl/p2p" "github.com/prysmaticlabs/prysm/v5/cmd/prysmctl/p2p"
"github.com/prysmaticlabs/prysm/v5/cmd/prysmctl/testnet" "github.com/prysmaticlabs/prysm/v5/cmd/prysmctl/testnet"
"github.com/prysmaticlabs/prysm/v5/cmd/prysmctl/validator" "github.com/prysmaticlabs/prysm/v5/cmd/prysmctl/validator"
@@ -27,10 +26,6 @@ func main() {
} }
func init() { func init() {
// contains the old checkpoint sync subcommands. these commands should display help/warn messages
// pointing to their new locations
prysmctlCommands = append(prysmctlCommands, deprecated.Commands...)
prysmctlCommands = append(prysmctlCommands, checkpointsync.Commands...) prysmctlCommands = append(prysmctlCommands, checkpointsync.Commands...)
prysmctlCommands = append(prysmctlCommands, db.Commands...) prysmctlCommands = append(prysmctlCommands, db.Commands...)
prysmctlCommands = append(prysmctlCommands, p2p.Commands...) prysmctlCommands = append(prysmctlCommands, p2p.Commands...)

View File

@@ -51,22 +51,20 @@ type BeaconChainConfig struct {
ZeroHash [32]byte // ZeroHash is used to represent a zeroed out 32 byte array. ZeroHash [32]byte // ZeroHash is used to represent a zeroed out 32 byte array.
// Time parameters constants. // Time parameters constants.
GenesisDelay uint64 `yaml:"GENESIS_DELAY" spec:"true"` // GenesisDelay is the minimum number of seconds to delay starting the Ethereum Beacon Chain genesis. Must be at least 1 second. GenesisDelay uint64 `yaml:"GENESIS_DELAY" spec:"true"` // GenesisDelay is the minimum number of seconds to delay starting the Ethereum Beacon Chain genesis. Must be at least 1 second.
MinAttestationInclusionDelay primitives.Slot `yaml:"MIN_ATTESTATION_INCLUSION_DELAY" spec:"true"` // MinAttestationInclusionDelay defines how many slots validator has to wait to include attestation for beacon block. MinAttestationInclusionDelay primitives.Slot `yaml:"MIN_ATTESTATION_INCLUSION_DELAY" spec:"true"` // MinAttestationInclusionDelay defines how many slots validator has to wait to include attestation for beacon block.
SecondsPerSlot uint64 `yaml:"SECONDS_PER_SLOT" spec:"true"` // SecondsPerSlot is how many seconds are in a single slot. SecondsPerSlot uint64 `yaml:"SECONDS_PER_SLOT" spec:"true"` // SecondsPerSlot is how many seconds are in a single slot.
SlotsPerEpoch primitives.Slot `yaml:"SLOTS_PER_EPOCH" spec:"true"` // SlotsPerEpoch is the number of slots in an epoch. SlotsPerEpoch primitives.Slot `yaml:"SLOTS_PER_EPOCH" spec:"true"` // SlotsPerEpoch is the number of slots in an epoch.
SqrRootSlotsPerEpoch primitives.Slot // SqrRootSlotsPerEpoch is a hard coded value where we take the square root of `SlotsPerEpoch` and round down. SqrRootSlotsPerEpoch primitives.Slot // SqrRootSlotsPerEpoch is a hard coded value where we take the square root of `SlotsPerEpoch` and round down.
MinSeedLookahead primitives.Epoch `yaml:"MIN_SEED_LOOKAHEAD" spec:"true"` // MinSeedLookahead is the duration of randao look ahead seed. MinSeedLookahead primitives.Epoch `yaml:"MIN_SEED_LOOKAHEAD" spec:"true"` // MinSeedLookahead is the duration of randao look ahead seed.
MaxSeedLookahead primitives.Epoch `yaml:"MAX_SEED_LOOKAHEAD" spec:"true"` // MaxSeedLookahead is the duration a validator has to wait for entry and exit in epoch. MaxSeedLookahead primitives.Epoch `yaml:"MAX_SEED_LOOKAHEAD" spec:"true"` // MaxSeedLookahead is the duration a validator has to wait for entry and exit in epoch.
EpochsPerEth1VotingPeriod primitives.Epoch `yaml:"EPOCHS_PER_ETH1_VOTING_PERIOD" spec:"true"` // EpochsPerEth1VotingPeriod defines how often the merkle root of deposit receipts get updated in beacon node on per epoch basis. EpochsPerEth1VotingPeriod primitives.Epoch `yaml:"EPOCHS_PER_ETH1_VOTING_PERIOD" spec:"true"` // EpochsPerEth1VotingPeriod defines how often the merkle root of deposit receipts get updated in beacon node on per epoch basis.
SlotsPerHistoricalRoot primitives.Slot `yaml:"SLOTS_PER_HISTORICAL_ROOT" spec:"true"` // SlotsPerHistoricalRoot defines how often the historical root is saved. SlotsPerHistoricalRoot primitives.Slot `yaml:"SLOTS_PER_HISTORICAL_ROOT" spec:"true"` // SlotsPerHistoricalRoot defines how often the historical root is saved.
MinValidatorWithdrawabilityDelay primitives.Epoch `yaml:"MIN_VALIDATOR_WITHDRAWABILITY_DELAY" spec:"true"` // MinValidatorWithdrawabilityDelay is the shortest amount of time a validator has to wait to withdraw. MinValidatorWithdrawabilityDelay primitives.Epoch `yaml:"MIN_VALIDATOR_WITHDRAWABILITY_DELAY" spec:"true"` // MinValidatorWithdrawabilityDelay is the shortest amount of time a validator has to wait to withdraw.
ShardCommitteePeriod primitives.Epoch `yaml:"SHARD_COMMITTEE_PERIOD" spec:"true"` // ShardCommitteePeriod is the minimum amount of epochs a validator must participate before exiting. ShardCommitteePeriod primitives.Epoch `yaml:"SHARD_COMMITTEE_PERIOD" spec:"true"` // ShardCommitteePeriod is the minimum amount of epochs a validator must participate before exiting.
MinEpochsToInactivityPenalty primitives.Epoch `yaml:"MIN_EPOCHS_TO_INACTIVITY_PENALTY" spec:"true"` // MinEpochsToInactivityPenalty defines the minimum amount of epochs since finality to begin penalizing inactivity. MinEpochsToInactivityPenalty primitives.Epoch `yaml:"MIN_EPOCHS_TO_INACTIVITY_PENALTY" spec:"true"` // MinEpochsToInactivityPenalty defines the minimum amount of epochs since finality to begin penalizing inactivity.
Eth1FollowDistance uint64 `yaml:"ETH1_FOLLOW_DISTANCE" spec:"true"` // Eth1FollowDistance is the number of eth1.0 blocks to wait before considering a new deposit for voting. This only applies after the chain as been started. Eth1FollowDistance uint64 `yaml:"ETH1_FOLLOW_DISTANCE" spec:"true"` // Eth1FollowDistance is the number of eth1.0 blocks to wait before considering a new deposit for voting. This only applies after the chain as been started.
DeprecatedSafeSlotsToUpdateJustified primitives.Slot `yaml:"SAFE_SLOTS_TO_UPDATE_JUSTIFIED" spec:"true"` // DeprecateSafeSlotsToUpdateJustified is the minimal slots needed to update justified check point. SecondsPerETH1Block uint64 `yaml:"SECONDS_PER_ETH1_BLOCK" spec:"true"` // SecondsPerETH1Block is the approximate time for a single eth1 block to be produced.
DeprecatedSafeSlotsToImportOptimistically primitives.Slot `yaml:"SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY" spec:"true"` // SafeSlotsToImportOptimistically is the minimal number of slots to wait before importing optimistically a pre-merge block
SecondsPerETH1Block uint64 `yaml:"SECONDS_PER_ETH1_BLOCK" spec:"true"` // SecondsPerETH1Block is the approximate time for a single eth1 block to be produced.
// Fork choice algorithm constants. // Fork choice algorithm constants.
ProposerScoreBoost uint64 `yaml:"PROPOSER_SCORE_BOOST" spec:"true"` // ProposerScoreBoost defines a value that is a % of the committee weight for fork-choice boosting. ProposerScoreBoost uint64 `yaml:"PROPOSER_SCORE_BOOST" spec:"true"` // ProposerScoreBoost defines a value that is a % of the committee weight for fork-choice boosting.

View File

@@ -112,7 +112,6 @@ func compareConfigs(t *testing.T, expected, actual *BeaconChainConfig) {
require.DeepEqual(t, expected.ShardCommitteePeriod, actual.ShardCommitteePeriod) require.DeepEqual(t, expected.ShardCommitteePeriod, actual.ShardCommitteePeriod)
require.DeepEqual(t, expected.MinEpochsToInactivityPenalty, actual.MinEpochsToInactivityPenalty) require.DeepEqual(t, expected.MinEpochsToInactivityPenalty, actual.MinEpochsToInactivityPenalty)
require.DeepEqual(t, expected.Eth1FollowDistance, actual.Eth1FollowDistance) require.DeepEqual(t, expected.Eth1FollowDistance, actual.Eth1FollowDistance)
require.DeepEqual(t, expected.DeprecatedSafeSlotsToUpdateJustified, actual.DeprecatedSafeSlotsToUpdateJustified)
require.DeepEqual(t, expected.SecondsPerETH1Block, actual.SecondsPerETH1Block) require.DeepEqual(t, expected.SecondsPerETH1Block, actual.SecondsPerETH1Block)
require.DeepEqual(t, expected.ProposerScoreBoost, actual.ProposerScoreBoost) require.DeepEqual(t, expected.ProposerScoreBoost, actual.ProposerScoreBoost)
require.DeepEqual(t, expected.IntervalsPerSlot, actual.IntervalsPerSlot) require.DeepEqual(t, expected.IntervalsPerSlot, actual.IntervalsPerSlot)

View File

@@ -65,9 +65,6 @@ func assertEqualConfigs(t *testing.T, name string, fields []string, expected, ac
assert.Equal(t, expected.HysteresisDownwardMultiplier, actual.HysteresisDownwardMultiplier, "%s: HysteresisDownwardMultiplier", name) assert.Equal(t, expected.HysteresisDownwardMultiplier, actual.HysteresisDownwardMultiplier, "%s: HysteresisDownwardMultiplier", name)
assert.Equal(t, expected.HysteresisUpwardMultiplier, actual.HysteresisUpwardMultiplier, "%s: HysteresisUpwardMultiplier", name) assert.Equal(t, expected.HysteresisUpwardMultiplier, actual.HysteresisUpwardMultiplier, "%s: HysteresisUpwardMultiplier", name)
// Fork Choice params.
assert.Equal(t, expected.DeprecatedSafeSlotsToUpdateJustified, actual.DeprecatedSafeSlotsToUpdateJustified, "%s: SafeSlotsToUpdateJustified", name)
// Validator params. // Validator params.
assert.Equal(t, expected.Eth1FollowDistance, actual.Eth1FollowDistance, "%s: Eth1FollowDistance", name) assert.Equal(t, expected.Eth1FollowDistance, actual.Eth1FollowDistance, "%s: Eth1FollowDistance", name)
assert.Equal(t, expected.TargetAggregatorsPerCommittee, actual.TargetAggregatorsPerCommittee, "%s: TargetAggregatorsPerCommittee", name) assert.Equal(t, expected.TargetAggregatorsPerCommittee, actual.TargetAggregatorsPerCommittee, "%s: TargetAggregatorsPerCommittee", name)

View File

@@ -68,7 +68,6 @@ func compareConfigs(t *testing.T, expected, actual *params.BeaconChainConfig) {
require.DeepEqual(t, expected.ShardCommitteePeriod, actual.ShardCommitteePeriod) require.DeepEqual(t, expected.ShardCommitteePeriod, actual.ShardCommitteePeriod)
require.DeepEqual(t, expected.MinEpochsToInactivityPenalty, actual.MinEpochsToInactivityPenalty) require.DeepEqual(t, expected.MinEpochsToInactivityPenalty, actual.MinEpochsToInactivityPenalty)
require.DeepEqual(t, expected.Eth1FollowDistance, actual.Eth1FollowDistance) require.DeepEqual(t, expected.Eth1FollowDistance, actual.Eth1FollowDistance)
require.DeepEqual(t, expected.DeprecatedSafeSlotsToUpdateJustified, actual.DeprecatedSafeSlotsToUpdateJustified)
require.DeepEqual(t, expected.SecondsPerETH1Block, actual.SecondsPerETH1Block) require.DeepEqual(t, expected.SecondsPerETH1Block, actual.SecondsPerETH1Block)
require.DeepEqual(t, expected.ProposerScoreBoost, actual.ProposerScoreBoost) require.DeepEqual(t, expected.ProposerScoreBoost, actual.ProposerScoreBoost)
require.DeepEqual(t, expected.IntervalsPerSlot, actual.IntervalsPerSlot) require.DeepEqual(t, expected.IntervalsPerSlot, actual.IntervalsPerSlot)

View File

@@ -9,10 +9,9 @@ iface_mock_path="testing/validator-mock"
# github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1 # github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1
# ------------------------------------------------------ # ------------------------------------------------------
proto_mocks_v1alpha1=( proto_mocks_v1alpha1=(
"$mock_path/beacon_service_mock.go BeaconChainClient,BeaconChain_StreamChainHeadClient,BeaconChain_StreamAttestationsClient,BeaconChain_StreamBlocksClient,BeaconChain_StreamValidatorsInfoClient,BeaconChain_StreamIndexedAttestationsClient" "$mock_path/beacon_service_mock.go BeaconChainClient"
"$mock_path/beacon_chain_service_mock.go BeaconChain_StreamChainHeadServer,BeaconChain_StreamAttestationsServer,BeaconChain_StreamBlocksServer,BeaconChain_StreamValidatorsInfoServer,BeaconChain_StreamIndexedAttestationsServer" "$mock_path/beacon_validator_server_mock.go BeaconNodeValidatorServer,BeaconNodeValidator_WaitForActivationServer,BeaconNodeValidator_WaitForChainStartServer,BeaconNodeValidator_StreamSlotsServer"
"$mock_path/beacon_validator_server_mock.go BeaconNodeValidatorServer,BeaconNodeValidator_WaitForActivationServer,BeaconNodeValidator_WaitForChainStartServer,BeaconNodeValidator_StreamDutiesServer,BeaconNodeValidator_StreamSlotsServer" "$mock_path/beacon_validator_client_mock.go BeaconNodeValidatorClient,BeaconNodeValidator_WaitForChainStartClient,BeaconNodeValidator_WaitForActivationClient,BeaconNodeValidator_StreamSlotsClient"
"$mock_path/beacon_validator_client_mock.go BeaconNodeValidatorClient,BeaconNodeValidator_WaitForChainStartClient,BeaconNodeValidator_WaitForActivationClient,BeaconNodeValidator_StreamDutiesClient,BeaconNodeValidator_StreamSlotsClient"
"$mock_path/node_service_mock.go NodeClient" "$mock_path/node_service_mock.go NodeClient"
) )

File diff suppressed because it is too large Load Diff

View File

@@ -53,7 +53,7 @@ message GenericSignedBeaconBlock {
SignedBlindedBeaconBlockDeneb blinded_deneb = 8; SignedBlindedBeaconBlockDeneb blinded_deneb = 8;
} }
bool is_blinded = 100; bool is_blinded = 100;
uint64 payload_value = 101 [deprecated = true]; reserved 101; // Deprecated fields
} }
message GenericBeaconBlock { message GenericBeaconBlock {

File diff suppressed because it is too large Load Diff

View File

@@ -107,40 +107,6 @@ func local_request_BeaconChain_ListIndexedAttestations_0(ctx context.Context, ma
} }
func request_BeaconChain_StreamAttestations_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (BeaconChain_StreamAttestationsClient, runtime.ServerMetadata, error) {
var protoReq emptypb.Empty
var metadata runtime.ServerMetadata
stream, err := client.StreamAttestations(ctx, &protoReq)
if err != nil {
return nil, metadata, err
}
header, err := stream.Header()
if err != nil {
return nil, metadata, err
}
metadata.HeaderMD = header
return stream, metadata, nil
}
func request_BeaconChain_StreamIndexedAttestations_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (BeaconChain_StreamIndexedAttestationsClient, runtime.ServerMetadata, error) {
var protoReq emptypb.Empty
var metadata runtime.ServerMetadata
stream, err := client.StreamIndexedAttestations(ctx, &protoReq)
if err != nil {
return nil, metadata, err
}
header, err := stream.Header()
if err != nil {
return nil, metadata, err
}
metadata.HeaderMD = header
return stream, metadata, nil
}
var ( var (
filter_BeaconChain_AttestationPool_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} filter_BeaconChain_AttestationPool_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
) )
@@ -213,51 +179,6 @@ func local_request_BeaconChain_ListBeaconBlocks_0(ctx context.Context, marshaler
} }
var (
filter_BeaconChain_StreamBlocks_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_BeaconChain_StreamBlocks_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (BeaconChain_StreamBlocksClient, runtime.ServerMetadata, error) {
var protoReq StreamBlocksRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_StreamBlocks_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
stream, err := client.StreamBlocks(ctx, &protoReq)
if err != nil {
return nil, metadata, err
}
header, err := stream.Header()
if err != nil {
return nil, metadata, err
}
metadata.HeaderMD = header
return stream, metadata, nil
}
func request_BeaconChain_StreamChainHead_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (BeaconChain_StreamChainHeadClient, runtime.ServerMetadata, error) {
var protoReq emptypb.Empty
var metadata runtime.ServerMetadata
stream, err := client.StreamChainHead(ctx, &protoReq)
if err != nil {
return nil, metadata, err
}
header, err := stream.Header()
if err != nil {
return nil, metadata, err
}
metadata.HeaderMD = header
return stream, metadata, nil
}
func request_BeaconChain_GetChainHead_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { func request_BeaconChain_GetChainHead_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq emptypb.Empty var protoReq emptypb.Empty
var metadata runtime.ServerMetadata var metadata runtime.ServerMetadata
@@ -600,58 +521,6 @@ func local_request_BeaconChain_GetBeaconConfig_0(ctx context.Context, marshaler
} }
func request_BeaconChain_StreamValidatorsInfo_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (BeaconChain_StreamValidatorsInfoClient, runtime.ServerMetadata, error) {
var metadata runtime.ServerMetadata
stream, err := client.StreamValidatorsInfo(ctx)
if err != nil {
grpclog.Infof("Failed to start streaming: %v", err)
return nil, metadata, err
}
dec := marshaler.NewDecoder(req.Body)
handleSend := func() error {
var protoReq ValidatorChangeSet
err := dec.Decode(&protoReq)
if err == io.EOF {
return err
}
if err != nil {
grpclog.Infof("Failed to decode request: %v", err)
return err
}
if err := stream.Send(&protoReq); err != nil {
grpclog.Infof("Failed to send request: %v", err)
return err
}
return nil
}
if err := handleSend(); err != nil {
if cerr := stream.CloseSend(); cerr != nil {
grpclog.Infof("Failed to terminate client stream: %v", cerr)
}
if err == io.EOF {
return stream, metadata, nil
}
return nil, metadata, err
}
go func() {
for {
if err := handleSend(); err != nil {
break
}
}
if err := stream.CloseSend(); err != nil {
grpclog.Infof("Failed to terminate client stream: %v", err)
}
}()
header, err := stream.Header()
if err != nil {
grpclog.Infof("Failed to get header from client: %v", err)
return nil, metadata, err
}
metadata.HeaderMD = header
return stream, metadata, nil
}
var ( var (
filter_BeaconChain_SubmitAttesterSlashing_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} filter_BeaconChain_SubmitAttesterSlashing_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
) )
@@ -812,20 +681,6 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux
}) })
mux.Handle("GET", pattern_BeaconChain_StreamAttestations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport")
_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
})
mux.Handle("GET", pattern_BeaconChain_StreamIndexedAttestations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport")
_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
})
mux.Handle("GET", pattern_BeaconChain_AttestationPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_BeaconChain_AttestationPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
@@ -872,20 +727,6 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux
}) })
mux.Handle("GET", pattern_BeaconChain_StreamBlocks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport")
_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
})
mux.Handle("GET", pattern_BeaconChain_StreamChainHead_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport")
_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
})
mux.Handle("GET", pattern_BeaconChain_GetChainHead_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_BeaconChain_GetChainHead_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
@@ -1139,13 +980,6 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux
}) })
mux.Handle("GET", pattern_BeaconChain_StreamValidatorsInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport")
_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
})
mux.Handle("GET", pattern_BeaconChain_SubmitAttesterSlashing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_BeaconChain_SubmitAttesterSlashing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
@@ -1296,46 +1130,6 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux
}) })
mux.Handle("GET", pattern_BeaconChain_StreamAttestations_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.v1alpha1.BeaconChain/StreamAttestations")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BeaconChain_StreamAttestations_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconChain_StreamAttestations_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconChain_StreamIndexedAttestations_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.v1alpha1.BeaconChain/StreamIndexedAttestations")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BeaconChain_StreamIndexedAttestations_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconChain_StreamIndexedAttestations_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconChain_AttestationPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_BeaconChain_AttestationPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
@@ -1376,46 +1170,6 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux
}) })
mux.Handle("GET", pattern_BeaconChain_StreamBlocks_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.v1alpha1.BeaconChain/StreamBlocks")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BeaconChain_StreamBlocks_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconChain_StreamBlocks_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconChain_StreamChainHead_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.v1alpha1.BeaconChain/StreamChainHead")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BeaconChain_StreamChainHead_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconChain_StreamChainHead_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconChain_GetChainHead_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_BeaconChain_GetChainHead_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
@@ -1636,26 +1390,6 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux
}) })
mux.Handle("GET", pattern_BeaconChain_StreamValidatorsInfo_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.v1alpha1.BeaconChain/StreamValidatorsInfo")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BeaconChain_StreamValidatorsInfo_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconChain_StreamValidatorsInfo_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconChain_SubmitAttesterSlashing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_BeaconChain_SubmitAttesterSlashing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
@@ -1724,18 +1458,10 @@ var (
pattern_BeaconChain_ListIndexedAttestations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "indexed"}, "")) pattern_BeaconChain_ListIndexedAttestations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "indexed"}, ""))
pattern_BeaconChain_StreamAttestations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "stream"}, ""))
pattern_BeaconChain_StreamIndexedAttestations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"eth", "v1alpha1", "beacon", "attestations", "indexed", "stream"}, ""))
pattern_BeaconChain_AttestationPool_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "pool"}, "")) pattern_BeaconChain_AttestationPool_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "pool"}, ""))
pattern_BeaconChain_ListBeaconBlocks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha2", "beacon", "blocks"}, "")) pattern_BeaconChain_ListBeaconBlocks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha2", "beacon", "blocks"}, ""))
pattern_BeaconChain_StreamBlocks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "blocks", "stream"}, ""))
pattern_BeaconChain_StreamChainHead_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "chainhead", "stream"}, ""))
pattern_BeaconChain_GetChainHead_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "chainhead"}, "")) pattern_BeaconChain_GetChainHead_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "chainhead"}, ""))
pattern_BeaconChain_ListBeaconCommittees_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "committees"}, "")) pattern_BeaconChain_ListBeaconCommittees_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "committees"}, ""))
@@ -1758,8 +1484,6 @@ var (
pattern_BeaconChain_GetBeaconConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "config"}, "")) pattern_BeaconChain_GetBeaconConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "config"}, ""))
pattern_BeaconChain_StreamValidatorsInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"eth", "v1alpha1", "beacon", "validators", "info", "stream"}, ""))
pattern_BeaconChain_SubmitAttesterSlashing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"eth", "v1alpha1", "beacon", "slashings", "attester", "submit"}, "")) pattern_BeaconChain_SubmitAttesterSlashing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"eth", "v1alpha1", "beacon", "slashings", "attester", "submit"}, ""))
pattern_BeaconChain_SubmitProposerSlashing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"eth", "v1alpha1", "beacon", "slashings", "proposer", "submit"}, "")) pattern_BeaconChain_SubmitProposerSlashing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"eth", "v1alpha1", "beacon", "slashings", "proposer", "submit"}, ""))
@@ -1772,18 +1496,10 @@ var (
forward_BeaconChain_ListIndexedAttestations_0 = runtime.ForwardResponseMessage forward_BeaconChain_ListIndexedAttestations_0 = runtime.ForwardResponseMessage
forward_BeaconChain_StreamAttestations_0 = runtime.ForwardResponseStream
forward_BeaconChain_StreamIndexedAttestations_0 = runtime.ForwardResponseStream
forward_BeaconChain_AttestationPool_0 = runtime.ForwardResponseMessage forward_BeaconChain_AttestationPool_0 = runtime.ForwardResponseMessage
forward_BeaconChain_ListBeaconBlocks_0 = runtime.ForwardResponseMessage forward_BeaconChain_ListBeaconBlocks_0 = runtime.ForwardResponseMessage
forward_BeaconChain_StreamBlocks_0 = runtime.ForwardResponseStream
forward_BeaconChain_StreamChainHead_0 = runtime.ForwardResponseStream
forward_BeaconChain_GetChainHead_0 = runtime.ForwardResponseMessage forward_BeaconChain_GetChainHead_0 = runtime.ForwardResponseMessage
forward_BeaconChain_ListBeaconCommittees_0 = runtime.ForwardResponseMessage forward_BeaconChain_ListBeaconCommittees_0 = runtime.ForwardResponseMessage
@@ -1806,8 +1522,6 @@ var (
forward_BeaconChain_GetBeaconConfig_0 = runtime.ForwardResponseMessage forward_BeaconChain_GetBeaconConfig_0 = runtime.ForwardResponseMessage
forward_BeaconChain_StreamValidatorsInfo_0 = runtime.ForwardResponseStream
forward_BeaconChain_SubmitAttesterSlashing_0 = runtime.ForwardResponseMessage forward_BeaconChain_SubmitAttesterSlashing_0 = runtime.ForwardResponseMessage
forward_BeaconChain_SubmitProposerSlashing_0 = runtime.ForwardResponseMessage forward_BeaconChain_SubmitProposerSlashing_0 = runtime.ForwardResponseMessage

View File

@@ -59,26 +59,6 @@ service BeaconChain {
}; };
} }
// Server-side stream of attestations as they are received by
// the beacon chain node.
// DEPRECATED: This endpoint is superseded by the /eth/v1/events Beacon API endpoint
rpc StreamAttestations(google.protobuf.Empty) returns (stream Attestation) {
option deprecated = true;
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/attestations/stream"
};
}
// Server-side stream of indexed attestations as they are received by
// the beacon chain node.
// DEPRECATED: This endpoint is superseded by the /eth/v1/events Beacon API endpoint
rpc StreamIndexedAttestations(google.protobuf.Empty) returns (stream IndexedAttestation) {
option deprecated = true;
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/attestations/indexed/stream"
};
}
// Retrieve attestations from pool. // Retrieve attestations from pool.
// //
// The server returns a list of attestations that have been seen but not // The server returns a list of attestations that have been seen but not
@@ -107,29 +87,6 @@ service BeaconChain {
}; };
} }
// Server-side stream of all signed blocks as they are received by
// the beacon chain node.
// DEPRECATED: This endpoint is superseded by the /eth/v1/events Beacon API endpoint
rpc StreamBlocks(StreamBlocksRequest) returns (stream SignedBeaconBlock) {
option deprecated = true;
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/blocks/stream"
};
}
// Server-side stream of information about the head of the beacon chain
// from the view of the beacon chain node.
//
// This includes the head block slot and root as well as information about
// the most recent finalized and justified slots.
// DEPRECATED: This endpoint is superseded by the /eth/v1/events Beacon API endpoint
rpc StreamChainHead(google.protobuf.Empty) returns (stream ChainHead) {
option deprecated = true;
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/chainhead/stream"
};
}
// Retrieve information about the head of the beacon chain from the view of // Retrieve information about the head of the beacon chain from the view of
// the beacon chain node. // the beacon chain node.
// //
@@ -228,6 +185,7 @@ service BeaconChain {
// validator attestations. This endpoint allows for retrieval of genesis // validator attestations. This endpoint allows for retrieval of genesis
// information via a boolean query filter. // information via a boolean query filter.
rpc GetValidatorParticipation(GetValidatorParticipationRequest) returns (ValidatorParticipationResponse) { rpc GetValidatorParticipation(GetValidatorParticipationRequest) returns (ValidatorParticipationResponse) {
option deprecated = true;
option (google.api.http) = { option (google.api.http) = {
get: "/eth/v1alpha1/validators/participation" get: "/eth/v1alpha1/validators/participation"
}; };
@@ -240,16 +198,6 @@ service BeaconChain {
}; };
} }
// Server-side stream of validator information at each epoch.
// DEPRECATED: Streaming Validator Info is no longer supported.
// The Beacon API /eth/v1/beacon/states/{state_id}/validators will provide validator info in unstreamed format.
rpc StreamValidatorsInfo(stream ValidatorChangeSet) returns (stream ValidatorInfo) {
option deprecated = true;
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/validators/info/stream"
};
}
// Submit an attester slashing object to the beacon node. // Submit an attester slashing object to the beacon node.
rpc SubmitAttesterSlashing(AttesterSlashing) returns (SubmitSlashingResponse) { rpc SubmitAttesterSlashing(AttesterSlashing) returns (SubmitSlashingResponse) {
option (google.api.http) = { option (google.api.http) = {
@@ -272,27 +220,6 @@ service BeaconChain {
} }
} }
// SetAction defines the type of action that should be applied to the keys in a validator change set.
enum SetAction {
// ADD_VALIDATOR_KEYS adds to the existing keys.
ADD_VALIDATOR_KEYS = 0;
// REMOVE_VALIDATOR_KEYS removes from the existing keys.
REMOVE_VALIDATOR_KEYS = 1;
// SET_VALIDATOR_KEYS overwrites the existing keys.
SET_VALIDATOR_KEYS = 2;
}
// ValidatorChangeSet updates the server's list of keys on which to operate.
// DEPRECATED: This message's endpoint is superseded by the /eth/v1/events Beacon API endpoint
message ValidatorChangeSet {
option deprecated = true;
// Action (add/remove/set).
SetAction action = 1;
// 48 byte BLS public keys of validators on which the operation occurs.
repeated bytes public_keys = 2;
}
// Request for indexed attestations by target epoch. // Request for indexed attestations by target epoch.
message ListIndexedAttestationsRequest { message ListIndexedAttestationsRequest {
oneof query_filter { oneof query_filter {
@@ -809,7 +736,6 @@ message GetValidatorParticipationRequest {
} }
} }
// DEPRECATED: Prysm Web UI and associated endpoints will be fully removed in a future hard fork.
message ValidatorParticipationResponse { message ValidatorParticipationResponse {
option deprecated = true; option deprecated = true;
// Epoch which this message is applicable. // Epoch which this message is applicable.

View File

@@ -979,7 +979,7 @@ var file_proto_prysm_v1alpha1_debug_proto_rawDesc = []byte{
0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65,
0x72, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x18, 0x69, 0x6e, 0x76, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x18, 0x69, 0x6e, 0x76, 0x61,
0x6c, 0x69, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65,
0x72, 0x69, 0x65, 0x73, 0x32, 0x8e, 0x06, 0x0a, 0x05, 0x44, 0x65, 0x62, 0x75, 0x67, 0x12, 0x82, 0x72, 0x69, 0x65, 0x73, 0x32, 0xf4, 0x04, 0x0a, 0x05, 0x44, 0x65, 0x62, 0x75, 0x67, 0x12, 0x82,
0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74,
0x65, 0x12, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x12, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68,
0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e,
@@ -1018,27 +1018,17 @@ var file_proto_prysm_v1alpha1_debug_proto_rawDesc = []byte{
0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x50, 0x65, 0x65, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x50, 0x65, 0x65,
0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02,
0x1a, 0x12, 0x18, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x12, 0x18, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31,
0x2f, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2f, 0x70, 0x65, 0x65, 0x72, 0x12, 0x97, 0x01, 0x0a, 0x10, 0x2f, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2f, 0x70, 0x65, 0x65, 0x72, 0x42, 0x95, 0x01, 0x0a, 0x19,
0x47, 0x65, 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x6c, 0x6f, 0x74, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68,
0x12, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0a, 0x44, 0x65, 0x62, 0x75, 0x67,
0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x6f, 0x6e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62,
0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b,
0x6c, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45,
0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x74, 0x68, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74,
0x61, 0x31, 0x2f, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70,
0x6f, 0x6e, 0x88, 0x02, 0x01, 0x42, 0x95, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70,
0x68, 0x61, 0x31, 0x42, 0x0a, 0x44, 0x65, 0x62, 0x75, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
0x01, 0x5a, 0x3a, 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, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d,
0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15,
0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0x61,
0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d,
0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@@ -1094,15 +1084,13 @@ var file_proto_prysm_v1alpha1_debug_proto_depIdxs = []int32{
6, // 13: ethereum.eth.v1alpha1.Debug.SetLoggingLevel:input_type -> ethereum.eth.v1alpha1.LoggingLevelRequest 6, // 13: ethereum.eth.v1alpha1.Debug.SetLoggingLevel:input_type -> ethereum.eth.v1alpha1.LoggingLevelRequest
18, // 14: ethereum.eth.v1alpha1.Debug.ListPeers:input_type -> google.protobuf.Empty 18, // 14: ethereum.eth.v1alpha1.Debug.ListPeers:input_type -> google.protobuf.Empty
19, // 15: ethereum.eth.v1alpha1.Debug.GetPeer:input_type -> ethereum.eth.v1alpha1.PeerRequest 19, // 15: ethereum.eth.v1alpha1.Debug.GetPeer:input_type -> ethereum.eth.v1alpha1.PeerRequest
1, // 16: ethereum.eth.v1alpha1.Debug.GetInclusionSlot:input_type -> ethereum.eth.v1alpha1.InclusionSlotRequest 5, // 16: ethereum.eth.v1alpha1.Debug.GetBeaconState:output_type -> ethereum.eth.v1alpha1.SSZResponse
5, // 17: ethereum.eth.v1alpha1.Debug.GetBeaconState:output_type -> ethereum.eth.v1alpha1.SSZResponse 5, // 17: ethereum.eth.v1alpha1.Debug.GetBlock:output_type -> ethereum.eth.v1alpha1.SSZResponse
5, // 18: ethereum.eth.v1alpha1.Debug.GetBlock:output_type -> ethereum.eth.v1alpha1.SSZResponse 18, // 18: ethereum.eth.v1alpha1.Debug.SetLoggingLevel:output_type -> google.protobuf.Empty
18, // 19: ethereum.eth.v1alpha1.Debug.SetLoggingLevel:output_type -> google.protobuf.Empty 7, // 19: ethereum.eth.v1alpha1.Debug.ListPeers:output_type -> ethereum.eth.v1alpha1.DebugPeerResponses
7, // 20: ethereum.eth.v1alpha1.Debug.ListPeers:output_type -> ethereum.eth.v1alpha1.DebugPeerResponses 8, // 20: ethereum.eth.v1alpha1.Debug.GetPeer:output_type -> ethereum.eth.v1alpha1.DebugPeerResponse
8, // 21: ethereum.eth.v1alpha1.Debug.GetPeer:output_type -> ethereum.eth.v1alpha1.DebugPeerResponse 16, // [16:21] is the sub-list for method output_type
2, // 22: ethereum.eth.v1alpha1.Debug.GetInclusionSlot:output_type -> ethereum.eth.v1alpha1.InclusionSlotResponse 11, // [11:16] is the sub-list for method input_type
17, // [17:23] is the sub-list for method output_type
11, // [11:17] is the sub-list for method input_type
11, // [11:11] is the sub-list for extension type_name 11, // [11:11] is the sub-list for extension type_name
11, // [11:11] is the sub-list for extension extendee 11, // [11:11] is the sub-list for extension extendee
0, // [0:11] is the sub-list for field type_name 0, // [0:11] is the sub-list for field type_name
@@ -1291,8 +1279,6 @@ type DebugClient interface {
SetLoggingLevel(ctx context.Context, in *LoggingLevelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) SetLoggingLevel(ctx context.Context, in *LoggingLevelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
ListPeers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*DebugPeerResponses, error) ListPeers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*DebugPeerResponses, error)
GetPeer(ctx context.Context, in *PeerRequest, opts ...grpc.CallOption) (*DebugPeerResponse, error) GetPeer(ctx context.Context, in *PeerRequest, opts ...grpc.CallOption) (*DebugPeerResponse, error)
// Deprecated: Do not use.
GetInclusionSlot(ctx context.Context, in *InclusionSlotRequest, opts ...grpc.CallOption) (*InclusionSlotResponse, error)
} }
type debugClient struct { type debugClient struct {
@@ -1348,16 +1334,6 @@ func (c *debugClient) GetPeer(ctx context.Context, in *PeerRequest, opts ...grpc
return out, nil return out, nil
} }
// Deprecated: Do not use.
func (c *debugClient) GetInclusionSlot(ctx context.Context, in *InclusionSlotRequest, opts ...grpc.CallOption) (*InclusionSlotResponse, error) {
out := new(InclusionSlotResponse)
err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Debug/GetInclusionSlot", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// DebugServer is the server API for Debug service. // DebugServer is the server API for Debug service.
type DebugServer interface { type DebugServer interface {
GetBeaconState(context.Context, *BeaconStateRequest) (*SSZResponse, error) GetBeaconState(context.Context, *BeaconStateRequest) (*SSZResponse, error)
@@ -1365,8 +1341,6 @@ type DebugServer interface {
SetLoggingLevel(context.Context, *LoggingLevelRequest) (*emptypb.Empty, error) SetLoggingLevel(context.Context, *LoggingLevelRequest) (*emptypb.Empty, error)
ListPeers(context.Context, *emptypb.Empty) (*DebugPeerResponses, error) ListPeers(context.Context, *emptypb.Empty) (*DebugPeerResponses, error)
GetPeer(context.Context, *PeerRequest) (*DebugPeerResponse, error) GetPeer(context.Context, *PeerRequest) (*DebugPeerResponse, error)
// Deprecated: Do not use.
GetInclusionSlot(context.Context, *InclusionSlotRequest) (*InclusionSlotResponse, error)
} }
// UnimplementedDebugServer can be embedded to have forward compatible implementations. // UnimplementedDebugServer can be embedded to have forward compatible implementations.
@@ -1388,9 +1362,6 @@ func (*UnimplementedDebugServer) ListPeers(context.Context, *emptypb.Empty) (*De
func (*UnimplementedDebugServer) GetPeer(context.Context, *PeerRequest) (*DebugPeerResponse, error) { func (*UnimplementedDebugServer) GetPeer(context.Context, *PeerRequest) (*DebugPeerResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetPeer not implemented") return nil, status.Errorf(codes.Unimplemented, "method GetPeer not implemented")
} }
func (*UnimplementedDebugServer) GetInclusionSlot(context.Context, *InclusionSlotRequest) (*InclusionSlotResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetInclusionSlot not implemented")
}
func RegisterDebugServer(s *grpc.Server, srv DebugServer) { func RegisterDebugServer(s *grpc.Server, srv DebugServer) {
s.RegisterService(&_Debug_serviceDesc, srv) s.RegisterService(&_Debug_serviceDesc, srv)
@@ -1486,24 +1457,6 @@ func _Debug_GetPeer_Handler(srv interface{}, ctx context.Context, dec func(inter
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Debug_GetInclusionSlot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InclusionSlotRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DebugServer).GetInclusionSlot(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ethereum.eth.v1alpha1.Debug/GetInclusionSlot",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DebugServer).GetInclusionSlot(ctx, req.(*InclusionSlotRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Debug_serviceDesc = grpc.ServiceDesc{ var _Debug_serviceDesc = grpc.ServiceDesc{
ServiceName: "ethereum.eth.v1alpha1.Debug", ServiceName: "ethereum.eth.v1alpha1.Debug",
HandlerType: (*DebugServer)(nil), HandlerType: (*DebugServer)(nil),
@@ -1528,10 +1481,6 @@ var _Debug_serviceDesc = grpc.ServiceDesc{
MethodName: "GetPeer", MethodName: "GetPeer",
Handler: _Debug_GetPeer_Handler, Handler: _Debug_GetPeer_Handler,
}, },
{
MethodName: "GetInclusionSlot",
Handler: _Debug_GetInclusionSlot_Handler,
},
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
Metadata: "proto/prysm/v1alpha1/debug.proto", Metadata: "proto/prysm/v1alpha1/debug.proto",

View File

@@ -197,42 +197,6 @@ func local_request_Debug_GetPeer_0(ctx context.Context, marshaler runtime.Marsha
} }
var (
filter_Debug_GetInclusionSlot_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_Debug_GetInclusionSlot_0(ctx context.Context, marshaler runtime.Marshaler, client DebugClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq InclusionSlotRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Debug_GetInclusionSlot_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.GetInclusionSlot(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Debug_GetInclusionSlot_0(ctx context.Context, marshaler runtime.Marshaler, server DebugServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq InclusionSlotRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Debug_GetInclusionSlot_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.GetInclusionSlot(ctx, &protoReq)
return msg, metadata, err
}
// RegisterDebugHandlerServer registers the http handlers for service Debug to "mux". // RegisterDebugHandlerServer registers the http handlers for service Debug to "mux".
// UnaryRPC :call DebugServer directly. // UnaryRPC :call DebugServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
@@ -354,29 +318,6 @@ func RegisterDebugHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
}) })
mux.Handle("GET", pattern_Debug_GetInclusionSlot_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.v1alpha1.Debug/GetInclusionSlot")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Debug_GetInclusionSlot_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_Debug_GetInclusionSlot_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil return nil
} }
@@ -518,26 +459,6 @@ func RegisterDebugHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}) })
mux.Handle("GET", pattern_Debug_GetInclusionSlot_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.v1alpha1.Debug/GetInclusionSlot")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Debug_GetInclusionSlot_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Debug_GetInclusionSlot_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil return nil
} }
@@ -551,8 +472,6 @@ var (
pattern_Debug_ListPeers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "debug", "peers"}, "")) pattern_Debug_ListPeers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "debug", "peers"}, ""))
pattern_Debug_GetPeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "debug", "peer"}, "")) pattern_Debug_GetPeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "debug", "peer"}, ""))
pattern_Debug_GetInclusionSlot_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "debug", "inclusion"}, ""))
) )
var ( var (
@@ -565,6 +484,4 @@ var (
forward_Debug_ListPeers_0 = runtime.ForwardResponseMessage forward_Debug_ListPeers_0 = runtime.ForwardResponseMessage
forward_Debug_GetPeer_0 = runtime.ForwardResponseMessage forward_Debug_GetPeer_0 = runtime.ForwardResponseMessage
forward_Debug_GetInclusionSlot_0 = runtime.ForwardResponseMessage
) )

View File

@@ -51,15 +51,6 @@ service Debug {
get: "/eth/v1alpha1/debug/peer" get: "/eth/v1alpha1/debug/peer"
}; };
} }
// Returns the inclusion slot of a given attester id and slot.
// DEPRECATED: This endpoint doesn't appear to be used and have been marked for deprecation.
rpc GetInclusionSlot(InclusionSlotRequest) returns (InclusionSlotResponse) {
option deprecated = true;
option (google.api.http) = {
get: "/eth/v1alpha1/debug/inclusion"
};
}
} }
message InclusionSlotRequest { message InclusionSlotRequest {

File diff suppressed because it is too large Load Diff

View File

@@ -71,34 +71,6 @@ func local_request_BeaconNodeValidator_GetDuties_0(ctx context.Context, marshale
} }
var (
filter_BeaconNodeValidator_StreamDuties_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_BeaconNodeValidator_StreamDuties_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (BeaconNodeValidator_StreamDutiesClient, runtime.ServerMetadata, error) {
var protoReq DutiesRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_StreamDuties_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
stream, err := client.StreamDuties(ctx, &protoReq)
if err != nil {
return nil, metadata, err
}
header, err := stream.Header()
if err != nil {
return nil, metadata, err
}
metadata.HeaderMD = header
return stream, metadata, nil
}
var ( var (
filter_BeaconNodeValidator_DomainData_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} filter_BeaconNodeValidator_DomainData_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
) )
@@ -1013,13 +985,6 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime.
}) })
mux.Handle("GET", pattern_BeaconNodeValidator_StreamDuties_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport")
_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
})
mux.Handle("GET", pattern_BeaconNodeValidator_DomainData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_BeaconNodeValidator_DomainData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
@@ -1638,26 +1603,6 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime.
}) })
mux.Handle("GET", pattern_BeaconNodeValidator_StreamDuties_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.v1alpha1.BeaconNodeValidator/StreamDuties")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BeaconNodeValidator_StreamDuties_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconNodeValidator_StreamDuties_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconNodeValidator_DomainData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_BeaconNodeValidator_DomainData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
@@ -2204,8 +2149,6 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime.
var ( var (
pattern_BeaconNodeValidator_GetDuties_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "duties"}, "")) pattern_BeaconNodeValidator_GetDuties_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "duties"}, ""))
pattern_BeaconNodeValidator_StreamDuties_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "duties", "stream"}, ""))
pattern_BeaconNodeValidator_DomainData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "domain"}, "")) pattern_BeaconNodeValidator_DomainData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "domain"}, ""))
pattern_BeaconNodeValidator_WaitForChainStart_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "chainstart", "stream"}, "")) pattern_BeaconNodeValidator_WaitForChainStart_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "chainstart", "stream"}, ""))
@@ -2264,8 +2207,6 @@ var (
var ( var (
forward_BeaconNodeValidator_GetDuties_0 = runtime.ForwardResponseMessage forward_BeaconNodeValidator_GetDuties_0 = runtime.ForwardResponseMessage
forward_BeaconNodeValidator_StreamDuties_0 = runtime.ForwardResponseStream
forward_BeaconNodeValidator_DomainData_0 = runtime.ForwardResponseMessage forward_BeaconNodeValidator_DomainData_0 = runtime.ForwardResponseMessage
forward_BeaconNodeValidator_WaitForChainStart_0 = runtime.ForwardResponseStream forward_BeaconNodeValidator_WaitForChainStart_0 = runtime.ForwardResponseStream

View File

@@ -53,19 +53,6 @@ service BeaconNodeValidator {
}; };
} }
// Stream validator duties for the requested validators.
//
// The duties consist of:
// Proposer - the validator that creates a beacon chain block.
// Attester — a validator that is part of a committee that needs to sign off on a beacon chain
// DEPRECATED: This endpoint is superseded by the /eth/v1/events Beacon API endpoint
rpc StreamDuties(DutiesRequest) returns (stream DutiesResponse) {
option deprecated = true;
option (google.api.http) = {
get: "/eth/v1alpha1/validator/duties/stream"
};
}
// DomainData fetches the current BLS signature domain version information from the // DomainData fetches the current BLS signature domain version information from the
// running beacon node's state. This information is used when validators sign // running beacon node's state. This information is used when validators sign
// blocks and attestations appropriately based on their duty. // blocks and attestations appropriately based on their duty.
@@ -373,7 +360,6 @@ message StreamSlotsResponse {
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"];
} }
// DEPRECATED: This endpoint StreamBlocks is superseded by the /eth/v1/events Beacon API endpoint // DEPRECATED: This endpoint StreamBlocks is superseded by the /eth/v1/events Beacon API endpoint
message StreamBlocksResponse { message StreamBlocksResponse {
option deprecated = true; option deprecated = true;
@@ -395,7 +381,6 @@ message StreamBlocksResponse {
} }
} }
message DomainRequest { message DomainRequest {
// The epoch for which the domain is being requested. // The epoch for which the domain is being requested.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"]; uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"];
@@ -522,7 +507,7 @@ message DutiesRequest {
} }
message DutiesResponse { message DutiesResponse {
repeated Duty duties = 1 [deprecated = true]; reserved 1; // Deprecated fields
repeated Duty current_epoch_duties = 2; repeated Duty current_epoch_duties = 2;
@@ -676,13 +661,10 @@ message ValidatorParticipation {
// Percentage of validator participation in the given epoch. This field // Percentage of validator participation in the given epoch. This field
// contains a value between 0 and 1. // contains a value between 0 and 1.
float global_participation_rate = 1 [deprecated = true]; float global_participation_rate = 1 [deprecated = true];
// The total amount of ether, in gwei, that has been used in voting. // The total amount of ether, in gwei, that has been used in voting.
uint64 voted_ether = 2 [deprecated = true]; uint64 voted_ether = 2 [deprecated = true];
// The total amount of ether, in gwei, that is eligible for voting. // The total amount of ether, in gwei, that is eligible for voting.
uint64 eligible_ether = 3 [deprecated = true]; uint64 eligible_ether = 3 [deprecated = true];
// Total staked gwei that was active (i.e. eligible to vote) during the current epoch. // Total staked gwei that was active (i.e. eligible to vote) during the current epoch.
uint64 current_epoch_active_gwei = 4; uint64 current_epoch_active_gwei = 4;
// Total staked gwei that had attestations included in a block during the current epoch, // Total staked gwei that had attestations included in a block during the current epoch,
@@ -768,7 +750,6 @@ message StreamSlotsRequest {
bool verified_only = 1; bool verified_only = 1;
} }
// Request to only return blocks that is verified by the beacon node. // Request to only return blocks that is verified by the beacon node.
// DEPRECATED: This endpoint StreamBlocks is superseded by the /eth/v1/events Beacon API endpoint // DEPRECATED: This endpoint StreamBlocks is superseded by the /eth/v1/events Beacon API endpoint
message StreamBlocksRequest { message StreamBlocksRequest {

View File

@@ -55,7 +55,7 @@ func (h *doubleAttestationHelper) setup(ctx context.Context) error {
var committeeIndex primitives.CommitteeIndex var committeeIndex primitives.CommitteeIndex
var committee []primitives.ValidatorIndex var committee []primitives.ValidatorIndex
for _, duty := range duties.Duties { for _, duty := range duties.CurrentEpochDuties {
if duty.AttesterSlot == chainHead.HeadSlot { if duty.AttesterSlot == chainHead.HeadSlot {
committeeIndex = duty.CommitteeIndex committeeIndex = duty.CommitteeIndex
committee = duty.Committee committee = duty.Committee

View File

@@ -7,7 +7,6 @@ go_library(
srcs = [ srcs = [
"beacon_altair_validator_client_mock.go", "beacon_altair_validator_client_mock.go",
"beacon_altair_validator_server_mock.go", "beacon_altair_validator_server_mock.go",
"beacon_chain_service_mock.go",
"beacon_service_mock.go", "beacon_service_mock.go",
"beacon_validator_client_mock.go", "beacon_validator_client_mock.go",
"beacon_validator_server_mock.go", "beacon_validator_server_mock.go",

View File

@@ -1,624 +0,0 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1 (interfaces: BeaconChain_StreamChainHeadServer,BeaconChain_StreamAttestationsServer,BeaconChain_StreamBlocksServer,BeaconChain_StreamValidatorsInfoServer,BeaconChain_StreamIndexedAttestationsServer)
// Package mock is a generated GoMock package.
package mock
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
metadata "google.golang.org/grpc/metadata"
)
// MockBeaconChain_StreamChainHeadServer is a mock of BeaconChain_StreamChainHeadServer interface.
type MockBeaconChain_StreamChainHeadServer struct {
ctrl *gomock.Controller
recorder *MockBeaconChain_StreamChainHeadServerMockRecorder
}
// MockBeaconChain_StreamChainHeadServerMockRecorder is the mock recorder for MockBeaconChain_StreamChainHeadServer.
type MockBeaconChain_StreamChainHeadServerMockRecorder struct {
mock *MockBeaconChain_StreamChainHeadServer
}
// NewMockBeaconChain_StreamChainHeadServer creates a new mock instance.
func NewMockBeaconChain_StreamChainHeadServer(ctrl *gomock.Controller) *MockBeaconChain_StreamChainHeadServer {
mock := &MockBeaconChain_StreamChainHeadServer{ctrl: ctrl}
mock.recorder = &MockBeaconChain_StreamChainHeadServerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBeaconChain_StreamChainHeadServer) EXPECT() *MockBeaconChain_StreamChainHeadServerMockRecorder {
return m.recorder
}
// Context mocks base method.
func (m *MockBeaconChain_StreamChainHeadServer) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockBeaconChain_StreamChainHeadServerMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockBeaconChain_StreamChainHeadServer)(nil).Context))
}
// RecvMsg mocks base method.
func (m *MockBeaconChain_StreamChainHeadServer) RecvMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RecvMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockBeaconChain_StreamChainHeadServerMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockBeaconChain_StreamChainHeadServer)(nil).RecvMsg), arg0)
}
// Send mocks base method.
func (m *MockBeaconChain_StreamChainHeadServer) Send(arg0 *eth.ChainHead) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Send indicates an expected call of Send.
func (mr *MockBeaconChain_StreamChainHeadServerMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockBeaconChain_StreamChainHeadServer)(nil).Send), arg0)
}
// SendHeader mocks base method.
func (m *MockBeaconChain_StreamChainHeadServer) SendHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendHeader indicates an expected call of SendHeader.
func (mr *MockBeaconChain_StreamChainHeadServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockBeaconChain_StreamChainHeadServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m *MockBeaconChain_StreamChainHeadServer) SendMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockBeaconChain_StreamChainHeadServerMockRecorder) SendMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockBeaconChain_StreamChainHeadServer)(nil).SendMsg), arg0)
}
// SetHeader mocks base method.
func (m *MockBeaconChain_StreamChainHeadServer) SetHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SetHeader indicates an expected call of SetHeader.
func (mr *MockBeaconChain_StreamChainHeadServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockBeaconChain_StreamChainHeadServer)(nil).SetHeader), arg0)
}
// SetTrailer mocks base method.
func (m *MockBeaconChain_StreamChainHeadServer) SetTrailer(arg0 metadata.MD) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "SetTrailer", arg0)
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *MockBeaconChain_StreamChainHeadServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockBeaconChain_StreamChainHeadServer)(nil).SetTrailer), arg0)
}
// MockBeaconChain_StreamAttestationsServer is a mock of BeaconChain_StreamAttestationsServer interface.
type MockBeaconChain_StreamAttestationsServer struct {
ctrl *gomock.Controller
recorder *MockBeaconChain_StreamAttestationsServerMockRecorder
}
// MockBeaconChain_StreamAttestationsServerMockRecorder is the mock recorder for MockBeaconChain_StreamAttestationsServer.
type MockBeaconChain_StreamAttestationsServerMockRecorder struct {
mock *MockBeaconChain_StreamAttestationsServer
}
// NewMockBeaconChain_StreamAttestationsServer creates a new mock instance.
func NewMockBeaconChain_StreamAttestationsServer(ctrl *gomock.Controller) *MockBeaconChain_StreamAttestationsServer {
mock := &MockBeaconChain_StreamAttestationsServer{ctrl: ctrl}
mock.recorder = &MockBeaconChain_StreamAttestationsServerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBeaconChain_StreamAttestationsServer) EXPECT() *MockBeaconChain_StreamAttestationsServerMockRecorder {
return m.recorder
}
// Context mocks base method.
func (m *MockBeaconChain_StreamAttestationsServer) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockBeaconChain_StreamAttestationsServerMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockBeaconChain_StreamAttestationsServer)(nil).Context))
}
// RecvMsg mocks base method.
func (m *MockBeaconChain_StreamAttestationsServer) RecvMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RecvMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockBeaconChain_StreamAttestationsServerMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockBeaconChain_StreamAttestationsServer)(nil).RecvMsg), arg0)
}
// Send mocks base method.
func (m *MockBeaconChain_StreamAttestationsServer) Send(arg0 *eth.Attestation) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Send indicates an expected call of Send.
func (mr *MockBeaconChain_StreamAttestationsServerMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockBeaconChain_StreamAttestationsServer)(nil).Send), arg0)
}
// SendHeader mocks base method.
func (m *MockBeaconChain_StreamAttestationsServer) SendHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendHeader indicates an expected call of SendHeader.
func (mr *MockBeaconChain_StreamAttestationsServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockBeaconChain_StreamAttestationsServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m *MockBeaconChain_StreamAttestationsServer) SendMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockBeaconChain_StreamAttestationsServerMockRecorder) SendMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockBeaconChain_StreamAttestationsServer)(nil).SendMsg), arg0)
}
// SetHeader mocks base method.
func (m *MockBeaconChain_StreamAttestationsServer) SetHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SetHeader indicates an expected call of SetHeader.
func (mr *MockBeaconChain_StreamAttestationsServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockBeaconChain_StreamAttestationsServer)(nil).SetHeader), arg0)
}
// SetTrailer mocks base method.
func (m *MockBeaconChain_StreamAttestationsServer) SetTrailer(arg0 metadata.MD) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "SetTrailer", arg0)
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *MockBeaconChain_StreamAttestationsServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockBeaconChain_StreamAttestationsServer)(nil).SetTrailer), arg0)
}
// MockBeaconChain_StreamBlocksServer is a mock of BeaconChain_StreamBlocksServer interface.
type MockBeaconChain_StreamBlocksServer struct {
ctrl *gomock.Controller
recorder *MockBeaconChain_StreamBlocksServerMockRecorder
}
// MockBeaconChain_StreamBlocksServerMockRecorder is the mock recorder for MockBeaconChain_StreamBlocksServer.
type MockBeaconChain_StreamBlocksServerMockRecorder struct {
mock *MockBeaconChain_StreamBlocksServer
}
// NewMockBeaconChain_StreamBlocksServer creates a new mock instance.
func NewMockBeaconChain_StreamBlocksServer(ctrl *gomock.Controller) *MockBeaconChain_StreamBlocksServer {
mock := &MockBeaconChain_StreamBlocksServer{ctrl: ctrl}
mock.recorder = &MockBeaconChain_StreamBlocksServerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBeaconChain_StreamBlocksServer) EXPECT() *MockBeaconChain_StreamBlocksServerMockRecorder {
return m.recorder
}
// Context mocks base method.
func (m *MockBeaconChain_StreamBlocksServer) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockBeaconChain_StreamBlocksServerMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockBeaconChain_StreamBlocksServer)(nil).Context))
}
// RecvMsg mocks base method.
func (m *MockBeaconChain_StreamBlocksServer) RecvMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RecvMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockBeaconChain_StreamBlocksServerMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockBeaconChain_StreamBlocksServer)(nil).RecvMsg), arg0)
}
// Send mocks base method.
func (m *MockBeaconChain_StreamBlocksServer) Send(arg0 *eth.SignedBeaconBlock) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Send indicates an expected call of Send.
func (mr *MockBeaconChain_StreamBlocksServerMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockBeaconChain_StreamBlocksServer)(nil).Send), arg0)
}
// SendHeader mocks base method.
func (m *MockBeaconChain_StreamBlocksServer) SendHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendHeader indicates an expected call of SendHeader.
func (mr *MockBeaconChain_StreamBlocksServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockBeaconChain_StreamBlocksServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m *MockBeaconChain_StreamBlocksServer) SendMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockBeaconChain_StreamBlocksServerMockRecorder) SendMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockBeaconChain_StreamBlocksServer)(nil).SendMsg), arg0)
}
// SetHeader mocks base method.
func (m *MockBeaconChain_StreamBlocksServer) SetHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SetHeader indicates an expected call of SetHeader.
func (mr *MockBeaconChain_StreamBlocksServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockBeaconChain_StreamBlocksServer)(nil).SetHeader), arg0)
}
// SetTrailer mocks base method.
func (m *MockBeaconChain_StreamBlocksServer) SetTrailer(arg0 metadata.MD) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "SetTrailer", arg0)
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *MockBeaconChain_StreamBlocksServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockBeaconChain_StreamBlocksServer)(nil).SetTrailer), arg0)
}
// MockBeaconChain_StreamValidatorsInfoServer is a mock of BeaconChain_StreamValidatorsInfoServer interface.
type MockBeaconChain_StreamValidatorsInfoServer struct {
ctrl *gomock.Controller
recorder *MockBeaconChain_StreamValidatorsInfoServerMockRecorder
}
// MockBeaconChain_StreamValidatorsInfoServerMockRecorder is the mock recorder for MockBeaconChain_StreamValidatorsInfoServer.
type MockBeaconChain_StreamValidatorsInfoServerMockRecorder struct {
mock *MockBeaconChain_StreamValidatorsInfoServer
}
// NewMockBeaconChain_StreamValidatorsInfoServer creates a new mock instance.
func NewMockBeaconChain_StreamValidatorsInfoServer(ctrl *gomock.Controller) *MockBeaconChain_StreamValidatorsInfoServer {
mock := &MockBeaconChain_StreamValidatorsInfoServer{ctrl: ctrl}
mock.recorder = &MockBeaconChain_StreamValidatorsInfoServerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBeaconChain_StreamValidatorsInfoServer) EXPECT() *MockBeaconChain_StreamValidatorsInfoServerMockRecorder {
return m.recorder
}
// Context mocks base method.
func (m *MockBeaconChain_StreamValidatorsInfoServer) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockBeaconChain_StreamValidatorsInfoServerMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockBeaconChain_StreamValidatorsInfoServer)(nil).Context))
}
// Recv mocks base method.
func (m *MockBeaconChain_StreamValidatorsInfoServer) Recv() (*eth.ValidatorChangeSet, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*eth.ValidatorChangeSet)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Recv indicates an expected call of Recv.
func (mr *MockBeaconChain_StreamValidatorsInfoServerMockRecorder) Recv() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockBeaconChain_StreamValidatorsInfoServer)(nil).Recv))
}
// RecvMsg mocks base method.
func (m *MockBeaconChain_StreamValidatorsInfoServer) RecvMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RecvMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockBeaconChain_StreamValidatorsInfoServerMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockBeaconChain_StreamValidatorsInfoServer)(nil).RecvMsg), arg0)
}
// Send mocks base method.
func (m *MockBeaconChain_StreamValidatorsInfoServer) Send(arg0 *eth.ValidatorInfo) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Send indicates an expected call of Send.
func (mr *MockBeaconChain_StreamValidatorsInfoServerMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockBeaconChain_StreamValidatorsInfoServer)(nil).Send), arg0)
}
// SendHeader mocks base method.
func (m *MockBeaconChain_StreamValidatorsInfoServer) SendHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendHeader indicates an expected call of SendHeader.
func (mr *MockBeaconChain_StreamValidatorsInfoServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockBeaconChain_StreamValidatorsInfoServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m *MockBeaconChain_StreamValidatorsInfoServer) SendMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockBeaconChain_StreamValidatorsInfoServerMockRecorder) SendMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockBeaconChain_StreamValidatorsInfoServer)(nil).SendMsg), arg0)
}
// SetHeader mocks base method.
func (m *MockBeaconChain_StreamValidatorsInfoServer) SetHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SetHeader indicates an expected call of SetHeader.
func (mr *MockBeaconChain_StreamValidatorsInfoServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockBeaconChain_StreamValidatorsInfoServer)(nil).SetHeader), arg0)
}
// SetTrailer mocks base method.
func (m *MockBeaconChain_StreamValidatorsInfoServer) SetTrailer(arg0 metadata.MD) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "SetTrailer", arg0)
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *MockBeaconChain_StreamValidatorsInfoServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockBeaconChain_StreamValidatorsInfoServer)(nil).SetTrailer), arg0)
}
// MockBeaconChain_StreamIndexedAttestationsServer is a mock of BeaconChain_StreamIndexedAttestationsServer interface.
type MockBeaconChain_StreamIndexedAttestationsServer struct {
ctrl *gomock.Controller
recorder *MockBeaconChain_StreamIndexedAttestationsServerMockRecorder
}
// MockBeaconChain_StreamIndexedAttestationsServerMockRecorder is the mock recorder for MockBeaconChain_StreamIndexedAttestationsServer.
type MockBeaconChain_StreamIndexedAttestationsServerMockRecorder struct {
mock *MockBeaconChain_StreamIndexedAttestationsServer
}
// NewMockBeaconChain_StreamIndexedAttestationsServer creates a new mock instance.
func NewMockBeaconChain_StreamIndexedAttestationsServer(ctrl *gomock.Controller) *MockBeaconChain_StreamIndexedAttestationsServer {
mock := &MockBeaconChain_StreamIndexedAttestationsServer{ctrl: ctrl}
mock.recorder = &MockBeaconChain_StreamIndexedAttestationsServerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBeaconChain_StreamIndexedAttestationsServer) EXPECT() *MockBeaconChain_StreamIndexedAttestationsServerMockRecorder {
return m.recorder
}
// Context mocks base method.
func (m *MockBeaconChain_StreamIndexedAttestationsServer) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockBeaconChain_StreamIndexedAttestationsServerMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockBeaconChain_StreamIndexedAttestationsServer)(nil).Context))
}
// RecvMsg mocks base method.
func (m *MockBeaconChain_StreamIndexedAttestationsServer) RecvMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RecvMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockBeaconChain_StreamIndexedAttestationsServerMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockBeaconChain_StreamIndexedAttestationsServer)(nil).RecvMsg), arg0)
}
// Send mocks base method.
func (m *MockBeaconChain_StreamIndexedAttestationsServer) Send(arg0 *eth.IndexedAttestation) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Send indicates an expected call of Send.
func (mr *MockBeaconChain_StreamIndexedAttestationsServerMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockBeaconChain_StreamIndexedAttestationsServer)(nil).Send), arg0)
}
// SendHeader mocks base method.
func (m *MockBeaconChain_StreamIndexedAttestationsServer) SendHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendHeader indicates an expected call of SendHeader.
func (mr *MockBeaconChain_StreamIndexedAttestationsServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockBeaconChain_StreamIndexedAttestationsServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m *MockBeaconChain_StreamIndexedAttestationsServer) SendMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockBeaconChain_StreamIndexedAttestationsServerMockRecorder) SendMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockBeaconChain_StreamIndexedAttestationsServer)(nil).SendMsg), arg0)
}
// SetHeader mocks base method.
func (m *MockBeaconChain_StreamIndexedAttestationsServer) SetHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SetHeader indicates an expected call of SetHeader.
func (mr *MockBeaconChain_StreamIndexedAttestationsServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockBeaconChain_StreamIndexedAttestationsServer)(nil).SetHeader), arg0)
}
// SetTrailer mocks base method.
func (m *MockBeaconChain_StreamIndexedAttestationsServer) SetTrailer(arg0 metadata.MD) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "SetTrailer", arg0)
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *MockBeaconChain_StreamIndexedAttestationsServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockBeaconChain_StreamIndexedAttestationsServer)(nil).SetTrailer), arg0)
}

View File

@@ -1,5 +1,5 @@
// Code generated by MockGen. DO NOT EDIT. // Code generated by MockGen. DO NOT EDIT.
// Source: github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1 (interfaces: BeaconChainClient,BeaconChain_StreamChainHeadClient,BeaconChain_StreamAttestationsClient,BeaconChain_StreamBlocksClient,BeaconChain_StreamValidatorsInfoClient,BeaconChain_StreamIndexedAttestationsClient) // Source: github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1 (interfaces: BeaconChainClient)
// Package mock is a generated GoMock package. // Package mock is a generated GoMock package.
package mock package mock
@@ -11,7 +11,6 @@ import (
gomock "github.com/golang/mock/gomock" gomock "github.com/golang/mock/gomock"
eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
metadata "google.golang.org/grpc/metadata"
emptypb "google.golang.org/protobuf/types/known/emptypb" emptypb "google.golang.org/protobuf/types/known/emptypb"
) )
@@ -358,106 +357,6 @@ func (mr *MockBeaconChainClientMockRecorder) ListValidators(arg0, arg1 interface
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListValidators", reflect.TypeOf((*MockBeaconChainClient)(nil).ListValidators), varargs...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListValidators", reflect.TypeOf((*MockBeaconChainClient)(nil).ListValidators), varargs...)
} }
// StreamAttestations mocks base method.
func (m *MockBeaconChainClient) StreamAttestations(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc.CallOption) (eth.BeaconChain_StreamAttestationsClient, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "StreamAttestations", varargs...)
ret0, _ := ret[0].(eth.BeaconChain_StreamAttestationsClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StreamAttestations indicates an expected call of StreamAttestations.
func (mr *MockBeaconChainClientMockRecorder) StreamAttestations(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamAttestations", reflect.TypeOf((*MockBeaconChainClient)(nil).StreamAttestations), varargs...)
}
// StreamBlocks mocks base method.
func (m *MockBeaconChainClient) StreamBlocks(arg0 context.Context, arg1 *eth.StreamBlocksRequest, arg2 ...grpc.CallOption) (eth.BeaconChain_StreamBlocksClient, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "StreamBlocks", varargs...)
ret0, _ := ret[0].(eth.BeaconChain_StreamBlocksClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StreamBlocks indicates an expected call of StreamBlocks.
func (mr *MockBeaconChainClientMockRecorder) StreamBlocks(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamBlocks", reflect.TypeOf((*MockBeaconChainClient)(nil).StreamBlocks), varargs...)
}
// StreamChainHead mocks base method.
func (m *MockBeaconChainClient) StreamChainHead(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc.CallOption) (eth.BeaconChain_StreamChainHeadClient, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "StreamChainHead", varargs...)
ret0, _ := ret[0].(eth.BeaconChain_StreamChainHeadClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StreamChainHead indicates an expected call of StreamChainHead.
func (mr *MockBeaconChainClientMockRecorder) StreamChainHead(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamChainHead", reflect.TypeOf((*MockBeaconChainClient)(nil).StreamChainHead), varargs...)
}
// StreamIndexedAttestations mocks base method.
func (m *MockBeaconChainClient) StreamIndexedAttestations(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc.CallOption) (eth.BeaconChain_StreamIndexedAttestationsClient, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "StreamIndexedAttestations", varargs...)
ret0, _ := ret[0].(eth.BeaconChain_StreamIndexedAttestationsClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StreamIndexedAttestations indicates an expected call of StreamIndexedAttestations.
func (mr *MockBeaconChainClientMockRecorder) StreamIndexedAttestations(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamIndexedAttestations", reflect.TypeOf((*MockBeaconChainClient)(nil).StreamIndexedAttestations), varargs...)
}
// StreamValidatorsInfo mocks base method.
func (m *MockBeaconChainClient) StreamValidatorsInfo(arg0 context.Context, arg1 ...grpc.CallOption) (eth.BeaconChain_StreamValidatorsInfoClient, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0}
for _, a := range arg1 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "StreamValidatorsInfo", varargs...)
ret0, _ := ret[0].(eth.BeaconChain_StreamValidatorsInfoClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StreamValidatorsInfo indicates an expected call of StreamValidatorsInfo.
func (mr *MockBeaconChainClientMockRecorder) StreamValidatorsInfo(arg0 interface{}, arg1 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0}, arg1...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamValidatorsInfo", reflect.TypeOf((*MockBeaconChainClient)(nil).StreamValidatorsInfo), varargs...)
}
// SubmitAttesterSlashing mocks base method. // SubmitAttesterSlashing mocks base method.
func (m *MockBeaconChainClient) SubmitAttesterSlashing(arg0 context.Context, arg1 *eth.AttesterSlashing, arg2 ...grpc.CallOption) (*eth.SubmitSlashingResponse, error) { func (m *MockBeaconChainClient) SubmitAttesterSlashing(arg0 context.Context, arg1 *eth.AttesterSlashing, arg2 ...grpc.CallOption) (*eth.SubmitSlashingResponse, error) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
@@ -497,632 +396,3 @@ func (mr *MockBeaconChainClientMockRecorder) SubmitProposerSlashing(arg0, arg1 i
varargs := append([]interface{}{arg0, arg1}, arg2...) varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitProposerSlashing", reflect.TypeOf((*MockBeaconChainClient)(nil).SubmitProposerSlashing), varargs...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitProposerSlashing", reflect.TypeOf((*MockBeaconChainClient)(nil).SubmitProposerSlashing), varargs...)
} }
// MockBeaconChain_StreamChainHeadClient is a mock of BeaconChain_StreamChainHeadClient interface.
type MockBeaconChain_StreamChainHeadClient struct {
ctrl *gomock.Controller
recorder *MockBeaconChain_StreamChainHeadClientMockRecorder
}
// MockBeaconChain_StreamChainHeadClientMockRecorder is the mock recorder for MockBeaconChain_StreamChainHeadClient.
type MockBeaconChain_StreamChainHeadClientMockRecorder struct {
mock *MockBeaconChain_StreamChainHeadClient
}
// NewMockBeaconChain_StreamChainHeadClient creates a new mock instance.
func NewMockBeaconChain_StreamChainHeadClient(ctrl *gomock.Controller) *MockBeaconChain_StreamChainHeadClient {
mock := &MockBeaconChain_StreamChainHeadClient{ctrl: ctrl}
mock.recorder = &MockBeaconChain_StreamChainHeadClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBeaconChain_StreamChainHeadClient) EXPECT() *MockBeaconChain_StreamChainHeadClientMockRecorder {
return m.recorder
}
// CloseSend mocks base method.
func (m *MockBeaconChain_StreamChainHeadClient) CloseSend() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CloseSend")
ret0, _ := ret[0].(error)
return ret0
}
// CloseSend indicates an expected call of CloseSend.
func (mr *MockBeaconChain_StreamChainHeadClientMockRecorder) CloseSend() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*MockBeaconChain_StreamChainHeadClient)(nil).CloseSend))
}
// Context mocks base method.
func (m *MockBeaconChain_StreamChainHeadClient) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockBeaconChain_StreamChainHeadClientMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockBeaconChain_StreamChainHeadClient)(nil).Context))
}
// Header mocks base method.
func (m *MockBeaconChain_StreamChainHeadClient) Header() (metadata.MD, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Header")
ret0, _ := ret[0].(metadata.MD)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Header indicates an expected call of Header.
func (mr *MockBeaconChain_StreamChainHeadClientMockRecorder) Header() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Header", reflect.TypeOf((*MockBeaconChain_StreamChainHeadClient)(nil).Header))
}
// Recv mocks base method.
func (m *MockBeaconChain_StreamChainHeadClient) Recv() (*eth.ChainHead, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*eth.ChainHead)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Recv indicates an expected call of Recv.
func (mr *MockBeaconChain_StreamChainHeadClientMockRecorder) Recv() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockBeaconChain_StreamChainHeadClient)(nil).Recv))
}
// RecvMsg mocks base method.
func (m *MockBeaconChain_StreamChainHeadClient) RecvMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RecvMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockBeaconChain_StreamChainHeadClientMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockBeaconChain_StreamChainHeadClient)(nil).RecvMsg), arg0)
}
// SendMsg mocks base method.
func (m *MockBeaconChain_StreamChainHeadClient) SendMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockBeaconChain_StreamChainHeadClientMockRecorder) SendMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockBeaconChain_StreamChainHeadClient)(nil).SendMsg), arg0)
}
// Trailer mocks base method.
func (m *MockBeaconChain_StreamChainHeadClient) Trailer() metadata.MD {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Trailer")
ret0, _ := ret[0].(metadata.MD)
return ret0
}
// Trailer indicates an expected call of Trailer.
func (mr *MockBeaconChain_StreamChainHeadClientMockRecorder) Trailer() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockBeaconChain_StreamChainHeadClient)(nil).Trailer))
}
// MockBeaconChain_StreamAttestationsClient is a mock of BeaconChain_StreamAttestationsClient interface.
type MockBeaconChain_StreamAttestationsClient struct {
ctrl *gomock.Controller
recorder *MockBeaconChain_StreamAttestationsClientMockRecorder
}
// MockBeaconChain_StreamAttestationsClientMockRecorder is the mock recorder for MockBeaconChain_StreamAttestationsClient.
type MockBeaconChain_StreamAttestationsClientMockRecorder struct {
mock *MockBeaconChain_StreamAttestationsClient
}
// NewMockBeaconChain_StreamAttestationsClient creates a new mock instance.
func NewMockBeaconChain_StreamAttestationsClient(ctrl *gomock.Controller) *MockBeaconChain_StreamAttestationsClient {
mock := &MockBeaconChain_StreamAttestationsClient{ctrl: ctrl}
mock.recorder = &MockBeaconChain_StreamAttestationsClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBeaconChain_StreamAttestationsClient) EXPECT() *MockBeaconChain_StreamAttestationsClientMockRecorder {
return m.recorder
}
// CloseSend mocks base method.
func (m *MockBeaconChain_StreamAttestationsClient) CloseSend() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CloseSend")
ret0, _ := ret[0].(error)
return ret0
}
// CloseSend indicates an expected call of CloseSend.
func (mr *MockBeaconChain_StreamAttestationsClientMockRecorder) CloseSend() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*MockBeaconChain_StreamAttestationsClient)(nil).CloseSend))
}
// Context mocks base method.
func (m *MockBeaconChain_StreamAttestationsClient) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockBeaconChain_StreamAttestationsClientMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockBeaconChain_StreamAttestationsClient)(nil).Context))
}
// Header mocks base method.
func (m *MockBeaconChain_StreamAttestationsClient) Header() (metadata.MD, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Header")
ret0, _ := ret[0].(metadata.MD)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Header indicates an expected call of Header.
func (mr *MockBeaconChain_StreamAttestationsClientMockRecorder) Header() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Header", reflect.TypeOf((*MockBeaconChain_StreamAttestationsClient)(nil).Header))
}
// Recv mocks base method.
func (m *MockBeaconChain_StreamAttestationsClient) Recv() (*eth.Attestation, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*eth.Attestation)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Recv indicates an expected call of Recv.
func (mr *MockBeaconChain_StreamAttestationsClientMockRecorder) Recv() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockBeaconChain_StreamAttestationsClient)(nil).Recv))
}
// RecvMsg mocks base method.
func (m *MockBeaconChain_StreamAttestationsClient) RecvMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RecvMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockBeaconChain_StreamAttestationsClientMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockBeaconChain_StreamAttestationsClient)(nil).RecvMsg), arg0)
}
// SendMsg mocks base method.
func (m *MockBeaconChain_StreamAttestationsClient) SendMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockBeaconChain_StreamAttestationsClientMockRecorder) SendMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockBeaconChain_StreamAttestationsClient)(nil).SendMsg), arg0)
}
// Trailer mocks base method.
func (m *MockBeaconChain_StreamAttestationsClient) Trailer() metadata.MD {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Trailer")
ret0, _ := ret[0].(metadata.MD)
return ret0
}
// Trailer indicates an expected call of Trailer.
func (mr *MockBeaconChain_StreamAttestationsClientMockRecorder) Trailer() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockBeaconChain_StreamAttestationsClient)(nil).Trailer))
}
// MockBeaconChain_StreamBlocksClient is a mock of BeaconChain_StreamBlocksClient interface.
type MockBeaconChain_StreamBlocksClient struct {
ctrl *gomock.Controller
recorder *MockBeaconChain_StreamBlocksClientMockRecorder
}
// MockBeaconChain_StreamBlocksClientMockRecorder is the mock recorder for MockBeaconChain_StreamBlocksClient.
type MockBeaconChain_StreamBlocksClientMockRecorder struct {
mock *MockBeaconChain_StreamBlocksClient
}
// NewMockBeaconChain_StreamBlocksClient creates a new mock instance.
func NewMockBeaconChain_StreamBlocksClient(ctrl *gomock.Controller) *MockBeaconChain_StreamBlocksClient {
mock := &MockBeaconChain_StreamBlocksClient{ctrl: ctrl}
mock.recorder = &MockBeaconChain_StreamBlocksClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBeaconChain_StreamBlocksClient) EXPECT() *MockBeaconChain_StreamBlocksClientMockRecorder {
return m.recorder
}
// CloseSend mocks base method.
func (m *MockBeaconChain_StreamBlocksClient) CloseSend() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CloseSend")
ret0, _ := ret[0].(error)
return ret0
}
// CloseSend indicates an expected call of CloseSend.
func (mr *MockBeaconChain_StreamBlocksClientMockRecorder) CloseSend() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*MockBeaconChain_StreamBlocksClient)(nil).CloseSend))
}
// Context mocks base method.
func (m *MockBeaconChain_StreamBlocksClient) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockBeaconChain_StreamBlocksClientMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockBeaconChain_StreamBlocksClient)(nil).Context))
}
// Header mocks base method.
func (m *MockBeaconChain_StreamBlocksClient) Header() (metadata.MD, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Header")
ret0, _ := ret[0].(metadata.MD)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Header indicates an expected call of Header.
func (mr *MockBeaconChain_StreamBlocksClientMockRecorder) Header() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Header", reflect.TypeOf((*MockBeaconChain_StreamBlocksClient)(nil).Header))
}
// Recv mocks base method.
func (m *MockBeaconChain_StreamBlocksClient) Recv() (*eth.SignedBeaconBlock, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*eth.SignedBeaconBlock)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Recv indicates an expected call of Recv.
func (mr *MockBeaconChain_StreamBlocksClientMockRecorder) Recv() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockBeaconChain_StreamBlocksClient)(nil).Recv))
}
// RecvMsg mocks base method.
func (m *MockBeaconChain_StreamBlocksClient) RecvMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RecvMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockBeaconChain_StreamBlocksClientMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockBeaconChain_StreamBlocksClient)(nil).RecvMsg), arg0)
}
// SendMsg mocks base method.
func (m *MockBeaconChain_StreamBlocksClient) SendMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockBeaconChain_StreamBlocksClientMockRecorder) SendMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockBeaconChain_StreamBlocksClient)(nil).SendMsg), arg0)
}
// Trailer mocks base method.
func (m *MockBeaconChain_StreamBlocksClient) Trailer() metadata.MD {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Trailer")
ret0, _ := ret[0].(metadata.MD)
return ret0
}
// Trailer indicates an expected call of Trailer.
func (mr *MockBeaconChain_StreamBlocksClientMockRecorder) Trailer() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockBeaconChain_StreamBlocksClient)(nil).Trailer))
}
// MockBeaconChain_StreamValidatorsInfoClient is a mock of BeaconChain_StreamValidatorsInfoClient interface.
type MockBeaconChain_StreamValidatorsInfoClient struct {
ctrl *gomock.Controller
recorder *MockBeaconChain_StreamValidatorsInfoClientMockRecorder
}
// MockBeaconChain_StreamValidatorsInfoClientMockRecorder is the mock recorder for MockBeaconChain_StreamValidatorsInfoClient.
type MockBeaconChain_StreamValidatorsInfoClientMockRecorder struct {
mock *MockBeaconChain_StreamValidatorsInfoClient
}
// NewMockBeaconChain_StreamValidatorsInfoClient creates a new mock instance.
func NewMockBeaconChain_StreamValidatorsInfoClient(ctrl *gomock.Controller) *MockBeaconChain_StreamValidatorsInfoClient {
mock := &MockBeaconChain_StreamValidatorsInfoClient{ctrl: ctrl}
mock.recorder = &MockBeaconChain_StreamValidatorsInfoClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBeaconChain_StreamValidatorsInfoClient) EXPECT() *MockBeaconChain_StreamValidatorsInfoClientMockRecorder {
return m.recorder
}
// CloseSend mocks base method.
func (m *MockBeaconChain_StreamValidatorsInfoClient) CloseSend() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CloseSend")
ret0, _ := ret[0].(error)
return ret0
}
// CloseSend indicates an expected call of CloseSend.
func (mr *MockBeaconChain_StreamValidatorsInfoClientMockRecorder) CloseSend() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*MockBeaconChain_StreamValidatorsInfoClient)(nil).CloseSend))
}
// Context mocks base method.
func (m *MockBeaconChain_StreamValidatorsInfoClient) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockBeaconChain_StreamValidatorsInfoClientMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockBeaconChain_StreamValidatorsInfoClient)(nil).Context))
}
// Header mocks base method.
func (m *MockBeaconChain_StreamValidatorsInfoClient) Header() (metadata.MD, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Header")
ret0, _ := ret[0].(metadata.MD)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Header indicates an expected call of Header.
func (mr *MockBeaconChain_StreamValidatorsInfoClientMockRecorder) Header() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Header", reflect.TypeOf((*MockBeaconChain_StreamValidatorsInfoClient)(nil).Header))
}
// Recv mocks base method.
func (m *MockBeaconChain_StreamValidatorsInfoClient) Recv() (*eth.ValidatorInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*eth.ValidatorInfo)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Recv indicates an expected call of Recv.
func (mr *MockBeaconChain_StreamValidatorsInfoClientMockRecorder) Recv() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockBeaconChain_StreamValidatorsInfoClient)(nil).Recv))
}
// RecvMsg mocks base method.
func (m *MockBeaconChain_StreamValidatorsInfoClient) RecvMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RecvMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockBeaconChain_StreamValidatorsInfoClientMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockBeaconChain_StreamValidatorsInfoClient)(nil).RecvMsg), arg0)
}
// Send mocks base method.
func (m *MockBeaconChain_StreamValidatorsInfoClient) Send(arg0 *eth.ValidatorChangeSet) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Send indicates an expected call of Send.
func (mr *MockBeaconChain_StreamValidatorsInfoClientMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockBeaconChain_StreamValidatorsInfoClient)(nil).Send), arg0)
}
// SendMsg mocks base method.
func (m *MockBeaconChain_StreamValidatorsInfoClient) SendMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockBeaconChain_StreamValidatorsInfoClientMockRecorder) SendMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockBeaconChain_StreamValidatorsInfoClient)(nil).SendMsg), arg0)
}
// Trailer mocks base method.
func (m *MockBeaconChain_StreamValidatorsInfoClient) Trailer() metadata.MD {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Trailer")
ret0, _ := ret[0].(metadata.MD)
return ret0
}
// Trailer indicates an expected call of Trailer.
func (mr *MockBeaconChain_StreamValidatorsInfoClientMockRecorder) Trailer() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockBeaconChain_StreamValidatorsInfoClient)(nil).Trailer))
}
// MockBeaconChain_StreamIndexedAttestationsClient is a mock of BeaconChain_StreamIndexedAttestationsClient interface.
type MockBeaconChain_StreamIndexedAttestationsClient struct {
ctrl *gomock.Controller
recorder *MockBeaconChain_StreamIndexedAttestationsClientMockRecorder
}
// MockBeaconChain_StreamIndexedAttestationsClientMockRecorder is the mock recorder for MockBeaconChain_StreamIndexedAttestationsClient.
type MockBeaconChain_StreamIndexedAttestationsClientMockRecorder struct {
mock *MockBeaconChain_StreamIndexedAttestationsClient
}
// NewMockBeaconChain_StreamIndexedAttestationsClient creates a new mock instance.
func NewMockBeaconChain_StreamIndexedAttestationsClient(ctrl *gomock.Controller) *MockBeaconChain_StreamIndexedAttestationsClient {
mock := &MockBeaconChain_StreamIndexedAttestationsClient{ctrl: ctrl}
mock.recorder = &MockBeaconChain_StreamIndexedAttestationsClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBeaconChain_StreamIndexedAttestationsClient) EXPECT() *MockBeaconChain_StreamIndexedAttestationsClientMockRecorder {
return m.recorder
}
// CloseSend mocks base method.
func (m *MockBeaconChain_StreamIndexedAttestationsClient) CloseSend() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CloseSend")
ret0, _ := ret[0].(error)
return ret0
}
// CloseSend indicates an expected call of CloseSend.
func (mr *MockBeaconChain_StreamIndexedAttestationsClientMockRecorder) CloseSend() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*MockBeaconChain_StreamIndexedAttestationsClient)(nil).CloseSend))
}
// Context mocks base method.
func (m *MockBeaconChain_StreamIndexedAttestationsClient) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockBeaconChain_StreamIndexedAttestationsClientMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockBeaconChain_StreamIndexedAttestationsClient)(nil).Context))
}
// Header mocks base method.
func (m *MockBeaconChain_StreamIndexedAttestationsClient) Header() (metadata.MD, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Header")
ret0, _ := ret[0].(metadata.MD)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Header indicates an expected call of Header.
func (mr *MockBeaconChain_StreamIndexedAttestationsClientMockRecorder) Header() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Header", reflect.TypeOf((*MockBeaconChain_StreamIndexedAttestationsClient)(nil).Header))
}
// Recv mocks base method.
func (m *MockBeaconChain_StreamIndexedAttestationsClient) Recv() (*eth.IndexedAttestation, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*eth.IndexedAttestation)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Recv indicates an expected call of Recv.
func (mr *MockBeaconChain_StreamIndexedAttestationsClientMockRecorder) Recv() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockBeaconChain_StreamIndexedAttestationsClient)(nil).Recv))
}
// RecvMsg mocks base method.
func (m *MockBeaconChain_StreamIndexedAttestationsClient) RecvMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RecvMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockBeaconChain_StreamIndexedAttestationsClientMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockBeaconChain_StreamIndexedAttestationsClient)(nil).RecvMsg), arg0)
}
// SendMsg mocks base method.
func (m *MockBeaconChain_StreamIndexedAttestationsClient) SendMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockBeaconChain_StreamIndexedAttestationsClientMockRecorder) SendMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockBeaconChain_StreamIndexedAttestationsClient)(nil).SendMsg), arg0)
}
// Trailer mocks base method.
func (m *MockBeaconChain_StreamIndexedAttestationsClient) Trailer() metadata.MD {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Trailer")
ret0, _ := ret[0].(metadata.MD)
return ret0
}
// Trailer indicates an expected call of Trailer.
func (mr *MockBeaconChain_StreamIndexedAttestationsClientMockRecorder) Trailer() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockBeaconChain_StreamIndexedAttestationsClient)(nil).Trailer))
}

View File

@@ -1,5 +1,5 @@
// Code generated by MockGen. DO NOT EDIT. // Code generated by MockGen. DO NOT EDIT.
// Source: github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1 (interfaces: BeaconNodeValidatorClient,BeaconNodeValidator_WaitForChainStartClient,BeaconNodeValidator_WaitForActivationClient,BeaconNodeValidator_StreamDutiesClient,BeaconNodeValidator_StreamSlotsClient) // Source: github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1 (interfaces: BeaconNodeValidatorClient,BeaconNodeValidator_WaitForChainStartClient,BeaconNodeValidator_WaitForActivationClient,BeaconNodeValidator_StreamSlotsClient)
// Package mock is a generated GoMock package. // Package mock is a generated GoMock package.
package mock package mock
@@ -378,26 +378,6 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) StreamBlocksAltair(arg0, ar
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamBlocksAltair", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).StreamBlocksAltair), varargs...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamBlocksAltair", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).StreamBlocksAltair), varargs...)
} }
// StreamDuties mocks base method.
func (m *MockBeaconNodeValidatorClient) StreamDuties(arg0 context.Context, arg1 *eth.DutiesRequest, arg2 ...grpc.CallOption) (eth.BeaconNodeValidator_StreamDutiesClient, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "StreamDuties", varargs...)
ret0, _ := ret[0].(eth.BeaconNodeValidator_StreamDutiesClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StreamDuties indicates an expected call of StreamDuties.
func (mr *MockBeaconNodeValidatorClientMockRecorder) StreamDuties(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamDuties", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).StreamDuties), varargs...)
}
// StreamSlots mocks base method. // StreamSlots mocks base method.
func (m *MockBeaconNodeValidatorClient) StreamSlots(arg0 context.Context, arg1 *eth.StreamSlotsRequest, arg2 ...grpc.CallOption) (eth.BeaconNodeValidator_StreamSlotsClient, error) { func (m *MockBeaconNodeValidatorClient) StreamSlots(arg0 context.Context, arg1 *eth.StreamSlotsRequest, arg2 ...grpc.CallOption) (eth.BeaconNodeValidator_StreamSlotsClient, error) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
@@ -864,129 +844,6 @@ func (mr *MockBeaconNodeValidator_WaitForActivationClientMockRecorder) Trailer()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockBeaconNodeValidator_WaitForActivationClient)(nil).Trailer)) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockBeaconNodeValidator_WaitForActivationClient)(nil).Trailer))
} }
// MockBeaconNodeValidator_StreamDutiesClient is a mock of BeaconNodeValidator_StreamDutiesClient interface.
type MockBeaconNodeValidator_StreamDutiesClient struct {
ctrl *gomock.Controller
recorder *MockBeaconNodeValidator_StreamDutiesClientMockRecorder
}
// MockBeaconNodeValidator_StreamDutiesClientMockRecorder is the mock recorder for MockBeaconNodeValidator_StreamDutiesClient.
type MockBeaconNodeValidator_StreamDutiesClientMockRecorder struct {
mock *MockBeaconNodeValidator_StreamDutiesClient
}
// NewMockBeaconNodeValidator_StreamDutiesClient creates a new mock instance.
func NewMockBeaconNodeValidator_StreamDutiesClient(ctrl *gomock.Controller) *MockBeaconNodeValidator_StreamDutiesClient {
mock := &MockBeaconNodeValidator_StreamDutiesClient{ctrl: ctrl}
mock.recorder = &MockBeaconNodeValidator_StreamDutiesClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBeaconNodeValidator_StreamDutiesClient) EXPECT() *MockBeaconNodeValidator_StreamDutiesClientMockRecorder {
return m.recorder
}
// CloseSend mocks base method.
func (m *MockBeaconNodeValidator_StreamDutiesClient) CloseSend() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CloseSend")
ret0, _ := ret[0].(error)
return ret0
}
// CloseSend indicates an expected call of CloseSend.
func (mr *MockBeaconNodeValidator_StreamDutiesClientMockRecorder) CloseSend() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*MockBeaconNodeValidator_StreamDutiesClient)(nil).CloseSend))
}
// Context mocks base method.
func (m *MockBeaconNodeValidator_StreamDutiesClient) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockBeaconNodeValidator_StreamDutiesClientMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockBeaconNodeValidator_StreamDutiesClient)(nil).Context))
}
// Header mocks base method.
func (m *MockBeaconNodeValidator_StreamDutiesClient) Header() (metadata.MD, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Header")
ret0, _ := ret[0].(metadata.MD)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Header indicates an expected call of Header.
func (mr *MockBeaconNodeValidator_StreamDutiesClientMockRecorder) Header() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Header", reflect.TypeOf((*MockBeaconNodeValidator_StreamDutiesClient)(nil).Header))
}
// Recv mocks base method.
func (m *MockBeaconNodeValidator_StreamDutiesClient) Recv() (*eth.DutiesResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*eth.DutiesResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Recv indicates an expected call of Recv.
func (mr *MockBeaconNodeValidator_StreamDutiesClientMockRecorder) Recv() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockBeaconNodeValidator_StreamDutiesClient)(nil).Recv))
}
// RecvMsg mocks base method.
func (m *MockBeaconNodeValidator_StreamDutiesClient) RecvMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RecvMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockBeaconNodeValidator_StreamDutiesClientMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockBeaconNodeValidator_StreamDutiesClient)(nil).RecvMsg), arg0)
}
// SendMsg mocks base method.
func (m *MockBeaconNodeValidator_StreamDutiesClient) SendMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockBeaconNodeValidator_StreamDutiesClientMockRecorder) SendMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockBeaconNodeValidator_StreamDutiesClient)(nil).SendMsg), arg0)
}
// Trailer mocks base method.
func (m *MockBeaconNodeValidator_StreamDutiesClient) Trailer() metadata.MD {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Trailer")
ret0, _ := ret[0].(metadata.MD)
return ret0
}
// Trailer indicates an expected call of Trailer.
func (mr *MockBeaconNodeValidator_StreamDutiesClientMockRecorder) Trailer() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockBeaconNodeValidator_StreamDutiesClient)(nil).Trailer))
}
// MockBeaconNodeValidator_StreamSlotsClient is a mock of BeaconNodeValidator_StreamSlotsClient interface. // MockBeaconNodeValidator_StreamSlotsClient is a mock of BeaconNodeValidator_StreamSlotsClient interface.
type MockBeaconNodeValidator_StreamSlotsClient struct { type MockBeaconNodeValidator_StreamSlotsClient struct {
ctrl *gomock.Controller ctrl *gomock.Controller

View File

@@ -1,5 +1,5 @@
// Code generated by MockGen. DO NOT EDIT. // Code generated by MockGen. DO NOT EDIT.
// Source: github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1 (interfaces: BeaconNodeValidatorServer,BeaconNodeValidator_WaitForActivationServer,BeaconNodeValidator_WaitForChainStartServer,BeaconNodeValidator_StreamDutiesServer,BeaconNodeValidator_StreamSlotsServer) // Source: github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1 (interfaces: BeaconNodeValidatorServer,BeaconNodeValidator_WaitForActivationServer,BeaconNodeValidator_WaitForChainStartServer,BeaconNodeValidator_StreamSlotsServer)
// Package mock is a generated GoMock package. // Package mock is a generated GoMock package.
package mock package mock
@@ -291,20 +291,6 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) StreamBlocksAltair(arg0, ar
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamBlocksAltair", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).StreamBlocksAltair), arg0, arg1) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamBlocksAltair", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).StreamBlocksAltair), arg0, arg1)
} }
// StreamDuties mocks base method.
func (m *MockBeaconNodeValidatorServer) StreamDuties(arg0 *eth.DutiesRequest, arg1 eth.BeaconNodeValidator_StreamDutiesServer) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StreamDuties", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// StreamDuties indicates an expected call of StreamDuties.
func (mr *MockBeaconNodeValidatorServerMockRecorder) StreamDuties(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamDuties", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).StreamDuties), arg0, arg1)
}
// StreamSlots mocks base method. // StreamSlots mocks base method.
func (m *MockBeaconNodeValidatorServer) StreamSlots(arg0 *eth.StreamSlotsRequest, arg1 eth.BeaconNodeValidator_StreamSlotsServer) error { func (m *MockBeaconNodeValidatorServer) StreamSlots(arg0 *eth.StreamSlotsRequest, arg1 eth.BeaconNodeValidator_StreamSlotsServer) error {
m.ctrl.T.Helper() m.ctrl.T.Helper()
@@ -705,125 +691,6 @@ func (mr *MockBeaconNodeValidator_WaitForChainStartServerMockRecorder) SetTraile
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockBeaconNodeValidator_WaitForChainStartServer)(nil).SetTrailer), arg0) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockBeaconNodeValidator_WaitForChainStartServer)(nil).SetTrailer), arg0)
} }
// MockBeaconNodeValidator_StreamDutiesServer is a mock of BeaconNodeValidator_StreamDutiesServer interface.
type MockBeaconNodeValidator_StreamDutiesServer struct {
ctrl *gomock.Controller
recorder *MockBeaconNodeValidator_StreamDutiesServerMockRecorder
}
// MockBeaconNodeValidator_StreamDutiesServerMockRecorder is the mock recorder for MockBeaconNodeValidator_StreamDutiesServer.
type MockBeaconNodeValidator_StreamDutiesServerMockRecorder struct {
mock *MockBeaconNodeValidator_StreamDutiesServer
}
// NewMockBeaconNodeValidator_StreamDutiesServer creates a new mock instance.
func NewMockBeaconNodeValidator_StreamDutiesServer(ctrl *gomock.Controller) *MockBeaconNodeValidator_StreamDutiesServer {
mock := &MockBeaconNodeValidator_StreamDutiesServer{ctrl: ctrl}
mock.recorder = &MockBeaconNodeValidator_StreamDutiesServerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBeaconNodeValidator_StreamDutiesServer) EXPECT() *MockBeaconNodeValidator_StreamDutiesServerMockRecorder {
return m.recorder
}
// Context mocks base method.
func (m *MockBeaconNodeValidator_StreamDutiesServer) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockBeaconNodeValidator_StreamDutiesServerMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockBeaconNodeValidator_StreamDutiesServer)(nil).Context))
}
// RecvMsg mocks base method.
func (m *MockBeaconNodeValidator_StreamDutiesServer) RecvMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RecvMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockBeaconNodeValidator_StreamDutiesServerMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockBeaconNodeValidator_StreamDutiesServer)(nil).RecvMsg), arg0)
}
// Send mocks base method.
func (m *MockBeaconNodeValidator_StreamDutiesServer) Send(arg0 *eth.DutiesResponse) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Send indicates an expected call of Send.
func (mr *MockBeaconNodeValidator_StreamDutiesServerMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockBeaconNodeValidator_StreamDutiesServer)(nil).Send), arg0)
}
// SendHeader mocks base method.
func (m *MockBeaconNodeValidator_StreamDutiesServer) SendHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendHeader indicates an expected call of SendHeader.
func (mr *MockBeaconNodeValidator_StreamDutiesServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockBeaconNodeValidator_StreamDutiesServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m *MockBeaconNodeValidator_StreamDutiesServer) SendMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockBeaconNodeValidator_StreamDutiesServerMockRecorder) SendMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockBeaconNodeValidator_StreamDutiesServer)(nil).SendMsg), arg0)
}
// SetHeader mocks base method.
func (m *MockBeaconNodeValidator_StreamDutiesServer) SetHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SetHeader indicates an expected call of SetHeader.
func (mr *MockBeaconNodeValidator_StreamDutiesServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockBeaconNodeValidator_StreamDutiesServer)(nil).SetHeader), arg0)
}
// SetTrailer mocks base method.
func (m *MockBeaconNodeValidator_StreamDutiesServer) SetTrailer(arg0 metadata.MD) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "SetTrailer", arg0)
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *MockBeaconNodeValidator_StreamDutiesServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockBeaconNodeValidator_StreamDutiesServer)(nil).SetTrailer), arg0)
}
// MockBeaconNodeValidator_StreamSlotsServer is a mock of BeaconNodeValidator_StreamSlotsServer interface. // MockBeaconNodeValidator_StreamSlotsServer is a mock of BeaconNodeValidator_StreamSlotsServer interface.
type MockBeaconNodeValidator_StreamSlotsServer struct { type MockBeaconNodeValidator_StreamSlotsServer struct {
ctrl *gomock.Controller ctrl *gomock.Controller

View File

@@ -63,7 +63,6 @@ func (c beaconApiValidatorClient) getDuties(ctx context.Context, in *ethpb.Dutie
} }
return &ethpb.DutiesResponse{ return &ethpb.DutiesResponse{
Duties: currentEpochDuties,
CurrentEpochDuties: currentEpochDuties, CurrentEpochDuties: currentEpochDuties,
NextEpochDuties: nextEpochDuties, NextEpochDuties: nextEpochDuties,
}, nil }, nil

View File

@@ -1270,7 +1270,6 @@ func TestGetDuties_Valid(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
expectedDuties := &ethpb.DutiesResponse{ expectedDuties := &ethpb.DutiesResponse{
Duties: expectedCurrentEpochDuties,
CurrentEpochDuties: expectedCurrentEpochDuties, CurrentEpochDuties: expectedCurrentEpochDuties,
NextEpochDuties: expectedNextEpochDuties, NextEpochDuties: expectedNextEpochDuties,
} }