Use Latest Vote Map (#4102)

* add latest vote map
* fix all tests
* remove db crud methods
* Merge branch 'master' into latestVoteMap
* preston's review
* Merge branch 'latestVoteMap' of https://github.com/prysmaticlabs/geth-sharding into latestVoteMap
This commit is contained in:
Nishant Das
2019-11-26 00:34:20 +08:00
committed by prylabs-bulldozer[bot]
parent feb1267fee
commit 7d0e5a9dc4
28 changed files with 85 additions and 282 deletions

View File

@@ -50,17 +50,11 @@ func BenchmarkForkChoiceTree1(b *testing.B) {
for i := 0; i < len(validators); i++ {
switch {
case i < 256:
if err := store.db.SaveValidatorLatestVote(ctx, uint64(i), &pb.ValidatorLatestVote{Root: roots[1]}); err != nil {
b.Fatal(err)
}
store.latestVoteMap[uint64(i)] = &pb.ValidatorLatestVote{Root: roots[1]}
case i > 768:
if err := store.db.SaveValidatorLatestVote(ctx, uint64(i), &pb.ValidatorLatestVote{Root: roots[7]}); err != nil {
b.Fatal(err)
}
store.latestVoteMap[uint64(i)] = &pb.ValidatorLatestVote{Root: roots[7]}
default:
if err := store.db.SaveValidatorLatestVote(ctx, uint64(i), &pb.ValidatorLatestVote{Root: roots[8]}); err != nil {
b.Fatal(err)
}
store.latestVoteMap[uint64(i)] = &pb.ValidatorLatestVote{Root: roots[8]}
}
}
@@ -110,9 +104,7 @@ func BenchmarkForkChoiceTree2(b *testing.B) {
// Spread out the votes evenly for all the leaf nodes. 8 to 15
nodeIndex := 8
for i := 0; i < len(validators); i++ {
if err := store.db.SaveValidatorLatestVote(ctx, uint64(i), &pb.ValidatorLatestVote{Root: roots[nodeIndex]}); err != nil {
b.Fatal(err)
}
store.latestVoteMap[uint64(i)] = &pb.ValidatorLatestVote{Root: roots[nodeIndex]}
if i%155 == 0 {
nodeIndex++
}
@@ -163,9 +155,7 @@ func BenchmarkForkChoiceTree3(b *testing.B) {
// All validators vote on the same head
for i := 0; i < len(validators); i++ {
if err := store.db.SaveValidatorLatestVote(ctx, uint64(i), &pb.ValidatorLatestVote{Root: roots[len(roots)-1]}); err != nil {
b.Fatal(err)
}
store.latestVoteMap[uint64(i)] = &pb.ValidatorLatestVote{Root: roots[len(roots)-1]}
}
b.ResetTimer()

View File

@@ -78,6 +78,8 @@ func TestGetHeadFromYaml(t *testing.T) {
}
}
store := NewForkChoiceService(ctx, db)
// Assign validator votes to the blocks as weights.
count := 0
for blk, votes := range test.Weights {
@@ -87,14 +89,11 @@ func TestGetHeadFromYaml(t *testing.T) {
}
max := count + votes
for i := count; i < max; i++ {
if err := db.SaveValidatorLatestVote(ctx, uint64(i), &pb.ValidatorLatestVote{Root: blksRoot[slot]}); err != nil {
t.Fatal(err)
}
store.latestVoteMap[uint64(i)] = &pb.ValidatorLatestVote{Root: blksRoot[slot]}
count++
}
}
store := NewForkChoiceService(ctx, db)
validators := make([]*ethpb.Validator, count)
for i := 0; i < len(validators); i++ {
validators[i] = &ethpb.Validator{ExitEpoch: 2, EffectiveBalance: 1e9}

View File

@@ -180,22 +180,18 @@ func (s *Store) updateAttVotes(
tgtEpoch uint64) error {
indices := append(indexedAtt.CustodyBit_0Indices, indexedAtt.CustodyBit_1Indices...)
newVoteIndices := make([]uint64, 0, len(indices))
newVotes := make([]*pb.ValidatorLatestVote, 0, len(indices))
s.voteLock.Lock()
defer s.voteLock.Unlock()
for _, i := range indices {
vote, err := s.db.ValidatorLatestVote(ctx, i)
if err != nil {
return errors.Wrapf(err, "could not get latest vote for validator %d", i)
}
if vote == nil || tgtEpoch > vote.Epoch {
newVotes = append(newVotes, &pb.ValidatorLatestVote{
vote, ok := s.latestVoteMap[i]
if !ok || tgtEpoch > vote.Epoch {
s.latestVoteMap[i] = &pb.ValidatorLatestVote{
Epoch: tgtEpoch,
Root: tgtRoot,
})
newVoteIndices = append(newVoteIndices, i)
}
}
}
return s.db.SaveValidatorLatestVotes(ctx, newVoteIndices, newVotes)
return nil
}
// setSeenAtt sets the attestation hash in seen attestation map to true.

View File

@@ -297,17 +297,14 @@ func (s *Store) updateBlockAttestationVote(ctx context.Context, att *ethpb.Attes
if err != nil {
return errors.Wrap(err, "could not convert attestation to indexed attestation")
}
s.voteLock.Lock()
defer s.voteLock.Unlock()
for _, i := range append(indexedAtt.CustodyBit_0Indices, indexedAtt.CustodyBit_1Indices...) {
vote, err := s.db.ValidatorLatestVote(ctx, i)
if err != nil {
return errors.Wrapf(err, "could not get latest vote for validator %d", i)
}
if vote == nil || tgt.Epoch > vote.Epoch {
if err := s.db.SaveValidatorLatestVote(ctx, i, &pb.ValidatorLatestVote{
vote, ok := s.latestVoteMap[i]
if !ok || tgt.Epoch > vote.Epoch {
s.latestVoteMap[i] = &pb.ValidatorLatestVote{
Epoch: tgt.Epoch,
Root: tgt.Root,
}); err != nil {
return errors.Wrapf(err, "could not save latest vote for validator %d", i)
}
}
}

View File

@@ -159,10 +159,7 @@ func TestStore_UpdateBlockAttestationVote(t *testing.T) {
t.Fatal(err)
}
for _, i := range attestedIndices {
v, err := store.db.ValidatorLatestVote(ctx, i)
if err != nil {
t.Fatal(err)
}
v := store.latestVoteMap[i]
if !reflect.DeepEqual(v.Root, r[:]) {
t.Error("Attested roots don't match")
}

View File

@@ -11,6 +11,7 @@ import (
"github.com/prysmaticlabs/prysm/beacon-chain/core/helpers"
"github.com/prysmaticlabs/prysm/beacon-chain/db"
"github.com/prysmaticlabs/prysm/beacon-chain/db/filters"
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
"github.com/prysmaticlabs/prysm/shared/bytesutil"
"github.com/prysmaticlabs/prysm/shared/params"
@@ -41,6 +42,8 @@ type Store struct {
checkpointStateLock sync.Mutex
seenAtts map[[32]byte]bool
seenAttsLock sync.Mutex
latestVoteMap map[uint64]*pb.ValidatorLatestVote
voteLock sync.RWMutex
}
// NewForkChoiceService instantiates a new service instance that will
@@ -52,6 +55,7 @@ func NewForkChoiceService(ctx context.Context, db db.Database) *Store {
cancel: cancel,
db: db,
checkpointState: cache.NewCheckpointStateCache(),
latestVoteMap: make(map[uint64]*pb.ValidatorLatestVote),
seenAtts: make(map[[32]byte]bool),
}
}
@@ -165,12 +169,11 @@ func (s *Store) latestAttestingBalance(ctx context.Context, root []byte) (uint64
}
balances := uint64(0)
s.voteLock.RLock()
defer s.voteLock.RUnlock()
for _, i := range activeIndices {
vote, err := s.db.ValidatorLatestVote(ctx, i)
if err != nil {
return 0, errors.Wrapf(err, "could not get validator %d's latest vote", i)
}
if vote == nil {
vote, ok := s.latestVoteMap[i]
if !ok {
continue
}

View File

@@ -174,17 +174,11 @@ func TestStore_LatestAttestingBalance(t *testing.T) {
for i := 0; i < len(validators); i++ {
switch {
case i < 33:
if err := store.db.SaveValidatorLatestVote(ctx, uint64(i), &pb.ValidatorLatestVote{Root: roots[1]}); err != nil {
t.Fatal(err)
}
store.latestVoteMap[uint64(i)] = &pb.ValidatorLatestVote{Root: roots[1]}
case i > 66:
if err := store.db.SaveValidatorLatestVote(ctx, uint64(i), &pb.ValidatorLatestVote{Root: roots[7]}); err != nil {
t.Fatal(err)
}
store.latestVoteMap[uint64(i)] = &pb.ValidatorLatestVote{Root: roots[7]}
default:
if err := store.db.SaveValidatorLatestVote(ctx, uint64(i), &pb.ValidatorLatestVote{Root: roots[8]}); err != nil {
t.Fatal(err)
}
store.latestVoteMap[uint64(i)] = &pb.ValidatorLatestVote{Root: roots[8]}
}
}
@@ -293,17 +287,11 @@ func TestStore_GetHead(t *testing.T) {
for i := 0; i < len(validators); i++ {
switch {
case i < 33:
if err := store.db.SaveValidatorLatestVote(ctx, uint64(i), &pb.ValidatorLatestVote{Root: roots[1]}); err != nil {
t.Fatal(err)
}
store.latestVoteMap[uint64(i)] = &pb.ValidatorLatestVote{Root: roots[1]}
case i > 66:
if err := store.db.SaveValidatorLatestVote(ctx, uint64(i), &pb.ValidatorLatestVote{Root: roots[7]}); err != nil {
t.Fatal(err)
}
store.latestVoteMap[uint64(i)] = &pb.ValidatorLatestVote{Root: roots[7]}
default:
if err := store.db.SaveValidatorLatestVote(ctx, uint64(i), &pb.ValidatorLatestVote{Root: roots[8]}); err != nil {
t.Fatal(err)
}
store.latestVoteMap[uint64(i)] = &pb.ValidatorLatestVote{Root: roots[8]}
}
}
@@ -317,9 +305,8 @@ func TestStore_GetHead(t *testing.T) {
}
// 1 validator switches vote to B7 to gain 34%, enough to switch head
if err := store.db.SaveValidatorLatestVote(ctx, 50, &pb.ValidatorLatestVote{Root: roots[7]}); err != nil {
t.Fatal(err)
}
store.latestVoteMap[uint64(50)] = &pb.ValidatorLatestVote{Root: roots[7]}
head, err = store.Head(ctx)
if err != nil {
t.Fatal(err)
@@ -331,9 +318,7 @@ func TestStore_GetHead(t *testing.T) {
// 18 validators switches vote to B1 to gain 51%, enough to switch head
for i := 0; i < 18; i++ {
idx := 50 + uint64(i)
if err := store.db.SaveValidatorLatestVote(ctx, idx, &pb.ValidatorLatestVote{Root: roots[1]}); err != nil {
t.Fatal(err)
}
store.latestVoteMap[uint64(idx)] = &pb.ValidatorLatestVote{Root: roots[1]}
}
head, err = store.Head(ctx)
if err != nil {

View File

@@ -41,11 +41,6 @@ type Database interface {
SaveGenesisBlockRoot(ctx context.Context, blockRoot [32]byte) error
IsFinalizedBlock(ctx context.Context, blockRoot [32]byte) bool
// Validator related methods.
ValidatorLatestVote(ctx context.Context, validatorIdx uint64) (*pb.ValidatorLatestVote, error)
HasValidatorLatestVote(ctx context.Context, validatorIdx uint64) bool
DeleteValidatorLatestVote(ctx context.Context, validatorIdx uint64) error
SaveValidatorLatestVote(ctx context.Context, validatorIdx uint64, vote *pb.ValidatorLatestVote) error
SaveValidatorLatestVotes(ctx context.Context, validatorIndices []uint64, votes []*pb.ValidatorLatestVote) error
ValidatorIndex(ctx context.Context, publicKey [48]byte) (uint64, bool, error)
HasValidatorIndex(ctx context.Context, publicKey [48]byte) bool
DeleteValidatorIndex(ctx context.Context, publicKey [48]byte) error

View File

@@ -3,111 +3,12 @@ package kv
import (
"context"
"encoding/binary"
"sync"
"time"
"github.com/boltdb/bolt"
"github.com/gogo/protobuf/proto"
"go.opencensus.io/trace"
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
)
// ValidatorLatestVote retrieval by validator index.
func (k *Store) ValidatorLatestVote(ctx context.Context, validatorIdx uint64) (*pb.ValidatorLatestVote, error) {
ctx, span := trace.StartSpan(ctx, "BeaconDB.ValidatorLatestVote")
defer span.End()
// Return latest vote from cache if it exists.
if v := k.votesCache.Get(string(validatorIdx)); v != nil && v.Value() != nil {
return v.Value().(*pb.ValidatorLatestVote), nil
}
buf := uint64ToBytes(validatorIdx)
var latestVote *pb.ValidatorLatestVote
err := k.db.View(func(tx *bolt.Tx) error {
bkt := tx.Bucket(validatorsBucket)
enc := bkt.Get(buf)
if enc == nil {
return nil
}
latestVote = &pb.ValidatorLatestVote{}
return proto.Unmarshal(enc, latestVote)
})
return latestVote, err
}
// HasValidatorLatestVote verifies if a validator index has a latest vote stored in the db.
func (k *Store) HasValidatorLatestVote(ctx context.Context, validatorIdx uint64) bool {
ctx, span := trace.StartSpan(ctx, "BeaconDB.HasValidatorLatestVote")
defer span.End()
if v := k.votesCache.Get(string(validatorIdx)); v != nil && v.Value() != nil {
return true
}
buf := uint64ToBytes(validatorIdx)
exists := false
// #nosec G104. Always returns nil.
k.db.View(func(tx *bolt.Tx) error {
bkt := tx.Bucket(validatorsBucket)
exists = bkt.Get(buf) != nil
return nil
})
return exists
}
// SaveValidatorLatestVote by validator index.
func (k *Store) SaveValidatorLatestVote(ctx context.Context, validatorIdx uint64, vote *pb.ValidatorLatestVote) error {
ctx, span := trace.StartSpan(ctx, "BeaconDB.SaveValidatorLatestVote")
defer span.End()
return k.db.Batch(func(tx *bolt.Tx) error {
buf := uint64ToBytes(validatorIdx)
enc, err := proto.Marshal(vote)
if err != nil {
return err
}
bucket := tx.Bucket(validatorsBucket)
k.votesCache.Set(string(validatorIdx), vote, time.Hour)
return bucket.Put(buf, enc)
})
}
// SaveValidatorLatestVotes by validator indidces.
func (k *Store) SaveValidatorLatestVotes(ctx context.Context, validatorIndices []uint64, votes []*pb.ValidatorLatestVote) error {
ctx, span := trace.StartSpan(ctx, "BeaconDB.SaveValidatorLatestVotes")
defer span.End()
var wg sync.WaitGroup
var err error
wg.Add(len(votes))
for i := 0; i < len(votes); i++ {
go func(w *sync.WaitGroup, i uint64, v *pb.ValidatorLatestVote) {
defer wg.Done()
if err = k.SaveValidatorLatestVote(ctx, i, v); err != nil {
return
}
return
}(&wg, validatorIndices[i], votes[i])
}
wg.Wait()
return err
}
// DeleteValidatorLatestVote from the db.
func (k *Store) DeleteValidatorLatestVote(ctx context.Context, validatorIdx uint64) error {
ctx, span := trace.StartSpan(ctx, "BeaconDB.DeleteValidatorLatestVote")
defer span.End()
return k.db.Update(func(tx *bolt.Tx) error {
bkt := tx.Bucket(validatorsBucket)
enc := bkt.Get(uint64ToBytes(validatorIdx))
if enc == nil {
return nil
}
k.votesCache.Delete(string(validatorIdx))
return bkt.Delete(uint64ToBytes(validatorIdx))
})
}
// ValidatorIndex by public key.
func (k *Store) ValidatorIndex(ctx context.Context, publicKey [48]byte) (uint64, bool, error) {
ctx, span := trace.StartSpan(ctx, "BeaconDB.ValidatorIndex")

View File

@@ -3,9 +3,6 @@ package kv
import (
"context"
"testing"
"github.com/gogo/protobuf/proto"
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
)
func TestStore_ValidatorIndexCRUD(t *testing.T) {
@@ -41,78 +38,3 @@ func TestStore_ValidatorIndexCRUD(t *testing.T) {
t.Error("Expected validator index to have been deleted from the db")
}
}
func TestStore_ValidatorLatestVoteCRUD(t *testing.T) {
db := setupDB(t)
defer teardownDB(t, db)
ctx := context.Background()
validatorIdx := uint64(100)
latestVote := &pb.ValidatorLatestVote{
Epoch: 1,
Root: []byte("root"),
}
retrievedVote, err := db.ValidatorLatestVote(ctx, validatorIdx)
if err != nil {
t.Fatal(err)
}
if retrievedVote != nil {
t.Errorf("Expected nil validator latest vote, received %v", retrievedVote)
}
if err := db.SaveValidatorLatestVote(ctx, validatorIdx, latestVote); err != nil {
t.Fatal(err)
}
if !db.HasValidatorLatestVote(ctx, validatorIdx) {
t.Error("Expected validator latest vote to exist in the db")
}
retrievedVote, err = db.ValidatorLatestVote(ctx, validatorIdx)
if err != nil {
t.Fatal(err)
}
if !proto.Equal(latestVote, retrievedVote) {
t.Errorf("Wanted %d, received %d", latestVote, retrievedVote)
}
if err := db.DeleteValidatorLatestVote(ctx, validatorIdx); err != nil {
t.Fatal(err)
}
if db.HasValidatorLatestVote(ctx, validatorIdx) {
t.Error("Expected validator latest vote to have been deleted from the db")
}
}
func TestStore_ValidatorLatestVoteCRUD_NoCache(t *testing.T) {
db := setupDB(t)
defer teardownDB(t, db)
ctx := context.Background()
validatorIdx := uint64(100)
latestVote := &pb.ValidatorLatestVote{
Epoch: 1,
Root: []byte("root"),
}
retrievedVote, err := db.ValidatorLatestVote(ctx, validatorIdx)
if err != nil {
t.Fatal(err)
}
if retrievedVote != nil {
t.Errorf("Expected nil validator latest vote, received %v", retrievedVote)
}
if err := db.SaveValidatorLatestVote(ctx, validatorIdx, latestVote); err != nil {
t.Fatal(err)
}
db.votesCache.Delete(string(validatorIdx))
if !db.HasValidatorLatestVote(ctx, validatorIdx) {
t.Error("Expected validator latest vote to exist in the db")
}
retrievedVote, err = db.ValidatorLatestVote(ctx, validatorIdx)
if err != nil {
t.Fatal(err)
}
if !proto.Equal(latestVote, retrievedVote) {
t.Errorf("Wanted %d, received %d", latestVote, retrievedVote)
}
if err := db.DeleteValidatorLatestVote(ctx, validatorIdx); err != nil {
t.Fatal(err)
}
if db.HasValidatorLatestVote(ctx, validatorIdx) {
t.Error("Expected validator latest vote to have been deleted from the db")
}
}

View File

@@ -5,12 +5,13 @@ package db
import (
fmt "fmt"
io "io"
math "math"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
github_com_prysmaticlabs_go_bitfield "github.com/prysmaticlabs/go-bitfield"
v1alpha1 "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
io "io"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.

View File

@@ -5,9 +5,10 @@ package db
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
proto "github.com/gogo/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.

View File

@@ -5,10 +5,11 @@ package ethereum_beacon_p2p_v1
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.

View File

@@ -5,12 +5,13 @@ package ethereum_beacon_p2p_v1
import (
fmt "fmt"
io "io"
math "math"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
github_com_prysmaticlabs_go_bitfield "github.com/prysmaticlabs/go-bitfield"
v1alpha1 "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
io "io"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.

View File

@@ -7,12 +7,13 @@ import (
context "context"
encoding_binary "encoding/binary"
fmt "fmt"
io "io"
math "math"
proto "github.com/gogo/protobuf/proto"
types "github.com/gogo/protobuf/types"
v1alpha1 "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
grpc "google.golang.org/grpc"
io "io"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.

View File

@@ -6,13 +6,14 @@ package ethereum_beacon_rpc_v1
import (
context "context"
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
empty "github.com/golang/protobuf/ptypes/empty"
v1alpha1 "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.

View File

@@ -5,10 +5,11 @@ package eth
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.

View File

@@ -5,11 +5,12 @@ package eth
import (
fmt "fmt"
io "io"
math "math"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
github_com_prysmaticlabs_go_bitfield "github.com/prysmaticlabs/go-bitfield"
io "io"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.

View File

@@ -5,10 +5,11 @@ package eth
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.

View File

@@ -6,13 +6,14 @@ package eth
import (
context "context"
fmt "fmt"
io "io"
math "math"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
types "github.com/gogo/protobuf/types"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
io "io"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.

View File

@@ -6,12 +6,13 @@ package eth
import (
context "context"
fmt "fmt"
io "io"
math "math"
proto "github.com/gogo/protobuf/proto"
types "github.com/gogo/protobuf/types"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
io "io"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.

View File

@@ -6,11 +6,12 @@ package eth
import (
context "context"
fmt "fmt"
io "io"
math "math"
proto "github.com/gogo/protobuf/proto"
types "github.com/gogo/protobuf/types"
grpc "google.golang.org/grpc"
io "io"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.

View File

@@ -7,13 +7,14 @@ import (
context "context"
encoding_binary "encoding/binary"
fmt "fmt"
io "io"
math "math"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
types "github.com/gogo/protobuf/types"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
io "io"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.

View File

@@ -5,9 +5,10 @@ package ethereum_sharding_p2p_v1
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
proto "github.com/gogo/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.

View File

@@ -6,10 +6,11 @@ package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
v1 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
grpc "google.golang.org/grpc"
reflect "reflect"
)
// MockAggregatorServiceClient is a mock of AggregatorServiceClient interface

View File

@@ -6,11 +6,12 @@ package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
v1 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
v1alpha1 "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
grpc "google.golang.org/grpc"
reflect "reflect"
)
// MockAttesterServiceClient is a mock of AttesterServiceClient interface

View File

@@ -6,11 +6,12 @@ package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
v1 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
v1alpha1 "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
grpc "google.golang.org/grpc"
reflect "reflect"
)
// MockProposerServiceClient is a mock of ProposerServiceClient interface

View File

@@ -6,13 +6,14 @@ package internal
import (
context "context"
reflect "reflect"
types "github.com/gogo/protobuf/types"
gomock "github.com/golang/mock/gomock"
v1 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
v1alpha1 "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
grpc "google.golang.org/grpc"
metadata "google.golang.org/grpc/metadata"
reflect "reflect"
)
// MockValidatorServiceClient is a mock of ValidatorServiceClient interface