diff --git a/WORKSPACE b/WORKSPACE index b703447743..ba70e4fcf9 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -117,7 +117,7 @@ http_archive( go_repository( name = "com_github_golang_mock", - commit = "8a44ef6e8be577e050008c7886f24fc705d709fb", + commit = "c20582278a829e4b3259747a3ce0eceb1763ee13", importpath = "github.com/golang/mock", ) diff --git a/beacon-chain/attestation/service.go b/beacon-chain/attestation/service.go index 747f7daf66..6ff5fb844a 100644 --- a/beacon-chain/attestation/service.go +++ b/beacon-chain/attestation/service.go @@ -123,7 +123,7 @@ func (a *Service) updateLatestAttestation(attestation *pb.Attestation) error { // The participation bitfield from attestation is represented in bytes, // here we multiply by 8 to get an accurate validator count in bits. - bitfield := attestation.ParticipationBitfield + bitfield := attestation.AggregationBitfield totalBits := len(bitfield) * 8 // Check each bit of participation bitfield to find out which diff --git a/beacon-chain/attestation/service_test.go b/beacon-chain/attestation/service_test.go index a3f4450e58..5698517abb 100644 --- a/beacon-chain/attestation/service_test.go +++ b/beacon-chain/attestation/service_test.go @@ -27,7 +27,7 @@ func TestUpdateLatestAttestation_Ok(t *testing.T) { service := NewAttestationService(context.Background(), &Config{BeaconDB: beaconDB}) attestation := &pb.Attestation{ - ParticipationBitfield: []byte{0x80}, + AggregationBitfield: []byte{0x80}, Data: &pb.AttestationData{ Slot: 5, }, @@ -66,8 +66,8 @@ func TestAttestationPool_Ok(t *testing.T) { service := NewAttestationService(context.Background(), &Config{BeaconDB: beaconDB}) attestation := &pb.Attestation{ - ParticipationBitfield: []byte{0x80}, - Data: &pb.AttestationData{}, + AggregationBitfield: []byte{0x80}, + Data: &pb.AttestationData{}, } exitRoutine := make(chan bool) diff --git a/beacon-chain/blockchain/service_test.go b/beacon-chain/blockchain/service_test.go index 30c9db4902..01d5579e72 100644 --- a/beacon-chain/blockchain/service_test.go +++ b/beacon-chain/blockchain/service_test.go @@ -364,7 +364,7 @@ func TestRunningChainService(t *testing.T) { }, Body: &pb.BeaconBlockBody{ Attestations: []*pb.Attestation{{ - ParticipationBitfield: []byte{128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + AggregationBitfield: []byte{128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, Data: &pb.AttestationData{ Slot: attestationSlot, @@ -563,7 +563,7 @@ func TestIsBlockReadyForProcessing(t *testing.T) { }, Body: &pb.BeaconBlockBody{ Attestations: []*pb.Attestation{{ - ParticipationBitfield: []byte{128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + AggregationBitfield: []byte{128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, Data: &pb.AttestationData{ Slot: attestationSlot, diff --git a/beacon-chain/core/balances/rewards_penalties_test.go b/beacon-chain/core/balances/rewards_penalties_test.go index 2ef4b4ca2e..cb88d0fadd 100644 --- a/beacon-chain/core/balances/rewards_penalties_test.go +++ b/beacon-chain/core/balances/rewards_penalties_test.go @@ -214,8 +214,8 @@ func TestInclusionDistRewards_Ok(t *testing.T) { attestation := []*pb.PendingAttestationRecord{ {Data: &pb.AttestationData{Slot: 0}, - ParticipationBitfield: participationBitfield, - SlotIncluded: 5}, + AggregationBitfield: participationBitfield, + SlotIncluded: 5}, } tests := []struct { @@ -263,7 +263,7 @@ func TestInclusionDistRewards_NotOk(t *testing.T) { attestation := []*pb.PendingAttestationRecord{ {Data: &pb.AttestationData{Shard: 1, Slot: 0}, - ParticipationBitfield: []byte{0xff}}, + AggregationBitfield: []byte{0xff}}, } tests := []struct { @@ -447,8 +447,8 @@ func TestInactivityInclusionPenalty_Ok(t *testing.T) { } attestation := []*pb.PendingAttestationRecord{ {Data: &pb.AttestationData{Slot: 0}, - ParticipationBitfield: participationBitfield, - SlotIncluded: 5}, + AggregationBitfield: participationBitfield, + SlotIncluded: 5}, } tests := []struct { @@ -495,7 +495,7 @@ func TestInactivityInclusionPenalty_NotOk(t *testing.T) { } attestation := []*pb.PendingAttestationRecord{ {Data: &pb.AttestationData{Shard: 1, Slot: 0}, - ParticipationBitfield: []byte{0xff}}, + AggregationBitfield: []byte{0xff}}, } tests := []struct { @@ -531,8 +531,8 @@ func TestAttestationInclusionRewards(t *testing.T) { } attestation := []*pb.PendingAttestationRecord{ {Data: &pb.AttestationData{Slot: 0}, - ParticipationBitfield: participationBitfield, - SlotIncluded: 0}, + AggregationBitfield: participationBitfield, + SlotIncluded: 0}, } tests := []struct { @@ -608,8 +608,8 @@ func TestAttestationInclusionRewards_NoProposerIndex(t *testing.T) { } attestation := []*pb.PendingAttestationRecord{ {Data: &pb.AttestationData{Shard: 1, Slot: 0}, - ParticipationBitfield: []byte{0xff}, - SlotIncluded: 0}, + AggregationBitfield: []byte{0xff}, + SlotIncluded: 0}, } tests := []struct { @@ -663,8 +663,8 @@ func TestCrosslinksRewardsPenalties(t *testing.T) { } attestation := []*pb.PendingAttestationRecord{ {Data: &pb.AttestationData{Shard: 1, Slot: 0}, - ParticipationBitfield: tt.voted, - SlotIncluded: 0}, + AggregationBitfield: tt.voted, + SlotIncluded: 0}, } state := &pb.BeaconState{ ValidatorRegistry: validators, diff --git a/beacon-chain/core/blocks/block_operations.go b/beacon-chain/core/blocks/block_operations.go index 875134f343..ea007d1aeb 100644 --- a/beacon-chain/core/blocks/block_operations.go +++ b/beacon-chain/core/blocks/block_operations.go @@ -441,10 +441,10 @@ func ProcessBlockAttestations( return nil, fmt.Errorf("could not verify attestation at index %d in block: %v", idx, err) } pendingAttestations = append(pendingAttestations, &pb.PendingAttestationRecord{ - Data: attestation.Data, - ParticipationBitfield: attestation.ParticipationBitfield, - CustodyBitfield: attestation.CustodyBitfield, - SlotIncluded: beaconState.Slot, + Data: attestation.Data, + AggregationBitfield: attestation.AggregationBitfield, + CustodyBitfield: attestation.CustodyBitfield, + SlotIncluded: beaconState.Slot, }) } beaconState.LatestAttestations = pendingAttestations diff --git a/beacon-chain/core/blocks/block_operations_test.go b/beacon-chain/core/blocks/block_operations_test.go index 1612731d40..cf4342ee46 100644 --- a/beacon-chain/core/blocks/block_operations_test.go +++ b/beacon-chain/core/blocks/block_operations_test.go @@ -1088,8 +1088,8 @@ func TestProcessBlockAttestations_CreatePendingAttestations(t *testing.T) { LatestCrosslinkRootHash32: []byte{1}, ShardBlockRootHash32: []byte{}, }, - ParticipationBitfield: []byte{1}, - CustodyBitfield: []byte{1}, + AggregationBitfield: []byte{1}, + CustodyBitfield: []byte{1}, } attestations := []*pb.Attestation{att1} block := &pb.BeaconBlock{ diff --git a/beacon-chain/core/epoch/epoch_operations.go b/beacon-chain/core/epoch/epoch_operations.go index e6a1ef60b8..76c883747d 100644 --- a/beacon-chain/core/epoch/epoch_operations.go +++ b/beacon-chain/core/epoch/epoch_operations.go @@ -206,7 +206,7 @@ func TotalBalance( func InclusionSlot(state *pb.BeaconState, validatorIndex uint64) (uint64, error) { lowestSlotIncluded := uint64(math.MaxUint64) for _, attestation := range state.LatestAttestations { - participatedValidators, err := helpers.AttestationParticipants(state, attestation.Data, attestation.ParticipationBitfield) + participatedValidators, err := helpers.AttestationParticipants(state, attestation.Data, attestation.AggregationBitfield) if err != nil { return 0, fmt.Errorf("could not get attestation participants: %v", err) } @@ -234,7 +234,7 @@ func InclusionSlot(state *pb.BeaconState, validatorIndex uint64) (uint64, error) func InclusionDistance(state *pb.BeaconState, validatorIndex uint64) (uint64, error) { for _, attestation := range state.LatestAttestations { - participatedValidators, err := helpers.AttestationParticipants(state, attestation.Data, attestation.ParticipationBitfield) + participatedValidators, err := helpers.AttestationParticipants(state, attestation.Data, attestation.AggregationBitfield) if err != nil { return 0, fmt.Errorf("could not get attestation participants: %v", err) } diff --git a/beacon-chain/core/epoch/epoch_operations_test.go b/beacon-chain/core/epoch/epoch_operations_test.go index 51d5b9f590..75597aabd7 100644 --- a/beacon-chain/core/epoch/epoch_operations_test.go +++ b/beacon-chain/core/epoch/epoch_operations_test.go @@ -316,7 +316,7 @@ func TestWinningRootOk(t *testing.T) { Slot: 0, ShardBlockRootHash32: []byte{byte(i + 100)}, }, - ParticipationBitfield: participationBitfield, + AggregationBitfield: participationBitfield, } attestations = append(attestations, attestation) } @@ -343,7 +343,7 @@ func TestWinningRootCantGetParticipantBitfield(t *testing.T) { {Data: &pb.AttestationData{ ShardBlockRootHash32: []byte{}, }, - ParticipationBitfield: []byte{}, + AggregationBitfield: []byte{}, }, } @@ -362,7 +362,7 @@ func TestAttestingValidatorsOk(t *testing.T) { Data: &pb.AttestationData{ ShardBlockRootHash32: []byte{byte(i + 100)}, }, - ParticipationBitfield: []byte{0xFF}, + AggregationBitfield: []byte{0xFF}, } attestations = append(attestations, attestation) } @@ -389,7 +389,7 @@ func TestAttestingValidatorsCantGetWinningRoot(t *testing.T) { Data: &pb.AttestationData{ ShardBlockRootHash32: []byte{}, }, - ParticipationBitfield: []byte{}, + AggregationBitfield: []byte{}, } want := fmt.Sprintf("wanted participants bitfield length %d, got: %d", 16, 0) @@ -410,7 +410,7 @@ func TestTotalAttestingBalanceOk(t *testing.T) { ShardBlockRootHash32: []byte{byte(i + 100)}, }, // All validators attested to the above roots. - ParticipationBitfield: []byte{0xff}, + AggregationBitfield: []byte{0xff}, } attestations = append(attestations, attestation) } @@ -436,7 +436,7 @@ func TestTotalAttestingBalanceCantGetWinningRoot(t *testing.T) { Data: &pb.AttestationData{ ShardBlockRootHash32: []byte{}, }, - ParticipationBitfield: []byte{}, + AggregationBitfield: []byte{}, } want := fmt.Sprintf("wanted participants bitfield length %d, got: %d", 16, 0) @@ -469,14 +469,14 @@ func TestInclusionSlotOk(t *testing.T) { state.LatestAttestations = []*pb.PendingAttestationRecord{ {Data: &pb.AttestationData{}, - ParticipationBitfield: participationBitfield, - SlotIncluded: 101}, + AggregationBitfield: participationBitfield, + SlotIncluded: 101}, {Data: &pb.AttestationData{}, - ParticipationBitfield: participationBitfield, - SlotIncluded: 100}, + AggregationBitfield: participationBitfield, + SlotIncluded: 100}, {Data: &pb.AttestationData{}, - ParticipationBitfield: participationBitfield, - SlotIncluded: 102}, + AggregationBitfield: participationBitfield, + SlotIncluded: 102}, } slot, err := InclusionSlot(state, 237) if err != nil { @@ -493,8 +493,8 @@ func TestInclusionSlotBadBitfield(t *testing.T) { state.LatestAttestations = []*pb.PendingAttestationRecord{ {Data: &pb.AttestationData{}, - ParticipationBitfield: []byte{}, - SlotIncluded: 100}, + AggregationBitfield: []byte{}, + SlotIncluded: 100}, } want := fmt.Sprintf("wanted participants bitfield length %d, got: %d", 16, 0) @@ -522,8 +522,8 @@ func TestInclusionDistanceOk(t *testing.T) { state.LatestAttestations = []*pb.PendingAttestationRecord{ {Data: &pb.AttestationData{}, - ParticipationBitfield: participationBitfield, - SlotIncluded: 100}, + AggregationBitfield: participationBitfield, + SlotIncluded: 100}, } distance, err := InclusionDistance(state, 237) if err != nil { @@ -543,8 +543,8 @@ func TestInclusionDistanceBadBitfield(t *testing.T) { state.LatestAttestations = []*pb.PendingAttestationRecord{ {Data: &pb.AttestationData{}, - ParticipationBitfield: []byte{}, - SlotIncluded: 100}, + AggregationBitfield: []byte{}, + SlotIncluded: 100}, } want := fmt.Sprintf("wanted participants bitfield length %d, got: %d", 16, 0) diff --git a/beacon-chain/core/epoch/epoch_processing_test.go b/beacon-chain/core/epoch/epoch_processing_test.go index 3afa21e825..3689487942 100644 --- a/beacon-chain/core/epoch/epoch_processing_test.go +++ b/beacon-chain/core/epoch/epoch_processing_test.go @@ -312,7 +312,7 @@ func TestProcessCrosslinksOk(t *testing.T) { ShardBlockRootHash32: []byte{'A'}, }, // All validators attested to the above roots. - ParticipationBitfield: participationBitfield, + AggregationBitfield: participationBitfield, } attestations = append(attestations, attestation) } @@ -346,7 +346,7 @@ func TestProcessCrosslinksNoParticipantsBitField(t *testing.T) { attestations := []*pb.PendingAttestationRecord{ {Data: &pb.AttestationData{}, // Empty participation bitfield will trigger error. - ParticipationBitfield: []byte{}}} + AggregationBitfield: []byte{}}} wanted := fmt.Sprintf( "wanted participants bitfield length %d, got: %d", diff --git a/beacon-chain/core/state/transition_test.go b/beacon-chain/core/state/transition_test.go index db4eb1e0d3..4d44d7256b 100644 --- a/beacon-chain/core/state/transition_test.go +++ b/beacon-chain/core/state/transition_test.go @@ -237,8 +237,8 @@ func TestProcessBlock_IncorrectProcessExits(t *testing.T) { LatestCrosslinkRootHash32: []byte{1}, ShardBlockRootHash32: []byte{}, }, - ParticipationBitfield: []byte{1}, - CustodyBitfield: []byte{1}, + AggregationBitfield: []byte{1}, + CustodyBitfield: []byte{1}, } attestations := []*pb.Attestation{blockAtt} latestMixes := make([][]byte, config.LatestRandaoMixesLength) @@ -328,8 +328,8 @@ func TestProcessBlock_PassesProcessingConditions(t *testing.T) { LatestCrosslinkRootHash32: []byte{1}, ShardBlockRootHash32: []byte{}, }, - ParticipationBitfield: []byte{1}, - CustodyBitfield: []byte{1}, + AggregationBitfield: []byte{1}, + CustodyBitfield: []byte{1}, } attestations := []*pb.Attestation{blockAtt} latestMixes := make([][]byte, config.LatestRandaoMixesLength) @@ -443,8 +443,8 @@ func TestProcessEpoch_InactiveConditions(t *testing.T) { JustifiedSlot: 64, JustifiedBlockRootHash32: []byte{0}, }, - ParticipationBitfield: []byte{}, - SlotIncluded: i + config.EpochLength + 1, + AggregationBitfield: []byte{}, + SlotIncluded: i + config.EpochLength + 1, }) } @@ -506,7 +506,7 @@ func TestProcessEpoch_CantGetCurrentValidatorIndices(t *testing.T) { Shard: 1, JustifiedBlockRootHash32: make([]byte, 32), }, - ParticipationBitfield: []byte{0xff}, + AggregationBitfield: []byte{0xff}, }) } @@ -564,7 +564,7 @@ func TestProcessEpoch_CantProcessEjections(t *testing.T) { LatestRandaoMixesHash32S: randaoHashes, LatestCrosslinks: []*pb.CrosslinkRecord{{}}, LatestAttestations: []*pb.PendingAttestationRecord{ - {Data: &pb.AttestationData{}, ParticipationBitfield: participationBitfield}, + {Data: &pb.AttestationData{}, AggregationBitfield: participationBitfield}, }} want := fmt.Sprintf("could not process inclusion distance: 0") diff --git a/beacon-chain/core/validators/validator.go b/beacon-chain/core/validators/validator.go index 8cde968bed..9a7aee9808 100644 --- a/beacon-chain/core/validators/validator.go +++ b/beacon-chain/core/validators/validator.go @@ -187,7 +187,7 @@ func ValidatorIndices( attesterIndices, err := helpers.AttestationParticipants( state, attestation.Data, - attestation.ParticipationBitfield) + attestation.AggregationBitfield) if err != nil { return nil, err } @@ -221,7 +221,7 @@ func AttestingValidatorIndices( if attestation.Data.Shard == shard && bytes.Equal(attestation.Data.ShardBlockRootHash32, shardBlockRoot) { - validatorIndicesCommittee, err := helpers.AttestationParticipants(state, attestation.Data, attestation.ParticipationBitfield) + validatorIndicesCommittee, err := helpers.AttestationParticipants(state, attestation.Data, attestation.AggregationBitfield) if err != nil { return nil, fmt.Errorf("could not get attester indices: %v", err) } diff --git a/beacon-chain/core/validators/validator_test.go b/beacon-chain/core/validators/validator_test.go index 75449f8029..3a4cb2be82 100644 --- a/beacon-chain/core/validators/validator_test.go +++ b/beacon-chain/core/validators/validator_test.go @@ -16,11 +16,11 @@ import ( func TestHasVoted(t *testing.T) { // Setting bit field to 11111111. pendingAttestation := &pb.Attestation{ - ParticipationBitfield: []byte{255}, + AggregationBitfield: []byte{255}, } - for i := 0; i < len(pendingAttestation.ParticipationBitfield); i++ { - voted, err := bitutil.CheckBit(pendingAttestation.ParticipationBitfield, i) + for i := 0; i < len(pendingAttestation.AggregationBitfield); i++ { + voted, err := bitutil.CheckBit(pendingAttestation.AggregationBitfield, i) if err != nil { t.Errorf("checking bit failed at index: %d with : %v", i, err) } @@ -32,11 +32,11 @@ func TestHasVoted(t *testing.T) { // Setting bit field to 01010101. pendingAttestation = &pb.Attestation{ - ParticipationBitfield: []byte{85}, + AggregationBitfield: []byte{85}, } - for i := 0; i < len(pendingAttestation.ParticipationBitfield); i++ { - voted, err := bitutil.CheckBit(pendingAttestation.ParticipationBitfield, i) + for i := 0; i < len(pendingAttestation.AggregationBitfield); i++ { + voted, err := bitutil.CheckBit(pendingAttestation.AggregationBitfield, i) if err != nil { t.Errorf("checking bit failed at index: %d : %v", i, err) } @@ -189,8 +189,8 @@ func TestBoundaryAttesterIndices(t *testing.T) { } boundaryAttestations := []*pb.PendingAttestationRecord{ - {Data: &pb.AttestationData{}, ParticipationBitfield: []byte{0x10}}, // returns indices 242 - {Data: &pb.AttestationData{}, ParticipationBitfield: []byte{0xF0}}, // returns indices 237,224,2 + {Data: &pb.AttestationData{}, AggregationBitfield: []byte{0x10}}, // returns indices 242 + {Data: &pb.AttestationData{}, AggregationBitfield: []byte{0xF0}}, // returns indices 237,224,2 } attesterIndices, err := ValidatorIndices(state, boundaryAttestations) @@ -293,7 +293,7 @@ func TestAttestingValidatorIndices_Ok(t *testing.T) { Shard: 6, ShardBlockRootHash32: []byte{'B'}, }, - ParticipationBitfield: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1}, + AggregationBitfield: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1}, } indices, err := AttestingValidatorIndices( @@ -331,7 +331,7 @@ func TestAttestingValidatorIndices_OutOfBound(t *testing.T) { Shard: 1, ShardBlockRootHash32: []byte{'B'}, }, - ParticipationBitfield: []byte{'A'}, // 01000001 = 1,7 + AggregationBitfield: []byte{'A'}, // 01000001 = 1,7 } _, err := AttestingValidatorIndices( diff --git a/beacon-chain/dbcleanup/service_test.go b/beacon-chain/dbcleanup/service_test.go index baf50bc6b1..8daba01301 100644 --- a/beacon-chain/dbcleanup/service_test.go +++ b/beacon-chain/dbcleanup/service_test.go @@ -5,6 +5,8 @@ import ( "testing" "time" + "github.com/prysmaticlabs/prysm/shared/params" + "github.com/prysmaticlabs/prysm/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/beacon-chain/core/validators" "github.com/prysmaticlabs/prysm/beacon-chain/db" @@ -13,7 +15,6 @@ import ( pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" "github.com/prysmaticlabs/prysm/shared/event" "github.com/prysmaticlabs/prysm/shared/hashutil" - "github.com/prysmaticlabs/prysm/shared/params" "github.com/prysmaticlabs/prysm/shared/testutil" logTest "github.com/sirupsen/logrus/hooks/test" ) diff --git a/beacon-chain/operations/service_test.go b/beacon-chain/operations/service_test.go index c7e2a58dc8..313ab840a0 100644 --- a/beacon-chain/operations/service_test.go +++ b/beacon-chain/operations/service_test.go @@ -89,7 +89,7 @@ func TestIncomingAttestation_Ok(t *testing.T) { <-exitRoutine }() attestation := &pb.Attestation{ - ParticipationBitfield: []byte{'A'}, + AggregationBitfield: []byte{'A'}, Data: &pb.AttestationData{ Slot: 100, }} diff --git a/beacon-chain/rpc/attester_server.go b/beacon-chain/rpc/attester_server.go index 87d3aa12b7..2041866a3a 100644 --- a/beacon-chain/rpc/attester_server.go +++ b/beacon-chain/rpc/attester_server.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + pbp2p "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" pb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" "github.com/prysmaticlabs/prysm/shared/hashutil" ) @@ -16,12 +17,26 @@ type AttesterServer struct { // AttestHead is a function called by an attester in a sharding validator to vote // on a block via an attestation object as defined in the Ethereum Serenity specification. -func (as *AttesterServer) AttestHead(ctx context.Context, req *pb.AttestRequest) (*pb.AttestResponse, error) { - h, err := hashutil.HashProto(req.Attestation) +func (as *AttesterServer) AttestHead(ctx context.Context, att *pbp2p.Attestation) (*pb.AttestResponse, error) { + h, err := hashutil.HashProto(att) if err != nil { return nil, fmt.Errorf("could not hash attestation: %v", err) } // Relays the attestation to chain service. - as.operationService.IncomingAttFeed().Send(req.Attestation) + as.operationService.IncomingAttFeed().Send(att) return &pb.AttestResponse{AttestationHash: h[:]}, nil } + +// AttestationInfoAtSlot -- +// +// TODO(#1505): WIP. +func (as *AttesterServer) AttestationInfoAtSlot(ctx context.Context, req *pb.AttestationInfoRequest) (*pb.AttestationInfoResponse, error) { + return nil, nil +} + +// CrosslinkCommitteesAtSlot -- +// +// TODO(#1505): WIP. +func (as *AttesterServer) CrosslinkCommitteesAtSlot(ctx context.Context, req *pb.CrosslinkCommitteeRequest) (*pb.CrosslinkCommitteeResponse, error) { + return nil, nil +} diff --git a/beacon-chain/rpc/attester_server_test.go b/beacon-chain/rpc/attester_server_test.go index 4489cea79d..af9f5c8502 100644 --- a/beacon-chain/rpc/attester_server_test.go +++ b/beacon-chain/rpc/attester_server_test.go @@ -5,7 +5,6 @@ import ( "testing" pbp2p "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" - pb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" ) func TestAttestHead(t *testing.T) { @@ -13,13 +12,11 @@ func TestAttestHead(t *testing.T) { attesterServer := &AttesterServer{ operationService: mockOperationService, } - req := &pb.AttestRequest{ - Attestation: &pbp2p.Attestation{ - Data: &pbp2p.AttestationData{ - Slot: 999, - Shard: 1, - ShardBlockRootHash32: []byte{'a'}, - }, + req := &pbp2p.Attestation{ + Data: &pbp2p.AttestationData{ + Slot: 999, + Shard: 1, + ShardBlockRootHash32: []byte{'a'}, }, } if _, err := attesterServer.AttestHead(context.Background(), req); err != nil { diff --git a/beacon-chain/sync/regular_sync_test.go b/beacon-chain/sync/regular_sync_test.go index 2931f50e2f..da5fd70a29 100644 --- a/beacon-chain/sync/regular_sync_test.go +++ b/beacon-chain/sync/regular_sync_test.go @@ -405,7 +405,7 @@ func TestReceiveAttestation_Ok(t *testing.T) { }() request1 := &pb.Attestation{ - ParticipationBitfield: []byte{99}, + AggregationBitfield: []byte{99}, Data: &pb.AttestationData{ Slot: 0, }, diff --git a/proto/beacon/p2p/v1/types.pb.go b/proto/beacon/p2p/v1/types.pb.go index 2f35411cf5..c625b8a9a6 100755 --- a/proto/beacon/p2p/v1/types.pb.go +++ b/proto/beacon/p2p/v1/types.pb.go @@ -44,7 +44,7 @@ func (x ValidatorRecord_StatusFlags) String() string { return proto.EnumName(ValidatorRecord_StatusFlags_name, int32(x)) } func (ValidatorRecord_StatusFlags) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{6, 0} + return fileDescriptor_types_bdf1eadd736c0167, []int{6, 0} } type ValidatorRegistryDeltaBlock_ValidatorRegistryDeltaFlags int32 @@ -67,7 +67,7 @@ func (x ValidatorRegistryDeltaBlock_ValidatorRegistryDeltaFlags) String() string return proto.EnumName(ValidatorRegistryDeltaBlock_ValidatorRegistryDeltaFlags_name, int32(x)) } func (ValidatorRegistryDeltaBlock_ValidatorRegistryDeltaFlags) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{19, 0} + return fileDescriptor_types_bdf1eadd736c0167, []int{19, 0} } type BeaconState struct { @@ -105,7 +105,7 @@ func (m *BeaconState) Reset() { *m = BeaconState{} } func (m *BeaconState) String() string { return proto.CompactTextString(m) } func (*BeaconState) ProtoMessage() {} func (*BeaconState) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{0} + return fileDescriptor_types_bdf1eadd736c0167, []int{0} } func (m *BeaconState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -322,7 +322,7 @@ func (m *Fork) Reset() { *m = Fork{} } func (m *Fork) String() string { return proto.CompactTextString(m) } func (*Fork) ProtoMessage() {} func (*Fork) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{1} + return fileDescriptor_types_bdf1eadd736c0167, []int{1} } func (m *Fork) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -373,20 +373,20 @@ func (m *Fork) GetEpoch() uint64 { } type PendingAttestationRecord struct { - Data *AttestationData `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - ParticipationBitfield []byte `protobuf:"bytes,2,opt,name=participation_bitfield,json=participationBitfield,proto3" json:"participation_bitfield,omitempty"` - CustodyBitfield []byte `protobuf:"bytes,3,opt,name=custody_bitfield,json=custodyBitfield,proto3" json:"custody_bitfield,omitempty"` - SlotIncluded uint64 `protobuf:"varint,4,opt,name=slot_included,json=slotIncluded,proto3" json:"slot_included,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Data *AttestationData `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + AggregationBitfield []byte `protobuf:"bytes,2,opt,name=aggregation_bitfield,json=aggregationBitfield,proto3" json:"aggregation_bitfield,omitempty"` + CustodyBitfield []byte `protobuf:"bytes,3,opt,name=custody_bitfield,json=custodyBitfield,proto3" json:"custody_bitfield,omitempty"` + SlotIncluded uint64 `protobuf:"varint,4,opt,name=slot_included,json=slotIncluded,proto3" json:"slot_included,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *PendingAttestationRecord) Reset() { *m = PendingAttestationRecord{} } func (m *PendingAttestationRecord) String() string { return proto.CompactTextString(m) } func (*PendingAttestationRecord) ProtoMessage() {} func (*PendingAttestationRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{2} + return fileDescriptor_types_bdf1eadd736c0167, []int{2} } func (m *PendingAttestationRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -422,9 +422,9 @@ func (m *PendingAttestationRecord) GetData() *AttestationData { return nil } -func (m *PendingAttestationRecord) GetParticipationBitfield() []byte { +func (m *PendingAttestationRecord) GetAggregationBitfield() []byte { if m != nil { - return m.ParticipationBitfield + return m.AggregationBitfield } return nil } @@ -444,20 +444,20 @@ func (m *PendingAttestationRecord) GetSlotIncluded() uint64 { } type Attestation struct { - Data *AttestationData `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - ParticipationBitfield []byte `protobuf:"bytes,2,opt,name=participation_bitfield,json=participationBitfield,proto3" json:"participation_bitfield,omitempty"` - CustodyBitfield []byte `protobuf:"bytes,3,opt,name=custody_bitfield,json=custodyBitfield,proto3" json:"custody_bitfield,omitempty"` - AggregateSignature []byte `protobuf:"bytes,4,opt,name=aggregate_signature,json=aggregateSignature,proto3" json:"aggregate_signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Data *AttestationData `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + AggregationBitfield []byte `protobuf:"bytes,2,opt,name=aggregation_bitfield,json=aggregationBitfield,proto3" json:"aggregation_bitfield,omitempty"` + CustodyBitfield []byte `protobuf:"bytes,3,opt,name=custody_bitfield,json=custodyBitfield,proto3" json:"custody_bitfield,omitempty"` + AggregateSignature []byte `protobuf:"bytes,4,opt,name=aggregate_signature,json=aggregateSignature,proto3" json:"aggregate_signature,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Attestation) Reset() { *m = Attestation{} } func (m *Attestation) String() string { return proto.CompactTextString(m) } func (*Attestation) ProtoMessage() {} func (*Attestation) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{3} + return fileDescriptor_types_bdf1eadd736c0167, []int{3} } func (m *Attestation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -493,9 +493,9 @@ func (m *Attestation) GetData() *AttestationData { return nil } -func (m *Attestation) GetParticipationBitfield() []byte { +func (m *Attestation) GetAggregationBitfield() []byte { if m != nil { - return m.ParticipationBitfield + return m.AggregationBitfield } return nil } @@ -521,8 +521,9 @@ type AttestationData struct { EpochBoundaryRootHash32 []byte `protobuf:"bytes,4,opt,name=epoch_boundary_root_hash32,json=epochBoundaryRootHash32,proto3" json:"epoch_boundary_root_hash32,omitempty"` ShardBlockRootHash32 []byte `protobuf:"bytes,5,opt,name=shard_block_root_hash32,json=shardBlockRootHash32,proto3" json:"shard_block_root_hash32,omitempty"` LatestCrosslinkRootHash32 []byte `protobuf:"bytes,6,opt,name=latest_crosslink_root_hash32,json=latestCrosslinkRootHash32,proto3" json:"latest_crosslink_root_hash32,omitempty"` - JustifiedSlot uint64 `protobuf:"varint,7,opt,name=justified_slot,json=justifiedSlot,proto3" json:"justified_slot,omitempty"` + JustifiedEpoch uint64 `protobuf:"varint,7,opt,name=justified_epoch,json=justifiedEpoch,proto3" json:"justified_epoch,omitempty"` JustifiedBlockRootHash32 []byte `protobuf:"bytes,8,opt,name=justified_block_root_hash32,json=justifiedBlockRootHash32,proto3" json:"justified_block_root_hash32,omitempty"` + JustifiedSlot uint64 `protobuf:"varint,1000,opt,name=justified_slot,json=justifiedSlot,proto3" json:"justified_slot,omitempty"` // Deprecated: Do not use. XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -532,7 +533,7 @@ func (m *AttestationData) Reset() { *m = AttestationData{} } func (m *AttestationData) String() string { return proto.CompactTextString(m) } func (*AttestationData) ProtoMessage() {} func (*AttestationData) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{4} + return fileDescriptor_types_bdf1eadd736c0167, []int{4} } func (m *AttestationData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -603,9 +604,9 @@ func (m *AttestationData) GetLatestCrosslinkRootHash32() []byte { return nil } -func (m *AttestationData) GetJustifiedSlot() uint64 { +func (m *AttestationData) GetJustifiedEpoch() uint64 { if m != nil { - return m.JustifiedSlot + return m.JustifiedEpoch } return 0 } @@ -617,6 +618,14 @@ func (m *AttestationData) GetJustifiedBlockRootHash32() []byte { return nil } +// Deprecated: Do not use. +func (m *AttestationData) GetJustifiedSlot() uint64 { + if m != nil { + return m.JustifiedSlot + } + return 0 +} + type AttestationDataAndCustodyBit struct { Data *AttestationData `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` CustodyBit bool `protobuf:"varint,2,opt,name=custody_bit,json=custodyBit,proto3" json:"custody_bit,omitempty"` @@ -629,7 +638,7 @@ func (m *AttestationDataAndCustodyBit) Reset() { *m = AttestationDataAnd func (m *AttestationDataAndCustodyBit) String() string { return proto.CompactTextString(m) } func (*AttestationDataAndCustodyBit) ProtoMessage() {} func (*AttestationDataAndCustodyBit) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{5} + return fileDescriptor_types_bdf1eadd736c0167, []int{5} } func (m *AttestationDataAndCustodyBit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -691,7 +700,7 @@ func (m *ValidatorRecord) Reset() { *m = ValidatorRecord{} } func (m *ValidatorRecord) String() string { return proto.CompactTextString(m) } func (*ValidatorRecord) ProtoMessage() {} func (*ValidatorRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{6} + return fileDescriptor_types_bdf1eadd736c0167, []int{6} } func (m *ValidatorRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -796,7 +805,7 @@ func (m *ShardReassignmentRecord) Reset() { *m = ShardReassignmentRecord func (m *ShardReassignmentRecord) String() string { return proto.CompactTextString(m) } func (*ShardReassignmentRecord) ProtoMessage() {} func (*ShardReassignmentRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{7} + return fileDescriptor_types_bdf1eadd736c0167, []int{7} } func (m *ShardReassignmentRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -858,7 +867,7 @@ func (m *CrosslinkRecord) Reset() { *m = CrosslinkRecord{} } func (m *CrosslinkRecord) String() string { return proto.CompactTextString(m) } func (*CrosslinkRecord) ProtoMessage() {} func (*CrosslinkRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{8} + return fileDescriptor_types_bdf1eadd736c0167, []int{8} } func (m *CrosslinkRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -918,7 +927,7 @@ func (m *BeaconBlock) Reset() { *m = BeaconBlock{} } func (m *BeaconBlock) String() string { return proto.CompactTextString(m) } func (*BeaconBlock) ProtoMessage() {} func (*BeaconBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{9} + return fileDescriptor_types_bdf1eadd736c0167, []int{9} } func (m *BeaconBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1011,7 +1020,7 @@ func (m *BeaconBlockBody) Reset() { *m = BeaconBlockBody{} } func (m *BeaconBlockBody) String() string { return proto.CompactTextString(m) } func (*BeaconBlockBody) ProtoMessage() {} func (*BeaconBlockBody) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{10} + return fileDescriptor_types_bdf1eadd736c0167, []int{10} } func (m *BeaconBlockBody) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1090,7 +1099,7 @@ func (m *DepositInput) Reset() { *m = DepositInput{} } func (m *DepositInput) String() string { return proto.CompactTextString(m) } func (*DepositInput) ProtoMessage() {} func (*DepositInput) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{11} + return fileDescriptor_types_bdf1eadd736c0167, []int{11} } func (m *DepositInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1167,7 +1176,7 @@ func (m *ProposalSignedData) Reset() { *m = ProposalSignedData{} } func (m *ProposalSignedData) String() string { return proto.CompactTextString(m) } func (*ProposalSignedData) ProtoMessage() {} func (*ProposalSignedData) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{12} + return fileDescriptor_types_bdf1eadd736c0167, []int{12} } func (m *ProposalSignedData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1231,7 +1240,7 @@ func (m *SlashableVote) Reset() { *m = SlashableVote{} } func (m *SlashableVote) String() string { return proto.CompactTextString(m) } func (*SlashableVote) ProtoMessage() {} func (*SlashableVote) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{13} + return fileDescriptor_types_bdf1eadd736c0167, []int{13} } func (m *SlashableVote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1301,7 +1310,7 @@ func (m *DepositData) Reset() { *m = DepositData{} } func (m *DepositData) String() string { return proto.CompactTextString(m) } func (*DepositData) ProtoMessage() {} func (*DepositData) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{14} + return fileDescriptor_types_bdf1eadd736c0167, []int{14} } func (m *DepositData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1366,7 +1375,7 @@ func (m *ProposerSlashing) Reset() { *m = ProposerSlashing{} } func (m *ProposerSlashing) String() string { return proto.CompactTextString(m) } func (*ProposerSlashing) ProtoMessage() {} func (*ProposerSlashing) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{15} + return fileDescriptor_types_bdf1eadd736c0167, []int{15} } func (m *ProposerSlashing) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1442,7 +1451,7 @@ func (m *AttesterSlashing) Reset() { *m = AttesterSlashing{} } func (m *AttesterSlashing) String() string { return proto.CompactTextString(m) } func (*AttesterSlashing) ProtoMessage() {} func (*AttesterSlashing) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{16} + return fileDescriptor_types_bdf1eadd736c0167, []int{16} } func (m *AttesterSlashing) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1498,7 +1507,7 @@ func (m *Deposit) Reset() { *m = Deposit{} } func (m *Deposit) String() string { return proto.CompactTextString(m) } func (*Deposit) ProtoMessage() {} func (*Deposit) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{17} + return fileDescriptor_types_bdf1eadd736c0167, []int{17} } func (m *Deposit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1561,7 +1570,7 @@ func (m *Exit) Reset() { *m = Exit{} } func (m *Exit) String() string { return proto.CompactTextString(m) } func (*Exit) ProtoMessage() {} func (*Exit) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{18} + return fileDescriptor_types_bdf1eadd736c0167, []int{18} } func (m *Exit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1626,7 +1635,7 @@ func (m *ValidatorRegistryDeltaBlock) Reset() { *m = ValidatorRegistryDe func (m *ValidatorRegistryDeltaBlock) String() string { return proto.CompactTextString(m) } func (*ValidatorRegistryDeltaBlock) ProtoMessage() {} func (*ValidatorRegistryDeltaBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{19} + return fileDescriptor_types_bdf1eadd736c0167, []int{19} } func (m *ValidatorRegistryDeltaBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1702,7 +1711,7 @@ func (m *Eth1Data) Reset() { *m = Eth1Data{} } func (m *Eth1Data) String() string { return proto.CompactTextString(m) } func (*Eth1Data) ProtoMessage() {} func (*Eth1Data) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{20} + return fileDescriptor_types_bdf1eadd736c0167, []int{20} } func (m *Eth1Data) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1757,7 +1766,7 @@ func (m *Eth1DataVote) Reset() { *m = Eth1DataVote{} } func (m *Eth1DataVote) String() string { return proto.CompactTextString(m) } func (*Eth1DataVote) ProtoMessage() {} func (*Eth1DataVote) Descriptor() ([]byte, []int) { - return fileDescriptor_types_69a4d8ebf9326a13, []int{21} + return fileDescriptor_types_bdf1eadd736c0167, []int{21} } func (m *Eth1DataVote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2175,11 +2184,11 @@ func (m *PendingAttestationRecord) MarshalTo(dAtA []byte) (int, error) { } i += n7 } - if len(m.ParticipationBitfield) > 0 { + if len(m.AggregationBitfield) > 0 { dAtA[i] = 0x12 i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.ParticipationBitfield))) - i += copy(dAtA[i:], m.ParticipationBitfield) + i = encodeVarintTypes(dAtA, i, uint64(len(m.AggregationBitfield))) + i += copy(dAtA[i:], m.AggregationBitfield) } if len(m.CustodyBitfield) > 0 { dAtA[i] = 0x1a @@ -2223,11 +2232,11 @@ func (m *Attestation) MarshalTo(dAtA []byte) (int, error) { } i += n8 } - if len(m.ParticipationBitfield) > 0 { + if len(m.AggregationBitfield) > 0 { dAtA[i] = 0x12 i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.ParticipationBitfield))) - i += copy(dAtA[i:], m.ParticipationBitfield) + i = encodeVarintTypes(dAtA, i, uint64(len(m.AggregationBitfield))) + i += copy(dAtA[i:], m.AggregationBitfield) } if len(m.CustodyBitfield) > 0 { dAtA[i] = 0x1a @@ -2296,10 +2305,10 @@ func (m *AttestationData) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.LatestCrosslinkRootHash32))) i += copy(dAtA[i:], m.LatestCrosslinkRootHash32) } - if m.JustifiedSlot != 0 { + if m.JustifiedEpoch != 0 { dAtA[i] = 0x38 i++ - i = encodeVarintTypes(dAtA, i, uint64(m.JustifiedSlot)) + i = encodeVarintTypes(dAtA, i, uint64(m.JustifiedEpoch)) } if len(m.JustifiedBlockRootHash32) > 0 { dAtA[i] = 0x42 @@ -2307,6 +2316,13 @@ func (m *AttestationData) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.JustifiedBlockRootHash32))) i += copy(dAtA[i:], m.JustifiedBlockRootHash32) } + if m.JustifiedSlot != 0 { + dAtA[i] = 0xc0 + i++ + dAtA[i] = 0x3e + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.JustifiedSlot)) + } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) } @@ -3289,7 +3305,7 @@ func (m *PendingAttestationRecord) Size() (n int) { l = m.Data.Size() n += 1 + l + sovTypes(uint64(l)) } - l = len(m.ParticipationBitfield) + l = len(m.AggregationBitfield) if l > 0 { n += 1 + l + sovTypes(uint64(l)) } @@ -3316,7 +3332,7 @@ func (m *Attestation) Size() (n int) { l = m.Data.Size() n += 1 + l + sovTypes(uint64(l)) } - l = len(m.ParticipationBitfield) + l = len(m.AggregationBitfield) if l > 0 { n += 1 + l + sovTypes(uint64(l)) } @@ -3362,13 +3378,16 @@ func (m *AttestationData) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - if m.JustifiedSlot != 0 { - n += 1 + sovTypes(uint64(m.JustifiedSlot)) + if m.JustifiedEpoch != 0 { + n += 1 + sovTypes(uint64(m.JustifiedEpoch)) } l = len(m.JustifiedBlockRootHash32) if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.JustifiedSlot != 0 { + n += 2 + sovTypes(uint64(m.JustifiedSlot)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -4791,7 +4810,7 @@ func (m *PendingAttestationRecord) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParticipationBitfield", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AggregationBitfield", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -4815,9 +4834,9 @@ func (m *PendingAttestationRecord) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ParticipationBitfield = append(m.ParticipationBitfield[:0], dAtA[iNdEx:postIndex]...) - if m.ParticipationBitfield == nil { - m.ParticipationBitfield = []byte{} + m.AggregationBitfield = append(m.AggregationBitfield[:0], dAtA[iNdEx:postIndex]...) + if m.AggregationBitfield == nil { + m.AggregationBitfield = []byte{} } iNdEx = postIndex case 3: @@ -4956,7 +4975,7 @@ func (m *Attestation) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParticipationBitfield", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AggregationBitfield", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -4980,9 +4999,9 @@ func (m *Attestation) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ParticipationBitfield = append(m.ParticipationBitfield[:0], dAtA[iNdEx:postIndex]...) - if m.ParticipationBitfield == nil { - m.ParticipationBitfield = []byte{} + m.AggregationBitfield = append(m.AggregationBitfield[:0], dAtA[iNdEx:postIndex]...) + if m.AggregationBitfield == nil { + m.AggregationBitfield = []byte{} } iNdEx = postIndex case 3: @@ -5262,9 +5281,9 @@ func (m *AttestationData) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 7: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field JustifiedSlot", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field JustifiedEpoch", wireType) } - m.JustifiedSlot = 0 + m.JustifiedEpoch = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -5274,7 +5293,7 @@ func (m *AttestationData) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.JustifiedSlot |= (uint64(b) & 0x7F) << shift + m.JustifiedEpoch |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } @@ -5310,6 +5329,25 @@ func (m *AttestationData) Unmarshal(dAtA []byte) error { m.JustifiedBlockRootHash32 = []byte{} } iNdEx = postIndex + case 1000: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JustifiedSlot", wireType) + } + m.JustifiedSlot = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.JustifiedSlot |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -8091,140 +8129,141 @@ var ( ) func init() { - proto.RegisterFile("proto/beacon/p2p/v1/types.proto", fileDescriptor_types_69a4d8ebf9326a13) + proto.RegisterFile("proto/beacon/p2p/v1/types.proto", fileDescriptor_types_bdf1eadd736c0167) } -var fileDescriptor_types_69a4d8ebf9326a13 = []byte{ - // 2091 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcb, 0x73, 0x1b, 0x49, - 0x19, 0xdf, 0x91, 0xe4, 0xc4, 0xf9, 0x24, 0x5b, 0x72, 0x3b, 0xb1, 0x66, 0x63, 0x27, 0x76, 0x26, - 0xbb, 0xd8, 0x09, 0x60, 0xaf, 0x94, 0x5a, 0x42, 0x11, 0x02, 0x58, 0xb6, 0x97, 0x08, 0xb2, 0x9b, - 0xd4, 0xd8, 0xeb, 0x70, 0x81, 0xa9, 0xd6, 0x4c, 0x5b, 0x9a, 0x78, 0x34, 0x33, 0x35, 0xdd, 0xf2, - 0xc6, 0x14, 0x27, 0x8a, 0x0b, 0x8f, 0x02, 0xfe, 0x05, 0xf8, 0x1b, 0xb8, 0x50, 0xbc, 0x4e, 0x14, - 0x1c, 0x79, 0x5e, 0xa8, 0x82, 0xa2, 0x72, 0xe6, 0x7d, 0xa7, 0x8a, 0xea, 0xc7, 0x3c, 0x25, 0x39, - 0xce, 0xe6, 0xc2, 0x49, 0xd5, 0xdf, 0xf7, 0xfb, 0x7d, 0xdd, 0xfd, 0xf5, 0xf7, 0xd2, 0xc0, 0x6a, - 0x18, 0x05, 0x2c, 0xd8, 0xea, 0x11, 0x6c, 0x07, 0xfe, 0x56, 0xd8, 0x0e, 0xb7, 0x4e, 0x5a, 0x5b, - 0xec, 0x34, 0x24, 0x74, 0x53, 0x68, 0xd0, 0x12, 0x61, 0x03, 0x12, 0x91, 0xd1, 0x70, 0x53, 0x62, - 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xc6, 0x8b, 0x6c, 0x1d, 0x06, 0x8c, 0x98, 0x73, 0x24, 0xb3, 0xa2, 0xc8, 0x80, 0x5a, 0x9f, 0xf8, - 0x84, 0xba, 0xd4, 0x62, 0xee, 0x90, 0xe8, 0xdf, 0x5c, 0x17, 0xf1, 0x56, 0x55, 0xc2, 0x03, 0x77, - 0x48, 0x50, 0x0b, 0x2a, 0x47, 0x41, 0x74, 0xac, 0x7f, 0x6b, 0x5d, 0x9c, 0x79, 0x65, 0xda, 0x3e, - 0xef, 0x04, 0xd1, 0xb1, 0x29, 0xa0, 0x68, 0x11, 0x2a, 0x22, 0x7c, 0xbf, 0x2d, 0xcd, 0x89, 0x85, - 0x11, 0x42, 0x85, 0x43, 0xd0, 0x2d, 0x68, 0x24, 0xe9, 0x77, 0x42, 0x22, 0xea, 0x06, 0xbe, 0xae, - 0x09, 0x5c, 0x3d, 0x96, 0x1f, 0x4a, 0x31, 0x5a, 0x87, 0x7a, 0x9c, 0xe5, 0x31, 0x52, 0xd6, 0xef, - 0x79, 0x25, 0x8e, 0x81, 0x97, 0x61, 0x46, 0x56, 0x9d, 0xb2, 0x50, 0xcb, 0x85, 0xf1, 0x17, 0x0d, - 0xf4, 0x69, 0xcf, 0x8c, 0xee, 0x41, 0x45, 0x3c, 0x85, 0x26, 0x6e, 0x35, 0x35, 0x6d, 0x32, 0x44, - 0xf1, 0x20, 0x82, 0x84, 0xde, 0x86, 0xa5, 0x10, 0x47, 0xcc, 0xb5, 0xdd, 0xb0, 0x90, 0xe1, 0x25, - 0x51, 0x7a, 0xae, 0xe4, 0xb4, 0x49, 0x82, 0xdf, 0x82, 0x86, 0x3d, 0xa2, 0x2c, 0x70, 0x4e, 0x53, - 0x42, 0x59, 0x10, 0xea, 0x4a, 0x9e, 0x40, 0x6f, 0xc2, 0x1c, 0xf7, 0x9a, 0xe5, 0xfa, 0xb6, 0x37, - 0x72, 0x88, 0xa3, 0x57, 0xc4, 0xcd, 0x6a, 0x5c, 0xd8, 0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0b, 0xe1, - 0xa8, 0x77, 0x4c, 0x4e, 0xc5, 0x9e, 0x35, 0x53, 0xad, 0x50, 0x07, 0xae, 0x7d, 0xe0, 0xb2, 0x81, - 0x13, 0xe1, 0x0f, 0xb0, 0x67, 0xd9, 0x11, 0x71, 0x88, 0xcf, 0x5c, 0xec, 0xc5, 0x83, 0x99, 0x8a, - 0xea, 0xe5, 0x14, 0xb4, 0x93, 0x62, 0x94, 0x4f, 0x3f, 0x09, 0xba, 0x1a, 0xe9, 0xf8, 0x5c, 0xeb, - 0xb2, 0x21, 0xaf, 0x44, 0xb9, 0x08, 0x5a, 0x92, 0xfa, 0x9d, 0x44, 0xad, 0x98, 0x37, 0x61, 0x4e, - 0x31, 0x3d, 0x7c, 0x4a, 0x22, 0x1a, 0xa7, 0xaf, 0x14, 0x3e, 0x14, 0x32, 0x9e, 0x3a, 0xd8, 0x66, - 0xee, 0x49, 0x76, 0x6c, 0x9a, 0x91, 0x95, 0x30, 0x95, 0xcb, 0x69, 0xe9, 0x1a, 0x00, 0x79, 0xe6, - 0xaa, 0x61, 0x47, 0x04, 0x43, 0xc5, 0xbc, 0xc4, 0x25, 0x52, 0x7d, 0x0b, 0x1a, 0x99, 0xcb, 0x4a, - 0x90, 0x7c, 0xfe, 0x7a, 0x2a, 0x97, 0xd0, 0x75, 0xa8, 0xa7, 0x4d, 0x56, 0x22, 0x67, 0x65, 0x4d, - 0x4d, 0xc4, 0x12, 0x78, 0x08, 0x35, 0xfe, 0x44, 0x23, 0x6a, 0x1d, 0x79, 0xb8, 0x4f, 0x75, 0x58, - 0xd3, 0x36, 0xe6, 0xdb, 0x77, 0xce, 0x39, 0x9e, 0x6f, 0xee, 0x0b, 0xee, 0x3b, 0x9c, 0x6a, 0x56, - 0x69, 0xba, 0x30, 0x3e, 0x07, 0xd5, 0x8c, 0x0e, 0x55, 0xe1, 0x62, 0xf7, 0xbd, 0xee, 0x41, 0x77, - 0xfb, 0x61, 0xe3, 0x35, 0x84, 0x60, 0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0x17, 0x34, 0xe8, 0xf3, - 0x50, 0xcb, 0x8d, 0x85, 0xf2, 0x4f, 0xe6, 0xcd, 0x73, 0x14, 0x26, 0x33, 0x47, 0x44, 0x4f, 0x00, - 0x85, 0x51, 0x10, 0x06, 0x94, 0x44, 0x16, 0xf5, 0x30, 0x1d, 0xb8, 0x7e, 0x9f, 0xea, 0x25, 0x61, - 0x6e, 0x63, 0xea, 0x90, 0xa9, 0x18, 0xfb, 0x8a, 0x60, 0x2e, 0x84, 0x05, 0x89, 0x30, 0x2c, 0x37, - 0xca, 0x19, 0x2e, 0x9f, 0x6d, 0x78, 0x5b, 0x31, 0x52, 0xc3, 0xb8, 0x20, 0xe1, 0x53, 0xf5, 0xac, - 0x43, 0xc2, 0x80, 0xba, 0x8c, 0x97, 0x1f, 0x6e, 0x6e, 0x75, 0x9a, 0xb9, 0x5d, 0x89, 0x33, 0x13, - 0x02, 0x6a, 0xc3, 0x0c, 0x2f, 0x2f, 0x54, 0x9f, 0x11, 0xcc, 0xa9, 0x53, 0xdf, 0xde, 0x33, 0x97, - 0x99, 0x12, 0x6a, 0x7c, 0xbf, 0x04, 0x35, 0x65, 0xa9, 0xeb, 0x87, 0x23, 0x36, 0xb5, 0x36, 0x6f, - 0xc2, 0x62, 0x18, 0x05, 0xc1, 0x91, 0x15, 0x1c, 0x59, 0x61, 0x40, 0x29, 0xa1, 0xc9, 0x6c, 0x57, - 0x13, 0x2e, 0x0a, 0x8e, 0x1e, 0x1d, 0x3d, 0x4e, 0x14, 0x2f, 0xae, 0xe5, 0xe5, 0x57, 0xab, 0xe5, - 0x95, 0x33, 0x6b, 0xb9, 0xf8, 0xaf, 0x29, 0xdb, 0xd2, 0x38, 0x55, 0xf6, 0xf4, 0xa6, 0x02, 0x14, - 0xb9, 0xc6, 0x53, 0x40, 0x32, 0x06, 0xb0, 0xc7, 0xc7, 0x1a, 0xe2, 0xbc, 0xe4, 0x0c, 0x73, 0x1b, - 0x16, 0xa6, 0x0d, 0x2f, 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 0xa7, 0xe8, 0xe4, 0x74, 0x2b, 0x8c, 0x1b, 0x77, 0xa7, 0xb9, 0x48, 0x8e, 0xb9, 0xf3, 0x00, - 0xdb, 0x3b, 0x07, 0xdd, 0xc3, 0xed, 0x83, 0xee, 0xa3, 0xf7, 0x1a, 0xaf, 0xa1, 0x59, 0xa8, 0xc8, - 0xf9, 0xd6, 0xf8, 0x32, 0xcc, 0x26, 0x9f, 0x77, 0x36, 0x61, 0x31, 0x7e, 0xee, 0x71, 0xd7, 0x2d, - 0x28, 0x55, 0xc6, 0x5d, 0x37, 0xa0, 0x26, 0xdb, 0x43, 0x6e, 0x22, 0xac, 0x0a, 0x99, 0xea, 0x0a, - 0x1e, 0xd4, 0xb2, 0x5f, 0x80, 0xf2, 0xe3, 0x9b, 0xf6, 0xd2, 0xe3, 0xdb, 0x35, 0x00, 0x91, 0x43, - 0x76, 0xa6, 0x6a, 0x5e, 0xe2, 0x92, 0x1d, 0x2e, 0xe8, 0xd4, 0x7e, 0xfd, 0xfc, 0xba, 0xf6, 0x9b, - 0xe7, 0xd7, 0xb5, 0xbf, 0x3e, 0xbf, 0xae, 0xf5, 0x2e, 0x88, 0xcf, 0xff, 0x77, 0xfe, 0x17, 0x00, - 0x00, 0xff, 0xff, 0x56, 0x79, 0x39, 0x1f, 0x56, 0x18, 0x00, 0x00, +var fileDescriptor_types_bdf1eadd736c0167 = []byte{ + // 2103 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0xcb, 0x73, 0x1b, 0x49, + 0x19, 0xdf, 0x91, 0xe4, 0xc4, 0xf9, 0x24, 0x4b, 0x72, 0x3b, 0xb1, 0x66, 0xf3, 0xb2, 0x33, 0xd9, + 0xc5, 0x4e, 0x00, 0x7b, 0xa5, 0x14, 0x84, 0x22, 0x04, 0xb0, 0x6c, 0x2f, 0x11, 0x64, 0x37, 0xa9, + 0xb1, 0xd7, 0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 0x64, 0xcc, 0xf8, 0x1f, 0xe1, 0x53, 0xaa, 0xff, 0x42, 0xfa, 0xe3, 0xad, 0x59, + 0xfe, 0x78, 0x4c, 0x7c, 0xc7, 0xf5, 0x07, 0x5b, 0x29, 0x47, 0x39, 0x06, 0x49, 0x6b, 0x19, 0x45, + 0xd6, 0x35, 0xae, 0xef, 0x90, 0x67, 0xf9, 0xdb, 0xfd, 0x32, 0xe7, 0x9a, 0x1e, 0x07, 0x64, 0x2f, + 0xf7, 0x15, 0x50, 0xae, 0xb6, 0x08, 0x1b, 0xb6, 0x2d, 0x07, 0x33, 0xac, 0xff, 0x68, 0x65, 0x55, + 0x5b, 0xaf, 0x76, 0x56, 0x67, 0x1d, 0x6e, 0x97, 0x0d, 0xdb, 0x3b, 0x98, 0x61, 0xb3, 0x2e, 0xa9, + 0xf1, 0x1a, 0xbd, 0x03, 0x8d, 0xc4, 0x8a, 0x75, 0x1c, 0x30, 0x42, 0xf5, 0x1f, 0xaf, 0x88, 0x8b, + 0xbe, 0xf1, 0x22, 0x5b, 0x07, 0x01, 0x23, 0xe6, 0x02, 0xc9, 0xac, 0x28, 0x32, 0xa0, 0x36, 0x20, + 0x3e, 0xa1, 0x2e, 0xb5, 0x98, 0x3b, 0x22, 0xfa, 0x77, 0xd6, 0x44, 0xbc, 0x55, 0x95, 0x70, 0xdf, + 0x1d, 0x11, 0xd4, 0x86, 0xca, 0x61, 0x10, 0x1d, 0xe9, 0xdf, 0x5d, 0x13, 0x67, 0xbe, 0x3a, 0x6b, + 0x9f, 0xb7, 0x83, 0xe8, 0xc8, 0x14, 0x50, 0xb4, 0x04, 0x15, 0x11, 0xbe, 0xdf, 0x93, 0xe6, 0xc4, + 0xc2, 0x08, 0xa1, 0xc2, 0x21, 0xe8, 0x16, 0x34, 0x93, 0xf4, 0x3b, 0x26, 0x11, 0x75, 0x03, 0x5f, + 0xd7, 0x04, 0xae, 0x11, 0xcb, 0x0f, 0xa4, 0x18, 0xad, 0x41, 0x23, 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0x5d, 0x03, 0x10, 0x39, 0x64, 0x67, 0xaa, 0xe6, 0x05, + 0x2e, 0xd9, 0xe6, 0x82, 0x6e, 0xed, 0x37, 0xcf, 0xaf, 0x6b, 0xbf, 0x7d, 0x7e, 0x5d, 0xfb, 0xcb, + 0xf3, 0xeb, 0x5a, 0xff, 0x9c, 0xf8, 0x27, 0xc1, 0x9d, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x2b, + 0x62, 0x5a, 0xe4, 0x7c, 0x18, 0x00, 0x00, } diff --git a/proto/beacon/p2p/v1/types.proto b/proto/beacon/p2p/v1/types.proto index e13463685d..760a74ad2c 100644 --- a/proto/beacon/p2p/v1/types.proto +++ b/proto/beacon/p2p/v1/types.proto @@ -51,14 +51,14 @@ message Fork { message PendingAttestationRecord { AttestationData data = 1; - bytes participation_bitfield = 2; + bytes aggregation_bitfield = 2; bytes custody_bitfield = 3; uint64 slot_included = 4; } message Attestation { AttestationData data = 1; - bytes participation_bitfield = 2; + bytes aggregation_bitfield = 2; bytes custody_bitfield = 3; bytes aggregate_signature = 4; // Type of [uint384] ? } @@ -70,8 +70,9 @@ message AttestationData { bytes epoch_boundary_root_hash32 = 4; bytes shard_block_root_hash32 = 5; bytes latest_crosslink_root_hash32 = 6; - uint64 justified_slot = 7; + uint64 justified_epoch = 7; bytes justified_block_root_hash32 = 8; + uint64 justified_slot = 1000 [deprecated=true]; } message AttestationDataAndCustodyBit { diff --git a/proto/beacon/rpc/v1/services.pb.go b/proto/beacon/rpc/v1/services.pb.go index 27e68ecb52..a5e63a98b9 100755 --- a/proto/beacon/rpc/v1/services.pb.go +++ b/proto/beacon/rpc/v1/services.pb.go @@ -50,7 +50,243 @@ func (x ValidatorRole) String() string { return proto.EnumName(ValidatorRole_name, int32(x)) } func (ValidatorRole) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_services_fe42b90f12b872ee, []int{0} + return fileDescriptor_services_ad7fec92be597562, []int{0} +} + +type AttestationInfoRequest struct { + Slot uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"` + Shard uint64 `protobuf:"varint,2,opt,name=shard,proto3" json:"shard,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AttestationInfoRequest) Reset() { *m = AttestationInfoRequest{} } +func (m *AttestationInfoRequest) String() string { return proto.CompactTextString(m) } +func (*AttestationInfoRequest) ProtoMessage() {} +func (*AttestationInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_services_ad7fec92be597562, []int{0} +} +func (m *AttestationInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AttestationInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AttestationInfoRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *AttestationInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AttestationInfoRequest.Merge(dst, src) +} +func (m *AttestationInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *AttestationInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AttestationInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AttestationInfoRequest proto.InternalMessageInfo + +func (m *AttestationInfoRequest) GetSlot() uint64 { + if m != nil { + return m.Slot + } + return 0 +} + +func (m *AttestationInfoRequest) GetShard() uint64 { + if m != nil { + return m.Shard + } + return 0 +} + +type AttestationInfoResponse struct { + BeaconBlockRootHash32 []byte `protobuf:"bytes,1,opt,name=beacon_block_root_hash32,json=beaconBlockRootHash32,proto3" json:"beacon_block_root_hash32,omitempty"` + EpochBoundaryRootHash32 []byte `protobuf:"bytes,2,opt,name=epoch_boundary_root_hash32,json=epochBoundaryRootHash32,proto3" json:"epoch_boundary_root_hash32,omitempty"` + JustifiedEpoch uint64 `protobuf:"varint,3,opt,name=justified_epoch,json=justifiedEpoch,proto3" json:"justified_epoch,omitempty"` + JustifiedBlockRootHash32 []byte `protobuf:"bytes,4,opt,name=justified_block_root_hash32,json=justifiedBlockRootHash32,proto3" json:"justified_block_root_hash32,omitempty"` + LatestCrosslinkRootHash32 []byte `protobuf:"bytes,5,opt,name=latest_crosslink_root_hash32,json=latestCrosslinkRootHash32,proto3" json:"latest_crosslink_root_hash32,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AttestationInfoResponse) Reset() { *m = AttestationInfoResponse{} } +func (m *AttestationInfoResponse) String() string { return proto.CompactTextString(m) } +func (*AttestationInfoResponse) ProtoMessage() {} +func (*AttestationInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_services_ad7fec92be597562, []int{1} +} +func (m *AttestationInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AttestationInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AttestationInfoResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *AttestationInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AttestationInfoResponse.Merge(dst, src) +} +func (m *AttestationInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *AttestationInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AttestationInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AttestationInfoResponse proto.InternalMessageInfo + +func (m *AttestationInfoResponse) GetBeaconBlockRootHash32() []byte { + if m != nil { + return m.BeaconBlockRootHash32 + } + return nil +} + +func (m *AttestationInfoResponse) GetEpochBoundaryRootHash32() []byte { + if m != nil { + return m.EpochBoundaryRootHash32 + } + return nil +} + +func (m *AttestationInfoResponse) GetJustifiedEpoch() uint64 { + if m != nil { + return m.JustifiedEpoch + } + return 0 +} + +func (m *AttestationInfoResponse) GetJustifiedBlockRootHash32() []byte { + if m != nil { + return m.JustifiedBlockRootHash32 + } + return nil +} + +func (m *AttestationInfoResponse) GetLatestCrosslinkRootHash32() []byte { + if m != nil { + return m.LatestCrosslinkRootHash32 + } + return nil +} + +type CrosslinkCommitteeRequest struct { + Slot uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CrosslinkCommitteeRequest) Reset() { *m = CrosslinkCommitteeRequest{} } +func (m *CrosslinkCommitteeRequest) String() string { return proto.CompactTextString(m) } +func (*CrosslinkCommitteeRequest) ProtoMessage() {} +func (*CrosslinkCommitteeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_services_ad7fec92be597562, []int{2} +} +func (m *CrosslinkCommitteeRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CrosslinkCommitteeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CrosslinkCommitteeRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *CrosslinkCommitteeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CrosslinkCommitteeRequest.Merge(dst, src) +} +func (m *CrosslinkCommitteeRequest) XXX_Size() int { + return m.Size() +} +func (m *CrosslinkCommitteeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CrosslinkCommitteeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CrosslinkCommitteeRequest proto.InternalMessageInfo + +func (m *CrosslinkCommitteeRequest) GetSlot() uint64 { + if m != nil { + return m.Slot + } + return 0 +} + +type CrosslinkCommitteeResponse struct { + Committee []uint64 `protobuf:"varint,1,rep,packed,name=committee,proto3" json:"committee,omitempty"` + Shard uint64 `protobuf:"varint,2,opt,name=shard,proto3" json:"shard,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CrosslinkCommitteeResponse) Reset() { *m = CrosslinkCommitteeResponse{} } +func (m *CrosslinkCommitteeResponse) String() string { return proto.CompactTextString(m) } +func (*CrosslinkCommitteeResponse) ProtoMessage() {} +func (*CrosslinkCommitteeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_services_ad7fec92be597562, []int{3} +} +func (m *CrosslinkCommitteeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CrosslinkCommitteeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CrosslinkCommitteeResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *CrosslinkCommitteeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CrosslinkCommitteeResponse.Merge(dst, src) +} +func (m *CrosslinkCommitteeResponse) XXX_Size() int { + return m.Size() +} +func (m *CrosslinkCommitteeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CrosslinkCommitteeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CrosslinkCommitteeResponse proto.InternalMessageInfo + +func (m *CrosslinkCommitteeResponse) GetCommittee() []uint64 { + if m != nil { + return m.Committee + } + return nil +} + +func (m *CrosslinkCommitteeResponse) GetShard() uint64 { + if m != nil { + return m.Shard + } + return 0 } type ChainStartResponse struct { @@ -65,7 +301,7 @@ func (m *ChainStartResponse) Reset() { *m = ChainStartResponse{} } func (m *ChainStartResponse) String() string { return proto.CompactTextString(m) } func (*ChainStartResponse) ProtoMessage() {} func (*ChainStartResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_services_fe42b90f12b872ee, []int{0} + return fileDescriptor_services_ad7fec92be597562, []int{4} } func (m *ChainStartResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -124,7 +360,7 @@ func (m *ProposeRequest) Reset() { *m = ProposeRequest{} } func (m *ProposeRequest) String() string { return proto.CompactTextString(m) } func (*ProposeRequest) ProtoMessage() {} func (*ProposeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_services_fe42b90f12b872ee, []int{1} + return fileDescriptor_services_ad7fec92be597562, []int{5} } func (m *ProposeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -206,7 +442,7 @@ func (m *ProposeResponse) Reset() { *m = ProposeResponse{} } func (m *ProposeResponse) String() string { return proto.CompactTextString(m) } func (*ProposeResponse) ProtoMessage() {} func (*ProposeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_services_fe42b90f12b872ee, []int{2} + return fileDescriptor_services_ad7fec92be597562, []int{6} } func (m *ProposeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -253,7 +489,7 @@ func (m *ProposerIndexRequest) Reset() { *m = ProposerIndexRequest{} } func (m *ProposerIndexRequest) String() string { return proto.CompactTextString(m) } func (*ProposerIndexRequest) ProtoMessage() {} func (*ProposerIndexRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_services_fe42b90f12b872ee, []int{3} + return fileDescriptor_services_ad7fec92be597562, []int{7} } func (m *ProposerIndexRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -300,7 +536,7 @@ func (m *ProposerIndexResponse) Reset() { *m = ProposerIndexResponse{} } func (m *ProposerIndexResponse) String() string { return proto.CompactTextString(m) } func (*ProposerIndexResponse) ProtoMessage() {} func (*ProposerIndexResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_services_fe42b90f12b872ee, []int{4} + return fileDescriptor_services_ad7fec92be597562, []int{8} } func (m *ProposerIndexResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -347,7 +583,7 @@ func (m *StateRootResponse) Reset() { *m = StateRootResponse{} } func (m *StateRootResponse) String() string { return proto.CompactTextString(m) } func (*StateRootResponse) ProtoMessage() {} func (*StateRootResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_services_fe42b90f12b872ee, []int{5} + return fileDescriptor_services_ad7fec92be597562, []int{9} } func (m *StateRootResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -383,53 +619,6 @@ func (m *StateRootResponse) GetStateRoot() []byte { return nil } -type AttestRequest struct { - Attestation *v1.Attestation `protobuf:"bytes,1,opt,name=attestation,proto3" json:"attestation,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AttestRequest) Reset() { *m = AttestRequest{} } -func (m *AttestRequest) String() string { return proto.CompactTextString(m) } -func (*AttestRequest) ProtoMessage() {} -func (*AttestRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_services_fe42b90f12b872ee, []int{6} -} -func (m *AttestRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AttestRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AttestRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *AttestRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AttestRequest.Merge(dst, src) -} -func (m *AttestRequest) XXX_Size() int { - return m.Size() -} -func (m *AttestRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AttestRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AttestRequest proto.InternalMessageInfo - -func (m *AttestRequest) GetAttestation() *v1.Attestation { - if m != nil { - return m.Attestation - } - return nil -} - type AttestResponse struct { AttestationHash []byte `protobuf:"bytes,1,opt,name=attestation_hash,json=attestationHash,proto3" json:"attestation_hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -441,7 +630,7 @@ func (m *AttestResponse) Reset() { *m = AttestResponse{} } func (m *AttestResponse) String() string { return proto.CompactTextString(m) } func (*AttestResponse) ProtoMessage() {} func (*AttestResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_services_fe42b90f12b872ee, []int{7} + return fileDescriptor_services_ad7fec92be597562, []int{10} } func (m *AttestResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -491,7 +680,7 @@ func (m *Assignment) Reset() { *m = Assignment{} } func (m *Assignment) String() string { return proto.CompactTextString(m) } func (*Assignment) ProtoMessage() {} func (*Assignment) Descriptor() ([]byte, []int) { - return fileDescriptor_services_fe42b90f12b872ee, []int{8} + return fileDescriptor_services_ad7fec92be597562, []int{11} } func (m *Assignment) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -559,7 +748,7 @@ func (m *ValidatorIndexRequest) Reset() { *m = ValidatorIndexRequest{} } func (m *ValidatorIndexRequest) String() string { return proto.CompactTextString(m) } func (*ValidatorIndexRequest) ProtoMessage() {} func (*ValidatorIndexRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_services_fe42b90f12b872ee, []int{9} + return fileDescriptor_services_ad7fec92be597562, []int{12} } func (m *ValidatorIndexRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -606,7 +795,7 @@ func (m *ValidatorIndexResponse) Reset() { *m = ValidatorIndexResponse{} func (m *ValidatorIndexResponse) String() string { return proto.CompactTextString(m) } func (*ValidatorIndexResponse) ProtoMessage() {} func (*ValidatorIndexResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_services_fe42b90f12b872ee, []int{10} + return fileDescriptor_services_ad7fec92be597562, []int{13} } func (m *ValidatorIndexResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -654,7 +843,7 @@ func (m *ValidatorEpochAssignmentsRequest) Reset() { *m = ValidatorEpoch func (m *ValidatorEpochAssignmentsRequest) String() string { return proto.CompactTextString(m) } func (*ValidatorEpochAssignmentsRequest) ProtoMessage() {} func (*ValidatorEpochAssignmentsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_services_fe42b90f12b872ee, []int{11} + return fileDescriptor_services_ad7fec92be597562, []int{14} } func (m *ValidatorEpochAssignmentsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -708,7 +897,7 @@ func (m *ValidatorEpochAssignmentsResponse) Reset() { *m = ValidatorEpoc func (m *ValidatorEpochAssignmentsResponse) String() string { return proto.CompactTextString(m) } func (*ValidatorEpochAssignmentsResponse) ProtoMessage() {} func (*ValidatorEpochAssignmentsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_services_fe42b90f12b872ee, []int{12} + return fileDescriptor_services_ad7fec92be597562, []int{15} } func (m *ValidatorEpochAssignmentsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -755,7 +944,7 @@ func (m *PendingDepositsResponse) Reset() { *m = PendingDepositsResponse func (m *PendingDepositsResponse) String() string { return proto.CompactTextString(m) } func (*PendingDepositsResponse) ProtoMessage() {} func (*PendingDepositsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_services_fe42b90f12b872ee, []int{13} + return fileDescriptor_services_ad7fec92be597562, []int{16} } func (m *PendingDepositsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -802,7 +991,7 @@ func (m *Eth1DataResponse) Reset() { *m = Eth1DataResponse{} } func (m *Eth1DataResponse) String() string { return proto.CompactTextString(m) } func (*Eth1DataResponse) ProtoMessage() {} func (*Eth1DataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_services_fe42b90f12b872ee, []int{14} + return fileDescriptor_services_ad7fec92be597562, []int{17} } func (m *Eth1DataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -839,13 +1028,16 @@ func (m *Eth1DataResponse) GetEth1Data() *v1.Eth1Data { } func init() { + proto.RegisterType((*AttestationInfoRequest)(nil), "ethereum.beacon.rpc.v1.AttestationInfoRequest") + proto.RegisterType((*AttestationInfoResponse)(nil), "ethereum.beacon.rpc.v1.AttestationInfoResponse") + proto.RegisterType((*CrosslinkCommitteeRequest)(nil), "ethereum.beacon.rpc.v1.CrosslinkCommitteeRequest") + proto.RegisterType((*CrosslinkCommitteeResponse)(nil), "ethereum.beacon.rpc.v1.CrosslinkCommitteeResponse") proto.RegisterType((*ChainStartResponse)(nil), "ethereum.beacon.rpc.v1.ChainStartResponse") proto.RegisterType((*ProposeRequest)(nil), "ethereum.beacon.rpc.v1.ProposeRequest") proto.RegisterType((*ProposeResponse)(nil), "ethereum.beacon.rpc.v1.ProposeResponse") proto.RegisterType((*ProposerIndexRequest)(nil), "ethereum.beacon.rpc.v1.ProposerIndexRequest") proto.RegisterType((*ProposerIndexResponse)(nil), "ethereum.beacon.rpc.v1.ProposerIndexResponse") proto.RegisterType((*StateRootResponse)(nil), "ethereum.beacon.rpc.v1.StateRootResponse") - proto.RegisterType((*AttestRequest)(nil), "ethereum.beacon.rpc.v1.AttestRequest") proto.RegisterType((*AttestResponse)(nil), "ethereum.beacon.rpc.v1.AttestResponse") proto.RegisterType((*Assignment)(nil), "ethereum.beacon.rpc.v1.Assignment") proto.RegisterType((*ValidatorIndexRequest)(nil), "ethereum.beacon.rpc.v1.ValidatorIndexRequest") @@ -1120,7 +1312,9 @@ var _BeaconService_serviceDesc = grpc.ServiceDesc{ // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type AttesterServiceClient interface { - AttestHead(ctx context.Context, in *AttestRequest, opts ...grpc.CallOption) (*AttestResponse, error) + AttestHead(ctx context.Context, in *v1.Attestation, opts ...grpc.CallOption) (*AttestResponse, error) + CrosslinkCommitteesAtSlot(ctx context.Context, in *CrosslinkCommitteeRequest, opts ...grpc.CallOption) (*CrosslinkCommitteeResponse, error) + AttestationInfoAtSlot(ctx context.Context, in *AttestationInfoRequest, opts ...grpc.CallOption) (*AttestationInfoResponse, error) } type attesterServiceClient struct { @@ -1131,7 +1325,7 @@ func NewAttesterServiceClient(cc *grpc.ClientConn) AttesterServiceClient { return &attesterServiceClient{cc} } -func (c *attesterServiceClient) AttestHead(ctx context.Context, in *AttestRequest, opts ...grpc.CallOption) (*AttestResponse, error) { +func (c *attesterServiceClient) AttestHead(ctx context.Context, in *v1.Attestation, opts ...grpc.CallOption) (*AttestResponse, error) { out := new(AttestResponse) err := c.cc.Invoke(ctx, "/ethereum.beacon.rpc.v1.AttesterService/AttestHead", in, out, opts...) if err != nil { @@ -1140,9 +1334,29 @@ func (c *attesterServiceClient) AttestHead(ctx context.Context, in *AttestReques return out, nil } +func (c *attesterServiceClient) CrosslinkCommitteesAtSlot(ctx context.Context, in *CrosslinkCommitteeRequest, opts ...grpc.CallOption) (*CrosslinkCommitteeResponse, error) { + out := new(CrosslinkCommitteeResponse) + err := c.cc.Invoke(ctx, "/ethereum.beacon.rpc.v1.AttesterService/CrosslinkCommitteesAtSlot", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *attesterServiceClient) AttestationInfoAtSlot(ctx context.Context, in *AttestationInfoRequest, opts ...grpc.CallOption) (*AttestationInfoResponse, error) { + out := new(AttestationInfoResponse) + err := c.cc.Invoke(ctx, "/ethereum.beacon.rpc.v1.AttesterService/AttestationInfoAtSlot", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // AttesterServiceServer is the server API for AttesterService service. type AttesterServiceServer interface { - AttestHead(context.Context, *AttestRequest) (*AttestResponse, error) + AttestHead(context.Context, *v1.Attestation) (*AttestResponse, error) + CrosslinkCommitteesAtSlot(context.Context, *CrosslinkCommitteeRequest) (*CrosslinkCommitteeResponse, error) + AttestationInfoAtSlot(context.Context, *AttestationInfoRequest) (*AttestationInfoResponse, error) } func RegisterAttesterServiceServer(s *grpc.Server, srv AttesterServiceServer) { @@ -1150,7 +1364,7 @@ func RegisterAttesterServiceServer(s *grpc.Server, srv AttesterServiceServer) { } func _AttesterService_AttestHead_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AttestRequest) + in := new(v1.Attestation) if err := dec(in); err != nil { return nil, err } @@ -1162,7 +1376,43 @@ func _AttesterService_AttestHead_Handler(srv interface{}, ctx context.Context, d FullMethod: "/ethereum.beacon.rpc.v1.AttesterService/AttestHead", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AttesterServiceServer).AttestHead(ctx, req.(*AttestRequest)) + return srv.(AttesterServiceServer).AttestHead(ctx, req.(*v1.Attestation)) + } + return interceptor(ctx, in, info, handler) +} + +func _AttesterService_CrosslinkCommitteesAtSlot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CrosslinkCommitteeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AttesterServiceServer).CrosslinkCommitteesAtSlot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.beacon.rpc.v1.AttesterService/CrosslinkCommitteesAtSlot", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AttesterServiceServer).CrosslinkCommitteesAtSlot(ctx, req.(*CrosslinkCommitteeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AttesterService_AttestationInfoAtSlot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AttestationInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AttesterServiceServer).AttestationInfoAtSlot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.beacon.rpc.v1.AttesterService/AttestationInfoAtSlot", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AttesterServiceServer).AttestationInfoAtSlot(ctx, req.(*AttestationInfoRequest)) } return interceptor(ctx, in, info, handler) } @@ -1175,6 +1425,14 @@ var _AttesterService_serviceDesc = grpc.ServiceDesc{ MethodName: "AttestHead", Handler: _AttesterService_AttestHead_Handler, }, + { + MethodName: "CrosslinkCommitteesAtSlot", + Handler: _AttesterService_CrosslinkCommitteesAtSlot_Handler, + }, + { + MethodName: "AttestationInfoAtSlot", + Handler: _AttesterService_AttestationInfoAtSlot_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/beacon/rpc/v1/services.proto", @@ -1407,6 +1665,156 @@ var _ValidatorService_serviceDesc = grpc.ServiceDesc{ Metadata: "proto/beacon/rpc/v1/services.proto", } +func (m *AttestationInfoRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AttestationInfoRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Slot != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintServices(dAtA, i, uint64(m.Slot)) + } + if m.Shard != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintServices(dAtA, i, uint64(m.Shard)) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *AttestationInfoResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AttestationInfoResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.BeaconBlockRootHash32) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintServices(dAtA, i, uint64(len(m.BeaconBlockRootHash32))) + i += copy(dAtA[i:], m.BeaconBlockRootHash32) + } + if len(m.EpochBoundaryRootHash32) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintServices(dAtA, i, uint64(len(m.EpochBoundaryRootHash32))) + i += copy(dAtA[i:], m.EpochBoundaryRootHash32) + } + if m.JustifiedEpoch != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintServices(dAtA, i, uint64(m.JustifiedEpoch)) + } + if len(m.JustifiedBlockRootHash32) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintServices(dAtA, i, uint64(len(m.JustifiedBlockRootHash32))) + i += copy(dAtA[i:], m.JustifiedBlockRootHash32) + } + if len(m.LatestCrosslinkRootHash32) > 0 { + dAtA[i] = 0x2a + i++ + i = encodeVarintServices(dAtA, i, uint64(len(m.LatestCrosslinkRootHash32))) + i += copy(dAtA[i:], m.LatestCrosslinkRootHash32) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *CrosslinkCommitteeRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CrosslinkCommitteeRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Slot != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintServices(dAtA, i, uint64(m.Slot)) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *CrosslinkCommitteeResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CrosslinkCommitteeResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Committee) > 0 { + dAtA2 := make([]byte, len(m.Committee)*10) + var j1 int + for _, num := range m.Committee { + for num >= 1<<7 { + dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA2[j1] = uint8(num) + j1++ + } + dAtA[i] = 0xa + i++ + i = encodeVarintServices(dAtA, i, uint64(j1)) + i += copy(dAtA[i:], dAtA2[:j1]) + } + if m.Shard != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintServices(dAtA, i, uint64(m.Shard)) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + func (m *ChainStartResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1482,31 +1890,31 @@ func (m *ProposeRequest) MarshalTo(dAtA []byte) (int, error) { i += copy(dAtA[i:], m.AttestationBitmask) } if len(m.AttestationAggregateSig) > 0 { - dAtA2 := make([]byte, len(m.AttestationAggregateSig)*10) - var j1 int + dAtA4 := make([]byte, len(m.AttestationAggregateSig)*10) + var j3 int for _, num := range m.AttestationAggregateSig { for num >= 1<<7 { - dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) + dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j1++ + j3++ } - dAtA2[j1] = uint8(num) - j1++ + dAtA4[j3] = uint8(num) + j3++ } dAtA[i] = 0x2a i++ - i = encodeVarintServices(dAtA, i, uint64(j1)) - i += copy(dAtA[i:], dAtA2[:j1]) + i = encodeVarintServices(dAtA, i, uint64(j3)) + i += copy(dAtA[i:], dAtA4[:j3]) } if m.Timestamp != nil { dAtA[i] = 0x32 i++ i = encodeVarintServices(dAtA, i, uint64(m.Timestamp.Size())) - n3, err := m.Timestamp.MarshalTo(dAtA[i:]) + n5, err := m.Timestamp.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n3 + i += n5 } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -1620,37 +2028,6 @@ func (m *StateRootResponse) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *AttestRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AttestRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Attestation != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintServices(dAtA, i, uint64(m.Attestation.Size())) - n4, err := m.Attestation.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - func (m *AttestResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1824,11 +2201,11 @@ func (m *ValidatorEpochAssignmentsResponse) MarshalTo(dAtA []byte) (int, error) dAtA[i] = 0x12 i++ i = encodeVarintServices(dAtA, i, uint64(m.Assignment.Size())) - n5, err := m.Assignment.MarshalTo(dAtA[i:]) + n6, err := m.Assignment.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n5 + i += n6 } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -1888,11 +2265,11 @@ func (m *Eth1DataResponse) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintServices(dAtA, i, uint64(m.Eth1Data.Size())) - n6, err := m.Eth1Data.MarshalTo(dAtA[i:]) + n7, err := m.Eth1Data.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n6 + i += n7 } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -1909,6 +2286,92 @@ func encodeVarintServices(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return offset + 1 } +func (m *AttestationInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Slot != 0 { + n += 1 + sovServices(uint64(m.Slot)) + } + if m.Shard != 0 { + n += 1 + sovServices(uint64(m.Shard)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *AttestationInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BeaconBlockRootHash32) + if l > 0 { + n += 1 + l + sovServices(uint64(l)) + } + l = len(m.EpochBoundaryRootHash32) + if l > 0 { + n += 1 + l + sovServices(uint64(l)) + } + if m.JustifiedEpoch != 0 { + n += 1 + sovServices(uint64(m.JustifiedEpoch)) + } + l = len(m.JustifiedBlockRootHash32) + if l > 0 { + n += 1 + l + sovServices(uint64(l)) + } + l = len(m.LatestCrosslinkRootHash32) + if l > 0 { + n += 1 + l + sovServices(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *CrosslinkCommitteeRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Slot != 0 { + n += 1 + sovServices(uint64(m.Slot)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *CrosslinkCommitteeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Committee) > 0 { + l = 0 + for _, e := range m.Committee { + l += sovServices(uint64(e)) + } + n += 1 + sovServices(uint64(l)) + l + } + if m.Shard != 0 { + n += 1 + sovServices(uint64(m.Shard)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func (m *ChainStartResponse) Size() (n int) { if m == nil { return 0 @@ -2027,22 +2490,6 @@ func (m *StateRootResponse) Size() (n int) { return n } -func (m *AttestRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Attestation != nil { - l = m.Attestation.Size() - n += 1 + l + sovServices(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - func (m *AttestResponse) Size() (n int) { if m == nil { return 0 @@ -2197,6 +2644,502 @@ func sovServices(x uint64) (n int) { func sozServices(x uint64) (n int) { return sovServices(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *AttestationInfoRequest) 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 ErrIntOverflowServices + } + 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: AttestationInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AttestationInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType) + } + m.Slot = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Slot |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) + } + m.Shard = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Shard |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipServices(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthServices + } + 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 (m *AttestationInfoResponse) 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 ErrIntOverflowServices + } + 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: AttestationInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AttestationInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BeaconBlockRootHash32", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthServices + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BeaconBlockRootHash32 = append(m.BeaconBlockRootHash32[:0], dAtA[iNdEx:postIndex]...) + if m.BeaconBlockRootHash32 == nil { + m.BeaconBlockRootHash32 = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochBoundaryRootHash32", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthServices + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EpochBoundaryRootHash32 = append(m.EpochBoundaryRootHash32[:0], dAtA[iNdEx:postIndex]...) + if m.EpochBoundaryRootHash32 == nil { + m.EpochBoundaryRootHash32 = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JustifiedEpoch", wireType) + } + m.JustifiedEpoch = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.JustifiedEpoch |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field JustifiedBlockRootHash32", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthServices + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.JustifiedBlockRootHash32 = append(m.JustifiedBlockRootHash32[:0], dAtA[iNdEx:postIndex]...) + if m.JustifiedBlockRootHash32 == nil { + m.JustifiedBlockRootHash32 = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestCrosslinkRootHash32", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthServices + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LatestCrosslinkRootHash32 = append(m.LatestCrosslinkRootHash32[:0], dAtA[iNdEx:postIndex]...) + if m.LatestCrosslinkRootHash32 == nil { + m.LatestCrosslinkRootHash32 = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipServices(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthServices + } + 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 (m *CrosslinkCommitteeRequest) 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 ErrIntOverflowServices + } + 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: CrosslinkCommitteeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CrosslinkCommitteeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType) + } + m.Slot = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Slot |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipServices(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthServices + } + 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 (m *CrosslinkCommitteeResponse) 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 ErrIntOverflowServices + } + 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: CrosslinkCommitteeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CrosslinkCommitteeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Committee = append(m.Committee, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthServices + } + postIndex := iNdEx + packedLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.Committee) == 0 { + m.Committee = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Committee = append(m.Committee, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Committee", wireType) + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) + } + m.Shard = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Shard |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipServices(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthServices + } + 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 (m *ChainStartResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2860,90 +3803,6 @@ func (m *StateRootResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AttestRequest) 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 ErrIntOverflowServices - } - 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: AttestRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AttestRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attestation", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowServices - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthServices - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Attestation == nil { - m.Attestation = &v1.Attestation{} - } - if err := m.Attestation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipServices(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthServices - } - 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 (m *AttestResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3774,73 +4633,84 @@ var ( ) func init() { - proto.RegisterFile("proto/beacon/rpc/v1/services.proto", fileDescriptor_services_fe42b90f12b872ee) + proto.RegisterFile("proto/beacon/rpc/v1/services.proto", fileDescriptor_services_ad7fec92be597562) } -var fileDescriptor_services_fe42b90f12b872ee = []byte{ - // 1021 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xdd, 0x72, 0xdb, 0x44, - 0x14, 0x46, 0x4e, 0xda, 0x26, 0xc7, 0x76, 0xe2, 0x2c, 0x69, 0xea, 0x9a, 0x21, 0x71, 0xd5, 0x01, - 0xdc, 0x0e, 0x95, 0x13, 0x75, 0x06, 0x02, 0x0c, 0x17, 0x4e, 0x6a, 0x26, 0xd0, 0x4c, 0x92, 0xca, - 0xa1, 0x1d, 0x7e, 0x66, 0x34, 0x6b, 0xfb, 0x20, 0x6b, 0x22, 0x6b, 0x17, 0xed, 0x3a, 0x43, 0x9e, - 0x81, 0x1b, 0xae, 0x78, 0x09, 0xee, 0xb9, 0xe7, 0x8e, 0x4b, 0x1e, 0x81, 0xc9, 0x93, 0x30, 0x5a, - 0xad, 0x14, 0xd9, 0x89, 0x92, 0xd0, 0x3b, 0xe9, 0x9c, 0xef, 0xfb, 0xf6, 0xec, 0xb7, 0x67, 0xcf, - 0x82, 0xc9, 0x23, 0x26, 0x59, 0xbb, 0x8f, 0x74, 0xc0, 0xc2, 0x76, 0xc4, 0x07, 0xed, 0xd3, 0xad, - 0xb6, 0xc0, 0xe8, 0xd4, 0x1f, 0xa0, 0xb0, 0x54, 0x92, 0xac, 0xa1, 0x1c, 0x61, 0x84, 0x93, 0xb1, - 0x95, 0xc0, 0xac, 0x88, 0x0f, 0xac, 0xd3, 0xad, 0xc6, 0xc6, 0x14, 0x97, 0xdb, 0x3c, 0xe6, 0xca, - 0x33, 0x9e, 0x12, 0x1b, 0xef, 0x79, 0x8c, 0x79, 0x01, 0xb6, 0xd5, 0x5f, 0x7f, 0xf2, 0x53, 0x1b, - 0xc7, 0x5c, 0x9e, 0xe9, 0xe4, 0xc6, 0x6c, 0x52, 0xfa, 0x63, 0x14, 0x92, 0x8e, 0x79, 0x02, 0x30, - 0x5f, 0x01, 0xd9, 0x1d, 0x51, 0x3f, 0xec, 0x49, 0x1a, 0x49, 0x07, 0x05, 0x67, 0xa1, 0x40, 0x52, - 0x87, 0x7b, 0x22, 0x0e, 0xe0, 0xb0, 0x6e, 0x34, 0x8d, 0xd6, 0x82, 0x93, 0xfe, 0x92, 0x47, 0x50, - 0xf1, 0x30, 0x44, 0xe1, 0x0b, 0x37, 0x96, 0xaa, 0x97, 0x9a, 0x46, 0x6b, 0xde, 0x29, 0xeb, 0xd8, - 0xb1, 0x3f, 0x46, 0xf3, 0x8f, 0x12, 0x2c, 0x1d, 0x45, 0x8c, 0x33, 0x81, 0x0e, 0xfe, 0x3c, 0x41, - 0x21, 0xc9, 0x06, 0x94, 0x39, 0x8d, 0x30, 0x94, 0xee, 0x88, 0x8a, 0x91, 0xd2, 0xac, 0x38, 0x90, - 0x84, 0xf6, 0xa8, 0x18, 0xc5, 0x00, 0x11, 0x30, 0xe9, 0x86, 0x93, 0x71, 0x1f, 0x23, 0xad, 0x0a, - 0x71, 0xe8, 0x40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 0xfe, 0x5d, 0x75, 0x29, 0x9e, 0xff, - 0x17, 0x00, 0x00, 0xff, 0xff, 0x30, 0xf2, 0x42, 0x88, 0xd2, 0x0a, 0x00, 0x00, +var fileDescriptor_services_ad7fec92be597562 = []byte{ + // 1200 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x6e, 0xdb, 0x46, + 0x10, 0x2e, 0x65, 0x3b, 0xb1, 0x47, 0x92, 0x25, 0x6f, 0xfd, 0x23, 0x33, 0xa9, 0xed, 0xd0, 0x40, + 0xe3, 0x04, 0x0d, 0x65, 0x33, 0x40, 0xe3, 0x36, 0x08, 0x0a, 0xc9, 0x51, 0x91, 0x34, 0x86, 0xed, + 0x50, 0x6e, 0x83, 0x16, 0x05, 0x88, 0x95, 0xb4, 0x96, 0x58, 0x4b, 0x5c, 0x96, 0xbb, 0x32, 0xe2, + 0x6b, 0xaf, 0xbd, 0xf4, 0xd4, 0x97, 0xe8, 0xbd, 0xe8, 0xb5, 0xb7, 0x1e, 0xfb, 0x08, 0x85, 0xaf, + 0x7d, 0x89, 0x82, 0xbb, 0x4b, 0x8a, 0xa2, 0x44, 0xc7, 0xe9, 0x8d, 0x3b, 0x3f, 0xdf, 0xcc, 0x7c, + 0x3b, 0x3b, 0x43, 0x30, 0xfc, 0x80, 0x72, 0x5a, 0x6d, 0x11, 0xdc, 0xa6, 0x5e, 0x35, 0xf0, 0xdb, + 0xd5, 0x8b, 0xbd, 0x2a, 0x23, 0xc1, 0x85, 0xdb, 0x26, 0xcc, 0x14, 0x4a, 0xb4, 0x4a, 0x78, 0x8f, + 0x04, 0x64, 0x38, 0x30, 0xa5, 0x99, 0x19, 0xf8, 0x6d, 0xf3, 0x62, 0x4f, 0xdf, 0x1c, 0xf3, 0xf5, + 0x2d, 0x3f, 0xf4, 0xe5, 0x97, 0x7e, 0xe4, 0xa8, 0xdf, 0xe9, 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3, 0xc5, 0x6c, 0xf7, + 0xa1, 0x38, 0xb6, 0x91, 0xd0, 0x27, 0x99, 0x1d, 0x31, 0x65, 0xe3, 0xe9, 0x8f, 0x6e, 0x68, 0xad, + 0x6a, 0xff, 0x1e, 0x0a, 0x4a, 0x21, 0xbb, 0xff, 0x26, 0x4f, 0x44, 0xbf, 0xff, 0x8e, 0x18, 0x31, + 0x7a, 0x0b, 0xca, 0x07, 0x74, 0xe0, 0x0f, 0x39, 0x89, 0xb7, 0xe6, 0xcd, 0x22, 0x3c, 0xc8, 0x8a, + 0x30, 0xb1, 0x7d, 0xad, 0x5f, 0x73, 0x50, 0x8e, 0xa7, 0x54, 0x44, 0x22, 0x85, 0xc5, 0xf1, 0x85, + 0x83, 0x32, 0x79, 0x99, 0xba, 0xd0, 0x74, 0xf3, 0xa6, 0xe6, 0xaa, 0xd2, 0x5f, 0x34, 0x58, 0xcf, + 0x5c, 0x27, 0x68, 0xff, 0x9d, 0x68, 0x19, 0x5b, 0x4e, 0xff, 0xec, 0x7f, 0x78, 0xca, 0x94, 0xea, + 0x85, 0xbf, 0xae, 0x36, 0xb4, 0xbf, 0xaf, 0x36, 0xb4, 0x7f, 0xae, 0x36, 0xb4, 0xd6, 0x2d, 0x31, + 0x12, 0x1e, 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0xca, 0x4d, 0x34, 0xf9, 0x7a, 0x0d, 0x00, 0x00, } diff --git a/proto/beacon/rpc/v1/services.proto b/proto/beacon/rpc/v1/services.proto index 0a34f3fe01..4e437c4da0 100644 --- a/proto/beacon/rpc/v1/services.proto +++ b/proto/beacon/rpc/v1/services.proto @@ -17,7 +17,9 @@ service BeaconService { } service AttesterService { - rpc AttestHead(AttestRequest) returns (AttestResponse); + rpc AttestHead(ethereum.beacon.p2p.v1.Attestation) returns (AttestResponse); + rpc CrosslinkCommitteesAtSlot(CrosslinkCommitteeRequest) returns (CrosslinkCommitteeResponse); + rpc AttestationInfoAtSlot(AttestationInfoRequest) returns (AttestationInfoResponse); } service ProposerService { @@ -31,6 +33,28 @@ service ValidatorService { rpc ValidatorEpochAssignments(ValidatorEpochAssignmentsRequest) returns (ValidatorEpochAssignmentsResponse); } +message AttestationInfoRequest { + uint64 slot = 1; + uint64 shard = 2; +} + +message AttestationInfoResponse { + bytes beacon_block_root_hash32 = 1; + bytes epoch_boundary_root_hash32 = 2; + uint64 justified_epoch = 3; + bytes justified_block_root_hash32 = 4; + bytes latest_crosslink_root_hash32 = 5; +} + +message CrosslinkCommitteeRequest { + uint64 slot = 1; +} + +message CrosslinkCommitteeResponse { + repeated uint64 committee = 1; + uint64 shard = 2; +} + message ChainStartResponse { bool started = 1; uint64 genesis_time = 2; @@ -61,10 +85,6 @@ message StateRootResponse { bytes state_root = 1; } -message AttestRequest { - ethereum.beacon.p2p.v1.Attestation attestation = 1; -} - message AttestResponse { bytes attestation_hash = 1; } @@ -92,18 +112,19 @@ message ValidatorIndexResponse { } message ValidatorEpochAssignmentsRequest { - uint64 epoch_start = 1; - bytes public_key = 2; + uint64 epoch_start = 1; + bytes public_key = 2; } message ValidatorEpochAssignmentsResponse { - Assignment assignment = 2; + Assignment assignment = 2; } message PendingDepositsResponse { - repeated ethereum.beacon.p2p.v1.Deposit pending_deposits = 1; + repeated ethereum.beacon.p2p.v1.Deposit pending_deposits = 1; } message Eth1DataResponse { - ethereum.beacon.p2p.v1.Eth1Data eth1_data = 1; + ethereum.beacon.p2p.v1.Eth1Data eth1_data = 1; } + diff --git a/shared/p2p/adapter/metric/metric_test.go b/shared/p2p/adapter/metric/metric_test.go index 348141af83..622f4aad2f 100644 --- a/shared/p2p/adapter/metric/metric_test.go +++ b/shared/p2p/adapter/metric/metric_test.go @@ -26,7 +26,7 @@ func TestMessageMetrics(t *testing.T) { t.Error("Expected metric adapter") } data := &pb.Attestation{ - ParticipationBitfield: []byte{99}, + AggregationBitfield: []byte{99}, Data: &pb.AttestationData{ Slot: 0, }, diff --git a/shared/p2p/dial_relay_node.go b/shared/p2p/dial_relay_node.go index 9f8f1744fe..19f02d3474 100644 --- a/shared/p2p/dial_relay_node.go +++ b/shared/p2p/dial_relay_node.go @@ -3,8 +3,8 @@ package p2p import ( "context" - "github.com/libp2p/go-libp2p-host" - "github.com/libp2p/go-libp2p-peerstore" + host "github.com/libp2p/go-libp2p-host" + peerstore "github.com/libp2p/go-libp2p-peerstore" "github.com/multiformats/go-multiaddr" "go.opencensus.io/trace" ) diff --git a/shared/p2p/discovery.go b/shared/p2p/discovery.go index 24b9167a7e..4662c9ffbd 100644 --- a/shared/p2p/discovery.go +++ b/shared/p2p/discovery.go @@ -5,7 +5,7 @@ import ( "time" iaddr "github.com/ipfs/go-ipfs-addr" - "github.com/libp2p/go-libp2p-host" + host "github.com/libp2p/go-libp2p-host" ps "github.com/libp2p/go-libp2p-peerstore" mdns "github.com/libp2p/go-libp2p/p2p/discovery" "github.com/sirupsen/logrus" diff --git a/shared/p2p/monitoring.go b/shared/p2p/monitoring.go index 9176c16aec..4a85232013 100644 --- a/shared/p2p/monitoring.go +++ b/shared/p2p/monitoring.go @@ -4,7 +4,7 @@ import ( "context" "time" - "github.com/libp2p/go-libp2p-host" + host "github.com/libp2p/go-libp2p-host" "github.com/prometheus/client_golang/prometheus" ) diff --git a/tools/bootnode-query/main.go b/tools/bootnode-query/main.go index 41561cfe06..c1ac25ae79 100644 --- a/tools/bootnode-query/main.go +++ b/tools/bootnode-query/main.go @@ -13,10 +13,10 @@ import ( ggio "github.com/gogo/protobuf/io" "github.com/libp2p/go-libp2p" - "github.com/libp2p/go-libp2p-host" + host "github.com/libp2p/go-libp2p-host" dhtopts "github.com/libp2p/go-libp2p-kad-dht/opts" dhtpb "github.com/libp2p/go-libp2p-kad-dht/pb" - "github.com/libp2p/go-libp2p-net" + net "github.com/libp2p/go-libp2p-net" "github.com/prysmaticlabs/prysm/shared/p2p" ) diff --git a/validator/attester/BUILD.bazel b/validator/attester/BUILD.bazel deleted file mode 100644 index 951d393e35..0000000000 --- a/validator/attester/BUILD.bazel +++ /dev/null @@ -1,35 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = ["service.go"], - importpath = "github.com/prysmaticlabs/prysm/validator/attester", - visibility = ["//validator:__subpackages__"], - deps = [ - "//proto/beacon/p2p/v1:go_default_library", - "//proto/beacon/rpc/v1:go_default_library", - "//shared/bitutil:go_default_library", - "//shared/event:go_default_library", - "//shared/hashutil:go_default_library", - "@com_github_gogo_protobuf//proto:go_default_library", - "@com_github_sirupsen_logrus//:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["service_test.go"], - embed = [":go_default_library"], - deps = [ - "//proto/beacon/p2p/v1:go_default_library", #keep - "//proto/beacon/rpc/v1:go_default_library", - "//shared/event:go_default_library", - "//shared/testutil:go_default_library", - "//validator/internal:go_default_library", - "@com_github_golang_mock//gomock:go_default_library", #keep - "@com_github_sirupsen_logrus//:go_default_library", - "@com_github_sirupsen_logrus//hooks/test:go_default_library", - "@org_golang_google_grpc//:go_default_library", #keep - "@org_golang_google_grpc//metadata:go_default_library", #keep - ], -) diff --git a/validator/attester/service.go b/validator/attester/service.go deleted file mode 100644 index 3c28b9cb6b..0000000000 --- a/validator/attester/service.go +++ /dev/null @@ -1,151 +0,0 @@ -// Package attester defines all relevant functionality for a Attester actor -// within Ethereum Serenity. -package attester - -import ( - "context" - - "github.com/gogo/protobuf/proto" - pbp2p "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" - pb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" - "github.com/prysmaticlabs/prysm/shared/bitutil" - "github.com/prysmaticlabs/prysm/shared/event" - "github.com/prysmaticlabs/prysm/shared/hashutil" - "github.com/sirupsen/logrus" -) - -var log = logrus.WithField("prefix", "attester") - -type rpcClientService interface { - AttesterServiceClient() pb.AttesterServiceClient - ValidatorServiceClient() pb.ValidatorServiceClient -} - -type beaconClientService interface { - AttesterAssignmentFeed() *event.Feed -} - -// Attester holds functionality required to run a block attester -// in Ethereum Serenity. -type Attester struct { - ctx context.Context - cancel context.CancelFunc - beaconService beaconClientService - rpcClientService rpcClientService - assignmentChan chan *pbp2p.BeaconBlock - shardID uint64 - publicKey []byte -} - -// Config options for an attester service. -type Config struct { - AssignmentBuf int - ShardID uint64 - Assigner beaconClientService - Client rpcClientService - PublicKey []byte -} - -// NewAttester creates a new attester instance. -func NewAttester(ctx context.Context, cfg *Config) *Attester { - ctx, cancel := context.WithCancel(ctx) - return &Attester{ - ctx: ctx, - cancel: cancel, - beaconService: cfg.Assigner, - rpcClientService: cfg.Client, - shardID: cfg.ShardID, - publicKey: cfg.PublicKey, - assignmentChan: make(chan *pbp2p.BeaconBlock, cfg.AssignmentBuf), - } -} - -// Start the main routine for an attester. -func (a *Attester) Start() { - log.Info("Starting service") - attester := a.rpcClientService.AttesterServiceClient() - validator := a.rpcClientService.ValidatorServiceClient() - go a.run(attester, validator) -} - -// Stop the main loop. -func (a *Attester) Stop() error { - defer a.cancel() - log.Info("Stopping service") - return nil -} - -// Status always returns nil. -// This service will be rewritten in the future so this service check is a -// no-op for now. -func (a *Attester) Status() error { - return nil -} - -// run the main event loop that listens for an attester assignment. -func (a *Attester) run(attester pb.AttesterServiceClient, validator pb.ValidatorServiceClient) { - sub := a.beaconService.AttesterAssignmentFeed().Subscribe(a.assignmentChan) - defer sub.Unsubscribe() - - for { - select { - case <-a.ctx.Done(): - log.Debug("Attester context closed, exiting goroutine") - return - case latestBeaconBlock := <-a.assignmentChan: - log.Info("Performing attester responsibility") - - if latestBeaconBlock == nil { - log.Errorf("could not marshal nil latest beacon block") - continue - } - data, err := proto.Marshal(latestBeaconBlock) - if err != nil { - log.Errorf("could not marshal latest beacon block: %v", err) - continue - } - latestBlockHash := hashutil.Hash(data) - - req := &pb.ValidatorEpochAssignmentsRequest{ - EpochStart: 0, - PublicKey: a.publicKey, - } - res, err := validator.ValidatorEpochAssignments(a.ctx, req) - if err != nil { - log.Errorf("could not get attester Shard ID: %v", err) - continue - } - - a.shardID = res.Assignment.Shard - - indexReq := &pb.ValidatorIndexRequest{ - PublicKey: a.publicKey, - } - attesterIndex, err := validator.ValidatorIndex(a.ctx, indexReq) - if err != nil { - log.Errorf("could not get attester index: %v", err) - continue - } - attesterBitfield := bitutil.SetBitfield(int(attesterIndex.Index)) - - attestReq := &pb.AttestRequest{ - Attestation: &pbp2p.Attestation{ - ParticipationBitfield: attesterBitfield, - AggregateSignature: []byte{}, // TODO(258): Need Signature verification scheme/library - Data: &pbp2p.AttestationData{ - Slot: latestBeaconBlock.Slot, - Shard: a.shardID, - ShardBlockRootHash32: latestBlockHash[:], - }, - }, - } - - attRes, err := attester.AttestHead(a.ctx, attestReq) - if err != nil { - log.Errorf("could not attest head: %v", err) - continue - } - log.Infof("Attestation proposed successfully with hash %#x", attRes.AttestationHash) - } - } -} diff --git a/validator/attester/service_test.go b/validator/attester/service_test.go deleted file mode 100644 index a62157ba01..0000000000 --- a/validator/attester/service_test.go +++ /dev/null @@ -1,264 +0,0 @@ -package attester - -import ( - "context" - "errors" - "io/ioutil" - "testing" - - "github.com/golang/mock/gomock" - pbp2p "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" - pb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" - "github.com/prysmaticlabs/prysm/shared/event" - "github.com/prysmaticlabs/prysm/shared/testutil" - "github.com/prysmaticlabs/prysm/validator/internal" - "github.com/sirupsen/logrus" - logTest "github.com/sirupsen/logrus/hooks/test" -) - -func init() { - logrus.SetLevel(logrus.DebugLevel) - logrus.SetOutput(ioutil.Discard) -} - -type mockClient struct { - ctrl *gomock.Controller -} - -func (mc *mockClient) AttesterServiceClient() pb.AttesterServiceClient { - return internal.NewMockAttesterServiceClient(mc.ctrl) -} - -func (mc *mockClient) ValidatorServiceClient() pb.ValidatorServiceClient { - return internal.NewMockValidatorServiceClient(mc.ctrl) -} - -type mockAssigner struct{} - -func (m *mockAssigner) AttesterAssignmentFeed() *event.Feed { - return new(event.Feed) -} - -func (m *mockAssigner) PublicKey() []byte { - return []byte{} -} - -func TestLifecycle(t *testing.T) { - hook := logTest.NewGlobal() - ctrl := gomock.NewController(t) - defer ctrl.Finish() - cfg := &Config{ - AssignmentBuf: 0, - Assigner: &mockAssigner{}, - Client: &mockClient{ctrl}, - } - att := NewAttester(context.Background(), cfg) - att.Start() - att.Stop() - - testutil.AssertLogsContain(t, hook, "Starting service") - testutil.AssertLogsContain(t, hook, "Stopping service") -} - -func TestAttesterLoop(t *testing.T) { - hook := logTest.NewGlobal() - ctrl := gomock.NewController(t) - defer ctrl.Finish() - cfg := &Config{ - AssignmentBuf: 0, - Assigner: &mockAssigner{}, - Client: &mockClient{ctrl}, - } - att := NewAttester(context.Background(), cfg) - - mockServiceValidator := internal.NewMockValidatorServiceClient(ctrl) - mockServiceValidator.EXPECT().ValidatorEpochAssignments( - gomock.Any(), - gomock.Any(), - ).Return(&pb.ValidatorEpochAssignmentsResponse{ - Assignment: &pb.Assignment{ - Shard: 100, - }, - }, nil) - mockServiceValidator.EXPECT().ValidatorIndex( - gomock.Any(), - gomock.Any(), - ).Return(&pb.ValidatorIndexResponse{ - Index: 0, - }, nil) - - mockServiceAttester := internal.NewMockAttesterServiceClient(ctrl) - mockServiceAttester.EXPECT().AttestHead( - gomock.Any(), - gomock.Any(), - ).Return(&pb.AttestResponse{ - AttestationHash: []byte{'A'}, - }, nil) - - exitRoutine := make(chan bool) - go func() { - att.run(mockServiceAttester, mockServiceValidator) - <-exitRoutine - }() - att.assignmentChan <- &pbp2p.BeaconBlock{Slot: 33} - att.cancel() - exitRoutine <- true - - testutil.AssertLogsContain(t, hook, "Performing attester responsibility") - testutil.AssertLogsContain(t, hook, "Attester context closed") -} - -func TestAttesterMarshalError(t *testing.T) { - hook := logTest.NewGlobal() - ctrl := gomock.NewController(t) - defer ctrl.Finish() - ctx := context.Background() - cfg := &Config{ - AssignmentBuf: 0, - Assigner: &mockAssigner{}, - Client: &mockClient{ctrl}, - } - att := NewAttester(ctx, cfg) - - mockServiceAttester := internal.NewMockAttesterServiceClient(ctrl) - - mockServiceValidator := internal.NewMockValidatorServiceClient(ctrl) - - exitRoutine := make(chan bool) - go func() { - att.run(mockServiceAttester, mockServiceValidator) - <-exitRoutine - }() - - att.assignmentChan <- nil - att.cancel() - exitRoutine <- true - - testutil.AssertLogsContain(t, hook, "could not marshal nil latest beacon block") - testutil.AssertLogsContain(t, hook, "Attester context closed") -} - -func TestAttesterErrorCantAttestHead(t *testing.T) { - hook := logTest.NewGlobal() - ctrl := gomock.NewController(t) - defer ctrl.Finish() - cfg := &Config{ - AssignmentBuf: 0, - Assigner: &mockAssigner{}, - Client: &mockClient{ctrl}, - } - att := NewAttester(context.Background(), cfg) - - mockServiceValidator := internal.NewMockValidatorServiceClient(ctrl) - mockServiceValidator.EXPECT().ValidatorEpochAssignments( - gomock.Any(), - gomock.Any(), - ).Return(&pb.ValidatorEpochAssignmentsResponse{ - Assignment: &pb.Assignment{ - Shard: 100, - }, - }, nil) - mockServiceValidator.EXPECT().ValidatorIndex( - gomock.Any(), - gomock.Any(), - ).Return(&pb.ValidatorIndexResponse{ - Index: 0, - }, nil) - - mockServiceAttester := internal.NewMockAttesterServiceClient(ctrl) - // Expect call to throw an error. - mockServiceAttester.EXPECT().AttestHead( - gomock.Any(), - gomock.Any(), - ).Return(nil, errors.New("could not attest head")) - - exitRoutine := make(chan bool) - go func() { - att.run(mockServiceAttester, mockServiceValidator) - <-exitRoutine - }() - - att.assignmentChan <- &pbp2p.BeaconBlock{Slot: 999} - att.cancel() - exitRoutine <- true - - testutil.AssertLogsContain(t, hook, "Performing attester responsibility") - testutil.AssertLogsContain(t, hook, "could not attest head") - testutil.AssertLogsContain(t, hook, "Attester context closed") -} - -func TestAttesterErrorCantGetShardID(t *testing.T) { - hook := logTest.NewGlobal() - ctrl := gomock.NewController(t) - defer ctrl.Finish() - cfg := &Config{ - AssignmentBuf: 0, - Assigner: &mockAssigner{}, - Client: &mockClient{ctrl}, - } - att := NewAttester(context.Background(), cfg) - - mockServiceValidator := internal.NewMockValidatorServiceClient(ctrl) - mockServiceValidator.EXPECT().ValidatorEpochAssignments( - gomock.Any(), - gomock.Any(), - ).Return(nil, errors.New("could not get attester Shard ID")) - - mockServiceAttester := internal.NewMockAttesterServiceClient(ctrl) - - exitRoutine := make(chan bool) - go func() { - att.run(mockServiceAttester, mockServiceValidator) - <-exitRoutine - }() - - att.assignmentChan <- &pbp2p.BeaconBlock{Slot: 999} - att.cancel() - exitRoutine <- true - - testutil.AssertLogsContain(t, hook, "Performing attester responsibility") - testutil.AssertLogsContain(t, hook, "could not get attester Shard ID") - testutil.AssertLogsContain(t, hook, "Attester context closed") -} - -func TestAttesterErrorCantGetAttesterIndex(t *testing.T) { - hook := logTest.NewGlobal() - ctrl := gomock.NewController(t) - defer ctrl.Finish() - cfg := &Config{ - AssignmentBuf: 0, - Assigner: &mockAssigner{}, - Client: &mockClient{ctrl}, - } - att := NewAttester(context.Background(), cfg) - - mockServiceValidator := internal.NewMockValidatorServiceClient(ctrl) - mockServiceValidator.EXPECT().ValidatorEpochAssignments( - gomock.Any(), - gomock.Any(), - ).Return(&pb.ValidatorEpochAssignmentsResponse{ - Assignment: &pb.Assignment{ - Shard: 100, - }, - }, nil) - mockServiceValidator.EXPECT().ValidatorIndex( - gomock.Any(), - gomock.Any(), - ).Return(nil, errors.New("could not get attester index")) - - mockServiceAttester := internal.NewMockAttesterServiceClient(ctrl) - - exitRoutine := make(chan bool) - go func() { - att.run(mockServiceAttester, mockServiceValidator) - <-exitRoutine - }() - - att.assignmentChan <- &pbp2p.BeaconBlock{Slot: 999} - att.cancel() - exitRoutine <- true - - testutil.AssertLogsContain(t, hook, "Performing attester responsibility") - testutil.AssertLogsContain(t, hook, "could not get attester index") - testutil.AssertLogsContain(t, hook, "Attester context closed") -} diff --git a/validator/client/BUILD.bazel b/validator/client/BUILD.bazel index 87d72cbf12..5f20b5c555 100644 --- a/validator/client/BUILD.bazel +++ b/validator/client/BUILD.bazel @@ -6,6 +6,7 @@ go_library( "runner.go", "service.go", "validator.go", + "validator_attest.go", "validator_propose.go", ], importpath = "github.com/prysmaticlabs/prysm/validator/client", @@ -31,6 +32,7 @@ go_test( "fake_validator_test.go", "runner_test.go", "service_test.go", + "validator_attest_test.go", "validator_propose_test.go", "validator_test.go", ], @@ -42,6 +44,7 @@ go_test( "//shared/params:go_default_library", "//shared/testutil:go_default_library", "//validator/internal:go_default_library", + "@com_github_gogo_protobuf//proto:go_default_library", "@com_github_gogo_protobuf//types:go_default_library", "@com_github_golang_mock//gomock:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", diff --git a/validator/client/service.go b/validator/client/service.go index 865200d7ef..1fbde5c167 100644 --- a/validator/client/service.go +++ b/validator/client/service.go @@ -67,6 +67,7 @@ func (v *ValidatorService) Start() { v.validator = &validator{ beaconClient: pb.NewBeaconServiceClient(v.conn), validatorClient: pb.NewValidatorServiceClient(v.conn), + attesterClient: pb.NewAttesterServiceClient(v.conn), } go run(v.ctx, v.validator) } diff --git a/validator/client/validator.go b/validator/client/validator.go index 65f30957d5..271b8bd029 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -32,6 +32,7 @@ type validator struct { proposerClient pb.ProposerServiceClient validatorClient pb.ValidatorServiceClient beaconClient pb.BeaconServiceClient + attesterClient pb.AttesterServiceClient pubKey []byte attestationPool AttestationPool } @@ -137,11 +138,3 @@ func (v *validator) RoleAt(slot uint64) pb.ValidatorRole { } return pb.ValidatorRole_UNKNOWN } - -// AttestToBlockHead -// -// WIP - not done. -func (v *validator) AttestToBlockHead(ctx context.Context, slot uint64) { - span, ctx := opentracing.StartSpanFromContext(ctx, "validator.AttestToBlockHead") - defer span.Finish() -} diff --git a/validator/client/validator_attest.go b/validator/client/validator_attest.go new file mode 100644 index 0000000000..ecd1743544 --- /dev/null +++ b/validator/client/validator_attest.go @@ -0,0 +1,121 @@ +package client + +import ( + "context" + + "fmt" + + "github.com/prysmaticlabs/prysm/shared/params" + + "github.com/opentracing/opentracing-go" + pbp2p "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" + pb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" +) + +// AttestToBlockHead completes the validator client's attester responsibility at a given slot. +// It fetches the latest beacon block head along with the latest canonical beacon state +// information in order to sign the block and include information about the validator's +// participation in voting on the block. +func (v *validator) AttestToBlockHead(ctx context.Context, slot uint64) { + span, ctx := opentracing.StartSpanFromContext(ctx, "validator.AttestToBlockHead") + defer span.Finish() + // First the validator should construct attestation_data, an AttestationData + // object based upon the state at the assigned slot. + attData := &pbp2p.AttestationData{ + Slot: slot, + ShardBlockRootHash32: params.BeaconConfig().ZeroHash[:], // Stub for Phase 0. + } + req := &pb.CrosslinkCommitteeRequest{ + Slot: slot, + } + resp, err := v.attesterClient.CrosslinkCommitteesAtSlot(ctx, req) + if err != nil { + log.Errorf("Could not fetch crosslink committees at slot %d: %v", slot, err) + return + } + if len(resp.Committee) == 0 { + log.Error("Received an empty committee assignment") + return + } + // Set the attestation data's shard as the shard associated with the validator's + // committee as retrieved by CrosslinkCommitteesAtSlot. + attData.Shard = resp.Shard + + // Fetch other necessary information from the beacon node in order to attest + // including the justified epoch, epoch boundary information, and more. + infoReq := &pb.AttestationInfoRequest{ + Slot: slot, + Shard: resp.Shard, + } + infoRes, err := v.attesterClient.AttestationInfoAtSlot(ctx, infoReq) + if err != nil { + log.Errorf("Could not fetch necessary info to produce attestation at slot %d: %v", slot, err) + return + } + // Set the attestation data's beacon block root = hash_tree_root(head) where head + // is the validator's view of the head block of the beacon chain during the slot. + attData.BeaconBlockRootHash32 = infoRes.BeaconBlockRootHash32 + // Set the attestation data's epoch boundary root = hash_tree_root(epoch_boundary) + // where epoch_boundary is the block at the most recent epoch boundary in the + // chain defined by head -- i.e. the BeaconBlock where block.slot == get_epoch_start_slot(head.slot). + // On the server side, this is fetched by calling get_block_root(state, get_epoch_start_slot(head.slot)). + attData.EpochBoundaryRootHash32 = infoRes.EpochBoundaryRootHash32 + // Set the attestation data's latest crosslink root = state.latest_crosslinks[shard].shard_block_root + // where state is the beacon state at head and shard is the validator's assigned shard. + attData.LatestCrosslinkRootHash32 = infoRes.LatestCrosslinkRootHash32 + // Set the attestation data's justified epoch = state.justified_epoch where state + // is the beacon state at the head. + attData.JustifiedEpoch = infoRes.JustifiedEpoch + // Set the attestation data's justified block root = hash_tree_root(justified_block) where + // justified_block is the block at state.justified_epoch in the chain defined by head. + // On the server side, this is fetched by calling get_block_root(state, justified_epoch). + attData.JustifiedBlockRootHash32 = infoRes.JustifiedBlockRootHash32 + + // The validator now creates an Attestation object using the AttestationData as + // set in the code above after all properties have been set. + attestation := &pbp2p.Attestation{ + Data: attData, + } + + // We set the custody bitfield to an slice of zero values as a stub for phase 0 + // of length len(committee)+7 // 8. + attestation.CustodyBitfield = make([]byte, (len(resp.Committee)+7)/8) + + // We set the aggregation bitfield for the attestation. + idxReq := &pb.ValidatorIndexRequest{ + PublicKey: v.pubKey, + } + // We fetch the validator index as it is necessary to generate the aggregation + // bitfield of the attestation itself. + validatorIndexRes, err := v.validatorClient.ValidatorIndex(ctx, idxReq) + if err != nil { + log.Errorf("Could not fetch validator index: %v", err) + return + } + // We set the attestation's aggregation bitfield by determining the index in the committee + // corresponding to the validator and modifying the bitfield itself. + aggregationBitfield := make([]byte, (len(resp.Committee)+7)/8) + var indexIntoCommittee uint + for i, validator := range resp.Committee { + if validator == validatorIndexRes.Index { + indexIntoCommittee = uint(i) + break + } + } + aggregationBitfield[indexIntoCommittee/8] |= 1 << (indexIntoCommittee % 8) + // Note: calling get_attestation_participants(state, attestation.data, attestation.aggregation_bitfield) + // should return a list of length equal to 1, containing validator_index. + attestation.AggregationBitfield = aggregationBitfield + + // TODO(#1366): Use BLS to generate an aggregate signature. + attestation.AggregateSignature = []byte("signed") + + attestRes, err := v.attesterClient.AttestHead(ctx, attestation) + if err != nil { + log.Errorf("Could not submit attestation to beacon node: %v", err) + return + } + log.WithField( + "hash", fmt.Sprintf("%#x", attestRes.AttestationHash), + ).Info("Submitted attestation successfully with hash %#x", attestRes.AttestationHash) +} diff --git a/validator/client/validator_attest_test.go b/validator/client/validator_attest_test.go new file mode 100644 index 0000000000..2f5c82662f --- /dev/null +++ b/validator/client/validator_attest_test.go @@ -0,0 +1,201 @@ +package client + +import ( + "context" + "errors" + "testing" + + "github.com/prysmaticlabs/prysm/shared/params" + + "github.com/gogo/protobuf/proto" + "github.com/golang/mock/gomock" + pbp2p "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" + pb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" + "github.com/prysmaticlabs/prysm/shared/testutil" + logTest "github.com/sirupsen/logrus/hooks/test" +) + +func TestAttestToBlockHead_CrosslinkCommitteeRequestFailure(t *testing.T) { + hook := logTest.NewGlobal() + + validator, m, finish := setup(t) + defer finish() + m.attesterClient.EXPECT().CrosslinkCommitteesAtSlot( + gomock.Any(), // ctx + gomock.AssignableToTypeOf(&pb.CrosslinkCommitteeRequest{}), + ).Return(nil /*Crosslinks Response*/, errors.New("something bad happened")) + + validator.AttestToBlockHead(context.Background(), 30) + testutil.AssertLogsContain(t, hook, "Could not fetch crosslink committees at slot 30") +} + +func TestAttestToBlockHead_CrosslinkCommitteeRequestEmptyCommittee(t *testing.T) { + hook := logTest.NewGlobal() + + validator, m, finish := setup(t) + defer finish() + m.attesterClient.EXPECT().CrosslinkCommitteesAtSlot( + gomock.Any(), // ctx + gomock.AssignableToTypeOf(&pb.CrosslinkCommitteeRequest{}), + ).Return(&pb.CrosslinkCommitteeResponse{ + Committee: []uint64{}, + }, nil) + + validator.AttestToBlockHead(context.Background(), 30) + testutil.AssertLogsContain(t, hook, "Received an empty committee assignment") +} + +func TestAttestToBlockHead_AttestationInfoAtSlotRequestFailure(t *testing.T) { + hook := logTest.NewGlobal() + + validator, m, finish := setup(t) + defer finish() + m.attesterClient.EXPECT().CrosslinkCommitteesAtSlot( + gomock.Any(), // ctx + gomock.Any(), + ).Return(&pb.CrosslinkCommitteeResponse{ + Shard: 5, + Committee: []uint64{1, 2, 3, 4}, + }, nil) + m.attesterClient.EXPECT().AttestationInfoAtSlot( + gomock.Any(), // ctx + gomock.AssignableToTypeOf(&pb.AttestationInfoRequest{}), + ).Return(nil /* Attestation Info Response*/, errors.New("something bad happened")) + + validator.AttestToBlockHead(context.Background(), 30) + testutil.AssertLogsContain(t, hook, "Could not fetch necessary info to produce attestation at slot 30") +} + +func TestAttestToBlockHead_ValidatorIndexRequestFailure(t *testing.T) { + hook := logTest.NewGlobal() + + validator, m, finish := setup(t) + defer finish() + m.attesterClient.EXPECT().CrosslinkCommitteesAtSlot( + gomock.Any(), // ctx + gomock.AssignableToTypeOf(&pb.CrosslinkCommitteeRequest{}), + ).Return(&pb.CrosslinkCommitteeResponse{ + Shard: 5, + Committee: []uint64{1, 2, 3, 4}, + }, nil) + m.attesterClient.EXPECT().AttestationInfoAtSlot( + gomock.Any(), // ctx + gomock.AssignableToTypeOf(&pb.AttestationInfoRequest{}), + ).Return(&pb.AttestationInfoResponse{ + BeaconBlockRootHash32: []byte{}, + EpochBoundaryRootHash32: []byte{}, + JustifiedBlockRootHash32: []byte{}, + LatestCrosslinkRootHash32: []byte{}, + JustifiedEpoch: 0, + }, nil) + m.validatorClient.EXPECT().ValidatorIndex( + gomock.Any(), // ctx + gomock.AssignableToTypeOf(&pb.ValidatorIndexRequest{}), + ).Return(nil /* Validator Index Response*/, errors.New("something bad happened")) + + validator.AttestToBlockHead(context.Background(), 30) + testutil.AssertLogsContain(t, hook, "Could not fetch validator index") +} + +func TestAttestToBlockHead_AttestHeadRequestFailure(t *testing.T) { + hook := logTest.NewGlobal() + + validator, m, finish := setup(t) + defer finish() + m.attesterClient.EXPECT().CrosslinkCommitteesAtSlot( + gomock.Any(), // ctx + gomock.AssignableToTypeOf(&pb.CrosslinkCommitteeRequest{}), + ).Return(&pb.CrosslinkCommitteeResponse{ + Shard: 5, + Committee: make([]uint64, 111), + }, nil) + m.attesterClient.EXPECT().AttestationInfoAtSlot( + gomock.Any(), // ctx + gomock.AssignableToTypeOf(&pb.AttestationInfoRequest{}), + ).Return(&pb.AttestationInfoResponse{ + BeaconBlockRootHash32: []byte{}, + EpochBoundaryRootHash32: []byte{}, + JustifiedBlockRootHash32: []byte{}, + LatestCrosslinkRootHash32: []byte{}, + JustifiedEpoch: 0, + }, nil) + m.validatorClient.EXPECT().ValidatorIndex( + gomock.Any(), // ctx + gomock.AssignableToTypeOf(&pb.ValidatorIndexRequest{}), + ).Return(&pb.ValidatorIndexResponse{ + Index: 0, + }, nil) + m.attesterClient.EXPECT().AttestHead( + gomock.Any(), // ctx + gomock.AssignableToTypeOf(&pbp2p.Attestation{}), + ).Return(nil, errors.New("something went wrong")) + + validator.AttestToBlockHead(context.Background(), 30) + testutil.AssertLogsContain(t, hook, "Could not submit attestation to beacon node") +} + +func TestAttestToBlockHead_AttestsCorrectly(t *testing.T) { + hook := logTest.NewGlobal() + + validator, m, finish := setup(t) + defer finish() + validatorIndex := uint64(5) + committee := []uint64{0, 3, 4, 2, validatorIndex, 6, 8, 9, 10} + m.attesterClient.EXPECT().CrosslinkCommitteesAtSlot( + gomock.Any(), // ctx + gomock.AssignableToTypeOf(&pb.CrosslinkCommitteeRequest{}), + ).Return(&pb.CrosslinkCommitteeResponse{ + Shard: 5, + Committee: committee, + }, nil) + m.attesterClient.EXPECT().AttestationInfoAtSlot( + gomock.Any(), // ctx + gomock.AssignableToTypeOf(&pb.AttestationInfoRequest{}), + ).Return(&pb.AttestationInfoResponse{ + BeaconBlockRootHash32: []byte("A"), + EpochBoundaryRootHash32: []byte("B"), + JustifiedBlockRootHash32: []byte("C"), + LatestCrosslinkRootHash32: []byte("D"), + JustifiedEpoch: 3, + }, nil) + m.validatorClient.EXPECT().ValidatorIndex( + gomock.Any(), // ctx + gomock.AssignableToTypeOf(&pb.ValidatorIndexRequest{}), + ).Return(&pb.ValidatorIndexResponse{ + Index: uint64(validatorIndex), + }, nil) + + var generatedAttestation *pbp2p.Attestation + m.attesterClient.EXPECT().AttestHead( + gomock.Any(), // ctx + gomock.AssignableToTypeOf(&pbp2p.Attestation{}), + ).Do(func(_ context.Context, att *pbp2p.Attestation) { + generatedAttestation = att + }).Return(&pb.AttestResponse{}, nil /* error */) + + validator.AttestToBlockHead(context.Background(), 30) + + aggregationBitfield := make([]byte, (len(committee)+7)/8) + // Validator index is at index 4 in the mocked committee defined in this test. + indexIntoCommittee := uint64(4) + aggregationBitfield[indexIntoCommittee/8] |= 1 << (indexIntoCommittee % 8) + expectedAttestation := &pbp2p.Attestation{ + Data: &pbp2p.AttestationData{ + Slot: 30, + Shard: 5, + BeaconBlockRootHash32: []byte("A"), + EpochBoundaryRootHash32: []byte("B"), + JustifiedBlockRootHash32: []byte("C"), + LatestCrosslinkRootHash32: []byte("D"), + ShardBlockRootHash32: params.BeaconConfig().ZeroHash[:], + JustifiedEpoch: 3, + }, + CustodyBitfield: make([]byte, (len(committee)+7)/8), + AggregationBitfield: aggregationBitfield, + AggregateSignature: []byte("signed"), + } + if !proto.Equal(generatedAttestation, expectedAttestation) { + t.Errorf("Incorrectly attested head, wanted %v, received %v", expectedAttestation, generatedAttestation) + } + testutil.AssertLogsContain(t, hook, "Submitted attestation successfully") +} diff --git a/validator/client/validator_propose_test.go b/validator/client/validator_propose_test.go index 4eaa3a2427..aa9e222808 100644 --- a/validator/client/validator_propose_test.go +++ b/validator/client/validator_propose_test.go @@ -16,21 +16,27 @@ import ( ) type mocks struct { - proposerClient *internal.MockProposerServiceClient - beaconClient *internal.MockBeaconServiceClient + proposerClient *internal.MockProposerServiceClient + beaconClient *internal.MockBeaconServiceClient + validatorClient *internal.MockValidatorServiceClient + attesterClient *internal.MockAttesterServiceClient } func setup(t *testing.T) (*validator, *mocks, func()) { ctrl := gomock.NewController(t) m := &mocks{ - proposerClient: internal.NewMockProposerServiceClient(ctrl), - beaconClient: internal.NewMockBeaconServiceClient(ctrl), + proposerClient: internal.NewMockProposerServiceClient(ctrl), + beaconClient: internal.NewMockBeaconServiceClient(ctrl), + validatorClient: internal.NewMockValidatorServiceClient(ctrl), + attesterClient: internal.NewMockAttesterServiceClient(ctrl), } validator := &validator{ attestationPool: &fakeAttestationPool{}, proposerClient: m.proposerClient, beaconClient: m.beaconClient, + attesterClient: m.attesterClient, + validatorClient: m.validatorClient, } return validator, m, ctrl.Finish @@ -85,7 +91,7 @@ func TestProposeBlock_UsePendingDeposits(t *testing.T) { gomock.Eq(&ptypes.Empty{}), ).Return(&pb.PendingDepositsResponse{ PendingDeposits: []*pbp2p.Deposit{ - &pbp2p.Deposit{DepositData: []byte{'D', 'A', 'T', 'A'}}, + {DepositData: []byte{'D', 'A', 'T', 'A'}}, }, }, nil /*err*/) diff --git a/validator/internal/attester_service_mock.go b/validator/internal/attester_service_mock.go index 2c1a1ee9e2..c0875cd8a6 100644 --- a/validator/internal/attester_service_mock.go +++ b/validator/internal/attester_service_mock.go @@ -1,7 +1,6 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1 (interfaces: AttesterServiceClient) -// Package internal is a generated GoMock package. package internal import ( @@ -9,7 +8,8 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - v1 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" + v1 "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" + v10 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" grpc "google.golang.org/grpc" ) @@ -37,19 +37,61 @@ func (m *MockAttesterServiceClient) EXPECT() *MockAttesterServiceClientMockRecor } // AttestHead mocks base method -func (m *MockAttesterServiceClient) AttestHead(arg0 context.Context, arg1 *v1.AttestRequest, arg2 ...grpc.CallOption) (*v1.AttestResponse, error) { +func (m *MockAttesterServiceClient) AttestHead(arg0 context.Context, arg1 *v1.Attestation, arg2 ...grpc.CallOption) (*v10.AttestResponse, error) { + m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } ret := m.ctrl.Call(m, "AttestHead", varargs...) - ret0, _ := ret[0].(*v1.AttestResponse) + ret0, _ := ret[0].(*v10.AttestResponse) ret1, _ := ret[1].(error) return ret0, ret1 } // AttestHead indicates an expected call of AttestHead func (mr *MockAttesterServiceClientMockRecorder) AttestHead(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, "AttestHead", reflect.TypeOf((*MockAttesterServiceClient)(nil).AttestHead), varargs...) } + +// AttestationInfoAtSlot mocks base method +func (m *MockAttesterServiceClient) AttestationInfoAtSlot(arg0 context.Context, arg1 *v10.AttestationInfoRequest, arg2 ...grpc.CallOption) (*v10.AttestationInfoResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AttestationInfoAtSlot", varargs...) + ret0, _ := ret[0].(*v10.AttestationInfoResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AttestationInfoAtSlot indicates an expected call of AttestationInfoAtSlot +func (mr *MockAttesterServiceClientMockRecorder) AttestationInfoAtSlot(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, "AttestationInfoAtSlot", reflect.TypeOf((*MockAttesterServiceClient)(nil).AttestationInfoAtSlot), varargs...) +} + +// CrosslinkCommitteesAtSlot mocks base method +func (m *MockAttesterServiceClient) CrosslinkCommitteesAtSlot(arg0 context.Context, arg1 *v10.CrosslinkCommitteeRequest, arg2 ...grpc.CallOption) (*v10.CrosslinkCommitteeResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CrosslinkCommitteesAtSlot", varargs...) + ret0, _ := ret[0].(*v10.CrosslinkCommitteeResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CrosslinkCommitteesAtSlot indicates an expected call of CrosslinkCommitteesAtSlot +func (mr *MockAttesterServiceClientMockRecorder) CrosslinkCommitteesAtSlot(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, "CrosslinkCommitteesAtSlot", reflect.TypeOf((*MockAttesterServiceClient)(nil).CrosslinkCommitteesAtSlot), varargs...) +} diff --git a/validator/main.go b/validator/main.go index 41cd0e3753..1bbd959e3a 100644 --- a/validator/main.go +++ b/validator/main.go @@ -15,7 +15,7 @@ import ( "github.com/prysmaticlabs/prysm/validator/types" "github.com/sirupsen/logrus" "github.com/urfave/cli" - "github.com/x-cray/logrus-prefixed-formatter" + prefixed "github.com/x-cray/logrus-prefixed-formatter" ) func startNode(ctx *cli.Context) error { diff --git a/validator/proposer/BUILD.bazel b/validator/proposer/BUILD.bazel deleted file mode 100644 index 403f3497dd..0000000000 --- a/validator/proposer/BUILD.bazel +++ /dev/null @@ -1,34 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = ["service.go"], - importpath = "github.com/prysmaticlabs/prysm/validator/proposer", - visibility = ["//validator:__subpackages__"], - deps = [ - "//proto/beacon/p2p/v1:go_default_library", - "//proto/beacon/rpc/v1:go_default_library", - "//shared/event:go_default_library", - "//shared/hashutil:go_default_library", - "//shared/params:go_default_library", - "@com_github_gogo_protobuf//proto:go_default_library", - "@com_github_sirupsen_logrus//:go_default_library", - ], -) - -go_test( - name = "go_default_test", - size = "small", - srcs = ["service_test.go"], - embed = [":go_default_library"], - deps = [ - "//proto/beacon/p2p/v1:go_default_library", - "//proto/beacon/rpc/v1:go_default_library", - "//shared/event:go_default_library", - "//shared/testutil:go_default_library", - "//validator/internal:go_default_library", - "@com_github_golang_mock//gomock:go_default_library", - "@com_github_sirupsen_logrus//:go_default_library", - "@com_github_sirupsen_logrus//hooks/test:go_default_library", - ], -) diff --git a/validator/proposer/service.go b/validator/proposer/service.go deleted file mode 100644 index c5df2a3e60..0000000000 --- a/validator/proposer/service.go +++ /dev/null @@ -1,277 +0,0 @@ -// Package proposer defines all relevant functionality for a Proposer actor -// within Ethereum Serenity. -package proposer - -import ( - "bytes" - "context" - "fmt" - "math" - "sync" - - "github.com/gogo/protobuf/proto" - pbp2p "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" - pb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" - "github.com/prysmaticlabs/prysm/shared/event" - "github.com/prysmaticlabs/prysm/shared/hashutil" - "github.com/prysmaticlabs/prysm/shared/params" - "github.com/sirupsen/logrus" -) - -var log = logrus.WithField("prefix", "proposer") - -type rpcClientService interface { - ProposerServiceClient() pb.ProposerServiceClient -} - -type beaconClientService interface { - ProposerAssignmentFeed() *event.Feed -} - -type rpcAttestationService interface { - ProcessedAttestationFeed() *event.Feed -} - -// Proposer holds functionality required to run a block proposer -// in Ethereum Serenity. Must satisfy the Service interface defined in -// sharding/service.go. -type Proposer struct { - ctx context.Context - cancel context.CancelFunc - beaconService beaconClientService - rpcClientService rpcClientService - assignmentChan chan *pbp2p.BeaconBlock - attestationService rpcAttestationService - attestationChan chan *pbp2p.Attestation - pendingAttestation []*pbp2p.Attestation - lock sync.Mutex -} - -// Config options for proposer service. -type Config struct { - AssignmentBuf int - AttestationBufferSize int - Assigner beaconClientService - AttesterFeed rpcAttestationService - Client rpcClientService -} - -// NewProposer creates a new attester instance. -func NewProposer(ctx context.Context, cfg *Config) *Proposer { - ctx, cancel := context.WithCancel(ctx) - return &Proposer{ - ctx: ctx, - cancel: cancel, - beaconService: cfg.Assigner, - rpcClientService: cfg.Client, - attestationService: cfg.AttesterFeed, - assignmentChan: make(chan *pbp2p.BeaconBlock, cfg.AssignmentBuf), - attestationChan: make(chan *pbp2p.Attestation, cfg.AttestationBufferSize), - pendingAttestation: make([]*pbp2p.Attestation, 0), - lock: sync.Mutex{}, - } -} - -// Start the main routine for a proposer. -func (p *Proposer) Start() { - log.Info("Starting service") - client := p.rpcClientService.ProposerServiceClient() - - go p.run(p.ctx.Done(), client) - go p.processAttestation(p.ctx.Done()) -} - -// Stop the main loop. -func (p *Proposer) Stop() error { - defer p.cancel() - log.Info("Stopping service") - return nil -} - -// Status always returns nil. -// This service will be rewritten in the future so this service check is a -// no-op for now. -func (p *Proposer) Status() error { - return nil -} - -// DoesAttestationExist checks if an attester has already attested to a block. -func (p *Proposer) DoesAttestationExist(attestation *pbp2p.Attestation) bool { - exists := false - for _, record := range p.pendingAttestation { - if bytes.Equal(record.ParticipationBitfield, attestation.ParticipationBitfield) { - exists = true - break - } - } - return exists -} - -// AddPendingAttestation adds a pending attestation to the memory so that it can be included -// in the next proposed block. -func (p *Proposer) AddPendingAttestation(attestation *pbp2p.Attestation) { - p.pendingAttestation = append(p.pendingAttestation, attestation) -} - -// AggregateAllSignatures aggregates all the signatures of the attesters. This is currently a -// stub for now till BLS/other signature schemes are implemented. -func (p *Proposer) AggregateAllSignatures(attestations []*pbp2p.Attestation) []uint32 { - // TODO(#258): Implement Signature Aggregation. - return []uint32{} -} - -// GenerateBitmask creates the attestation bitmask from all the attester bitfields in the -// attestation records. -func (p *Proposer) GenerateBitmask(attestations []*pbp2p.Attestation) []byte { - // TODO(#258): Implement bitmask where all attesters bitfields are aggregated. - return []byte{} -} - -// processAttestation processes incoming broadcasted attestations from the beacon node. -func (p *Proposer) processAttestation(done <-chan struct{}) { - attestationSub := p.attestationService.ProcessedAttestationFeed().Subscribe(p.attestationChan) - defer attestationSub.Unsubscribe() - - for { - select { - case <-done: - log.Debug("Proposer context closed, exiting goroutine") - return - case attestationRecord := <-p.attestationChan: - attestationExists := p.DoesAttestationExist(attestationRecord) - if !attestationExists { - p.AddPendingAttestation(attestationRecord) - log.Info("Attestation stored in memory") - } - } - - } -} - -// run the main event loop that listens for a proposer assignment. -func (p *Proposer) run(done <-chan struct{}, client pb.ProposerServiceClient) { - sub := p.beaconService.ProposerAssignmentFeed().Subscribe(p.assignmentChan) - defer sub.Unsubscribe() - - for { - select { - case <-done: - log.Debug("Proposer context closed, exiting goroutine") - return - // When we receive an assignment on a slot, we leverage the fields - // from the latest canonical beacon block to perform a proposal responsibility. - case latestBeaconBlock := <-p.assignmentChan: - p.receiveAssignment(latestBeaconBlock, client) - } - } -} - -// receiveAssignment responds to the latest proposer assignment that the validator has received from the beacon -// node. It handles all the core proposal logic for the validator client, from creating the block to be proposed, -// to the signing of the proposal data and ultimately sending the block proposal to the beacon node. -func (p *Proposer) receiveAssignment(latestBeaconBlock *pbp2p.BeaconBlock, client pb.ProposerServiceClient) { - log.Info("Performing proposer responsibility") - - block, err := p.computeBlockToBeProposed(latestBeaconBlock, client) - if err != nil { - log.Error(err) - return - } - - proposalData, err := p.createProposalDataFromBlock(block) - if err != nil { - log.Error(err) - return - } - - signature := p.signProposalData(proposalData) - block.Signature[0] = signature[:] - - hash, err := client.ProposeBlock(p.ctx, block) - if err != nil { - log.Errorf("Could not propose block %v", err) - return - } - - log.Infof("Successfully proposed block with hash %#x", hash.BlockHash) -} - -func (p *Proposer) computeBlockToBeProposed(latestBlock *pbp2p.BeaconBlock, - client pb.ProposerServiceClient) (*pbp2p.BeaconBlock, error) { - // Extract the hash of the latest beacon block to use as parent hash in - // the proposal. - if latestBlock == nil { - return nil, fmt.Errorf("could not marshal nil latest beacon block") - - } - - latestBlockHash, err := hashutil.HashBeaconBlock(latestBlock) - if err != nil { - return nil, fmt.Errorf("could not hash latest beacon block: %v", err) - } - - indexRes, err := client.ProposerIndex(p.ctx, &pb.ProposerIndexRequest{SlotNumber: latestBlock.Slot}) - if err != nil { - return nil, fmt.Errorf("could not get proposer index: %v", err) - } - - proposerBitfield := uint64(math.Pow(2, 7-float64(indexRes.Index))) - attestation := &pbp2p.Attestation{ - ParticipationBitfield: []byte{byte(proposerBitfield)}, - } - - // To prevent any unaccounted attestations from being added. - p.lock.Lock() - defer p.lock.Unlock() - - signature := make([][]byte, 48) - block := &pbp2p.BeaconBlock{ - Slot: latestBlock.Slot + 1, - ParentRootHash32: latestBlockHash[:], - RandaoRevealHash32: []byte{}, - Body: &pbp2p.BeaconBlockBody{ - Attestations: []*pbp2p.Attestation{attestation}, - }, - Signature: signature, - } - - block, err = p.addStateRootToBlock(block, client) - if err != nil { - return nil, err - } - - log.Infof("Created block proposal for slot %d", block.Slot) - p.pendingAttestation = nil - - return block, nil -} - -func (p *Proposer) addStateRootToBlock(block *pbp2p.BeaconBlock, client pb.ProposerServiceClient) (*pbp2p.BeaconBlock, error) { - res, err := client.ComputeStateRoot(p.ctx, block) - if err != nil { - return nil, fmt.Errorf("unable to compute state root for block: %v", err) - } - - block.StateRootHash32 = res.StateRoot - - return block, nil -} - -func (p *Proposer) createProposalDataFromBlock(block *pbp2p.BeaconBlock) (*pbp2p.ProposalSignedData, error) { - encodedBlock, err := proto.Marshal(block) - if err != nil { - return nil, fmt.Errorf("unable to marshal block %v", err) - } - - blockHash := hashutil.Hash(encodedBlock) - - return &pbp2p.ProposalSignedData{ - Slot: block.Slot, - Shard: params.BeaconConfig().BeaconChainShardNumber, // placeholder - BlockRootHash32: blockHash[:], - }, nil -} - -func (p *Proposer) signProposalData(data *pbp2p.ProposalSignedData) [32]byte { - return [32]byte{'S', 'I', 'G', 'N', 'A', 'T', 'U', 'R', 'E'} -} diff --git a/validator/proposer/service_test.go b/validator/proposer/service_test.go deleted file mode 100644 index db368520d2..0000000000 --- a/validator/proposer/service_test.go +++ /dev/null @@ -1,368 +0,0 @@ -package proposer - -import ( - "bytes" - "context" - "errors" - "fmt" - "io/ioutil" - "testing" - - "github.com/golang/mock/gomock" - pbp2p "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" - pb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" - "github.com/prysmaticlabs/prysm/shared/event" - "github.com/prysmaticlabs/prysm/shared/testutil" - "github.com/prysmaticlabs/prysm/validator/internal" - "github.com/sirupsen/logrus" - logTest "github.com/sirupsen/logrus/hooks/test" -) - -func init() { - logrus.SetLevel(logrus.DebugLevel) - logrus.SetOutput(ioutil.Discard) -} - -type mockClient struct { - ctrl *gomock.Controller -} - -func (mc *mockClient) ProposerServiceClient() pb.ProposerServiceClient { - return internal.NewMockProposerServiceClient(mc.ctrl) -} - -type mockAssigner struct{} - -func (m *mockAssigner) ProposerAssignmentFeed() *event.Feed { - return new(event.Feed) -} - -type mockAttesterFeed struct{} - -func (m *mockAttesterFeed) ProcessedAttestationFeed() *event.Feed { - return new(event.Feed) -} - -func TestDoesAttestationExist(t *testing.T) { - ctrl := gomock.NewController(t) - defer ctrl.Finish() - cfg := &Config{ - AssignmentBuf: 0, - Assigner: &mockAssigner{}, - Client: &mockClient{ctrl}, - } - p := NewProposer(context.Background(), cfg) - - p.pendingAttestation = []*pbp2p.Attestation{ - { - ParticipationBitfield: []byte{'a'}, - }, - { - ParticipationBitfield: []byte{'b'}, - }, - { - ParticipationBitfield: []byte{'c'}, - }, - { - ParticipationBitfield: []byte{'d'}, - }} - - fakeAttestation := &pbp2p.Attestation{ - ParticipationBitfield: []byte{'e'}, - } - - realAttestation := &pbp2p.Attestation{ - ParticipationBitfield: []byte{'a'}, - } - - if p.DoesAttestationExist(fakeAttestation) { - t.Fatal("invalid attestation exists") - } - - if !p.DoesAttestationExist(realAttestation) { - t.Fatal("valid attestation does not exists") - } - -} -func TestLifecycle(t *testing.T) { - hook := logTest.NewGlobal() - ctrl := gomock.NewController(t) - defer ctrl.Finish() - cfg := &Config{ - AssignmentBuf: 0, - Assigner: &mockAssigner{}, - Client: &mockClient{ctrl}, - AttesterFeed: &mockAttesterFeed{}, - } - p := NewProposer(context.Background(), cfg) - p.Start() - p.Stop() - - testutil.AssertLogsContain(t, hook, "Starting service") - testutil.AssertLogsContain(t, hook, "Stopping service") -} - -func TestProposerComputeBlock(t *testing.T) { - hook := logTest.NewGlobal() - ctrl := gomock.NewController(t) - defer ctrl.Finish() - cfg := &Config{ - AssignmentBuf: 0, - Assigner: &mockAssigner{}, - Client: &mockClient{ctrl}, - AttesterFeed: &mockAttesterFeed{}, - } - p := NewProposer(context.Background(), cfg) - - mockServiceClient := internal.NewMockProposerServiceClient(ctrl) - - mockServiceClient.EXPECT().ProposerIndex( - gomock.Any(), - gomock.Any()).Return( - &pb.ProposerIndexResponse{ - Index: 2, - }, nil) - - mockServiceClient.EXPECT().ComputeStateRoot( - gomock.Any(), - gomock.Any()).Return( - &pb.StateRootResponse{ - StateRoot: []byte("test"), - }, nil) - - mockServiceClient.EXPECT().ProposeBlock( - gomock.Any(), - gomock.Any(), - ).Return(&pb.ProposeResponse{ - BlockHash: []byte("hi"), - }, nil) - - doneChan := make(chan struct{}) - exitRoutine := make(chan bool) - - go func() { - p.run(doneChan, mockServiceClient) - <-exitRoutine - }() - p.assignmentChan <- &pbp2p.BeaconBlock{Slot: 5} - doneChan <- struct{}{} - exitRoutine <- true - - testutil.AssertLogsContain(t, hook, "Performing proposer responsibility") - testutil.AssertLogsContain(t, hook, fmt.Sprintf("Created block proposal for slot %d", 6)) - testutil.AssertLogsContain(t, hook, "Proposer context closed") -} - -func TestProposerProcessAttestation(t *testing.T) { - hook := logTest.NewGlobal() - ctrl := gomock.NewController(t) - defer ctrl.Finish() - cfg := &Config{ - AssignmentBuf: 0, - Assigner: &mockAssigner{}, - Client: &mockClient{ctrl}, - AttesterFeed: &mockAttesterFeed{}, - } - p := NewProposer(context.Background(), cfg) - - doneChan := make(chan struct{}) - exitRoutine := make(chan bool) - - go func() { - p.processAttestation(doneChan) - <-exitRoutine - }() - p.pendingAttestation = []*pbp2p.Attestation{ - { - ParticipationBitfield: []byte{'a'}, - }, - { - ParticipationBitfield: []byte{'b'}, - }} - - attestation := &pbp2p.Attestation{ParticipationBitfield: []byte{'c'}} - p.attestationChan <- attestation - - doneChan <- struct{}{} - exitRoutine <- true - - testutil.AssertLogsContain(t, hook, "Attestation stored in memory") - testutil.AssertLogsContain(t, hook, "Proposer context closed") - - if !bytes.Equal(p.pendingAttestation[2].ParticipationBitfield, []byte{'c'}) { - t.Errorf("attestation was unable to be saved %v", p.pendingAttestation[2].ParticipationBitfield) - } -} - -func TestFullProposalOfBlock(t *testing.T) { - hook := logTest.NewGlobal() - ctrl := gomock.NewController(t) - defer ctrl.Finish() - cfg := &Config{ - AssignmentBuf: 0, - Assigner: &mockAssigner{}, - Client: &mockClient{ctrl}, - AttesterFeed: &mockAttesterFeed{}, - } - p := NewProposer(context.Background(), cfg) - mockServiceClient := internal.NewMockProposerServiceClient(ctrl) - mockServiceClient.EXPECT().ProposerIndex( - gomock.Any(), - gomock.Any()).Return( - &pb.ProposerIndexResponse{ - Index: 2, - }, nil) - - mockServiceClient.EXPECT().ComputeStateRoot( - gomock.Any(), - gomock.Any()).Return( - &pb.StateRootResponse{ - StateRoot: []byte("test"), - }, nil) - - mockServiceClient.EXPECT().ProposeBlock( - gomock.Any(), - gomock.Any(), - ).Return(&pb.ProposeResponse{ - BlockHash: []byte("hi"), - }, nil) - - doneChan := make(chan struct{}) - exitRoutine := make(chan bool) - - go p.run(doneChan, mockServiceClient) - - go func() { - p.processAttestation(doneChan) - <-exitRoutine - }() - - p.pendingAttestation = []*pbp2p.Attestation{ - { - ParticipationBitfield: []byte{'a'}, - }, - { - ParticipationBitfield: []byte{'b'}, - }} - - attestation := &pbp2p.Attestation{ParticipationBitfield: []byte{'c'}} - p.attestationChan <- attestation - - p.assignmentChan <- &pbp2p.BeaconBlock{Slot: 5} - - doneChan <- struct{}{} - doneChan <- struct{}{} - exitRoutine <- true - - testutil.AssertLogsContain(t, hook, "Performing proposer responsibility") - testutil.AssertLogsContain(t, hook, fmt.Sprintf("Created block proposal for slot %d", 6)) - testutil.AssertLogsContain(t, hook, fmt.Sprintf("Successfully proposed block with hash %#x", []byte("hi"))) - testutil.AssertLogsContain(t, hook, "Proposer context closed") - testutil.AssertLogsContain(t, hook, "Attestation stored in memory") - testutil.AssertLogsContain(t, hook, "Proposer context closed") - -} - -func TestProposerServiceErrors(t *testing.T) { - hook := logTest.NewGlobal() - ctrl := gomock.NewController(t) - defer ctrl.Finish() - cfg := &Config{ - AssignmentBuf: 0, - Assigner: &mockAssigner{}, - Client: &mockClient{ctrl}, - AttesterFeed: &mockAttesterFeed{}, - } - p := NewProposer(context.Background(), cfg) - - mockServiceClient := internal.NewMockProposerServiceClient(ctrl) - - mockServiceClient.EXPECT().ProposerIndex( - gomock.Any(), - gomock.Any()).Return( - &pb.ProposerIndexResponse{ - Index: 2, - }, nil) - // Expect call to throw an error - mockServiceClient.EXPECT().ComputeStateRoot( - gomock.Any(), - gomock.Any(), - ).Return(nil, errors.New("could not hash state")) - - doneChan := make(chan struct{}) - exitRoutine := make(chan bool) - - go p.run(doneChan, mockServiceClient) - - go func() { - p.processAttestation(doneChan) - <-exitRoutine - }() - - p.attestationChan <- &pbp2p.Attestation{} - p.assignmentChan <- nil - p.assignmentChan <- &pbp2p.BeaconBlock{Slot: 9} - - doneChan <- struct{}{} - doneChan <- struct{}{} - exitRoutine <- true - - testutil.AssertLogsContain(t, hook, "Performing proposer responsibility") - testutil.AssertLogsContain(t, hook, "could not marshal nil latest beacon block") - testutil.AssertLogsContain(t, hook, "Proposer context closed") - testutil.AssertLogsContain(t, hook, "unable to compute state root for block: could not hash state") -} - -func TestProposedBlockError(t *testing.T) { - hook := logTest.NewGlobal() - ctrl := gomock.NewController(t) - defer ctrl.Finish() - cfg := &Config{ - AssignmentBuf: 0, - Assigner: &mockAssigner{}, - Client: &mockClient{ctrl}, - AttesterFeed: &mockAttesterFeed{}, - } - p := NewProposer(context.Background(), cfg) - - mockServiceClient := internal.NewMockProposerServiceClient(ctrl) - mockServiceClient.EXPECT().ProposerIndex( - gomock.Any(), - gomock.Any()).Return( - &pb.ProposerIndexResponse{ - Index: 2, - }, nil) - - mockServiceClient.EXPECT().ComputeStateRoot( - gomock.Any(), - gomock.Any()).Return( - &pb.StateRootResponse{ - StateRoot: []byte("test"), - }, nil) - - // Expect call to throw an error. - mockServiceClient.EXPECT().ProposeBlock( - gomock.Any(), - gomock.Any(), - ).Return(nil, errors.New("bad block proposed")) - - doneChan := make(chan struct{}) - exitRoutine := make(chan bool) - - go p.run(doneChan, mockServiceClient) - - go func() { - p.processAttestation(doneChan) - <-exitRoutine - }() - - p.assignmentChan <- &pbp2p.BeaconBlock{Slot: 9} - - doneChan <- struct{}{} - doneChan <- struct{}{} - exitRoutine <- true - - testutil.AssertLogsContain(t, hook, "Performing proposer responsibility") - testutil.AssertLogsContain(t, hook, "Proposer context closed") - testutil.AssertLogsContain(t, hook, "Could not propose block bad block proposed") -}