From 023c99ddf4492d7c6af288411550cf49bb9453ea Mon Sep 17 00:00:00 2001 From: rkapka Date: Mon, 23 Dec 2024 17:45:18 +0100 Subject: [PATCH] try a different design --- beacon-chain/rpc/eth/beacon/handlers_pool.go | 6 +- beacon-chain/rpc/eth/validator/handlers.go | 6 +- .../rpc/prysm/v1alpha1/validator/attester.go | 5 +- beacon-chain/sync/BUILD.bazel | 2 - .../sync/pending_attestations_queue.go | 12 +- .../sync/subscriber_beacon_attestation.go | 5 +- beacon-chain/sync/validate_aggregate_proof.go | 15 +- .../sync/validate_beacon_attestation.go | 141 +++---- .../validate_beacon_attestation_electra.go | 27 -- ...alidate_beacon_attestation_electra_test.go | 28 -- proto/prysm/v1alpha1/BUILD.bazel | 4 +- proto/prysm/v1alpha1/attestation.go | 64 ++- proto/prysm/v1alpha1/attestation.pb.go | 373 +++++++++++++----- proto/prysm/v1alpha1/attestation.proto | 19 + proto/prysm/v1alpha1/electra.ssz.go | 177 ++++++++- 15 files changed, 604 insertions(+), 280 deletions(-) delete mode 100644 beacon-chain/sync/validate_beacon_attestation_electra.go delete mode 100644 beacon-chain/sync/validate_beacon_attestation_electra_test.go diff --git a/beacon-chain/rpc/eth/beacon/handlers_pool.go b/beacon-chain/rpc/eth/beacon/handlers_pool.go index d183ab8c0775..f27af61267d9 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_pool.go +++ b/beacon-chain/rpc/eth/beacon/handlers_pool.go @@ -336,11 +336,7 @@ func (s *Server) handleAttestationsElectra( failedBroadcasts = append(failedBroadcasts, strconv.Itoa(i)) continue } - committeeIndex, err := att.GetCommitteeIndex() - if err != nil { - return nil, nil, errors.Wrap(err, "failed to retrieve attestation committee index") - } - subnet := corehelpers.ComputeSubnetFromCommitteeAndSlot(uint64(len(vals)), committeeIndex, att.Data.Slot) + subnet := corehelpers.ComputeSubnetFromCommitteeAndSlot(uint64(len(vals)), att.GetCommitteeIndex(), att.Data.Slot) if err = s.Broadcaster.BroadcastAttestation(ctx, subnet, att); err != nil { log.WithError(err).Errorf("could not broadcast attestation at index %d", i) failedBroadcasts = append(failedBroadcasts, strconv.Itoa(i)) diff --git a/beacon-chain/rpc/eth/validator/handlers.go b/beacon-chain/rpc/eth/validator/handlers.go index b903ce81b59f..c10dd27f5140 100644 --- a/beacon-chain/rpc/eth/validator/handlers.go +++ b/beacon-chain/rpc/eth/validator/handlers.go @@ -189,11 +189,7 @@ func matchingAtts(atts []ethpbalpha.Att, slot primitives.Slot, attDataRoot []byt // compare the committee index separately. if postElectra { if att.Version() >= version.Electra { - ci, err := att.GetCommitteeIndex() - if err != nil { - return nil, err - } - if ci != index { + if att.GetCommitteeIndex() != index { continue } } else { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go b/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go index 782dc2f8eb03..0d18448599cd 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go @@ -71,10 +71,7 @@ func (vs *Server) ProposeAttestationElectra(ctx context.Context, att *ethpb.Sing if err != nil { return nil, status.Error(codes.Internal, "Could not get target state") } - committeeIndex, err := att.GetCommitteeIndex() - if err != nil { - return nil, status.Error(codes.Internal, "Could not get committee index") - } + committeeIndex := att.GetCommitteeIndex() committee, err := helpers.BeaconCommitteeFromState(ctx, targetState, att.Data.Slot, committeeIndex) if err != nil { return nil, status.Error(codes.Internal, "Could not get committee") diff --git a/beacon-chain/sync/BUILD.bazel b/beacon-chain/sync/BUILD.bazel index 1d83ac98ad6f..86c6d1318672 100644 --- a/beacon-chain/sync/BUILD.bazel +++ b/beacon-chain/sync/BUILD.bazel @@ -44,7 +44,6 @@ go_library( "validate_aggregate_proof.go", "validate_attester_slashing.go", "validate_beacon_attestation.go", - "validate_beacon_attestation_electra.go", "validate_beacon_blocks.go", "validate_blob.go", "validate_bls_to_execution_change.go", @@ -179,7 +178,6 @@ go_test( "sync_test.go", "validate_aggregate_proof_test.go", "validate_attester_slashing_test.go", - "validate_beacon_attestation_electra_test.go", "validate_beacon_attestation_test.go", "validate_beacon_blocks_test.go", "validate_blob_test.go", diff --git a/beacon-chain/sync/pending_attestations_queue.go b/beacon-chain/sync/pending_attestations_queue.go index 448875c203c2..5a0b7d3231ce 100644 --- a/beacon-chain/sync/pending_attestations_queue.go +++ b/beacon-chain/sync/pending_attestations_queue.go @@ -131,12 +131,20 @@ func (s *Service) processAttestations(ctx context.Context, attestations []ethpb. log.WithError(err).Debug("Could not retrieve attestation prestate") continue } - - valid, err := s.validateUnaggregatedAttWithState(ctx, aggregate, preState) + committee, valid, err := s.validateUnaggregatedAttWithState(ctx, aggregate, preState) if err != nil { log.WithError(err).Debug("Pending unaggregated attestation failed validation") continue } + if aggregate.Version() >= version.Electra { + singleAtt, ok := aggregate.(*ethpb.SingleAttestation) + if !ok { + log.Debugf("Attestation has wrong type (expected %T, got %T)", ðpb.SingleAttestation{}, aggregate) + continue + } + aggregate = singleAtt.ToAttestationElectra(committee) + } + if valid == pubsub.ValidationAccept { if err := s.cfg.attPool.SaveUnaggregatedAttestation(aggregate); err != nil { log.WithError(err).Debug("Could not save unaggregated attestation") diff --git a/beacon-chain/sync/subscriber_beacon_attestation.go b/beacon-chain/sync/subscriber_beacon_attestation.go index ab440132e477..c049604db010 100644 --- a/beacon-chain/sync/subscriber_beacon_attestation.go +++ b/beacon-chain/sync/subscriber_beacon_attestation.go @@ -25,10 +25,7 @@ func (s *Service) committeeIndexBeaconAttestationSubscriber(_ context.Context, m if data == nil { return errors.New("nil attestation") } - committeeIndex, err := a.GetCommitteeIndex() - if err != nil { - return errors.Wrap(err, "committeeIndexBeaconAttestationSubscriber failed to get committee index") - } + committeeIndex := a.GetCommitteeIndex() s.setSeenCommitteeIndicesSlot(data.Slot, committeeIndex, a.GetAggregationBits()) exists, err := s.cfg.attPool.HasAggregatedAttestation(a) diff --git a/beacon-chain/sync/validate_aggregate_proof.go b/beacon-chain/sync/validate_aggregate_proof.go index 614f3aca85ed..f1c05d0de105 100644 --- a/beacon-chain/sync/validate_aggregate_proof.go +++ b/beacon-chain/sync/validate_aggregate_proof.go @@ -169,16 +169,23 @@ func (s *Service) validateAggregatedAtt(ctx context.Context, signed ethpb.Signed return pubsub.ValidationIgnore, err } - committeeIndex, _, result, err := s.validateCommitteeIndexAndCount(ctx, aggregate, bs) + committeeIndex, _, result, err := s.validateCommitteeIndex(ctx, aggregate, bs) if result != pubsub.ValidationAccept { wrappedErr := errors.Wrapf(err, "could not validate committee index") tracing.AnnotateError(span, wrappedErr) return result, err } - committee, result, err := s.validateBitLength(ctx, bs, aggregate.GetData().Slot, committeeIndex, aggregate.GetAggregationBits()) - if result != pubsub.ValidationAccept { - return result, err + committee, err := helpers.BeaconCommitteeFromState(ctx, bs, aggregate.GetData().Slot, committeeIndex) + if err != nil { + tracing.AnnotateError(span, err) + return pubsub.ValidationIgnore, err + } + + // Verify number of aggregation bits matches the committee size. + if err = helpers.VerifyBitfieldLength(aggregate.GetAggregationBits(), uint64(len(committee))); err != nil { + tracing.AnnotateError(span, err) + return pubsub.ValidationReject, err } // Verify validator index is within the beacon committee. diff --git a/beacon-chain/sync/validate_beacon_attestation.go b/beacon-chain/sync/validate_beacon_attestation.go index 58495a8d31d6..a0490890cb59 100644 --- a/beacon-chain/sync/validate_beacon_attestation.go +++ b/beacon-chain/sync/validate_beacon_attestation.go @@ -9,7 +9,6 @@ import ( pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/libp2p/go-libp2p/core/peer" "github.com/pkg/errors" - "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed" @@ -83,12 +82,7 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p return pubsub.ValidationReject, err } - committeeIndex, result, err := s.validateCommitteeIndex(ctx, att) - if result != pubsub.ValidationAccept { - wrappedErr := errors.Wrapf(err, "could not validate committee index for %s version", version.String(att.Version())) - tracing.AnnotateError(span, wrappedErr) - return result, wrappedErr - } + committeeIndex := att.GetCommitteeIndex() if !features.Get().EnableSlasher { // Verify this the first attestation received for the participating validator for the slot. @@ -112,12 +106,12 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p if !s.hasBlockAndState(ctx, blockRoot) { // A node doesn't have the block, it'll request from peer while saving the pending attestation to a queue. if att.Version() >= version.Electra { - a, ok := att.(*eth.AttestationElectra) + a, ok := att.(*eth.SingleAttestation) // This will never fail in practice because we asserted the version if !ok { - return pubsub.ValidationIgnore, fmt.Errorf("attestation has wrong type (expected %T, got %T)", ð.AttestationElectra{}, att) + return pubsub.ValidationIgnore, fmt.Errorf("attestation has wrong type (expected %T, got %T)", ð.SingleAttestation{}, att) } - s.savePendingAtt(ð.SignedAggregateAttestationAndProofElectra{Message: ð.AggregateAttestationAndProofElectra{Aggregate: a}}) + s.savePendingAtt(ð.SignedAggregateAttestationAndProofSingle{Message: ð.AggregateAttestationAndProofSingle{Aggregate: a}}) } else { a, ok := att.(*eth.Attestation) // This will never fail in practice because we asserted the version @@ -133,7 +127,6 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p tracing.AnnotateError(span, blockchain.ErrNotDescendantOfFinalized) return pubsub.ValidationIgnore, blockchain.ErrNotDescendantOfFinalized } - if err = s.cfg.chain.VerifyLmdFfgConsistency(ctx, att); err != nil { tracing.AnnotateError(span, err) attBadLmdConsistencyCount.Inc() @@ -145,38 +138,25 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p tracing.AnnotateError(span, err) return pubsub.ValidationIgnore, err } - committee, err := helpers.BeaconCommitteeFromState(ctx, preState, att.GetData().Slot, committeeIndex) - if err != nil { - tracing.AnnotateError(span, err) - return pubsub.ValidationIgnore, err - } - - var singleAtt *eth.SingleAttestation - if att.Version() >= version.Electra { - singleAtt, ok = att.(*eth.SingleAttestation) - if !ok { - return pubsub.ValidationIgnore, fmt.Errorf("attestation has wrong type (expected %T, got %T)", ð.SingleAttestation{}, att) - } - att = singleAtt.ToAttestationElectra(committee) - } validationRes, err = s.validateUnaggregatedAttTopic(ctx, att, preState, *msg.Topic) if validationRes != pubsub.ValidationAccept { return validationRes, err } - if singleAtt != nil { - validationRes, err = validateAttestingIndex(ctx, singleAtt, committee) - if validationRes != pubsub.ValidationAccept { - return validationRes, err - } - } - - validationRes, err = s.validateUnaggregatedAttWithState(ctx, att, preState) + committee, validationRes, err := s.validateUnaggregatedAttWithState(ctx, att, preState) if validationRes != pubsub.ValidationAccept { return validationRes, err } + if att.Version() >= version.Electra { + singleAtt, ok := att.(*eth.SingleAttestation) + if !ok { + return pubsub.ValidationIgnore, fmt.Errorf("attestation has wrong type (expected %T, got %T)", ð.SingleAttestation{}, att) + } + att = singleAtt.ToAttestationElectra(committee) + } + if features.Get().EnableSlasher { // Feed the indexed attestation to slasher if enabled. This action // is done in the background to avoid adding more load to this critical code path. @@ -227,7 +207,7 @@ func (s *Service) validateUnaggregatedAttTopic(ctx context.Context, a eth.Att, b ctx, span := trace.StartSpan(ctx, "sync.validateUnaggregatedAttTopic") defer span.End() - _, valCount, result, err := s.validateCommitteeIndexAndCount(ctx, a, bs) + _, valCount, result, err := s.validateCommitteeIndex(ctx, a, bs) if result != pubsub.ValidationAccept { return result, err } @@ -245,79 +225,84 @@ func (s *Service) validateUnaggregatedAttTopic(ctx context.Context, a eth.Att, b return pubsub.ValidationAccept, nil } -func (s *Service) validateCommitteeIndexAndCount( +func (s *Service) validateCommitteeIndex( ctx context.Context, a eth.Att, bs state.ReadOnlyBeaconState, ) (primitives.CommitteeIndex, uint64, pubsub.ValidationResult, error) { - ci, result, err := s.validateCommitteeIndex(ctx, a) - if result != pubsub.ValidationAccept { - return 0, 0, result, err - } valCount, err := helpers.ActiveValidatorCount(ctx, bs, slots.ToEpoch(a.GetData().Slot)) if err != nil { return 0, 0, pubsub.ValidationIgnore, err } count := helpers.SlotCommitteeCount(valCount) + ci := a.GetCommitteeIndex() if uint64(ci) > count { return 0, 0, pubsub.ValidationReject, fmt.Errorf("committee index %d > %d", ci, count) } return ci, valCount, pubsub.ValidationAccept, nil } -func (s *Service) validateCommitteeIndex(ctx context.Context, a eth.Att) (primitives.CommitteeIndex, pubsub.ValidationResult, error) { - if a.Version() >= version.Electra { - return validateCommitteeIndexElectra(ctx, a) - } - return a.GetData().CommitteeIndex, 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.Att, bs state.ReadOnlyBeaconState) (pubsub.ValidationResult, error) { +func (s *Service) validateUnaggregatedAttWithState( + ctx context.Context, + a eth.Att, + bs state.ReadOnlyBeaconState, +) ([]primitives.ValidatorIndex, pubsub.ValidationResult, error) { ctx, span := trace.StartSpan(ctx, "sync.validateUnaggregatedAttWithState") defer span.End() - committeeIndex, err := a.GetCommitteeIndex() - if err != nil { - return pubsub.ValidationIgnore, err - } + committeeIndex := a.GetCommitteeIndex() - committee, result, err := s.validateBitLength(ctx, bs, a.GetData().Slot, committeeIndex, a.GetAggregationBits()) - if result != pubsub.ValidationAccept { - return result, err - } - // 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.GetAggregationBits().Count() != 1 || a.GetAggregationBits().BitIndices()[0] >= len(committee) { - return pubsub.ValidationReject, errors.New("attestation bitfield is invalid") + var committee []primitives.ValidatorIndex + var err error + + // TODO: add test + // - [REJECT] attestation.data.index == 0 + if a.Version() >= version.Electra { + if committeeIndex != 0 { + return nil, pubsub.ValidationReject, errors.New("attestation data's committee index must be 0") + } + singleAtt, ok := a.(*eth.SingleAttestation) + if !ok { + return nil, pubsub.ValidationReject, fmt.Errorf("attestation has wrong type (expected %T, got %T)", ð.SingleAttestation{}, a) + } + committee, err = helpers.BeaconCommitteeFromState(ctx, bs, a.GetData().Slot, committeeIndex) + if err != nil { + return nil, pubsub.ValidationIgnore, err + } + result, err := validateAttestingIndex(ctx, singleAtt, committee) + if result != pubsub.ValidationAccept { + return nil, result, err + } + } else { + committee, err = helpers.BeaconCommitteeFromState(ctx, bs, a.GetData().Slot, committeeIndex) + if err != nil { + return nil, pubsub.ValidationIgnore, err + } + // Verify number of aggregation bits matches the committee size. + if err = helpers.VerifyBitfieldLength(a.GetAggregationBits(), uint64(len(committee))); err != nil { + return nil, pubsub.ValidationReject, err + } + // 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.GetAggregationBits().Count() != 1 || a.GetAggregationBits().BitIndices()[0] >= len(committee) { + return nil, pubsub.ValidationReject, errors.New("attestation bitfield is invalid") + } } set, err := blocks.AttestationSignatureBatch(ctx, bs, []eth.Att{a}) if err != nil { tracing.AnnotateError(span, err) attBadSignatureBatchCount.Inc() - return pubsub.ValidationReject, err - } - return s.validateWithBatchVerifier(ctx, "attestation", set) -} - -func (s *Service) validateBitLength( - ctx context.Context, - bs state.ReadOnlyBeaconState, - slot primitives.Slot, - committeeIndex primitives.CommitteeIndex, - aggregationBits bitfield.Bitlist, -) ([]primitives.ValidatorIndex, pubsub.ValidationResult, error) { - committee, err := helpers.BeaconCommitteeFromState(ctx, bs, slot, committeeIndex) - if err != nil { - return nil, pubsub.ValidationIgnore, err + return nil, pubsub.ValidationReject, err } - // Verify number of aggregation bits matches the committee size. - if err := helpers.VerifyBitfieldLength(aggregationBits, uint64(len(committee))); err != nil { - return nil, pubsub.ValidationReject, err + result, err := s.validateWithBatchVerifier(ctx, "attestation", set) + if result != pubsub.ValidationAccept { + tracing.AnnotateError(span, err) + return nil, result, err } return committee, pubsub.ValidationAccept, nil diff --git a/beacon-chain/sync/validate_beacon_attestation_electra.go b/beacon-chain/sync/validate_beacon_attestation_electra.go deleted file mode 100644 index dd008107f710..000000000000 --- a/beacon-chain/sync/validate_beacon_attestation_electra.go +++ /dev/null @@ -1,27 +0,0 @@ -package sync - -import ( - "context" - "errors" - - pubsub "github.com/libp2p/go-libp2p-pubsub" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" -) - -// validateCommitteeIndexElectra implements the following checks from the spec: -// - [REJECT] attestation.data.index == 0 -func validateCommitteeIndexElectra(ctx context.Context, a ethpb.Att) (primitives.CommitteeIndex, pubsub.ValidationResult, error) { - _, span := trace.StartSpan(ctx, "sync.validateCommitteeIndexElectra") - defer span.End() - - if a.GetData().CommitteeIndex != 0 { - return 0, pubsub.ValidationReject, errors.New("attestation data's committee index must be zero") - } - committeeIndex, err := a.GetCommitteeIndex() - if err != nil { - return 0, pubsub.ValidationReject, err - } - return committeeIndex, pubsub.ValidationAccept, nil -} diff --git a/beacon-chain/sync/validate_beacon_attestation_electra_test.go b/beacon-chain/sync/validate_beacon_attestation_electra_test.go deleted file mode 100644 index 332929ad056e..000000000000 --- a/beacon-chain/sync/validate_beacon_attestation_electra_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package sync - -import ( - "context" - "testing" - - pubsub "github.com/libp2p/go-libp2p-pubsub" - "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "github.com/prysmaticlabs/prysm/v5/testing/assert" - "github.com/prysmaticlabs/prysm/v5/testing/require" -) - -func Test_validateCommitteeIndexElectra(t *testing.T) { - ctx := context.Background() - - t.Run("valid", func(t *testing.T) { - ci, res, err := validateCommitteeIndexElectra(ctx, ðpb.SingleAttestation{Data: ðpb.AttestationData{}, CommitteeId: 1}) - require.NoError(t, err) - assert.Equal(t, pubsub.ValidationAccept, res) - assert.Equal(t, primitives.CommitteeIndex(1), ci) - }) - t.Run("non-zero committee index in att data", func(t *testing.T) { - _, res, err := validateCommitteeIndexElectra(ctx, ðpb.SingleAttestation{Data: ðpb.AttestationData{CommitteeIndex: 1}}) - assert.NotNil(t, err) - assert.Equal(t, pubsub.ValidationReject, res) - }) -} diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index fe510860a9c6..3a917a3bdd29 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -149,6 +149,7 @@ ssz_deneb_objs = [ ssz_electra_objs = [ "AggregateAttestationAndProofElectra", + "AggregateAttestationAndProofSingle", "AttestationElectra", "AttesterSlashingElectra", "BeaconBlockElectra", @@ -168,6 +169,7 @@ ssz_electra_objs = [ "PendingConsolidation", "PendingPartialWithdrawal", "SignedAggregateAttestationAndProofElectra", + "SignedAggregateAttestationAndProofSingle", "SignedBeaconBlockContentsElectra", "SignedBeaconBlockElectra", "SignedBlindedBeaconBlockElectra", @@ -375,8 +377,8 @@ ssz_proto_files( "beacon_block.proto", "beacon_state.proto", "blobs.proto", - "light_client.proto", "data_columns.proto", + "light_client.proto", "sync_committee.proto", "withdrawals.proto", ], diff --git a/proto/prysm/v1alpha1/attestation.go b/proto/prysm/v1alpha1/attestation.go index 4cef23af85c6..4498d26f1e87 100644 --- a/proto/prysm/v1alpha1/attestation.go +++ b/proto/prysm/v1alpha1/attestation.go @@ -1,9 +1,6 @@ package eth import ( - "fmt" - - "github.com/pkg/errors" ssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -25,7 +22,7 @@ type Att interface { GetData() *AttestationData CommitteeBitsVal() bitfield.Bitfield GetSignature() []byte - GetCommitteeIndex() (primitives.CommitteeIndex, error) + GetCommitteeIndex() primitives.CommitteeIndex IsNil() bool IsSingle() bool } @@ -150,11 +147,11 @@ func (a *Attestation) CommitteeBitsVal() bitfield.Bitfield { } // GetCommitteeIndex -- -func (a *Attestation) GetCommitteeIndex() (primitives.CommitteeIndex, error) { +func (a *Attestation) GetCommitteeIndex() primitives.CommitteeIndex { if a == nil || a.Data == nil { - return 0, errors.New("nil attestation data") + return 0 } - return a.Data.CommitteeIndex, nil + return a.Data.CommitteeIndex } // Version -- @@ -206,11 +203,11 @@ func (a *PendingAttestation) GetSignature() []byte { } // GetCommitteeIndex -- -func (a *PendingAttestation) GetCommitteeIndex() (primitives.CommitteeIndex, error) { +func (a *PendingAttestation) GetCommitteeIndex() primitives.CommitteeIndex { if a == nil || a.Data == nil { - return 0, errors.New("nil attestation data") + return 0 } - return a.Data.CommitteeIndex, nil + return a.Data.CommitteeIndex } // Version -- @@ -257,18 +254,15 @@ func (a *AttestationElectra) CommitteeBitsVal() bitfield.Bitfield { } // GetCommitteeIndex -- -func (a *AttestationElectra) GetCommitteeIndex() (primitives.CommitteeIndex, error) { - if a == nil || a.Data == nil { - return 0, errors.New("nil attestation data") - } +func (a *AttestationElectra) GetCommitteeIndex() primitives.CommitteeIndex { if len(a.CommitteeBits) == 0 { - return 0, errors.New("no committee bits found in attestation") + return 0 } indices := a.CommitteeBits.BitIndices() - if len(indices) != 1 { - return 0, fmt.Errorf("exactly 1 committee index must be set but %d were set", len(indices)) + if len(indices) == 0 { + return 0 } - return primitives.CommitteeIndex(uint64(indices[0])), nil + return primitives.CommitteeIndex(uint64(indices[0])) } // Version -- @@ -322,8 +316,8 @@ func (a *SingleAttestation) GetAggregationBits() bitfield.Bitlist { } // GetCommitteeIndex -- -func (a *SingleAttestation) GetCommitteeIndex() (primitives.CommitteeIndex, error) { - return a.CommitteeId, nil +func (a *SingleAttestation) GetCommitteeIndex() primitives.CommitteeIndex { + return a.CommitteeId } // ToAttestationElectra converts the attestation to an AttestationElectra. @@ -494,6 +488,21 @@ func (a *AggregateAttestationAndProofElectra) AggregateVal() Att { return a.Aggregate } +// Version -- +func (a *AggregateAttestationAndProofSingle) Version() int { + return version.Electra +} + +// IsNil -- +func (a *AggregateAttestationAndProofSingle) IsNil() bool { + return a == nil || a.Aggregate == nil || a.Aggregate.IsNil() +} + +// AggregateVal -- +func (a *AggregateAttestationAndProofSingle) AggregateVal() Att { + return a.Aggregate +} + // Version -- func (a *SignedAggregateAttestationAndProof) Version() int { return version.Phase0 @@ -523,3 +532,18 @@ func (a *SignedAggregateAttestationAndProofElectra) IsNil() bool { func (a *SignedAggregateAttestationAndProofElectra) AggregateAttestationAndProof() AggregateAttAndProof { return a.Message } + +// Version -- +func (a *SignedAggregateAttestationAndProofSingle) Version() int { + return version.Electra +} + +// IsNil -- +func (a *SignedAggregateAttestationAndProofSingle) IsNil() bool { + return a == nil || a.Message == nil || a.Message.IsNil() +} + +// AggregateAttestationAndProof -- +func (a *SignedAggregateAttestationAndProofSingle) AggregateAttestationAndProof() AggregateAttAndProof { + return a.Message +} diff --git a/proto/prysm/v1alpha1/attestation.pb.go b/proto/prysm/v1alpha1/attestation.pb.go index 2c3cfc022e16..ff1efce2ed4c 100755 --- a/proto/prysm/v1alpha1/attestation.pb.go +++ b/proto/prysm/v1alpha1/attestation.pb.go @@ -355,6 +355,69 @@ func (x *AggregateAttestationAndProofElectra) GetSelectionProof() []byte { return nil } +type AggregateAttestationAndProofSingle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AggregatorIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=aggregator_index,json=aggregatorIndex,proto3" json:"aggregator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` + Aggregate *SingleAttestation `protobuf:"bytes,3,opt,name=aggregate,proto3" json:"aggregate,omitempty"` + SelectionProof []byte `protobuf:"bytes,2,opt,name=selection_proof,json=selectionProof,proto3" json:"selection_proof,omitempty" ssz-size:"96"` +} + +func (x *AggregateAttestationAndProofSingle) Reset() { + *x = AggregateAttestationAndProofSingle{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AggregateAttestationAndProofSingle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AggregateAttestationAndProofSingle) ProtoMessage() {} + +func (x *AggregateAttestationAndProofSingle) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AggregateAttestationAndProofSingle.ProtoReflect.Descriptor instead. +func (*AggregateAttestationAndProofSingle) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{5} +} + +func (x *AggregateAttestationAndProofSingle) GetAggregatorIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { + if x != nil { + return x.AggregatorIndex + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) +} + +func (x *AggregateAttestationAndProofSingle) GetAggregate() *SingleAttestation { + if x != nil { + return x.Aggregate + } + return nil +} + +func (x *AggregateAttestationAndProofSingle) GetSelectionProof() []byte { + if x != nil { + return x.SelectionProof + } + return nil +} + type SignedAggregateAttestationAndProof struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -367,7 +430,7 @@ type SignedAggregateAttestationAndProof struct { func (x *SignedAggregateAttestationAndProof) Reset() { *x = SignedAggregateAttestationAndProof{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[5] + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -380,7 +443,7 @@ func (x *SignedAggregateAttestationAndProof) String() string { func (*SignedAggregateAttestationAndProof) ProtoMessage() {} func (x *SignedAggregateAttestationAndProof) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[5] + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -393,7 +456,7 @@ func (x *SignedAggregateAttestationAndProof) ProtoReflect() protoreflect.Message // Deprecated: Use SignedAggregateAttestationAndProof.ProtoReflect.Descriptor instead. func (*SignedAggregateAttestationAndProof) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{5} + return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{6} } func (x *SignedAggregateAttestationAndProof) GetMessage() *AggregateAttestationAndProof { @@ -422,7 +485,7 @@ type SignedAggregateAttestationAndProofElectra struct { func (x *SignedAggregateAttestationAndProofElectra) Reset() { *x = SignedAggregateAttestationAndProofElectra{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[6] + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -435,7 +498,7 @@ func (x *SignedAggregateAttestationAndProofElectra) String() string { func (*SignedAggregateAttestationAndProofElectra) ProtoMessage() {} func (x *SignedAggregateAttestationAndProofElectra) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[6] + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -448,7 +511,7 @@ func (x *SignedAggregateAttestationAndProofElectra) ProtoReflect() protoreflect. // Deprecated: Use SignedAggregateAttestationAndProofElectra.ProtoReflect.Descriptor instead. func (*SignedAggregateAttestationAndProofElectra) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{6} + return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{7} } func (x *SignedAggregateAttestationAndProofElectra) GetMessage() *AggregateAttestationAndProofElectra { @@ -465,6 +528,61 @@ func (x *SignedAggregateAttestationAndProofElectra) GetSignature() []byte { return nil } +type SignedAggregateAttestationAndProofSingle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message *AggregateAttestationAndProofSingle `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` +} + +func (x *SignedAggregateAttestationAndProofSingle) Reset() { + *x = SignedAggregateAttestationAndProofSingle{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedAggregateAttestationAndProofSingle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedAggregateAttestationAndProofSingle) ProtoMessage() {} + +func (x *SignedAggregateAttestationAndProofSingle) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedAggregateAttestationAndProofSingle.ProtoReflect.Descriptor instead. +func (*SignedAggregateAttestationAndProofSingle) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{8} +} + +func (x *SignedAggregateAttestationAndProofSingle) GetMessage() *AggregateAttestationAndProofSingle { + if x != nil { + return x.Message + } + return nil +} + +func (x *SignedAggregateAttestationAndProofSingle) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + type AttestationData struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -480,7 +598,7 @@ type AttestationData struct { func (x *AttestationData) Reset() { *x = AttestationData{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[7] + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -493,7 +611,7 @@ func (x *AttestationData) String() string { func (*AttestationData) ProtoMessage() {} func (x *AttestationData) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[7] + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -506,7 +624,7 @@ func (x *AttestationData) ProtoReflect() protoreflect.Message { // Deprecated: Use AttestationData.ProtoReflect.Descriptor instead. func (*AttestationData) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{7} + return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{9} } func (x *AttestationData) GetSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { @@ -556,7 +674,7 @@ type Checkpoint struct { func (x *Checkpoint) Reset() { *x = Checkpoint{} if protoimpl.UnsafeEnabled { - mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[8] + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -569,7 +687,7 @@ func (x *Checkpoint) String() string { func (*Checkpoint) ProtoMessage() {} func (x *Checkpoint) ProtoReflect() protoreflect.Message { - mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[8] + mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -582,7 +700,7 @@ func (x *Checkpoint) ProtoReflect() protoreflect.Message { // Deprecated: Use Checkpoint.ProtoReflect.Descriptor instead. func (*Checkpoint) Descriptor() ([]byte, []int) { - return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{8} + return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{10} } func (x *Checkpoint) GetEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch { @@ -698,71 +816,100 @@ var file_proto_prysm_v1alpha1_attestation_proto_rawDesc = []byte{ 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x0f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x99, 0x01, 0x0a, 0x22, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x4d, - 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, - 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, - 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x22, 0xa7, 0x01, 0x0a, 0x29, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, + 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x99, 0x02, 0x0a, 0x22, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x7a, + 0x0a, 0x10, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 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, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x46, 0x0a, 0x09, 0x61, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 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, 0x6e, 0x67, 0x6c, 0x65, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x0f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x39, 0x36, 0x52, 0x0e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, + 0x6f, 0x6f, 0x66, 0x22, 0x99, 0x01, 0x0a, 0x22, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, - 0x61, 0x12, 0x54, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, - 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x07, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x90, 0x03, - 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, - 0x61, 0x12, 0x59, 0x0a, 0x04, 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, 0x04, 0x73, 0x6c, 0x6f, 0x74, 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, 0x32, 0x0a, 0x11, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 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, 0x0f, 0x62, 0x65, 0x61, 0x63, 0x6f, - 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 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, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 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, - 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x22, 0x86, 0x01, 0x0a, 0x0a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 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, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, - 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 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, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 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, + 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x4d, 0x0a, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, + 0xa7, 0x01, 0x0a, 0x29, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, + 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x54, 0x0a, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, + 0x6f, 0x6f, 0x66, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xa5, 0x01, 0x0a, 0x28, 0x53, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x53, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x53, 0x69, 0x6e, 0x67, + 0x6c, 0x65, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x22, 0x90, 0x03, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x59, 0x0a, 0x04, 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, 0x04, 0x73, 0x6c, 0x6f, 0x74, + 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, 0x32, 0x0a, 0x11, 0x62, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 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, 0x0f, 0x62, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x39, + 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, + 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, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 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, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x22, 0x86, 0x01, 0x0a, 0x0a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, + 0x69, 0x6e, 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, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x12, 0x1a, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 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, 0x41, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 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 ( @@ -777,33 +924,37 @@ func file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP() []byte { return file_proto_prysm_v1alpha1_attestation_proto_rawDescData } -var file_proto_prysm_v1alpha1_attestation_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_proto_prysm_v1alpha1_attestation_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_proto_prysm_v1alpha1_attestation_proto_goTypes = []interface{}{ (*Attestation)(nil), // 0: ethereum.eth.v1alpha1.Attestation (*AttestationElectra)(nil), // 1: ethereum.eth.v1alpha1.AttestationElectra (*SingleAttestation)(nil), // 2: ethereum.eth.v1alpha1.SingleAttestation (*AggregateAttestationAndProof)(nil), // 3: ethereum.eth.v1alpha1.AggregateAttestationAndProof (*AggregateAttestationAndProofElectra)(nil), // 4: ethereum.eth.v1alpha1.AggregateAttestationAndProofElectra - (*SignedAggregateAttestationAndProof)(nil), // 5: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof - (*SignedAggregateAttestationAndProofElectra)(nil), // 6: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProofElectra - (*AttestationData)(nil), // 7: ethereum.eth.v1alpha1.AttestationData - (*Checkpoint)(nil), // 8: ethereum.eth.v1alpha1.Checkpoint + (*AggregateAttestationAndProofSingle)(nil), // 5: ethereum.eth.v1alpha1.AggregateAttestationAndProofSingle + (*SignedAggregateAttestationAndProof)(nil), // 6: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof + (*SignedAggregateAttestationAndProofElectra)(nil), // 7: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProofElectra + (*SignedAggregateAttestationAndProofSingle)(nil), // 8: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProofSingle + (*AttestationData)(nil), // 9: ethereum.eth.v1alpha1.AttestationData + (*Checkpoint)(nil), // 10: ethereum.eth.v1alpha1.Checkpoint } var file_proto_prysm_v1alpha1_attestation_proto_depIdxs = []int32{ - 7, // 0: ethereum.eth.v1alpha1.Attestation.data:type_name -> ethereum.eth.v1alpha1.AttestationData - 7, // 1: ethereum.eth.v1alpha1.AttestationElectra.data:type_name -> ethereum.eth.v1alpha1.AttestationData - 7, // 2: ethereum.eth.v1alpha1.SingleAttestation.data:type_name -> ethereum.eth.v1alpha1.AttestationData - 0, // 3: ethereum.eth.v1alpha1.AggregateAttestationAndProof.aggregate:type_name -> ethereum.eth.v1alpha1.Attestation - 1, // 4: ethereum.eth.v1alpha1.AggregateAttestationAndProofElectra.aggregate:type_name -> ethereum.eth.v1alpha1.AttestationElectra - 3, // 5: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof.message:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProof - 4, // 6: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProofElectra.message:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProofElectra - 8, // 7: ethereum.eth.v1alpha1.AttestationData.source:type_name -> ethereum.eth.v1alpha1.Checkpoint - 8, // 8: ethereum.eth.v1alpha1.AttestationData.target:type_name -> ethereum.eth.v1alpha1.Checkpoint - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 9, // 0: ethereum.eth.v1alpha1.Attestation.data:type_name -> ethereum.eth.v1alpha1.AttestationData + 9, // 1: ethereum.eth.v1alpha1.AttestationElectra.data:type_name -> ethereum.eth.v1alpha1.AttestationData + 9, // 2: ethereum.eth.v1alpha1.SingleAttestation.data:type_name -> ethereum.eth.v1alpha1.AttestationData + 0, // 3: ethereum.eth.v1alpha1.AggregateAttestationAndProof.aggregate:type_name -> ethereum.eth.v1alpha1.Attestation + 1, // 4: ethereum.eth.v1alpha1.AggregateAttestationAndProofElectra.aggregate:type_name -> ethereum.eth.v1alpha1.AttestationElectra + 2, // 5: ethereum.eth.v1alpha1.AggregateAttestationAndProofSingle.aggregate:type_name -> ethereum.eth.v1alpha1.SingleAttestation + 3, // 6: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof.message:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProof + 4, // 7: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProofElectra.message:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProofElectra + 5, // 8: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProofSingle.message:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProofSingle + 10, // 9: ethereum.eth.v1alpha1.AttestationData.source:type_name -> ethereum.eth.v1alpha1.Checkpoint + 10, // 10: ethereum.eth.v1alpha1.AttestationData.target:type_name -> ethereum.eth.v1alpha1.Checkpoint + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_proto_prysm_v1alpha1_attestation_proto_init() } @@ -873,7 +1024,7 @@ func file_proto_prysm_v1alpha1_attestation_proto_init() { } } file_proto_prysm_v1alpha1_attestation_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedAggregateAttestationAndProof); i { + switch v := v.(*AggregateAttestationAndProofSingle); i { case 0: return &v.state case 1: @@ -885,7 +1036,7 @@ func file_proto_prysm_v1alpha1_attestation_proto_init() { } } file_proto_prysm_v1alpha1_attestation_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedAggregateAttestationAndProofElectra); i { + switch v := v.(*SignedAggregateAttestationAndProof); i { case 0: return &v.state case 1: @@ -897,7 +1048,7 @@ func file_proto_prysm_v1alpha1_attestation_proto_init() { } } file_proto_prysm_v1alpha1_attestation_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AttestationData); i { + switch v := v.(*SignedAggregateAttestationAndProofElectra); i { case 0: return &v.state case 1: @@ -909,6 +1060,30 @@ func file_proto_prysm_v1alpha1_attestation_proto_init() { } } file_proto_prysm_v1alpha1_attestation_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedAggregateAttestationAndProofSingle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_attestation_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AttestationData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_attestation_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Checkpoint); i { case 0: return &v.state @@ -927,7 +1102,7 @@ func file_proto_prysm_v1alpha1_attestation_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_prysm_v1alpha1_attestation_proto_rawDesc, NumEnums: 0, - NumMessages: 9, + NumMessages: 11, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/prysm/v1alpha1/attestation.proto b/proto/prysm/v1alpha1/attestation.proto index 3b30d6aab801..d6de1745ef81 100644 --- a/proto/prysm/v1alpha1/attestation.proto +++ b/proto/prysm/v1alpha1/attestation.proto @@ -78,6 +78,17 @@ message AggregateAttestationAndProofElectra { bytes selection_proof = 2 [(ethereum.eth.ext.ssz_size) = "96"]; } +message AggregateAttestationAndProofSingle { + // The aggregator index that submitted this aggregated attestation and proof. + uint64 aggregator_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; + + // The aggregated attestation that was submitted. + SingleAttestation aggregate = 3; + + // 96 byte selection proof signed by the aggregator, which is the signature of the slot to aggregate. + bytes selection_proof = 2 [(ethereum.eth.ext.ssz_size) = "96"]; +} + message SignedAggregateAttestationAndProof { // The aggregated attestation and selection proof itself. AggregateAttestationAndProof message = 1; @@ -94,6 +105,14 @@ message SignedAggregateAttestationAndProofElectra { bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"]; } +message SignedAggregateAttestationAndProofSingle { + // The aggregated attestation and selection proof itself. + AggregateAttestationAndProofSingle message = 1; + + // 96 byte BLS aggregate signature signed by the aggregator over the message. + bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"]; +} + message AttestationData { // Attestation data includes information on Casper the Friendly Finality Gadget's votes // See: https://arxiv.org/pdf/1710.09437.pdf diff --git a/proto/prysm/v1alpha1/electra.ssz.go b/proto/prysm/v1alpha1/electra.ssz.go index 05bffda17e4d..1d0eb6eb57e0 100644 --- a/proto/prysm/v1alpha1/electra.ssz.go +++ b/proto/prysm/v1alpha1/electra.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 678c01efb0c60dfd165322b72151277be12cf3c501117900efa16e90a934b94c +// Hash: 22d071b33085dccb532beacb3b5bc5bb67c9a211c2af003b8e20712276885666 package eth import ( @@ -376,6 +376,98 @@ func (a *AggregateAttestationAndProofElectra) HashTreeRootWith(hh *ssz.Hasher) ( return } +// MarshalSSZ ssz marshals the AggregateAttestationAndProofSingle object +func (a *AggregateAttestationAndProofSingle) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(a) +} + +// MarshalSSZTo ssz marshals the AggregateAttestationAndProofSingle object to a target array +func (a *AggregateAttestationAndProofSingle) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'AggregatorIndex' + dst = ssz.MarshalUint64(dst, uint64(a.AggregatorIndex)) + + // Field (1) 'Aggregate' + if a.Aggregate == nil { + a.Aggregate = new(SingleAttestation) + } + if dst, err = a.Aggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'SelectionProof' + if size := len(a.SelectionProof); size != 96 { + err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) + return + } + dst = append(dst, a.SelectionProof...) + + return +} + +// UnmarshalSSZ ssz unmarshals the AggregateAttestationAndProofSingle object +func (a *AggregateAttestationAndProofSingle) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 344 { + return ssz.ErrSize + } + + // Field (0) 'AggregatorIndex' + a.AggregatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'Aggregate' + if a.Aggregate == nil { + a.Aggregate = new(SingleAttestation) + } + if err = a.Aggregate.UnmarshalSSZ(buf[8:248]); err != nil { + return err + } + + // Field (2) 'SelectionProof' + if cap(a.SelectionProof) == 0 { + a.SelectionProof = make([]byte, 0, len(buf[248:344])) + } + a.SelectionProof = append(a.SelectionProof, buf[248:344]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the AggregateAttestationAndProofSingle object +func (a *AggregateAttestationAndProofSingle) SizeSSZ() (size int) { + size = 344 + return +} + +// HashTreeRoot ssz hashes the AggregateAttestationAndProofSingle object +func (a *AggregateAttestationAndProofSingle) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(a) +} + +// HashTreeRootWith ssz hashes the AggregateAttestationAndProofSingle object with a hasher +func (a *AggregateAttestationAndProofSingle) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AggregatorIndex' + hh.PutUint64(uint64(a.AggregatorIndex)) + + // Field (1) 'Aggregate' + if err = a.Aggregate.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'SelectionProof' + if size := len(a.SelectionProof); size != 96 { + err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) + return + } + hh.PutBytes(a.SelectionProof) + + hh.Merkleize(indx) + return +} + // MarshalSSZ ssz marshals the SignedAggregateAttestationAndProofElectra object func (s *SignedAggregateAttestationAndProofElectra) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) @@ -485,6 +577,89 @@ func (s *SignedAggregateAttestationAndProofElectra) HashTreeRootWith(hh *ssz.Has return } +// MarshalSSZ ssz marshals the SignedAggregateAttestationAndProofSingle object +func (s *SignedAggregateAttestationAndProofSingle) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedAggregateAttestationAndProofSingle object to a target array +func (s *SignedAggregateAttestationAndProofSingle) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(AggregateAttestationAndProofSingle) + } + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedAggregateAttestationAndProofSingle object +func (s *SignedAggregateAttestationAndProofSingle) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 440 { + return ssz.ErrSize + } + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(AggregateAttestationAndProofSingle) + } + if err = s.Message.UnmarshalSSZ(buf[0:344]); err != nil { + return err + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[344:440])) + } + s.Signature = append(s.Signature, buf[344:440]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedAggregateAttestationAndProofSingle object +func (s *SignedAggregateAttestationAndProofSingle) SizeSSZ() (size int) { + size = 440 + return +} + +// HashTreeRoot ssz hashes the SignedAggregateAttestationAndProofSingle object +func (s *SignedAggregateAttestationAndProofSingle) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedAggregateAttestationAndProofSingle object with a hasher +func (s *SignedAggregateAttestationAndProofSingle) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + // MarshalSSZ ssz marshals the AttesterSlashingElectra object func (a *AttesterSlashingElectra) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(a)