From 8686a813043f048a97268c4248324f44d69952f8 Mon Sep 17 00:00:00 2001 From: terence tsao Date: Fri, 21 Aug 2020 08:50:21 -0700 Subject: [PATCH] Implement checkpt info cache (#7070) --- beacon-chain/blockchain/BUILD.bazel | 4 + .../blockchain/checkpoint_info_cache.go | 83 +++ .../blockchain/checkpoint_info_cache_test.go | 41 ++ proto/beacon/p2p/v1/types.pb.go | 624 +++++++++++++++--- proto/beacon/p2p/v1/types.proto | 14 + 5 files changed, 688 insertions(+), 78 deletions(-) create mode 100644 beacon-chain/blockchain/checkpoint_info_cache.go create mode 100644 beacon-chain/blockchain/checkpoint_info_cache_test.go diff --git a/beacon-chain/blockchain/BUILD.bazel b/beacon-chain/blockchain/BUILD.bazel index 50bbeb2f4a..1b2c01aece 100644 --- a/beacon-chain/blockchain/BUILD.bazel +++ b/beacon-chain/blockchain/BUILD.bazel @@ -5,6 +5,7 @@ go_library( name = "go_default_library", srcs = [ "chain_info.go", + "checkpoint_info_cache.go", "head.go", "info.go", "init_sync_process_block.go", @@ -46,11 +47,13 @@ go_library( "//shared/bls:go_default_library", "//shared/bytesutil:go_default_library", "//shared/featureconfig:go_default_library", + "//shared/hashutil:go_default_library", "//shared/params:go_default_library", "//shared/roughtime:go_default_library", "//shared/slotutil:go_default_library", "//shared/traceutil:go_default_library", "@com_github_emicklei_dot//:go_default_library", + "@com_github_hashicorp_golang_lru//: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", @@ -73,6 +76,7 @@ go_test( size = "medium", srcs = [ "chain_info_test.go", + "checkpoint_info_cache_test.go", "head_test.go", "info_test.go", "process_attestation_test.go", diff --git a/beacon-chain/blockchain/checkpoint_info_cache.go b/beacon-chain/blockchain/checkpoint_info_cache.go new file mode 100644 index 0000000000..a2fb8bf717 --- /dev/null +++ b/beacon-chain/blockchain/checkpoint_info_cache.go @@ -0,0 +1,83 @@ +package blockchain + +import ( + "sync" + + lru "github.com/hashicorp/golang-lru" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" + ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" + pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" + "github.com/prysmaticlabs/prysm/shared/hashutil" +) + +var ( + // This defines the max number of checkpoint info this cache can store. + // Each cache is calculated at 3MB(30K validators), the total cache size is around 100MB. + // Due to reorgs and long finality, it's good to keep the old cache around for quickly switch over. + maxInfoSize = 32 + + // This tracks the number of check point info requests that aren't present in the cache. + infoMiss = promauto.NewCounter(prometheus.CounterOpts{ + Name: "check_point_info_cache_miss", + Help: "The number of check point info requests that aren't present in the cache.", + }) + // This tracks the number of check point info requests that are in the cache. + infoHit = promauto.NewCounter(prometheus.CounterOpts{ + Name: "check_point_info_cache_hit", + Help: "The number of check point info requests that are present in the cache.", + }) +) + +// checkPtInfoCache is a struct with 1 LRU cache for looking up check point info by checkpoint. +type checkPtInfoCache struct { + cache *lru.Cache + lock sync.RWMutex +} + +// newCheckPointInfoCache creates a new checkpoint info cache for storing/accessing processed check point info object. +func newCheckPointInfoCache() *checkPtInfoCache { + cache, err := lru.New(maxInfoSize) + if err != nil { + panic(err) + } + return &checkPtInfoCache{ + cache: cache, + } +} + +// get fetches check point info by check point. Returns the reference of the CheckPtInfo, nil if doesn't exist. +func (c *checkPtInfoCache) get(cp *ethpb.Checkpoint) (*pb.CheckPtInfo, error) { + c.lock.RLock() + defer c.lock.RUnlock() + h, err := hashutil.HashProto(cp) + if err != nil { + return nil, err + } + + item, exists := c.cache.Get(h) + + if exists && item != nil { + infoHit.Inc() + // Copy here is unnecessary since the returned check point info object + // will only be used to verify attestation signature. + return item.(*pb.CheckPtInfo), nil + } + + infoMiss.Inc() + return nil, nil +} + +// put adds CheckPtInfo object to the cache. This method also trims the least +// recently added CheckPtInfo object if the cache size has ready the max cache size limit. +func (c *checkPtInfoCache) put(cp *ethpb.Checkpoint, info *pb.CheckPtInfo) error { + c.lock.Lock() + defer c.lock.Unlock() + h, err := hashutil.HashProto(cp) + if err != nil { + return err + } + + c.cache.Add(h, info) + return nil +} diff --git a/beacon-chain/blockchain/checkpoint_info_cache_test.go b/beacon-chain/blockchain/checkpoint_info_cache_test.go new file mode 100644 index 0000000000..19959be004 --- /dev/null +++ b/beacon-chain/blockchain/checkpoint_info_cache_test.go @@ -0,0 +1,41 @@ +package blockchain + +import ( + "testing" + + ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" + pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" + "github.com/prysmaticlabs/prysm/shared/bytesutil" + "github.com/prysmaticlabs/prysm/shared/testutil/require" +) + +func TestHotStateCache_RoundTrip(t *testing.T) { + c := newCheckPointInfoCache() + cp := ðpb.Checkpoint{ + Epoch: 1, + Root: bytesutil.PadTo([]byte{'a'}, 32), + } + info, err := c.get(cp) + require.NoError(t, err) + require.Equal(t, (*pb.CheckPtInfo)(nil), info) + + i := &pb.CheckPtInfo{ + Seed: bytesutil.PadTo([]byte{'c'}, 32), + GenesisRoot: bytesutil.PadTo([]byte{'d'}, 32), + ActiveIndices: []uint64{0, 1, 2, 3}, + } + + require.NoError(t, c.put(cp, i)) + info, err = c.get(cp) + require.NoError(t, err) + require.DeepEqual(t, info, i) +} + +func TestHotStateCache_CanPrune(t *testing.T) { + c := newCheckPointInfoCache() + for i := 0; i < maxInfoSize+1; i++ { + cp := ðpb.Checkpoint{Epoch: uint64(i)} + require.NoError(t, c.put(cp, &pb.CheckPtInfo{})) + } + require.Equal(t, len(c.cache.Keys()), maxInfoSize) +} diff --git a/proto/beacon/p2p/v1/types.pb.go b/proto/beacon/p2p/v1/types.pb.go index af2954e0b3..aaa7854999 100755 --- a/proto/beacon/p2p/v1/types.pb.go +++ b/proto/beacon/p2p/v1/types.pb.go @@ -641,6 +641,85 @@ func (m *SignedAggregateAndProof) GetSignature() []byte { return nil } +type CheckPtInfo struct { + Seed []byte `protobuf:"bytes,1,opt,name=seed,proto3" json:"seed,omitempty"` + GenesisRoot []byte `protobuf:"bytes,2,opt,name=genesis_root,json=genesisRoot,proto3" json:"genesis_root,omitempty"` + ActiveIndices []uint64 `protobuf:"varint,3,rep,packed,name=active_indices,json=activeIndices,proto3" json:"active_indices,omitempty"` + PubKeys [][]byte `protobuf:"bytes,4,rep,name=pub_keys,json=pubKeys,proto3" json:"pub_keys,omitempty"` + Fork *Fork `protobuf:"bytes,5,opt,name=fork,proto3" json:"fork,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CheckPtInfo) Reset() { *m = CheckPtInfo{} } +func (m *CheckPtInfo) String() string { return proto.CompactTextString(m) } +func (*CheckPtInfo) ProtoMessage() {} +func (*CheckPtInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_e719e7d82cfa7b0d, []int{8} +} +func (m *CheckPtInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CheckPtInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CheckPtInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CheckPtInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_CheckPtInfo.Merge(m, src) +} +func (m *CheckPtInfo) XXX_Size() int { + return m.Size() +} +func (m *CheckPtInfo) XXX_DiscardUnknown() { + xxx_messageInfo_CheckPtInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_CheckPtInfo proto.InternalMessageInfo + +func (m *CheckPtInfo) GetSeed() []byte { + if m != nil { + return m.Seed + } + return nil +} + +func (m *CheckPtInfo) GetGenesisRoot() []byte { + if m != nil { + return m.GenesisRoot + } + return nil +} + +func (m *CheckPtInfo) GetActiveIndices() []uint64 { + if m != nil { + return m.ActiveIndices + } + return nil +} + +func (m *CheckPtInfo) GetPubKeys() [][]byte { + if m != nil { + return m.PubKeys + } + return nil +} + +func (m *CheckPtInfo) GetFork() *Fork { + if m != nil { + return m.Fork + } + return nil +} + func init() { proto.RegisterType((*BeaconState)(nil), "ethereum.beacon.p2p.v1.BeaconState") proto.RegisterType((*Fork)(nil), "ethereum.beacon.p2p.v1.Fork") @@ -650,89 +729,95 @@ func init() { proto.RegisterType((*SigningData)(nil), "ethereum.beacon.p2p.v1.SigningData") proto.RegisterType((*ForkData)(nil), "ethereum.beacon.p2p.v1.ForkData") proto.RegisterType((*SignedAggregateAndProof)(nil), "ethereum.beacon.p2p.v1.SignedAggregateAndProof") + proto.RegisterType((*CheckPtInfo)(nil), "ethereum.beacon.p2p.v1.CheckPtInfo") } func init() { proto.RegisterFile("proto/beacon/p2p/v1/types.proto", fileDescriptor_e719e7d82cfa7b0d) } var fileDescriptor_e719e7d82cfa7b0d = []byte{ - // 1223 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcd, 0x8f, 0xdb, 0xc4, - 0x1b, 0x96, 0xb7, 0xf9, 0xf5, 0x63, 0x92, 0x6e, 0xb6, 0xb3, 0xfd, 0x35, 0xa6, 0x2d, 0xeb, 0xc5, - 0x12, 0x6d, 0x41, 0xdd, 0xa4, 0xf6, 0x6e, 0x93, 0xdd, 0x56, 0x14, 0x35, 0x6d, 0x51, 0x5b, 0xa9, - 0x52, 0xe5, 0x42, 0x25, 0x24, 0x84, 0x35, 0xb1, 0x27, 0xf6, 0x74, 0x6d, 0x8f, 0xe5, 0x99, 0x44, - 0xdd, 0x95, 0x10, 0x07, 0x4e, 0x9c, 0xe0, 0xc0, 0x85, 0x23, 0xfc, 0x17, 0xc0, 0x89, 0x8f, 0x03, - 0x47, 0xbe, 0x2e, 0xe5, 0x10, 0xa1, 0xbd, 0xf1, 0x71, 0x21, 0x47, 0x4e, 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- 0xcf, 0x29, 0x9a, 0x75, 0x89, 0xe9, 0xd6, 0xbe, 0x3e, 0x58, 0x53, 0xbe, 0x39, 0x58, 0x53, 0x7e, - 0x3a, 0x58, 0x53, 0x7a, 0x87, 0xe5, 0xd0, 0xb9, 0xf9, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xac, - 0x86, 0x1c, 0xa3, 0x3d, 0x0b, 0x00, 0x00, + // 1306 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xc9, 0x8f, 0x1b, 0xc5, + 0x17, 0x56, 0xcf, 0x38, 0xc9, 0xa4, 0xec, 0x19, 0x4f, 0x6a, 0xf2, 0x8b, 0x3b, 0xcb, 0x6f, 0x7a, + 0xd2, 0x52, 0x16, 0x50, 0xc6, 0x9e, 0xf6, 0x4c, 0xec, 0x99, 0x44, 0x04, 0xc5, 0x49, 0x50, 0x26, + 0x28, 0x52, 0xd4, 0x81, 0x48, 0x48, 0x88, 0x56, 0xb9, 0xbb, 0xdc, 0x5d, 0x99, 0x76, 0x57, 0xab, + 0xab, 0x6c, 0xc5, 0x91, 0x10, 0x07, 0x4e, 0x9c, 0xe0, 0xc0, 0x85, 0x23, 0xfc, 0x15, 0x2c, 0x27, + 0x96, 0x03, 0x47, 0xb6, 0x4b, 0x38, 0x58, 0x28, 0x37, 0x96, 0x0b, 0x3e, 0x72, 0x42, 0x55, 0xbd, + 0xd9, 0xc4, 0x06, 0x23, 0x71, 0xeb, 0x7a, 0xf5, 0x7d, 0xef, 0x55, 0xbd, 0xf7, 0xf5, 0xab, 0x07, + 0xb4, 0x30, 0xa2, 0x9c, 0xd6, 0xda, 0x18, 0xd9, 0x34, 0xa8, 0x85, 0xf5, 0xb0, 0xd6, 0x37, 0x6a, + 0x7c, 0x10, 0x62, 0x56, 0x95, 0x3b, 0xf0, 0x04, 0xe6, 0x1e, 0x8e, 0x70, 0xaf, 0x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, 0x68, 0x2e, 0xc7, 0xd6, 0xfd, 0xd8, 0x08, 0x4f, 0x82, 0xa5, 0xb0, + 0xd7, 0xb6, 0x0e, 0xf0, 0x80, 0xa9, 0x05, 0x21, 0x3c, 0xf3, 0x48, 0xd8, 0x6b, 0xbf, 0x8c, 0x07, + 0x0c, 0x6e, 0x25, 0x33, 0xe5, 0xa1, 0x79, 0x47, 0xca, 0x56, 0xe9, 0xeb, 0xa7, 0xeb, 0xca, 0x37, + 0x4f, 0xd7, 0x95, 0x9f, 0x9e, 0xae, 0x2b, 0xed, 0xc3, 0x72, 0x5e, 0xde, 0xfe, 0x33, 0x00, 0x00, + 0xff, 0xff, 0xd4, 0x1c, 0xd6, 0x98, 0xf8, 0x0b, 0x00, 0x00, } func (m *BeaconState) Marshal() (dAtA []byte, err error) { @@ -1373,6 +1458,86 @@ func (m *SignedAggregateAndProof) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *CheckPtInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CheckPtInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CheckPtInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Fork != nil { + { + size, err := m.Fork.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.PubKeys) > 0 { + for iNdEx := len(m.PubKeys) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.PubKeys[iNdEx]) + copy(dAtA[i:], m.PubKeys[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.PubKeys[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.ActiveIndices) > 0 { + dAtA15 := make([]byte, len(m.ActiveIndices)*10) + var j14 int + for _, num := range m.ActiveIndices { + for num >= 1<<7 { + dAtA15[j14] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j14++ + } + dAtA15[j14] = uint8(num) + j14++ + } + i -= j14 + copy(dAtA[i:], dAtA15[:j14]) + i = encodeVarintTypes(dAtA, i, uint64(j14)) + i-- + dAtA[i] = 0x1a + } + if len(m.GenesisRoot) > 0 { + i -= len(m.GenesisRoot) + copy(dAtA[i:], m.GenesisRoot) + i = encodeVarintTypes(dAtA, i, uint64(len(m.GenesisRoot))) + i-- + dAtA[i] = 0x12 + } + if len(m.Seed) > 0 { + i -= len(m.Seed) + copy(dAtA[i:], m.Seed) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Seed))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { offset -= sovTypes(v) base := offset @@ -1651,6 +1816,43 @@ func (m *SignedAggregateAndProof) Size() (n int) { return n } +func (m *CheckPtInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Seed) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.GenesisRoot) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if len(m.ActiveIndices) > 0 { + l = 0 + for _, e := range m.ActiveIndices { + l += sovTypes(uint64(e)) + } + n += 1 + sovTypes(uint64(l)) + l + } + if len(m.PubKeys) > 0 { + for _, b := range m.PubKeys { + l = len(b) + n += 1 + l + sovTypes(uint64(l)) + } + } + if m.Fork != nil { + l = m.Fork.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -3364,6 +3566,272 @@ func (m *SignedAggregateAndProof) Unmarshal(dAtA []byte) error { } return nil } +func (m *CheckPtInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CheckPtInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CheckPtInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Seed", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Seed = append(m.Seed[:0], dAtA[iNdEx:postIndex]...) + if m.Seed == nil { + m.Seed = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenesisRoot", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GenesisRoot = append(m.GenesisRoot[:0], dAtA[iNdEx:postIndex]...) + if m.GenesisRoot == nil { + m.GenesisRoot = []byte{} + } + iNdEx = postIndex + case 3: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ActiveIndices = append(m.ActiveIndices, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.ActiveIndices) == 0 { + m.ActiveIndices = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ActiveIndices = append(m.ActiveIndices, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field ActiveIndices", wireType) + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKeys", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PubKeys = append(m.PubKeys, make([]byte, postIndex-iNdEx)) + copy(m.PubKeys[len(m.PubKeys)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fork", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Fork == nil { + m.Fork = &Fork{} + } + if err := m.Fork.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/proto/beacon/p2p/v1/types.proto b/proto/beacon/p2p/v1/types.proto index 16fa74510a..3277078dca 100644 --- a/proto/beacon/p2p/v1/types.proto +++ b/proto/beacon/p2p/v1/types.proto @@ -99,3 +99,17 @@ message SignedAggregateAndProof { // The signature of the aggregator signing the aggregated and proof object. bytes signature = 2 [(gogoproto.moretags) = "ssz-size:\"96\""]; } + +message CheckPtInfo { + // The randao seed which the check point refers to, this will be used to retrieve shuffled indices. + bytes seed = 1; + // The genesis root which the check point refers to. This ensures same seed can't happen on different chain. + bytes genesis_root = 2; + // Validators that were active at that check point. + repeated uint64 active_indices = 3; + // Validators public keys at that check point. + repeated bytes pub_keys = 4; + // The fork data at that check point. This will be used to verify signatures. + Fork fork = 5; +} +