diff --git a/beacon-chain/blockchain/head.go b/beacon-chain/blockchain/head.go index 51cff3738531..bda360a84ba0 100644 --- a/beacon-chain/blockchain/head.go +++ b/beacon-chain/blockchain/head.go @@ -401,7 +401,7 @@ func (s *Service) saveOrphanedOperations(ctx context.Context, orphanedRoot [32]b } for _, a := range orphanedBlk.Block().Body().Attestations() { // if the attestation is one epoch older, it wouldn't been useful to save it. - if a.Data.Slot+params.BeaconConfig().SlotsPerEpoch < s.CurrentSlot() { + if a.GetData().Slot+params.BeaconConfig().SlotsPerEpoch < s.CurrentSlot() { continue } if helpers.IsAggregated(a) { diff --git a/beacon-chain/blockchain/head_test.go b/beacon-chain/blockchain/head_test.go index 012cb54c127d..d1e5b1c1de51 100644 --- a/beacon-chain/blockchain/head_test.go +++ b/beacon-chain/blockchain/head_test.go @@ -13,6 +13,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/blstoexec" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpbv1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" @@ -312,14 +313,14 @@ func TestSaveOrphanedAtts(t *testing.T) { require.NoError(t, service.saveOrphanedOperations(ctx, r3, r4)) require.Equal(t, 3, service.cfg.AttPool.AggregatedAttestationCount()) - wantAtts := []*ethpb.Attestation{ + wantAtts := []interfaces.Attestation{ blk3.Block.Body.Attestations[0], blk2.Block.Body.Attestations[0], blk1.Block.Body.Attestations[0], } atts := service.cfg.AttPool.AggregatedAttestations() sort.Slice(atts, func(i, j int) bool { - return atts[i].Data.Slot > atts[j].Data.Slot + return atts[i].GetData().Slot > atts[j].GetData().Slot }) require.DeepEqual(t, wantAtts, atts) } @@ -389,14 +390,14 @@ func TestSaveOrphanedOps(t *testing.T) { require.NoError(t, service.saveOrphanedOperations(ctx, r3, r4)) require.Equal(t, 3, service.cfg.AttPool.AggregatedAttestationCount()) - wantAtts := []*ethpb.Attestation{ + wantAtts := []interfaces.Attestation{ blk3.Block.Body.Attestations[0], blk2.Block.Body.Attestations[0], blk1.Block.Body.Attestations[0], } atts := service.cfg.AttPool.AggregatedAttestations() sort.Slice(atts, func(i, j int) bool { - return atts[i].Data.Slot > atts[j].Data.Slot + return atts[i].GetData().Slot > atts[j].GetData().Slot }) require.DeepEqual(t, wantAtts, atts) require.Equal(t, 1, len(service.cfg.SlashingPool.PendingProposerSlashings(ctx, st, false))) @@ -517,14 +518,14 @@ func TestSaveOrphanedAtts_DoublyLinkedTrie(t *testing.T) { require.NoError(t, service.saveOrphanedOperations(ctx, r3, r4)) require.Equal(t, 3, service.cfg.AttPool.AggregatedAttestationCount()) - wantAtts := []*ethpb.Attestation{ + wantAtts := []interfaces.Attestation{ blk3.Block.Body.Attestations[0], blk2.Block.Body.Attestations[0], blk1.Block.Body.Attestations[0], } atts := service.cfg.AttPool.AggregatedAttestations() sort.Slice(atts, func(i, j int) bool { - return atts[i].Data.Slot > atts[j].Data.Slot + return atts[i].GetData().Slot > atts[j].GetData().Slot }) require.DeepEqual(t, wantAtts, atts) } diff --git a/beacon-chain/blockchain/metrics.go b/beacon-chain/blockchain/metrics.go index c712b574d04f..8abcce3a2c52 100644 --- a/beacon-chain/blockchain/metrics.go +++ b/beacon-chain/blockchain/metrics.go @@ -369,6 +369,6 @@ func reportEpochMetrics(ctx context.Context, postState, headState state.BeaconSt func reportAttestationInclusion(blk interfaces.ReadOnlyBeaconBlock) { for _, att := range blk.Body().Attestations() { - attestationInclusionDelay.Observe(float64(blk.Slot() - att.Data.Slot)) + attestationInclusionDelay.Observe(float64(blk.Slot() - att.GetData().Slot)) } } diff --git a/beacon-chain/blockchain/process_attestation.go b/beacon-chain/blockchain/process_attestation.go index c61078ff7143..c645f9ccee26 100644 --- a/beacon-chain/blockchain/process_attestation.go +++ b/beacon-chain/blockchain/process_attestation.go @@ -6,6 +6,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" @@ -36,17 +37,17 @@ import ( // // # Update latest messages for attesting indices // update_latest_messages(store, indexed_attestation.attesting_indices, attestation) -func (s *Service) OnAttestation(ctx context.Context, a *ethpb.Attestation, disparity time.Duration) error { +func (s *Service) OnAttestation(ctx context.Context, a interfaces.Attestation, disparity time.Duration) error { ctx, span := trace.StartSpan(ctx, "blockChain.onAttestation") defer span.End() if err := helpers.ValidateNilAttestation(a); err != nil { return err } - if err := helpers.ValidateSlotTargetEpoch(a.Data); err != nil { + if err := helpers.ValidateSlotTargetEpoch(a.GetData()); err != nil { return err } - tgt := ethpb.CopyCheckpoint(a.Data.Target) + tgt := ethpb.CopyCheckpoint(a.GetData().Target) // Note that target root check is ignored here because it was performed in sync's validation pipeline: // validate_aggregate_proof.go and validate_beacon_attestation.go @@ -67,7 +68,7 @@ func (s *Service) OnAttestation(ctx context.Context, a *ethpb.Attestation, dispa } // Verify attestation beacon block is known and not from the future. - if err := s.verifyBeaconBlock(ctx, a.Data); err != nil { + if err := s.verifyBeaconBlock(ctx, a.GetData()); err != nil { return errors.Wrap(err, "could not verify attestation beacon block") } @@ -75,12 +76,12 @@ func (s *Service) OnAttestation(ctx context.Context, a *ethpb.Attestation, dispa // validate_aggregate_proof.go and validate_beacon_attestation.go // Verify attestations can only affect the fork choice of subsequent slots. - if err := slots.VerifyTime(genesisTime, a.Data.Slot+1, disparity); err != nil { + if err := slots.VerifyTime(genesisTime, a.GetData().Slot+1, disparity); err != nil { return err } // Use the target state to verify attesting indices are valid. - committee, err := helpers.BeaconCommitteeFromState(ctx, baseState, a.Data.Slot, a.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, baseState, a.GetData().Slot, a.GetData().CommitteeIndex) if err != nil { return err } @@ -97,7 +98,7 @@ func (s *Service) OnAttestation(ctx context.Context, a *ethpb.Attestation, dispa // We assume trusted attestation in this function has verified signature. // Update forkchoice store with the new attestation for updating weight. - s.cfg.ForkChoiceStore.ProcessAttestation(ctx, indexedAtt.AttestingIndices, bytesutil.ToBytes32(a.Data.BeaconBlockRoot), a.Data.Target.Epoch) + s.cfg.ForkChoiceStore.ProcessAttestation(ctx, indexedAtt.GetAttestingIndices(), bytesutil.ToBytes32(a.GetData().BeaconBlockRoot), a.GetData().Target.Epoch) return nil } diff --git a/beacon-chain/blockchain/process_attestation_test.go b/beacon-chain/blockchain/process_attestation_test.go index b84298ccb1ed..9b0f722051b1 100644 --- a/beacon-chain/blockchain/process_attestation_test.go +++ b/beacon-chain/blockchain/process_attestation_test.go @@ -9,6 +9,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -73,7 +74,7 @@ func TestStore_OnAttestation_ErrorConditions(t *testing.T) { tests := []struct { name string - a *ethpb.Attestation + a interfaces.Attestation wantedErr string }{ { diff --git a/beacon-chain/blockchain/process_block.go b/beacon-chain/blockchain/process_block.go index 34a16e39e446..3f8c94ccedfd 100644 --- a/beacon-chain/blockchain/process_block.go +++ b/beacon-chain/blockchain/process_block.go @@ -366,17 +366,17 @@ func (s *Service) handleEpochBoundary(ctx context.Context, slot primitives.Slot, func (s *Service) handleBlockAttestations(ctx context.Context, blk interfaces.ReadOnlyBeaconBlock, st state.BeaconState) error { // Feed in block's attestations to fork choice store. for _, a := range blk.Body().Attestations() { - committee, err := helpers.BeaconCommitteeFromState(ctx, st, a.Data.Slot, a.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, st, a.GetData().Slot, a.GetData().CommitteeIndex) if err != nil { return err } - indices, err := attestation.AttestingIndices(a.AggregationBits, committee) + indices, err := attestation.AttestingIndices(a.GetAggregationBits(), committee) if err != nil { return err } - r := bytesutil.ToBytes32(a.Data.BeaconBlockRoot) + r := bytesutil.ToBytes32(a.GetData().BeaconBlockRoot) if s.cfg.ForkChoiceStore.HasNode(r) { - s.cfg.ForkChoiceStore.ProcessAttestation(ctx, indices, r, a.Data.Target.Epoch) + s.cfg.ForkChoiceStore.ProcessAttestation(ctx, indices, r, a.GetData().Target.Epoch) } else if err := s.cfg.AttPool.SaveBlockAttestation(a); err != nil { return err } @@ -387,7 +387,7 @@ func (s *Service) handleBlockAttestations(ctx context.Context, blk interfaces.Re // InsertSlashingsToForkChoiceStore inserts attester slashing indices to fork choice store. // To call this function, it's caller's responsibility to ensure the slashing object is valid. // This function requires a write lock on forkchoice. -func (s *Service) InsertSlashingsToForkChoiceStore(ctx context.Context, slashings []*ethpb.AttesterSlashing) { +func (s *Service) InsertSlashingsToForkChoiceStore(ctx context.Context, slashings []interfaces.AttesterSlashing) { for _, slashing := range slashings { indices := blocks.SlashableAttesterIndices(slashing) for _, index := range indices { diff --git a/beacon-chain/blockchain/process_block_test.go b/beacon-chain/blockchain/process_block_test.go index 0ff6590fd5a1..fbc15a824ae8 100644 --- a/beacon-chain/blockchain/process_block_test.go +++ b/beacon-chain/blockchain/process_block_test.go @@ -824,7 +824,10 @@ func TestRemoveBlockAttestationsInPool(t *testing.T) { require.NoError(t, service.cfg.BeaconDB.SaveStateSummary(ctx, ðpb.StateSummary{Root: r[:]})) require.NoError(t, service.cfg.BeaconDB.SaveGenesisBlockRoot(ctx, r)) - atts := b.Block.Body.Attestations + atts := make([]interfaces.Attestation, len(b.Block.Body.Attestations)) + for i, a := range b.Block.Body.Attestations { + atts[i] = a + } require.NoError(t, service.cfg.AttPool.SaveAggregatedAttestations(atts)) wsb, err := consensusblocks.NewSignedBeaconBlock(b) require.NoError(t, err) @@ -2010,12 +2013,12 @@ func TestOnBlock_HandleBlockAttestations(t *testing.T) { require.Equal(t, 1, len(wsb.Block().Body().Attestations())) a := wsb.Block().Body().Attestations()[0] - r := bytesutil.ToBytes32(a.Data.BeaconBlockRoot) + r := bytesutil.ToBytes32(a.GetData().BeaconBlockRoot) require.Equal(t, true, service.cfg.ForkChoiceStore.HasNode(r)) require.Equal(t, 1, len(wsb.Block().Body().Attestations())) a3 := wsb3.Block().Body().Attestations()[0] - r3 := bytesutil.ToBytes32(a3.Data.BeaconBlockRoot) + r3 := bytesutil.ToBytes32(a3.GetData().BeaconBlockRoot) require.Equal(t, false, service.cfg.ForkChoiceStore.HasNode(r3)) require.NoError(t, service.handleBlockAttestations(ctx, wsb.Block(), st)) // fine to use the same committee as st diff --git a/beacon-chain/blockchain/receive_attestation.go b/beacon-chain/blockchain/receive_attestation.go index d94156f227ca..1d5a5763f3d5 100644 --- a/beacon-chain/blockchain/receive_attestation.go +++ b/beacon-chain/blockchain/receive_attestation.go @@ -10,6 +10,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -31,7 +32,7 @@ type AttestationStateFetcher interface { // AttestationReceiver interface defines the methods of chain service receive and processing new attestations. type AttestationReceiver interface { AttestationStateFetcher - VerifyLmdFfgConsistency(ctx context.Context, att *ethpb.Attestation) error + VerifyLmdFfgConsistency(ctx context.Context, att interfaces.Attestation) error InForkchoice([32]byte) bool } @@ -51,13 +52,13 @@ func (s *Service) AttestationTargetState(ctx context.Context, target *ethpb.Chec } // VerifyLmdFfgConsistency verifies that attestation's LMD and FFG votes are consistency to each other. -func (s *Service) VerifyLmdFfgConsistency(ctx context.Context, a *ethpb.Attestation) error { - r, err := s.TargetRootForEpoch([32]byte(a.Data.BeaconBlockRoot), a.Data.Target.Epoch) +func (s *Service) VerifyLmdFfgConsistency(ctx context.Context, a interfaces.Attestation) error { + r, err := s.TargetRootForEpoch([32]byte(a.GetData().BeaconBlockRoot), a.GetData().Target.Epoch) if err != nil { return err } - if !bytes.Equal(a.Data.Target.Root, r[:]) { - return fmt.Errorf("FFG and LMD votes are not consistent, block root: %#x, target root: %#x, canonical target root: %#x", a.Data.BeaconBlockRoot, a.Data.Target.Root, r) + if !bytes.Equal(a.GetData().Target.Root, r[:]) { + return fmt.Errorf("FFG and LMD votes are not consistent, block root: %#x, target root: %#x, canonical target root: %#x", a.GetData().BeaconBlockRoot, a.GetData().Target.Root, r) } return nil } @@ -170,13 +171,13 @@ func (s *Service) processAttestations(ctx context.Context, disparity time.Durati // Based on the spec, don't process the attestation until the subsequent slot. // This delays consideration in the fork choice until their slot is in the past. // https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/fork-choice.md#validate_on_attestation - nextSlot := a.Data.Slot + 1 + nextSlot := a.GetData().Slot + 1 if err := slots.VerifyTime(uint64(s.genesisTime.Unix()), nextSlot, disparity); err != nil { continue } - hasState := s.cfg.BeaconDB.HasStateSummary(ctx, bytesutil.ToBytes32(a.Data.BeaconBlockRoot)) - hasBlock := s.hasBlock(ctx, bytesutil.ToBytes32(a.Data.BeaconBlockRoot)) + hasState := s.cfg.BeaconDB.HasStateSummary(ctx, bytesutil.ToBytes32(a.GetData().BeaconBlockRoot)) + hasBlock := s.hasBlock(ctx, bytesutil.ToBytes32(a.GetData().BeaconBlockRoot)) if !(hasState && hasBlock) { continue } @@ -185,17 +186,17 @@ func (s *Service) processAttestations(ctx context.Context, disparity time.Durati log.WithError(err).Error("Could not delete fork choice attestation in pool") } - if !helpers.VerifyCheckpointEpoch(a.Data.Target, s.genesisTime) { + if !helpers.VerifyCheckpointEpoch(a.GetData().Target, s.genesisTime) { continue } if err := s.receiveAttestationNoPubsub(ctx, a, disparity); err != nil { log.WithFields(logrus.Fields{ - "slot": a.Data.Slot, - "committeeIndex": a.Data.CommitteeIndex, - "beaconBlockRoot": fmt.Sprintf("%#x", bytesutil.Trunc(a.Data.BeaconBlockRoot)), - "targetRoot": fmt.Sprintf("%#x", bytesutil.Trunc(a.Data.Target.Root)), - "aggregationCount": a.AggregationBits.Count(), + "slot": a.GetData().Slot, + "committeeIndex": a.GetData().CommitteeIndex, + "beaconBlockRoot": fmt.Sprintf("%#x", bytesutil.Trunc(a.GetData().BeaconBlockRoot)), + "targetRoot": fmt.Sprintf("%#x", bytesutil.Trunc(a.GetData().Target.Root)), + "aggregationCount": a.GetAggregationBits().Count(), }).WithError(err).Warn("Could not process attestation for fork choice") } } @@ -206,7 +207,7 @@ func (s *Service) processAttestations(ctx context.Context, disparity time.Durati // 1. Validate attestation, update validator's latest vote // 2. Apply fork choice to the processed attestation // 3. Save latest head info -func (s *Service) receiveAttestationNoPubsub(ctx context.Context, att *ethpb.Attestation, disparity time.Duration) error { +func (s *Service) receiveAttestationNoPubsub(ctx context.Context, att interfaces.Attestation, disparity time.Duration) error { ctx, span := trace.StartSpan(ctx, "beacon-chain.blockchain.receiveAttestationNoPubsub") defer span.End() diff --git a/beacon-chain/blockchain/receive_attestation_test.go b/beacon-chain/blockchain/receive_attestation_test.go index 51654f4e6d6c..dd1ce2cabc8f 100644 --- a/beacon-chain/blockchain/receive_attestation_test.go +++ b/beacon-chain/blockchain/receive_attestation_test.go @@ -10,6 +10,7 @@ import ( forkchoicetypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/types" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -83,7 +84,11 @@ func TestProcessAttestations_Ok(t *testing.T) { state, blkRoot, err := prepareForkchoiceState(ctx, 0, tRoot, tRoot, params.BeaconConfig().ZeroHash, ojc, ofc) require.NoError(t, err) require.NoError(t, service.cfg.ForkChoiceStore.InsertNode(ctx, state, blkRoot)) - require.NoError(t, service.cfg.AttPool.SaveForkchoiceAttestations(atts)) + attsToSave := make([]interfaces.Attestation, len(atts)) + for i, a := range atts { + attsToSave[i] = a + } + require.NoError(t, service.cfg.AttPool.SaveForkchoiceAttestations(attsToSave)) service.processAttestations(ctx, 0) require.Equal(t, 0, len(service.cfg.AttPool.ForkchoiceAttestations())) require.LogsDoNotContain(t, hook, "Could not process attestation for fork choice") @@ -121,7 +126,11 @@ func TestService_ProcessAttestationsAndUpdateHead(t *testing.T) { // Generate attestations for this block in Slot 1 atts, err := util.GenerateAttestations(copied, pks, 1, 1, false) require.NoError(t, err) - require.NoError(t, service.cfg.AttPool.SaveForkchoiceAttestations(atts)) + attsToSave := make([]interfaces.Attestation, len(atts)) + for i, a := range atts { + attsToSave[i] = a + } + require.NoError(t, service.cfg.AttPool.SaveForkchoiceAttestations(attsToSave)) // Verify the target is in forkchoice require.Equal(t, true, fcs.HasNode(bytesutil.ToBytes32(atts[0].Data.BeaconBlockRoot))) require.Equal(t, tRoot, bytesutil.ToBytes32(atts[0].Data.BeaconBlockRoot)) diff --git a/beacon-chain/blockchain/receive_block.go b/beacon-chain/blockchain/receive_block.go index 23a6f9de1e2a..f4b05f6c35d4 100644 --- a/beacon-chain/blockchain/receive_block.go +++ b/beacon-chain/blockchain/receive_block.go @@ -52,7 +52,7 @@ type BlobReceiver interface { // SlashingReceiver interface defines the methods of chain service for receiving validated slashing over the wire. type SlashingReceiver interface { - ReceiveAttesterSlashing(ctx context.Context, slashings *ethpb.AttesterSlashing) + ReceiveAttesterSlashing(ctx context.Context, slashing interfaces.AttesterSlashing) } // ReceiveBlock is a function that defines the operations (minus pubsub) @@ -295,10 +295,10 @@ func (s *Service) HasBlock(ctx context.Context, root [32]byte) bool { } // ReceiveAttesterSlashing receives an attester slashing and inserts it to forkchoice -func (s *Service) ReceiveAttesterSlashing(ctx context.Context, slashing *ethpb.AttesterSlashing) { +func (s *Service) ReceiveAttesterSlashing(ctx context.Context, slashing interfaces.AttesterSlashing) { s.cfg.ForkChoiceStore.Lock() defer s.cfg.ForkChoiceStore.Unlock() - s.InsertSlashingsToForkChoiceStore(ctx, []*ethpb.AttesterSlashing{slashing}) + s.InsertSlashingsToForkChoiceStore(ctx, []interfaces.AttesterSlashing{slashing}) } // prunePostBlockOperationPools only runs on new head otherwise should return a nil. @@ -479,7 +479,7 @@ func (s *Service) sendBlockAttestationsToSlasher(signed interfaces.ReadOnlySigne // is done in the background to avoid adding more load to this critical code path. ctx := context.TODO() for _, att := range signed.Block().Body().Attestations() { - committee, err := helpers.BeaconCommitteeFromState(ctx, preState, att.Data.Slot, att.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, preState, att.GetData().Slot, att.GetData().CommitteeIndex) if err != nil { log.WithError(err).Error("Could not get attestation committee") return diff --git a/beacon-chain/blockchain/setup_test.go b/beacon-chain/blockchain/setup_test.go index 3d3e98b3f86e..97c6d00f7d06 100644 --- a/beacon-chain/blockchain/setup_test.go +++ b/beacon-chain/blockchain/setup_test.go @@ -20,6 +20,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/v5/beacon-chain/startup" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" "google.golang.org/protobuf/proto" @@ -49,7 +50,7 @@ func (mb *mockBroadcaster) Broadcast(_ context.Context, _ proto.Message) error { return nil } -func (mb *mockBroadcaster) BroadcastAttestation(_ context.Context, _ uint64, _ *ethpb.Attestation) error { +func (mb *mockBroadcaster) BroadcastAttestation(_ context.Context, _ uint64, _ interfaces.Attestation) error { mb.broadcastCalled = true return nil } diff --git a/beacon-chain/blockchain/testing/mock.go b/beacon-chain/blockchain/testing/mock.go index 27083f671962..e85868c448cb 100644 --- a/beacon-chain/blockchain/testing/mock.go +++ b/beacon-chain/blockchain/testing/mock.go @@ -414,8 +414,8 @@ func (*ChainService) HeadGenesisValidatorsRoot() [32]byte { } // VerifyLmdFfgConsistency mocks VerifyLmdFfgConsistency and always returns nil. -func (*ChainService) VerifyLmdFfgConsistency(_ context.Context, a *ethpb.Attestation) error { - if !bytes.Equal(a.Data.BeaconBlockRoot, a.Data.Target.Root) { +func (*ChainService) VerifyLmdFfgConsistency(_ context.Context, a interfaces.Attestation) error { + if !bytes.Equal(a.GetData().BeaconBlockRoot, a.GetData().Target.Root) { return errors.New("LMD and FFG miss matched") } return nil @@ -495,7 +495,7 @@ func (s *ChainService) UpdateHead(ctx context.Context, slot primitives.Slot) { } // ReceiveAttesterSlashing mocks the same method in the chain service. -func (*ChainService) ReceiveAttesterSlashing(context.Context, *ethpb.AttesterSlashing) {} +func (*ChainService) ReceiveAttesterSlashing(context.Context, interfaces.AttesterSlashing) {} // IsFinalized mocks the same method in the chain service. func (s *ChainService) IsFinalized(_ context.Context, blockRoot [32]byte) bool { diff --git a/beacon-chain/core/altair/attestation.go b/beacon-chain/core/altair/attestation.go index f54a6d043924..8b123c91ca8b 100644 --- a/beacon-chain/core/altair/attestation.go +++ b/beacon-chain/core/altair/attestation.go @@ -48,7 +48,7 @@ func ProcessAttestationsNoVerifySignature( func ProcessAttestationNoVerifySignature( ctx context.Context, beaconState state.BeaconState, - att *ethpb.Attestation, + att interfaces.Attestation, totalBalance uint64, ) (state.BeaconState, error) { ctx, span := trace.StartSpan(ctx, "altair.ProcessAttestationNoVerifySignature") @@ -58,24 +58,24 @@ func ProcessAttestationNoVerifySignature( return nil, err } - delay, err := beaconState.Slot().SafeSubSlot(att.Data.Slot) + delay, err := beaconState.Slot().SafeSubSlot(att.GetData().Slot) if err != nil { - return nil, fmt.Errorf("att slot %d can't be greater than state slot %d", att.Data.Slot, beaconState.Slot()) + return nil, fmt.Errorf("att slot %d can't be greater than state slot %d", att.GetData().Slot, beaconState.Slot()) } - participatedFlags, err := AttestationParticipationFlagIndices(beaconState, att.Data, delay) + participatedFlags, err := AttestationParticipationFlagIndices(beaconState, att.GetData(), delay) if err != nil { return nil, err } - committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, att.Data.Slot, att.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, att.GetData().Slot, att.GetData().CommitteeIndex) if err != nil { return nil, err } - indices, err := attestation.AttestingIndices(att.AggregationBits, committee) + indices, err := attestation.AttestingIndices(att.GetAggregationBits(), committee) if err != nil { return nil, err } - return SetParticipationAndRewardProposer(ctx, beaconState, att.Data.Target.Epoch, indices, participatedFlags, totalBalance) + return SetParticipationAndRewardProposer(ctx, beaconState, att.GetData().Target.Epoch, indices, participatedFlags, totalBalance) } // SetParticipationAndRewardProposer retrieves and sets the epoch participation bits in state. Based on the epoch participation, it rewards diff --git a/beacon-chain/core/blocks/attestation.go b/beacon-chain/core/blocks/attestation.go index 96073e83e028..a704bf26050a 100644 --- a/beacon-chain/core/blocks/attestation.go +++ b/beacon-chain/core/blocks/attestation.go @@ -46,7 +46,7 @@ func ProcessAttestationsNoVerifySignature( func VerifyAttestationNoVerifySignature( ctx context.Context, beaconState state.ReadOnlyBeaconState, - att *ethpb.Attestation, + att interfaces.Attestation, ) error { ctx, span := trace.StartSpan(ctx, "core.VerifyAttestationNoVerifySignature") defer span.End() @@ -56,7 +56,7 @@ func VerifyAttestationNoVerifySignature( } currEpoch := time.CurrentEpoch(beaconState) prevEpoch := time.PrevEpoch(beaconState) - data := att.Data + data := att.GetData() if data.Target.Epoch != prevEpoch && data.Target.Epoch != currEpoch { return fmt.Errorf( "expected target epoch (%d) to be the previous epoch (%d) or the current epoch (%d)", @@ -76,11 +76,11 @@ func VerifyAttestationNoVerifySignature( } } - if err := helpers.ValidateSlotTargetEpoch(att.Data); err != nil { + if err := helpers.ValidateSlotTargetEpoch(att.GetData()); err != nil { return err } - s := att.Data.Slot + s := att.GetData().Slot minInclusionCheck := s+params.BeaconConfig().MinAttestationInclusionDelay <= beaconState.Slot() if !minInclusionCheck { return fmt.Errorf( @@ -102,13 +102,13 @@ func VerifyAttestationNoVerifySignature( ) } } - activeValidatorCount, err := helpers.ActiveValidatorCount(ctx, beaconState, att.Data.Target.Epoch) + activeValidatorCount, err := helpers.ActiveValidatorCount(ctx, beaconState, att.GetData().Target.Epoch) if err != nil { return err } c := helpers.SlotCommitteeCount(activeValidatorCount) - if uint64(att.Data.CommitteeIndex) >= c { - return fmt.Errorf("committee index %d >= committee count %d", att.Data.CommitteeIndex, c) + if uint64(att.GetData().CommitteeIndex) >= c { + return fmt.Errorf("committee index %d >= committee count %d", att.GetData().CommitteeIndex, c) } if err := helpers.VerifyAttestationBitfieldLengths(ctx, beaconState, att); err != nil { @@ -116,7 +116,7 @@ func VerifyAttestationNoVerifySignature( } // Verify attesting indices are correct. - committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, att.Data.Slot, att.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, att.GetData().Slot, att.GetData().CommitteeIndex) if err != nil { return err } @@ -133,7 +133,7 @@ func VerifyAttestationNoVerifySignature( func ProcessAttestationNoVerifySignature( ctx context.Context, beaconState state.BeaconState, - att *ethpb.Attestation, + att interfaces.Attestation, ) (state.BeaconState, error) { ctx, span := trace.StartSpan(ctx, "core.ProcessAttestationNoVerifySignature") defer span.End() @@ -143,15 +143,15 @@ func ProcessAttestationNoVerifySignature( } currEpoch := time.CurrentEpoch(beaconState) - data := att.Data - s := att.Data.Slot + data := att.GetData() + s := att.GetData().Slot proposerIndex, err := helpers.BeaconProposerIndex(ctx, beaconState) if err != nil { return nil, err } pendingAtt := ðpb.PendingAttestation{ Data: data, - AggregationBits: att.AggregationBits, + AggregationBits: att.GetAggregationBits(), InclusionDelay: beaconState.Slot() - s, ProposerIndex: proposerIndex, } @@ -171,11 +171,11 @@ func ProcessAttestationNoVerifySignature( // VerifyAttestationSignature converts and attestation into an indexed attestation and verifies // the signature in that attestation. -func VerifyAttestationSignature(ctx context.Context, beaconState state.ReadOnlyBeaconState, att *ethpb.Attestation) error { +func VerifyAttestationSignature(ctx context.Context, beaconState state.ReadOnlyBeaconState, att interfaces.Attestation) error { if err := helpers.ValidateNilAttestation(att); err != nil { return err } - committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, att.Data.Slot, att.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, beaconState, att.GetData().Slot, att.GetData().CommitteeIndex) if err != nil { return err } @@ -203,7 +203,7 @@ func VerifyAttestationSignature(ctx context.Context, beaconState state.ReadOnlyB // domain = get_domain(state, DOMAIN_BEACON_ATTESTER, indexed_attestation.data.target.epoch) // signing_root = compute_signing_root(indexed_attestation.data, domain) // return bls.FastAggregateVerify(pubkeys, signing_root, indexed_attestation.signature) -func VerifyIndexedAttestation(ctx context.Context, beaconState state.ReadOnlyBeaconState, indexedAtt *ethpb.IndexedAttestation) error { +func VerifyIndexedAttestation(ctx context.Context, beaconState state.ReadOnlyBeaconState, indexedAtt ethpb.IndexedAtt) error { ctx, span := trace.StartSpan(ctx, "core.VerifyIndexedAttestation") defer span.End() @@ -212,14 +212,14 @@ func VerifyIndexedAttestation(ctx context.Context, beaconState state.ReadOnlyBea } domain, err := signing.Domain( beaconState.Fork(), - indexedAtt.Data.Target.Epoch, + indexedAtt.GetData().Target.Epoch, params.BeaconConfig().DomainBeaconAttester, beaconState.GenesisValidatorsRoot(), ) if err != nil { return err } - indices := indexedAtt.AttestingIndices + indices := indexedAtt.GetAttestingIndices() var pubkeys []bls.PublicKey for i := 0; i < len(indices); i++ { pubkeyAtIdx := beaconState.PubkeyAtIndex(primitives.ValidatorIndex(indices[i])) diff --git a/beacon-chain/core/blocks/attestation_test.go b/beacon-chain/core/blocks/attestation_test.go index 978c46838565..3565e3ceb288 100644 --- a/beacon-chain/core/blocks/attestation_test.go +++ b/beacon-chain/core/blocks/attestation_test.go @@ -11,6 +11,7 @@ import ( state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -386,7 +387,7 @@ func TestValidateIndexedAttestation_BadAttestationsSignatureSet(t *testing.T) { sig := keys[0].Sign([]byte{'t', 'e', 's', 't'}) list := bitfield.Bitlist{0b11111} - var atts []*ethpb.Attestation + var atts []interfaces.Attestation for i := uint64(0); i < 1000; i++ { atts = append(atts, ðpb.Attestation{ Data: ðpb.AttestationData{ @@ -402,7 +403,7 @@ func TestValidateIndexedAttestation_BadAttestationsSignatureSet(t *testing.T) { _, err := blocks.AttestationSignatureBatch(context.Background(), beaconState, atts) assert.ErrorContains(t, want, err) - atts = []*ethpb.Attestation{} + atts = []interfaces.Attestation{} list = bitfield.Bitlist{0b10000} for i := uint64(0); i < 1000; i++ { atts = append(atts, ðpb.Attestation{ @@ -543,7 +544,7 @@ func TestRetrieveAttestationSignatureSet_VerifiesMultipleAttestations(t *testing } att2.Signature = bls.AggregateSignatures(sigs).Marshal() - set, err := blocks.AttestationSignatureBatch(ctx, st, []*ethpb.Attestation{att1, att2}) + set, err := blocks.AttestationSignatureBatch(ctx, st, []interfaces.Attestation{att1, att2}) require.NoError(t, err) verified, err := set.Verify() require.NoError(t, err) @@ -607,6 +608,6 @@ func TestRetrieveAttestationSignatureSet_AcrossFork(t *testing.T) { } att2.Signature = bls.AggregateSignatures(sigs).Marshal() - _, err = blocks.AttestationSignatureBatch(ctx, st, []*ethpb.Attestation{att1, att2}) + _, err = blocks.AttestationSignatureBatch(ctx, st, []interfaces.Attestation{att1, att2}) require.NoError(t, err) } diff --git a/beacon-chain/core/blocks/attester_slashing.go b/beacon-chain/core/blocks/attester_slashing.go index 9f97aa59aa0c..20d2291aae22 100644 --- a/beacon-chain/core/blocks/attester_slashing.go +++ b/beacon-chain/core/blocks/attester_slashing.go @@ -8,6 +8,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -40,7 +41,7 @@ import ( func ProcessAttesterSlashings( ctx context.Context, beaconState state.BeaconState, - slashings []*ethpb.AttesterSlashing, + slashings []interfaces.AttesterSlashing, slashFunc slashValidatorFunc, ) (state.BeaconState, error) { var err error @@ -57,7 +58,7 @@ func ProcessAttesterSlashings( func ProcessAttesterSlashing( ctx context.Context, beaconState state.BeaconState, - slashing *ethpb.AttesterSlashing, + slashing interfaces.AttesterSlashing, slashFunc slashValidatorFunc, ) (state.BeaconState, error) { if err := VerifyAttesterSlashing(ctx, beaconState, slashing); err != nil { @@ -104,20 +105,20 @@ func ProcessAttesterSlashing( } // VerifyAttesterSlashing validates the attestation data in both attestations in the slashing object. -func VerifyAttesterSlashing(ctx context.Context, beaconState state.ReadOnlyBeaconState, slashing *ethpb.AttesterSlashing) error { +func VerifyAttesterSlashing(ctx context.Context, beaconState state.ReadOnlyBeaconState, slashing interfaces.AttesterSlashing) error { if slashing == nil { return errors.New("nil slashing") } - if slashing.Attestation_1 == nil || slashing.Attestation_2 == nil { + if slashing.GetFirstAttestation() == nil || slashing.GetSecondAttestation() == nil { return errors.New("nil attestation") } - if slashing.Attestation_1.Data == nil || slashing.Attestation_2.Data == nil { + if slashing.GetFirstAttestation().GetData() == nil || slashing.GetSecondAttestation().GetData() == nil { return errors.New("nil attestation data") } - att1 := slashing.Attestation_1 - att2 := slashing.Attestation_2 - data1 := att1.Data - data2 := att2.Data + att1 := slashing.GetFirstAttestation() + att2 := slashing.GetSecondAttestation() + data1 := att1.GetData() + data2 := att2.GetData() if !IsSlashableAttestationData(data1, data2) { return errors.New("attestations are not slashable") } @@ -157,11 +158,11 @@ func IsSlashableAttestationData(data1, data2 *ethpb.AttestationData) bool { } // SlashableAttesterIndices returns the intersection of attester indices from both attestations in this slashing. -func SlashableAttesterIndices(slashing *ethpb.AttesterSlashing) []uint64 { - if slashing == nil || slashing.Attestation_1 == nil || slashing.Attestation_2 == nil { +func SlashableAttesterIndices(slashing interfaces.AttesterSlashing) []uint64 { + if slashing == nil || slashing.GetFirstAttestation() == nil || slashing.GetSecondAttestation() == nil { return nil } - indices1 := slashing.Attestation_1.AttestingIndices - indices2 := slashing.Attestation_2.AttestingIndices + indices1 := slashing.GetFirstAttestation().GetAttestingIndices() + indices2 := slashing.GetSecondAttestation().GetAttestingIndices() return slice.IntersectionUint64(indices1, indices2) } diff --git a/beacon-chain/core/blocks/attester_slashing_test.go b/beacon-chain/core/blocks/attester_slashing_test.go index cfa281b0d7bc..295146c77c77 100644 --- a/beacon-chain/core/blocks/attester_slashing_test.go +++ b/beacon-chain/core/blocks/attester_slashing_test.go @@ -9,6 +9,7 @@ import ( v "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -57,7 +58,11 @@ func TestProcessAttesterSlashings_DataNotSlashable(t *testing.T) { AttesterSlashings: slashings, }, } - _, err = blocks.ProcessAttesterSlashings(context.Background(), beaconState, b.Block.Body.AttesterSlashings, v.SlashValidator) + ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + for i, s := range b.Block.Body.AttesterSlashings { + ss[i] = s + } + _, err = blocks.ProcessAttesterSlashings(context.Background(), beaconState, ss, v.SlashValidator) assert.ErrorContains(t, "attestations are not slashable", err) } @@ -92,7 +97,11 @@ func TestProcessAttesterSlashings_IndexedAttestationFailedToVerify(t *testing.T) }, } - _, err = blocks.ProcessAttesterSlashings(context.Background(), beaconState, b.Block.Body.AttesterSlashings, v.SlashValidator) + ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + for i, s := range b.Block.Body.AttesterSlashings { + ss[i] = s + } + _, err = blocks.ProcessAttesterSlashings(context.Background(), beaconState, ss, v.SlashValidator) assert.ErrorContains(t, "validator indices count exceeds MAX_VALIDATORS_PER_COMMITTEE", err) } @@ -144,7 +153,11 @@ func TestProcessAttesterSlashings_AppliesCorrectStatus(t *testing.T) { }, } - newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, b.Block.Body.AttesterSlashings, v.SlashValidator) + ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + for i, s := range b.Block.Body.AttesterSlashings { + ss[i] = s + } + newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, ss, v.SlashValidator) require.NoError(t, err) newRegistry := newState.Validators() @@ -213,7 +226,11 @@ func TestProcessAttesterSlashings_AppliesCorrectStatusAltair(t *testing.T) { }, } - newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, b.Block.Body.AttesterSlashings, v.SlashValidator) + ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + for i, s := range b.Block.Body.AttesterSlashings { + ss[i] = s + } + newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, ss, v.SlashValidator) require.NoError(t, err) newRegistry := newState.Validators() @@ -282,7 +299,11 @@ func TestProcessAttesterSlashings_AppliesCorrectStatusBellatrix(t *testing.T) { }, } - newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, b.Block.Body.AttesterSlashings, v.SlashValidator) + ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + for i, s := range b.Block.Body.AttesterSlashings { + ss[i] = s + } + newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, ss, v.SlashValidator) require.NoError(t, err) newRegistry := newState.Validators() @@ -351,7 +372,11 @@ func TestProcessAttesterSlashings_AppliesCorrectStatusCapella(t *testing.T) { }, } - newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, b.Block.Body.AttesterSlashings, v.SlashValidator) + ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + for i, s := range b.Block.Body.AttesterSlashings { + ss[i] = s + } + newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, ss, v.SlashValidator) require.NoError(t, err) newRegistry := newState.Validators() diff --git a/beacon-chain/core/blocks/block_operations_fuzz_test.go b/beacon-chain/core/blocks/block_operations_fuzz_test.go index d51072620b8c..8d2ac1fbbb74 100644 --- a/beacon-chain/core/blocks/block_operations_fuzz_test.go +++ b/beacon-chain/core/blocks/block_operations_fuzz_test.go @@ -10,6 +10,7 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -216,7 +217,7 @@ func TestFuzzProcessAttesterSlashings_10000(t *testing.T) { fuzzer.Fuzz(a) s, err := state_native.InitializeFromProtoUnsafePhase0(state) require.NoError(t, err) - r, err := ProcessAttesterSlashings(ctx, s, []*ethpb.AttesterSlashing{a}, v.SlashValidator) + r, err := ProcessAttesterSlashings(ctx, s, []interfaces.AttesterSlashing{a}, v.SlashValidator) if err != nil && r != nil { t.Fatalf("return value should be nil on err. found: %v on error: %v for state: %v and slashing: %v", r, err, state, a) } diff --git a/beacon-chain/core/blocks/block_regression_test.go b/beacon-chain/core/blocks/block_regression_test.go index d85761509054..807cea81b48c 100644 --- a/beacon-chain/core/blocks/block_regression_test.go +++ b/beacon-chain/core/blocks/block_regression_test.go @@ -8,6 +8,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" v "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -91,7 +92,11 @@ func TestProcessAttesterSlashings_RegressionSlashableIndices(t *testing.T) { }, } - newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, b.Block.Body.AttesterSlashings, v.SlashValidator) + ss := make([]interfaces.AttesterSlashing, len(b.Block.Body.AttesterSlashings)) + for i, s := range b.Block.Body.AttesterSlashings { + ss[i] = s + } + newState, err := blocks.ProcessAttesterSlashings(context.Background(), beaconState, ss, v.SlashValidator) require.NoError(t, err) newRegistry := newState.Validators() if !newRegistry[expectedSlashedVal].Slashed { diff --git a/beacon-chain/core/blocks/signature.go b/beacon-chain/core/blocks/signature.go index 508de5f1add6..720e025d41bc 100644 --- a/beacon-chain/core/blocks/signature.go +++ b/beacon-chain/core/blocks/signature.go @@ -179,7 +179,7 @@ func randaoSigningData(ctx context.Context, beaconState state.ReadOnlyBeaconStat func createAttestationSignatureBatch( ctx context.Context, beaconState state.ReadOnlyBeaconState, - atts []*ethpb.Attestation, + atts []interfaces.Attestation, domain []byte, ) (*bls.SignatureBatch, error) { if len(atts) == 0 { @@ -191,8 +191,8 @@ func createAttestationSignatureBatch( msgs := make([][32]byte, len(atts)) descs := make([]string, len(atts)) for i, a := range atts { - sigs[i] = a.Signature - c, err := helpers.BeaconCommitteeFromState(ctx, beaconState, a.Data.Slot, a.Data.CommitteeIndex) + sigs[i] = a.GetSignature() + c, err := helpers.BeaconCommitteeFromState(ctx, beaconState, a.GetData().Slot, a.GetData().CommitteeIndex) if err != nil { return nil, err } @@ -203,7 +203,7 @@ func createAttestationSignatureBatch( if err := attestation.IsValidAttestationIndices(ctx, ia); err != nil { return nil, err } - indices := ia.AttestingIndices + indices := ia.GetAttestingIndices() pubkeys := make([][]byte, len(indices)) for i := 0; i < len(indices); i++ { pubkeyAtIdx := beaconState.PubkeyAtIndex(primitives.ValidatorIndex(indices[i])) @@ -215,7 +215,7 @@ func createAttestationSignatureBatch( } pks[i] = aggP - root, err := signing.ComputeSigningRoot(ia.Data, domain) + root, err := signing.ComputeSigningRoot(ia.GetData(), domain) if err != nil { return nil, errors.Wrap(err, "could not get signing root of object") } @@ -233,7 +233,7 @@ func createAttestationSignatureBatch( // AttestationSignatureBatch retrieves all the related attestation signature data such as the relevant public keys, // signatures and attestation signing data and collate it into a signature batch object. -func AttestationSignatureBatch(ctx context.Context, beaconState state.ReadOnlyBeaconState, atts []*ethpb.Attestation) (*bls.SignatureBatch, error) { +func AttestationSignatureBatch(ctx context.Context, beaconState state.ReadOnlyBeaconState, atts []interfaces.Attestation) (*bls.SignatureBatch, error) { if len(atts) == 0 { return bls.NewSet(), nil } @@ -243,10 +243,10 @@ func AttestationSignatureBatch(ctx context.Context, beaconState state.ReadOnlyBe dt := params.BeaconConfig().DomainBeaconAttester // Split attestations by fork. Note: the signature domain will differ based on the fork. - var preForkAtts []*ethpb.Attestation - var postForkAtts []*ethpb.Attestation + var preForkAtts []interfaces.Attestation + var postForkAtts []interfaces.Attestation for _, a := range atts { - if slots.ToEpoch(a.Data.Slot) < fork.Epoch { + if slots.ToEpoch(a.GetData().Slot) < fork.Epoch { preForkAtts = append(preForkAtts, a) } else { postForkAtts = append(postForkAtts, a) diff --git a/beacon-chain/core/epoch/precompute/attestation.go b/beacon-chain/core/epoch/precompute/attestation.go index 9ec7fd0f1ffc..48087d89db85 100644 --- a/beacon-chain/core/epoch/precompute/attestation.go +++ b/beacon-chain/core/epoch/precompute/attestation.go @@ -54,7 +54,7 @@ func ProcessAttestations( return nil, nil, errors.Wrap(err, "could not check validator attested previous epoch") } - committee, err := helpers.BeaconCommitteeFromState(ctx, state, a.Data.Slot, a.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, state, a.GetData().Slot, a.GetData().CommitteeIndex) if err != nil { return nil, nil, err } diff --git a/beacon-chain/core/feed/operation/BUILD.bazel b/beacon-chain/core/feed/operation/BUILD.bazel index 0d475e92d8ce..b159265e1926 100644 --- a/beacon-chain/core/feed/operation/BUILD.bazel +++ b/beacon-chain/core/feed/operation/BUILD.bazel @@ -11,6 +11,7 @@ go_library( deps = [ "//async/event:go_default_library", "//consensus-types/blocks:go_default_library", + "//consensus-types/interfaces:go_default_library", "//proto/prysm/v1alpha1:go_default_library", ], ) diff --git a/beacon-chain/core/feed/operation/events.go b/beacon-chain/core/feed/operation/events.go index ce5eeb2fbc76..2a4bf6942ff1 100644 --- a/beacon-chain/core/feed/operation/events.go +++ b/beacon-chain/core/feed/operation/events.go @@ -3,6 +3,7 @@ package operation import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -37,7 +38,7 @@ const ( // UnAggregatedAttReceivedData is the data sent with UnaggregatedAttReceived events. type UnAggregatedAttReceivedData struct { // Attestation is the unaggregated attestation object. - Attestation *ethpb.Attestation + Attestation interfaces.Attestation } // AggregatedAttReceivedData is the data sent with AggregatedAttReceived events. @@ -75,5 +76,5 @@ type ProposerSlashingReceivedData struct { // AttesterSlashingReceivedData is the data sent with AttesterSlashingReceived events. type AttesterSlashingReceivedData struct { - AttesterSlashing *ethpb.AttesterSlashing + AttesterSlashing interfaces.AttesterSlashing } diff --git a/beacon-chain/core/helpers/BUILD.bazel b/beacon-chain/core/helpers/BUILD.bazel index bbeb7964435f..1912d6c2998c 100644 --- a/beacon-chain/core/helpers/BUILD.bazel +++ b/beacon-chain/core/helpers/BUILD.bazel @@ -25,6 +25,7 @@ go_library( "//beacon-chain/state:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//container/slice:go_default_library", "//container/trie:go_default_library", @@ -72,6 +73,7 @@ go_test( "//beacon-chain/state/state-native:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//container/slice:go_default_library", "//crypto/hash:go_default_library", diff --git a/beacon-chain/core/helpers/attestation.go b/beacon-chain/core/helpers/attestation.go index af153f8faf17..bb620ba17969 100644 --- a/beacon-chain/core/helpers/attestation.go +++ b/beacon-chain/core/helpers/attestation.go @@ -7,6 +7,7 @@ import ( "time" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/hash" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -21,20 +22,20 @@ var ( // ValidateNilAttestation checks if any composite field of input attestation is nil. // Access to these nil fields will result in run time panic, // it is recommended to run these checks as first line of defense. -func ValidateNilAttestation(attestation *ethpb.Attestation) error { +func ValidateNilAttestation(attestation interfaces.Attestation) error { if attestation == nil { return errors.New("attestation can't be nil") } - if attestation.Data == nil { + if attestation.GetData() == nil { return errors.New("attestation's data can't be nil") } - if attestation.Data.Source == nil { + if attestation.GetData().Source == nil { return errors.New("attestation's source can't be nil") } - if attestation.Data.Target == nil { + if attestation.GetData().Target == nil { return errors.New("attestation's target can't be nil") } - if attestation.AggregationBits == nil { + if attestation.GetAggregationBits() == nil { return errors.New("attestation's bitfield can't be nil") } return nil @@ -71,8 +72,8 @@ func IsAggregator(committeeCount uint64, slotSig []byte) (bool, error) { // IsAggregated returns true if the attestation is an aggregated attestation, // false otherwise. -func IsAggregated(attestation *ethpb.Attestation) bool { - return attestation.AggregationBits.Count() > 1 +func IsAggregated(attestation interfaces.Attestation) bool { + return attestation.GetAggregationBits().Count() > 1 } // ComputeSubnetForAttestation returns the subnet for which the provided attestation will be broadcasted to. @@ -90,8 +91,8 @@ func IsAggregated(attestation *ethpb.Attestation) bool { // committees_since_epoch_start = committees_per_slot * slots_since_epoch_start // // return uint64((committees_since_epoch_start + committee_index) % ATTESTATION_SUBNET_COUNT) -func ComputeSubnetForAttestation(activeValCount uint64, att *ethpb.Attestation) uint64 { - return ComputeSubnetFromCommitteeAndSlot(activeValCount, att.Data.CommitteeIndex, att.Data.Slot) +func ComputeSubnetForAttestation(activeValCount uint64, att interfaces.Attestation) uint64 { + return ComputeSubnetFromCommitteeAndSlot(activeValCount, att.GetData().CommitteeIndex, att.GetData().Slot) } // ComputeSubnetFromCommitteeAndSlot is a flattened version of ComputeSubnetForAttestation where we only pass in diff --git a/beacon-chain/core/helpers/attestation_test.go b/beacon-chain/core/helpers/attestation_test.go index 5c3a34a5087a..6ffb5f447695 100644 --- a/beacon-chain/core/helpers/attestation_test.go +++ b/beacon-chain/core/helpers/attestation_test.go @@ -9,6 +9,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" @@ -238,7 +239,7 @@ func TestVerifyCheckpointEpoch_Ok(t *testing.T) { func TestValidateNilAttestation(t *testing.T) { tests := []struct { name string - attestation *ethpb.Attestation + attestation interfaces.Attestation errString string }{ { diff --git a/beacon-chain/core/helpers/beacon_committee.go b/beacon-chain/core/helpers/beacon_committee.go index 715e490b7a64..9cb3f11c6793 100644 --- a/beacon-chain/core/helpers/beacon_committee.go +++ b/beacon-chain/core/helpers/beacon_committee.go @@ -15,12 +15,12 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" "github.com/prysmaticlabs/prysm/v5/crypto/hash" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/math" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" ) @@ -257,8 +257,8 @@ func VerifyBitfieldLength(bf bitfield.Bitfield, committeeSize uint64) error { // VerifyAttestationBitfieldLengths verifies that an attestations aggregation bitfields is // a valid length matching the size of the committee. -func VerifyAttestationBitfieldLengths(ctx context.Context, state state.ReadOnlyBeaconState, att *ethpb.Attestation) error { - committee, err := BeaconCommitteeFromState(ctx, state, att.Data.Slot, att.Data.CommitteeIndex) +func VerifyAttestationBitfieldLengths(ctx context.Context, state state.ReadOnlyBeaconState, att interfaces.Attestation) error { + committee, err := BeaconCommitteeFromState(ctx, state, att.GetData().Slot, att.GetData().CommitteeIndex) if err != nil { return errors.Wrap(err, "could not retrieve beacon committees") } @@ -267,7 +267,7 @@ func VerifyAttestationBitfieldLengths(ctx context.Context, state state.ReadOnlyB return errors.New("no committee exist for this attestation") } - if err := VerifyBitfieldLength(att.AggregationBits, uint64(len(committee))); err != nil { + if err := VerifyBitfieldLength(att.GetAggregationBits(), uint64(len(committee))); err != nil { return errors.Wrap(err, "failed to verify aggregation bitfield") } return nil diff --git a/beacon-chain/core/helpers/validators.go b/beacon-chain/core/helpers/validators.go index e53794d45070..2614c7d17ac0 100644 --- a/beacon-chain/core/helpers/validators.go +++ b/beacon-chain/core/helpers/validators.go @@ -671,5 +671,5 @@ func ValidatorMaxEffectiveBalance(val *ethpb.Validator) uint64 { if HasCompoundingWithdrawalCredential(val) { return params.BeaconConfig().MaxEffectiveBalanceElectra } - return params.BeaconConfig().MinActivationBalance // TODO: Add test that MinActivationBalance == (old) MaxEffectiveBalance + return params.BeaconConfig().MinActivationBalance } diff --git a/beacon-chain/db/slasherkv/slasher.go b/beacon-chain/db/slasherkv/slasher.go index 15c7fcbb23be..1c558e3c59d5 100644 --- a/beacon-chain/db/slasherkv/slasher.go +++ b/beacon-chain/db/slasherkv/slasher.go @@ -156,10 +156,10 @@ func (s *Store) CheckAttesterDoubleVotes( signingRootsBkt := tx.Bucket(attestationDataRootsBucket) attRecordsBkt := tx.Bucket(attestationRecordsBucket) - encEpoch := encodeTargetEpoch(attToProcess.IndexedAttestation.Data.Target.Epoch) + encEpoch := encodeTargetEpoch(attToProcess.IndexedAttestation.GetData().Target.Epoch) localDoubleVotes := make([]*slashertypes.AttesterDoubleVote, 0) - for _, valIdx := range attToProcess.IndexedAttestation.AttestingIndices { + for _, valIdx := range attToProcess.IndexedAttestation.GetAttestingIndices() { // Check if there is signing root in the database for this combination // of validator index and target epoch. encIdx := encodeValidatorIndex(primitives.ValidatorIndex(valIdx)) @@ -194,7 +194,7 @@ func (s *Store) CheckAttesterDoubleVotes( // Build the proof of double vote. slashAtt := &slashertypes.AttesterDoubleVote{ ValidatorIndex: primitives.ValidatorIndex(valIdx), - Target: attToProcess.IndexedAttestation.Data.Target.Epoch, + Target: attToProcess.IndexedAttestation.GetData().Target.Epoch, Wrapper_1: existingAttRecord, Wrapper_2: attToProcess, } @@ -280,7 +280,7 @@ func (s *Store) SaveAttestationRecordsForValidators( encodedRecords := make([][]byte, attWrappersCount) for i, attestation := range attWrappers { - encEpoch := encodeTargetEpoch(attestation.IndexedAttestation.Data.Target.Epoch) + encEpoch := encodeTargetEpoch(attestation.IndexedAttestation.GetData().Target.Epoch) value, err := encodeAttestationRecord(attestation) if err != nil { @@ -325,7 +325,7 @@ func (s *Store) SaveAttestationRecordsForValidators( return err } - for _, validatorIndex := range attWrapper.IndexedAttestation.AttestingIndices { + for _, validatorIndex := range attWrapper.IndexedAttestation.GetAttestingIndices() { encodedIndex := encodeValidatorIndex(primitives.ValidatorIndex(validatorIndex)) key := append(encodedTargetEpoch, encodedIndex...) @@ -638,8 +638,8 @@ func (s *Store) HighestAttestations( } highestAtt := ðpb.HighestAttestation{ ValidatorIndex: uint64(indices[i]), - HighestSourceEpoch: attWrapper.IndexedAttestation.Data.Source.Epoch, - HighestTargetEpoch: attWrapper.IndexedAttestation.Data.Target.Epoch, + HighestSourceEpoch: attWrapper.IndexedAttestation.GetData().Source.Epoch, + HighestTargetEpoch: attWrapper.IndexedAttestation.GetData().Target.Epoch, } history = append(history, highestAtt) break diff --git a/beacon-chain/db/slasherkv/slasher_test.go b/beacon-chain/db/slasherkv/slasher_test.go index 2bbac54cfae5..292e109042c2 100644 --- a/beacon-chain/db/slasherkv/slasher_test.go +++ b/beacon-chain/db/slasherkv/slasher_test.go @@ -62,7 +62,7 @@ func TestStore_AttestationRecordForValidator_SaveRetrieve(t *testing.T) { actual, err := beaconDB.AttestationRecordForValidator(ctx, validatorIndex, primitives.Epoch(i+1)) require.NoError(t, err) - require.DeepEqual(t, expected.IndexedAttestation.Data.Source.Epoch, actual.IndexedAttestation.Data.Source.Epoch) + require.DeepEqual(t, expected.IndexedAttestation.GetData().Source.Epoch, actual.IndexedAttestation.GetData().Source.Epoch) } } @@ -544,7 +544,7 @@ func BenchmarkHighestAttestations(b *testing.B) { for i := 0; i < count; i++ { indicesForAtt := make([]primitives.ValidatorIndex, valsPerAtt) for r := 0; r < valsPerAtt; r++ { - indicesForAtt[r] = primitives.ValidatorIndex(atts[i].IndexedAttestation.AttestingIndices[r]) + indicesForAtt[r] = primitives.ValidatorIndex(atts[i].IndexedAttestation.GetAttestingIndices()[r]) } allIndices = append(allIndices, indicesForAtt...) } diff --git a/beacon-chain/monitor/process_attestation.go b/beacon-chain/monitor/process_attestation.go index 9379292b9a1f..25b90b741b13 100644 --- a/beacon-chain/monitor/process_attestation.go +++ b/beacon-chain/monitor/process_attestation.go @@ -33,12 +33,12 @@ func (s *Service) canUpdateAttestedValidator(idx primitives.ValidatorIndex, slot } // attestingIndices returns the indices of validators that participated in the given aggregated attestation. -func attestingIndices(ctx context.Context, state state.BeaconState, att *ethpb.Attestation) ([]uint64, error) { - committee, err := helpers.BeaconCommitteeFromState(ctx, state, att.Data.Slot, att.Data.CommitteeIndex) +func attestingIndices(ctx context.Context, state state.BeaconState, att interfaces.Attestation) ([]uint64, error) { + committee, err := helpers.BeaconCommitteeFromState(ctx, state, att.GetData().Slot, att.GetData().CommitteeIndex) if err != nil { return nil, err } - return attestation.AttestingIndices(att.AggregationBits, committee) + return attestation.AttestingIndices(att.GetAggregationBits(), committee) } // logMessageTimelyFlagsForIndex returns the log message with performance info for the attestation (head, source, target) @@ -63,7 +63,7 @@ func (s *Service) processAttestations(ctx context.Context, state state.BeaconSta } // processIncludedAttestation logs in the event for the tracked validators' and their latest attestation gets processed. -func (s *Service) processIncludedAttestation(ctx context.Context, state state.BeaconState, att *ethpb.Attestation) { +func (s *Service) processIncludedAttestation(ctx context.Context, state state.BeaconState, att interfaces.Attestation) { attestingIndices, err := attestingIndices(ctx, state, att) if err != nil { log.WithError(err).Error("Could not get attesting indices") @@ -72,8 +72,8 @@ func (s *Service) processIncludedAttestation(ctx context.Context, state state.Be s.Lock() defer s.Unlock() for _, idx := range attestingIndices { - if s.canUpdateAttestedValidator(primitives.ValidatorIndex(idx), att.Data.Slot) { - logFields := logMessageTimelyFlagsForIndex(primitives.ValidatorIndex(idx), att.Data) + if s.canUpdateAttestedValidator(primitives.ValidatorIndex(idx), att.GetData().Slot) { + logFields := logMessageTimelyFlagsForIndex(primitives.ValidatorIndex(idx), att.GetData()) balance, err := state.BalanceAtIndex(primitives.ValidatorIndex(idx)) if err != nil { log.WithError(err).Error("Could not get balance") @@ -88,7 +88,7 @@ func (s *Service) processIncludedAttestation(ctx context.Context, state state.Be balanceChg := int64(balance - latestPerf.balance) latestPerf.balanceChange = balanceChg latestPerf.balance = balance - latestPerf.attestedSlot = att.Data.Slot + latestPerf.attestedSlot = att.GetData().Slot latestPerf.inclusionSlot = state.Slot() inclusionSlotGauge.WithLabelValues(fmt.Sprintf("%d", idx)).Set(float64(latestPerf.inclusionSlot)) aggregatedPerf.totalDistance += uint64(latestPerf.inclusionSlot - latestPerf.attestedSlot) @@ -161,10 +161,10 @@ func (s *Service) processIncludedAttestation(ctx context.Context, state state.Be } // processUnaggregatedAttestation logs when the beacon node observes an unaggregated attestation from tracked validator. -func (s *Service) processUnaggregatedAttestation(ctx context.Context, att *ethpb.Attestation) { +func (s *Service) processUnaggregatedAttestation(ctx context.Context, att interfaces.Attestation) { s.RLock() defer s.RUnlock() - root := bytesutil.ToBytes32(att.Data.BeaconBlockRoot) + root := bytesutil.ToBytes32(att.GetData().BeaconBlockRoot) st := s.config.StateGen.StateByRootIfCachedNoCopy(root) if st == nil { log.WithField("beaconBlockRoot", fmt.Sprintf("%#x", bytesutil.Trunc(root[:]))).Debug( @@ -177,8 +177,8 @@ func (s *Service) processUnaggregatedAttestation(ctx context.Context, att *ethpb return } for _, idx := range attestingIndices { - if s.canUpdateAttestedValidator(primitives.ValidatorIndex(idx), att.Data.Slot) { - logFields := logMessageTimelyFlagsForIndex(primitives.ValidatorIndex(idx), att.Data) + if s.canUpdateAttestedValidator(primitives.ValidatorIndex(idx), att.GetData().Slot) { + logFields := logMessageTimelyFlagsForIndex(primitives.ValidatorIndex(idx), att.GetData()) log.WithFields(logFields).Info("Processed unaggregated attestation") } } diff --git a/beacon-chain/monitor/process_block.go b/beacon-chain/monitor/process_block.go index 65101da4c7f1..d1661a3dfb6d 100644 --- a/beacon-chain/monitor/process_block.go +++ b/beacon-chain/monitor/process_block.go @@ -124,14 +124,14 @@ func (s *Service) processSlashings(blk interfaces.ReadOnlyBeaconBlock) { log.WithFields(logrus.Fields{ "attesterIndex": idx, "blockInclusionSlot": blk.Slot(), - "attestationSlot1": slashing.Attestation_1.Data.Slot, - "beaconBlockRoot1": fmt.Sprintf("%#x", bytesutil.Trunc(slashing.Attestation_1.Data.BeaconBlockRoot)), - "sourceEpoch1": slashing.Attestation_1.Data.Source.Epoch, - "targetEpoch1": slashing.Attestation_1.Data.Target.Epoch, - "attestationSlot2": slashing.Attestation_2.Data.Slot, - "beaconBlockRoot2": fmt.Sprintf("%#x", bytesutil.Trunc(slashing.Attestation_2.Data.BeaconBlockRoot)), - "sourceEpoch2": slashing.Attestation_2.Data.Source.Epoch, - "targetEpoch2": slashing.Attestation_2.Data.Target.Epoch, + "attestationSlot1": slashing.GetFirstAttestation().GetData().Slot, + "beaconBlockRoot1": fmt.Sprintf("%#x", bytesutil.Trunc(slashing.GetFirstAttestation().GetData().BeaconBlockRoot)), + "sourceEpoch1": slashing.GetFirstAttestation().GetData().Source.Epoch, + "targetEpoch1": slashing.GetFirstAttestation().GetData().Target.Epoch, + "attestationSlot2": slashing.GetSecondAttestation().GetData().Slot, + "beaconBlockRoot2": fmt.Sprintf("%#x", bytesutil.Trunc(slashing.GetSecondAttestation().GetData().BeaconBlockRoot)), + "sourceEpoch2": slashing.GetSecondAttestation().GetData().Source.Epoch, + "targetEpoch2": slashing.GetSecondAttestation().GetData().Target.Epoch, }).Info("Attester slashing was included") } } diff --git a/beacon-chain/operations/attestations/BUILD.bazel b/beacon-chain/operations/attestations/BUILD.bazel index 5b4cc57b38d4..96f11a78f746 100644 --- a/beacon-chain/operations/attestations/BUILD.bazel +++ b/beacon-chain/operations/attestations/BUILD.bazel @@ -20,9 +20,9 @@ go_library( "//cache/lru:go_default_library", "//config/features:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/hash:go_default_library", - "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/attestation/aggregation/attestations:go_default_library", "//time:go_default_library", "//time/slots:go_default_library", @@ -49,6 +49,7 @@ go_test( "//beacon-chain/operations/attestations/kv:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/beacon-chain/operations/attestations/kv/BUILD.bazel b/beacon-chain/operations/attestations/kv/BUILD.bazel index 807bc292003f..a2daf64e8378 100644 --- a/beacon-chain/operations/attestations/kv/BUILD.bazel +++ b/beacon-chain/operations/attestations/kv/BUILD.bazel @@ -15,9 +15,9 @@ go_library( deps = [ "//beacon-chain/core/helpers:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/hash:go_default_library", - "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/attestation/aggregation/attestations:go_default_library", "@com_github_patrickmn_go_cache//:go_default_library", "@com_github_pkg_errors//:go_default_library", @@ -39,6 +39,7 @@ go_test( embed = [":go_default_library"], deps = [ "//config/fieldparams:go_default_library", + "//consensus-types/interfaces:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/assert:go_default_library", diff --git a/beacon-chain/operations/attestations/kv/aggregated.go b/beacon-chain/operations/attestations/kv/aggregated.go index 2bcf16190a3f..8c11767db2ef 100644 --- a/beacon-chain/operations/attestations/kv/aggregated.go +++ b/beacon-chain/operations/attestations/kv/aggregated.go @@ -7,8 +7,8 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations" log "github.com/sirupsen/logrus" "go.opencensus.io/trace" @@ -28,13 +28,13 @@ func (c *AttCaches) AggregateUnaggregatedAttestations(ctx context.Context) error return c.aggregateUnaggregatedAtts(ctx, unaggregatedAtts) } -func (c *AttCaches) aggregateUnaggregatedAtts(ctx context.Context, unaggregatedAtts []*ethpb.Attestation) error { +func (c *AttCaches) aggregateUnaggregatedAtts(ctx context.Context, unaggregatedAtts []interfaces.Attestation) error { _, span := trace.StartSpan(ctx, "operations.attestations.kv.aggregateUnaggregatedAtts") defer span.End() - attsByDataRoot := make(map[[32]byte][]*ethpb.Attestation, len(unaggregatedAtts)) + attsByDataRoot := make(map[[32]byte][]interfaces.Attestation, len(unaggregatedAtts)) for _, att := range unaggregatedAtts { - attDataRoot, err := att.Data.HashTreeRoot() + attDataRoot, err := att.GetData().HashTreeRoot() if err != nil { return err } @@ -66,12 +66,12 @@ func (c *AttCaches) aggregateUnaggregatedAtts(ctx context.Context, unaggregatedA // aggregateParallel aggregates attestations in parallel for `atts` and saves them in the pool, // returns the unaggregated attestations that weren't able to aggregate. // Given `n` CPU cores, it creates a channel of size `n` and spawns `n` goroutines to aggregate attestations -func (c *AttCaches) aggregateParallel(atts map[[32]byte][]*ethpb.Attestation, leftOver map[[32]byte]bool) map[[32]byte]bool { +func (c *AttCaches) aggregateParallel(atts map[[32]byte][]interfaces.Attestation, leftOver map[[32]byte]bool) map[[32]byte]bool { var leftoverLock sync.Mutex wg := sync.WaitGroup{} n := runtime.GOMAXPROCS(0) // defaults to the value of runtime.NumCPU - ch := make(chan []*ethpb.Attestation, n) + ch := make(chan []interfaces.Attestation, n) wg.Add(n) for i := 0; i < n; i++ { go func() { @@ -87,7 +87,7 @@ func (c *AttCaches) aggregateParallel(atts map[[32]byte][]*ethpb.Attestation, le continue } if helpers.IsAggregated(aggregated) { - if err := c.SaveAggregatedAttestations([]*ethpb.Attestation{aggregated}); err != nil { + if err := c.SaveAggregatedAttestations([]interfaces.Attestation{aggregated}); err != nil { log.WithError(err).Error("could not save aggregated attestation") continue } @@ -116,7 +116,7 @@ func (c *AttCaches) aggregateParallel(atts map[[32]byte][]*ethpb.Attestation, le } // SaveAggregatedAttestation saves an aggregated attestation in cache. -func (c *AttCaches) SaveAggregatedAttestation(att *ethpb.Attestation) error { +func (c *AttCaches) SaveAggregatedAttestation(att interfaces.Attestation) error { if err := helpers.ValidateNilAttestation(att); err != nil { return err } @@ -139,16 +139,16 @@ func (c *AttCaches) SaveAggregatedAttestation(att *ethpb.Attestation) error { return nil } - r, err := hashFn(att.Data) + r, err := hashFn(att.GetData()) if err != nil { return errors.Wrap(err, "could not tree hash attestation") } - copiedAtt := ethpb.CopyAttestation(att) + copiedAtt := interfaces.CopyAttestation(att) c.aggregatedAttLock.Lock() defer c.aggregatedAttLock.Unlock() atts, ok := c.aggregatedAtt[r] if !ok { - atts := []*ethpb.Attestation{copiedAtt} + atts := []interfaces.Attestation{copiedAtt} c.aggregatedAtt[r] = atts return nil } @@ -163,7 +163,7 @@ func (c *AttCaches) SaveAggregatedAttestation(att *ethpb.Attestation) error { } // SaveAggregatedAttestations saves a list of aggregated attestations in cache. -func (c *AttCaches) SaveAggregatedAttestations(atts []*ethpb.Attestation) error { +func (c *AttCaches) SaveAggregatedAttestations(atts []interfaces.Attestation) error { for _, att := range atts { if err := c.SaveAggregatedAttestation(att); err != nil { log.WithError(err).Debug("Could not save aggregated attestation") @@ -176,11 +176,11 @@ func (c *AttCaches) SaveAggregatedAttestations(atts []*ethpb.Attestation) error } // AggregatedAttestations returns the aggregated attestations in cache. -func (c *AttCaches) AggregatedAttestations() []*ethpb.Attestation { +func (c *AttCaches) AggregatedAttestations() []interfaces.Attestation { c.aggregatedAttLock.RLock() defer c.aggregatedAttLock.RUnlock() - atts := make([]*ethpb.Attestation, 0) + atts := make([]interfaces.Attestation, 0) for _, a := range c.aggregatedAtt { atts = append(atts, a...) @@ -191,16 +191,16 @@ func (c *AttCaches) AggregatedAttestations() []*ethpb.Attestation { // AggregatedAttestationsBySlotIndex returns the aggregated attestations in cache, // filtered by committee index and slot. -func (c *AttCaches) AggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []*ethpb.Attestation { +func (c *AttCaches) AggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []interfaces.Attestation { _, span := trace.StartSpan(ctx, "operations.attestations.kv.AggregatedAttestationsBySlotIndex") defer span.End() - atts := make([]*ethpb.Attestation, 0) + atts := make([]interfaces.Attestation, 0) c.aggregatedAttLock.RLock() defer c.aggregatedAttLock.RUnlock() for _, a := range c.aggregatedAtt { - if slot == a[0].Data.Slot && committeeIndex == a[0].Data.CommitteeIndex { + if slot == a[0].GetData().Slot && committeeIndex == a[0].GetData().CommitteeIndex { atts = append(atts, a...) } } @@ -209,14 +209,14 @@ func (c *AttCaches) AggregatedAttestationsBySlotIndex(ctx context.Context, slot } // DeleteAggregatedAttestation deletes the aggregated attestations in cache. -func (c *AttCaches) DeleteAggregatedAttestation(att *ethpb.Attestation) error { +func (c *AttCaches) DeleteAggregatedAttestation(att interfaces.Attestation) error { if err := helpers.ValidateNilAttestation(att); err != nil { return err } if !helpers.IsAggregated(att) { return errors.New("attestation is not aggregated") } - r, err := hashFn(att.Data) + r, err := hashFn(att.GetData()) if err != nil { return errors.Wrap(err, "could not tree hash attestation data") } @@ -232,9 +232,9 @@ func (c *AttCaches) DeleteAggregatedAttestation(att *ethpb.Attestation) error { return nil } - filtered := make([]*ethpb.Attestation, 0) + filtered := make([]interfaces.Attestation, 0) for _, a := range attList { - if c, err := att.AggregationBits.Contains(a.AggregationBits); err != nil { + if c, err := att.GetAggregationBits().Contains(a.GetAggregationBits()); err != nil { return err } else if !c { filtered = append(filtered, a) @@ -250,11 +250,11 @@ func (c *AttCaches) DeleteAggregatedAttestation(att *ethpb.Attestation) error { } // HasAggregatedAttestation checks if the input attestations has already existed in cache. -func (c *AttCaches) HasAggregatedAttestation(att *ethpb.Attestation) (bool, error) { +func (c *AttCaches) HasAggregatedAttestation(att interfaces.Attestation) (bool, error) { if err := helpers.ValidateNilAttestation(att); err != nil { return false, err } - r, err := hashFn(att.Data) + r, err := hashFn(att.GetData()) if err != nil { return false, errors.Wrap(err, "could not tree hash attestation") } @@ -263,7 +263,7 @@ func (c *AttCaches) HasAggregatedAttestation(att *ethpb.Attestation) (bool, erro defer c.aggregatedAttLock.RUnlock() if atts, ok := c.aggregatedAtt[r]; ok { for _, a := range atts { - if c, err := a.AggregationBits.Contains(att.AggregationBits); err != nil { + if c, err := a.GetAggregationBits().Contains(att.GetAggregationBits()); err != nil { return false, err } else if c { return true, nil @@ -275,7 +275,7 @@ func (c *AttCaches) HasAggregatedAttestation(att *ethpb.Attestation) (bool, erro defer c.blockAttLock.RUnlock() if atts, ok := c.blockAtt[r]; ok { for _, a := range atts { - if c, err := a.AggregationBits.Contains(att.AggregationBits); err != nil { + if c, err := a.GetAggregationBits().Contains(att.GetAggregationBits()); err != nil { return false, err } else if c { return true, nil diff --git a/beacon-chain/operations/attestations/kv/aggregated_test.go b/beacon-chain/operations/attestations/kv/aggregated_test.go index 0ad4b5a43239..37a8e5013ddd 100644 --- a/beacon-chain/operations/attestations/kv/aggregated_test.go +++ b/beacon-chain/operations/attestations/kv/aggregated_test.go @@ -9,6 +9,7 @@ import ( "github.com/pkg/errors" fssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" @@ -30,7 +31,7 @@ func TestKV_Aggregated_AggregateUnaggregatedAttestations(t *testing.T) { att6 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1010}, Signature: sig1.Marshal()}) att7 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1100}, Signature: sig1.Marshal()}) att8 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1001}, Signature: sig2.Marshal()}) - atts := []*ethpb.Attestation{att1, att2, att3, att4, att5, att6, att7, att8} + atts := []interfaces.Attestation{att1, att2, att3, att4, att5, att6, att7, att8} require.NoError(t, cache.SaveUnaggregatedAttestations(atts)) require.NoError(t, cache.AggregateUnaggregatedAttestations(context.Background())) @@ -41,7 +42,7 @@ func TestKV_Aggregated_AggregateUnaggregatedAttestations(t *testing.T) { func TestKV_Aggregated_SaveAggregatedAttestation(t *testing.T) { tests := []struct { name string - att *ethpb.Attestation + att interfaces.Attestation count int wantErrString string }{ @@ -118,13 +119,13 @@ func TestKV_Aggregated_SaveAggregatedAttestation(t *testing.T) { func TestKV_Aggregated_SaveAggregatedAttestations(t *testing.T) { tests := []struct { name string - atts []*ethpb.Attestation + atts []interfaces.Attestation count int wantErrString string }{ { name: "no duplicates", - atts: []*ethpb.Attestation{ + atts: []interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, @@ -153,13 +154,13 @@ func TestKV_Aggregated_SaveAggregatedAttestations(t *testing.T) { func TestKV_Aggregated_SaveAggregatedAttestations_SomeGoodSomeBad(t *testing.T) { tests := []struct { name string - atts []*ethpb.Attestation + atts []interfaces.Attestation count int wantErrString string }{ { name: "the first attestation is bad", - atts: []*ethpb.Attestation{ + atts: []interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1100}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, @@ -191,7 +192,7 @@ func TestKV_Aggregated_AggregatedAttestations(t *testing.T) { att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}) att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}}) - atts := []*ethpb.Attestation{att1, att2, att3} + atts := []interfaces.Attestation{att1, att2, att3} for _, att := range atts { require.NoError(t, cache.SaveAggregatedAttestation(att)) @@ -199,7 +200,7 @@ func TestKV_Aggregated_AggregatedAttestations(t *testing.T) { returned := cache.AggregatedAttestations() sort.Slice(returned, func(i, j int) bool { - return returned[i].Data.Slot < returned[j].Data.Slot + return returned[i].GetData().Slot < returned[j].GetData().Slot }) assert.DeepSSZEqual(t, atts, returned) } @@ -246,13 +247,13 @@ func TestKV_Aggregated_DeleteAggregatedAttestation(t *testing.T) { att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b11010}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b11010}}) att4 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b10101}}) - atts := []*ethpb.Attestation{att1, att2, att3, att4} + atts := []interfaces.Attestation{att1, att2, att3, att4} require.NoError(t, cache.SaveAggregatedAttestations(atts)) require.NoError(t, cache.DeleteAggregatedAttestation(att1)) require.NoError(t, cache.DeleteAggregatedAttestation(att3)) returned := cache.AggregatedAttestations() - wanted := []*ethpb.Attestation{att2} + wanted := []interfaces.Attestation{att2} assert.DeepEqual(t, wanted, returned) }) @@ -262,16 +263,16 @@ func TestKV_Aggregated_DeleteAggregatedAttestation(t *testing.T) { att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b110111}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b110100}}) att4 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b110101}}) - atts := []*ethpb.Attestation{att1, att2, att3, att4} + atts := []interfaces.Attestation{att1, att2, att3, att4} require.NoError(t, cache.SaveAggregatedAttestations(atts)) assert.Equal(t, 2, cache.AggregatedAttestationCount(), "Unexpected number of atts") require.NoError(t, cache.DeleteAggregatedAttestation(att4)) returned := cache.AggregatedAttestations() - wanted := []*ethpb.Attestation{att1, att2} + wanted := []interfaces.Attestation{att1, att2} sort.Slice(returned, func(i, j int) bool { - return string(returned[i].AggregationBits) < string(returned[j].AggregationBits) + return string(returned[i].GetAggregationBits()) < string(returned[j].GetAggregationBits()) }) assert.DeepEqual(t, wanted, returned) }) @@ -280,7 +281,7 @@ func TestKV_Aggregated_DeleteAggregatedAttestation(t *testing.T) { func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { tests := []struct { name string - existing []*ethpb.Attestation + existing []interfaces.Attestation input *ethpb.Attestation want bool err error @@ -319,7 +320,7 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "single attestation in cache with exact match", - existing: []*ethpb.Attestation{{ + existing: []interfaces.Attestation{ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, }), @@ -334,7 +335,7 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "single attestation in cache with subset aggregation", - existing: []*ethpb.Attestation{{ + existing: []interfaces.Attestation{ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, }), @@ -349,7 +350,7 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "single attestation in cache with superset aggregation", - existing: []*ethpb.Attestation{{ + existing: []interfaces.Attestation{ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, }), @@ -364,14 +365,14 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "multiple attestations with same data in cache with overlapping aggregation, input is subset", - existing: []*ethpb.Attestation{ - { + existing: []interfaces.Attestation{ + ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, }), AggregationBits: bitfield.Bitlist{0b1111000}, }, - { + ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, }), @@ -387,14 +388,14 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "multiple attestations with same data in cache with overlapping aggregation and input is superset", - existing: []*ethpb.Attestation{ - { + existing: []interfaces.Attestation{ + ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, }), AggregationBits: bitfield.Bitlist{0b1111000}, }, - { + ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 1, }), @@ -410,14 +411,14 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "multiple attestations with different data in cache", - existing: []*ethpb.Attestation{ - { + existing: []interfaces.Attestation{ + ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 2, }), AggregationBits: bitfield.Bitlist{0b1111000}, }, - { + ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 3, }), @@ -433,8 +434,8 @@ func TestKV_Aggregated_HasAggregatedAttestation(t *testing.T) { }, { name: "attestations with different bitlist lengths", - existing: []*ethpb.Attestation{ - { + existing: []interfaces.Attestation{ + ðpb.Attestation{ Data: util.HydrateAttestationData(ðpb.AttestationData{ Slot: 2, }), diff --git a/beacon-chain/operations/attestations/kv/block.go b/beacon-chain/operations/attestations/kv/block.go index 757fe8766b20..797deb6913c1 100644 --- a/beacon-chain/operations/attestations/kv/block.go +++ b/beacon-chain/operations/attestations/kv/block.go @@ -2,15 +2,15 @@ package kv import ( "github.com/pkg/errors" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ) // SaveBlockAttestation saves an block attestation in cache. -func (c *AttCaches) SaveBlockAttestation(att *ethpb.Attestation) error { +func (c *AttCaches) SaveBlockAttestation(att interfaces.Attestation) error { if att == nil { return nil } - r, err := hashFn(att.Data) + r, err := hashFn(att.GetData()) if err != nil { return errors.Wrap(err, "could not tree hash attestation") } @@ -19,26 +19,26 @@ func (c *AttCaches) SaveBlockAttestation(att *ethpb.Attestation) error { defer c.blockAttLock.Unlock() atts, ok := c.blockAtt[r] if !ok { - atts = make([]*ethpb.Attestation, 0, 1) + atts = make([]interfaces.Attestation, 0, 1) } // Ensure that this attestation is not already fully contained in an existing attestation. for _, a := range atts { - if c, err := a.AggregationBits.Contains(att.AggregationBits); err != nil { + if c, err := a.GetAggregationBits().Contains(att.GetAggregationBits()); err != nil { return err } else if c { return nil } } - c.blockAtt[r] = append(atts, ethpb.CopyAttestation(att)) + c.blockAtt[r] = append(atts, interfaces.CopyAttestation(att)) return nil } // BlockAttestations returns the block attestations in cache. -func (c *AttCaches) BlockAttestations() []*ethpb.Attestation { - atts := make([]*ethpb.Attestation, 0) +func (c *AttCaches) BlockAttestations() []interfaces.Attestation { + atts := make([]interfaces.Attestation, 0) c.blockAttLock.RLock() defer c.blockAttLock.RUnlock() @@ -50,11 +50,11 @@ func (c *AttCaches) BlockAttestations() []*ethpb.Attestation { } // DeleteBlockAttestation deletes a block attestation in cache. -func (c *AttCaches) DeleteBlockAttestation(att *ethpb.Attestation) error { +func (c *AttCaches) DeleteBlockAttestation(att interfaces.Attestation) error { if att == nil { return nil } - r, err := hashFn(att.Data) + r, err := hashFn(att.GetData()) if err != nil { return errors.Wrap(err, "could not tree hash attestation") } diff --git a/beacon-chain/operations/attestations/kv/block_test.go b/beacon-chain/operations/attestations/kv/block_test.go index 52fc996e50ef..c1a26181e925 100644 --- a/beacon-chain/operations/attestations/kv/block_test.go +++ b/beacon-chain/operations/attestations/kv/block_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -17,7 +18,7 @@ func TestKV_BlockAttestation_CanSaveRetrieve(t *testing.T) { att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}) att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}}) - atts := []*ethpb.Attestation{att1, att2, att3} + atts := []interfaces.Attestation{att1, att2, att3} for _, att := range atts { require.NoError(t, cache.SaveBlockAttestation(att)) @@ -31,7 +32,7 @@ func TestKV_BlockAttestation_CanSaveRetrieve(t *testing.T) { returned := cache.BlockAttestations() sort.Slice(returned, func(i, j int) bool { - return returned[i].Data.Slot < returned[j].Data.Slot + return returned[i].GetData().Slot < returned[j].GetData().Slot }) assert.DeepEqual(t, atts, returned) @@ -43,7 +44,7 @@ func TestKV_BlockAttestation_CanDelete(t *testing.T) { att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}) att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}}) - atts := []*ethpb.Attestation{att1, att2, att3} + atts := []interfaces.Attestation{att1, att2, att3} for _, att := range atts { require.NoError(t, cache.SaveBlockAttestation(att)) @@ -53,6 +54,6 @@ func TestKV_BlockAttestation_CanDelete(t *testing.T) { require.NoError(t, cache.DeleteBlockAttestation(att3)) returned := cache.BlockAttestations() - wanted := []*ethpb.Attestation{att2} + wanted := []interfaces.Attestation{att2} assert.DeepEqual(t, wanted, returned) } diff --git a/beacon-chain/operations/attestations/kv/forkchoice.go b/beacon-chain/operations/attestations/kv/forkchoice.go index 323a2a41b098..202b6ef8998f 100644 --- a/beacon-chain/operations/attestations/kv/forkchoice.go +++ b/beacon-chain/operations/attestations/kv/forkchoice.go @@ -2,11 +2,11 @@ package kv import ( "github.com/pkg/errors" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ) // SaveForkchoiceAttestation saves an forkchoice attestation in cache. -func (c *AttCaches) SaveForkchoiceAttestation(att *ethpb.Attestation) error { +func (c *AttCaches) SaveForkchoiceAttestation(att interfaces.Attestation) error { if att == nil { return nil } @@ -15,7 +15,7 @@ func (c *AttCaches) SaveForkchoiceAttestation(att *ethpb.Attestation) error { return errors.Wrap(err, "could not tree hash attestation") } - att = ethpb.CopyAttestation(att) + att = interfaces.CopyAttestation(att) c.forkchoiceAttLock.Lock() defer c.forkchoiceAttLock.Unlock() c.forkchoiceAtt[r] = att @@ -24,7 +24,7 @@ func (c *AttCaches) SaveForkchoiceAttestation(att *ethpb.Attestation) error { } // SaveForkchoiceAttestations saves a list of forkchoice attestations in cache. -func (c *AttCaches) SaveForkchoiceAttestations(atts []*ethpb.Attestation) error { +func (c *AttCaches) SaveForkchoiceAttestations(atts []interfaces.Attestation) error { for _, att := range atts { if err := c.SaveForkchoiceAttestation(att); err != nil { return err @@ -35,20 +35,20 @@ func (c *AttCaches) SaveForkchoiceAttestations(atts []*ethpb.Attestation) error } // ForkchoiceAttestations returns the forkchoice attestations in cache. -func (c *AttCaches) ForkchoiceAttestations() []*ethpb.Attestation { +func (c *AttCaches) ForkchoiceAttestations() []interfaces.Attestation { c.forkchoiceAttLock.RLock() defer c.forkchoiceAttLock.RUnlock() - atts := make([]*ethpb.Attestation, 0, len(c.forkchoiceAtt)) + atts := make([]interfaces.Attestation, 0, len(c.forkchoiceAtt)) for _, att := range c.forkchoiceAtt { - atts = append(atts, ethpb.CopyAttestation(att) /* Copied */) + atts = append(atts, interfaces.CopyAttestation(att) /* Copied */) } return atts } // DeleteForkchoiceAttestation deletes a forkchoice attestation in cache. -func (c *AttCaches) DeleteForkchoiceAttestation(att *ethpb.Attestation) error { +func (c *AttCaches) DeleteForkchoiceAttestation(att interfaces.Attestation) error { if att == nil { return nil } diff --git a/beacon-chain/operations/attestations/kv/forkchoice_test.go b/beacon-chain/operations/attestations/kv/forkchoice_test.go index aa04117a1c2e..005c53f79b70 100644 --- a/beacon-chain/operations/attestations/kv/forkchoice_test.go +++ b/beacon-chain/operations/attestations/kv/forkchoice_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -17,7 +18,7 @@ func TestKV_Forkchoice_CanSaveRetrieve(t *testing.T) { att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}) att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}}) - atts := []*ethpb.Attestation{att1, att2, att3} + atts := []interfaces.Attestation{att1, att2, att3} for _, att := range atts { require.NoError(t, cache.SaveForkchoiceAttestation(att)) @@ -26,7 +27,7 @@ func TestKV_Forkchoice_CanSaveRetrieve(t *testing.T) { returned := cache.ForkchoiceAttestations() sort.Slice(returned, func(i, j int) bool { - return returned[i].Data.Slot < returned[j].Data.Slot + return returned[i].GetData().Slot < returned[j].GetData().Slot }) assert.DeepEqual(t, atts, returned) @@ -38,7 +39,7 @@ func TestKV_Forkchoice_CanDelete(t *testing.T) { att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b1101}}) att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b1101}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b1101}}) - atts := []*ethpb.Attestation{att1, att2, att3} + atts := []interfaces.Attestation{att1, att2, att3} for _, att := range atts { require.NoError(t, cache.SaveForkchoiceAttestation(att)) @@ -48,7 +49,7 @@ func TestKV_Forkchoice_CanDelete(t *testing.T) { require.NoError(t, cache.DeleteForkchoiceAttestation(att3)) returned := cache.ForkchoiceAttestations() - wanted := []*ethpb.Attestation{att2} + wanted := []interfaces.Attestation{att2} assert.DeepEqual(t, wanted, returned) } diff --git a/beacon-chain/operations/attestations/kv/kv.go b/beacon-chain/operations/attestations/kv/kv.go index 93bbcfef44dd..f6bd3bcd70dd 100644 --- a/beacon-chain/operations/attestations/kv/kv.go +++ b/beacon-chain/operations/attestations/kv/kv.go @@ -9,8 +9,8 @@ import ( "github.com/patrickmn/go-cache" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/hash" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) var hashFn = hash.Proto @@ -20,13 +20,13 @@ var hashFn = hash.Proto // such are unaggregated, aggregated or attestations within a block. type AttCaches struct { aggregatedAttLock sync.RWMutex - aggregatedAtt map[[32]byte][]*ethpb.Attestation + aggregatedAtt map[[32]byte][]interfaces.Attestation unAggregateAttLock sync.RWMutex - unAggregatedAtt map[[32]byte]*ethpb.Attestation + unAggregatedAtt map[[32]byte]interfaces.Attestation forkchoiceAttLock sync.RWMutex - forkchoiceAtt map[[32]byte]*ethpb.Attestation + forkchoiceAtt map[[32]byte]interfaces.Attestation blockAttLock sync.RWMutex - blockAtt map[[32]byte][]*ethpb.Attestation + blockAtt map[[32]byte][]interfaces.Attestation seenAtt *cache.Cache } @@ -36,10 +36,10 @@ func NewAttCaches() *AttCaches { secsInEpoch := time.Duration(params.BeaconConfig().SlotsPerEpoch.Mul(params.BeaconConfig().SecondsPerSlot)) c := cache.New(secsInEpoch*time.Second, 2*secsInEpoch*time.Second) pool := &AttCaches{ - unAggregatedAtt: make(map[[32]byte]*ethpb.Attestation), - aggregatedAtt: make(map[[32]byte][]*ethpb.Attestation), - forkchoiceAtt: make(map[[32]byte]*ethpb.Attestation), - blockAtt: make(map[[32]byte][]*ethpb.Attestation), + unAggregatedAtt: make(map[[32]byte]interfaces.Attestation), + aggregatedAtt: make(map[[32]byte][]interfaces.Attestation), + forkchoiceAtt: make(map[[32]byte]interfaces.Attestation), + blockAtt: make(map[[32]byte][]interfaces.Attestation), seenAtt: c, } diff --git a/beacon-chain/operations/attestations/kv/seen_bits.go b/beacon-chain/operations/attestations/kv/seen_bits.go index 0992b52a39a9..aceb7f875362 100644 --- a/beacon-chain/operations/attestations/kv/seen_bits.go +++ b/beacon-chain/operations/attestations/kv/seen_bits.go @@ -4,11 +4,11 @@ import ( "github.com/patrickmn/go-cache" "github.com/pkg/errors" "github.com/prysmaticlabs/go-bitfield" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ) -func (c *AttCaches) insertSeenBit(att *ethpb.Attestation) error { - r, err := hashFn(att.Data) +func (c *AttCaches) insertSeenBit(att interfaces.Attestation) error { + r, err := hashFn(att.GetData()) if err != nil { return err } @@ -21,7 +21,7 @@ func (c *AttCaches) insertSeenBit(att *ethpb.Attestation) error { } alreadyExists := false for _, bit := range seenBits { - if c, err := bit.Contains(att.AggregationBits); err != nil { + if c, err := bit.Contains(att.GetAggregationBits()); err != nil { return err } else if c { alreadyExists = true @@ -29,18 +29,18 @@ func (c *AttCaches) insertSeenBit(att *ethpb.Attestation) error { } } if !alreadyExists { - seenBits = append(seenBits, att.AggregationBits) + seenBits = append(seenBits, att.GetAggregationBits()) } c.seenAtt.Set(string(r[:]), seenBits, cache.DefaultExpiration /* one epoch */) return nil } - c.seenAtt.Set(string(r[:]), []bitfield.Bitlist{att.AggregationBits}, cache.DefaultExpiration /* one epoch */) + c.seenAtt.Set(string(r[:]), []bitfield.Bitlist{att.GetAggregationBits()}, cache.DefaultExpiration /* one epoch */) return nil } -func (c *AttCaches) hasSeenBit(att *ethpb.Attestation) (bool, error) { - r, err := hashFn(att.Data) +func (c *AttCaches) hasSeenBit(att interfaces.Attestation) (bool, error) { + r, err := hashFn(att.GetData()) if err != nil { return false, err } @@ -52,7 +52,7 @@ func (c *AttCaches) hasSeenBit(att *ethpb.Attestation) (bool, error) { return false, errors.New("could not convert to bitlist type") } for _, bit := range seenBits { - if c, err := bit.Contains(att.AggregationBits); err != nil { + if c, err := bit.Contains(att.GetAggregationBits()); err != nil { return false, err } else if c { return true, nil diff --git a/beacon-chain/operations/attestations/kv/unaggregated.go b/beacon-chain/operations/attestations/kv/unaggregated.go index 2275f6cb6143..e16e36cbc745 100644 --- a/beacon-chain/operations/attestations/kv/unaggregated.go +++ b/beacon-chain/operations/attestations/kv/unaggregated.go @@ -5,13 +5,13 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "go.opencensus.io/trace" ) // SaveUnaggregatedAttestation saves an unaggregated attestation in cache. -func (c *AttCaches) SaveUnaggregatedAttestation(att *ethpb.Attestation) error { +func (c *AttCaches) SaveUnaggregatedAttestation(att interfaces.Attestation) error { if att == nil { return nil } @@ -31,7 +31,7 @@ func (c *AttCaches) SaveUnaggregatedAttestation(att *ethpb.Attestation) error { if err != nil { return errors.Wrap(err, "could not tree hash attestation") } - att = ethpb.CopyAttestation(att) // Copied. + att = interfaces.CopyAttestation(att) // Copied. c.unAggregateAttLock.Lock() defer c.unAggregateAttLock.Unlock() c.unAggregatedAtt[r] = att @@ -40,7 +40,7 @@ func (c *AttCaches) SaveUnaggregatedAttestation(att *ethpb.Attestation) error { } // SaveUnaggregatedAttestations saves a list of unaggregated attestations in cache. -func (c *AttCaches) SaveUnaggregatedAttestations(atts []*ethpb.Attestation) error { +func (c *AttCaches) SaveUnaggregatedAttestations(atts []interfaces.Attestation) error { for _, att := range atts { if err := c.SaveUnaggregatedAttestation(att); err != nil { return err @@ -51,18 +51,18 @@ func (c *AttCaches) SaveUnaggregatedAttestations(atts []*ethpb.Attestation) erro } // UnaggregatedAttestations returns all the unaggregated attestations in cache. -func (c *AttCaches) UnaggregatedAttestations() ([]*ethpb.Attestation, error) { +func (c *AttCaches) UnaggregatedAttestations() ([]interfaces.Attestation, error) { c.unAggregateAttLock.RLock() defer c.unAggregateAttLock.RUnlock() unAggregatedAtts := c.unAggregatedAtt - atts := make([]*ethpb.Attestation, 0, len(unAggregatedAtts)) + atts := make([]interfaces.Attestation, 0, len(unAggregatedAtts)) for _, att := range unAggregatedAtts { seen, err := c.hasSeenBit(att) if err != nil { return nil, err } if !seen { - atts = append(atts, ethpb.CopyAttestation(att) /* Copied */) + atts = append(atts, interfaces.CopyAttestation(att) /* Copied */) } } return atts, nil @@ -70,18 +70,18 @@ func (c *AttCaches) UnaggregatedAttestations() ([]*ethpb.Attestation, error) { // UnaggregatedAttestationsBySlotIndex returns the unaggregated attestations in cache, // filtered by committee index and slot. -func (c *AttCaches) UnaggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []*ethpb.Attestation { +func (c *AttCaches) UnaggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []interfaces.Attestation { _, span := trace.StartSpan(ctx, "operations.attestations.kv.UnaggregatedAttestationsBySlotIndex") defer span.End() - atts := make([]*ethpb.Attestation, 0) + atts := make([]interfaces.Attestation, 0) c.unAggregateAttLock.RLock() defer c.unAggregateAttLock.RUnlock() unAggregatedAtts := c.unAggregatedAtt for _, a := range unAggregatedAtts { - if slot == a.Data.Slot && committeeIndex == a.Data.CommitteeIndex { + if slot == a.GetData().Slot && committeeIndex == a.GetData().CommitteeIndex { atts = append(atts, a) } } @@ -90,7 +90,7 @@ func (c *AttCaches) UnaggregatedAttestationsBySlotIndex(ctx context.Context, slo } // DeleteUnaggregatedAttestation deletes the unaggregated attestations in cache. -func (c *AttCaches) DeleteUnaggregatedAttestation(att *ethpb.Attestation) error { +func (c *AttCaches) DeleteUnaggregatedAttestation(att interfaces.Attestation) error { if att == nil { return nil } diff --git a/beacon-chain/operations/attestations/kv/unaggregated_test.go b/beacon-chain/operations/attestations/kv/unaggregated_test.go index 690899ee1684..115199d1b1e5 100644 --- a/beacon-chain/operations/attestations/kv/unaggregated_test.go +++ b/beacon-chain/operations/attestations/kv/unaggregated_test.go @@ -10,6 +10,7 @@ import ( fssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/go-bitfield" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -19,7 +20,7 @@ import ( func TestKV_Unaggregated_SaveUnaggregatedAttestation(t *testing.T) { tests := []struct { name string - att *ethpb.Attestation + att interfaces.Attestation count int wantErrString string }{ @@ -66,8 +67,8 @@ func TestKV_Unaggregated_SaveUnaggregatedAttestation(t *testing.T) { cache.seenAtt.Set(string(r[:]), []bitfield.Bitlist{{0xff}}, c.DefaultExpiration) assert.Equal(t, 0, len(cache.unAggregatedAtt), "Invalid start pool, atts: %d", len(cache.unAggregatedAtt)) - if tt.att != nil && tt.att.Signature == nil { - tt.att.Signature = make([]byte, fieldparams.BLSSignatureLength) + if tt.att != nil && tt.att.GetSignature() == nil { + tt.att.(*ethpb.Attestation).Signature = make([]byte, fieldparams.BLSSignatureLength) } err := cache.SaveUnaggregatedAttestation(tt.att) @@ -85,13 +86,13 @@ func TestKV_Unaggregated_SaveUnaggregatedAttestation(t *testing.T) { func TestKV_Unaggregated_SaveUnaggregatedAttestations(t *testing.T) { tests := []struct { name string - atts []*ethpb.Attestation + atts []interfaces.Attestation count int wantErrString string }{ { name: "unaggregated only", - atts: []*ethpb.Attestation{ + atts: []interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}}), @@ -100,9 +101,9 @@ func TestKV_Unaggregated_SaveUnaggregatedAttestations(t *testing.T) { }, { name: "has aggregated", - atts: []*ethpb.Attestation{ + atts: []interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}}), - {AggregationBits: bitfield.Bitlist{0b1111}, Data: ðpb.AttestationData{Slot: 2}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b1111}, Data: ðpb.AttestationData{Slot: 2}}, util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}}), }, wantErrString: "attestation is aggregated", @@ -145,14 +146,14 @@ func TestKV_Unaggregated_DeleteUnaggregatedAttestation(t *testing.T) { att1 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b101}}) att2 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b110}}) att3 := util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b110}}) - atts := []*ethpb.Attestation{att1, att2, att3} + atts := []interfaces.Attestation{att1, att2, att3} require.NoError(t, cache.SaveUnaggregatedAttestations(atts)) for _, att := range atts { assert.NoError(t, cache.DeleteUnaggregatedAttestation(att)) } returned, err := cache.UnaggregatedAttestations() require.NoError(t, err) - assert.DeepEqual(t, []*ethpb.Attestation{}, returned) + assert.DeepEqual(t, []interfaces.Attestation{}, returned) }) } @@ -168,7 +169,7 @@ func TestKV_Unaggregated_DeleteSeenUnaggregatedAttestations(t *testing.T) { t.Run("none seen", func(t *testing.T) { cache := NewAttCaches() - atts := []*ethpb.Attestation{ + atts := []interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1001}}), util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1010}}), util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1100}}), @@ -185,7 +186,7 @@ func TestKV_Unaggregated_DeleteSeenUnaggregatedAttestations(t *testing.T) { t.Run("some seen", func(t *testing.T) { cache := NewAttCaches() - atts := []*ethpb.Attestation{ + atts := []interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1001}}), util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1010}}), util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1100}}), @@ -202,15 +203,15 @@ func TestKV_Unaggregated_DeleteSeenUnaggregatedAttestations(t *testing.T) { assert.Equal(t, 2, cache.UnaggregatedAttestationCount()) returned, err := cache.UnaggregatedAttestations() sort.Slice(returned, func(i, j int) bool { - return bytes.Compare(returned[i].AggregationBits, returned[j].AggregationBits) < 0 + return bytes.Compare(returned[i].GetAggregationBits(), returned[j].GetAggregationBits()) < 0 }) require.NoError(t, err) - assert.DeepEqual(t, []*ethpb.Attestation{atts[0], atts[2]}, returned) + assert.DeepEqual(t, []interfaces.Attestation{atts[0], atts[2]}, returned) }) t.Run("all seen", func(t *testing.T) { cache := NewAttCaches() - atts := []*ethpb.Attestation{ + atts := []interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1001}}), util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1010}}), util.HydrateAttestation(ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b1100}}), @@ -229,7 +230,7 @@ func TestKV_Unaggregated_DeleteSeenUnaggregatedAttestations(t *testing.T) { assert.Equal(t, 0, cache.UnaggregatedAttestationCount()) returned, err := cache.UnaggregatedAttestations() require.NoError(t, err) - assert.DeepEqual(t, []*ethpb.Attestation{}, returned) + assert.DeepEqual(t, []interfaces.Attestation{}, returned) }) } @@ -246,9 +247,9 @@ func TestKV_Unaggregated_UnaggregatedAttestationsBySlotIndex(t *testing.T) { } ctx := context.Background() returned := cache.UnaggregatedAttestationsBySlotIndex(ctx, 1, 1) - assert.DeepEqual(t, []*ethpb.Attestation{att1}, returned) + assert.DeepEqual(t, []interfaces.Attestation{att1}, returned) returned = cache.UnaggregatedAttestationsBySlotIndex(ctx, 1, 2) - assert.DeepEqual(t, []*ethpb.Attestation{att2}, returned) + assert.DeepEqual(t, []interfaces.Attestation{att2}, returned) returned = cache.UnaggregatedAttestationsBySlotIndex(ctx, 2, 1) - assert.DeepEqual(t, []*ethpb.Attestation{att3}, returned) + assert.DeepEqual(t, []interfaces.Attestation{att3}, returned) } diff --git a/beacon-chain/operations/attestations/pool.go b/beacon-chain/operations/attestations/pool.go index 55de969da7ae..d6d457079099 100644 --- a/beacon-chain/operations/attestations/pool.go +++ b/beacon-chain/operations/attestations/pool.go @@ -4,8 +4,8 @@ import ( "context" "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations/kv" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) // Pool defines the necessary methods for Prysm attestations pool to serve @@ -15,30 +15,30 @@ import ( type Pool interface { // For Aggregated attestations AggregateUnaggregatedAttestations(ctx context.Context) error - SaveAggregatedAttestation(att *ethpb.Attestation) error - SaveAggregatedAttestations(atts []*ethpb.Attestation) error - AggregatedAttestations() []*ethpb.Attestation - AggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []*ethpb.Attestation - DeleteAggregatedAttestation(att *ethpb.Attestation) error - HasAggregatedAttestation(att *ethpb.Attestation) (bool, error) + SaveAggregatedAttestation(att interfaces.Attestation) error + SaveAggregatedAttestations(atts []interfaces.Attestation) error + AggregatedAttestations() []interfaces.Attestation + AggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []interfaces.Attestation + DeleteAggregatedAttestation(att interfaces.Attestation) error + HasAggregatedAttestation(att interfaces.Attestation) (bool, error) AggregatedAttestationCount() int // For unaggregated attestations. - SaveUnaggregatedAttestation(att *ethpb.Attestation) error - SaveUnaggregatedAttestations(atts []*ethpb.Attestation) error - UnaggregatedAttestations() ([]*ethpb.Attestation, error) - UnaggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []*ethpb.Attestation - DeleteUnaggregatedAttestation(att *ethpb.Attestation) error + SaveUnaggregatedAttestation(att interfaces.Attestation) error + SaveUnaggregatedAttestations(atts []interfaces.Attestation) error + UnaggregatedAttestations() ([]interfaces.Attestation, error) + UnaggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []interfaces.Attestation + DeleteUnaggregatedAttestation(att interfaces.Attestation) error DeleteSeenUnaggregatedAttestations() (int, error) UnaggregatedAttestationCount() int // For attestations that were included in the block. - SaveBlockAttestation(att *ethpb.Attestation) error - BlockAttestations() []*ethpb.Attestation - DeleteBlockAttestation(att *ethpb.Attestation) error + SaveBlockAttestation(att interfaces.Attestation) error + BlockAttestations() []interfaces.Attestation + DeleteBlockAttestation(att interfaces.Attestation) error // For attestations to be passed to fork choice. - SaveForkchoiceAttestation(att *ethpb.Attestation) error - SaveForkchoiceAttestations(atts []*ethpb.Attestation) error - ForkchoiceAttestations() []*ethpb.Attestation - DeleteForkchoiceAttestation(att *ethpb.Attestation) error + SaveForkchoiceAttestation(att interfaces.Attestation) error + SaveForkchoiceAttestations(atts []interfaces.Attestation) error + ForkchoiceAttestations() []interfaces.Attestation + DeleteForkchoiceAttestation(att interfaces.Attestation) error ForkchoiceAttestationCount() int } diff --git a/beacon-chain/operations/attestations/prepare_forkchoice.go b/beacon-chain/operations/attestations/prepare_forkchoice.go index f0f443b6b1fb..bb0840d629c2 100644 --- a/beacon-chain/operations/attestations/prepare_forkchoice.go +++ b/beacon-chain/operations/attestations/prepare_forkchoice.go @@ -9,8 +9,8 @@ import ( "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/config/features" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/hash" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations" "github.com/prysmaticlabs/prysm/v5/time/slots" "go.opencensus.io/trace" @@ -67,7 +67,7 @@ func (s *Service) batchForkChoiceAtts(ctx context.Context) error { atts := append(s.cfg.Pool.AggregatedAttestations(), s.cfg.Pool.BlockAttestations()...) atts = append(atts, s.cfg.Pool.ForkchoiceAttestations()...) - attsByDataRoot := make(map[[32]byte][]*ethpb.Attestation, len(atts)) + attsByDataRoot := make(map[[32]byte][]interfaces.Attestation, len(atts)) // Consolidate attestations by aggregating them by similar data root. for _, att := range atts { @@ -79,7 +79,7 @@ func (s *Service) batchForkChoiceAtts(ctx context.Context) error { continue } - attDataRoot, err := att.Data.HashTreeRoot() + attDataRoot, err := att.GetData().HashTreeRoot() if err != nil { return err } @@ -103,10 +103,10 @@ func (s *Service) batchForkChoiceAtts(ctx context.Context) error { // This aggregates a list of attestations using the aggregation algorithm defined in AggregateAttestations // and saves the attestations for fork choice. -func (s *Service) aggregateAndSaveForkChoiceAtts(atts []*ethpb.Attestation) error { - clonedAtts := make([]*ethpb.Attestation, len(atts)) +func (s *Service) aggregateAndSaveForkChoiceAtts(atts []interfaces.Attestation) error { + clonedAtts := make([]interfaces.Attestation, len(atts)) for i, a := range atts { - clonedAtts[i] = ethpb.CopyAttestation(a) + clonedAtts[i] = interfaces.CopyAttestation(a) } aggregatedAtts, err := attaggregation.Aggregate(clonedAtts) if err != nil { @@ -118,12 +118,12 @@ func (s *Service) aggregateAndSaveForkChoiceAtts(atts []*ethpb.Attestation) erro // This checks if the attestation has previously been aggregated for fork choice // return true if yes, false if no. -func (s *Service) seen(att *ethpb.Attestation) (bool, error) { - attRoot, err := hash.Proto(att.Data) +func (s *Service) seen(att interfaces.Attestation) (bool, error) { + attRoot, err := hash.Proto(att.GetData()) if err != nil { return false, err } - incomingBits := att.AggregationBits + incomingBits := att.GetAggregationBits() savedBits, ok := s.forkChoiceProcessedRoots.Get(attRoot) if ok { savedBitlist, ok := savedBits.(bitfield.Bitlist) diff --git a/beacon-chain/operations/attestations/prepare_forkchoice_test.go b/beacon-chain/operations/attestations/prepare_forkchoice_test.go index 916fc4a04b1a..11578b7729a7 100644 --- a/beacon-chain/operations/attestations/prepare_forkchoice_test.go +++ b/beacon-chain/operations/attestations/prepare_forkchoice_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations" @@ -25,35 +26,35 @@ func TestBatchAttestations_Multiple(t *testing.T) { sig := priv.Sign([]byte("dummy_test_data")) var mockRoot [32]byte - unaggregatedAtts := []*ethpb.Attestation{ - {Data: ðpb.AttestationData{ + unaggregatedAtts := []interfaces.Attestation{ + ðpb.Attestation{Data: ðpb.AttestationData{ Slot: 2, BeaconBlockRoot: mockRoot[:], Source: ðpb.Checkpoint{Root: mockRoot[:]}, Target: ðpb.Checkpoint{Root: mockRoot[:]}}, AggregationBits: bitfield.Bitlist{0b100100}, Signature: sig.Marshal()}, - {Data: ðpb.AttestationData{ + ðpb.Attestation{Data: ðpb.AttestationData{ Slot: 1, BeaconBlockRoot: mockRoot[:], Source: ðpb.Checkpoint{Root: mockRoot[:]}, Target: ðpb.Checkpoint{Root: mockRoot[:]}}, AggregationBits: bitfield.Bitlist{0b101000}, Signature: sig.Marshal()}, - {Data: ðpb.AttestationData{ + ðpb.Attestation{Data: ðpb.AttestationData{ Slot: 0, BeaconBlockRoot: mockRoot[:], Source: ðpb.Checkpoint{Root: mockRoot[:]}, Target: ðpb.Checkpoint{Root: mockRoot[:]}}, AggregationBits: bitfield.Bitlist{0b100010}, Signature: sig.Marshal()}, } - aggregatedAtts := []*ethpb.Attestation{ - {Data: ðpb.AttestationData{ + aggregatedAtts := []interfaces.Attestation{ + ðpb.Attestation{Data: ðpb.AttestationData{ Slot: 2, BeaconBlockRoot: mockRoot[:], Source: ðpb.Checkpoint{Root: mockRoot[:]}, Target: ðpb.Checkpoint{Root: mockRoot[:]}}, AggregationBits: bitfield.Bitlist{0b111000}, Signature: sig.Marshal()}, - {Data: ðpb.AttestationData{ + ðpb.Attestation{Data: ðpb.AttestationData{ Slot: 1, BeaconBlockRoot: mockRoot[:], Source: ðpb.Checkpoint{Root: mockRoot[:]}, Target: ðpb.Checkpoint{Root: mockRoot[:]}}, AggregationBits: bitfield.Bitlist{0b100011}, Signature: sig.Marshal()}, - {Data: ðpb.AttestationData{ + ðpb.Attestation{Data: ðpb.AttestationData{ Slot: 0, BeaconBlockRoot: mockRoot[:], Source: ðpb.Checkpoint{Root: mockRoot[:]}, @@ -93,12 +94,12 @@ func TestBatchAttestations_Multiple(t *testing.T) { } require.NoError(t, s.batchForkChoiceAtts(context.Background())) - wanted, err := attaggregation.Aggregate([]*ethpb.Attestation{aggregatedAtts[0], blockAtts[0]}) + wanted, err := attaggregation.Aggregate([]interfaces.Attestation{aggregatedAtts[0], blockAtts[0]}) require.NoError(t, err) - aggregated, err := attaggregation.Aggregate([]*ethpb.Attestation{aggregatedAtts[1], blockAtts[1]}) + aggregated, err := attaggregation.Aggregate([]interfaces.Attestation{aggregatedAtts[1], blockAtts[1]}) require.NoError(t, err) wanted = append(wanted, aggregated...) - aggregated, err = attaggregation.Aggregate([]*ethpb.Attestation{aggregatedAtts[2], blockAtts[2]}) + aggregated, err = attaggregation.Aggregate([]interfaces.Attestation{aggregatedAtts[2], blockAtts[2]}) require.NoError(t, err) wanted = append(wanted, aggregated...) @@ -106,10 +107,10 @@ func TestBatchAttestations_Multiple(t *testing.T) { received := s.cfg.Pool.ForkchoiceAttestations() sort.Slice(received, func(i, j int) bool { - return received[i].Data.Slot < received[j].Data.Slot + return received[i].GetData().Slot < received[j].GetData().Slot }) sort.Slice(wanted, func(i, j int) bool { - return wanted[i].Data.Slot < wanted[j].Data.Slot + return wanted[i].GetData().Slot < wanted[j].GetData().Slot }) assert.DeepSSZEqual(t, wanted, received) @@ -129,18 +130,18 @@ func TestBatchAttestations_Single(t *testing.T) { Target: ðpb.Checkpoint{Root: mockRoot[:]}, } - unaggregatedAtts := []*ethpb.Attestation{ - {Data: d, AggregationBits: bitfield.Bitlist{0b101000}, Signature: sig.Marshal()}, - {Data: d, AggregationBits: bitfield.Bitlist{0b100100}, Signature: sig.Marshal()}, + unaggregatedAtts := []interfaces.Attestation{ + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b101000}, Signature: sig.Marshal()}, + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b100100}, Signature: sig.Marshal()}, } - aggregatedAtts := []*ethpb.Attestation{ - {Data: d, AggregationBits: bitfield.Bitlist{0b101100}, Signature: sig.Marshal()}, - {Data: d, AggregationBits: bitfield.Bitlist{0b110010}, Signature: sig.Marshal()}, + aggregatedAtts := []interfaces.Attestation{ + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b101100}, Signature: sig.Marshal()}, + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b110010}, Signature: sig.Marshal()}, } - blockAtts := []*ethpb.Attestation{ - {Data: d, AggregationBits: bitfield.Bitlist{0b110010}, Signature: sig.Marshal()}, - {Data: d, AggregationBits: bitfield.Bitlist{0b100010}, Signature: sig.Marshal()}, - {Data: d, AggregationBits: bitfield.Bitlist{0b110010}, Signature: sig.Marshal()}, // Duplicated + blockAtts := []interfaces.Attestation{ + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b110010}, Signature: sig.Marshal()}, + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b100010}, Signature: sig.Marshal()}, + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b110010}, Signature: sig.Marshal()}, // Duplicated } require.NoError(t, s.cfg.Pool.SaveUnaggregatedAttestations(unaggregatedAtts)) require.NoError(t, s.cfg.Pool.SaveAggregatedAttestations(aggregatedAtts)) @@ -174,9 +175,9 @@ func TestAggregateAndSaveForkChoiceAtts_Single(t *testing.T) { Target: ðpb.Checkpoint{Root: mockRoot[:]}, } - atts := []*ethpb.Attestation{ - {Data: d, AggregationBits: bitfield.Bitlist{0b101}, Signature: sig.Marshal()}, - {Data: d, AggregationBits: bitfield.Bitlist{0b110}, Signature: sig.Marshal()}} + atts := []interfaces.Attestation{ + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b101}, Signature: sig.Marshal()}, + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b110}, Signature: sig.Marshal()}} require.NoError(t, s.aggregateAndSaveForkChoiceAtts(atts)) wanted, err := attaggregation.Aggregate(atts) @@ -204,19 +205,19 @@ func TestAggregateAndSaveForkChoiceAtts_Multiple(t *testing.T) { require.Equal(t, true, ok, "Entity is not of type *ethpb.AttestationData") d2.Slot = 2 - atts1 := []*ethpb.Attestation{ - {Data: d, AggregationBits: bitfield.Bitlist{0b101}, Signature: sig.Marshal()}, - {Data: d, AggregationBits: bitfield.Bitlist{0b110}, Signature: sig.Marshal()}, + atts1 := []interfaces.Attestation{ + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b101}, Signature: sig.Marshal()}, + ðpb.Attestation{Data: d, AggregationBits: bitfield.Bitlist{0b110}, Signature: sig.Marshal()}, } require.NoError(t, s.aggregateAndSaveForkChoiceAtts(atts1)) - atts2 := []*ethpb.Attestation{ - {Data: d1, AggregationBits: bitfield.Bitlist{0b10110}, Signature: sig.Marshal()}, - {Data: d1, AggregationBits: bitfield.Bitlist{0b11100}, Signature: sig.Marshal()}, - {Data: d1, AggregationBits: bitfield.Bitlist{0b11000}, Signature: sig.Marshal()}, + atts2 := []interfaces.Attestation{ + ðpb.Attestation{Data: d1, AggregationBits: bitfield.Bitlist{0b10110}, Signature: sig.Marshal()}, + ðpb.Attestation{Data: d1, AggregationBits: bitfield.Bitlist{0b11100}, Signature: sig.Marshal()}, + ðpb.Attestation{Data: d1, AggregationBits: bitfield.Bitlist{0b11000}, Signature: sig.Marshal()}, } require.NoError(t, s.aggregateAndSaveForkChoiceAtts(atts2)) - att3 := []*ethpb.Attestation{ - {Data: d2, AggregationBits: bitfield.Bitlist{0b1100}, Signature: sig.Marshal()}, + att3 := []interfaces.Attestation{ + ðpb.Attestation{Data: d2, AggregationBits: bitfield.Bitlist{0b1100}, Signature: sig.Marshal()}, } require.NoError(t, s.aggregateAndSaveForkChoiceAtts(att3)) @@ -230,7 +231,7 @@ func TestAggregateAndSaveForkChoiceAtts_Multiple(t *testing.T) { received := s.cfg.Pool.ForkchoiceAttestations() sort.Slice(received, func(i, j int) bool { - return received[i].Data.Slot < received[j].Data.Slot + return received[i].GetData().Slot < received[j].GetData().Slot }) for i, a := range wanted { assert.Equal(t, true, proto.Equal(a, received[i])) diff --git a/beacon-chain/operations/attestations/prune_expired.go b/beacon-chain/operations/attestations/prune_expired.go index e956fee3a61e..5bbe29c77fbc 100644 --- a/beacon-chain/operations/attestations/prune_expired.go +++ b/beacon-chain/operations/attestations/prune_expired.go @@ -29,7 +29,7 @@ func (s *Service) pruneAttsPool() { func (s *Service) pruneExpiredAtts() { aggregatedAtts := s.cfg.Pool.AggregatedAttestations() for _, att := range aggregatedAtts { - if s.expired(att.Data.Slot) { + if s.expired(att.GetData().Slot) { if err := s.cfg.Pool.DeleteAggregatedAttestation(att); err != nil { log.WithError(err).Error("Could not delete expired aggregated attestation") } @@ -46,7 +46,7 @@ func (s *Service) pruneExpiredAtts() { return } for _, att := range unAggregatedAtts { - if s.expired(att.Data.Slot) { + if s.expired(att.GetData().Slot) { if err := s.cfg.Pool.DeleteUnaggregatedAttestation(att); err != nil { log.WithError(err).Error("Could not delete expired unaggregated attestation") } @@ -56,7 +56,7 @@ func (s *Service) pruneExpiredAtts() { blockAtts := s.cfg.Pool.BlockAttestations() for _, att := range blockAtts { - if s.expired(att.Data.Slot) { + if s.expired(att.GetData().Slot) { if err := s.cfg.Pool.DeleteBlockAttestation(att); err != nil { log.WithError(err).Error("Could not delete expired block attestation") } diff --git a/beacon-chain/operations/attestations/prune_expired_test.go b/beacon-chain/operations/attestations/prune_expired_test.go index 816e4689bbe1..99397b3c13d9 100644 --- a/beacon-chain/operations/attestations/prune_expired_test.go +++ b/beacon-chain/operations/attestations/prune_expired_test.go @@ -9,6 +9,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/async" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" @@ -31,15 +32,15 @@ func TestPruneExpired_Ticker(t *testing.T) { ad2 := util.HydrateAttestationData(ðpb.AttestationData{Slot: 1}) - atts := []*ethpb.Attestation{ - {Data: ad1, AggregationBits: bitfield.Bitlist{0b1000, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, - {Data: ad2, AggregationBits: bitfield.Bitlist{0b1000, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, + atts := []interfaces.Attestation{ + ðpb.Attestation{Data: ad1, AggregationBits: bitfield.Bitlist{0b1000, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, + ðpb.Attestation{Data: ad2, AggregationBits: bitfield.Bitlist{0b1000, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, } require.NoError(t, s.cfg.Pool.SaveUnaggregatedAttestations(atts)) require.Equal(t, 2, s.cfg.Pool.UnaggregatedAttestationCount(), "Unexpected number of attestations") - atts = []*ethpb.Attestation{ - {Data: ad1, AggregationBits: bitfield.Bitlist{0b1101, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, - {Data: ad2, AggregationBits: bitfield.Bitlist{0b1101, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, + atts = []interfaces.Attestation{ + ðpb.Attestation{Data: ad1, AggregationBits: bitfield.Bitlist{0b1101, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, + ðpb.Attestation{Data: ad2, AggregationBits: bitfield.Bitlist{0b1101, 0b1}, Signature: make([]byte, fieldparams.BLSSignatureLength)}, } require.NoError(t, s.cfg.Pool.SaveAggregatedAttestations(atts)) assert.Equal(t, 2, s.cfg.Pool.AggregatedAttestationCount()) @@ -57,17 +58,17 @@ func TestPruneExpired_Ticker(t *testing.T) { atts, err := s.cfg.Pool.UnaggregatedAttestations() require.NoError(t, err) for _, attestation := range atts { - if attestation.Data.Slot == 0 { + if attestation.GetData().Slot == 0 { return } } for _, attestation := range s.cfg.Pool.AggregatedAttestations() { - if attestation.Data.Slot == 0 { + if attestation.GetData().Slot == 0 { return } } for _, attestation := range s.cfg.Pool.BlockAttestations() { - if attestation.Data.Slot == 0 { + if attestation.GetData().Slot == 0 { return } } @@ -96,7 +97,7 @@ func TestPruneExpired_PruneExpiredAtts(t *testing.T) { att2 := ðpb.Attestation{Data: ad1, AggregationBits: bitfield.Bitlist{0b1111}} att3 := ðpb.Attestation{Data: ad2, AggregationBits: bitfield.Bitlist{0b1101}} att4 := ðpb.Attestation{Data: ad2, AggregationBits: bitfield.Bitlist{0b1110}} - atts := []*ethpb.Attestation{att1, att2, att3, att4} + atts := []interfaces.Attestation{att1, att2, att3, att4} require.NoError(t, s.cfg.Pool.SaveAggregatedAttestations(atts)) for _, att := range atts { require.NoError(t, s.cfg.Pool.SaveBlockAttestation(att)) @@ -108,12 +109,12 @@ func TestPruneExpired_PruneExpiredAtts(t *testing.T) { s.pruneExpiredAtts() // All the attestations on slot 0 should be pruned. for _, attestation := range s.cfg.Pool.AggregatedAttestations() { - if attestation.Data.Slot == 0 { + if attestation.GetData().Slot == 0 { t.Error("Should be pruned") } } for _, attestation := range s.cfg.Pool.BlockAttestations() { - if attestation.Data.Slot == 0 { + if attestation.GetData().Slot == 0 { t.Error("Should be pruned") } } diff --git a/beacon-chain/operations/slashings/BUILD.bazel b/beacon-chain/operations/slashings/BUILD.bazel index e8d40e847377..3d158ccce832 100644 --- a/beacon-chain/operations/slashings/BUILD.bazel +++ b/beacon-chain/operations/slashings/BUILD.bazel @@ -21,6 +21,7 @@ go_library( "//beacon-chain/core/time:go_default_library", "//beacon-chain/state:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//container/slice:go_default_library", "//proto/prysm/v1alpha1:go_default_library", @@ -47,6 +48,7 @@ go_test( "//beacon-chain/state:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/beacon-chain/operations/slashings/mock/BUILD.bazel b/beacon-chain/operations/slashings/mock/BUILD.bazel index 27ad01733569..d501e4c7ac9d 100644 --- a/beacon-chain/operations/slashings/mock/BUILD.bazel +++ b/beacon-chain/operations/slashings/mock/BUILD.bazel @@ -8,6 +8,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//beacon-chain/state:go_default_library", + "//consensus-types/interfaces:go_default_library", "//proto/prysm/v1alpha1:go_default_library", ], ) diff --git a/beacon-chain/operations/slashings/mock/mock.go b/beacon-chain/operations/slashings/mock/mock.go index 307c5fc9f539..1498b979b8d9 100644 --- a/beacon-chain/operations/slashings/mock/mock.go +++ b/beacon-chain/operations/slashings/mock/mock.go @@ -4,17 +4,18 @@ import ( "context" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) // PoolMock is a fake implementation of PoolManager. type PoolMock struct { - PendingAttSlashings []*ethpb.AttesterSlashing + PendingAttSlashings []interfaces.AttesterSlashing PendingPropSlashings []*ethpb.ProposerSlashing } // PendingAttesterSlashings -- -func (m *PoolMock) PendingAttesterSlashings(_ context.Context, _ state.ReadOnlyBeaconState, _ bool) []*ethpb.AttesterSlashing { +func (m *PoolMock) PendingAttesterSlashings(_ context.Context, _ state.ReadOnlyBeaconState, _ bool) []interfaces.AttesterSlashing { return m.PendingAttSlashings } @@ -24,7 +25,7 @@ func (m *PoolMock) PendingProposerSlashings(_ context.Context, _ state.ReadOnlyB } // InsertAttesterSlashing -- -func (m *PoolMock) InsertAttesterSlashing(_ context.Context, _ state.ReadOnlyBeaconState, slashing *ethpb.AttesterSlashing) error { +func (m *PoolMock) InsertAttesterSlashing(_ context.Context, _ state.ReadOnlyBeaconState, slashing interfaces.AttesterSlashing) error { m.PendingAttSlashings = append(m.PendingAttSlashings, slashing) return nil } @@ -36,7 +37,7 @@ func (m *PoolMock) InsertProposerSlashing(_ context.Context, _ state.ReadOnlyBea } // MarkIncludedAttesterSlashing -- -func (*PoolMock) MarkIncludedAttesterSlashing(_ *ethpb.AttesterSlashing) { +func (*PoolMock) MarkIncludedAttesterSlashing(_ interfaces.AttesterSlashing) { panic("implement me") } diff --git a/beacon-chain/operations/slashings/service.go b/beacon-chain/operations/slashings/service.go index 2a808c11c738..2439d9004fac 100644 --- a/beacon-chain/operations/slashings/service.go +++ b/beacon-chain/operations/slashings/service.go @@ -11,6 +11,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -30,7 +31,7 @@ func NewPool() *Pool { // PendingAttesterSlashings returns attester slashings that are able to be included into a block. // This method will return the amount of pending attester slashings for a block transition unless parameter `noLimit` is true // to indicate the request is for noLimit pending items. -func (p *Pool) PendingAttesterSlashings(ctx context.Context, state state.ReadOnlyBeaconState, noLimit bool) []*ethpb.AttesterSlashing { +func (p *Pool) PendingAttesterSlashings(ctx context.Context, state state.ReadOnlyBeaconState, noLimit bool) []interfaces.AttesterSlashing { p.lock.Lock() defer p.lock.Unlock() _, span := trace.StartSpan(ctx, "operations.PendingAttesterSlashing") @@ -46,7 +47,7 @@ func (p *Pool) PendingAttesterSlashings(ctx context.Context, state state.ReadOnl if noLimit { maxSlashings = uint64(len(p.pendingAttesterSlashing)) } - pending := make([]*ethpb.AttesterSlashing, 0, maxSlashings) + pending := make([]interfaces.AttesterSlashing, 0, maxSlashings) for i := 0; i < len(p.pendingAttesterSlashing); i++ { if uint64(len(pending)) >= maxSlashings { break @@ -63,7 +64,10 @@ func (p *Pool) PendingAttesterSlashings(ctx context.Context, state state.ReadOnl continue } attSlashing := slashing.attesterSlashing - slashedVal := slice.IntersectionUint64(attSlashing.Attestation_1.AttestingIndices, attSlashing.Attestation_2.AttestingIndices) + slashedVal := slice.IntersectionUint64( + attSlashing.GetFirstAttestation().GetAttestingIndices(), + attSlashing.GetSecondAttestation().GetAttestingIndices(), + ) for _, idx := range slashedVal { included[primitives.ValidatorIndex(idx)] = true } @@ -118,7 +122,7 @@ func (p *Pool) PendingProposerSlashings(ctx context.Context, state state.ReadOnl func (p *Pool) InsertAttesterSlashing( ctx context.Context, state state.ReadOnlyBeaconState, - slashing *ethpb.AttesterSlashing, + slashing interfaces.AttesterSlashing, ) error { p.lock.Lock() defer p.lock.Unlock() @@ -129,7 +133,7 @@ func (p *Pool) InsertAttesterSlashing( return errors.Wrap(err, "could not verify attester slashing") } - slashedVal := slice.IntersectionUint64(slashing.Attestation_1.AttestingIndices, slashing.Attestation_2.AttestingIndices) + slashedVal := slice.IntersectionUint64(slashing.GetFirstAttestation().GetAttestingIndices(), slashing.GetSecondAttestation().GetAttestingIndices()) cantSlash := make([]uint64, 0, len(slashedVal)) slashingReason := "" for _, val := range slashedVal { @@ -229,10 +233,10 @@ func (p *Pool) InsertProposerSlashing( // MarkIncludedAttesterSlashing is used when an attester slashing has been included in a beacon block. // Every block seen by this node that contains proposer slashings should call this method to include // the proposer slashings. -func (p *Pool) MarkIncludedAttesterSlashing(as *ethpb.AttesterSlashing) { +func (p *Pool) MarkIncludedAttesterSlashing(as interfaces.AttesterSlashing) { p.lock.Lock() defer p.lock.Unlock() - slashedVal := slice.IntersectionUint64(as.Attestation_1.AttestingIndices, as.Attestation_2.AttestingIndices) + slashedVal := slice.IntersectionUint64(as.GetFirstAttestation().GetAttestingIndices(), as.GetSecondAttestation().GetAttestingIndices()) for _, val := range slashedVal { i := sort.Search(len(p.pendingAttesterSlashing), func(i int) bool { return uint64(p.pendingAttesterSlashing[i].validatorToSlash) >= val diff --git a/beacon-chain/operations/slashings/service_attester_test.go b/beacon-chain/operations/slashings/service_attester_test.go index 3caa4af0fa58..a032d52d2732 100644 --- a/beacon-chain/operations/slashings/service_attester_test.go +++ b/beacon-chain/operations/slashings/service_attester_test.go @@ -6,6 +6,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -314,7 +315,7 @@ func TestPool_InsertAttesterSlashing_SigFailsVerify_ClearPool(t *testing.T) { // We mess up the signature of the second slashing. badSig := make([]byte, 96) copy(badSig, "muahaha") - pendingSlashings[1].attesterSlashing.Attestation_1.Signature = badSig + pendingSlashings[1].attesterSlashing.(*ethpb.AttesterSlashing).Attestation_1.Signature = badSig slashings[1].Attestation_1.Signature = badSig p := &Pool{ pendingAttesterSlashing: make([]*PendingAttesterSlashing, 0), @@ -455,7 +456,7 @@ func TestPool_PendingAttesterSlashings(t *testing.T) { params.SetupTestConfigCleanup(t) beaconState, privKeys := util.DeterministicGenesisState(t, 64) pendingSlashings := make([]*PendingAttesterSlashing, 20) - slashings := make([]*ethpb.AttesterSlashing, 20) + slashings := make([]interfaces.AttesterSlashing, 20) for i := 0; i < len(pendingSlashings); i++ { sl, err := util.GenerateAttesterSlashingForValidator(beaconState, privKeys[i], primitives.ValidatorIndex(i)) require.NoError(t, err) @@ -468,14 +469,14 @@ func TestPool_PendingAttesterSlashings(t *testing.T) { tests := []struct { name string fields fields - want []*ethpb.AttesterSlashing + want []interfaces.AttesterSlashing }{ { name: "Empty list", fields: fields{ pending: []*PendingAttesterSlashing{}, }, - want: []*ethpb.AttesterSlashing{}, + want: []interfaces.AttesterSlashing{}, }, { name: "All pending", @@ -530,7 +531,7 @@ func TestPool_PendingAttesterSlashings_Slashed(t *testing.T) { require.NoError(t, beaconState.UpdateValidatorAtIndex(5, val)) pendingSlashings := make([]*PendingAttesterSlashing, 20) pendingSlashings2 := make([]*PendingAttesterSlashing, 20) - slashings := make([]*ethpb.AttesterSlashing, 20) + slashings := make([]interfaces.AttesterSlashing, 20) for i := 0; i < len(pendingSlashings); i++ { sl, err := util.GenerateAttesterSlashingForValidator(beaconState, privKeys[i], primitives.ValidatorIndex(i)) require.NoError(t, err) @@ -548,7 +549,7 @@ func TestPool_PendingAttesterSlashings_Slashed(t *testing.T) { tests := []struct { name string fields fields - want []*ethpb.AttesterSlashing + want []interfaces.AttesterSlashing }{ { name: "One item", @@ -588,7 +589,7 @@ func TestPool_PendingAttesterSlashings_NoDuplicates(t *testing.T) { params.OverrideBeaconConfig(conf) beaconState, privKeys := util.DeterministicGenesisState(t, 64) pendingSlashings := make([]*PendingAttesterSlashing, 3) - slashings := make([]*ethpb.AttesterSlashing, 3) + slashings := make([]interfaces.AttesterSlashing, 3) for i := 0; i < 2; i++ { sl, err := util.GenerateAttesterSlashingForValidator(beaconState, privKeys[i], primitives.ValidatorIndex(i)) require.NoError(t, err) diff --git a/beacon-chain/operations/slashings/types.go b/beacon-chain/operations/slashings/types.go index 2cb418f9923f..6bc6785f97b7 100644 --- a/beacon-chain/operations/slashings/types.go +++ b/beacon-chain/operations/slashings/types.go @@ -5,6 +5,7 @@ import ( "sync" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -14,7 +15,7 @@ type PoolInserter interface { InsertAttesterSlashing( ctx context.Context, state state.ReadOnlyBeaconState, - slashing *ethpb.AttesterSlashing, + slashing interfaces.AttesterSlashing, ) error InsertProposerSlashing( ctx context.Context, @@ -27,9 +28,9 @@ type PoolInserter interface { // This pool is used by proposers to insert data into new blocks. type PoolManager interface { PoolInserter - PendingAttesterSlashings(ctx context.Context, state state.ReadOnlyBeaconState, noLimit bool) []*ethpb.AttesterSlashing + PendingAttesterSlashings(ctx context.Context, state state.ReadOnlyBeaconState, noLimit bool) []interfaces.AttesterSlashing PendingProposerSlashings(ctx context.Context, state state.ReadOnlyBeaconState, noLimit bool) []*ethpb.ProposerSlashing - MarkIncludedAttesterSlashing(as *ethpb.AttesterSlashing) + MarkIncludedAttesterSlashing(as interfaces.AttesterSlashing) MarkIncludedProposerSlashing(ps *ethpb.ProposerSlashing) } @@ -44,6 +45,6 @@ type Pool struct { // PendingAttesterSlashing represents an attester slashing in the operation pool. // Allows for easy binary searching of included validator indexes. type PendingAttesterSlashing struct { - attesterSlashing *ethpb.AttesterSlashing + attesterSlashing interfaces.AttesterSlashing validatorToSlash primitives.ValidatorIndex } diff --git a/beacon-chain/p2p/BUILD.bazel b/beacon-chain/p2p/BUILD.bazel index ddbbf7b5b105..0ef51faed3e6 100644 --- a/beacon-chain/p2p/BUILD.bazel +++ b/beacon-chain/p2p/BUILD.bazel @@ -57,6 +57,7 @@ go_library( "//cmd/beacon-chain/flags:go_default_library", "//config/features:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//consensus-types/wrapper:go_default_library", "//container/leaky-bucket:go_default_library", diff --git a/beacon-chain/p2p/broadcaster.go b/beacon-chain/p2p/broadcaster.go index f5923d95a8c8..43a0270ee2d0 100644 --- a/beacon-chain/p2p/broadcaster.go +++ b/beacon-chain/p2p/broadcaster.go @@ -12,6 +12,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/altair" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/hash" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -56,7 +57,7 @@ func (s *Service) Broadcast(ctx context.Context, msg proto.Message) error { // BroadcastAttestation broadcasts an attestation to the p2p network, the message is assumed to be // broadcasted to the current fork. -func (s *Service) BroadcastAttestation(ctx context.Context, subnet uint64, att *ethpb.Attestation) error { +func (s *Service) BroadcastAttestation(ctx context.Context, subnet uint64, att interfaces.Attestation) error { if att == nil { return errors.New("attempted to broadcast nil attestation") } @@ -96,7 +97,7 @@ func (s *Service) BroadcastSyncCommitteeMessage(ctx context.Context, subnet uint return nil } -func (s *Service) internalBroadcastAttestation(ctx context.Context, subnet uint64, att *ethpb.Attestation, forkDigest [4]byte) { +func (s *Service) internalBroadcastAttestation(ctx context.Context, subnet uint64, att interfaces.Attestation, forkDigest [4]byte) { _, span := trace.StartSpan(ctx, "p2p.internalBroadcastAttestation") defer span.End() ctx = trace.NewContext(context.Background(), span) // clear parent context / deadline. @@ -112,8 +113,8 @@ func (s *Service) internalBroadcastAttestation(ctx context.Context, subnet uint6 span.AddAttributes( trace.BoolAttribute("hasPeer", hasPeer), - trace.Int64Attribute("slot", int64(att.Data.Slot)), // lint:ignore uintcast -- It's safe to do this for tracing. - trace.Int64Attribute("subnet", int64(subnet)), // lint:ignore uintcast -- It's safe to do this for tracing. + trace.Int64Attribute("slot", int64(att.GetData().Slot)), // lint:ignore uintcast -- It's safe to do this for tracing. + trace.Int64Attribute("subnet", int64(subnet)), // lint:ignore uintcast -- It's safe to do this for tracing. ) if !hasPeer { @@ -138,9 +139,9 @@ func (s *Service) internalBroadcastAttestation(ctx context.Context, subnet uint6 // In the event our attestation is outdated and beyond the // acceptable threshold, we exit early and do not broadcast it. currSlot := slots.CurrentSlot(uint64(s.genesisTime.Unix())) - if err := helpers.ValidateAttestationTime(att.Data.Slot, s.genesisTime, params.BeaconConfig().MaximumGossipClockDisparityDuration()); err != nil { + if err := helpers.ValidateAttestationTime(att.GetData().Slot, s.genesisTime, params.BeaconConfig().MaximumGossipClockDisparityDuration()); err != nil { log.WithFields(logrus.Fields{ - "attestationSlot": att.Data.Slot, + "attestationSlot": att.GetData().Slot, "currentSlot": currSlot, }).WithError(err).Warning("Attestation is too old to broadcast, discarding it") return diff --git a/beacon-chain/p2p/interfaces.go b/beacon-chain/p2p/interfaces.go index f08c874721f4..112eadcb2bfd 100644 --- a/beacon-chain/p2p/interfaces.go +++ b/beacon-chain/p2p/interfaces.go @@ -12,6 +12,7 @@ import ( "github.com/multiformats/go-multiaddr" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/encoder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/metadata" "google.golang.org/protobuf/proto" @@ -33,7 +34,7 @@ type P2P interface { // Broadcaster broadcasts messages to peers over the p2p pubsub protocol. type Broadcaster interface { Broadcast(context.Context, proto.Message) error - BroadcastAttestation(ctx context.Context, subnet uint64, att *ethpb.Attestation) error + BroadcastAttestation(ctx context.Context, subnet uint64, att interfaces.Attestation) error BroadcastSyncCommitteeMessage(ctx context.Context, subnet uint64, sMsg *ethpb.SyncCommitteeMessage) error BroadcastBlob(ctx context.Context, subnet uint64, blob *ethpb.BlobSidecar) error } diff --git a/beacon-chain/p2p/testing/BUILD.bazel b/beacon-chain/p2p/testing/BUILD.bazel index e6c2e8fe9030..c4dea6b2b45f 100644 --- a/beacon-chain/p2p/testing/BUILD.bazel +++ b/beacon-chain/p2p/testing/BUILD.bazel @@ -20,6 +20,7 @@ go_library( "//beacon-chain/p2p/encoder:go_default_library", "//beacon-chain/p2p/peers:go_default_library", "//beacon-chain/p2p/peers/scorers:go_default_library", + "//consensus-types/interfaces:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/metadata:go_default_library", "@com_github_ethereum_go_ethereum//crypto:go_default_library", diff --git a/beacon-chain/p2p/testing/fuzz_p2p.go b/beacon-chain/p2p/testing/fuzz_p2p.go index a37445f0c11c..ce70a1c62e0d 100644 --- a/beacon-chain/p2p/testing/fuzz_p2p.go +++ b/beacon-chain/p2p/testing/fuzz_p2p.go @@ -12,6 +12,7 @@ import ( "github.com/multiformats/go-multiaddr" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/encoder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/metadata" "google.golang.org/protobuf/proto" @@ -134,7 +135,7 @@ func (_ *FakeP2P) Broadcast(_ context.Context, _ proto.Message) error { } // BroadcastAttestation -- fake. -func (_ *FakeP2P) BroadcastAttestation(_ context.Context, _ uint64, _ *ethpb.Attestation) error { +func (_ *FakeP2P) BroadcastAttestation(_ context.Context, _ uint64, _ interfaces.Attestation) error { return nil } diff --git a/beacon-chain/p2p/testing/mock_broadcaster.go b/beacon-chain/p2p/testing/mock_broadcaster.go index 5f38499300b1..336fda939b62 100644 --- a/beacon-chain/p2p/testing/mock_broadcaster.go +++ b/beacon-chain/p2p/testing/mock_broadcaster.go @@ -5,6 +5,7 @@ import ( "sync" "sync/atomic" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "google.golang.org/protobuf/proto" ) @@ -13,7 +14,7 @@ import ( type MockBroadcaster struct { BroadcastCalled atomic.Bool BroadcastMessages []proto.Message - BroadcastAttestations []*ethpb.Attestation + BroadcastAttestations []interfaces.Attestation msgLock sync.Mutex attLock sync.Mutex } @@ -28,7 +29,7 @@ func (m *MockBroadcaster) Broadcast(_ context.Context, msg proto.Message) error } // BroadcastAttestation records a broadcast occurred. -func (m *MockBroadcaster) BroadcastAttestation(_ context.Context, _ uint64, a *ethpb.Attestation) error { +func (m *MockBroadcaster) BroadcastAttestation(_ context.Context, _ uint64, a interfaces.Attestation) error { m.BroadcastCalled.Store(true) m.attLock.Lock() defer m.attLock.Unlock() diff --git a/beacon-chain/p2p/testing/p2p.go b/beacon-chain/p2p/testing/p2p.go index 013c369d4386..5c471ac3dd01 100644 --- a/beacon-chain/p2p/testing/p2p.go +++ b/beacon-chain/p2p/testing/p2p.go @@ -25,6 +25,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/encoder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/peers/scorers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/metadata" "github.com/sirupsen/logrus" @@ -166,7 +167,7 @@ func (p *TestP2P) Broadcast(_ context.Context, _ proto.Message) error { } // BroadcastAttestation broadcasts an attestation. -func (p *TestP2P) BroadcastAttestation(_ context.Context, _ uint64, _ *ethpb.Attestation) error { +func (p *TestP2P) BroadcastAttestation(_ context.Context, _ uint64, _ interfaces.Attestation) error { p.BroadcastCalled.Store(true) return nil } diff --git a/beacon-chain/rpc/eth/beacon/handlers.go b/beacon-chain/rpc/eth/beacon/handlers.go index 03567b8be205..7e446588ab9e 100644 --- a/beacon-chain/rpc/eth/beacon/handlers.go +++ b/beacon-chain/rpc/eth/beacon/handlers.go @@ -878,7 +878,13 @@ func (s *Server) GetBlockAttestations(w http.ResponseWriter, r *http.Request) { consensusAtts := blk.Block().Body().Attestations() atts := make([]*structs.Attestation, len(consensusAtts)) for i, att := range consensusAtts { - atts[i] = structs.AttFromConsensus(att) + a, ok := att.(*eth.Attestation) + if ok { + atts[i] = structs.AttFromConsensus(a) + } else { + httputil.HandleError(w, fmt.Sprintf("unable to convert consensus attestations of type %T", att), http.StatusInternalServerError) + return + } } root, err := blk.Block().HashTreeRoot() if err != nil { diff --git a/beacon-chain/rpc/eth/beacon/handlers_pool.go b/beacon-chain/rpc/eth/beacon/handlers_pool.go index 49f6e313c532..eee3a7a70dad 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_pool.go +++ b/beacon-chain/rpc/eth/beacon/handlers_pool.go @@ -58,7 +58,13 @@ func (s *Server) ListAttestations(w http.ResponseWriter, r *http.Request) { if isEmptyReq { allAtts := make([]*structs.Attestation, len(attestations)) for i, att := range attestations { - allAtts[i] = structs.AttFromConsensus(att) + a, ok := att.(*eth.Attestation) + if ok { + allAtts[i] = structs.AttFromConsensus(a) + } else { + httputil.HandleError(w, fmt.Sprintf("unable to convert attestations of type %T", att), http.StatusInternalServerError) + return + } } httputil.WriteJson(w, &structs.ListAttestationsResponse{Data: allAtts}) return @@ -67,11 +73,17 @@ func (s *Server) ListAttestations(w http.ResponseWriter, r *http.Request) { bothDefined := rawSlot != "" && rawCommitteeIndex != "" filteredAtts := make([]*structs.Attestation, 0, len(attestations)) for _, att := range attestations { - committeeIndexMatch := rawCommitteeIndex != "" && att.Data.CommitteeIndex == primitives.CommitteeIndex(committeeIndex) - slotMatch := rawSlot != "" && att.Data.Slot == primitives.Slot(slot) + committeeIndexMatch := rawCommitteeIndex != "" && att.GetData().CommitteeIndex == primitives.CommitteeIndex(committeeIndex) + slotMatch := rawSlot != "" && att.GetData().Slot == primitives.Slot(slot) shouldAppend := (bothDefined && committeeIndexMatch && slotMatch) || (!bothDefined && (committeeIndexMatch || slotMatch)) if shouldAppend { - filteredAtts = append(filteredAtts, structs.AttFromConsensus(att)) + a, ok := att.(*eth.Attestation) + if ok { + filteredAtts = append(filteredAtts, structs.AttFromConsensus(a)) + } else { + httputil.HandleError(w, fmt.Sprintf("unable to convert attestations of type %T", att), http.StatusInternalServerError) + return + } } } httputil.WriteJson(w, &structs.ListAttestationsResponse{Data: filteredAtts}) @@ -455,7 +467,17 @@ func (s *Server) GetAttesterSlashings(w http.ResponseWriter, r *http.Request) { return } sourceSlashings := s.SlashingsPool.PendingAttesterSlashings(ctx, headState, true /* return unlimited slashings */) - slashings := structs.AttesterSlashingsFromConsensus(sourceSlashings) + ss := make([]*eth.AttesterSlashing, 0, len(sourceSlashings)) + for _, slashing := range sourceSlashings { + s, ok := slashing.(*eth.AttesterSlashing) + if ok { + ss = append(ss, s) + } else { + httputil.HandleError(w, fmt.Sprintf("unable to convert slashing of type %T", slashing), http.StatusInternalServerError) + return + } + } + slashings := structs.AttesterSlashingsFromConsensus(ss) httputil.WriteJson(w, &structs.GetAttesterSlashingsResponse{Data: slashings}) } diff --git a/beacon-chain/rpc/eth/beacon/handlers_pool_test.go b/beacon-chain/rpc/eth/beacon/handlers_pool_test.go index 808e057db9aa..5386320c2554 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_pool_test.go +++ b/beacon-chain/rpc/eth/beacon/handlers_pool_test.go @@ -29,6 +29,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/crypto/bls/common" @@ -115,8 +116,8 @@ func TestListAttestations(t *testing.T) { s := &Server{ AttestationsPool: attestations.NewPool(), } - require.NoError(t, s.AttestationsPool.SaveAggregatedAttestations([]*ethpbv1alpha1.Attestation{att1, att2})) - require.NoError(t, s.AttestationsPool.SaveUnaggregatedAttestations([]*ethpbv1alpha1.Attestation{att3, att4})) + require.NoError(t, s.AttestationsPool.SaveAggregatedAttestations([]interfaces.Attestation{att1, att2})) + require.NoError(t, s.AttestationsPool.SaveUnaggregatedAttestations([]interfaces.Attestation{att3, att4})) t.Run("empty request", func(t *testing.T) { url := "http://example.com" @@ -240,15 +241,15 @@ func TestSubmitAttestations(t *testing.T) { assert.Equal(t, http.StatusOK, writer.Code) assert.Equal(t, true, broadcaster.BroadcastCalled.Load()) assert.Equal(t, 1, broadcaster.NumAttestations()) - assert.Equal(t, "0x03", hexutil.Encode(broadcaster.BroadcastAttestations[0].AggregationBits)) - assert.Equal(t, "0x8146f4397bfd8fd057ebbcd6a67327bdc7ed5fb650533edcb6377b650dea0b6da64c14ecd60846d5c0a0cd43893d6972092500f82c9d8a955e2b58c5ed3cbe885d84008ace6bd86ba9e23652f58e2ec207cec494c916063257abf285b9b15b15", hexutil.Encode(broadcaster.BroadcastAttestations[0].Signature)) - assert.Equal(t, primitives.Slot(0), broadcaster.BroadcastAttestations[0].Data.Slot) - assert.Equal(t, primitives.CommitteeIndex(0), broadcaster.BroadcastAttestations[0].Data.CommitteeIndex) - assert.Equal(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", hexutil.Encode(broadcaster.BroadcastAttestations[0].Data.BeaconBlockRoot)) - assert.Equal(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", hexutil.Encode(broadcaster.BroadcastAttestations[0].Data.Source.Root)) - assert.Equal(t, primitives.Epoch(0), broadcaster.BroadcastAttestations[0].Data.Source.Epoch) - assert.Equal(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", hexutil.Encode(broadcaster.BroadcastAttestations[0].Data.Target.Root)) - assert.Equal(t, primitives.Epoch(0), broadcaster.BroadcastAttestations[0].Data.Target.Epoch) + assert.Equal(t, "0x03", hexutil.Encode(broadcaster.BroadcastAttestations[0].GetAggregationBits())) + assert.Equal(t, "0x8146f4397bfd8fd057ebbcd6a67327bdc7ed5fb650533edcb6377b650dea0b6da64c14ecd60846d5c0a0cd43893d6972092500f82c9d8a955e2b58c5ed3cbe885d84008ace6bd86ba9e23652f58e2ec207cec494c916063257abf285b9b15b15", hexutil.Encode(broadcaster.BroadcastAttestations[0].GetSignature())) + assert.Equal(t, primitives.Slot(0), broadcaster.BroadcastAttestations[0].GetData().Slot) + assert.Equal(t, primitives.CommitteeIndex(0), broadcaster.BroadcastAttestations[0].GetData().CommitteeIndex) + assert.Equal(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", hexutil.Encode(broadcaster.BroadcastAttestations[0].GetData().BeaconBlockRoot)) + assert.Equal(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", hexutil.Encode(broadcaster.BroadcastAttestations[0].GetData().Source.Root)) + assert.Equal(t, primitives.Epoch(0), broadcaster.BroadcastAttestations[0].GetData().Source.Epoch) + assert.Equal(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", hexutil.Encode(broadcaster.BroadcastAttestations[0].GetData().Target.Root)) + assert.Equal(t, primitives.Epoch(0), broadcaster.BroadcastAttestations[0].GetData().Target.Epoch) assert.Equal(t, 1, s.AttestationsPool.UnaggregatedAttestationCount()) }) t.Run("multiple", func(t *testing.T) { @@ -1060,7 +1061,7 @@ func TestGetAttesterSlashings(t *testing.T) { s := &Server{ ChainInfoFetcher: &blockchainmock.ChainService{State: bs}, - SlashingsPool: &slashingsmock.PoolMock{PendingAttSlashings: []*ethpbv1alpha1.AttesterSlashing{slashing1, slashing2}}, + SlashingsPool: &slashingsmock.PoolMock{PendingAttSlashings: []interfaces.AttesterSlashing{slashing1, slashing2}}, } request := httptest.NewRequest(http.MethodGet, "http://example.com/beacon/pool/attester_slashings", nil) diff --git a/beacon-chain/rpc/eth/events/BUILD.bazel b/beacon-chain/rpc/eth/events/BUILD.bazel index f795688bf5ce..419848a71cb2 100644 --- a/beacon-chain/rpc/eth/events/BUILD.bazel +++ b/beacon-chain/rpc/eth/events/BUILD.bazel @@ -22,6 +22,7 @@ go_library( "//network/httputil:go_default_library", "//proto/eth/v1:go_default_library", "//proto/eth/v2:go_default_library", + "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", "//time/slots:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 9382766d44ad..776dddf1980d 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -22,6 +22,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/network/httputil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" ethpbv2 "github.com/prysmaticlabs/prysm/v5/proto/eth/v2" + eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "go.opencensus.io/trace" @@ -173,7 +174,11 @@ func handleBlockOperationEvents(w http.ResponseWriter, flusher http.Flusher, req if !ok { return write(w, flusher, topicDataMismatch, event.Data, AttestationTopic) } - att := structs.AttFromConsensus(attData.Attestation) + a, ok := attData.Attestation.(*eth.Attestation) + if !ok { + return write(w, flusher, topicDataMismatch, event.Data, AttestationTopic) + } + att := structs.AttFromConsensus(a) return send(w, flusher, AttestationTopic, att) case operation.ExitReceived: if _, ok := requestedTopics[VoluntaryExitTopic]; !ok { @@ -229,7 +234,11 @@ func handleBlockOperationEvents(w http.ResponseWriter, flusher http.Flusher, req if !ok { return write(w, flusher, topicDataMismatch, event.Data, AttesterSlashingTopic) } - return send(w, flusher, AttesterSlashingTopic, structs.AttesterSlashingFromConsensus(attesterSlashingData.AttesterSlashing)) + slashing, ok := attesterSlashingData.AttesterSlashing.(*eth.AttesterSlashing) + if ok { + return send(w, flusher, AttesterSlashingTopic, structs.AttesterSlashingFromConsensus(slashing)) + } + // TODO: extend to Electra case operation.ProposerSlashingReceived: if _, ok := requestedTopics[ProposerSlashingTopic]; !ok { return nil diff --git a/beacon-chain/rpc/eth/rewards/handlers_test.go b/beacon-chain/rpc/eth/rewards/handlers_test.go index aa41b308a5b6..1acfa44b503b 100644 --- a/beacon-chain/rpc/eth/rewards/handlers_test.go +++ b/beacon-chain/rpc/eth/rewards/handlers_test.go @@ -104,18 +104,18 @@ func BlockRewardTestSetup(t *testing.T, forkName string) (state.BeaconState, int sbb.SetSlot(2) // we have to set the proposer index to the value that will be randomly chosen (fortunately it's deterministic) sbb.SetProposerIndex(12) - sbb.SetAttestations([]*eth.Attestation{ - { + require.NoError(t, sbb.SetAttestations([]interfaces.Attestation{ + ð.Attestation{ AggregationBits: bitfield.Bitlist{0b00000111}, Data: util.HydrateAttestationData(ð.AttestationData{}), Signature: make([]byte, fieldparams.BLSSignatureLength), }, - { + ð.Attestation{ AggregationBits: bitfield.Bitlist{0b00000111}, Data: util.HydrateAttestationData(ð.AttestationData{}), Signature: make([]byte, fieldparams.BLSSignatureLength), }, - }) + })) attData1 := util.HydrateAttestationData(ð.AttestationData{BeaconBlockRoot: bytesutil.PadTo([]byte("root1"), 32)}) attData2 := util.HydrateAttestationData(ð.AttestationData{BeaconBlockRoot: bytesutil.PadTo([]byte("root2"), 32)}) @@ -125,8 +125,8 @@ func BlockRewardTestSetup(t *testing.T, forkName string) (state.BeaconState, int require.NoError(t, err) sigRoot2, err := signing.ComputeSigningRoot(attData2, domain) require.NoError(t, err) - sbb.SetAttesterSlashings([]*eth.AttesterSlashing{ - { + require.NoError(t, sbb.SetAttesterSlashings([]interfaces.AttesterSlashing{ + ð.AttesterSlashing{ Attestation_1: ð.IndexedAttestation{ AttestingIndices: []uint64{0}, Data: attData1, @@ -138,7 +138,7 @@ func BlockRewardTestSetup(t *testing.T, forkName string) (state.BeaconState, int Signature: secretKeys[0].Sign(sigRoot2[:]).Marshal(), }, }, - }) + })) header1 := ð.BeaconBlockHeader{ Slot: 0, ProposerIndex: 1, diff --git a/beacon-chain/rpc/eth/validator/BUILD.bazel b/beacon-chain/rpc/eth/validator/BUILD.bazel index 5ab2597a0c09..4533938fe277 100644 --- a/beacon-chain/rpc/eth/validator/BUILD.bazel +++ b/beacon-chain/rpc/eth/validator/BUILD.bazel @@ -33,6 +33,7 @@ go_library( "//config/params:go_default_library", "//consensus-types:go_default_library", "//consensus-types/blocks:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//consensus-types/validator:go_default_library", "//encoding/bytesutil:go_default_library", @@ -79,6 +80,7 @@ go_test( "//beacon-chain/sync/initial-sync/testing:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//encoding/bytesutil:go_default_library", diff --git a/beacon-chain/rpc/eth/validator/handlers.go b/beacon-chain/rpc/eth/validator/handlers.go index 53cff078d2b5..6bd914c365fc 100644 --- a/beacon-chain/rpc/eth/validator/handlers.go +++ b/beacon-chain/rpc/eth/validator/handlers.go @@ -25,6 +25,7 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" validator2 "github.com/prysmaticlabs/prysm/v5/consensus-types/validator" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -52,7 +53,7 @@ func (s *Server) GetAggregateAttestation(w http.ResponseWriter, r *http.Request) return } - var match *ethpbalpha.Attestation + var match interfaces.Attestation var err error match, err = matchingAtt(s.AttestationsPool.AggregatedAttestations(), primitives.Slot(slot), attDataRoot) @@ -79,29 +80,29 @@ func (s *Server) GetAggregateAttestation(w http.ResponseWriter, r *http.Request) response := &structs.AggregateAttestationResponse{ Data: &structs.Attestation{ - AggregationBits: hexutil.Encode(match.AggregationBits), + AggregationBits: hexutil.Encode(match.GetAggregationBits()), Data: &structs.AttestationData{ - Slot: strconv.FormatUint(uint64(match.Data.Slot), 10), - CommitteeIndex: strconv.FormatUint(uint64(match.Data.CommitteeIndex), 10), - BeaconBlockRoot: hexutil.Encode(match.Data.BeaconBlockRoot), + Slot: strconv.FormatUint(uint64(match.GetData().Slot), 10), + CommitteeIndex: strconv.FormatUint(uint64(match.GetData().CommitteeIndex), 10), + BeaconBlockRoot: hexutil.Encode(match.GetData().BeaconBlockRoot), Source: &structs.Checkpoint{ - Epoch: strconv.FormatUint(uint64(match.Data.Source.Epoch), 10), - Root: hexutil.Encode(match.Data.Source.Root), + Epoch: strconv.FormatUint(uint64(match.GetData().Source.Epoch), 10), + Root: hexutil.Encode(match.GetData().Source.Root), }, Target: &structs.Checkpoint{ - Epoch: strconv.FormatUint(uint64(match.Data.Target.Epoch), 10), - Root: hexutil.Encode(match.Data.Target.Root), + Epoch: strconv.FormatUint(uint64(match.GetData().Target.Epoch), 10), + Root: hexutil.Encode(match.GetData().Target.Root), }, }, - Signature: hexutil.Encode(match.Signature), + Signature: hexutil.Encode(match.GetSignature()), }} httputil.WriteJson(w, response) } -func matchingAtt(atts []*ethpbalpha.Attestation, slot primitives.Slot, attDataRoot []byte) (*ethpbalpha.Attestation, error) { +func matchingAtt(atts []interfaces.Attestation, slot primitives.Slot, attDataRoot []byte) (interfaces.Attestation, error) { for _, att := range atts { - if att.Data.Slot == slot { - root, err := att.Data.HashTreeRoot() + if att.GetData().Slot == slot { + root, err := att.GetData().HashTreeRoot() if err != nil { return nil, errors.Wrap(err, "could not get attestation data root") } diff --git a/beacon-chain/rpc/eth/validator/handlers_test.go b/beacon-chain/rpc/eth/validator/handlers_test.go index 178d6fcb0c00..6ef0a4ce3db1 100644 --- a/beacon-chain/rpc/eth/validator/handlers_test.go +++ b/beacon-chain/rpc/eth/validator/handlers_test.go @@ -33,6 +33,7 @@ import ( mockSync "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync/initial-sync/testing" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -143,9 +144,9 @@ func TestGetAggregateAttestation(t *testing.T) { } pool := attestations.NewPool() - err := pool.SaveAggregatedAttestations([]*ethpbalpha.Attestation{attSlot1, attslot21, attslot22}) + err := pool.SaveAggregatedAttestations([]interfaces.Attestation{attSlot1, attslot21, attslot22}) assert.NoError(t, err) - err = pool.SaveUnaggregatedAttestations([]*ethpbalpha.Attestation{attslot31, attslot32}) + err = pool.SaveUnaggregatedAttestations([]interfaces.Attestation{attslot31, attslot32}) assert.NoError(t, err) s := &Server{ @@ -314,7 +315,7 @@ func TestGetAggregateAttestation_SameSlotAndRoot_ReturnMostAggregationBits(t *te Signature: sig, } pool := attestations.NewPool() - err := pool.SaveAggregatedAttestations([]*ethpbalpha.Attestation{att1, att2}) + err := pool.SaveAggregatedAttestations([]interfaces.Attestation{att1, att2}) assert.NoError(t, err) s := &Server{ AttestationsPool: pool, diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go index 28d9f5fc2713..fc8dc7b2c494 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go @@ -21,7 +21,7 @@ import ( // sortableAttestations implements the Sort interface to sort attestations // by slot as the canonical sorting attribute. -type sortableAttestations []*ethpb.Attestation +type sortableAttestations []interfaces.Attestation // Len is the number of elements in the collection. func (s sortableAttestations) Len() int { return len(s) } @@ -31,16 +31,16 @@ func (s sortableAttestations) Swap(i, j int) { s[i], s[j] = s[j], s[i] } // Less reports whether the element with index i must sort before the element with index j. func (s sortableAttestations) Less(i, j int) bool { - return s[i].Data.Slot < s[j].Data.Slot + return s[i].GetData().Slot < s[j].GetData().Slot } -func mapAttestationsByTargetRoot(atts []*ethpb.Attestation) map[[32]byte][]*ethpb.Attestation { - attsMap := make(map[[32]byte][]*ethpb.Attestation, len(atts)) +func mapAttestationsByTargetRoot(atts []interfaces.Attestation) map[[32]byte][]interfaces.Attestation { + attsMap := make(map[[32]byte][]interfaces.Attestation, len(atts)) if len(atts) == 0 { return attsMap } for _, att := range atts { - attsMap[bytesutil.ToBytes32(att.Data.Target.Root)] = append(attsMap[bytesutil.ToBytes32(att.Data.Target.Root)], att) + attsMap[bytesutil.ToBytes32(att.GetData().Target.Root)] = append(attsMap[bytesutil.ToBytes32(att.GetData().Target.Root)], att) } return attsMap } @@ -74,7 +74,7 @@ func (bs *Server) ListAttestations( default: return nil, status.Error(codes.InvalidArgument, "Must specify a filter criteria for fetching attestations") } - atts := make([]*ethpb.Attestation, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks))) + atts := make([]interfaces.Attestation, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks))) for _, blk := range blocks { atts = append(atts, blk.Block().Body().Attestations()...) } @@ -96,8 +96,15 @@ func (bs *Server) ListAttestations( if err != nil { return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err) } + attestations := make([]*ethpb.Attestation, 0, len(atts)) + for _, att := range atts { + a, ok := att.(*ethpb.Attestation) + if ok { + attestations = append(attestations, a) + } + } return ðpb.ListAttestationsResponse{ - Attestations: atts[start:end], + Attestations: attestations[start:end], TotalSize: int32(numAttestations), NextPageToken: nextPageToken, }, nil @@ -129,7 +136,7 @@ func (bs *Server) ListIndexedAttestations( return nil, status.Error(codes.InvalidArgument, "Must specify a filter criteria for fetching attestations") } - attsArray := make([]*ethpb.Attestation, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks))) + attsArray := make([]interfaces.Attestation, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks))) for _, b := range blocks { attsArray = append(attsArray, b.Block().Body().Attestations()...) } @@ -166,7 +173,7 @@ func (bs *Server) ListIndexedAttestations( } for i := 0; i < len(atts); i++ { att := atts[i] - committee, err := helpers.BeaconCommitteeFromState(ctx, attState, att.Data.Slot, att.Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(ctx, attState, att.GetData().Slot, att.GetData().CommitteeIndex) if err != nil { return nil, status.Errorf( codes.Internal, @@ -178,7 +185,10 @@ func (bs *Server) ListIndexedAttestations( if err != nil { return nil, err } - indexedAtts = append(indexedAtts, idxAtt) + a, ok := idxAtt.(*ethpb.IndexedAttestation) + if ok { + indexedAtts = append(indexedAtts, a) + } } } @@ -226,8 +236,15 @@ func (bs *Server) AttestationPool( if err != nil { return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err) } + attestations := make([]*ethpb.Attestation, 0, len(atts)) + for _, att := range atts { + a, ok := att.(*ethpb.Attestation) + if ok { + attestations = append(attestations, a) + } + } return ðpb.AttestationPoolResponse{ - Attestations: atts[start:end], + Attestations: attestations[start:end], TotalSize: int32(numAtts), NextPageToken: nextPageToken, }, nil diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go index be9ef9238967..bcc63c7c4705 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go @@ -263,7 +263,7 @@ func TestServer_ListAttestations_Pagination_CustomPageParameters(t *testing.T) { ctx := context.Background() count := params.BeaconConfig().SlotsPerEpoch * 4 - atts := make([]*ethpb.Attestation, 0, count) + atts := make([]interfaces.Attestation, 0, count) for i := primitives.Slot(0); i < params.BeaconConfig().SlotsPerEpoch; i++ { for s := primitives.CommitteeIndex(0); s < 4; s++ { blockExample := util.NewBeaconBlock() @@ -278,7 +278,11 @@ func TestServer_ListAttestations_Pagination_CustomPageParameters(t *testing.T) { }), } util.SaveBlock(t, ctx, db, blockExample) - atts = append(atts, blockExample.Block.Body.Attestations...) + as := make([]interfaces.Attestation, len(blockExample.Block.Body.Attestations)) + for i, a := range blockExample.Block.Body.Attestations { + as[i] = a + } + atts = append(atts, as...) } } sort.Sort(sortableAttestations(atts)) @@ -303,9 +307,9 @@ func TestServer_ListAttestations_Pagination_CustomPageParameters(t *testing.T) { }, res: ðpb.ListAttestationsResponse{ Attestations: []*ethpb.Attestation{ - atts[3], - atts[4], - atts[5], + atts[3].(*ethpb.Attestation), + atts[4].(*ethpb.Attestation), + atts[5].(*ethpb.Attestation), }, NextPageToken: strconv.Itoa(2), TotalSize: int32(count), @@ -322,7 +326,7 @@ func TestServer_ListAttestations_Pagination_CustomPageParameters(t *testing.T) { }, res: ðpb.ListAttestationsResponse{ Attestations: []*ethpb.Attestation{ - atts[10], + atts[10].(*ethpb.Attestation), }, NextPageToken: strconv.Itoa(11), TotalSize: int32(count), @@ -339,14 +343,14 @@ func TestServer_ListAttestations_Pagination_CustomPageParameters(t *testing.T) { }, res: ðpb.ListAttestationsResponse{ Attestations: []*ethpb.Attestation{ - atts[16], - atts[17], - atts[18], - atts[19], - atts[20], - atts[21], - atts[22], - atts[23], + atts[16].(*ethpb.Attestation), + atts[17].(*ethpb.Attestation), + atts[18].(*ethpb.Attestation), + atts[19].(*ethpb.Attestation), + atts[20].(*ethpb.Attestation), + atts[21].(*ethpb.Attestation), + atts[22].(*ethpb.Attestation), + atts[23].(*ethpb.Attestation), }, NextPageToken: strconv.Itoa(3), TotalSize: int32(count)}, @@ -460,7 +464,7 @@ func TestServer_ListAttestations_Pagination_DefaultPageSize(t *testing.T) { func TestServer_mapAttestationToTargetRoot(t *testing.T) { count := primitives.Slot(100) - atts := make([]*ethpb.Attestation, count) + atts := make([]interfaces.Attestation, count) targetRoot1 := bytesutil.ToBytes32([]byte("root1")) targetRoot2 := bytesutil.ToBytes32([]byte("root2")) @@ -548,7 +552,9 @@ func TestServer_ListIndexedAttestations_GenesisEpoch(t *testing.T) { require.NoError(t, err) idxAtt, err := attestation.ConvertToIndexed(ctx, atts[i], committee) require.NoError(t, err, "Could not convert attestation to indexed") - indexedAtts[i] = idxAtt + a, ok := idxAtt.(*ethpb.IndexedAttestation) + require.Equal(t, true, ok, "unexpected type of indexed attestation") + indexedAtts[i] = a } for i := 0; i < len(atts2); i++ { att := atts2[i] @@ -556,7 +562,9 @@ func TestServer_ListIndexedAttestations_GenesisEpoch(t *testing.T) { require.NoError(t, err) idxAtt, err := attestation.ConvertToIndexed(ctx, atts2[i], committee) require.NoError(t, err, "Could not convert attestation to indexed") - indexedAtts[i+len(atts)] = idxAtt + a, ok := idxAtt.(*ethpb.IndexedAttestation) + require.Equal(t, true, ok, "unexpected type of indexed attestation") + indexedAtts[i+len(atts)] = a } bs := &Server{ @@ -588,7 +596,7 @@ func TestServer_ListIndexedAttestations_GenesisEpoch(t *testing.T) { require.NoError(t, err) assert.Equal(t, len(indexedAtts), len(res.IndexedAttestations), "Incorrect indexted attestations length") sort.Slice(indexedAtts, func(i, j int) bool { - return indexedAtts[i].Data.Slot < indexedAtts[j].Data.Slot + return indexedAtts[i].GetData().Slot < indexedAtts[j].GetData().Slot }) sort.Slice(res.IndexedAttestations, func(i, j int) bool { return res.IndexedAttestations[i].Data.Slot < res.IndexedAttestations[j].Data.Slot @@ -655,7 +663,9 @@ func TestServer_ListIndexedAttestations_OldEpoch(t *testing.T) { require.NoError(t, err) idxAtt, err := attestation.ConvertToIndexed(ctx, atts[i], committee) require.NoError(t, err, "Could not convert attestation to indexed") - indexedAtts[i] = idxAtt + a, ok := idxAtt.(*ethpb.IndexedAttestation) + require.Equal(t, true, ok, "unexpected type of indexed attestation") + indexedAtts[i] = a } bs := &Server{ @@ -697,8 +707,8 @@ func TestServer_AttestationPool_Pagination_OutOfRange(t *testing.T) { AttestationsPool: attestations.NewPool(), } - atts := []*ethpb.Attestation{ - { + atts := []interfaces.Attestation{ + ðpb.Attestation{ Data: ðpb.AttestationData{ Slot: 1, BeaconBlockRoot: bytesutil.PadTo([]byte{1}, 32), @@ -708,7 +718,7 @@ func TestServer_AttestationPool_Pagination_OutOfRange(t *testing.T) { AggregationBits: bitfield.Bitlist{0b1101}, Signature: bytesutil.PadTo([]byte{1}, fieldparams.BLSSignatureLength), }, - { + ðpb.Attestation{ Data: ðpb.AttestationData{ Slot: 2, BeaconBlockRoot: bytesutil.PadTo([]byte{2}, 32), @@ -718,7 +728,7 @@ func TestServer_AttestationPool_Pagination_OutOfRange(t *testing.T) { AggregationBits: bitfield.Bitlist{0b1101}, Signature: bytesutil.PadTo([]byte{2}, fieldparams.BLSSignatureLength), }, - { + ðpb.Attestation{ Data: ðpb.AttestationData{ Slot: 3, BeaconBlockRoot: bytesutil.PadTo([]byte{3}, 32), @@ -746,7 +756,7 @@ func TestServer_AttestationPool_Pagination_DefaultPageSize(t *testing.T) { AttestationsPool: attestations.NewPool(), } - atts := make([]*ethpb.Attestation, params.BeaconConfig().DefaultPageSize+1) + atts := make([]interfaces.Attestation, params.BeaconConfig().DefaultPageSize+1) for i := 0; i < len(atts); i++ { att := util.NewAttestation() att.Data.Slot = primitives.Slot(i) @@ -768,7 +778,7 @@ func TestServer_AttestationPool_Pagination_CustomPageSize(t *testing.T) { } numAtts := 100 - atts := make([]*ethpb.Attestation, numAtts) + atts := make([]interfaces.Attestation, numAtts) for i := 0; i < len(atts); i++ { att := util.NewAttestation() att.Data.Slot = primitives.Slot(i) diff --git a/beacon-chain/rpc/prysm/v1alpha1/debug/block.go b/beacon-chain/rpc/prysm/v1alpha1/debug/block.go index cbe4e727b451..fe2c7facd850 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/debug/block.go +++ b/beacon-chain/rpc/prysm/v1alpha1/debug/block.go @@ -66,7 +66,7 @@ func (ds *Server) GetInclusionSlot(ctx context.Context, req *pbrpc.InclusionSlot targetStates := make(map[[32]byte]state.ReadOnlyBeaconState) for _, blk := range blks { for _, a := range blk.Block().Body().Attestations() { - tr := bytesutil.ToBytes32(a.Data.Target.Root) + tr := bytesutil.ToBytes32(a.GetData().Target.Root) s, ok := targetStates[tr] if !ok { s, err = ds.StateGen.StateByRoot(ctx, tr) @@ -75,16 +75,16 @@ func (ds *Server) GetInclusionSlot(ctx context.Context, req *pbrpc.InclusionSlot } targetStates[tr] = s } - c, err := helpers.BeaconCommitteeFromState(ctx, s, a.Data.Slot, a.Data.CommitteeIndex) + c, err := helpers.BeaconCommitteeFromState(ctx, s, a.GetData().Slot, a.GetData().CommitteeIndex) if err != nil { return nil, status.Errorf(codes.Internal, "Could not get committee: %v", err) } - indices, err := attestation.AttestingIndices(a.AggregationBits, c) + indices, err := attestation.AttestingIndices(a.GetAggregationBits(), c) if err != nil { return nil, err } for _, i := range indices { - if req.Id == i && req.Slot == a.Data.Slot { + if req.Id == i && req.Slot == a.GetData().Slot { inclusionSlot = blk.Block().Slot() break } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go index c342c3afb8c5..1d5d6d624d33 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go @@ -2,6 +2,7 @@ package validator import ( "context" + "fmt" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/core" @@ -85,22 +86,26 @@ func (vs *Server) SubmitAggregateSelectionProof(ctx context.Context, req *ethpb. // The aggregator should prefer an attestation that they have signed. We check this by // looking at the attestation's committee index against the validator's committee index // and check the aggregate bits to ensure the validator's index is set. - if aggregatedAtt.Data.CommitteeIndex == req.CommitteeIndex && - aggregatedAtt.AggregationBits.BitAt(indexInCommittee) && - (!best.AggregationBits.BitAt(indexInCommittee) || - aggregatedAtt.AggregationBits.Count() > best.AggregationBits.Count()) { + if aggregatedAtt.GetData().CommitteeIndex == req.CommitteeIndex && + aggregatedAtt.GetAggregationBits().BitAt(indexInCommittee) && + (!best.GetAggregationBits().BitAt(indexInCommittee) || + aggregatedAtt.GetAggregationBits().Count() > best.GetAggregationBits().Count()) { best = aggregatedAtt } // If the "best" still doesn't contain the validator's index, check the aggregation bits to // choose the attestation with the most bits set. - if !best.AggregationBits.BitAt(indexInCommittee) && - aggregatedAtt.AggregationBits.Count() > best.AggregationBits.Count() { + if !best.GetAggregationBits().BitAt(indexInCommittee) && + aggregatedAtt.GetAggregationBits().Count() > best.GetAggregationBits().Count() { best = aggregatedAtt } } + att, ok := best.(*ethpb.Attestation) + if !ok { + return nil, fmt.Errorf("best attestation has wrong type (expected %T, got %T)", ðpb.Attestation{}, best) + } a := ðpb.AggregateAttestationAndProof{ - Aggregate: best, + Aggregate: att, SelectionProof: req.SlotSignature, AggregatorIndex: validatorIndex, } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go index e62698661678..ef72ed17ea84 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go @@ -18,6 +18,7 @@ import ( mockSync "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync/initial-sync/testing" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -336,7 +337,7 @@ func TestSubmitAggregateAndProof_PreferOwnAttestation(t *testing.T) { pubKey := v.PublicKey req := ðpb.AggregateSelectionRequest{CommitteeIndex: 1, SlotSignature: sig.Marshal(), PublicKey: pubKey} - err = aggregatorServer.AttPool.SaveAggregatedAttestations([]*ethpb.Attestation{ + err = aggregatorServer.AttPool.SaveAggregatedAttestations([]interfaces.Attestation{ att0, att1, att2, @@ -387,7 +388,7 @@ func TestSubmitAggregateAndProof_SelectsMostBitsWhenOwnAttestationNotPresent(t * pubKey := v.PublicKey req := ðpb.AggregateSelectionRequest{CommitteeIndex: 1, SlotSignature: sig.Marshal(), PublicKey: pubKey} - err = aggregatorServer.AttPool.SaveAggregatedAttestations([]*ethpb.Attestation{ + err = aggregatorServer.AttPool.SaveAggregatedAttestations([]interfaces.Attestation{ att0, att1, }) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go index b4b5156d5549..a86d771186e7 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go @@ -202,17 +202,23 @@ func (vs *Server) BuildBlockParallel(ctx context.Context, sBlk interfaces.Signed deposits, atts, err := vs.packDepositsAndAttestations(ctx, head, eth1Data) // TODO: split attestations and deposits if err != nil { sBlk.SetDeposits([]*ethpb.Deposit{}) - sBlk.SetAttestations([]*ethpb.Attestation{}) + if err := sBlk.SetAttestations([]interfaces.Attestation{}); err != nil { + log.WithError(err).Error("Could not set attestations on block") + } log.WithError(err).Error("Could not pack deposits and attestations") } else { sBlk.SetDeposits(deposits) - sBlk.SetAttestations(atts) + if err := sBlk.SetAttestations(atts); err != nil { + log.WithError(err).Error("Could not set attestations on block") + } } // Set slashings. validProposerSlashings, validAttSlashings := vs.getSlashings(ctx, head) sBlk.SetProposerSlashings(validProposerSlashings) - sBlk.SetAttesterSlashings(validAttSlashings) + if err := sBlk.SetAttesterSlashings(validAttSlashings); err != nil { + log.WithError(err).Error("Could not set attester slashings on block") + } // Set exits. sBlk.SetVoluntaryExits(vs.getExits(head, sBlk.Block().Slot())) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go index b1ee701dbf9e..392113bc39c2 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go @@ -10,16 +10,16 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation" attaggregation "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations" "go.opencensus.io/trace" ) -type proposerAtts []*ethpb.Attestation +type proposerAtts []interfaces.Attestation -func (vs *Server) packAttestations(ctx context.Context, latestState state.BeaconState) ([]*ethpb.Attestation, error) { +func (vs *Server) packAttestations(ctx context.Context, latestState state.BeaconState) ([]interfaces.Attestation, error) { ctx, span := trace.StartSpan(ctx, "ProposerServer.packAttestations") defer span.End() @@ -46,16 +46,16 @@ func (vs *Server) packAttestations(ctx context.Context, latestState state.Beacon return nil, err } - attsByDataRoot := make(map[[32]byte][]*ethpb.Attestation, len(atts)) + attsByDataRoot := make(map[[32]byte][]interfaces.Attestation, len(atts)) for _, att := range atts { - attDataRoot, err := att.Data.HashTreeRoot() + attDataRoot, err := att.GetData().HashTreeRoot() if err != nil { return nil, err } attsByDataRoot[attDataRoot] = append(attsByDataRoot[attDataRoot], att) } - attsForInclusion := proposerAtts(make([]*ethpb.Attestation, 0)) + attsForInclusion := proposerAtts(make([]interfaces.Attestation, 0)) for _, as := range attsByDataRoot { as, err := attaggregation.Aggregate(as) if err != nil { @@ -79,8 +79,8 @@ func (vs *Server) packAttestations(ctx context.Context, latestState state.Beacon // The first group passes the all the required checks for attestation to be considered for proposing. // And attestations from the second group should be deleted. func (a proposerAtts) filter(ctx context.Context, st state.BeaconState) (proposerAtts, proposerAtts) { - validAtts := make([]*ethpb.Attestation, 0, len(a)) - invalidAtts := make([]*ethpb.Attestation, 0, len(a)) + validAtts := make([]interfaces.Attestation, 0, len(a)) + invalidAtts := make([]interfaces.Attestation, 0, len(a)) for _, att := range a { if err := blocks.VerifyAttestationNoVerifySignature(ctx, st, att); err == nil { @@ -107,10 +107,10 @@ func (a proposerAtts) sortByProfitabilityUsingMaxCover() (proposerAtts, error) { var slots []primitives.Slot attsBySlot := map[primitives.Slot]proposerAtts{} for _, att := range a { - if _, ok := attsBySlot[att.Data.Slot]; !ok { - slots = append(slots, att.Data.Slot) + if _, ok := attsBySlot[att.GetData().Slot]; !ok { + slots = append(slots, att.GetData().Slot) } - attsBySlot[att.Data.Slot] = append(attsBySlot[att.Data.Slot], att) + attsBySlot[att.GetData().Slot] = append(attsBySlot[att.GetData().Slot], att) } selectAtts := func(atts proposerAtts) (proposerAtts, error) { @@ -120,7 +120,7 @@ func (a proposerAtts) sortByProfitabilityUsingMaxCover() (proposerAtts, error) { candidates := make([]*bitfield.Bitlist64, len(atts)) for i := 0; i < len(atts); i++ { var err error - candidates[i], err = atts[i].AggregationBits.ToBitlist64() + candidates[i], err = atts[i].GetAggregationBits().ToBitlist64() if err != nil { return nil, err } @@ -139,10 +139,10 @@ func (a proposerAtts) sortByProfitabilityUsingMaxCover() (proposerAtts, error) { leftoverAtts[i] = atts[key] } sort.Slice(selectedAtts, func(i, j int) bool { - return selectedAtts[i].AggregationBits.Count() > selectedAtts[j].AggregationBits.Count() + return selectedAtts[i].GetAggregationBits().Count() > selectedAtts[j].GetAggregationBits().Count() }) sort.Slice(leftoverAtts, func(i, j int) bool { - return leftoverAtts[i].AggregationBits.Count() > leftoverAtts[j].AggregationBits.Count() + return leftoverAtts[i].GetAggregationBits().Count() > leftoverAtts[j].GetAggregationBits().Count() }) return append(selectedAtts, leftoverAtts...), nil } @@ -182,22 +182,22 @@ func (a proposerAtts) dedup() (proposerAtts, error) { if len(a) < 2 { return a, nil } - attsByDataRoot := make(map[[32]byte][]*ethpb.Attestation, len(a)) + attsByDataRoot := make(map[[32]byte][]interfaces.Attestation, len(a)) for _, att := range a { - attDataRoot, err := att.Data.HashTreeRoot() + attDataRoot, err := att.GetData().HashTreeRoot() if err != nil { continue } attsByDataRoot[attDataRoot] = append(attsByDataRoot[attDataRoot], att) } - uniqAtts := make([]*ethpb.Attestation, 0, len(a)) + uniqAtts := make([]interfaces.Attestation, 0, len(a)) for _, atts := range attsByDataRoot { for i := 0; i < len(atts); i++ { a := atts[i] for j := i + 1; j < len(atts); j++ { b := atts[j] - if c, err := a.AggregationBits.Contains(b.AggregationBits); err != nil { + if c, err := a.GetAggregationBits().Contains(b.GetAggregationBits()); err != nil { return nil, err } else if c { // a contains b, b is redundant. @@ -205,7 +205,7 @@ func (a proposerAtts) dedup() (proposerAtts, error) { atts[len(atts)-1] = nil atts = atts[:len(atts)-1] j-- - } else if c, err := b.AggregationBits.Contains(a.AggregationBits); err != nil { + } else if c, err := b.GetAggregationBits().Contains(a.GetAggregationBits()); err != nil { return nil, err } else if c { // b contains a, a is redundant. @@ -224,7 +224,7 @@ func (a proposerAtts) dedup() (proposerAtts, error) { } // This filters the input attestations to return a list of valid attestations to be packaged inside a beacon block. -func (vs *Server) validateAndDeleteAttsInPool(ctx context.Context, st state.BeaconState, atts []*ethpb.Attestation) ([]*ethpb.Attestation, error) { +func (vs *Server) validateAndDeleteAttsInPool(ctx context.Context, st state.BeaconState, atts []interfaces.Attestation) ([]interfaces.Attestation, error) { ctx, span := trace.StartSpan(ctx, "ProposerServer.validateAndDeleteAttsInPool") defer span.End() @@ -237,7 +237,7 @@ func (vs *Server) validateAndDeleteAttsInPool(ctx context.Context, st state.Beac // The input attestations are processed and seen by the node, this deletes them from pool // so proposers don't include them in a block for the future. -func (vs *Server) deleteAttsInPool(ctx context.Context, atts []*ethpb.Attestation) error { +func (vs *Server) deleteAttsInPool(ctx context.Context, atts []interfaces.Attestation) error { ctx, span := trace.StartSpan(ctx, "ProposerServer.deleteAttsInPool") defer span.End() diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go index 38414a7c5653..e1c9480a6d9f 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" @@ -14,7 +15,7 @@ import ( ) func TestProposer_ProposerAtts_sortByProfitability(t *testing.T) { - atts := proposerAtts([]*ethpb.Attestation{ + atts := proposerAtts([]interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 4}, AggregationBits: bitfield.Bitlist{0b11100000}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b11000000}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 2}, AggregationBits: bitfield.Bitlist{0b11100000}}), @@ -22,7 +23,7 @@ func TestProposer_ProposerAtts_sortByProfitability(t *testing.T) { util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b11100000}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b11000000}}), }) - want := proposerAtts([]*ethpb.Attestation{ + want := proposerAtts([]interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 4}, AggregationBits: bitfield.Bitlist{0b11110000}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 4}, AggregationBits: bitfield.Bitlist{0b11100000}}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 3}, AggregationBits: bitfield.Bitlist{0b11000000}}), @@ -411,13 +412,13 @@ func TestProposer_ProposerAtts_dedup(t *testing.T) { t.Error(err) } sort.Slice(atts, func(i, j int) bool { - if atts[i].AggregationBits.Count() == atts[j].AggregationBits.Count() { - if atts[i].Data.Slot == atts[j].Data.Slot { - return bytes.Compare(atts[i].AggregationBits, atts[j].AggregationBits) <= 0 + if atts[i].GetAggregationBits().Count() == atts[j].GetAggregationBits().Count() { + if atts[i].GetData().Slot == atts[j].GetData().Slot { + return bytes.Compare(atts[i].GetAggregationBits(), atts[j].GetAggregationBits()) <= 0 } - return atts[i].Data.Slot > atts[j].Data.Slot + return atts[i].GetData().Slot > atts[j].GetData().Slot } - return atts[i].AggregationBits.Count() > atts[j].AggregationBits.Count() + return atts[i].GetAggregationBits().Count() > atts[j].GetAggregationBits().Count() }) assert.DeepEqual(t, tt.want, atts) }) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go index 9933be06a54b..be110d9e30fc 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go @@ -9,6 +9,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/cache" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/container/trie" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/sirupsen/logrus" @@ -18,10 +19,10 @@ import ( "google.golang.org/grpc/status" ) -func (vs *Server) packDepositsAndAttestations(ctx context.Context, head state.BeaconState, eth1Data *ethpb.Eth1Data) ([]*ethpb.Deposit, []*ethpb.Attestation, error) { +func (vs *Server) packDepositsAndAttestations(ctx context.Context, head state.BeaconState, eth1Data *ethpb.Eth1Data) ([]*ethpb.Deposit, []interfaces.Attestation, error) { eg, egctx := errgroup.WithContext(ctx) var deposits []*ethpb.Deposit - var atts []*ethpb.Attestation + var atts []interfaces.Attestation eg.Go(func() error { // Pack ETH1 deposits which have not been included in the beacon chain. diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings.go index efb2beef3c12..2658140ac787 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings.go @@ -6,10 +6,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" v "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (vs *Server) getSlashings(ctx context.Context, head state.BeaconState) ([]*ethpb.ProposerSlashing, []*ethpb.AttesterSlashing) { +func (vs *Server) getSlashings(ctx context.Context, head state.BeaconState) ([]*ethpb.ProposerSlashing, []interfaces.AttesterSlashing) { proposerSlashings := vs.SlashingsPool.PendingProposerSlashings(ctx, head, false /*noLimit*/) validProposerSlashings := make([]*ethpb.ProposerSlashing, 0, len(proposerSlashings)) for _, slashing := range proposerSlashings { @@ -21,7 +22,7 @@ func (vs *Server) getSlashings(ctx context.Context, head state.BeaconState) ([]* validProposerSlashings = append(validProposerSlashings, slashing) } attSlashings := vs.SlashingsPool.PendingAttesterSlashings(ctx, head, false /*noLimit*/) - validAttSlashings := make([]*ethpb.AttesterSlashing, 0, len(attSlashings)) + validAttSlashings := make([]interfaces.AttesterSlashing, 0, len(attSlashings)) for _, slashing := range attSlashings { _, err := blocks.ProcessAttesterSlashing(ctx, head, slashing, v.SlashValidator) if err != nil { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings_test.go index 78f2351c0aee..3411a8b730cd 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_slashings_test.go @@ -6,6 +6,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/slashings" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -28,7 +29,7 @@ func TestServer_getSlashings(t *testing.T) { require.NoError(t, err) } - attSlashings := make([]*ethpb.AttesterSlashing, params.BeaconConfig().MaxAttesterSlashings) + attSlashings := make([]interfaces.AttesterSlashing, params.BeaconConfig().MaxAttesterSlashings) for i := uint64(0); i < params.BeaconConfig().MaxAttesterSlashings; i++ { attesterSlashing, err := util.GenerateAttesterSlashingForValidator( beaconState, diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go index 37b82a7617a5..796cdf1d1af3 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go @@ -38,6 +38,7 @@ import ( fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/trie" "github.com/prysmaticlabs/prysm/v5/crypto/bls" @@ -2396,22 +2397,22 @@ func TestProposer_FilterAttestation(t *testing.T) { tests := []struct { name string wantedErr string - inputAtts func() []*ethpb.Attestation - expectedAtts func(inputAtts []*ethpb.Attestation) []*ethpb.Attestation + inputAtts func() []interfaces.Attestation + expectedAtts func(inputAtts []interfaces.Attestation) []interfaces.Attestation }{ { name: "nil attestations", - inputAtts: func() []*ethpb.Attestation { + inputAtts: func() []interfaces.Attestation { return nil }, - expectedAtts: func(inputAtts []*ethpb.Attestation) []*ethpb.Attestation { - return []*ethpb.Attestation{} + expectedAtts: func(inputAtts []interfaces.Attestation) []interfaces.Attestation { + return []interfaces.Attestation{} }, }, { name: "invalid attestations", - inputAtts: func() []*ethpb.Attestation { - atts := make([]*ethpb.Attestation, 10) + inputAtts: func() []interfaces.Attestation { + atts := make([]interfaces.Attestation, 10) for i := 0; i < len(atts); i++ { atts[i] = util.HydrateAttestation(ðpb.Attestation{ Data: ðpb.AttestationData{ @@ -2421,14 +2422,14 @@ func TestProposer_FilterAttestation(t *testing.T) { } return atts }, - expectedAtts: func(inputAtts []*ethpb.Attestation) []*ethpb.Attestation { - return []*ethpb.Attestation{} + expectedAtts: func(inputAtts []interfaces.Attestation) []interfaces.Attestation { + return []interfaces.Attestation{} }, }, { name: "filter aggregates ok", - inputAtts: func() []*ethpb.Attestation { - atts := make([]*ethpb.Attestation, 10) + inputAtts: func() []interfaces.Attestation { + atts := make([]interfaces.Attestation, 10) for i := 0; i < len(atts); i++ { atts[i] = util.HydrateAttestation(ðpb.Attestation{ Data: ðpb.AttestationData{ @@ -2437,29 +2438,29 @@ func TestProposer_FilterAttestation(t *testing.T) { }, AggregationBits: bitfield.Bitlist{0b00010010}, }) - committee, err := helpers.BeaconCommitteeFromState(context.Background(), st, atts[i].Data.Slot, atts[i].Data.CommitteeIndex) + committee, err := helpers.BeaconCommitteeFromState(context.Background(), st, atts[i].GetData().Slot, atts[i].GetData().CommitteeIndex) assert.NoError(t, err) - attestingIndices, err := attestation.AttestingIndices(atts[i].AggregationBits, committee) + attestingIndices, err := attestation.AttestingIndices(atts[i].GetAggregationBits(), committee) require.NoError(t, err) assert.NoError(t, err) domain, err := signing.Domain(st.Fork(), 0, params.BeaconConfig().DomainBeaconAttester, params.BeaconConfig().ZeroHash[:]) require.NoError(t, err) sigs := make([]bls.Signature, len(attestingIndices)) var zeroSig [96]byte - atts[i].Signature = zeroSig[:] + atts[i].(*ethpb.Attestation).Signature = zeroSig[:] for i, indice := range attestingIndices { - hashTreeRoot, err := signing.ComputeSigningRoot(atts[i].Data, domain) + hashTreeRoot, err := signing.ComputeSigningRoot(atts[i].GetData(), domain) require.NoError(t, err) sig := privKeys[indice].Sign(hashTreeRoot[:]) sigs[i] = sig } - atts[i].Signature = bls.AggregateSignatures(sigs).Marshal() + atts[i].(*ethpb.Attestation).Signature = bls.AggregateSignatures(sigs).Marshal() } return atts }, - expectedAtts: func(inputAtts []*ethpb.Attestation) []*ethpb.Attestation { - return []*ethpb.Attestation{inputAtts[0], inputAtts[1]} + expectedAtts: func(inputAtts []interfaces.Attestation) []interfaces.Attestation { + return []interfaces.Attestation{inputAtts[0], inputAtts[1]} }, }, } @@ -2589,10 +2590,10 @@ func TestProposer_DeleteAttsInPool_Aggregated(t *testing.T) { priv, err := bls.RandKey() require.NoError(t, err) sig := priv.Sign([]byte("foo")).Marshal() - aggregatedAtts := []*ethpb.Attestation{ + aggregatedAtts := []interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b10101}, Signature: sig}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b11010}, Signature: sig})} - unaggregatedAtts := []*ethpb.Attestation{ + unaggregatedAtts := []interfaces.Attestation{ util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b10010}, Signature: sig}), util.HydrateAttestation(ðpb.Attestation{Data: ðpb.AttestationData{Slot: 1}, AggregationBits: bitfield.Bitlist{0b10100}, Signature: sig})} diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go index 00f20fe353d9..5fa5071de233 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go @@ -6,6 +6,7 @@ import ( "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" aggtesting "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/testing" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -44,10 +45,10 @@ func BenchmarkProposerAtts_sortByProfitability(b *testing.B) { }, } - runner := func(atts []*ethpb.Attestation) { + runner := func(atts []interfaces.Attestation) { attsCopy := make(proposerAtts, len(atts)) for i, att := range atts { - attsCopy[i] = ethpb.CopyAttestation(att) + attsCopy[i] = ethpb.CopyAttestation(att.(*ethpb.Attestation)) } _, err := attsCopy.sortByProfitability() require.NoError(b, err, "Could not sort attestations by profitability") diff --git a/beacon-chain/slasher/BUILD.bazel b/beacon-chain/slasher/BUILD.bazel index 00bf4aaaeacc..60965a8cee7c 100644 --- a/beacon-chain/slasher/BUILD.bazel +++ b/beacon-chain/slasher/BUILD.bazel @@ -36,6 +36,7 @@ go_library( "//beacon-chain/sync:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//container/slice:go_default_library", "//encoding/bytesutil:go_default_library", @@ -78,6 +79,7 @@ go_test( "//beacon-chain/sync/initial-sync/testing:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//crypto/bls/common:go_default_library", diff --git a/beacon-chain/slasher/chunks.go b/beacon-chain/slasher/chunks.go index c8f2f711bafd..dbb08035231f 100644 --- a/beacon-chain/slasher/chunks.go +++ b/beacon-chain/slasher/chunks.go @@ -9,6 +9,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" slashertypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/sirupsen/logrus" @@ -26,7 +27,7 @@ type Chunker interface { slasherDB db.SlasherDatabase, validatorIdx primitives.ValidatorIndex, attestation *slashertypes.IndexedAttestationWrapper, - ) (*ethpb.AttesterSlashing, error) + ) (interfaces.AttesterSlashing, error) Update( chunkIndex uint64, currentEpoch primitives.Epoch, @@ -185,9 +186,9 @@ func (m *MinSpanChunksSlice) CheckSlashable( slasherDB db.SlasherDatabase, validatorIdx primitives.ValidatorIndex, incomingAttWrapper *slashertypes.IndexedAttestationWrapper, -) (*ethpb.AttesterSlashing, error) { - sourceEpoch := incomingAttWrapper.IndexedAttestation.Data.Source.Epoch - targetEpoch := incomingAttWrapper.IndexedAttestation.Data.Target.Epoch +) (interfaces.AttesterSlashing, error) { + sourceEpoch := incomingAttWrapper.IndexedAttestation.GetData().Source.Epoch + targetEpoch := incomingAttWrapper.IndexedAttestation.GetData().Target.Epoch minTarget, err := chunkDataAtEpoch(m.params, m.data, validatorIdx, sourceEpoch) if err != nil { @@ -221,7 +222,7 @@ func (m *MinSpanChunksSlice) CheckSlashable( return nil, nil } - if existingAttWrapper.IndexedAttestation.Data.Source.Epoch <= sourceEpoch { + if existingAttWrapper.IndexedAttestation.GetData().Source.Epoch <= sourceEpoch { // This case should normally not happen, since if we have targetEpoch > minTarget, // then there is at least one attestation we surround. // However, it can happens if we have multiple attestation with the same target @@ -232,16 +233,33 @@ func (m *MinSpanChunksSlice) CheckSlashable( surroundingVotesTotal.Inc() + existing, ok := existingAttWrapper.IndexedAttestation.(*ethpb.IndexedAttestation) + if !ok { + return nil, fmt.Errorf( + "existing attestation has wrong type (expected %T, got %T)", + ðpb.IndexedAttestation{}, + existingAttWrapper.IndexedAttestation, + ) + } + incoming, ok := incomingAttWrapper.IndexedAttestation.(*ethpb.IndexedAttestation) + if !ok { + return nil, fmt.Errorf( + "incoming attestation has wrong type (expected %T, got %T)", + ðpb.IndexedAttestation{}, + incomingAttWrapper.IndexedAttestation, + ) + } + slashing := ðpb.AttesterSlashing{ - Attestation_1: existingAttWrapper.IndexedAttestation, - Attestation_2: incomingAttWrapper.IndexedAttestation, + Attestation_1: existing, + Attestation_2: incoming, } // Ensure the attestation with the lower data root is the first attestation. if bytes.Compare(existingAttWrapper.DataRoot[:], incomingAttWrapper.DataRoot[:]) > 0 { slashing = ðpb.AttesterSlashing{ - Attestation_1: incomingAttWrapper.IndexedAttestation, - Attestation_2: existingAttWrapper.IndexedAttestation, + Attestation_1: incoming, + Attestation_2: existing, } } @@ -264,9 +282,9 @@ func (m *MaxSpanChunksSlice) CheckSlashable( slasherDB db.SlasherDatabase, validatorIdx primitives.ValidatorIndex, incomingAttWrapper *slashertypes.IndexedAttestationWrapper, -) (*ethpb.AttesterSlashing, error) { - sourceEpoch := incomingAttWrapper.IndexedAttestation.Data.Source.Epoch - targetEpoch := incomingAttWrapper.IndexedAttestation.Data.Target.Epoch +) (interfaces.AttesterSlashing, error) { + sourceEpoch := incomingAttWrapper.IndexedAttestation.GetData().Source.Epoch + targetEpoch := incomingAttWrapper.IndexedAttestation.GetData().Target.Epoch maxTarget, err := chunkDataAtEpoch(m.params, m.data, validatorIdx, sourceEpoch) if err != nil { @@ -300,7 +318,7 @@ func (m *MaxSpanChunksSlice) CheckSlashable( return nil, nil } - if existingAttWrapper.IndexedAttestation.Data.Source.Epoch >= sourceEpoch { + if existingAttWrapper.IndexedAttestation.GetData().Source.Epoch >= sourceEpoch { // This case should normally not happen, since if we have targetEpoch < maxTarget, // then there is at least one attestation that surrounds us. // However, it can happens if we have multiple attestation with the same target @@ -311,16 +329,33 @@ func (m *MaxSpanChunksSlice) CheckSlashable( surroundedVotesTotal.Inc() + existing, ok := existingAttWrapper.IndexedAttestation.(*ethpb.IndexedAttestation) + if !ok { + return nil, fmt.Errorf( + "existing attestation has wrong type (expected %T, got %T)", + ðpb.IndexedAttestation{}, + existingAttWrapper.IndexedAttestation, + ) + } + incoming, ok := incomingAttWrapper.IndexedAttestation.(*ethpb.IndexedAttestation) + if !ok { + return nil, fmt.Errorf( + "incoming attestation has wrong type (expected %T, got %T)", + ðpb.IndexedAttestation{}, + incomingAttWrapper.IndexedAttestation, + ) + } + slashing := ðpb.AttesterSlashing{ - Attestation_1: existingAttWrapper.IndexedAttestation, - Attestation_2: incomingAttWrapper.IndexedAttestation, + Attestation_1: existing, + Attestation_2: incoming, } // Ensure the attestation with the lower data root is the first attestation. if bytes.Compare(existingAttWrapper.DataRoot[:], incomingAttWrapper.DataRoot[:]) > 0 { slashing = ðpb.AttesterSlashing{ - Attestation_1: incomingAttWrapper.IndexedAttestation, - Attestation_2: existingAttWrapper.IndexedAttestation, + Attestation_1: incoming, + Attestation_2: existing, } } diff --git a/beacon-chain/slasher/chunks_test.go b/beacon-chain/slasher/chunks_test.go index a9519b8a2b77..7fc1ab7a6501 100644 --- a/beacon-chain/slasher/chunks_test.go +++ b/beacon-chain/slasher/chunks_test.go @@ -115,11 +115,11 @@ func TestMinSpanChunksSlice_CheckSlashable(t *testing.T) { // based on our min chunk for either validator. slashing, err := chunk.CheckSlashable(ctx, slasherDB, validatorIdx, att) require.NoError(t, err) - require.Equal(t, (*ethpb.AttesterSlashing)(nil), slashing) + require.Equal(t, nil, slashing) slashing, err = chunk.CheckSlashable(ctx, slasherDB, validatorIdx.Sub(1), att) require.NoError(t, err) - require.Equal(t, (*ethpb.AttesterSlashing)(nil), slashing) + require.Equal(t, nil, slashing) // Next up we initialize an empty chunks slice and mark an attestation // with (source 1, target 2) as attested. @@ -141,11 +141,11 @@ func TestMinSpanChunksSlice_CheckSlashable(t *testing.T) { slashing, err = chunk.CheckSlashable(ctx, slasherDB, validatorIdx, surroundingVote) require.NoError(t, err) - require.Equal(t, (*ethpb.AttesterSlashing)(nil), slashing) + require.Equal(t, nil, slashing) // Next up, we save the old attestation record, then check if the // surrounding vote is indeed slashable. - attData := att.IndexedAttestation.Data + attData := att.IndexedAttestation.GetData() attRecord := createAttestationWrapperEmptySig(t, attData.Source.Epoch, attData.Target.Epoch, []uint64{uint64(validatorIdx)}, []byte{1}) err = slasherDB.SaveAttestationRecordsForValidators( ctx, @@ -193,11 +193,11 @@ func TestMaxSpanChunksSlice_CheckSlashable(t *testing.T) { // based on our max chunk for either validator. slashing, err := chunk.CheckSlashable(ctx, slasherDB, validatorIdx, att) require.NoError(t, err) - require.Equal(t, (*ethpb.AttesterSlashing)(nil), slashing) + require.Equal(t, nil, slashing) slashing, err = chunk.CheckSlashable(ctx, slasherDB, validatorIdx.Sub(1), att) require.NoError(t, err) - require.Equal(t, (*ethpb.AttesterSlashing)(nil), slashing) + require.Equal(t, nil, slashing) // Next up we initialize an empty chunks slice and mark an attestation // with (source 0, target 3) as attested. @@ -219,11 +219,11 @@ func TestMaxSpanChunksSlice_CheckSlashable(t *testing.T) { slashing, err = chunk.CheckSlashable(ctx, slasherDB, validatorIdx, surroundedVote) require.NoError(t, err) - require.Equal(t, (*ethpb.AttesterSlashing)(nil), slashing) + require.Equal(t, nil, slashing) // Next up, we save the old attestation record, then check if the // surroundedVote vote is indeed slashable. - attData := att.IndexedAttestation.Data + attData := att.IndexedAttestation.GetData() signingRoot := [32]byte{1} attRecord := createAttestationWrapperEmptySig( t, attData.Source.Epoch, attData.Target.Epoch, []uint64{uint64(validatorIdx)}, signingRoot[:], diff --git a/beacon-chain/slasher/detect_attestations.go b/beacon-chain/slasher/detect_attestations.go index 8bc349c9b71a..e3ed6abf3915 100644 --- a/beacon-chain/slasher/detect_attestations.go +++ b/beacon-chain/slasher/detect_attestations.go @@ -8,6 +8,7 @@ import ( "github.com/pkg/errors" slashertypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "go.opencensus.io/trace" @@ -18,8 +19,8 @@ import ( // found attester slashings to the caller. func (s *Service) checkSlashableAttestations( ctx context.Context, currentEpoch primitives.Epoch, atts []*slashertypes.IndexedAttestationWrapper, -) (map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing, error) { - slashings := map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing{} +) (map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing, error) { + slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{} // Double votes doubleVoteSlashings, err := s.checkDoubleVotes(ctx, atts) @@ -56,13 +57,13 @@ func (s *Service) checkSurroundVotes( ctx context.Context, attWrappers []*slashertypes.IndexedAttestationWrapper, currentEpoch primitives.Epoch, -) (map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing, error) { +) (map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing, error) { // With 256 validators and 16 epochs per chunk, there is 4096 `uint16` elements per chunk. // 4096 `uint16` elements = 8192 bytes = 8KB // 25_600 chunks * 8KB = 200MB const maxChunkBeforeFlush = 25_600 - slashings := map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing{} + slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{} // Group attestation wrappers by validator chunk index. attWrappersByValidatorChunkIndex := s.groupByValidatorChunkIndex(attWrappers) @@ -153,7 +154,7 @@ func (s *Service) checkSurroundVotes( // Check for double votes in our database given a list of incoming attestations. func (s *Service) checkDoubleVotes( ctx context.Context, incomingAttWrappers []*slashertypes.IndexedAttestationWrapper, -) (map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing, error) { +) (map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing, error) { ctx, span := trace.StartSpan(ctx, "Slasher.checkDoubleVotesOnDisk") defer span.End() @@ -162,15 +163,15 @@ func (s *Service) checkDoubleVotes( epoch primitives.Epoch } - slashings := map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing{} + slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{} // Check each incoming attestation for double votes against other incoming attestations. existingAttWrappers := make(map[attestationInfo]*slashertypes.IndexedAttestationWrapper) for _, incomingAttWrapper := range incomingAttWrappers { - targetEpoch := incomingAttWrapper.IndexedAttestation.Data.Target.Epoch + targetEpoch := incomingAttWrapper.IndexedAttestation.GetData().Target.Epoch - for _, validatorIndex := range incomingAttWrapper.IndexedAttestation.AttestingIndices { + for _, validatorIndex := range incomingAttWrapper.IndexedAttestation.GetAttestingIndices() { info := attestationInfo{ validatorIndex: validatorIndex, epoch: targetEpoch, @@ -193,17 +194,33 @@ func (s *Service) checkDoubleVotes( // This is a double vote. doubleVotesTotal.Inc() + existing, ok := existingAttWrapper.IndexedAttestation.(*ethpb.IndexedAttestation) + if !ok { + return nil, fmt.Errorf( + "existing attestation has wrong type (expected %T, got %T)", + ðpb.IndexedAttestation{}, + existingAttWrapper.IndexedAttestation, + ) + } + incoming, ok := incomingAttWrapper.IndexedAttestation.(*ethpb.IndexedAttestation) + if !ok { + return nil, fmt.Errorf( + "incoming attestation has wrong type (expected %T, got %T)", + ðpb.IndexedAttestation{}, + incomingAttWrapper.IndexedAttestation, + ) + } + slashing := ðpb.AttesterSlashing{ - Attestation_1: existingAttWrapper.IndexedAttestation, - Attestation_2: incomingAttWrapper.IndexedAttestation, + Attestation_1: existing, + Attestation_2: incoming, } // Ensure the attestation with the lower data root is the first attestation. - // It will be useful for comparing with other double votes. if bytes.Compare(existingAttWrapper.DataRoot[:], incomingAttWrapper.DataRoot[:]) > 0 { slashing = ðpb.AttesterSlashing{ - Attestation_1: incomingAttWrapper.IndexedAttestation, - Attestation_2: existingAttWrapper.IndexedAttestation, + Attestation_1: incoming, + Attestation_2: existing, } } @@ -229,16 +246,33 @@ func (s *Service) checkDoubleVotes( wrapper_1 := doubleVote.Wrapper_1 wrapper_2 := doubleVote.Wrapper_2 + att_1, ok := wrapper_1.IndexedAttestation.(*ethpb.IndexedAttestation) + if !ok { + return nil, fmt.Errorf( + "first attestation has wrong type (expected %T, got %T)", + ðpb.IndexedAttestation{}, + wrapper_1.IndexedAttestation, + ) + } + att_2, ok := wrapper_2.IndexedAttestation.(*ethpb.IndexedAttestation) + if !ok { + return nil, fmt.Errorf( + "second attestation has wrong type (expected %T, got %T)", + ðpb.IndexedAttestation{}, + wrapper_2.IndexedAttestation, + ) + } + slashing := ðpb.AttesterSlashing{ - Attestation_1: wrapper_1.IndexedAttestation, - Attestation_2: wrapper_2.IndexedAttestation, + Attestation_1: att_1, + Attestation_2: att_2, } // Ensure the attestation with the lower data root is the first attestation. if bytes.Compare(wrapper_1.DataRoot[:], wrapper_2.DataRoot[:]) > 0 { slashing = ðpb.AttesterSlashing{ - Attestation_1: wrapper_2.IndexedAttestation, - Attestation_2: wrapper_1.IndexedAttestation, + Attestation_1: att_2, + Attestation_2: att_1, } } @@ -428,17 +462,17 @@ func (s *Service) updateSpans( kind slashertypes.ChunkKind, validatorChunkIndex uint64, currentEpoch primitives.Epoch, -) (map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing, error) { +) (map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing, error) { ctx, span := trace.StartSpan(ctx, "Slasher.updateSpans") defer span.End() // Apply the attestations to the related chunks and find any // slashings along the way. - slashings := map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing{} + slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{} for _, attWrappers := range attWrapperByChunkIdx { for _, attWrapper := range attWrappers { - for _, validatorIdx := range attWrapper.IndexedAttestation.AttestingIndices { + for _, validatorIdx := range attWrapper.IndexedAttestation.GetAttestingIndices() { validatorIndex := primitives.ValidatorIndex(validatorIdx) computedValidatorChunkIdx := s.params.validatorChunkIndex(validatorIndex) @@ -493,14 +527,14 @@ func (s *Service) applyAttestationForValidator( validatorChunkIndex uint64, validatorIndex primitives.ValidatorIndex, currentEpoch primitives.Epoch, -) (*ethpb.AttesterSlashing, error) { +) (interfaces.AttesterSlashing, error) { ctx, span := trace.StartSpan(ctx, "Slasher.applyAttestationForValidator") defer span.End() var err error - sourceEpoch := attestation.IndexedAttestation.Data.Source.Epoch - targetEpoch := attestation.IndexedAttestation.Data.Target.Epoch + sourceEpoch := attestation.IndexedAttestation.GetData().Source.Epoch + targetEpoch := attestation.IndexedAttestation.GetData().Target.Epoch attestationDistance.Observe(float64(targetEpoch) - float64(sourceEpoch)) chunkIndex := s.params.chunkIndex(sourceEpoch) diff --git a/beacon-chain/slasher/detect_attestations_test.go b/beacon-chain/slasher/detect_attestations_test.go index 7763d205f7c9..0026f36877fc 100644 --- a/beacon-chain/slasher/detect_attestations_test.go +++ b/beacon-chain/slasher/detect_attestations_test.go @@ -668,8 +668,8 @@ func Test_processAttestations(t *testing.T) { // Create the attester slashing. expectedSlashing := ðpb.AttesterSlashing{ - Attestation_1: wrapper_1.IndexedAttestation, - Attestation_2: wrapper_2.IndexedAttestation, + Attestation_1: wrapper_1.IndexedAttestation.(*ethpb.IndexedAttestation), + Attestation_2: wrapper_2.IndexedAttestation.(*ethpb.IndexedAttestation), } root, err := expectedSlashing.HashTreeRoot() @@ -821,7 +821,7 @@ func Test_processQueuedAttestations_OverlappingChunkIndices(t *testing.T) { s.attsQueue = newAttestationsQueue() s.attsQueue.push(att1) s.attsQueue.push(att2) - slot, err := slots.EpochStart(att2.IndexedAttestation.Data.Target.Epoch) + slot, err := slots.EpochStart(att2.IndexedAttestation.GetData().Target.Epoch) require.NoError(t, err) mockChain.Slot = &slot s.serviceCfg.HeadStateFetcher = mockChain @@ -1164,7 +1164,7 @@ func Test_applyAttestationForValidator_MinSpanChunk(t *testing.T) { ) require.NoError(t, err) require.IsNil(t, slashing) - att.IndexedAttestation.AttestingIndices = []uint64{uint64(validatorIdx)} + att.IndexedAttestation.(*ethpb.IndexedAttestation).AttestingIndices = []uint64{uint64(validatorIdx)} err = slasherDB.SaveAttestationRecordsForValidators( ctx, []*slashertypes.IndexedAttestationWrapper{att}, @@ -1221,7 +1221,7 @@ func Test_applyAttestationForValidator_MaxSpanChunk(t *testing.T) { ) require.NoError(t, err) require.Equal(t, true, slashing == nil) - att.IndexedAttestation.AttestingIndices = []uint64{uint64(validatorIdx)} + att.IndexedAttestation.(*ethpb.IndexedAttestation).AttestingIndices = []uint64{uint64(validatorIdx)} err = slasherDB.SaveAttestationRecordsForValidators( ctx, []*slashertypes.IndexedAttestationWrapper{att}, diff --git a/beacon-chain/slasher/helpers.go b/beacon-chain/slasher/helpers.go index 23c544bbe8f2..411282a6e42c 100644 --- a/beacon-chain/slasher/helpers.go +++ b/beacon-chain/slasher/helpers.go @@ -10,6 +10,7 @@ import ( slashertypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -28,7 +29,7 @@ func (s *Service) groupByValidatorChunkIndex( for _, attestation := range attestations { validatorChunkIndexes := make(map[uint64]bool) - for _, validatorIndex := range attestation.IndexedAttestation.AttestingIndices { + for _, validatorIndex := range attestation.IndexedAttestation.GetAttestingIndices() { validatorChunkIndex := s.params.validatorChunkIndex(primitives.ValidatorIndex(validatorIndex)) validatorChunkIndexes[validatorChunkIndex] = true } @@ -51,7 +52,7 @@ func (s *Service) groupByChunkIndex( attestationsByChunkIndex := make(map[uint64][]*slashertypes.IndexedAttestationWrapper) for _, attestation := range attestations { - chunkIndex := s.params.chunkIndex(attestation.IndexedAttestation.Data.Source.Epoch) + chunkIndex := s.params.chunkIndex(attestation.IndexedAttestation.GetData().Source.Epoch) attestationsByChunkIndex[chunkIndex] = append(attestationsByChunkIndex[chunkIndex], attestation) } @@ -74,13 +75,13 @@ func (s *Service) filterAttestations( // If an attestation's source is epoch is older than the max history length // we keep track of for slashing detection, we drop it. - if attWrapper.IndexedAttestation.Data.Source.Epoch+s.params.historyLength <= currentEpoch { + if attWrapper.IndexedAttestation.GetData().Source.Epoch+s.params.historyLength <= currentEpoch { numDropped++ continue } // If an attestation's target epoch is in the future, we defer processing for later. - if attWrapper.IndexedAttestation.Data.Target.Epoch > currentEpoch { + if attWrapper.IndexedAttestation.GetData().Target.Epoch > currentEpoch { validInFuture = append(validInFuture, attWrapper) continue } @@ -95,17 +96,17 @@ func (s *Service) filterAttestations( // source and target epochs, and that the source epoch of the attestation must // be less than the target epoch, which is a precondition for performing slashing // detection (except for the genesis epoch). -func validateAttestationIntegrity(att *ethpb.IndexedAttestation) bool { +func validateAttestationIntegrity(att ethpb.IndexedAtt) bool { // If an attestation is malformed, we drop it. if att == nil || - att.Data == nil || - att.Data.Source == nil || - att.Data.Target == nil { + att.GetData() == nil || + att.GetData().Source == nil || + att.GetData().Target == nil { return false } - sourceEpoch := att.Data.Source.Epoch - targetEpoch := att.Data.Target.Epoch + sourceEpoch := att.GetData().Source.Epoch + targetEpoch := att.GetData().Target.Epoch // The genesis epoch is a special case, since all attestations formed in it // will have source and target 0, and they should be considered valid. @@ -129,14 +130,14 @@ func validateBlockHeaderIntegrity(header *ethpb.SignedBeaconBlockHeader) bool { return true } -func logAttesterSlashing(slashing *ethpb.AttesterSlashing) { - indices := slice.IntersectionUint64(slashing.Attestation_1.AttestingIndices, slashing.Attestation_2.AttestingIndices) +func logAttesterSlashing(slashing interfaces.AttesterSlashing) { + indices := slice.IntersectionUint64(slashing.GetFirstAttestation().GetAttestingIndices(), slashing.GetSecondAttestation().GetAttestingIndices()) log.WithFields(logrus.Fields{ "validatorIndex": indices, - "prevSourceEpoch": slashing.Attestation_1.Data.Source.Epoch, - "prevTargetEpoch": slashing.Attestation_1.Data.Target.Epoch, - "sourceEpoch": slashing.Attestation_2.Data.Source.Epoch, - "targetEpoch": slashing.Attestation_2.Data.Target.Epoch, + "prevSourceEpoch": slashing.GetFirstAttestation().GetData().Source.Epoch, + "prevTargetEpoch": slashing.GetFirstAttestation().GetData().Target.Epoch, + "sourceEpoch": slashing.GetSecondAttestation().GetData().Source.Epoch, + "targetEpoch": slashing.GetSecondAttestation().GetData().Target.Epoch, }).Info("Attester slashing detected") } diff --git a/beacon-chain/slasher/helpers_test.go b/beacon-chain/slasher/helpers_test.go index 6d9bfcae09a3..0b6284195300 100644 --- a/beacon-chain/slasher/helpers_test.go +++ b/beacon-chain/slasher/helpers_test.go @@ -271,22 +271,22 @@ func Test_logSlashingEvent(t *testing.T) { { name: "Surrounding vote", slashing: ðpb.AttesterSlashing{ - Attestation_1: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation, - Attestation_2: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation, + Attestation_1: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation.(*ethpb.IndexedAttestation), + Attestation_2: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation.(*ethpb.IndexedAttestation), }, }, { name: "Surrounded vote", slashing: ðpb.AttesterSlashing{ - Attestation_1: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation, - Attestation_2: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation, + Attestation_1: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation.(*ethpb.IndexedAttestation), + Attestation_2: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation.(*ethpb.IndexedAttestation), }, }, { name: "Double vote", slashing: ðpb.AttesterSlashing{ - Attestation_1: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation, - Attestation_2: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation, + Attestation_1: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation.(*ethpb.IndexedAttestation), + Attestation_2: createAttestationWrapperEmptySig(t, 0, 0, nil, nil).IndexedAttestation.(*ethpb.IndexedAttestation), }, }, } diff --git a/beacon-chain/slasher/process_slashings.go b/beacon-chain/slasher/process_slashings.go index e3a3d8ddf499..c98f5c0d1b11 100644 --- a/beacon-chain/slasher/process_slashings.go +++ b/beacon-chain/slasher/process_slashings.go @@ -6,6 +6,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) @@ -13,9 +14,9 @@ import ( // Verifies attester slashings, logs them, and submits them to the slashing operations pool // in the beacon node if they pass validation. func (s *Service) processAttesterSlashings( - ctx context.Context, slashings map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing, -) (map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing, error) { - processedSlashings := map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing{} + ctx context.Context, slashings map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing, +) (map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing, error) { + processedSlashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{} // If no slashings, return early. if len(slashings) == 0 { @@ -30,8 +31,8 @@ func (s *Service) processAttesterSlashings( for root, slashing := range slashings { // Verify the signature of the first attestation. - if err := s.verifyAttSignature(ctx, slashing.Attestation_1); err != nil { - log.WithError(err).WithField("a", slashing.Attestation_1).Warn( + if err := s.verifyAttSignature(ctx, slashing.GetFirstAttestation()); err != nil { + log.WithError(err).WithField("a", slashing.GetFirstAttestation()).Warn( "Invalid signature for attestation in detected slashing offense", ) @@ -39,8 +40,8 @@ func (s *Service) processAttesterSlashings( } // Verify the signature of the second attestation. - if err := s.verifyAttSignature(ctx, slashing.Attestation_2); err != nil { - log.WithError(err).WithField("b", slashing.Attestation_2).Warn( + if err := s.verifyAttSignature(ctx, slashing.GetSecondAttestation()); err != nil { + log.WithError(err).WithField("b", slashing.GetSecondAttestation()).Warn( "Invalid signature for attestation in detected slashing offense", ) @@ -110,8 +111,8 @@ func (s *Service) verifyBlockSignature(ctx context.Context, header *ethpb.Signed return blocks.VerifyBlockHeaderSignature(parentState, header) } -func (s *Service) verifyAttSignature(ctx context.Context, att *ethpb.IndexedAttestation) error { - preState, err := s.serviceCfg.AttestationStateFetcher.AttestationTargetState(ctx, att.Data.Target) +func (s *Service) verifyAttSignature(ctx context.Context, att ethpb.IndexedAtt) error { + preState, err := s.serviceCfg.AttestationStateFetcher.AttestationTargetState(ctx, att.GetData().Target) if err != nil { return err } diff --git a/beacon-chain/slasher/process_slashings_test.go b/beacon-chain/slasher/process_slashings_test.go index 7e45fb3b2c1d..90764497295c 100644 --- a/beacon-chain/slasher/process_slashings_test.go +++ b/beacon-chain/slasher/process_slashings_test.go @@ -12,6 +12,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -84,7 +85,7 @@ func TestService_processAttesterSlashings(t *testing.T) { root, err := slashing.HashTreeRoot() require.NoError(tt, err, "failed to hash tree root") - slashings := map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing{ + slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{ root: slashing, } @@ -108,7 +109,7 @@ func TestService_processAttesterSlashings(t *testing.T) { root, err := slashing.HashTreeRoot() require.NoError(tt, err, "failed to hash tree root") - slashings := map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing{ + slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{ root: slashing, } @@ -132,7 +133,7 @@ func TestService_processAttesterSlashings(t *testing.T) { root, err := slashing.HashTreeRoot() require.NoError(tt, err, "failed to hash tree root") - slashings := map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing{ + slashings := map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing{ root: slashing, } diff --git a/beacon-chain/slasher/receive.go b/beacon-chain/slasher/receive.go index 056df52369f2..66b82de0fbcc 100644 --- a/beacon-chain/slasher/receive.go +++ b/beacon-chain/slasher/receive.go @@ -7,6 +7,7 @@ import ( "github.com/pkg/errors" slashertypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/slasher/types" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" @@ -22,7 +23,7 @@ const ( // Receive indexed attestations from some source event feed, // validating their integrity before appending them to an attestation queue // for batch processing in a separate routine. -func (s *Service) receiveAttestations(ctx context.Context, indexedAttsChan chan *ethpb.IndexedAttestation) { +func (s *Service) receiveAttestations(ctx context.Context, indexedAttsChan chan ethpb.IndexedAtt) { defer s.wg.Done() sub := s.serviceCfg.IndexedAttestationsFeed.Subscribe(indexedAttsChan) @@ -33,7 +34,7 @@ func (s *Service) receiveAttestations(ctx context.Context, indexedAttsChan chan if !validateAttestationIntegrity(att) { continue } - dataRoot, err := att.Data.HashTreeRoot() + dataRoot, err := att.GetData().HashTreeRoot() if err != nil { log.WithError(err).Error("Could not get hash tree root of attestation") continue @@ -108,7 +109,7 @@ func (s *Service) processAttestations( ctx context.Context, attestations []*slashertypes.IndexedAttestationWrapper, currentSlot primitives.Slot, -) map[[fieldparams.RootLength]byte]*ethpb.AttesterSlashing { +) map[[fieldparams.RootLength]byte]interfaces.AttesterSlashing { // Get the current epoch from the current slot. currentEpoch := slots.ToEpoch(currentSlot) diff --git a/beacon-chain/slasher/receive_test.go b/beacon-chain/slasher/receive_test.go index c8c9fa02da83..f7b0eacefcbb 100644 --- a/beacon-chain/slasher/receive_test.go +++ b/beacon-chain/slasher/receive_test.go @@ -29,7 +29,7 @@ func TestSlasher_receiveAttestations_OK(t *testing.T) { }, attsQueue: newAttestationsQueue(), } - indexedAttsChan := make(chan *ethpb.IndexedAttestation) + indexedAttsChan := make(chan ethpb.IndexedAtt) defer close(indexedAttsChan) s.wg.Add(1) @@ -212,7 +212,7 @@ func TestSlasher_receiveAttestations_OnlyValidAttestations(t *testing.T) { }, attsQueue: newAttestationsQueue(), } - indexedAttsChan := make(chan *ethpb.IndexedAttestation) + indexedAttsChan := make(chan ethpb.IndexedAtt) defer close(indexedAttsChan) s.wg.Add(1) diff --git a/beacon-chain/slasher/service.go b/beacon-chain/slasher/service.go index 5de7c859d10e..8de75eba8251 100644 --- a/beacon-chain/slasher/service.go +++ b/beacon-chain/slasher/service.go @@ -48,7 +48,7 @@ type ServiceConfig struct { type Service struct { params *Parameters serviceCfg *ServiceConfig - indexedAttsChan chan *ethpb.IndexedAttestation + indexedAttsChan chan ethpb.IndexedAtt beaconBlockHeadersChan chan *ethpb.SignedBeaconBlockHeader attsQueue *attestationsQueue blksQueue *blocksQueue @@ -68,7 +68,7 @@ func New(ctx context.Context, srvCfg *ServiceConfig) (*Service, error) { return &Service{ params: DefaultParams(), serviceCfg: srvCfg, - indexedAttsChan: make(chan *ethpb.IndexedAttestation, 1), + indexedAttsChan: make(chan ethpb.IndexedAtt, 1), beaconBlockHeadersChan: make(chan *ethpb.SignedBeaconBlockHeader, 1), attsQueue: newAttestationsQueue(), blksQueue: newBlocksQueue(), @@ -117,7 +117,7 @@ func (s *Service) run() { "Finished retrieving last epoch written per validator", ) - indexedAttsChan := make(chan *ethpb.IndexedAttestation, 1) + indexedAttsChan := make(chan ethpb.IndexedAtt, 1) beaconBlockHeadersChan := make(chan *ethpb.SignedBeaconBlockHeader, 1) s.wg.Add(1) diff --git a/beacon-chain/slasher/types/types.go b/beacon-chain/slasher/types/types.go index c1699227e88d..d2ee753174c5 100644 --- a/beacon-chain/slasher/types/types.go +++ b/beacon-chain/slasher/types/types.go @@ -29,7 +29,7 @@ func (c ChunkKind) String() string { // IndexedAttestationWrapper contains an indexed attestation with its // data root to reduce duplicated computation. type IndexedAttestationWrapper struct { - IndexedAttestation *ethpb.IndexedAttestation + IndexedAttestation ethpb.IndexedAtt DataRoot [32]byte } diff --git a/beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go b/beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go index 3c4e2e957bec..eecc49fb9951 100644 --- a/beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go +++ b/beacon-chain/sync/subscriber_beacon_aggregate_proof_test.go @@ -9,6 +9,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations" lruwrpr "github.com/prysmaticlabs/prysm/v5/cache/lru" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -34,7 +35,7 @@ func TestBeaconAggregateProofSubscriber_CanSaveAggregatedAttestation(t *testing. Signature: make([]byte, fieldparams.BLSSignatureLength), } require.NoError(t, r.beaconAggregateProofSubscriber(context.Background(), a)) - assert.DeepSSZEqual(t, []*ethpb.Attestation{a.Message.Aggregate}, r.cfg.attPool.AggregatedAttestations(), "Did not save aggregated attestation") + assert.DeepSSZEqual(t, []interfaces.Attestation{a.Message.Aggregate}, r.cfg.attPool.AggregatedAttestations(), "Did not save aggregated attestation") } func TestBeaconAggregateProofSubscriber_CanSaveUnaggregatedAttestation(t *testing.T) { @@ -59,5 +60,5 @@ func TestBeaconAggregateProofSubscriber_CanSaveUnaggregatedAttestation(t *testin atts, err := r.cfg.attPool.UnaggregatedAttestations() require.NoError(t, err) - assert.DeepEqual(t, []*ethpb.Attestation{a.Message.Aggregate}, atts, "Did not save unaggregated attestation") + assert.DeepEqual(t, []interfaces.Attestation{a.Message.Aggregate}, atts, "Did not save unaggregated attestation") } diff --git a/beacon-chain/sync/subscriber_handlers.go b/beacon-chain/sync/subscriber_handlers.go index 7a8585f1ac1a..dd49d259abbc 100644 --- a/beacon-chain/sync/subscriber_handlers.go +++ b/beacon-chain/sync/subscriber_handlers.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "google.golang.org/protobuf/proto" ) @@ -25,13 +26,13 @@ func (s *Service) voluntaryExitSubscriber(_ context.Context, msg proto.Message) } func (s *Service) attesterSlashingSubscriber(ctx context.Context, msg proto.Message) error { - aSlashing, ok := msg.(*ethpb.AttesterSlashing) + aSlashing, ok := msg.(interfaces.AttesterSlashing) if !ok { return fmt.Errorf("wrong type, expected: *ethpb.AttesterSlashing got: %T", msg) } // Do some nil checks to prevent easy DoS'ing of this handler. - aSlashing1IsNil := aSlashing == nil || aSlashing.Attestation_1 == nil || aSlashing.Attestation_1.AttestingIndices == nil - aSlashing2IsNil := aSlashing == nil || aSlashing.Attestation_2 == nil || aSlashing.Attestation_2.AttestingIndices == nil + aSlashing1IsNil := aSlashing == nil || aSlashing.GetFirstAttestation() == nil || aSlashing.GetFirstAttestation().GetAttestingIndices() == nil + aSlashing2IsNil := aSlashing == nil || aSlashing.GetSecondAttestation() == nil || aSlashing.GetSecondAttestation().GetAttestingIndices() == nil if !aSlashing1IsNil && !aSlashing2IsNil { headState, err := s.cfg.chain.HeadState(ctx) if err != nil { @@ -40,7 +41,7 @@ func (s *Service) attesterSlashingSubscriber(ctx context.Context, msg proto.Mess if err := s.cfg.slashingPool.InsertAttesterSlashing(ctx, headState, aSlashing); err != nil { return errors.Wrap(err, "could not insert attester slashing into pool") } - s.setAttesterSlashingIndicesSeen(aSlashing.Attestation_1.AttestingIndices, aSlashing.Attestation_2.AttestingIndices) + s.setAttesterSlashingIndicesSeen(aSlashing.GetFirstAttestation().GetAttestingIndices(), aSlashing.GetSecondAttestation().GetAttestingIndices()) } return nil } diff --git a/beacon-chain/sync/validate_aggregate_proof.go b/beacon-chain/sync/validate_aggregate_proof.go index f57b6e38972d..38f591952f15 100644 --- a/beacon-chain/sync/validate_aggregate_proof.go +++ b/beacon-chain/sync/validate_aggregate_proof.go @@ -15,6 +15,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" @@ -176,7 +177,7 @@ func (s *Service) validateAggregatedAtt(ctx context.Context, signed *ethpb.Signe tracing.AnnotateError(span, wrappedErr) return pubsub.ValidationIgnore, wrappedErr } - attSigSet, err := blocks.AttestationSignatureBatch(ctx, bs, []*ethpb.Attestation{signed.Message.Aggregate}) + attSigSet, err := blocks.AttestationSignatureBatch(ctx, bs, []interfaces.Attestation{signed.Message.Aggregate}) if err != nil { wrappedErr := errors.Wrapf(err, "Could not verify aggregator signature %d", signed.Message.AggregatorIndex) tracing.AnnotateError(span, wrappedErr) @@ -225,7 +226,7 @@ func (s *Service) setAggregatorIndexEpochSeen(epoch primitives.Epoch, aggregator // - [REJECT] The aggregate attestation has participants -- that is, len(get_attesting_indices(state, aggregate.data, aggregate.aggregation_bits)) >= 1. // - [REJECT] The aggregator's validator index is within the committee -- // i.e. `aggregate_and_proof.aggregator_index in get_beacon_committee(state, aggregate.data.slot, aggregate.data.index)`. -func (s *Service) validateIndexInCommittee(ctx context.Context, bs state.ReadOnlyBeaconState, a *ethpb.Attestation, validatorIndex primitives.ValidatorIndex) (pubsub.ValidationResult, error) { +func (s *Service) validateIndexInCommittee(ctx context.Context, bs state.ReadOnlyBeaconState, a interfaces.Attestation, validatorIndex primitives.ValidatorIndex) (pubsub.ValidationResult, error) { ctx, span := trace.StartSpan(ctx, "sync.validateIndexInCommittee") defer span.End() @@ -239,7 +240,7 @@ func (s *Service) validateIndexInCommittee(ctx context.Context, bs state.ReadOnl return result, err } - if a.AggregationBits.Count() == 0 { + if a.GetAggregationBits().Count() == 0 { return pubsub.ValidationReject, errors.New("no attesting indices") } diff --git a/beacon-chain/sync/validate_attester_slashing.go b/beacon-chain/sync/validate_attester_slashing.go index 6590b7a918ca..a30499d19c3b 100644 --- a/beacon-chain/sync/validate_attester_slashing.go +++ b/beacon-chain/sync/validate_attester_slashing.go @@ -10,10 +10,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/operation" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/container/slice" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/time/slots" "go.opencensus.io/trace" ) @@ -40,7 +40,7 @@ func (s *Service) validateAttesterSlashing(ctx context.Context, pid peer.ID, msg tracing.AnnotateError(span, err) return pubsub.ValidationReject, err } - slashing, ok := m.(*ethpb.AttesterSlashing) + slashing, ok := m.(interfaces.AttesterSlashing) if !ok { return pubsub.ValidationReject, errWrongMessage } diff --git a/beacon-chain/sync/validate_beacon_attestation.go b/beacon-chain/sync/validate_beacon_attestation.go index c0e2a17edc17..83a5d37170ad 100644 --- a/beacon-chain/sync/validate_beacon_attestation.go +++ b/beacon-chain/sync/validate_beacon_attestation.go @@ -17,6 +17,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" "github.com/prysmaticlabs/prysm/v5/config/features" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" @@ -171,7 +172,7 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p } // This validates beacon unaggregated attestation has correct topic string. -func (s *Service) validateUnaggregatedAttTopic(ctx context.Context, a *eth.Attestation, bs state.ReadOnlyBeaconState, t string) (pubsub.ValidationResult, error) { +func (s *Service) validateUnaggregatedAttTopic(ctx context.Context, a interfaces.Attestation, bs state.ReadOnlyBeaconState, t string) (pubsub.ValidationResult, error) { ctx, span := trace.StartSpan(ctx, "sync.validateUnaggregatedAttTopic") defer span.End() @@ -193,21 +194,21 @@ func (s *Service) validateUnaggregatedAttTopic(ctx context.Context, a *eth.Attes return pubsub.ValidationAccept, nil } -func (s *Service) validateCommitteeIndex(ctx context.Context, a *eth.Attestation, bs state.ReadOnlyBeaconState) (uint64, pubsub.ValidationResult, error) { - valCount, err := helpers.ActiveValidatorCount(ctx, bs, slots.ToEpoch(a.Data.Slot)) +func (s *Service) validateCommitteeIndex(ctx context.Context, a interfaces.Attestation, bs state.ReadOnlyBeaconState) (uint64, pubsub.ValidationResult, error) { + valCount, err := helpers.ActiveValidatorCount(ctx, bs, slots.ToEpoch(a.GetData().Slot)) if err != nil { return 0, pubsub.ValidationIgnore, err } count := helpers.SlotCommitteeCount(valCount) - if uint64(a.Data.CommitteeIndex) > count { - return 0, pubsub.ValidationReject, errors.Errorf("committee index %d > %d", a.Data.CommitteeIndex, count) + if uint64(a.GetData().CommitteeIndex) > count { + return 0, pubsub.ValidationReject, errors.Errorf("committee index %d > %d", a.GetData().CommitteeIndex, count) } return valCount, pubsub.ValidationAccept, nil } // This validates beacon unaggregated attestation using the given state, the validation consists of bitfield length and count consistency // and signature verification. -func (s *Service) validateUnaggregatedAttWithState(ctx context.Context, a *eth.Attestation, bs state.ReadOnlyBeaconState) (pubsub.ValidationResult, error) { +func (s *Service) validateUnaggregatedAttWithState(ctx context.Context, a interfaces.Attestation, bs state.ReadOnlyBeaconState) (pubsub.ValidationResult, error) { ctx, span := trace.StartSpan(ctx, "sync.validateUnaggregatedAttWithState") defer span.End() @@ -219,11 +220,11 @@ func (s *Service) validateUnaggregatedAttWithState(ctx context.Context, a *eth.A // Attestation must be unaggregated and the bit index must exist in the range of committee indices. // Note: The Ethereum Beacon chain spec suggests (len(get_attesting_indices(state, attestation.data, attestation.aggregation_bits)) == 1) // however this validation can be achieved without use of get_attesting_indices which is an O(n) lookup. - if a.AggregationBits.Count() != 1 || a.AggregationBits.BitIndices()[0] >= len(committee) { + if a.GetAggregationBits().Count() != 1 || a.GetAggregationBits().BitIndices()[0] >= len(committee) { return pubsub.ValidationReject, errors.New("attestation bitfield is invalid") } - set, err := blocks.AttestationSignatureBatch(ctx, bs, []*eth.Attestation{a}) + set, err := blocks.AttestationSignatureBatch(ctx, bs, []interfaces.Attestation{a}) if err != nil { tracing.AnnotateError(span, err) attBadSignatureBatchCount.Inc() @@ -232,14 +233,14 @@ func (s *Service) validateUnaggregatedAttWithState(ctx context.Context, a *eth.A return s.validateWithBatchVerifier(ctx, "attestation", set) } -func (s *Service) validateBitLength(ctx context.Context, a *eth.Attestation, bs state.ReadOnlyBeaconState) ([]primitives.ValidatorIndex, pubsub.ValidationResult, error) { - committee, err := helpers.BeaconCommitteeFromState(ctx, bs, a.Data.Slot, a.Data.CommitteeIndex) +func (s *Service) validateBitLength(ctx context.Context, a interfaces.Attestation, bs state.ReadOnlyBeaconState) ([]primitives.ValidatorIndex, pubsub.ValidationResult, error) { + committee, err := helpers.BeaconCommitteeFromState(ctx, bs, a.GetData().Slot, a.GetData().CommitteeIndex) if err != nil { return nil, pubsub.ValidationIgnore, err } // Verify number of aggregation bits matches the committee size. - if err := helpers.VerifyBitfieldLength(a.AggregationBits, uint64(len(committee))); err != nil { + if err := helpers.VerifyBitfieldLength(a.GetAggregationBits(), uint64(len(committee))); err != nil { return nil, pubsub.ValidationReject, err } diff --git a/consensus-types/blocks/execution.go b/consensus-types/blocks/execution.go index deeff7045315..d4006244efed 100644 --- a/consensus-types/blocks/execution.go +++ b/consensus-types/blocks/execution.go @@ -187,6 +187,11 @@ func (executionPayload) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { return nil, consensus_types.ErrUnsupportedField } +// PbElectra -- +func (executionPayload) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { + return nil, consensus_types.ErrUnsupportedField +} + // ValueInWei -- func (executionPayload) ValueInWei() (math.Wei, error) { return nil, consensus_types.ErrUnsupportedField @@ -197,6 +202,16 @@ func (executionPayload) ValueInGwei() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } +// DepositReceipts -- +func (e executionPayload) DepositReceipts() ([]*enginev1.DepositReceipt, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// WithdrawalRequests -- +func (e executionPayload) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { + return nil, consensus_types.ErrUnsupportedField +} + // executionPayloadHeader is a convenience wrapper around a blinded beacon block body's execution header data structure // This wrapper allows us to conform to a common interface so that beacon // blocks for future forks can also be applied across Prysm without issues. @@ -353,6 +368,11 @@ func (e executionPayloadHeader) ExcessBlobGas() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } +// PbElectra -- +func (e executionPayloadHeader) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { + return nil, consensus_types.ErrUnsupportedField +} + // PbDeneb -- func (executionPayloadHeader) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { return nil, consensus_types.ErrUnsupportedField @@ -378,6 +398,16 @@ func (executionPayloadHeader) ValueInGwei() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } +// DepositReceipts -- +func (e executionPayloadHeader) DepositReceipts() ([]*enginev1.DepositReceipt, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// WithdrawalRequests -- +func (e executionPayloadHeader) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { + return nil, consensus_types.ErrUnsupportedField +} + // PayloadToHeader converts `payload` into execution payload header format. func PayloadToHeader(payload interfaces.ExecutionData) (*enginev1.ExecutionPayloadHeader, error) { txs, err := payload.Transactions() @@ -564,6 +594,11 @@ func (e executionPayloadCapella) ExcessBlobGas() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } +// PbElectra -- +func (executionPayloadCapella) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { + return nil, consensus_types.ErrUnsupportedField +} + // PbDeneb -- func (executionPayloadCapella) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { return nil, consensus_types.ErrUnsupportedField @@ -589,6 +624,16 @@ func (e executionPayloadCapella) ValueInGwei() (uint64, error) { return e.gweiValue, nil } +// DepositReceipts -- +func (e executionPayloadCapella) DepositReceipts() ([]*enginev1.DepositReceipt, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// WithdrawalRequests -- +func (e executionPayloadCapella) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { + return nil, consensus_types.ErrUnsupportedField +} + // executionPayloadHeaderCapella is a convenience wrapper around a blinded beacon block body's execution header data structure // This wrapper allows us to conform to a common interface so that beacon // blocks for future forks can also be applied across Prysm without issues. @@ -747,6 +792,11 @@ func (e executionPayloadHeaderCapella) ExcessBlobGas() (uint64, error) { return 0, consensus_types.ErrUnsupportedField } +// PbElectra -- +func (executionPayloadHeaderCapella) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { + return nil, consensus_types.ErrUnsupportedField +} + // PbDeneb -- func (executionPayloadHeaderCapella) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { return nil, consensus_types.ErrUnsupportedField @@ -772,6 +822,16 @@ func (e executionPayloadHeaderCapella) ValueInGwei() (uint64, error) { return e.gweiValue, nil } +// DepositReceipts -- +func (e executionPayloadHeaderCapella) DepositReceipts() ([]*enginev1.DepositReceipt, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// WithdrawalRequests -- +func (e executionPayloadHeaderCapella) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { + return nil, consensus_types.ErrUnsupportedField +} + // PayloadToHeaderCapella converts `payload` into execution payload header format. func PayloadToHeaderCapella(payload interfaces.ExecutionData) (*enginev1.ExecutionPayloadHeaderCapella, error) { txs, err := payload.Transactions() @@ -858,6 +918,73 @@ func PayloadToHeaderDeneb(payload interfaces.ExecutionData) (*enginev1.Execution }, nil } +// PayloadToHeaderElectra converts `payload` into execution payload header format. +func PayloadToHeaderElectra(payload interfaces.ExecutionData) (*enginev1.ExecutionPayloadHeaderElectra, error) { + txs, err := payload.Transactions() + if err != nil { + return nil, err + } + txRoot, err := ssz.TransactionsRoot(txs) + if err != nil { + return nil, err + } + withdrawals, err := payload.Withdrawals() + if err != nil { + return nil, err + } + withdrawalsRoot, err := ssz.WithdrawalSliceRoot(withdrawals, fieldparams.MaxWithdrawalsPerPayload) + if err != nil { + return nil, err + } + blobGasUsed, err := payload.BlobGasUsed() + if err != nil { + return nil, err + } + excessBlobGas, err := payload.ExcessBlobGas() + if err != nil { + return nil, err + } + + depositReceipts, err := payload.DepositReceipts() + if err != nil { + return nil, err + } + depositReceiptsRoot, err := ssz.DepositReceiptSliceRoot(depositReceipts, fieldparams.MaxDepositReceiptsPerPayload) + if err != nil { + return nil, err + } + withdrawalRequests, err := payload.WithdrawalRequests() + if err != nil { + return nil, err + } + withdrawalRequestsRoot, err := ssz.WithdrawalRequestSliceRoot(withdrawalRequests, fieldparams.MaxWithdrawalRequestsPerPayload) + if err != nil { + return nil, err + } + + return &enginev1.ExecutionPayloadHeaderElectra{ + ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash()), + FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient()), + StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot()), + ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot()), + LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom()), + PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao()), + BlockNumber: payload.BlockNumber(), + GasLimit: payload.GasLimit(), + GasUsed: payload.GasUsed(), + Timestamp: payload.Timestamp(), + ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData()), + BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas()), + BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash()), + TransactionsRoot: txRoot[:], + WithdrawalsRoot: withdrawalsRoot[:], + BlobGasUsed: blobGasUsed, + ExcessBlobGas: excessBlobGas, + DepositReceiptsRoot: depositReceiptsRoot[:], + WithdrawalRequestsRoot: withdrawalRequestsRoot[:], + }, nil +} + // IsEmptyExecutionData checks if an execution data is empty underneath. If a single field has // a non-zero value, this function will return false. func IsEmptyExecutionData(data interfaces.ExecutionData) (bool, error) { @@ -915,6 +1042,29 @@ func IsEmptyExecutionData(data interfaces.ExecutionData) (bool, error) { if data.Timestamp() != 0 { return false, nil } + + drs, err := data.DepositReceipts() + switch { + case errors.Is(err, consensus_types.ErrUnsupportedField): + case err != nil: + return false, err + default: + if len(drs) != 0 { + return false, nil + } + } + + wrs, err := data.WithdrawalRequests() + switch { + case errors.Is(err, consensus_types.ErrUnsupportedField): + case err != nil: + return false, err + default: + if len(wrs) != 0 { + return false, nil + } + } + return true, nil } @@ -1071,6 +1221,11 @@ func (e executionPayloadHeaderDeneb) ExcessBlobGas() (uint64, error) { return e.p.ExcessBlobGas, nil } +// PbElectra -- +func (executionPayloadHeaderDeneb) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { + return nil, consensus_types.ErrUnsupportedField +} + // PbDeneb -- func (executionPayloadHeaderDeneb) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { return nil, consensus_types.ErrUnsupportedField @@ -1096,6 +1251,16 @@ func (e executionPayloadHeaderDeneb) ValueInGwei() (uint64, error) { return e.gweiValue, nil } +// DepositReceipts -- +func (e executionPayloadHeaderDeneb) DepositReceipts() ([]*enginev1.DepositReceipt, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// WithdrawalRequests -- +func (e executionPayloadHeaderDeneb) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { + return nil, consensus_types.ErrUnsupportedField +} + // IsBlinded returns true if the underlying data is blinded. func (e executionPayloadHeaderDeneb) IsBlinded() bool { return true @@ -1267,6 +1432,11 @@ func (e executionPayloadDeneb) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error return e.p, nil } +// PbElectra -- +func (e executionPayloadDeneb) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { + return nil, consensus_types.ErrUnsupportedField +} + // ValueInWei -- func (e executionPayloadDeneb) ValueInWei() (math.Wei, error) { return e.weiValue, nil @@ -1277,11 +1447,415 @@ func (e executionPayloadDeneb) ValueInGwei() (uint64, error) { return e.gweiValue, nil } +// DepositReceipts -- +func (e executionPayloadDeneb) DepositReceipts() ([]*enginev1.DepositReceipt, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// WithdrawalRequests -- +func (e executionPayloadDeneb) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { + return nil, consensus_types.ErrUnsupportedField +} + // IsBlinded returns true if the underlying data is blinded. func (e executionPayloadDeneb) IsBlinded() bool { return false } +// executionPayloadHeaderElectra is a convenience wrapper around a blinded beacon block body's execution header data structure. +// This wrapper allows us to conform to a common interface so that beacon +// blocks for future forks can also be applied across Prysm without issues. +type executionPayloadHeaderElectra struct { + p *enginev1.ExecutionPayloadHeaderElectra + weiValue math.Wei + gweiValue uint64 +} + +// WrappedExecutionPayloadHeaderElectra is a constructor which wraps a protobuf execution header into an interface. +func WrappedExecutionPayloadHeaderElectra(p *enginev1.ExecutionPayloadHeaderElectra, value math.Wei) (interfaces.ExecutionData, error) { + w := executionPayloadHeaderElectra{p: p, weiValue: value, gweiValue: uint64(math.WeiToGwei(value))} + if w.IsNil() { + return nil, consensus_types.ErrNilObjectWrapped + } + return w, nil +} + +// IsNil checks if the underlying data is nil. +func (e executionPayloadHeaderElectra) IsNil() bool { + return e.p == nil +} + +// MarshalSSZ -- +func (e executionPayloadHeaderElectra) MarshalSSZ() ([]byte, error) { + return e.p.MarshalSSZ() +} + +// MarshalSSZTo -- +func (e executionPayloadHeaderElectra) MarshalSSZTo(dst []byte) ([]byte, error) { + return e.p.MarshalSSZTo(dst) +} + +// SizeSSZ -- +func (e executionPayloadHeaderElectra) SizeSSZ() int { + return e.p.SizeSSZ() +} + +// UnmarshalSSZ -- +func (e executionPayloadHeaderElectra) UnmarshalSSZ(buf []byte) error { + return e.p.UnmarshalSSZ(buf) +} + +// HashTreeRoot -- +func (e executionPayloadHeaderElectra) HashTreeRoot() ([32]byte, error) { + return e.p.HashTreeRoot() +} + +// HashTreeRootWith -- +func (e executionPayloadHeaderElectra) HashTreeRootWith(hh *fastssz.Hasher) error { + return e.p.HashTreeRootWith(hh) +} + +// Proto -- +func (e executionPayloadHeaderElectra) Proto() proto.Message { + return e.p +} + +// ParentHash -- +func (e executionPayloadHeaderElectra) ParentHash() []byte { + return e.p.ParentHash +} + +// FeeRecipient -- +func (e executionPayloadHeaderElectra) FeeRecipient() []byte { + return e.p.FeeRecipient +} + +// StateRoot -- +func (e executionPayloadHeaderElectra) StateRoot() []byte { + return e.p.StateRoot +} + +// ReceiptsRoot -- +func (e executionPayloadHeaderElectra) ReceiptsRoot() []byte { + return e.p.ReceiptsRoot +} + +// LogsBloom -- +func (e executionPayloadHeaderElectra) LogsBloom() []byte { + return e.p.LogsBloom +} + +// PrevRandao -- +func (e executionPayloadHeaderElectra) PrevRandao() []byte { + return e.p.PrevRandao +} + +// BlockNumber -- +func (e executionPayloadHeaderElectra) BlockNumber() uint64 { + return e.p.BlockNumber +} + +// GasLimit -- +func (e executionPayloadHeaderElectra) GasLimit() uint64 { + return e.p.GasLimit +} + +// GasUsed -- +func (e executionPayloadHeaderElectra) GasUsed() uint64 { + return e.p.GasUsed +} + +// Timestamp -- +func (e executionPayloadHeaderElectra) Timestamp() uint64 { + return e.p.Timestamp +} + +// ExtraData -- +func (e executionPayloadHeaderElectra) ExtraData() []byte { + return e.p.ExtraData +} + +// BaseFeePerGas -- +func (e executionPayloadHeaderElectra) BaseFeePerGas() []byte { + return e.p.BaseFeePerGas +} + +// BlockHash -- +func (e executionPayloadHeaderElectra) BlockHash() []byte { + return e.p.BlockHash +} + +// Transactions -- +func (executionPayloadHeaderElectra) Transactions() ([][]byte, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// TransactionsRoot -- +func (e executionPayloadHeaderElectra) TransactionsRoot() ([]byte, error) { + return e.p.TransactionsRoot, nil +} + +// Withdrawals -- +func (e executionPayloadHeaderElectra) Withdrawals() ([]*enginev1.Withdrawal, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// WithdrawalsRoot -- +func (e executionPayloadHeaderElectra) WithdrawalsRoot() ([]byte, error) { + return e.p.WithdrawalsRoot, nil +} + +// BlobGasUsed -- +func (e executionPayloadHeaderElectra) BlobGasUsed() (uint64, error) { + return e.p.BlobGasUsed, nil +} + +// ExcessBlobGas -- +func (e executionPayloadHeaderElectra) ExcessBlobGas() (uint64, error) { + return e.p.ExcessBlobGas, nil +} + +// PbElectra -- +func (e executionPayloadHeaderElectra) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// PbDeneb -- +func (executionPayloadHeaderElectra) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// PbBellatrix -- +func (executionPayloadHeaderElectra) PbBellatrix() (*enginev1.ExecutionPayload, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// PbCapella -- +func (executionPayloadHeaderElectra) PbCapella() (*enginev1.ExecutionPayloadCapella, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// ValueInWei -- +func (e executionPayloadHeaderElectra) ValueInWei() (math.Wei, error) { + return e.weiValue, nil +} + +// ValueInGwei -- +func (e executionPayloadHeaderElectra) ValueInGwei() (uint64, error) { + return e.gweiValue, nil +} + +// DepositReceipts -- +func (e executionPayloadHeaderElectra) DepositReceipts() ([]*enginev1.DepositReceipt, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// WithdrawalRequests -- +func (e executionPayloadHeaderElectra) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// IsBlinded returns true if the underlying data is blinded. +func (e executionPayloadHeaderElectra) IsBlinded() bool { + return true +} + +// executionPayloadElectra is a convenience wrapper around a beacon block body's execution payload data structure +// This wrapper allows us to conform to a common interface so that beacon +// blocks for future forks can also be applied across Prysm without issues. +type executionPayloadElectra struct { + p *enginev1.ExecutionPayloadElectra + weiValue math.Wei + gweiValue uint64 +} + +// WrappedExecutionPayloadElectra is a constructor which wraps a protobuf execution payload into an interface. +func WrappedExecutionPayloadElectra(p *enginev1.ExecutionPayloadElectra, value math.Wei) (interfaces.ExecutionData, error) { + w := executionPayloadElectra{p: p, weiValue: value, gweiValue: uint64(math.WeiToGwei(value))} + if w.IsNil() { + return nil, consensus_types.ErrNilObjectWrapped + } + return w, nil +} + +// IsNil checks if the underlying data is nil. +func (e executionPayloadElectra) IsNil() bool { + return e.p == nil +} + +// MarshalSSZ -- +func (e executionPayloadElectra) MarshalSSZ() ([]byte, error) { + return e.p.MarshalSSZ() +} + +// MarshalSSZTo -- +func (e executionPayloadElectra) MarshalSSZTo(dst []byte) ([]byte, error) { + return e.p.MarshalSSZTo(dst) +} + +// SizeSSZ -- +func (e executionPayloadElectra) SizeSSZ() int { + return e.p.SizeSSZ() +} + +// UnmarshalSSZ -- +func (e executionPayloadElectra) UnmarshalSSZ(buf []byte) error { + return e.p.UnmarshalSSZ(buf) +} + +// HashTreeRoot -- +func (e executionPayloadElectra) HashTreeRoot() ([32]byte, error) { + return e.p.HashTreeRoot() +} + +// HashTreeRootWith -- +func (e executionPayloadElectra) HashTreeRootWith(hh *fastssz.Hasher) error { + return e.p.HashTreeRootWith(hh) +} + +// Proto -- +func (e executionPayloadElectra) Proto() proto.Message { + return e.p +} + +// ParentHash -- +func (e executionPayloadElectra) ParentHash() []byte { + return e.p.ParentHash +} + +// FeeRecipient -- +func (e executionPayloadElectra) FeeRecipient() []byte { + return e.p.FeeRecipient +} + +// StateRoot -- +func (e executionPayloadElectra) StateRoot() []byte { + return e.p.StateRoot +} + +// ReceiptsRoot -- +func (e executionPayloadElectra) ReceiptsRoot() []byte { + return e.p.ReceiptsRoot +} + +// LogsBloom -- +func (e executionPayloadElectra) LogsBloom() []byte { + return e.p.LogsBloom +} + +// PrevRandao -- +func (e executionPayloadElectra) PrevRandao() []byte { + return e.p.PrevRandao +} + +// BlockNumber -- +func (e executionPayloadElectra) BlockNumber() uint64 { + return e.p.BlockNumber +} + +// GasLimit -- +func (e executionPayloadElectra) GasLimit() uint64 { + return e.p.GasLimit +} + +// GasUsed -- +func (e executionPayloadElectra) GasUsed() uint64 { + return e.p.GasUsed +} + +// Timestamp -- +func (e executionPayloadElectra) Timestamp() uint64 { + return e.p.Timestamp +} + +// ExtraData -- +func (e executionPayloadElectra) ExtraData() []byte { + return e.p.ExtraData +} + +// BaseFeePerGas -- +func (e executionPayloadElectra) BaseFeePerGas() []byte { + return e.p.BaseFeePerGas +} + +// BlockHash -- +func (e executionPayloadElectra) BlockHash() []byte { + return e.p.BlockHash +} + +// Transactions -- +func (e executionPayloadElectra) Transactions() ([][]byte, error) { + return e.p.Transactions, nil +} + +// TransactionsRoot -- +func (e executionPayloadElectra) TransactionsRoot() ([]byte, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// Withdrawals -- +func (e executionPayloadElectra) Withdrawals() ([]*enginev1.Withdrawal, error) { + return e.p.Withdrawals, nil +} + +// WithdrawalsRoot -- +func (e executionPayloadElectra) WithdrawalsRoot() ([]byte, error) { + return nil, consensus_types.ErrUnsupportedField +} + +func (e executionPayloadElectra) BlobGasUsed() (uint64, error) { + return e.p.BlobGasUsed, nil +} + +func (e executionPayloadElectra) ExcessBlobGas() (uint64, error) { + return e.p.ExcessBlobGas, nil +} + +// PbBellatrix -- +func (e executionPayloadElectra) PbBellatrix() (*enginev1.ExecutionPayload, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// PbCapella -- +func (e executionPayloadElectra) PbCapella() (*enginev1.ExecutionPayloadCapella, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// PbDeneb -- +func (e executionPayloadElectra) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) { + return nil, consensus_types.ErrUnsupportedField +} + +// PbElectra -- +func (e executionPayloadElectra) PbElectra() (*enginev1.ExecutionPayloadElectra, error) { + return e.p, nil +} + +// ValueInWei -- +func (e executionPayloadElectra) ValueInWei() (math.Wei, error) { + return e.weiValue, nil +} + +// ValueInGwei -- +func (e executionPayloadElectra) ValueInGwei() (uint64, error) { + return e.gweiValue, nil +} + +// DepositReceipts -- +func (e executionPayloadElectra) DepositReceipts() ([]*enginev1.DepositReceipt, error) { + return e.p.DepositReceipts, nil +} + +// WithdrawalRequests -- +func (e executionPayloadElectra) WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) { + return e.p.WithdrawalRequests, nil +} + +// IsBlinded returns true if the underlying data is blinded. +func (e executionPayloadElectra) IsBlinded() bool { + return false +} + // PayloadValueToWei returns a Wei value given the payload's value func PayloadValueToWei(value []byte) math.Wei { // We have to convert big endian to little endian because the value is coming from the execution layer. diff --git a/consensus-types/blocks/factory.go b/consensus-types/blocks/factory.go index ec5103d8be3c..80d266a45e15 100644 --- a/consensus-types/blocks/factory.go +++ b/consensus-types/blocks/factory.go @@ -67,6 +67,14 @@ func NewSignedBeaconBlock(i interface{}) (interfaces.SignedBeaconBlock, error) { return initBlindedSignedBlockFromProtoDeneb(b) case *eth.GenericSignedBeaconBlock_BlindedDeneb: return initBlindedSignedBlockFromProtoDeneb(b.BlindedDeneb) + case *eth.GenericSignedBeaconBlock_Electra: + return initSignedBlockFromProtoElectra(b.Electra.Block) + case *eth.SignedBeaconBlockElectra: + return initSignedBlockFromProtoElectra(b) + case *eth.SignedBlindedBeaconBlockElectra: + return initBlindedSignedBlockFromProtoElectra(b) + case *eth.GenericSignedBeaconBlock_BlindedElectra: + return initBlindedSignedBlockFromProtoElectra(b.BlindedElectra) default: return nil, errors.Wrapf(ErrUnsupportedSignedBeaconBlock, "unable to create block from type %T", i) } @@ -109,6 +117,14 @@ func NewBeaconBlock(i interface{}) (interfaces.ReadOnlyBeaconBlock, error) { return initBlindedBlockFromProtoDeneb(b) case *eth.GenericBeaconBlock_BlindedDeneb: return initBlindedBlockFromProtoDeneb(b.BlindedDeneb) + case *eth.GenericBeaconBlock_Electra: + return initBlockFromProtoElectra(b.Electra.Block) + case *eth.BeaconBlockElectra: + return initBlockFromProtoElectra(b) + case *eth.BlindedBeaconBlockElectra: + return initBlindedBlockFromProtoElectra(b) + case *eth.GenericBeaconBlock_BlindedElectra: + return initBlindedBlockFromProtoElectra(b.BlindedElectra) default: return nil, errors.Wrapf(errUnsupportedBeaconBlock, "unable to create block from type %T", i) } @@ -135,6 +151,10 @@ func NewBeaconBlockBody(i interface{}) (interfaces.ReadOnlyBeaconBlockBody, erro return initBlockBodyFromProtoDeneb(b) case *eth.BlindedBeaconBlockBodyDeneb: return initBlindedBlockBodyFromProtoDeneb(b) + case *eth.BeaconBlockBodyElectra: + return initBlockBodyFromProtoElectra(b) + case *eth.BlindedBeaconBlockBodyElectra: + return initBlindedBlockBodyFromProtoElectra(b) default: return nil, errors.Wrapf(errUnsupportedBeaconBlockBody, "unable to create block body from type %T", i) } @@ -201,6 +221,19 @@ func BuildSignedBeaconBlock(blk interfaces.ReadOnlyBeaconBlock, signature []byte return nil, errIncorrectBlockVersion } return NewSignedBeaconBlock(ð.SignedBeaconBlockDeneb{Block: pb, Signature: signature}) + case version.Electra: + if blk.IsBlinded() { + pb, ok := pb.(*eth.BlindedBeaconBlockElectra) + if !ok { + return nil, errIncorrectBlockVersion + } + return NewSignedBeaconBlock(ð.SignedBlindedBeaconBlockElectra{Message: pb, Signature: signature}) + } + pb, ok := pb.(*eth.BeaconBlockElectra) + if !ok { + return nil, errIncorrectBlockVersion + } + return NewSignedBeaconBlock(ð.SignedBeaconBlockElectra{Block: pb, Signature: signature}) default: return nil, errUnsupportedBeaconBlock } @@ -208,9 +241,7 @@ func BuildSignedBeaconBlock(blk interfaces.ReadOnlyBeaconBlock, signature []byte // BuildSignedBeaconBlockFromExecutionPayload takes a signed, blinded beacon block and converts into // a full, signed beacon block by specifying an execution payload. -func BuildSignedBeaconBlockFromExecutionPayload( - blk interfaces.ReadOnlySignedBeaconBlock, payload interface{}, -) (interfaces.SignedBeaconBlock, error) { +func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBeaconBlock, payload interface{}) (interfaces.SignedBeaconBlock, error) { // nolint:gocognit if err := BeaconBlockIsNil(blk); err != nil { return nil, err } @@ -232,6 +263,8 @@ func BuildSignedBeaconBlockFromExecutionPayload( wrappedPayload, wrapErr = WrappedExecutionPayloadCapella(p, big.NewInt(0)) case *enginev1.ExecutionPayloadDeneb: wrappedPayload, wrapErr = WrappedExecutionPayloadDeneb(p, big.NewInt(0)) + case *enginev1.ExecutionPayloadElectra: + wrappedPayload, wrapErr = WrappedExecutionPayloadElectra(p, big.NewInt(0)) default: return nil, fmt.Errorf("%T is not a type of execution payload", p) } @@ -272,6 +305,28 @@ func BuildSignedBeaconBlockFromExecutionPayload( var fullBlock interface{} switch p := payload.(type) { case *enginev1.ExecutionPayload: + var atts []*eth.Attestation + if b.Body().Attestations() != nil { + atts = make([]*eth.Attestation, len(b.Body().Attestations())) + for i, att := range b.Body().Attestations() { + a, ok := att.(*eth.Attestation) + if !ok { + return nil, fmt.Errorf("attestation has wrong type (expected %T, got %T)", ð.Attestation{}, att) + } + atts[i] = a + } + } + var attSlashings []*eth.AttesterSlashing + if b.Body().AttesterSlashings() != nil { + attSlashings = make([]*eth.AttesterSlashing, len(b.Body().AttesterSlashings())) + for i, slashing := range b.Body().AttesterSlashings() { + s, ok := slashing.(*eth.AttesterSlashing) + if !ok { + return nil, fmt.Errorf("attester slashing has wrong type (expected %T, got %T)", ð.AttesterSlashing{}, slashing) + } + attSlashings[i] = s + } + } fullBlock = ð.SignedBeaconBlockBellatrix{ Block: ð.BeaconBlockBellatrix{ Slot: b.Slot(), @@ -283,8 +338,8 @@ func BuildSignedBeaconBlockFromExecutionPayload( Eth1Data: b.Body().Eth1Data(), Graffiti: graffiti[:], ProposerSlashings: b.Body().ProposerSlashings(), - AttesterSlashings: b.Body().AttesterSlashings(), - Attestations: b.Body().Attestations(), + AttesterSlashings: attSlashings, + Attestations: atts, Deposits: b.Body().Deposits(), VoluntaryExits: b.Body().VoluntaryExits(), SyncAggregate: syncAgg, @@ -298,6 +353,28 @@ func BuildSignedBeaconBlockFromExecutionPayload( if err != nil { return nil, err } + var atts []*eth.Attestation + if b.Body().Attestations() != nil { + atts = make([]*eth.Attestation, len(b.Body().Attestations())) + for i, att := range b.Body().Attestations() { + a, ok := att.(*eth.Attestation) + if !ok { + return nil, fmt.Errorf("attestation has wrong type (expected %T, got %T)", ð.Attestation{}, att) + } + atts[i] = a + } + } + var attSlashings []*eth.AttesterSlashing + if b.Body().AttesterSlashings() != nil { + attSlashings = make([]*eth.AttesterSlashing, len(b.Body().AttesterSlashings())) + for i, slashing := range b.Body().AttesterSlashings() { + s, ok := slashing.(*eth.AttesterSlashing) + if !ok { + return nil, fmt.Errorf("attester slashing has wrong type (expected %T, got %T)", ð.AttesterSlashing{}, slashing) + } + attSlashings[i] = s + } + } fullBlock = ð.SignedBeaconBlockCapella{ Block: ð.BeaconBlockCapella{ Slot: b.Slot(), @@ -309,8 +386,8 @@ func BuildSignedBeaconBlockFromExecutionPayload( Eth1Data: b.Body().Eth1Data(), Graffiti: graffiti[:], ProposerSlashings: b.Body().ProposerSlashings(), - AttesterSlashings: b.Body().AttesterSlashings(), - Attestations: b.Body().Attestations(), + AttesterSlashings: attSlashings, + Attestations: atts, Deposits: b.Body().Deposits(), VoluntaryExits: b.Body().VoluntaryExits(), SyncAggregate: syncAgg, @@ -329,6 +406,28 @@ func BuildSignedBeaconBlockFromExecutionPayload( if err != nil { return nil, err } + var atts []*eth.Attestation + if b.Body().Attestations() != nil { + atts = make([]*eth.Attestation, len(b.Body().Attestations())) + for i, att := range b.Body().Attestations() { + a, ok := att.(*eth.Attestation) + if !ok { + return nil, fmt.Errorf("attestation has wrong type (expected %T, got %T)", ð.Attestation{}, att) + } + atts[i] = a + } + } + var attSlashings []*eth.AttesterSlashing + if b.Body().AttesterSlashings() != nil { + attSlashings = make([]*eth.AttesterSlashing, len(b.Body().AttesterSlashings())) + for i, slashing := range b.Body().AttesterSlashings() { + s, ok := slashing.(*eth.AttesterSlashing) + if !ok { + return nil, fmt.Errorf("attester slashing has wrong type (expected %T, got %T)", ð.AttesterSlashing{}, slashing) + } + attSlashings[i] = s + } + } fullBlock = ð.SignedBeaconBlockDeneb{ Block: ð.BeaconBlockDeneb{ Slot: b.Slot(), @@ -340,14 +439,73 @@ func BuildSignedBeaconBlockFromExecutionPayload( Eth1Data: b.Body().Eth1Data(), Graffiti: graffiti[:], ProposerSlashings: b.Body().ProposerSlashings(), - AttesterSlashings: b.Body().AttesterSlashings(), - Attestations: b.Body().Attestations(), + AttesterSlashings: attSlashings, + Attestations: atts, + Deposits: b.Body().Deposits(), + VoluntaryExits: b.Body().VoluntaryExits(), + SyncAggregate: syncAgg, + ExecutionPayload: p, + BlsToExecutionChanges: blsToExecutionChanges, + BlobKzgCommitments: commitments, + }, + }, + Signature: sig[:], + } + case *enginev1.ExecutionPayloadElectra: + blsToExecutionChanges, err := b.Body().BLSToExecutionChanges() + if err != nil { + return nil, err + } + commitments, err := b.Body().BlobKzgCommitments() + if err != nil { + return nil, err + } + consolidations, err := b.Body().Consolidations() + if err != nil { + return nil, err + } + var atts []*eth.AttestationElectra + if b.Body().Attestations() != nil { + atts = make([]*eth.AttestationElectra, len(b.Body().Attestations())) + for i, att := range b.Body().Attestations() { + a, ok := att.(*eth.AttestationElectra) + if !ok { + return nil, fmt.Errorf("attestation has wrong type (expected %T, got %T)", ð.Attestation{}, att) + } + atts[i] = a + } + } + var attSlashings []*eth.AttesterSlashingElectra + if b.Body().AttesterSlashings() != nil { + attSlashings = make([]*eth.AttesterSlashingElectra, len(b.Body().AttesterSlashings())) + for i, slashing := range b.Body().AttesterSlashings() { + s, ok := slashing.(*eth.AttesterSlashingElectra) + if !ok { + return nil, fmt.Errorf("attester slashing has wrong type (expected %T, got %T)", ð.AttesterSlashing{}, slashing) + } + attSlashings[i] = s + } + } + fullBlock = ð.SignedBeaconBlockElectra{ + Block: ð.BeaconBlockElectra{ + Slot: b.Slot(), + ProposerIndex: b.ProposerIndex(), + ParentRoot: parentRoot[:], + StateRoot: stateRoot[:], + Body: ð.BeaconBlockBodyElectra{ + RandaoReveal: randaoReveal[:], + Eth1Data: b.Body().Eth1Data(), + Graffiti: graffiti[:], + ProposerSlashings: b.Body().ProposerSlashings(), + AttesterSlashings: attSlashings, + Attestations: atts, Deposits: b.Body().Deposits(), VoluntaryExits: b.Body().VoluntaryExits(), SyncAggregate: syncAgg, ExecutionPayload: p, BlsToExecutionChanges: blsToExecutionChanges, BlobKzgCommitments: commitments, + Consolidations: consolidations, }, }, Signature: sig[:], diff --git a/consensus-types/blocks/getters.go b/consensus-types/blocks/getters.go index 7ca9f6e5b555..4cc0f2c20398 100644 --- a/consensus-types/blocks/getters.go +++ b/consensus-types/blocks/getters.go @@ -81,6 +81,14 @@ func (b *SignedBeaconBlock) Copy() (interfaces.SignedBeaconBlock, error) { } cp := eth.CopySignedBeaconBlockDeneb(pb.(*eth.SignedBeaconBlockDeneb)) return initSignedBlockFromProtoDeneb(cp) + case version.Electra: + if b.IsBlinded() { + cp := eth.CopySignedBlindedBeaconBlockElectra(pb.(*eth.SignedBlindedBeaconBlockElectra)) + return initBlindedSignedBlockFromProtoElectra(cp) + } + cp := eth.CopySignedBeaconBlockElectra(pb.(*eth.SignedBeaconBlockElectra)) + return initSignedBlockFromProtoElectra(cp) + default: return nil, errIncorrectBlockVersion } @@ -128,6 +136,15 @@ func (b *SignedBeaconBlock) PbGenericBlock() (*eth.GenericSignedBeaconBlock, err return ð.GenericSignedBeaconBlock{ Block: ð.GenericSignedBeaconBlock_Deneb{Deneb: pb.(*eth.SignedBeaconBlockContentsDeneb)}, }, nil + case version.Electra: + if b.IsBlinded() { + return ð.GenericSignedBeaconBlock{ + Block: ð.GenericSignedBeaconBlock_BlindedElectra{BlindedElectra: pb.(*eth.SignedBlindedBeaconBlockElectra)}, + }, nil + } + return ð.GenericSignedBeaconBlock{ + Block: ð.GenericSignedBeaconBlock_Electra{Electra: pb.(*eth.SignedBeaconBlockContentsElectra)}, + }, nil default: return nil, errIncorrectBlockVersion } @@ -330,6 +347,37 @@ func (b *SignedBeaconBlock) ToBlinded() (interfaces.ReadOnlySignedBeaconBlock, e }, Signature: b.signature[:], }) + case *enginev1.ExecutionPayloadElectra: + header, err := PayloadToHeaderElectra(payload) + if err != nil { + return nil, err + } + return initBlindedSignedBlockFromProtoElectra( + ð.SignedBlindedBeaconBlockElectra{ + Message: ð.BlindedBeaconBlockElectra{ + Slot: b.block.slot, + ProposerIndex: b.block.proposerIndex, + ParentRoot: b.block.parentRoot[:], + StateRoot: b.block.stateRoot[:], + Body: ð.BlindedBeaconBlockBodyElectra{ + RandaoReveal: b.block.body.randaoReveal[:], + Eth1Data: b.block.body.eth1Data, + Graffiti: b.block.body.graffiti[:], + ProposerSlashings: b.block.body.proposerSlashings, + AttesterSlashings: b.block.body.attesterSlashingsElectra, + Attestations: b.block.body.attestationsElectra, + Deposits: b.block.body.deposits, + VoluntaryExits: b.block.body.voluntaryExits, + SyncAggregate: b.block.body.syncAggregate, + ExecutionPayloadHeader: header, + BlsToExecutionChanges: b.block.body.blsToExecutionChanges, + BlobKzgCommitments: b.block.body.blobKzgCommitments, + Consolidations: b.block.body.signedConsolidations, + }, + }, + Signature: b.signature[:], + }) + default: return nil, fmt.Errorf("%T is not an execution payload header", p) } @@ -459,6 +507,11 @@ func (b *SignedBeaconBlock) MarshalSSZ() ([]byte, error) { return pb.(*eth.SignedBlindedBeaconBlockDeneb).MarshalSSZ() } return pb.(*eth.SignedBeaconBlockDeneb).MarshalSSZ() + case version.Electra: + if b.IsBlinded() { + return pb.(*eth.SignedBlindedBeaconBlockElectra).MarshalSSZ() + } + return pb.(*eth.SignedBeaconBlockElectra).MarshalSSZ() default: return []byte{}, errIncorrectBlockVersion } @@ -491,6 +544,11 @@ func (b *SignedBeaconBlock) MarshalSSZTo(dst []byte) ([]byte, error) { return pb.(*eth.SignedBlindedBeaconBlockDeneb).MarshalSSZTo(dst) } return pb.(*eth.SignedBeaconBlockDeneb).MarshalSSZTo(dst) + case version.Electra: + if b.IsBlinded() { + return pb.(*eth.SignedBlindedBeaconBlockElectra).MarshalSSZTo(dst) + } + return pb.(*eth.SignedBeaconBlockElectra).MarshalSSZTo(dst) default: return []byte{}, errIncorrectBlockVersion } @@ -527,6 +585,11 @@ func (b *SignedBeaconBlock) SizeSSZ() int { return pb.(*eth.SignedBlindedBeaconBlockDeneb).SizeSSZ() } return pb.(*eth.SignedBeaconBlockDeneb).SizeSSZ() + case version.Electra: + if b.IsBlinded() { + return pb.(*eth.SignedBlindedBeaconBlockElectra).SizeSSZ() + } + return pb.(*eth.SignedBeaconBlockElectra).SizeSSZ() default: panic(incorrectBlockVersion) } @@ -622,6 +685,28 @@ func (b *SignedBeaconBlock) UnmarshalSSZ(buf []byte) error { return err } } + case version.Electra: + if b.IsBlinded() { + pb := ð.SignedBlindedBeaconBlockElectra{} + if err := pb.UnmarshalSSZ(buf); err != nil { + return err + } + var err error + newBlock, err = initBlindedSignedBlockFromProtoElectra(pb) + if err != nil { + return err + } + } else { + pb := ð.SignedBeaconBlockElectra{} + if err := pb.UnmarshalSSZ(buf); err != nil { + return err + } + var err error + newBlock, err = initSignedBlockFromProtoElectra(pb) + if err != nil { + return err + } + } default: return errIncorrectBlockVersion } @@ -695,6 +780,11 @@ func (b *BeaconBlock) HashTreeRoot() ([field_params.RootLength]byte, error) { return pb.(*eth.BlindedBeaconBlockDeneb).HashTreeRoot() } return pb.(*eth.BeaconBlockDeneb).HashTreeRoot() + case version.Electra: + if b.IsBlinded() { + return pb.(*eth.BlindedBeaconBlockElectra).HashTreeRoot() + } + return pb.(*eth.BeaconBlockElectra).HashTreeRoot() default: return [field_params.RootLength]byte{}, errIncorrectBlockVersion } @@ -726,6 +816,11 @@ func (b *BeaconBlock) HashTreeRootWith(h *ssz.Hasher) error { return pb.(*eth.BlindedBeaconBlockDeneb).HashTreeRootWith(h) } return pb.(*eth.BeaconBlockDeneb).HashTreeRootWith(h) + case version.Electra: + if b.IsBlinded() { + return pb.(*eth.BlindedBeaconBlockElectra).HashTreeRootWith(h) + } + return pb.(*eth.BeaconBlockElectra).HashTreeRootWith(h) default: return errIncorrectBlockVersion } @@ -758,6 +853,11 @@ func (b *BeaconBlock) MarshalSSZ() ([]byte, error) { return pb.(*eth.BlindedBeaconBlockDeneb).MarshalSSZ() } return pb.(*eth.BeaconBlockDeneb).MarshalSSZ() + case version.Electra: + if b.IsBlinded() { + return pb.(*eth.BlindedBeaconBlockElectra).MarshalSSZ() + } + return pb.(*eth.BeaconBlockElectra).MarshalSSZ() default: return []byte{}, errIncorrectBlockVersion } @@ -790,6 +890,11 @@ func (b *BeaconBlock) MarshalSSZTo(dst []byte) ([]byte, error) { return pb.(*eth.BlindedBeaconBlockDeneb).MarshalSSZTo(dst) } return pb.(*eth.BeaconBlockDeneb).MarshalSSZTo(dst) + case version.Electra: + if b.IsBlinded() { + return pb.(*eth.BlindedBeaconBlockElectra).MarshalSSZTo(dst) + } + return pb.(*eth.BeaconBlockElectra).MarshalSSZTo(dst) default: return []byte{}, errIncorrectBlockVersion } @@ -826,6 +931,11 @@ func (b *BeaconBlock) SizeSSZ() int { return pb.(*eth.BlindedBeaconBlockDeneb).SizeSSZ() } return pb.(*eth.BeaconBlockDeneb).SizeSSZ() + case version.Electra: + if b.IsBlinded() { + return pb.(*eth.BlindedBeaconBlockElectra).SizeSSZ() + } + return pb.(*eth.BeaconBlockElectra).SizeSSZ() default: panic(incorrectBodyVersion) } @@ -921,6 +1031,28 @@ func (b *BeaconBlock) UnmarshalSSZ(buf []byte) error { return err } } + case version.Electra: + if b.IsBlinded() { + pb := ð.BlindedBeaconBlockElectra{} + if err := pb.UnmarshalSSZ(buf); err != nil { + return err + } + var err error + newBlock, err = initBlindedBlockFromProtoElectra(pb) + if err != nil { + return err + } + } else { + pb := ð.BeaconBlockElectra{} + if err := pb.UnmarshalSSZ(buf); err != nil { + return err + } + var err error + newBlock, err = initBlockFromProtoElectra(pb) + if err != nil { + return err + } + } default: return errIncorrectBlockVersion } @@ -954,6 +1086,11 @@ func (b *BeaconBlock) AsSignRequestObject() (validatorpb.SignRequestObject, erro return &validatorpb.SignRequest_BlindedBlockDeneb{BlindedBlockDeneb: pb.(*eth.BlindedBeaconBlockDeneb)}, nil } return &validatorpb.SignRequest_BlockDeneb{BlockDeneb: pb.(*eth.BeaconBlockDeneb)}, nil + case version.Electra: + if b.IsBlinded() { + return &validatorpb.SignRequest_BlindedBlockElectra{BlindedBlockElectra: pb.(*eth.BlindedBeaconBlockElectra)}, nil + } + return &validatorpb.SignRequest_BlockElectra{BlockElectra: pb.(*eth.BeaconBlockElectra)}, nil default: return nil, errIncorrectBlockVersion } @@ -996,6 +1133,13 @@ func (b *BeaconBlock) Copy() (interfaces.ReadOnlyBeaconBlock, error) { } cp := eth.CopyBeaconBlockDeneb(pb.(*eth.BeaconBlockDeneb)) return initBlockFromProtoDeneb(cp) + case version.Electra: + if b.IsBlinded() { + cp := eth.CopyBlindedBeaconBlockElectra(pb.(*eth.BlindedBeaconBlockElectra)) + return initBlindedBlockFromProtoElectra(cp) + } + cp := eth.CopyBeaconBlockElectra(pb.(*eth.BeaconBlockElectra)) + return initBlockFromProtoElectra(cp) default: return nil, errIncorrectBlockVersion } @@ -1027,13 +1171,49 @@ func (b *BeaconBlockBody) ProposerSlashings() []*eth.ProposerSlashing { } // AttesterSlashings returns the attester slashings in the block. -func (b *BeaconBlockBody) AttesterSlashings() []*eth.AttesterSlashing { - return b.attesterSlashings +func (b *BeaconBlockBody) AttesterSlashings() []interfaces.AttesterSlashing { + var slashings []interfaces.AttesterSlashing + if b.version < version.Electra { + if b.attesterSlashings == nil { + return nil + } + slashings = make([]interfaces.AttesterSlashing, len(b.attesterSlashings)) + for i, s := range b.attesterSlashings { + slashings[i] = s + } + } else { + if b.attesterSlashingsElectra == nil { + return nil + } + slashings = make([]interfaces.AttesterSlashing, len(b.attesterSlashingsElectra)) + for i, s := range b.attesterSlashingsElectra { + slashings[i] = s + } + } + return slashings } // Attestations returns the stored attestations in the block. -func (b *BeaconBlockBody) Attestations() []*eth.Attestation { - return b.attestations +func (b *BeaconBlockBody) Attestations() []interfaces.Attestation { + var atts []interfaces.Attestation + if b.version < version.Electra { + if b.attestations == nil { + return nil + } + atts = make([]interfaces.Attestation, len(b.attestations)) + for i, a := range b.attestations { + atts[i] = a + } + } else { + if b.attestationsElectra == nil { + return nil + } + atts = make([]interfaces.Attestation, len(b.attestationsElectra)) + for i, a := range b.attestations { + atts[i] = a + } + } + return atts } // Deposits returns the stored deposits in the block. @@ -1079,13 +1259,20 @@ func (b *BeaconBlockBody) BlobKzgCommitments() ([][]byte, error) { switch b.version { case version.Phase0, version.Altair, version.Bellatrix, version.Capella: return nil, consensus_types.ErrNotSupported("BlobKzgCommitments", b.version) - case version.Deneb: + case version.Deneb, version.Electra: return b.blobKzgCommitments, nil default: return nil, errIncorrectBlockVersion } } +func (b *BeaconBlockBody) Consolidations() ([]*eth.SignedConsolidation, error) { + if b.version < version.Electra { + return nil, consensus_types.ErrNotSupported("Consolidations", b.version) + } + return b.signedConsolidations, nil +} + // Version returns the version of the beacon block body func (b *BeaconBlockBody) Version() int { return b.version @@ -1117,6 +1304,11 @@ func (b *BeaconBlockBody) HashTreeRoot() ([field_params.RootLength]byte, error) return pb.(*eth.BlindedBeaconBlockBodyDeneb).HashTreeRoot() } return pb.(*eth.BeaconBlockBodyDeneb).HashTreeRoot() + case version.Electra: + if b.IsBlinded() { + return pb.(*eth.BlindedBeaconBlockBodyElectra).HashTreeRoot() + } + return pb.(*eth.BeaconBlockBodyElectra).HashTreeRoot() default: return [field_params.RootLength]byte{}, errIncorrectBodyVersion } diff --git a/consensus-types/blocks/getters_test.go b/consensus-types/blocks/getters_test.go index b18a2caa7746..22c2fd63dde8 100644 --- a/consensus-types/blocks/getters_test.go +++ b/consensus-types/blocks/getters_test.go @@ -356,16 +356,16 @@ func Test_BeaconBlockBody_ProposerSlashings(t *testing.T) { } func Test_BeaconBlockBody_AttesterSlashings(t *testing.T) { - as := make([]*eth.AttesterSlashing, 0) + as := make([]interfaces.AttesterSlashing, 0) bb := &SignedBeaconBlock{block: &BeaconBlock{body: &BeaconBlockBody{}}} - bb.SetAttesterSlashings(as) + require.NoError(t, bb.SetAttesterSlashings(as)) assert.DeepSSZEqual(t, as, bb.Block().Body().AttesterSlashings()) } func Test_BeaconBlockBody_Attestations(t *testing.T) { - a := make([]*eth.Attestation, 0) + a := make([]interfaces.Attestation, 0) bb := &SignedBeaconBlock{block: &BeaconBlock{body: &BeaconBlockBody{}}} - bb.SetAttestations(a) + require.NoError(t, bb.SetAttestations(a)) assert.DeepSSZEqual(t, a, bb.Block().Body().Attestations()) } diff --git a/consensus-types/blocks/proto.go b/consensus-types/blocks/proto.go index e6af3a57d3b3..314fb0a5e67a 100644 --- a/consensus-types/blocks/proto.go +++ b/consensus-types/blocks/proto.go @@ -13,7 +13,7 @@ import ( ) // Proto converts the signed beacon block to a protobuf object. -func (b *SignedBeaconBlock) Proto() (proto.Message, error) { +func (b *SignedBeaconBlock) Proto() (proto.Message, error) { // nolint:gocognit if b == nil { return nil, errNilBlock } @@ -131,13 +131,40 @@ func (b *SignedBeaconBlock) Proto() (proto.Message, error) { Block: block, Signature: b.signature[:], }, nil + case version.Electra: + if b.IsBlinded() { + var block *eth.BlindedBeaconBlockElectra + if blockMessage != nil { + var ok bool + block, ok = blockMessage.(*eth.BlindedBeaconBlockElectra) + if !ok { + return nil, errIncorrectBlockVersion + } + } + return ð.SignedBlindedBeaconBlockElectra{ + Message: block, + Signature: b.signature[:], + }, nil + } + var block *eth.BeaconBlockElectra + if blockMessage != nil { + var ok bool + block, ok = blockMessage.(*eth.BeaconBlockElectra) + if !ok { + return nil, errIncorrectBlockVersion + } + } + return ð.SignedBeaconBlockElectra{ + Block: block, + Signature: b.signature[:], + }, nil default: return nil, errors.New("unsupported signed beacon block version") } } // Proto converts the beacon block to a protobuf object. -func (b *BeaconBlock) Proto() (proto.Message, error) { +func (b *BeaconBlock) Proto() (proto.Message, error) { // nolint:gocognit if b == nil { return nil, nil } @@ -279,6 +306,40 @@ func (b *BeaconBlock) Proto() (proto.Message, error) { StateRoot: b.stateRoot[:], Body: body, }, nil + case version.Electra: + if b.IsBlinded() { + var body *eth.BlindedBeaconBlockBodyElectra + if bodyMessage != nil { + var ok bool + body, ok = bodyMessage.(*eth.BlindedBeaconBlockBodyElectra) + if !ok { + return nil, errIncorrectBodyVersion + } + } + return ð.BlindedBeaconBlockElectra{ + Slot: b.slot, + ProposerIndex: b.proposerIndex, + ParentRoot: b.parentRoot[:], + StateRoot: b.stateRoot[:], + Body: body, + }, nil + } + var body *eth.BeaconBlockBodyElectra + if bodyMessage != nil { + var ok bool + body, ok = bodyMessage.(*eth.BeaconBlockBodyElectra) + if !ok { + return nil, errIncorrectBodyVersion + } + } + return ð.BeaconBlockElectra{ + Slot: b.slot, + ProposerIndex: b.proposerIndex, + ParentRoot: b.parentRoot[:], + StateRoot: b.stateRoot[:], + Body: body, + }, nil + default: return nil, errors.New("unsupported beacon block version") } @@ -449,6 +510,56 @@ func (b *BeaconBlockBody) Proto() (proto.Message, error) { BlsToExecutionChanges: b.blsToExecutionChanges, BlobKzgCommitments: b.blobKzgCommitments, }, nil + case version.Electra: + if b.IsBlinded() { + var ph *enginev1.ExecutionPayloadHeaderElectra + var ok bool + if b.executionPayloadHeader != nil { + ph, ok = b.executionPayloadHeader.Proto().(*enginev1.ExecutionPayloadHeaderElectra) + if !ok { + return nil, errPayloadHeaderWrongType + } + } + return ð.BlindedBeaconBlockBodyElectra{ + RandaoReveal: b.randaoReveal[:], + Eth1Data: b.eth1Data, + Graffiti: b.graffiti[:], + ProposerSlashings: b.proposerSlashings, + AttesterSlashings: b.attesterSlashingsElectra, + Attestations: b.attestationsElectra, + Deposits: b.deposits, + VoluntaryExits: b.voluntaryExits, + SyncAggregate: b.syncAggregate, + ExecutionPayloadHeader: ph, + BlsToExecutionChanges: b.blsToExecutionChanges, + BlobKzgCommitments: b.blobKzgCommitments, + Consolidations: b.signedConsolidations, + }, nil + } + var p *enginev1.ExecutionPayloadElectra + var ok bool + if b.executionPayload != nil { + p, ok = b.executionPayload.Proto().(*enginev1.ExecutionPayloadElectra) + if !ok { + return nil, errPayloadWrongType + } + } + return ð.BeaconBlockBodyElectra{ + RandaoReveal: b.randaoReveal[:], + Eth1Data: b.eth1Data, + Graffiti: b.graffiti[:], + ProposerSlashings: b.proposerSlashings, + AttesterSlashings: b.attesterSlashingsElectra, + Attestations: b.attestationsElectra, + Deposits: b.deposits, + VoluntaryExits: b.voluntaryExits, + SyncAggregate: b.syncAggregate, + ExecutionPayload: p, + BlsToExecutionChanges: b.blsToExecutionChanges, + BlobKzgCommitments: b.blobKzgCommitments, + Consolidations: b.signedConsolidations, + }, nil + default: return nil, errors.New("unsupported beacon block body version") } @@ -539,6 +650,23 @@ func initSignedBlockFromProtoDeneb(pb *eth.SignedBeaconBlockDeneb) (*SignedBeaco return b, nil } +func initSignedBlockFromProtoElectra(pb *eth.SignedBeaconBlockElectra) (*SignedBeaconBlock, error) { + if pb == nil { + return nil, errNilBlock + } + + block, err := initBlockFromProtoElectra(pb.Block) + if err != nil { + return nil, err + } + b := &SignedBeaconBlock{ + version: version.Electra, + block: block, + signature: bytesutil.ToBytes96(pb.Signature), + } + return b, nil +} + func initBlindedSignedBlockFromProtoBellatrix(pb *eth.SignedBlindedBeaconBlockBellatrix) (*SignedBeaconBlock, error) { if pb == nil { return nil, errNilBlock @@ -590,6 +718,23 @@ func initBlindedSignedBlockFromProtoDeneb(pb *eth.SignedBlindedBeaconBlockDeneb) return b, nil } +func initBlindedSignedBlockFromProtoElectra(pb *eth.SignedBlindedBeaconBlockElectra) (*SignedBeaconBlock, error) { + if pb == nil { + return nil, errNilBlock + } + + block, err := initBlindedBlockFromProtoElectra(pb.Message) + if err != nil { + return nil, err + } + b := &SignedBeaconBlock{ + version: version.Electra, + block: block, + signature: bytesutil.ToBytes96(pb.Signature), + } + return b, nil +} + func initBlockFromProtoPhase0(pb *eth.BeaconBlock) (*BeaconBlock, error) { if pb == nil { return nil, errNilBlock @@ -710,6 +855,26 @@ func initBlockFromProtoDeneb(pb *eth.BeaconBlockDeneb) (*BeaconBlock, error) { return b, nil } +func initBlockFromProtoElectra(pb *eth.BeaconBlockElectra) (*BeaconBlock, error) { + if pb == nil { + return nil, errNilBlock + } + + body, err := initBlockBodyFromProtoElectra(pb.Body) + if err != nil { + return nil, err + } + b := &BeaconBlock{ + version: version.Electra, + slot: pb.Slot, + proposerIndex: pb.ProposerIndex, + parentRoot: bytesutil.ToBytes32(pb.ParentRoot), + stateRoot: bytesutil.ToBytes32(pb.StateRoot), + body: body, + } + return b, nil +} + func initBlindedBlockFromProtoCapella(pb *eth.BlindedBeaconBlockCapella) (*BeaconBlock, error) { if pb == nil { return nil, errNilBlock @@ -750,6 +915,26 @@ func initBlindedBlockFromProtoDeneb(pb *eth.BlindedBeaconBlockDeneb) (*BeaconBlo return b, nil } +func initBlindedBlockFromProtoElectra(pb *eth.BlindedBeaconBlockElectra) (*BeaconBlock, error) { + if pb == nil { + return nil, errNilBlock + } + + body, err := initBlindedBlockBodyFromProtoElectra(pb.Body) + if err != nil { + return nil, err + } + b := &BeaconBlock{ + version: version.Electra, + slot: pb.Slot, + proposerIndex: pb.ProposerIndex, + parentRoot: bytesutil.ToBytes32(pb.ParentRoot), + stateRoot: bytesutil.ToBytes32(pb.StateRoot), + body: body, + } + return b, nil +} + func initBlockBodyFromProtoPhase0(pb *eth.BeaconBlockBody) (*BeaconBlockBody, error) { if pb == nil { return nil, errNilBlockBody @@ -950,3 +1135,61 @@ func initBlindedBlockBodyFromProtoDeneb(pb *eth.BlindedBeaconBlockBodyDeneb) (*B } return b, nil } + +func initBlockBodyFromProtoElectra(pb *eth.BeaconBlockBodyElectra) (*BeaconBlockBody, error) { + if pb == nil { + return nil, errNilBlockBody + } + + p, err := WrappedExecutionPayloadElectra(pb.ExecutionPayload, big.NewInt(0)) + // We allow the payload to be nil + if err != nil && err != consensus_types.ErrNilObjectWrapped { + return nil, err + } + b := &BeaconBlockBody{ + version: version.Electra, + randaoReveal: bytesutil.ToBytes96(pb.RandaoReveal), + eth1Data: pb.Eth1Data, + graffiti: bytesutil.ToBytes32(pb.Graffiti), + proposerSlashings: pb.ProposerSlashings, + attesterSlashingsElectra: pb.AttesterSlashings, + attestationsElectra: pb.Attestations, + deposits: pb.Deposits, + voluntaryExits: pb.VoluntaryExits, + syncAggregate: pb.SyncAggregate, + executionPayload: p, + blsToExecutionChanges: pb.BlsToExecutionChanges, + blobKzgCommitments: pb.BlobKzgCommitments, + signedConsolidations: pb.Consolidations, + } + return b, nil +} + +func initBlindedBlockBodyFromProtoElectra(pb *eth.BlindedBeaconBlockBodyElectra) (*BeaconBlockBody, error) { + if pb == nil { + return nil, errNilBlockBody + } + + ph, err := WrappedExecutionPayloadHeaderElectra(pb.ExecutionPayloadHeader, big.NewInt(0)) + // We allow the payload to be nil + if err != nil && err != consensus_types.ErrNilObjectWrapped { + return nil, err + } + b := &BeaconBlockBody{ + version: version.Electra, + randaoReveal: bytesutil.ToBytes96(pb.RandaoReveal), + eth1Data: pb.Eth1Data, + graffiti: bytesutil.ToBytes32(pb.Graffiti), + proposerSlashings: pb.ProposerSlashings, + attesterSlashingsElectra: pb.AttesterSlashings, + attestationsElectra: pb.Attestations, + deposits: pb.Deposits, + voluntaryExits: pb.VoluntaryExits, + syncAggregate: pb.SyncAggregate, + executionPayloadHeader: ph, + blsToExecutionChanges: pb.BlsToExecutionChanges, + blobKzgCommitments: pb.BlobKzgCommitments, + signedConsolidations: pb.Consolidations, + } + return b, nil +} diff --git a/consensus-types/blocks/setters.go b/consensus-types/blocks/setters.go index 0c1032cee1ff..caa1638211f0 100644 --- a/consensus-types/blocks/setters.go +++ b/consensus-types/blocks/setters.go @@ -1,6 +1,8 @@ package blocks import ( + "fmt" + consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -64,14 +66,56 @@ func (b *SignedBeaconBlock) SetProposerSlashings(p []*eth.ProposerSlashing) { // SetAttesterSlashings sets the attester slashings in the block. // This function is not thread safe, it is only used during block creation. -func (b *SignedBeaconBlock) SetAttesterSlashings(a []*eth.AttesterSlashing) { - b.block.body.attesterSlashings = a +func (b *SignedBeaconBlock) SetAttesterSlashings(slashings []interfaces.AttesterSlashing) error { + if b.version < version.Electra { + blockSlashings := make([]*eth.AttesterSlashing, 0, len(slashings)) + for _, slashing := range slashings { + s, ok := slashing.(*eth.AttesterSlashing) + if !ok { + return fmt.Errorf("slashing of type %T is not *eth.AttesterSlashing", slashing) + } + blockSlashings = append(blockSlashings, s) + } + b.block.body.attesterSlashings = blockSlashings + } else { + blockSlashings := make([]*eth.AttesterSlashingElectra, 0, len(slashings)) + for _, slashing := range slashings { + s, ok := slashing.(*eth.AttesterSlashingElectra) + if !ok { + return fmt.Errorf("slashing of type %T is not *eth.AttesterSlashingElectra", slashing) + } + blockSlashings = append(blockSlashings, s) + } + b.block.body.attesterSlashingsElectra = blockSlashings + } + return nil } // SetAttestations sets the attestations in the block. // This function is not thread safe, it is only used during block creation. -func (b *SignedBeaconBlock) SetAttestations(a []*eth.Attestation) { - b.block.body.attestations = a +func (b *SignedBeaconBlock) SetAttestations(atts []interfaces.Attestation) error { + if b.version < version.Electra { + blockAtts := make([]*eth.Attestation, 0, len(atts)) + for _, att := range atts { + a, ok := att.(*eth.Attestation) + if !ok { + return fmt.Errorf("attestation of type %T is not *eth.Attestation", att) + } + blockAtts = append(blockAtts, a) + } + b.block.body.attestations = blockAtts + } else { + blockAtts := make([]*eth.AttestationElectra, 0, len(atts)) + for _, att := range atts { + a, ok := att.(*eth.AttestationElectra) + if !ok { + return fmt.Errorf("attestation of type %T is not *eth.AttestationElectra", att) + } + blockAtts = append(blockAtts, a) + } + b.block.body.attestationsElectra = blockAtts + } + return nil } // SetDeposits sets the deposits in the block. @@ -122,13 +166,9 @@ func (b *SignedBeaconBlock) SetBLSToExecutionChanges(blsToExecutionChanges []*et // SetBlobKzgCommitments sets the blob kzg commitments in the block. func (b *SignedBeaconBlock) SetBlobKzgCommitments(c [][]byte) error { - switch b.version { - case version.Phase0, version.Altair, version.Bellatrix, version.Capella: + if b.version < version.Deneb { return consensus_types.ErrNotSupported("SetBlobKzgCommitments", b.version) - case version.Deneb: - b.block.body.blobKzgCommitments = c - return nil - default: - return errIncorrectBlockVersion } + b.block.body.blobKzgCommitments = c + return nil } diff --git a/consensus-types/blocks/types.go b/consensus-types/blocks/types.go index 0ad61da033e0..c6216b1d593c 100644 --- a/consensus-types/blocks/types.go +++ b/consensus-types/blocks/types.go @@ -38,20 +38,23 @@ var ( // BeaconBlockBody is the main beacon block body structure. It can represent any block type. type BeaconBlockBody struct { - version int - randaoReveal [field_params.BLSSignatureLength]byte - eth1Data *eth.Eth1Data - graffiti [field_params.RootLength]byte - proposerSlashings []*eth.ProposerSlashing - attesterSlashings []*eth.AttesterSlashing - attestations []*eth.Attestation - deposits []*eth.Deposit - voluntaryExits []*eth.SignedVoluntaryExit - syncAggregate *eth.SyncAggregate - executionPayload interfaces.ExecutionData - executionPayloadHeader interfaces.ExecutionData - blsToExecutionChanges []*eth.SignedBLSToExecutionChange - blobKzgCommitments [][]byte + version int + randaoReveal [field_params.BLSSignatureLength]byte + eth1Data *eth.Eth1Data + graffiti [field_params.RootLength]byte + proposerSlashings []*eth.ProposerSlashing + attesterSlashings []*eth.AttesterSlashing + attesterSlashingsElectra []*eth.AttesterSlashingElectra + attestations []*eth.Attestation + attestationsElectra []*eth.AttestationElectra + deposits []*eth.Deposit + voluntaryExits []*eth.SignedVoluntaryExit + syncAggregate *eth.SyncAggregate + executionPayload interfaces.ExecutionData + executionPayloadHeader interfaces.ExecutionData + blsToExecutionChanges []*eth.SignedBLSToExecutionChange + blobKzgCommitments [][]byte + signedConsolidations []*eth.SignedConsolidation } // BeaconBlock is the main beacon block structure. It can represent any block type. diff --git a/consensus-types/interfaces/BUILD.bazel b/consensus-types/interfaces/BUILD.bazel index a6fbdd5df957..84eb1c643fa2 100644 --- a/consensus-types/interfaces/BUILD.bazel +++ b/consensus-types/interfaces/BUILD.bazel @@ -17,6 +17,7 @@ go_library( "//proto/prysm/v1alpha1/validator-client:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", + "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/consensus-types/interfaces/beacon_block.go b/consensus-types/interfaces/beacon_block.go index 2366c3f19599..08cc1ef88d01 100644 --- a/consensus-types/interfaces/beacon_block.go +++ b/consensus-types/interfaces/beacon_block.go @@ -2,6 +2,7 @@ package interfaces import ( ssz "github.com/prysmaticlabs/fastssz" + "github.com/prysmaticlabs/go-bitfield" field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/math" @@ -66,8 +67,8 @@ type ReadOnlyBeaconBlockBody interface { Eth1Data() *ethpb.Eth1Data Graffiti() [field_params.RootLength]byte ProposerSlashings() []*ethpb.ProposerSlashing - AttesterSlashings() []*ethpb.AttesterSlashing - Attestations() []*ethpb.Attestation + AttesterSlashings() []AttesterSlashing + Attestations() []Attestation Deposits() []*ethpb.Deposit VoluntaryExits() []*ethpb.SignedVoluntaryExit SyncAggregate() (*ethpb.SyncAggregate, error) @@ -77,6 +78,7 @@ type ReadOnlyBeaconBlockBody interface { Execution() (ExecutionData, error) BLSToExecutionChanges() ([]*ethpb.SignedBLSToExecutionChange, error) BlobKzgCommitments() ([][]byte, error) + Consolidations() ([]*ethpb.SignedConsolidation, error) } type SignedBeaconBlock interface { @@ -87,8 +89,8 @@ type SignedBeaconBlock interface { SetSyncAggregate(*ethpb.SyncAggregate) error SetVoluntaryExits([]*ethpb.SignedVoluntaryExit) SetDeposits([]*ethpb.Deposit) - SetAttestations([]*ethpb.Attestation) - SetAttesterSlashings([]*ethpb.AttesterSlashing) + SetAttestations([]Attestation) error + SetAttesterSlashings([]AttesterSlashing) error SetProposerSlashings([]*ethpb.ProposerSlashing) SetGraffiti([]byte) SetEth1Data(*ethpb.Eth1Data) @@ -132,6 +134,45 @@ type ExecutionData interface { PbCapella() (*enginev1.ExecutionPayloadCapella, error) PbBellatrix() (*enginev1.ExecutionPayload, error) PbDeneb() (*enginev1.ExecutionPayloadDeneb, error) + PbElectra() (*enginev1.ExecutionPayloadElectra, error) ValueInWei() (math.Wei, error) ValueInGwei() (uint64, error) + DepositReceipts() ([]*enginev1.DepositReceipt, error) + WithdrawalRequests() ([]*enginev1.ExecutionLayerWithdrawalRequest, error) +} + +type Attestation interface { + proto.Message + ssz.Marshaler + ssz.Unmarshaler + ssz.HashRoot + Version() int + GetAggregationBits() bitfield.Bitlist + GetData() *ethpb.AttestationData + GetCommitteeBitsVal() bitfield.Bitfield + GetSignature() []byte +} + +type AttesterSlashing interface { + proto.Message + ssz.Marshaler + ssz.Unmarshaler + ssz.HashRoot + Version() int + GetFirstAttestation() ethpb.IndexedAtt + GetSecondAttestation() ethpb.IndexedAtt +} + +// TODO: this is ugly. The proper way to do this is to create a Copy() function on the interface and implement it. But this results in a circular dependency. +// CopyAttestation copies the provided attestation object. +func CopyAttestation(att Attestation) Attestation { + a, ok := att.(*ethpb.Attestation) + if ok { + return ethpb.CopyAttestation(a) + } + ae, ok := att.(*ethpb.AttestationElectra) + if ok { + return ethpb.CopyAttestationElectra(ae) + } + return nil } diff --git a/consensus-types/mock/block.go b/consensus-types/mock/block.go index f567ed6b3a2c..452c8720d55f 100644 --- a/consensus-types/mock/block.go +++ b/consensus-types/mock/block.go @@ -224,7 +224,7 @@ func (BeaconBlockBody) ProposerSlashings() []*eth.ProposerSlashing { panic("implement me") } -func (BeaconBlockBody) AttesterSlashings() []*eth.AttesterSlashing { +func (BeaconBlockBody) AttesterSlashings() []interfaces.AttesterSlashing { panic("implement me") } @@ -280,7 +280,7 @@ func (b *BeaconBlockBody) SetProposerSlashings([]*eth.ProposerSlashing) { panic("implement me") } -func (b *BeaconBlockBody) SetAttesterSlashings([]*eth.AttesterSlashing) { +func (b *BeaconBlockBody) SetAttesterSlashings([]interfaces.AttesterSlashing) { panic("implement me") } @@ -313,7 +313,11 @@ func (b *BeaconBlockBody) BlobKzgCommitments() ([][]byte, error) { panic("implement me") } -func (b *BeaconBlockBody) Attestations() []*eth.Attestation { +func (b *BeaconBlockBody) Attestations() []interfaces.Attestation { + panic("implement me") +} + +func (b *BeaconBlockBody) Consolidations() ([]*eth.SignedConsolidation, error) { panic("implement me") } diff --git a/encoding/ssz/htrutils_test.go b/encoding/ssz/htrutils_test.go index a49f63932f75..50717fa8afcf 100644 --- a/encoding/ssz/htrutils_test.go +++ b/encoding/ssz/htrutils_test.go @@ -288,7 +288,7 @@ func TestDepositReceiptSliceRoot(t *testing.T) { limit uint64 want [32]byte }{ - { + { name: "empty", input: make([]*enginev1.DepositReceipt, 0), want: [32]byte{0xf5, 0xa5, 0xfd, 0x42, 0xd1, 0x6a, 0x20, 0x30, 0x27, 0x98, 0xef, 0x6e, 0xd3, 0x9, 0x97, 0x9b, 0x43, 0x0, 0x3d, 0x23, 0x20, 0xd9, 0xf0, 0xe8, 0xea, 0x98, 0x31, 0xa9, 0x27, 0x59, 0xfb, 0x4b}, @@ -297,15 +297,15 @@ func TestDepositReceiptSliceRoot(t *testing.T) { name: "non-empty", input: []*enginev1.DepositReceipt{ { - Pubkey: bytesutil.PadTo([]byte{0x01, 0x02}, 48), + Pubkey: bytesutil.PadTo([]byte{0x01, 0x02}, 48), WithdrawalCredentials: bytesutil.PadTo([]byte{0x03, 0x04}, 32), - Amount: 5, - Signature: bytesutil.PadTo([]byte{0x06, 0x07}, 96), - Index: 8, + Amount: 5, + Signature: bytesutil.PadTo([]byte{0x06, 0x07}, 96), + Index: 8, }, }, limit: 16, - want: [32]byte{0x34, 0xe3, 0x76, 0x5, 0xe5, 0x12, 0xe4, 0x75, 0x14, 0xf6, 0x72, 0x1c, 0x56, 0x5a, 0xa7, 0xf8, 0x8d, 0xaf, 0x84, 0xb7, 0xd7, 0x3e, 0xe6, 0x5f, 0x3f, 0xb1, 0x9f, 0x41, 0xf0, 0x10, 0x2b, 0xe6}, + want: [32]byte{0x34, 0xe3, 0x76, 0x5, 0xe5, 0x12, 0xe4, 0x75, 0x14, 0xf6, 0x72, 0x1c, 0x56, 0x5a, 0xa7, 0xf8, 0x8d, 0xaf, 0x84, 0xb7, 0xd7, 0x3e, 0xe6, 0x5f, 0x3f, 0xb1, 0x9f, 0x41, 0xf0, 0x10, 0x2b, 0xe6}, }, } @@ -334,13 +334,13 @@ func TestWithdrawalRequestSliceRoot(t *testing.T) { name: "non-empty", input: []*enginev1.ExecutionLayerWithdrawalRequest{ { - SourceAddress: bytesutil.PadTo([]byte{0x01, 0x02}, 20), + SourceAddress: bytesutil.PadTo([]byte{0x01, 0x02}, 20), ValidatorPubkey: bytesutil.PadTo([]byte{0x03, 0x04}, 48), - Amount: 5, + Amount: 5, }, }, limit: 16, - want: [32]byte{0xa8, 0xab, 0xb2, 0x20, 0xe6, 0xd6, 0x5a, 0x7e, 0x56, 0x60, 0xe4, 0x9d, 0xae, 0x36, 0x17, 0x3d, 0x8b, 0xd, 0xde, 0x28, 0x96, 0x5, 0x82, 0x72, 0x18, 0xda, 0xc7, 0x5a, 0x53, 0xe0, 0x35, 0xf7}, + want: [32]byte{0xa8, 0xab, 0xb2, 0x20, 0xe6, 0xd6, 0x5a, 0x7e, 0x56, 0x60, 0xe4, 0x9d, 0xae, 0x36, 0x17, 0x3d, 0x8b, 0xd, 0xde, 0x28, 0x96, 0x5, 0x82, 0x72, 0x18, 0xda, 0xc7, 0x5a, 0x53, 0xe0, 0x35, 0xf7}, }, } diff --git a/go.mod b/go.mod index 6bdc52d05f11..6bcb6ea70560 100644 --- a/go.mod +++ b/go.mod @@ -27,6 +27,7 @@ require ( github.com/golang/gddo v0.0.0-20200528160355-8d077c1d8f4c github.com/golang/protobuf v1.5.3 github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb + github.com/google/go-cmp v0.6.0 github.com/google/gofuzz v1.2.0 github.com/google/uuid v1.4.0 github.com/gorilla/mux v1.8.0 @@ -146,7 +147,6 @@ require ( github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect - github.com/google/go-cmp v0.6.0 // indirect github.com/google/gopacket v1.1.19 // indirect github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 // indirect github.com/gorilla/websocket v1.5.1 // indirect diff --git a/proto/engine/v1/generated.ssz.go b/proto/engine/v1/generated.ssz.go index 2b122719efa9..9022df00bdf5 100644 --- a/proto/engine/v1/generated.ssz.go +++ b/proto/engine/v1/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: ee70c11ffb08b4e0b97fe19fdfdf1ce59c1474de33166d21d4fbd2f696c267ea +// Hash: 88fdbdfda4571603e11174a57e65c25e06780ff2cbd795c8ae2a4709da24d9a9 package enginev1 import ( diff --git a/proto/eth/v1/generated.ssz.go b/proto/eth/v1/generated.ssz.go index 3603865f6075..d6f69e0a83a6 100644 --- a/proto/eth/v1/generated.ssz.go +++ b/proto/eth/v1/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 13c946aa898cca1afa84687b619bc5a10fc79a46340e98dcfb07dde835d39a0c +// Hash: 6fed60156f1e57926b40b972ee25b48a82b18726a9c64fb0e974e4f638784049 package v1 import ( diff --git a/proto/eth/v2/generated.ssz.go b/proto/eth/v2/generated.ssz.go index 68ff620f25be..2674eea802fb 100644 --- a/proto/eth/v2/generated.ssz.go +++ b/proto/eth/v2/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 6b214399116c0ca31026da23db2b85fccd78e16d7b9113c83b4a9ee4e60977f6 +// Hash: 36d05ceafa355d5aa87123eb218143987a79f5095e2cafbad7760712ad0934a3 package eth import ( diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index a0a18f2cb944..3e8f57833cf5 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -205,6 +205,7 @@ go_proto_library( go_library( name = "go_default_library", srcs = [ + "attestation.go", "cloners.go", "eip_7251.go", "sync_committee_mainnet.go", @@ -220,6 +221,7 @@ go_library( "//encoding/bytesutil:go_default_library", "//proto/engine/v1:go_default_library", "//proto/eth/ext:go_default_library", + "//runtime/version:go_default_library", "@com_github_golang_protobuf//proto:go_default_library", "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto", "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", diff --git a/proto/prysm/v1alpha1/attestation.go b/proto/prysm/v1alpha1/attestation.go index b11c70e5db75..2af00e0872d8 100644 --- a/proto/prysm/v1alpha1/attestation.go +++ b/proto/prysm/v1alpha1/attestation.go @@ -1 +1,81 @@ package eth + +import ( + ssz "github.com/prysmaticlabs/fastssz" + "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/runtime/version" + "google.golang.org/protobuf/proto" +) + +// TODO: it would be nicer to declare this inside consensus-types, but this will result in a circular dependency +// (because the interface method returns another interface, the implementation also returns an interface) +type IndexedAtt interface { + proto.Message + ssz.Marshaler + ssz.Unmarshaler + ssz.HashRoot + Version() int + GetAttestingIndices() []uint64 + GetData() *AttestationData + GetSignature() []byte +} + +func (a *Attestation) Version() int { + return version.Phase0 +} + +func (a *Attestation) GetCommitteeBitsVal() bitfield.Bitfield { + return nil +} + +func (a *PendingAttestation) Version() int { + return version.Phase0 +} + +func (a *PendingAttestation) GetCommitteeBitsVal() bitfield.Bitfield { + return nil +} + +func (a *PendingAttestation) GetSignature() []byte { + return nil +} + +func (a *AttestationElectra) Version() int { + return version.Electra +} + +func (a *AttestationElectra) GetCommitteeBitsVal() bitfield.Bitfield { + return a.CommitteeBits +} + +func (a *IndexedAttestation) Version() int { + return version.Phase0 +} + +func (a *IndexedAttestationElectra) Version() int { + return version.Electra +} + +func (a *AttesterSlashing) Version() int { + return version.Phase0 +} + +func (a *AttesterSlashing) GetFirstAttestation() IndexedAtt { + return a.Attestation_1 +} + +func (a *AttesterSlashing) GetSecondAttestation() IndexedAtt { + return a.Attestation_2 +} + +func (a *AttesterSlashingElectra) Version() int { + return version.Electra +} + +func (a *AttesterSlashingElectra) GetFirstAttestation() IndexedAtt { + return a.Attestation_1 +} + +func (a *AttesterSlashingElectra) GetSecondAttestation() IndexedAtt { + return a.Attestation_2 +} diff --git a/proto/prysm/v1alpha1/attestation/BUILD.bazel b/proto/prysm/v1alpha1/attestation/BUILD.bazel index 33febb0f4cbc..9c45df7466c1 100644 --- a/proto/prysm/v1alpha1/attestation/BUILD.bazel +++ b/proto/prysm/v1alpha1/attestation/BUILD.bazel @@ -8,6 +8,7 @@ go_library( deps = [ "//beacon-chain/core/signing:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/proto/prysm/v1alpha1/attestation/aggregation/attestations/BUILD.bazel b/proto/prysm/v1alpha1/attestation/aggregation/attestations/BUILD.bazel index 1a537f2da053..53fe85d02514 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/attestations/BUILD.bazel +++ b/proto/prysm/v1alpha1/attestation/aggregation/attestations/BUILD.bazel @@ -9,6 +9,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/attestations", visibility = ["//visibility:public"], deps = [ + "//consensus-types/interfaces:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/attestation/aggregation:go_default_library", @@ -27,6 +28,7 @@ go_test( embed = [":go_default_library"], deps = [ "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//crypto/bls:go_default_library", "//encoding/ssz/equality:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations.go b/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations.go index 7d77655744ff..c7dc7542b0b7 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations.go +++ b/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations.go @@ -2,6 +2,7 @@ package attestations import ( "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation" @@ -9,7 +10,7 @@ import ( ) // attList represents list of attestations, defined for easier en masse operations (filtering, sorting). -type attList []*ethpb.Attestation +type attList []interfaces.Attestation // BLS aggregate signature aliases for testing / benchmark substitution. These methods are // significantly more expensive than the inner logic of AggregateAttestations so they must be @@ -32,25 +33,25 @@ var ErrInvalidAttestationCount = errors.New("invalid number of attestations") // clonedAtts[i] = stateTrie.CopyAttestation(a) // } // aggregatedAtts, err := attaggregation.Aggregate(clonedAtts) -func Aggregate(atts []*ethpb.Attestation) ([]*ethpb.Attestation, error) { +func Aggregate(atts []interfaces.Attestation) ([]interfaces.Attestation, error) { return MaxCoverAttestationAggregation(atts) } // AggregateDisjointOneBitAtts aggregates unaggregated attestations with the // exact same attestation data. -func AggregateDisjointOneBitAtts(atts []*ethpb.Attestation) (*ethpb.Attestation, error) { +func AggregateDisjointOneBitAtts(atts []interfaces.Attestation) (interfaces.Attestation, error) { if len(atts) == 0 { return nil, nil } if len(atts) == 1 { return atts[0], nil } - coverage, err := atts[0].AggregationBits.ToBitlist64() + coverage, err := atts[0].GetAggregationBits().ToBitlist64() if err != nil { return nil, errors.Wrap(err, "could not get aggregation bits") } for _, att := range atts[1:] { - bits, err := att.AggregationBits.ToBitlist64() + bits, err := att.GetAggregationBits().ToBitlist64() if err != nil { return nil, errors.Wrap(err, "could not get aggregation bits") } diff --git a/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations_test.go b/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations_test.go index 08b51ad09af8..13d1d277c686 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations_test.go +++ b/proto/prysm/v1alpha1/attestation/aggregation/attestations/attestations_test.go @@ -215,14 +215,14 @@ func TestAggregateAttestations_Aggregate(t *testing.T) { } require.NoError(t, err) sort.Slice(got, func(i, j int) bool { - return got[i].AggregationBits.Bytes()[0] < got[j].AggregationBits.Bytes()[0] + return got[i].GetAggregationBits().Bytes()[0] < got[j].GetAggregationBits().Bytes()[0] }) sort.Slice(tt.want, func(i, j int) bool { return tt.want[i].Bytes()[0] < tt.want[j].Bytes()[0] }) assert.Equal(t, len(tt.want), len(got)) for i, w := range tt.want { - assert.DeepEqual(t, w.Bytes(), got[i].AggregationBits.Bytes()) + assert.DeepEqual(t, w.Bytes(), got[i].GetAggregationBits().Bytes()) } } t.Run(tt.name, func(t *testing.T) { @@ -259,7 +259,7 @@ func TestAggregateAttestations_Aggregate(t *testing.T) { assert.NoError(t, err) assert.Equal(t, len(want), len(got)) for i, w := range want { - assert.DeepEqual(t, w.Bytes(), got[i].AggregationBits.Bytes()) + assert.DeepEqual(t, w.Bytes(), got[i].GetAggregationBits().Bytes()) } }) } diff --git a/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go b/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go index 36061552b7ac..a59b835ff285 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go +++ b/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover.go @@ -5,6 +5,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation" @@ -14,7 +15,7 @@ import ( // Aggregation occurs in many rounds, up until no more aggregation is possible (all attestations // are overlapping). // See https://hackmd.io/@farazdagi/in-place-attagg for design and rationale. -func MaxCoverAttestationAggregation(atts []*ethpb.Attestation) ([]*ethpb.Attestation, error) { +func MaxCoverAttestationAggregation(atts []interfaces.Attestation) ([]interfaces.Attestation, error) { if len(atts) < 2 { return atts, nil } @@ -28,7 +29,7 @@ func MaxCoverAttestationAggregation(atts []*ethpb.Attestation) ([]*ethpb.Attesta candidates := make([]*bitfield.Bitlist64, len(atts)) for i := 0; i < len(atts); i++ { var err error - candidates[i], err = atts[i].AggregationBits.ToBitlist64() + candidates[i], err = atts[i].GetAggregationBits().ToBitlist64() if err != nil { return nil, err } @@ -126,7 +127,7 @@ func (al attList) aggregate(coverage bitfield.Bitlist) (*ethpb.Attestation, erro } signs := make([]bls.Signature, len(al)) for i := 0; i < len(al); i++ { - sig, err := signatureFromBytes(al[i].Signature) + sig, err := signatureFromBytes(al[i].GetSignature()) if err != nil { return nil, err } @@ -134,7 +135,7 @@ func (al attList) aggregate(coverage bitfield.Bitlist) (*ethpb.Attestation, erro } return ðpb.Attestation{ AggregationBits: coverage, - Data: ethpb.CopyAttestationData(al[0].Data), + Data: ethpb.CopyAttestationData(al[0].GetData()), Signature: aggregateSignatures(signs).Marshal(), }, nil } @@ -149,7 +150,7 @@ func padSelectedKeys(keys []int, pad int) []int { // aggregateAttestations combines signatures of selected attestations into a single aggregate attestation, and // pushes that aggregated attestation into the position of the first of selected attestations. -func aggregateAttestations(atts []*ethpb.Attestation, keys []int, coverage *bitfield.Bitlist64) (targetIdx int, err error) { +func aggregateAttestations(atts []interfaces.Attestation, keys []int, coverage *bitfield.Bitlist64) (targetIdx int, err error) { if len(keys) < 2 || atts == nil || len(atts) < 2 { return targetIdx, errors.Wrap(ErrInvalidAttestationCount, "cannot aggregate") } @@ -160,13 +161,13 @@ func aggregateAttestations(atts []*ethpb.Attestation, keys []int, coverage *bitf var data *ethpb.AttestationData signs := make([]bls.Signature, 0, len(keys)) for i, idx := range keys { - sig, err := signatureFromBytes(atts[idx].Signature) + sig, err := signatureFromBytes(atts[idx].GetSignature()) if err != nil { return targetIdx, err } signs = append(signs, sig) if i == 0 { - data = ethpb.CopyAttestationData(atts[idx].Data) + data = ethpb.CopyAttestationData(atts[idx].GetData()) targetIdx = idx } } @@ -183,7 +184,7 @@ func aggregateAttestations(atts []*ethpb.Attestation, keys []int, coverage *bitf // rearrangeProcessedAttestations pushes processed attestations to the end of the slice, returning // the number of items re-arranged (so that caller can cut the slice, and allow processed items to be // garbage collected). -func rearrangeProcessedAttestations(atts []*ethpb.Attestation, candidates []*bitfield.Bitlist64, processedKeys []int) { +func rearrangeProcessedAttestations(atts []interfaces.Attestation, candidates []*bitfield.Bitlist64, processedKeys []int) { if atts == nil || candidates == nil || processedKeys == nil { return } @@ -215,7 +216,7 @@ func (al attList) merge(al1 attList) attList { // selectUsingKeys returns only items with specified keys. func (al attList) selectUsingKeys(keys []int) attList { - filtered := make([]*ethpb.Attestation, len(keys)) + filtered := make([]interfaces.Attestation, len(keys)) for i, key := range keys { filtered[i] = al[key] } @@ -246,7 +247,7 @@ func (al attList) selectComplementUsingKeys(keys []int) attList { // hasCoverage returns true if a given coverage is found in attestations list. func (al attList) hasCoverage(coverage bitfield.Bitlist) (bool, error) { for _, att := range al { - x, err := att.AggregationBits.Xor(coverage) + x, err := att.GetAggregationBits().Xor(coverage) if err != nil { return false, err } @@ -263,12 +264,12 @@ func (al attList) filterContained() (attList, error) { return al, nil } sort.Slice(al, func(i, j int) bool { - return al[i].AggregationBits.Count() > al[j].AggregationBits.Count() + return al[i].GetAggregationBits().Count() > al[j].GetAggregationBits().Count() }) filtered := al[:0] filtered = append(filtered, al[0]) for i := 1; i < len(al); i++ { - c, err := filtered[len(filtered)-1].AggregationBits.Contains(al[i].AggregationBits) + c, err := filtered[len(filtered)-1].GetAggregationBits().Contains(al[i].GetAggregationBits()) if err != nil { return nil, err } @@ -288,11 +289,11 @@ func (al attList) validate() error { if len(al) == 0 { return errors.Wrap(aggregation.ErrInvalidMaxCoverProblem, "empty list") } - if al[0].AggregationBits == nil || al[0].AggregationBits.Len() == 0 { + if al[0].GetAggregationBits() == nil || al[0].GetAggregationBits().Len() == 0 { return errors.Wrap(aggregation.ErrInvalidMaxCoverProblem, "bitlist cannot be nil or empty") } for i := 1; i < len(al); i++ { - if al[i].AggregationBits == nil || al[i].AggregationBits.Len() == 0 { + if al[i].GetAggregationBits() == nil || al[i].GetAggregationBits().Len() == 0 { return errors.Wrap(aggregation.ErrInvalidMaxCoverProblem, "bitlist cannot be nil or empty") } } diff --git a/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover_test.go b/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover_test.go index de9c607eaa4d..638c85ded6b1 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover_test.go +++ b/proto/prysm/v1alpha1/attestation/aggregation/attestations/maxcover_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation" @@ -144,138 +145,138 @@ func TestAggregateAttestations_MaxCover_AttList_validate(t *testing.T) { func TestAggregateAttestations_rearrangeProcessedAttestations(t *testing.T) { tests := []struct { name string - atts []*ethpb.Attestation + atts []interfaces.Attestation keys []int - wantAtts []*ethpb.Attestation + wantAtts []interfaces.Attestation }{ { name: "nil attestations", }, { name: "single attestation no processed keys", - atts: []*ethpb.Attestation{ - {}, + atts: []interfaces.Attestation{ + ðpb.Attestation{}, }, - wantAtts: []*ethpb.Attestation{ - {}, + wantAtts: []interfaces.Attestation{ + ðpb.Attestation{}, }, }, { name: "single attestation processed", - atts: []*ethpb.Attestation{ - {}, + atts: []interfaces.Attestation{ + ðpb.Attestation{}, }, keys: []int{0}, - wantAtts: []*ethpb.Attestation{ + wantAtts: []interfaces.Attestation{ nil, }, }, { name: "multiple processed, last attestation marked", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, - {AggregationBits: bitfield.Bitlist{0x02}}, - {AggregationBits: bitfield.Bitlist{0x03}}, - {AggregationBits: bitfield.Bitlist{0x04}}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, }, keys: []int{1, 4}, // Only attestation at index 1, should be moved, att at 4 is already at the end. - wantAtts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x03}}, - {AggregationBits: bitfield.Bitlist{0x02}}, + wantAtts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, nil, nil, }, }, { name: "all processed", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, - {AggregationBits: bitfield.Bitlist{0x02}}, - {AggregationBits: bitfield.Bitlist{0x03}}, - {AggregationBits: bitfield.Bitlist{0x04}}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, }, keys: []int{0, 1, 2, 3, 4}, - wantAtts: []*ethpb.Attestation{ + wantAtts: []interfaces.Attestation{ nil, nil, nil, nil, nil, }, }, { name: "operate on slice, single attestation marked", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, - {AggregationBits: bitfield.Bitlist{0x02}}, - {AggregationBits: bitfield.Bitlist{0x03}}, - {AggregationBits: bitfield.Bitlist{0x04}}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, // Assuming some attestations have been already marked as nil, during previous rounds: nil, nil, nil, }, keys: []int{2}, - wantAtts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, - {AggregationBits: bitfield.Bitlist{0x04}}, - {AggregationBits: bitfield.Bitlist{0x03}}, + wantAtts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, nil, nil, nil, nil, }, }, { name: "operate on slice, non-last attestation marked", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, - {AggregationBits: bitfield.Bitlist{0x02}}, - {AggregationBits: bitfield.Bitlist{0x03}}, - {AggregationBits: bitfield.Bitlist{0x04}}, - {AggregationBits: bitfield.Bitlist{0x05}}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x05}}, // Assuming some attestations have been already marked as nil, during previous rounds: nil, nil, nil, }, keys: []int{2, 3}, - wantAtts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, - {AggregationBits: bitfield.Bitlist{0x05}}, - {AggregationBits: bitfield.Bitlist{0x04}}, + wantAtts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x05}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, nil, nil, nil, nil, nil, }, }, { name: "operate on slice, last attestation marked", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, - {AggregationBits: bitfield.Bitlist{0x02}}, - {AggregationBits: bitfield.Bitlist{0x03}}, - {AggregationBits: bitfield.Bitlist{0x04}}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, // Assuming some attestations have been already marked as nil, during previous rounds: nil, nil, nil, }, keys: []int{2, 4}, - wantAtts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, - {AggregationBits: bitfield.Bitlist{0x03}}, + wantAtts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, nil, nil, nil, nil, nil, }, }, { name: "many items, many selected, keys unsorted", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, - {AggregationBits: bitfield.Bitlist{0x02}}, - {AggregationBits: bitfield.Bitlist{0x03}}, - {AggregationBits: bitfield.Bitlist{0x04}}, - {AggregationBits: bitfield.Bitlist{0x05}}, - {AggregationBits: bitfield.Bitlist{0x06}}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x02}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x04}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x05}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x06}}, }, keys: []int{4, 1, 2, 5, 6}, - wantAtts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x03}}, + wantAtts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x03}}, nil, nil, nil, nil, nil, }, }, @@ -286,7 +287,7 @@ func TestAggregateAttestations_rearrangeProcessedAttestations(t *testing.T) { for i := 0; i < len(tt.atts); i++ { if tt.atts[i] != nil { var err error - candidates[i], err = tt.atts[i].AggregationBits.ToBitlist64() + candidates[i], err = tt.atts[i].GetAggregationBits().ToBitlist64() if err != nil { t.Error(err) } @@ -302,8 +303,8 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { sign := bls.NewAggregateSignature().Marshal() tests := []struct { name string - atts []*ethpb.Attestation - wantAtts []*ethpb.Attestation + atts []interfaces.Attestation + wantAtts []interfaces.Attestation keys []int coverage *bitfield.Bitlist64 wantTargetIdx int @@ -317,8 +318,8 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { }, { name: "single attestation", - atts: []*ethpb.Attestation{ - {}, + atts: []interfaces.Attestation{ + ðpb.Attestation{}, }, wantTargetIdx: 0, wantErr: ErrInvalidAttestationCount.Error(), @@ -331,9 +332,9 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { }, { name: "two attestations, none selected", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, }, wantTargetIdx: 0, wantErr: ErrInvalidAttestationCount.Error(), @@ -341,9 +342,9 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { }, { name: "two attestations, one selected", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x00}}, - {AggregationBits: bitfield.Bitlist{0x01}}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x00}}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x01}}, }, wantTargetIdx: 0, wantErr: ErrInvalidAttestationCount.Error(), @@ -351,13 +352,13 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { }, { name: "two attestations, both selected, empty coverage", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0b00000001, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0b00000110, 0b1}, Signature: sign}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b00000001, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b00000110, 0b1}, Signature: sign}, }, - wantAtts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0b00000111, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0b00000110, 0b1}, Signature: sign}, + wantAtts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b00000111, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0b00000110, 0b1}, Signature: sign}, }, wantTargetIdx: 0, wantErr: "invalid or empty coverage", @@ -365,13 +366,13 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { }, { name: "two attestations, both selected", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000001, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000010, 0b1}, Signature: sign}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000001, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000010, 0b1}, Signature: sign}, }, - wantAtts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000011, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000010, 0b1}, Signature: sign}, + wantAtts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000011, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000010, 0b1}, Signature: sign}, }, wantTargetIdx: 0, keys: []int{0, 1}, @@ -385,21 +386,21 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { }, { name: "many attestations, several selected", - atts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000001, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000010, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000100, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00001000, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00010000, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00100000, 0b1}, Signature: sign}, - }, - wantAtts: []*ethpb.Attestation{ - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000001, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00010110, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000100, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00001000, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00010000, 0b1}, Signature: sign}, - {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00100000, 0b1}, Signature: sign}, + atts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000001, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000010, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000100, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00001000, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00010000, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00100000, 0b1}, Signature: sign}, + }, + wantAtts: []interfaces.Attestation{ + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000001, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00010110, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000100, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00001000, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00010000, 0b1}, Signature: sign}, + ðpb.Attestation{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00100000, 0b1}, Signature: sign}, }, wantTargetIdx: 1, keys: []int{1, 2, 4}, @@ -422,10 +423,10 @@ func TestAggregateAttestations_aggregateAttestations(t *testing.T) { assert.NoError(t, err) } assert.Equal(t, tt.wantTargetIdx, gotTargetIdx) - extractBitlists := func(atts []*ethpb.Attestation) []bitfield.Bitlist { + extractBitlists := func(atts []interfaces.Attestation) []bitfield.Bitlist { bl := make([]bitfield.Bitlist, len(atts)) for i, att := range atts { - bl[i] = att.AggregationBits + bl[i] = att.GetAggregationBits() } return bl } diff --git a/proto/prysm/v1alpha1/attestation/aggregation/testing/BUILD.bazel b/proto/prysm/v1alpha1/attestation/aggregation/testing/BUILD.bazel index 220bbe96bfba..c1e4ddcb0bb6 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/testing/BUILD.bazel +++ b/proto/prysm/v1alpha1/attestation/aggregation/testing/BUILD.bazel @@ -7,6 +7,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation/aggregation/testing", visibility = ["//visibility:public"], deps = [ + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//proto/prysm/v1alpha1:go_default_library", diff --git a/proto/prysm/v1alpha1/attestation/aggregation/testing/bitlistutils.go b/proto/prysm/v1alpha1/attestation/aggregation/testing/bitlistutils.go index 7e17c3e2c2df..c8510b5186c8 100644 --- a/proto/prysm/v1alpha1/attestation/aggregation/testing/bitlistutils.go +++ b/proto/prysm/v1alpha1/attestation/aggregation/testing/bitlistutils.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/prysmaticlabs/go-bitfield" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -77,8 +78,8 @@ func Bitlists64WithMultipleBitSet(t testing.TB, n, length, count uint64) []*bitf } // MakeAttestationsFromBitlists creates list of attestations from list of bitlist. -func MakeAttestationsFromBitlists(bl []bitfield.Bitlist) []*ethpb.Attestation { - atts := make([]*ethpb.Attestation, len(bl)) +func MakeAttestationsFromBitlists(bl []bitfield.Bitlist) []interfaces.Attestation { + atts := make([]interfaces.Attestation, len(bl)) for i, b := range bl { atts[i] = ðpb.Attestation{ AggregationBits: b, diff --git a/proto/prysm/v1alpha1/attestation/attestation_utils.go b/proto/prysm/v1alpha1/attestation/attestation_utils.go index 77bdfb55ca49..bfa2bf64aa92 100644 --- a/proto/prysm/v1alpha1/attestation/attestation_utils.go +++ b/proto/prysm/v1alpha1/attestation/attestation_utils.go @@ -12,6 +12,7 @@ import ( "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -37,8 +38,8 @@ import ( // data=attestation.data, // signature=attestation.signature, // ) -func ConvertToIndexed(ctx context.Context, attestation *ethpb.Attestation, committee []primitives.ValidatorIndex) (*ethpb.IndexedAttestation, error) { - attIndices, err := AttestingIndices(attestation.AggregationBits, committee) +func ConvertToIndexed(ctx context.Context, attestation interfaces.Attestation, committee []primitives.ValidatorIndex) (ethpb.IndexedAtt, error) { + attIndices, err := AttestingIndices(attestation.GetAggregationBits(), committee) if err != nil { return nil, err } @@ -47,8 +48,8 @@ func ConvertToIndexed(ctx context.Context, attestation *ethpb.Attestation, commi return attIndices[i] < attIndices[j] }) inAtt := ðpb.IndexedAttestation{ - Data: attestation.Data, - Signature: attestation.Signature, + Data: attestation.GetData(), + Signature: attestation.GetSignature(), AttestingIndices: attIndices, } return inAtt, err @@ -101,17 +102,17 @@ func AttestingIndices(bf bitfield.Bitfield, committee []primitives.ValidatorInde // domain = get_domain(state, DOMAIN_BEACON_ATTESTER, indexed_attestation.data.target.epoch) // signing_root = compute_signing_root(indexed_attestation.data, domain) // return bls.FastAggregateVerify(pubkeys, signing_root, indexed_attestation.signature) -func VerifyIndexedAttestationSig(ctx context.Context, indexedAtt *ethpb.IndexedAttestation, pubKeys []bls.PublicKey, domain []byte) error { +func VerifyIndexedAttestationSig(ctx context.Context, indexedAtt ethpb.IndexedAtt, pubKeys []bls.PublicKey, domain []byte) error { _, span := trace.StartSpan(ctx, "attestationutil.VerifyIndexedAttestationSig") defer span.End() - indices := indexedAtt.AttestingIndices + indices := indexedAtt.GetAttestingIndices() - messageHash, err := signing.ComputeSigningRoot(indexedAtt.Data, domain) + messageHash, err := signing.ComputeSigningRoot(indexedAtt.GetData(), domain) if err != nil { return errors.Wrap(err, "could not get signing root of object") } - sig, err := bls.SignatureFromBytes(indexedAtt.Signature) + sig, err := bls.SignatureFromBytes(indexedAtt.GetSignature()) if err != nil { return errors.Wrap(err, "could not convert bytes to signature") } @@ -142,14 +143,17 @@ func VerifyIndexedAttestationSig(ctx context.Context, indexedAtt *ethpb.IndexedA // domain = get_domain(state, DOMAIN_BEACON_ATTESTER, indexed_attestation.data.target.epoch) // signing_root = compute_signing_root(indexed_attestation.data, domain) // return bls.FastAggregateVerify(pubkeys, signing_root, indexed_attestation.signature) -func IsValidAttestationIndices(ctx context.Context, indexedAttestation *ethpb.IndexedAttestation) error { +func IsValidAttestationIndices(ctx context.Context, indexedAttestation ethpb.IndexedAtt) error { _, span := trace.StartSpan(ctx, "attestationutil.IsValidAttestationIndices") defer span.End() - if indexedAttestation == nil || indexedAttestation.Data == nil || indexedAttestation.Data.Target == nil || indexedAttestation.AttestingIndices == nil { + if indexedAttestation == nil || + indexedAttestation.GetData() == nil || + indexedAttestation.GetData().Target == nil || + indexedAttestation.GetAttestingIndices() == nil { return errors.New("nil or missing indexed attestation data") } - indices := indexedAttestation.AttestingIndices + indices := indexedAttestation.GetAttestingIndices() if len(indices) == 0 { return errors.New("expected non-empty attesting indices") } diff --git a/proto/prysm/v1alpha1/beacon_chain.pb.go b/proto/prysm/v1alpha1/beacon_chain.pb.go index 0261708da029..b753957c7c6a 100755 --- a/proto/prysm/v1alpha1/beacon_chain.pb.go +++ b/proto/prysm/v1alpha1/beacon_chain.pb.go @@ -554,6 +554,8 @@ type BeaconBlockContainer struct { // *BeaconBlockContainer_BlindedCapellaBlock // *BeaconBlockContainer_DenebBlock // *BeaconBlockContainer_BlindedDenebBlock + // *BeaconBlockContainer_ElectraBlock + // *BeaconBlockContainer_BlindedElectraBlock Block isBeaconBlockContainer_Block `protobuf_oneof:"block"` } @@ -666,6 +668,20 @@ func (x *BeaconBlockContainer) GetBlindedDenebBlock() *SignedBlindedBeaconBlockD return nil } +func (x *BeaconBlockContainer) GetElectraBlock() *SignedBeaconBlockElectra { + if x, ok := x.GetBlock().(*BeaconBlockContainer_ElectraBlock); ok { + return x.ElectraBlock + } + return nil +} + +func (x *BeaconBlockContainer) GetBlindedElectraBlock() *SignedBlindedBeaconBlockElectra { + if x, ok := x.GetBlock().(*BeaconBlockContainer_BlindedElectraBlock); ok { + return x.BlindedElectraBlock + } + return nil +} + type isBeaconBlockContainer_Block interface { isBeaconBlockContainer_Block() } @@ -702,6 +718,14 @@ type BeaconBlockContainer_BlindedDenebBlock struct { BlindedDenebBlock *SignedBlindedBeaconBlockDeneb `protobuf:"bytes,10,opt,name=blinded_deneb_block,json=blindedDenebBlock,proto3,oneof"` } +type BeaconBlockContainer_ElectraBlock struct { + ElectraBlock *SignedBeaconBlockElectra `protobuf:"bytes,11,opt,name=electra_block,json=electraBlock,proto3,oneof"` +} + +type BeaconBlockContainer_BlindedElectraBlock struct { + BlindedElectraBlock *SignedBlindedBeaconBlockElectra `protobuf:"bytes,12,opt,name=blinded_electra_block,json=blindedElectraBlock,proto3,oneof"` +} + func (*BeaconBlockContainer_Phase0Block) isBeaconBlockContainer_Block() {} func (*BeaconBlockContainer_AltairBlock) isBeaconBlockContainer_Block() {} @@ -718,6 +742,10 @@ func (*BeaconBlockContainer_DenebBlock) isBeaconBlockContainer_Block() {} func (*BeaconBlockContainer_BlindedDenebBlock) isBeaconBlockContainer_Block() {} +func (*BeaconBlockContainer_ElectraBlock) isBeaconBlockContainer_Block() {} + +func (*BeaconBlockContainer_BlindedElectraBlock) isBeaconBlockContainer_Block() {} + type ChainHead struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3174,7 +3202,7 @@ var file_proto_prysm_v1alpha1_beacon_chain_proto_rawDesc = []byte{ 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xd2, 0x06, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x98, 0x08, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x1c, @@ -3227,408 +3255,146 @@ var file_proto_prysm_v1alpha1_beacon_chain_proto_rawDesc = []byte{ 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x11, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0xb2, 0x09, 0x0a, 0x09, - 0x43, 0x68, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x12, 0x62, 0x0a, 0x09, 0x68, 0x65, 0x61, - 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, - 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, - 0x6c, 0x6f, 0x74, 0x52, 0x08, 0x68, 0x65, 0x61, 0x64, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x65, 0x0a, - 0x0a, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x09, 0x68, 0x65, 0x61, 0x64, 0x45, - 0x70, 0x6f, 0x63, 0x68, 0x12, 0x2e, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x6c, 0x0a, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, - 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, - 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, - 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x53, 0x6c, - 0x6f, 0x74, 0x12, 0x6f, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, - 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, - 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, - 0x6f, 0x63, 0x68, 0x52, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x70, - 0x6f, 0x63, 0x68, 0x12, 0x38, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, - 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, - 0x69, 0x7a, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x6c, 0x0a, - 0x0e, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x6a, 0x75, - 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x6f, 0x0a, 0x0f, 0x6a, - 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x0e, 0x6a, 0x75, - 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x38, 0x0a, 0x14, - 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, - 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x12, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x7d, 0x0a, 0x17, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, - 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x73, 0x6c, 0x6f, - 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, + 0x63, 0x6b, 0x12, 0x56, 0x0a, 0x0d, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x5f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, 0x52, 0x0c, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x72, 0x61, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x6c, 0x0a, 0x15, 0x62, 0x6c, + 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x5f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, + 0x61, 0x48, 0x00, 0x52, 0x13, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x45, 0x6c, 0x65, 0x63, + 0x74, 0x72, 0x61, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x22, 0xb2, 0x09, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x12, + 0x62, 0x0a, 0x09, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, + 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x08, 0x68, 0x65, 0x61, 0x64, 0x53, + 0x6c, 0x6f, 0x74, 0x12, 0x65, 0x0a, 0x0a, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x15, - 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, - 0x64, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x80, 0x01, 0x0a, 0x18, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, - 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, - 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, - 0x52, 0x16, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, - 0x69, 0x65, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x49, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, - 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x1a, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, - 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, - 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, - 0x63, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, - 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x22, 0xa3, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, - 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, - 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, - 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, - 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, - 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xef, 0x04, 0x0a, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, - 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, - 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, - 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x57, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, - 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x14, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x8d, 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x7c, 0x0a, 0x11, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x1a, 0x67, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x55, 0x0a, 0x0a, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, - 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, - 0x73, 0x1a, 0x75, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x2e, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xfc, 0x02, 0x0a, 0x1c, 0x4c, 0x69, 0x73, - 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, - 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, - 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, - 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, - 0x6e, 0x65, 0x73, 0x69, 0x73, 0x12, 0x29, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x6b, 0x65, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, - 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, - 0x12, 0x69, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, - 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, - 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xd2, 0x03, 0x0a, 0x11, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x5c, 0x0a, - 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, - 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, - 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x4c, 0x0a, 0x08, 0x62, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, - 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, - 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, - 0x1a, 0xc9, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0a, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x4b, 0x65, 0x79, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, + 0x09, 0x68, 0x65, 0x61, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x2e, 0x0a, 0x0f, 0x68, 0x65, + 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x68, 0x65, 0x61, + 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x6c, 0x0a, 0x0e, 0x66, 0x69, + 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x62, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x83, 0x03, 0x0a, - 0x15, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, - 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, - 0x69, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, - 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, - 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, - 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, - 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, - 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, - 0x65, 0x73, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x22, 0xb7, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x67, 0x0a, 0x05, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x05, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x48, - 0x00, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x0e, 0x0a, 0x0c, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xcc, 0x03, 0x0a, - 0x0a, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, - 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, + 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x66, 0x69, 0x6e, 0x61, 0x6c, + 0x69, 0x7a, 0x65, 0x64, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x6f, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, + 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, + 0x69, 0x7a, 0x65, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x38, 0x0a, 0x14, 0x66, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, + 0x6f, 0x6f, 0x74, 0x12, 0x6c, 0x0a, 0x0e, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, + 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, + 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, + 0x6f, 0x74, 0x52, 0x0d, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x53, 0x6c, 0x6f, + 0x74, 0x12, 0x6f, 0x0a, 0x0f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, - 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x5b, 0x0a, 0x0e, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, - 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x1a, 0xbb, 0x01, - 0x0a, 0x12, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, - 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x3e, 0x0a, 0x09, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0xb1, 0x01, 0x0a, 0x23, - 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x42, - 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, - 0xc4, 0x06, 0x0a, 0x10, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, - 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x12, 0x3c, 0x0a, 0x15, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x13, 0x61, 0x63, 0x74, - 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, - 0x12, 0x7c, 0x0a, 0x11, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, - 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, - 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x10, 0x61, 0x63, - 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x36, - 0x0a, 0x12, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x6b, 0x65, 0x79, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, - 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x10, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x76, 0x0a, 0x0e, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, - 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, - 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, - 0x0d, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x38, - 0x0a, 0x13, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, - 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x11, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x50, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x78, 0x0a, 0x0f, 0x73, 0x6c, 0x61, 0x73, - 0x68, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, - 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x52, 0x0e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, 0x63, - 0x65, 0x73, 0x12, 0x38, 0x0a, 0x13, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0c, 0x42, - 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x11, 0x65, 0x6a, 0x65, 0x63, 0x74, - 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x78, 0x0a, 0x0f, - 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, - 0x09, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x49, - 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0xad, 0x01, 0x0a, 0x1b, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x02, 0x18, 0x01, 0x52, - 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, 0x07, 0x69, - 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, - 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x07, 0x69, - 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0xc6, 0x06, 0x0a, 0x1c, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x18, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x70, 0x0a, 0x0f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, - 0x6f, 0x6e, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x42, 0x47, - 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x63, 0x68, 0x52, 0x0e, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x12, 0x38, 0x0a, 0x14, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x12, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x7d, 0x0a, 0x17, + 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x64, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, + 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, + 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x15, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, + 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x80, 0x01, 0x0a, 0x18, + 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x64, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, + 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x52, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, - 0x6f, 0x6e, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x78, 0x0a, 0x13, 0x69, 0x6e, 0x63, 0x6c, 0x75, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x52, 0x12, 0x69, - 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, - 0x73, 0x12, 0x34, 0x0a, 0x16, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x5f, 0x76, - 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x08, 0x52, 0x14, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, - 0x64, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x34, 0x0a, 0x16, 0x63, 0x6f, 0x72, 0x72, 0x65, - 0x63, 0x74, 0x6c, 0x79, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x08, 0x52, 0x14, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, - 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x30, 0x0a, - 0x14, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x64, - 0x5f, 0x68, 0x65, 0x61, 0x64, 0x18, 0x06, 0x20, 0x03, 0x28, 0x08, 0x52, 0x12, 0x63, 0x6f, 0x72, - 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x12, - 0x47, 0x0a, 0x20, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x5f, 0x62, 0x65, 0x66, 0x6f, - 0x72, 0x65, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, 0x52, 0x1d, 0x62, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x73, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x45, 0x0a, 0x1f, 0x62, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x73, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x03, 0x28, - 0x04, 0x52, 0x1c, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x41, 0x66, 0x74, 0x65, 0x72, - 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x2d, 0x0a, 0x12, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x11, 0x6d, 0x69, 0x73, - 0x73, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x47, - 0x0a, 0x20, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x02, 0x52, 0x1d, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, - 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x29, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, - 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, - 0x79, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, - 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x04, 0x52, 0x10, 0x69, - 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x22, - 0xc9, 0x03, 0x0a, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x51, 0x75, 0x65, - 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x68, 0x75, 0x72, 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x63, 0x68, 0x75, 0x72, 0x6e, 0x4c, 0x69, - 0x6d, 0x69, 0x74, 0x12, 0x40, 0x0a, 0x16, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x18, 0x01, 0x52, - 0x14, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x34, 0x0a, 0x10, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, - 0x0a, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x18, 0x01, 0x52, 0x0e, 0x65, 0x78, 0x69, - 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x91, 0x01, 0x0a, 0x1c, - 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x52, 0x1a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, - 0x85, 0x01, 0x0a, 0x16, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x04, - 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x16, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, + 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x49, + 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x1a, 0x70, + 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x6f, 0x70, 0x74, + 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xa3, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x42, 0x0e, 0x0a, 0x0c, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xef, 0x04, 0x0a, + 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, + 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, - 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x52, 0x14, 0x65, 0x78, 0x69, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xff, 0x02, 0x0a, 0x1f, - 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, - 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, + 0x57, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x8d, + 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x74, 0x65, 0x6d, + 0x12, 0x7c, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, + 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, + 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x10, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x1a, 0x67, + 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x55, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0a, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x1a, 0x75, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4c, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x74, 0x65, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xfc, + 0x02, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, @@ -3650,415 +3416,689 @@ var file_proto_prysm_v1alpha1_beacon_chain_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0e, 0x0a, - 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xab, 0x07, - 0x0a, 0x14, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, - 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, - 0x70, 0x6f, 0x63, 0x68, 0x12, 0x61, 0x0a, 0x0b, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, - 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, - 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x61, 0x73, 0x73, 0x69, - 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, - 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x1a, 0x8a, - 0x05, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x41, 0x73, 0x73, 0x69, - 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x7c, 0x0a, 0x11, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x52, 0x10, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x65, 0x73, 0x12, 0x78, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, - 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, - 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x6a, - 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0c, 0x61, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x6c, 0x0a, 0x0e, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xd2, 0x03, + 0x0a, 0x11, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x72, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x27, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, - 0x18, 0x02, 0x34, 0x38, 0x18, 0x01, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, - 0x79, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xb2, 0x01, 0x0a, 0x20, - 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, - 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, - 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x12, 0x4c, 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x42, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, + 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, + 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x1a, 0xc9, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x22, 0x83, 0x03, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, + 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, + 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, + 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0c, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, + 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, + 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, + 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xb7, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x67, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, - 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x3a, 0x02, 0x18, 0x01, - 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x22, 0xf5, 0x01, 0x0a, 0x1e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, - 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, - 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x12, - 0x53, 0x0a, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x54, 0x0a, 0x16, 0x41, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, - 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xa8, - 0x01, 0x0a, 0x17, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, - 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0c, 0x61, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, - 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x92, 0x01, 0x0a, 0x0c, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x47, 0x0a, 0x06, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x92, - 0x01, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x78, 0x0a, 0x0f, 0x73, 0x6c, 0x61, - 0x73, 0x68, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x48, 0x00, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0a, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x34, 0x38, 0x48, 0x00, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x22, 0xcc, 0x03, 0x0a, 0x0a, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, + 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, + 0x5b, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6c, 0x69, 0x73, + 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0d, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, + 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, + 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, + 0x69, 0x7a, 0x65, 0x1a, 0xbb, 0x01, 0x0a, 0x12, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x12, 0x3e, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x22, 0xb1, 0x01, 0x0a, 0x23, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, + 0x65, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xc4, 0x06, 0x0a, 0x10, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, + 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3c, 0x0a, 0x15, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, + 0x38, 0x52, 0x13, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x7c, 0x0a, 0x11, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x52, 0x10, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, + 0x69, 0x63, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x12, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, + 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x10, 0x65, 0x78, 0x69, 0x74, + 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x76, 0x0a, 0x0e, + 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, + 0x69, 0x63, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x13, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x5f, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x11, 0x73, 0x6c, 0x61, + 0x73, 0x68, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x78, + 0x0a, 0x0f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, + 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, + 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, + 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, + 0x64, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x13, 0x65, 0x6a, 0x65, 0x63, + 0x74, 0x65, 0x64, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, + 0x08, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, + 0x11, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, + 0x79, 0x73, 0x12, 0x78, 0x0a, 0x0f, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x69, 0x6e, + 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, + 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x65, 0x6a, + 0x65, 0x63, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0xad, 0x01, 0x0a, + 0x1b, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, + 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0b, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0c, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, + 0x73, 0x12, 0x69, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x52, 0x0e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, - 0x63, 0x65, 0x73, 0x22, 0x82, 0x02, 0x0a, 0x16, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, - 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5c, - 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, - 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, + 0x64, 0x65, 0x78, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0xc6, 0x06, 0x0a, + 0x1c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, + 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, + 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x04, 0x52, 0x18, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, + 0x69, 0x76, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x70, 0x0a, 0x0f, 0x69, + 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x52, 0x0e, 0x69, + 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x78, 0x0a, + 0x13, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, + 0x74, 0x18, 0x01, 0x52, 0x12, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x69, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x63, 0x6f, 0x72, 0x72, 0x65, + 0x63, 0x74, 0x6c, 0x79, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x08, 0x52, 0x14, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, + 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x34, 0x0a, + 0x16, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x64, + 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x08, 0x52, 0x14, 0x63, + 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x12, 0x30, 0x0a, 0x14, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, + 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x08, 0x52, 0x12, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x56, 0x6f, 0x74, 0x65, + 0x64, 0x48, 0x65, 0x61, 0x64, 0x12, 0x47, 0x0a, 0x20, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x73, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, 0x52, + 0x1d, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x45, + 0x70, 0x6f, 0x63, 0x68, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x45, + 0x0a, 0x1f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, + 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x08, 0x20, 0x03, 0x28, 0x04, 0x52, 0x1c, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x73, 0x41, 0x66, 0x74, 0x65, 0x72, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, + 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, + 0x0c, 0x52, 0x11, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x73, 0x12, 0x47, 0x0a, 0x20, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x5f, + 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x02, 0x52, 0x1d, + 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x29, 0x0a, + 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x0b, 0x20, 0x03, + 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x52, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x69, 0x6e, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x0c, 0x20, + 0x03, 0x28, 0x04, 0x52, 0x10, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, + 0x63, 0x6f, 0x72, 0x65, 0x73, 0x22, 0xc9, 0x03, 0x0a, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x68, 0x75, 0x72, + 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x63, + 0x68, 0x75, 0x72, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x40, 0x0a, 0x16, 0x61, 0x63, 0x74, + 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, + 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x04, 0x3f, + 0x2c, 0x34, 0x38, 0x18, 0x01, 0x52, 0x14, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x34, 0x0a, 0x10, 0x65, + 0x78, 0x69, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x18, + 0x01, 0x52, 0x0e, 0x65, 0x78, 0x69, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, + 0x73, 0x12, 0x91, 0x01, 0x0a, 0x1c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, + 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x1a, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, + 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x85, 0x01, 0x0a, 0x16, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x14, 0x65, 0x78, 0x69, 0x74, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x02, 0x18, + 0x01, 0x22, 0xff, 0x02, 0x0a, 0x1f, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, + 0x73, 0x12, 0x29, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, + 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, 0x07, + 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, + 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, - 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1f, 0x0a, 0x0b, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0c, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, - 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, - 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, - 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0x9f, 0x0a, 0x0a, 0x16, 0x49, 0x6e, 0x64, - 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x64, 0x12, 0x67, 0x0a, 0x10, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, - 0x6c, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, - 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x2e, 0x49, 0x6e, 0x64, - 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x0f, 0x69, 0x6e, 0x64, - 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x1a, 0x9b, 0x09, 0x0a, - 0x0e, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x12, - 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, - 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1d, 0x0a, - 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x78, 0x0a, 0x0f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x07, + 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, + 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x22, 0xab, 0x07, 0x0a, 0x14, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x5c, 0x0a, 0x05, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, + 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x61, 0x0a, 0x0b, 0x61, 0x73, + 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x3f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x0b, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x26, 0x0a, + 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x53, 0x69, 0x7a, 0x65, 0x1a, 0x8a, 0x05, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x7c, 0x0a, 0x11, + 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, + 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, + 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x10, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, 0x78, 0x0a, 0x0f, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x12, 0x6a, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, + 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, + 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, + 0x6f, 0x74, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x6f, 0x74, + 0x12, 0x6c, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x6c, 0x6f, + 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, + 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x6f, 0x74, 0x73, 0x12, 0x27, + 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x18, 0x01, 0x52, 0x09, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, + 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x22, 0xb2, 0x01, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x73, 0x6c, 0x61, - 0x73, 0x68, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x65, 0x64, 0x12, 0x46, 0x0a, 0x20, 0x69, 0x73, 0x5f, 0x77, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x6e, 0x5f, 0x63, 0x75, 0x72, 0x72, - 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x1c, 0x69, 0x73, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x49, - 0x6e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3a, 0x0a, - 0x1a, 0x69, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x5f, 0x63, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x16, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x43, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3c, 0x0a, 0x1b, 0x69, 0x73, 0x5f, - 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, - 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, - 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, - 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x39, 0x0a, 0x19, 0x69, 0x73, 0x5f, 0x63, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x69, 0x73, 0x43, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x65, 0x72, 0x12, 0x46, 0x0a, 0x20, 0x69, 0x73, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, - 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1c, 0x69, 0x73, - 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x1a, 0x69, 0x73, - 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, - 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, - 0x69, 0x73, 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x21, 0x69, 0x73, 0x5f, 0x70, 0x72, - 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x1d, 0x69, 0x73, 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, - 0x6f, 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, - 0x72, 0x12, 0x44, 0x0a, 0x1f, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, - 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1b, 0x69, 0x73, 0x50, 0x72, - 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x41, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x24, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, - 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, - 0x6f, 0x63, 0x68, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x42, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x47, 0x77, 0x65, 0x69, 0x12, 0x6e, 0x0a, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x04, 0x42, - 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, - 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x52, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, - 0x69, 0x6f, 0x6e, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x12, 0x69, 0x6e, 0x63, 0x6c, 0x75, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x0f, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, + 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, + 0x69, 0x73, 0x3a, 0x02, 0x18, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xf5, 0x01, 0x0a, 0x1e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x6e, 0x61, 0x6c, + 0x69, 0x7a, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x66, 0x69, 0x6e, 0x61, + 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x53, 0x0a, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, + 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, + 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x70, 0x61, 0x72, + 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x54, + 0x0a, 0x16, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, + 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, + 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xa8, 0x01, 0x0a, 0x17, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x46, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, + 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, + 0x92, 0x01, 0x0a, 0x0c, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x47, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0x92, 0x01, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x78, 0x0a, 0x0f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x73, 0x6c, 0x61, 0x73, 0x68, + 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0x82, 0x02, 0x0a, 0x16, 0x49, 0x6e, + 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x52, 0x11, 0x69, 0x6e, - 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, - 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, - 0x6f, 0x72, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x69, 0x6e, 0x61, 0x63, 0x74, - 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x32, 0xa3, 0x16, 0x0a, 0x0b, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x9e, 0x01, 0x0a, 0x10, 0x4c, - 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x61, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xbb, 0x01, 0x0a, 0x17, - 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, + 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0x9f, + 0x0a, 0x0a, 0x16, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x12, 0x67, 0x0a, 0x10, 0x69, 0x6e, 0x64, + 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x69, + 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x64, 0x2e, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, + 0x65, 0x52, 0x0f, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, + 0x65, 0x73, 0x1a, 0x9b, 0x09, 0x0a, 0x0e, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, + 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, + 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, + 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1d, 0x0a, 0x0a, + 0x69, 0x73, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x09, 0x69, 0x73, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x12, 0x46, 0x0a, 0x20, 0x69, + 0x73, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, + 0x6e, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1c, 0x69, 0x73, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, + 0x77, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x6e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x12, 0x3a, 0x0a, 0x1a, 0x69, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x5f, 0x69, 0x6e, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x65, 0x49, 0x6e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, + 0x3c, 0x0a, 0x1b, 0x69, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x5f, + 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, + 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x39, 0x0a, + 0x19, 0x69, 0x73, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x16, 0x69, 0x73, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x46, 0x0a, 0x20, 0x69, 0x73, 0x5f, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x1c, 0x69, 0x73, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, + 0x12, 0x3b, 0x0a, 0x1a, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x69, 0x73, 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x48, 0x0a, + 0x21, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1d, 0x69, 0x73, 0x50, 0x72, 0x65, 0x76, + 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x44, 0x0a, 0x1f, 0x69, 0x73, 0x5f, 0x70, 0x72, + 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, + 0x64, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x1b, 0x69, 0x73, 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, 0x70, 0x6f, 0x63, + 0x68, 0x48, 0x65, 0x61, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x4e, 0x0a, + 0x24, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x65, + 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x5f, 0x67, 0x77, 0x65, 0x69, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x20, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x47, 0x77, 0x65, 0x69, 0x12, 0x6e, 0x0a, + 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, + 0x0e, 0x20, 0x01, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, + 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x52, 0x0d, + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x76, 0x0a, + 0x12, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x04, 0x42, 0x47, 0x82, 0xb5, 0x18, 0x41, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, + 0x18, 0x01, 0x52, 0x11, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0f, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x63, 0x6f, 0x72, 0x65, + 0x32, 0xa3, 0x16, 0x0a, 0x0b, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x69, 0x6e, + 0x12, 0x9e, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x12, 0xa0, 0x01, 0x0a, 0x0f, 0x41, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x2d, 0x2e, + 0x73, 0x12, 0xbb, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, + 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, + 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x12, 0x92, 0x01, 0x0a, - 0x10, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x73, 0x12, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x32, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x73, 0x12, 0x73, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x61, - 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x22, 0x29, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x68, - 0x65, 0x61, 0x64, 0x88, 0x02, 0x01, 0x12, 0x96, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, - 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, - 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, - 0xa1, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, - 0x12, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x73, 0x12, 0x83, 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x12, + 0xa0, 0x01, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x6f, 0x6f, 0x6c, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x65, 0x74, 0x68, + 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x70, 0x6f, + 0x6f, 0x6c, 0x12, 0x92, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x65, 0x74, 0x68, + 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x73, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, + 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x61, + 0x64, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, 0x74, 0x68, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x68, 0x65, 0x61, 0x64, 0x88, 0x02, 0x01, 0x12, 0x96, 0x01, 0x0a, + 0x14, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x73, 0x22, 0x27, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x73, 0x12, 0xa1, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, + 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, - 0x18, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x7d, 0x0a, 0x0c, 0x47, 0x65, 0x74, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, - 0x17, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0xb6, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, - 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x3a, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x31, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x22, 0x29, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, - 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x65, 0x74, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x73, 0x12, 0x7a, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x25, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x51, 0x75, 0x65, 0x75, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, - 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x12, 0xb0, 0x01, - 0x0a, 0x17, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, - 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, - 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, + 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x83, 0x01, 0x0a, 0x0e, 0x4c, 0x69, + 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x2c, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x20, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, + 0x7d, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, + 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x1f, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0xb6, + 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, + 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, + 0x3a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x73, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x65, + 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x65, 0x74, + 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x7a, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x51, 0x75, 0x65, 0x75, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x71, 0x75, + 0x65, 0x75, 0x65, 0x12, 0xb0, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x12, + 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, + 0x12, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x66, 0x6f, + 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x12, 0xad, 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x36, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, + 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, + 0x12, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x69, 0x67, + 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0xbe, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, + 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, - 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x65, 0x74, 0x68, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, - 0x12, 0xad, 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x36, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x65, 0x74, 0x68, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x12, 0xbe, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x65, + 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x02, 0x01, 0x12, 0x73, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x1a, 0x23, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, + 0x1b, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0xa8, 0x01, 0x0a, + 0x16, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, - 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, - 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x02, - 0x01, 0x12, 0x73, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x23, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x65, 0x74, 0x68, 0x2f, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0xa8, 0x01, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x6d, 0x69, - 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x12, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x30, 0x12, 0x2e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x62, 0x6d, 0x69, - 0x74, 0x12, 0xa8, 0x01, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x27, 0x2e, 0x65, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, + 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, + 0x2f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x12, 0xa8, 0x01, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, + 0x6e, 0x67, 0x12, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x1a, 0x2d, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x12, 0xa1, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, + 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, + 0x25, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, + 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x6c, 0x61, - 0x73, 0x68, 0x69, 0x6e, 0x67, 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x75, - 0x62, 0x6d, 0x69, 0x74, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x65, - 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x70, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x12, 0xa1, 0x01, 0x0a, - 0x12, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, - 0x74, 0x65, 0x73, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x69, - 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x69, 0x76, - 0x69, 0x64, 0x75, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x64, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x65, 0x74, 0x68, 0x2f, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x2f, - 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, - 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, - 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4123,11 +4163,13 @@ var file_proto_prysm_v1alpha1_beacon_chain_proto_goTypes = []interface{}{ (*SignedBlindedBeaconBlockCapella)(nil), // 45: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockCapella (*SignedBeaconBlockDeneb)(nil), // 46: ethereum.eth.v1alpha1.SignedBeaconBlockDeneb (*SignedBlindedBeaconBlockDeneb)(nil), // 47: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockDeneb - (*ValidatorParticipation)(nil), // 48: ethereum.eth.v1alpha1.ValidatorParticipation - (*Validator)(nil), // 49: ethereum.eth.v1alpha1.Validator - (*emptypb.Empty)(nil), // 50: google.protobuf.Empty - (*AttesterSlashing)(nil), // 51: ethereum.eth.v1alpha1.AttesterSlashing - (*ProposerSlashing)(nil), // 52: ethereum.eth.v1alpha1.ProposerSlashing + (*SignedBeaconBlockElectra)(nil), // 48: ethereum.eth.v1alpha1.SignedBeaconBlockElectra + (*SignedBlindedBeaconBlockElectra)(nil), // 49: ethereum.eth.v1alpha1.SignedBlindedBeaconBlockElectra + (*ValidatorParticipation)(nil), // 50: ethereum.eth.v1alpha1.ValidatorParticipation + (*Validator)(nil), // 51: ethereum.eth.v1alpha1.Validator + (*emptypb.Empty)(nil), // 52: google.protobuf.Empty + (*AttesterSlashing)(nil), // 53: ethereum.eth.v1alpha1.AttesterSlashing + (*ProposerSlashing)(nil), // 54: ethereum.eth.v1alpha1.ProposerSlashing } var file_proto_prysm_v1alpha1_beacon_chain_proto_depIdxs = []int32{ 38, // 0: ethereum.eth.v1alpha1.ListAttestationsResponse.attestations:type_name -> ethereum.eth.v1alpha1.Attestation @@ -4141,58 +4183,60 @@ var file_proto_prysm_v1alpha1_beacon_chain_proto_depIdxs = []int32{ 45, // 8: ethereum.eth.v1alpha1.BeaconBlockContainer.blinded_capella_block:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockCapella 46, // 9: ethereum.eth.v1alpha1.BeaconBlockContainer.deneb_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockDeneb 47, // 10: ethereum.eth.v1alpha1.BeaconBlockContainer.blinded_deneb_block:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockDeneb - 32, // 11: ethereum.eth.v1alpha1.BeaconCommittees.committees:type_name -> ethereum.eth.v1alpha1.BeaconCommittees.CommitteesEntry - 33, // 12: ethereum.eth.v1alpha1.ValidatorBalances.balances:type_name -> ethereum.eth.v1alpha1.ValidatorBalances.Balance - 34, // 13: ethereum.eth.v1alpha1.Validators.validator_list:type_name -> ethereum.eth.v1alpha1.Validators.ValidatorContainer - 35, // 14: ethereum.eth.v1alpha1.ValidatorAssignments.assignments:type_name -> ethereum.eth.v1alpha1.ValidatorAssignments.CommitteeAssignment - 48, // 15: ethereum.eth.v1alpha1.ValidatorParticipationResponse.participation:type_name -> ethereum.eth.v1alpha1.ValidatorParticipation - 38, // 16: ethereum.eth.v1alpha1.AttestationPoolResponse.attestations:type_name -> ethereum.eth.v1alpha1.Attestation - 36, // 17: ethereum.eth.v1alpha1.BeaconConfig.config:type_name -> ethereum.eth.v1alpha1.BeaconConfig.ConfigEntry - 37, // 18: ethereum.eth.v1alpha1.IndividualVotesRespond.individual_votes:type_name -> ethereum.eth.v1alpha1.IndividualVotesRespond.IndividualVote - 30, // 19: ethereum.eth.v1alpha1.BeaconCommittees.CommitteesList.committees:type_name -> ethereum.eth.v1alpha1.BeaconCommittees.CommitteeItem - 31, // 20: ethereum.eth.v1alpha1.BeaconCommittees.CommitteesEntry.value:type_name -> ethereum.eth.v1alpha1.BeaconCommittees.CommitteesList - 49, // 21: ethereum.eth.v1alpha1.Validators.ValidatorContainer.validator:type_name -> ethereum.eth.v1alpha1.Validator - 1, // 22: ethereum.eth.v1alpha1.BeaconChain.ListAttestations:input_type -> ethereum.eth.v1alpha1.ListAttestationsRequest - 0, // 23: ethereum.eth.v1alpha1.BeaconChain.ListIndexedAttestations:input_type -> ethereum.eth.v1alpha1.ListIndexedAttestationsRequest - 24, // 24: ethereum.eth.v1alpha1.BeaconChain.AttestationPool:input_type -> ethereum.eth.v1alpha1.AttestationPoolRequest - 4, // 25: ethereum.eth.v1alpha1.BeaconChain.ListBeaconBlocks:input_type -> ethereum.eth.v1alpha1.ListBlocksRequest - 50, // 26: ethereum.eth.v1alpha1.BeaconChain.GetChainHead:input_type -> google.protobuf.Empty - 8, // 27: ethereum.eth.v1alpha1.BeaconChain.ListBeaconCommittees:input_type -> ethereum.eth.v1alpha1.ListCommitteesRequest - 10, // 28: ethereum.eth.v1alpha1.BeaconChain.ListValidatorBalances:input_type -> ethereum.eth.v1alpha1.ListValidatorBalancesRequest - 12, // 29: ethereum.eth.v1alpha1.BeaconChain.ListValidators:input_type -> ethereum.eth.v1alpha1.ListValidatorsRequest - 13, // 30: ethereum.eth.v1alpha1.BeaconChain.GetValidator:input_type -> ethereum.eth.v1alpha1.GetValidatorRequest - 15, // 31: ethereum.eth.v1alpha1.BeaconChain.GetValidatorActiveSetChanges:input_type -> ethereum.eth.v1alpha1.GetValidatorActiveSetChangesRequest - 50, // 32: ethereum.eth.v1alpha1.BeaconChain.GetValidatorQueue:input_type -> google.protobuf.Empty - 17, // 33: ethereum.eth.v1alpha1.BeaconChain.GetValidatorPerformance:input_type -> ethereum.eth.v1alpha1.ValidatorPerformanceRequest - 20, // 34: ethereum.eth.v1alpha1.BeaconChain.ListValidatorAssignments:input_type -> ethereum.eth.v1alpha1.ListValidatorAssignmentsRequest - 22, // 35: ethereum.eth.v1alpha1.BeaconChain.GetValidatorParticipation:input_type -> ethereum.eth.v1alpha1.GetValidatorParticipationRequest - 50, // 36: ethereum.eth.v1alpha1.BeaconChain.GetBeaconConfig:input_type -> google.protobuf.Empty - 51, // 37: ethereum.eth.v1alpha1.BeaconChain.SubmitAttesterSlashing:input_type -> ethereum.eth.v1alpha1.AttesterSlashing - 52, // 38: ethereum.eth.v1alpha1.BeaconChain.SubmitProposerSlashing:input_type -> ethereum.eth.v1alpha1.ProposerSlashing - 28, // 39: ethereum.eth.v1alpha1.BeaconChain.GetIndividualVotes:input_type -> ethereum.eth.v1alpha1.IndividualVotesRequest - 2, // 40: ethereum.eth.v1alpha1.BeaconChain.ListAttestations:output_type -> ethereum.eth.v1alpha1.ListAttestationsResponse - 3, // 41: ethereum.eth.v1alpha1.BeaconChain.ListIndexedAttestations:output_type -> ethereum.eth.v1alpha1.ListIndexedAttestationsResponse - 25, // 42: ethereum.eth.v1alpha1.BeaconChain.AttestationPool:output_type -> ethereum.eth.v1alpha1.AttestationPoolResponse - 5, // 43: ethereum.eth.v1alpha1.BeaconChain.ListBeaconBlocks:output_type -> ethereum.eth.v1alpha1.ListBeaconBlocksResponse - 7, // 44: ethereum.eth.v1alpha1.BeaconChain.GetChainHead:output_type -> ethereum.eth.v1alpha1.ChainHead - 9, // 45: ethereum.eth.v1alpha1.BeaconChain.ListBeaconCommittees:output_type -> ethereum.eth.v1alpha1.BeaconCommittees - 11, // 46: ethereum.eth.v1alpha1.BeaconChain.ListValidatorBalances:output_type -> ethereum.eth.v1alpha1.ValidatorBalances - 14, // 47: ethereum.eth.v1alpha1.BeaconChain.ListValidators:output_type -> ethereum.eth.v1alpha1.Validators - 49, // 48: ethereum.eth.v1alpha1.BeaconChain.GetValidator:output_type -> ethereum.eth.v1alpha1.Validator - 16, // 49: ethereum.eth.v1alpha1.BeaconChain.GetValidatorActiveSetChanges:output_type -> ethereum.eth.v1alpha1.ActiveSetChanges - 19, // 50: ethereum.eth.v1alpha1.BeaconChain.GetValidatorQueue:output_type -> ethereum.eth.v1alpha1.ValidatorQueue - 18, // 51: ethereum.eth.v1alpha1.BeaconChain.GetValidatorPerformance:output_type -> ethereum.eth.v1alpha1.ValidatorPerformanceResponse - 21, // 52: ethereum.eth.v1alpha1.BeaconChain.ListValidatorAssignments:output_type -> ethereum.eth.v1alpha1.ValidatorAssignments - 23, // 53: ethereum.eth.v1alpha1.BeaconChain.GetValidatorParticipation:output_type -> ethereum.eth.v1alpha1.ValidatorParticipationResponse - 26, // 54: ethereum.eth.v1alpha1.BeaconChain.GetBeaconConfig:output_type -> ethereum.eth.v1alpha1.BeaconConfig - 27, // 55: ethereum.eth.v1alpha1.BeaconChain.SubmitAttesterSlashing:output_type -> ethereum.eth.v1alpha1.SubmitSlashingResponse - 27, // 56: ethereum.eth.v1alpha1.BeaconChain.SubmitProposerSlashing:output_type -> ethereum.eth.v1alpha1.SubmitSlashingResponse - 29, // 57: ethereum.eth.v1alpha1.BeaconChain.GetIndividualVotes:output_type -> ethereum.eth.v1alpha1.IndividualVotesRespond - 40, // [40:58] is the sub-list for method output_type - 22, // [22:40] is the sub-list for method input_type - 22, // [22:22] is the sub-list for extension type_name - 22, // [22:22] is the sub-list for extension extendee - 0, // [0:22] is the sub-list for field type_name + 48, // 11: ethereum.eth.v1alpha1.BeaconBlockContainer.electra_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockElectra + 49, // 12: ethereum.eth.v1alpha1.BeaconBlockContainer.blinded_electra_block:type_name -> ethereum.eth.v1alpha1.SignedBlindedBeaconBlockElectra + 32, // 13: ethereum.eth.v1alpha1.BeaconCommittees.committees:type_name -> ethereum.eth.v1alpha1.BeaconCommittees.CommitteesEntry + 33, // 14: ethereum.eth.v1alpha1.ValidatorBalances.balances:type_name -> ethereum.eth.v1alpha1.ValidatorBalances.Balance + 34, // 15: ethereum.eth.v1alpha1.Validators.validator_list:type_name -> ethereum.eth.v1alpha1.Validators.ValidatorContainer + 35, // 16: ethereum.eth.v1alpha1.ValidatorAssignments.assignments:type_name -> ethereum.eth.v1alpha1.ValidatorAssignments.CommitteeAssignment + 50, // 17: ethereum.eth.v1alpha1.ValidatorParticipationResponse.participation:type_name -> ethereum.eth.v1alpha1.ValidatorParticipation + 38, // 18: ethereum.eth.v1alpha1.AttestationPoolResponse.attestations:type_name -> ethereum.eth.v1alpha1.Attestation + 36, // 19: ethereum.eth.v1alpha1.BeaconConfig.config:type_name -> ethereum.eth.v1alpha1.BeaconConfig.ConfigEntry + 37, // 20: ethereum.eth.v1alpha1.IndividualVotesRespond.individual_votes:type_name -> ethereum.eth.v1alpha1.IndividualVotesRespond.IndividualVote + 30, // 21: ethereum.eth.v1alpha1.BeaconCommittees.CommitteesList.committees:type_name -> ethereum.eth.v1alpha1.BeaconCommittees.CommitteeItem + 31, // 22: ethereum.eth.v1alpha1.BeaconCommittees.CommitteesEntry.value:type_name -> ethereum.eth.v1alpha1.BeaconCommittees.CommitteesList + 51, // 23: ethereum.eth.v1alpha1.Validators.ValidatorContainer.validator:type_name -> ethereum.eth.v1alpha1.Validator + 1, // 24: ethereum.eth.v1alpha1.BeaconChain.ListAttestations:input_type -> ethereum.eth.v1alpha1.ListAttestationsRequest + 0, // 25: ethereum.eth.v1alpha1.BeaconChain.ListIndexedAttestations:input_type -> ethereum.eth.v1alpha1.ListIndexedAttestationsRequest + 24, // 26: ethereum.eth.v1alpha1.BeaconChain.AttestationPool:input_type -> ethereum.eth.v1alpha1.AttestationPoolRequest + 4, // 27: ethereum.eth.v1alpha1.BeaconChain.ListBeaconBlocks:input_type -> ethereum.eth.v1alpha1.ListBlocksRequest + 52, // 28: ethereum.eth.v1alpha1.BeaconChain.GetChainHead:input_type -> google.protobuf.Empty + 8, // 29: ethereum.eth.v1alpha1.BeaconChain.ListBeaconCommittees:input_type -> ethereum.eth.v1alpha1.ListCommitteesRequest + 10, // 30: ethereum.eth.v1alpha1.BeaconChain.ListValidatorBalances:input_type -> ethereum.eth.v1alpha1.ListValidatorBalancesRequest + 12, // 31: ethereum.eth.v1alpha1.BeaconChain.ListValidators:input_type -> ethereum.eth.v1alpha1.ListValidatorsRequest + 13, // 32: ethereum.eth.v1alpha1.BeaconChain.GetValidator:input_type -> ethereum.eth.v1alpha1.GetValidatorRequest + 15, // 33: ethereum.eth.v1alpha1.BeaconChain.GetValidatorActiveSetChanges:input_type -> ethereum.eth.v1alpha1.GetValidatorActiveSetChangesRequest + 52, // 34: ethereum.eth.v1alpha1.BeaconChain.GetValidatorQueue:input_type -> google.protobuf.Empty + 17, // 35: ethereum.eth.v1alpha1.BeaconChain.GetValidatorPerformance:input_type -> ethereum.eth.v1alpha1.ValidatorPerformanceRequest + 20, // 36: ethereum.eth.v1alpha1.BeaconChain.ListValidatorAssignments:input_type -> ethereum.eth.v1alpha1.ListValidatorAssignmentsRequest + 22, // 37: ethereum.eth.v1alpha1.BeaconChain.GetValidatorParticipation:input_type -> ethereum.eth.v1alpha1.GetValidatorParticipationRequest + 52, // 38: ethereum.eth.v1alpha1.BeaconChain.GetBeaconConfig:input_type -> google.protobuf.Empty + 53, // 39: ethereum.eth.v1alpha1.BeaconChain.SubmitAttesterSlashing:input_type -> ethereum.eth.v1alpha1.AttesterSlashing + 54, // 40: ethereum.eth.v1alpha1.BeaconChain.SubmitProposerSlashing:input_type -> ethereum.eth.v1alpha1.ProposerSlashing + 28, // 41: ethereum.eth.v1alpha1.BeaconChain.GetIndividualVotes:input_type -> ethereum.eth.v1alpha1.IndividualVotesRequest + 2, // 42: ethereum.eth.v1alpha1.BeaconChain.ListAttestations:output_type -> ethereum.eth.v1alpha1.ListAttestationsResponse + 3, // 43: ethereum.eth.v1alpha1.BeaconChain.ListIndexedAttestations:output_type -> ethereum.eth.v1alpha1.ListIndexedAttestationsResponse + 25, // 44: ethereum.eth.v1alpha1.BeaconChain.AttestationPool:output_type -> ethereum.eth.v1alpha1.AttestationPoolResponse + 5, // 45: ethereum.eth.v1alpha1.BeaconChain.ListBeaconBlocks:output_type -> ethereum.eth.v1alpha1.ListBeaconBlocksResponse + 7, // 46: ethereum.eth.v1alpha1.BeaconChain.GetChainHead:output_type -> ethereum.eth.v1alpha1.ChainHead + 9, // 47: ethereum.eth.v1alpha1.BeaconChain.ListBeaconCommittees:output_type -> ethereum.eth.v1alpha1.BeaconCommittees + 11, // 48: ethereum.eth.v1alpha1.BeaconChain.ListValidatorBalances:output_type -> ethereum.eth.v1alpha1.ValidatorBalances + 14, // 49: ethereum.eth.v1alpha1.BeaconChain.ListValidators:output_type -> ethereum.eth.v1alpha1.Validators + 51, // 50: ethereum.eth.v1alpha1.BeaconChain.GetValidator:output_type -> ethereum.eth.v1alpha1.Validator + 16, // 51: ethereum.eth.v1alpha1.BeaconChain.GetValidatorActiveSetChanges:output_type -> ethereum.eth.v1alpha1.ActiveSetChanges + 19, // 52: ethereum.eth.v1alpha1.BeaconChain.GetValidatorQueue:output_type -> ethereum.eth.v1alpha1.ValidatorQueue + 18, // 53: ethereum.eth.v1alpha1.BeaconChain.GetValidatorPerformance:output_type -> ethereum.eth.v1alpha1.ValidatorPerformanceResponse + 21, // 54: ethereum.eth.v1alpha1.BeaconChain.ListValidatorAssignments:output_type -> ethereum.eth.v1alpha1.ValidatorAssignments + 23, // 55: ethereum.eth.v1alpha1.BeaconChain.GetValidatorParticipation:output_type -> ethereum.eth.v1alpha1.ValidatorParticipationResponse + 26, // 56: ethereum.eth.v1alpha1.BeaconChain.GetBeaconConfig:output_type -> ethereum.eth.v1alpha1.BeaconConfig + 27, // 57: ethereum.eth.v1alpha1.BeaconChain.SubmitAttesterSlashing:output_type -> ethereum.eth.v1alpha1.SubmitSlashingResponse + 27, // 58: ethereum.eth.v1alpha1.BeaconChain.SubmitProposerSlashing:output_type -> ethereum.eth.v1alpha1.SubmitSlashingResponse + 29, // 59: ethereum.eth.v1alpha1.BeaconChain.GetIndividualVotes:output_type -> ethereum.eth.v1alpha1.IndividualVotesRespond + 42, // [42:60] is the sub-list for method output_type + 24, // [24:42] is the sub-list for method input_type + 24, // [24:24] is the sub-list for extension type_name + 24, // [24:24] is the sub-list for extension extendee + 0, // [0:24] is the sub-list for field type_name } func init() { file_proto_prysm_v1alpha1_beacon_chain_proto_init() } @@ -4660,6 +4704,8 @@ func file_proto_prysm_v1alpha1_beacon_chain_proto_init() { (*BeaconBlockContainer_BlindedCapellaBlock)(nil), (*BeaconBlockContainer_DenebBlock)(nil), (*BeaconBlockContainer_BlindedDenebBlock)(nil), + (*BeaconBlockContainer_ElectraBlock)(nil), + (*BeaconBlockContainer_BlindedElectraBlock)(nil), } file_proto_prysm_v1alpha1_beacon_chain_proto_msgTypes[8].OneofWrappers = []interface{}{ (*ListCommitteesRequest_Epoch)(nil), diff --git a/proto/prysm/v1alpha1/beacon_chain.proto b/proto/prysm/v1alpha1/beacon_chain.proto index 04101d192836..0201e4c4cfa3 100644 --- a/proto/prysm/v1alpha1/beacon_chain.proto +++ b/proto/prysm/v1alpha1/beacon_chain.proto @@ -338,27 +338,35 @@ message BeaconBlockContainer { // The desired block to be returned. oneof block { - // Representing a phase 0 block. + // Representing a Phase0 block. SignedBeaconBlock phase0_block = 3; - // Representing an altair block. + // Representing an Altair block. SignedBeaconBlockAltair altair_block = 4; - // Representing a bellatrix block. + // Representing a Bellatrix block. SignedBeaconBlockBellatrix bellatrix_block = 5; - // Representing a blinded bellatrix block. + // Representing a blinded Bellatrix block. SignedBlindedBeaconBlockBellatrix blinded_bellatrix_block = 6; - // Representing a capella block. + // Representing a Capella block. SignedBeaconBlockCapella capella_block = 7; - // Representing a blinded capella block. + // Representing a blinded Capella block. SignedBlindedBeaconBlockCapella blinded_capella_block = 8; + // Representing a Deneb block. SignedBeaconBlockDeneb deneb_block = 9; + // Representing a blinded Deneb block. SignedBlindedBeaconBlockDeneb blinded_deneb_block = 10; + + // Representing an Electra block. + SignedBeaconBlockElectra electra_block = 11; + + // Representing a blinded Electra block. + SignedBlindedBeaconBlockElectra blinded_electra_block = 12; } } diff --git a/proto/prysm/v1alpha1/generated.ssz.go b/proto/prysm/v1alpha1/generated.ssz.go index 3bc5fc7a64b6..707521ef8345 100644 --- a/proto/prysm/v1alpha1/generated.ssz.go +++ b/proto/prysm/v1alpha1/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: f5dca4cd73e0ede007a079469da9c22998b793f769c4ce4da279ac910c6fd9b2 +// Hash: ae92821338b1fc2296cda7b35445bbd7005303c62eab0bcef3ef9c4c7cf0b9ef package eth import ( diff --git a/proto/prysm/v1alpha1/slashings/surround_votes.go b/proto/prysm/v1alpha1/slashings/surround_votes.go index d3415550f99a..1ea477199454 100644 --- a/proto/prysm/v1alpha1/slashings/surround_votes.go +++ b/proto/prysm/v1alpha1/slashings/surround_votes.go @@ -10,6 +10,6 @@ import ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" // t: target // // a surrounds b if: s_a < s_b and t_b < t_a -func IsSurround(a, b *ethpb.IndexedAttestation) bool { - return a.Data.Source.Epoch < b.Data.Source.Epoch && b.Data.Target.Epoch < a.Data.Target.Epoch +func IsSurround(a, b ethpb.IndexedAtt) bool { + return a.GetData().Source.Epoch < b.GetData().Source.Epoch && b.GetData().Target.Epoch < a.GetData().Target.Epoch } diff --git a/proto/prysm/v1alpha1/validator.proto b/proto/prysm/v1alpha1/validator.proto index 80e5e1eb7441..ac942559c1b0 100644 --- a/proto/prysm/v1alpha1/validator.proto +++ b/proto/prysm/v1alpha1/validator.proto @@ -188,7 +188,6 @@ service BeaconNodeValidator { }; } - // Submit selection proof to the beacon node to aggregate all matching wire attestations with the same data root. // the beacon node responses with an aggregate and proof object back to validator to sign over. rpc SubmitAggregateSelectionProof(AggregateSelectionRequest) returns (AggregateSelectionResponse) { diff --git a/runtime/version/fork.go b/runtime/version/fork.go index d9e9b3811d1d..902393c8bc80 100644 --- a/runtime/version/fork.go +++ b/runtime/version/fork.go @@ -8,6 +8,7 @@ const ( Bellatrix Capella Deneb + Electra ) var versionToString = map[int]string{ @@ -16,6 +17,7 @@ var versionToString = map[int]string{ Bellatrix: "bellatrix", Capella: "capella", Deneb: "deneb", + Electra: "electra", } // stringToVersion and allVersions are populated in init() diff --git a/testing/slasher/simulator/BUILD.bazel b/testing/slasher/simulator/BUILD.bazel index d8dccd2d376a..6f904214877c 100644 --- a/testing/slasher/simulator/BUILD.bazel +++ b/testing/slasher/simulator/BUILD.bazel @@ -26,6 +26,7 @@ go_library( "//beacon-chain/state/stategen:go_default_library", "//beacon-chain/sync:go_default_library", "//config/params:go_default_library", + "//consensus-types/interfaces:go_default_library", "//consensus-types/primitives:go_default_library", "//crypto/bls:go_default_library", "//crypto/rand:go_default_library", diff --git a/testing/slasher/simulator/simulator.go b/testing/slasher/simulator/simulator.go index d0fced31b2f1..d8825701e2e4 100644 --- a/testing/slasher/simulator/simulator.go +++ b/testing/slasher/simulator/simulator.go @@ -15,6 +15,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen" "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/crypto/bls" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -237,7 +238,7 @@ func (s *Simulator) verifySlashingsWereDetected(ctx context.Context) { ctx, nil, true, /* no limit */ ) detectedProposerSlashings := make(map[[32]byte]*ethpb.ProposerSlashing) - detectedAttesterSlashings := make(map[[32]byte]*ethpb.AttesterSlashing) + detectedAttesterSlashings := make(map[[32]byte]interfaces.AttesterSlashing) for _, slashing := range poolProposerSlashings { slashingRoot, err := slashing.HashTreeRoot() if err != nil { diff --git a/testing/spectest/shared/altair/epoch_processing/BUILD.bazel b/testing/spectest/shared/altair/epoch_processing/BUILD.bazel index 280be166efc0..d566fdbd43af 100644 --- a/testing/spectest/shared/altair/epoch_processing/BUILD.bazel +++ b/testing/spectest/shared/altair/epoch_processing/BUILD.bazel @@ -32,8 +32,9 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/altair/epoch_processing/helpers.go b/testing/spectest/shared/altair/epoch_processing/helpers.go index da522bc0f41f..2c5fcb585c76 100644 --- a/testing/spectest/shared/altair/epoch_processing/helpers.go +++ b/testing/spectest/shared/altair/epoch_processing/helpers.go @@ -8,13 +8,14 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) type epochOperation func(*testing.T, state.BeaconState) (state.BeaconState, error) @@ -62,8 +63,7 @@ func RunEpochOperationTest( pbState, err := state_native.ProtobufBeaconStateAltair(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/altair/operations/BUILD.bazel b/testing/spectest/shared/altair/operations/BUILD.bazel index 143e93cd5dc9..a668f22b8e56 100644 --- a/testing/spectest/shared/altair/operations/BUILD.bazel +++ b/testing/spectest/shared/altair/operations/BUILD.bazel @@ -29,8 +29,9 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/altair/operations/block_header.go b/testing/spectest/shared/altair/operations/block_header.go index ec9f7879a2bf..103b6e33d3aa 100644 --- a/testing/spectest/shared/altair/operations/block_header.go +++ b/testing/spectest/shared/altair/operations/block_header.go @@ -9,6 +9,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -17,7 +18,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func RunBlockHeaderTest(t *testing.T, config string) { @@ -72,8 +73,7 @@ func RunBlockHeaderTest(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStateAltair(beaconState.ToProto()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProto(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/altair/operations/helpers.go b/testing/spectest/shared/altair/operations/helpers.go index 2b9b07d38ca4..188eb237e3b8 100644 --- a/testing/spectest/shared/altair/operations/helpers.go +++ b/testing/spectest/shared/altair/operations/helpers.go @@ -9,6 +9,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -18,7 +19,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) type blockOperation func(context.Context, state.BeaconState, interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) @@ -72,8 +73,7 @@ func RunBlockOperationTest( pbState, err := state_native.ProtobufBeaconStateAltair(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/altair/sanity/BUILD.bazel b/testing/spectest/shared/altair/sanity/BUILD.bazel index d9588ac039e5..af8b85ac6ca0 100644 --- a/testing/spectest/shared/altair/sanity/BUILD.bazel +++ b/testing/spectest/shared/altair/sanity/BUILD.bazel @@ -20,10 +20,10 @@ go_library( "//testing/require:go_default_library", "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", - "@com_github_d4l3k_messagediff//:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/altair/sanity/block_processing.go b/testing/spectest/shared/altair/sanity/block_processing.go index 4d30d2b9bf6a..07e130c8bd5b 100644 --- a/testing/spectest/shared/altair/sanity/block_processing.go +++ b/testing/spectest/shared/altair/sanity/block_processing.go @@ -9,8 +9,8 @@ import ( "testing" "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/d4l3k/messagediff" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" @@ -21,6 +21,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" ) func init() { @@ -98,8 +99,7 @@ func RunBlockProcessingTest(t *testing.T, config, folderPath string) { pbState, err := state_native.ProtobufBeaconStateAltair(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/altair/sanity/slot_processing.go b/testing/spectest/shared/altair/sanity/slot_processing.go index 3c68fdcf790d..f1b6edb4f133 100644 --- a/testing/spectest/shared/altair/sanity/slot_processing.go +++ b/testing/spectest/shared/altair/sanity/slot_processing.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -13,7 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func init() { @@ -58,8 +59,8 @@ func RunSlotProcessingTests(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStateAltair(postState.ToProto()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState, postBeaconState) - t.Fatalf("Post state does not match expected. Diff between states %s", diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) + t.Fatal("Post state does not match expected. Diff between states") } }) } diff --git a/testing/spectest/shared/bellatrix/epoch_processing/BUILD.bazel b/testing/spectest/shared/bellatrix/epoch_processing/BUILD.bazel index b6a93b60fe5f..03ac47eaec86 100644 --- a/testing/spectest/shared/bellatrix/epoch_processing/BUILD.bazel +++ b/testing/spectest/shared/bellatrix/epoch_processing/BUILD.bazel @@ -32,8 +32,9 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/bellatrix/epoch_processing/helpers.go b/testing/spectest/shared/bellatrix/epoch_processing/helpers.go index e24421c70331..4255c168a52f 100644 --- a/testing/spectest/shared/bellatrix/epoch_processing/helpers.go +++ b/testing/spectest/shared/bellatrix/epoch_processing/helpers.go @@ -8,13 +8,14 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) type epochOperation func(*testing.T, state.BeaconState) (state.BeaconState, error) @@ -62,8 +63,7 @@ func RunEpochOperationTest( pbState, err := state_native.ProtobufBeaconStateBellatrix(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/bellatrix/operations/BUILD.bazel b/testing/spectest/shared/bellatrix/operations/BUILD.bazel index 69a47d70df67..3e5b2027dc0c 100644 --- a/testing/spectest/shared/bellatrix/operations/BUILD.bazel +++ b/testing/spectest/shared/bellatrix/operations/BUILD.bazel @@ -30,8 +30,9 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/bellatrix/operations/block_header.go b/testing/spectest/shared/bellatrix/operations/block_header.go index 6eb7c747c9cf..51d911bedabb 100644 --- a/testing/spectest/shared/bellatrix/operations/block_header.go +++ b/testing/spectest/shared/bellatrix/operations/block_header.go @@ -9,6 +9,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -17,7 +18,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func RunBlockHeaderTest(t *testing.T, config string) { @@ -72,8 +73,7 @@ func RunBlockHeaderTest(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStateBellatrix(beaconState.ToProto()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProto(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/bellatrix/operations/execution_payload.go b/testing/spectest/shared/bellatrix/operations/execution_payload.go index 68c42edb8d01..233e57175752 100644 --- a/testing/spectest/shared/bellatrix/operations/execution_payload.go +++ b/testing/spectest/shared/bellatrix/operations/execution_payload.go @@ -8,6 +8,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -17,7 +18,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func RunExecutionPayloadTest(t *testing.T, config string) { @@ -76,8 +77,7 @@ func RunExecutionPayloadTest(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStateBellatrix(gotState.ToProto()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(gotState.ToProto(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else if config.Valid { diff --git a/testing/spectest/shared/bellatrix/operations/helpers.go b/testing/spectest/shared/bellatrix/operations/helpers.go index 85e0197109b8..c234c6d0f7e9 100644 --- a/testing/spectest/shared/bellatrix/operations/helpers.go +++ b/testing/spectest/shared/bellatrix/operations/helpers.go @@ -9,6 +9,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -18,7 +19,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) type blockOperation func(context.Context, state.BeaconState, interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) @@ -72,8 +73,7 @@ func RunBlockOperationTest( pbState, err := state_native.ProtobufBeaconStateBellatrix(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/bellatrix/sanity/BUILD.bazel b/testing/spectest/shared/bellatrix/sanity/BUILD.bazel index 7e1a24dab44a..db8a5d07dc08 100644 --- a/testing/spectest/shared/bellatrix/sanity/BUILD.bazel +++ b/testing/spectest/shared/bellatrix/sanity/BUILD.bazel @@ -20,10 +20,10 @@ go_library( "//testing/require:go_default_library", "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", - "@com_github_d4l3k_messagediff//:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/bellatrix/sanity/block_processing.go b/testing/spectest/shared/bellatrix/sanity/block_processing.go index ce17d70cbb8a..c3bcac59013a 100644 --- a/testing/spectest/shared/bellatrix/sanity/block_processing.go +++ b/testing/spectest/shared/bellatrix/sanity/block_processing.go @@ -9,8 +9,8 @@ import ( "testing" "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/d4l3k/messagediff" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" @@ -21,6 +21,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" ) func init() { @@ -98,8 +99,7 @@ func RunBlockProcessingTest(t *testing.T, config, folderPath string) { pbState, err := state_native.ProtobufBeaconStateBellatrix(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/bellatrix/sanity/slot_processing.go b/testing/spectest/shared/bellatrix/sanity/slot_processing.go index c9e87045ecca..97806a03f74c 100644 --- a/testing/spectest/shared/bellatrix/sanity/slot_processing.go +++ b/testing/spectest/shared/bellatrix/sanity/slot_processing.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -13,7 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func init() { @@ -57,8 +58,8 @@ func RunSlotProcessingTests(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStateBellatrix(postState.ToProto()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState, postBeaconState) - t.Fatalf("Post state does not match expected. Diff between states %s", diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) + t.Fatal("Post state does not match expected. Diff between states") } }) } diff --git a/testing/spectest/shared/capella/epoch_processing/BUILD.bazel b/testing/spectest/shared/capella/epoch_processing/BUILD.bazel index 10d8d45c0106..9fd12223eb3e 100644 --- a/testing/spectest/shared/capella/epoch_processing/BUILD.bazel +++ b/testing/spectest/shared/capella/epoch_processing/BUILD.bazel @@ -32,8 +32,9 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/capella/epoch_processing/helpers.go b/testing/spectest/shared/capella/epoch_processing/helpers.go index 92df9f8b940c..1aa188d3214c 100644 --- a/testing/spectest/shared/capella/epoch_processing/helpers.go +++ b/testing/spectest/shared/capella/epoch_processing/helpers.go @@ -8,13 +8,14 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) type epochOperation func(*testing.T, state.BeaconState) (state.BeaconState, error) @@ -62,8 +63,7 @@ func RunEpochOperationTest( pbState, err := state_native.ProtobufBeaconStateCapella(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/capella/operations/BUILD.bazel b/testing/spectest/shared/capella/operations/BUILD.bazel index bd6194f9b9f7..f3c6b5fbe260 100644 --- a/testing/spectest/shared/capella/operations/BUILD.bazel +++ b/testing/spectest/shared/capella/operations/BUILD.bazel @@ -33,9 +33,10 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@com_github_pkg_errors//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/capella/operations/block_header.go b/testing/spectest/shared/capella/operations/block_header.go index d2144d0da148..1ca2ff80d6da 100644 --- a/testing/spectest/shared/capella/operations/block_header.go +++ b/testing/spectest/shared/capella/operations/block_header.go @@ -9,6 +9,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -17,7 +18,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func RunBlockHeaderTest(t *testing.T, config string) { @@ -72,8 +73,7 @@ func RunBlockHeaderTest(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStateCapella(beaconState.ToProto()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProto(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/capella/operations/helpers.go b/testing/spectest/shared/capella/operations/helpers.go index 95065a843bcf..918fd6c86b57 100644 --- a/testing/spectest/shared/capella/operations/helpers.go +++ b/testing/spectest/shared/capella/operations/helpers.go @@ -9,6 +9,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -18,7 +19,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) type blockOperation func(context.Context, state.BeaconState, interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) @@ -72,8 +73,7 @@ func RunBlockOperationTest( pbState, err := state_native.ProtobufBeaconStateCapella(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/capella/sanity/BUILD.bazel b/testing/spectest/shared/capella/sanity/BUILD.bazel index cb15f84ededa..c0d1ecd87490 100644 --- a/testing/spectest/shared/capella/sanity/BUILD.bazel +++ b/testing/spectest/shared/capella/sanity/BUILD.bazel @@ -21,8 +21,9 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/capella/sanity/block_processing.go b/testing/spectest/shared/capella/sanity/block_processing.go index ebc7fa5f24db..f7b490e0af39 100644 --- a/testing/spectest/shared/capella/sanity/block_processing.go +++ b/testing/spectest/shared/capella/sanity/block_processing.go @@ -10,6 +10,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" @@ -20,7 +21,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func init() { @@ -98,8 +99,7 @@ func RunBlockProcessingTest(t *testing.T, config, folderPath string) { pbState, err := state_native.ProtobufBeaconStateCapella(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(pbState, postBeaconState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/capella/sanity/slot_processing.go b/testing/spectest/shared/capella/sanity/slot_processing.go index 179491515bc6..862b584a4c58 100644 --- a/testing/spectest/shared/capella/sanity/slot_processing.go +++ b/testing/spectest/shared/capella/sanity/slot_processing.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -13,7 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func init() { @@ -57,8 +58,8 @@ func RunSlotProcessingTests(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStateCapella(postState.ToProto()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState, postBeaconState) - t.Fatalf("Post state does not match expected. Diff between states %s", diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) + t.Fatal("Post state does not match expected. Diff between states") } }) } diff --git a/testing/spectest/shared/common/forkchoice/builder.go b/testing/spectest/shared/common/forkchoice/builder.go index 8807bb4cae11..d354df5af075 100644 --- a/testing/spectest/shared/common/forkchoice/builder.go +++ b/testing/spectest/shared/common/forkchoice/builder.go @@ -126,7 +126,7 @@ func (bb *Builder) Attestation(t testing.TB, a *ethpb.Attestation) { // AttesterSlashing receives an attester slashing and feeds it to forkchoice. func (bb *Builder) AttesterSlashing(s *ethpb.AttesterSlashing) { - slashings := []*ethpb.AttesterSlashing{s} + slashings := []interfaces.AttesterSlashing{s} bb.service.InsertSlashingsToForkChoiceStore(context.TODO(), slashings) } diff --git a/testing/spectest/shared/deneb/fork/BUILD.bazel b/testing/spectest/shared/deneb/fork/BUILD.bazel index d740c3a62af6..f90f24925403 100644 --- a/testing/spectest/shared/deneb/fork/BUILD.bazel +++ b/testing/spectest/shared/deneb/fork/BUILD.bazel @@ -22,6 +22,8 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/deneb/fork/upgrade_to_deneb.go b/testing/spectest/shared/deneb/fork/upgrade_to_deneb.go index d5ef95cd4b8f..ccd0af5d538b 100644 --- a/testing/spectest/shared/deneb/fork/upgrade_to_deneb.go +++ b/testing/spectest/shared/deneb/fork/upgrade_to_deneb.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/deneb" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -13,6 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" ) // RunUpgradeToDeneb is a helper function that runs Deneb's fork spec tests. @@ -51,8 +53,7 @@ func RunUpgradeToDeneb(t *testing.T, config string) { } if !proto.Equal(postStateFromFile, postStateFromFunction) { - t.Log(postStateFromFile.LatestExecutionPayloadHeader) - t.Log(postStateFromFunction.LatestExecutionPayloadHeader) + t.Log(cmp.Diff(postStateFromFile, postStateFromFunction, protocmp.Transform())) t.Fatal("Post state does not match expected") } }) diff --git a/testing/spectest/shared/phase0/finality/BUILD.bazel b/testing/spectest/shared/phase0/finality/BUILD.bazel index eb3ec6a5f20e..15a2673522e1 100644 --- a/testing/spectest/shared/phase0/finality/BUILD.bazel +++ b/testing/spectest/shared/phase0/finality/BUILD.bazel @@ -17,7 +17,8 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/phase0/finality/runner.go b/testing/spectest/shared/phase0/finality/runner.go index af7072a896a4..16fdac7bf78c 100644 --- a/testing/spectest/shared/phase0/finality/runner.go +++ b/testing/spectest/shared/phase0/finality/runner.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" @@ -16,7 +17,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func init() { @@ -80,8 +81,7 @@ func RunFinalityTest(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStatePhase0(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } }) diff --git a/testing/spectest/shared/phase0/operations/BUILD.bazel b/testing/spectest/shared/phase0/operations/BUILD.bazel index 97c7e9c29418..fd66fea0f82c 100644 --- a/testing/spectest/shared/phase0/operations/BUILD.bazel +++ b/testing/spectest/shared/phase0/operations/BUILD.bazel @@ -27,9 +27,10 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@com_github_pkg_errors//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/phase0/operations/block_header.go b/testing/spectest/shared/phase0/operations/block_header.go index 64a559206166..0e95a5b66ca7 100644 --- a/testing/spectest/shared/phase0/operations/block_header.go +++ b/testing/spectest/shared/phase0/operations/block_header.go @@ -9,6 +9,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -17,7 +18,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) // RunBlockHeaderTest executes "operations/block_header" tests. @@ -74,8 +75,7 @@ func RunBlockHeaderTest(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStatePhase0(beaconState.ToProto()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProto(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/phase0/operations/helpers.go b/testing/spectest/shared/phase0/operations/helpers.go index ae7621889473..419dbbb32e9d 100644 --- a/testing/spectest/shared/phase0/operations/helpers.go +++ b/testing/spectest/shared/phase0/operations/helpers.go @@ -9,6 +9,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" @@ -18,7 +19,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) type blockOperation func(context.Context, state.BeaconState, interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) @@ -72,8 +73,7 @@ func RunBlockOperationTest( pbState, err := state_native.ProtobufBeaconStatePhase0(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/phase0/sanity/BUILD.bazel b/testing/spectest/shared/phase0/sanity/BUILD.bazel index f79f77db81dd..bf7f29d7888b 100644 --- a/testing/spectest/shared/phase0/sanity/BUILD.bazel +++ b/testing/spectest/shared/phase0/sanity/BUILD.bazel @@ -21,8 +21,9 @@ go_library( "//testing/spectest/utils:go_default_library", "//testing/util:go_default_library", "@com_github_golang_snappy//:go_default_library", - "@in_gopkg_d4l3k_messagediff_v1//:go_default_library", + "@com_github_google_go_cmp//cmp:go_default_library", "@io_bazel_rules_go//go/tools/bazel:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", + "@org_golang_google_protobuf//testing/protocmp:go_default_library", ], ) diff --git a/testing/spectest/shared/phase0/sanity/block_processing.go b/testing/spectest/shared/phase0/sanity/block_processing.go index b0eabad62549..8acf5344426f 100644 --- a/testing/spectest/shared/phase0/sanity/block_processing.go +++ b/testing/spectest/shared/phase0/sanity/block_processing.go @@ -10,6 +10,7 @@ import ( "github.com/bazelbuild/rules_go/go/tools/bazel" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" @@ -20,7 +21,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func init() { @@ -98,8 +99,7 @@ func RunBlockProcessingTest(t *testing.T, config, folderPath string) { pbState, err := state_native.ProtobufBeaconStatePhase0(beaconState.ToProtoUnsafe()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState.ToProtoUnsafe(), postBeaconState) - t.Log(diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) t.Fatal("Post state does not match expected") } } else { diff --git a/testing/spectest/shared/phase0/sanity/slot_processing.go b/testing/spectest/shared/phase0/sanity/slot_processing.go index cca9e316c768..4332e42f6da8 100644 --- a/testing/spectest/shared/phase0/sanity/slot_processing.go +++ b/testing/spectest/shared/phase0/sanity/slot_processing.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/golang/snappy" + "github.com/google/go-cmp/cmp" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/transition" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -13,7 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/protobuf/proto" - "gopkg.in/d4l3k/messagediff.v1" + "google.golang.org/protobuf/testing/protocmp" ) func init() { @@ -57,8 +58,8 @@ func RunSlotProcessingTests(t *testing.T, config string) { pbState, err := state_native.ProtobufBeaconStatePhase0(postState.ToProto()) require.NoError(t, err) if !proto.Equal(pbState, postBeaconState) { - diff, _ := messagediff.PrettyDiff(beaconState, postBeaconState) - t.Fatalf("Post state does not match expected. Diff between states %s", diff) + t.Log(cmp.Diff(postBeaconState, pbState, protocmp.Transform())) + t.Fatal("Post state does not match expected. Diff between states") } }) } diff --git a/testing/validator-mock/node_client_mock.go b/testing/validator-mock/node_client_mock.go index 8f6250cd86e3..337b8e22465e 100644 --- a/testing/validator-mock/node_client_mock.go +++ b/testing/validator-mock/node_client_mock.go @@ -21,8 +21,8 @@ import ( // MockNodeClient is a mock of NodeClient interface. type MockNodeClient struct { - ctrl *gomock.Controller - recorder *MockNodeClientMockRecorder + ctrl *gomock.Controller + recorder *MockNodeClientMockRecorder healthTracker *beacon.NodeHealthTracker } diff --git a/validator/client/beacon-api/mock/json_rest_handler_mock.go b/validator/client/beacon-api/mock/json_rest_handler_mock.go index ca58f39d22da..b79df47828b9 100644 --- a/validator/client/beacon-api/mock/json_rest_handler_mock.go +++ b/validator/client/beacon-api/mock/json_rest_handler_mock.go @@ -76,4 +76,3 @@ func (mr *MockJsonRestHandlerMockRecorder) Post(ctx, endpoint, headers, data, re mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Post", reflect.TypeOf((*MockJsonRestHandler)(nil).Post), ctx, endpoint, headers, data, resp) } -