From 5db230d40e0249d71dae96749858518b4b9769f6 Mon Sep 17 00:00:00 2001 From: Potuz Date: Mon, 29 Apr 2024 08:48:59 -0300 Subject: [PATCH] Helper for Payload Attestation Signing (#13901) --- beacon-chain/rpc/eth/config/handlers_test.go | 12 +- config/params/config.go | 4 +- proto/engine/v1/epbs.pb.go | 389 +++--------------- proto/engine/v1/epbs.proto | 19 - proto/engine/v1/generated.ssz.go | 287 ------------- proto/prysm/v1alpha1/BUILD.bazel | 4 + proto/prysm/v1alpha1/beacon_block.pb.go | 62 +-- proto/prysm/v1alpha1/beacon_block.proto | 3 +- proto/prysm/v1alpha1/generated.ssz.go | 293 ++++++++++++- .../prysm/v1alpha1/payload_attestation.pb.go | 376 +++++++++++++++++ .../v1alpha1/payload_attestation.pb.gw.go | 4 + .../prysm/v1alpha1/payload_attestation.proto | 43 ++ .../validator-client/keymanager.pb.go | 200 +++++---- .../validator-client/keymanager.proto | 4 + testing/util/BUILD.bazel | 1 + testing/util/payload_attestation.go | 45 ++ validator/client/BUILD.bazel | 2 + validator/client/payload_attestation.go | 49 +++ validator/client/payload_attestation_test.go | 51 +++ 19 files changed, 1085 insertions(+), 763 deletions(-) create mode 100755 proto/prysm/v1alpha1/payload_attestation.pb.go create mode 100755 proto/prysm/v1alpha1/payload_attestation.pb.gw.go create mode 100644 proto/prysm/v1alpha1/payload_attestation.proto create mode 100644 testing/util/payload_attestation.go create mode 100644 validator/client/payload_attestation.go create mode 100644 validator/client/payload_attestation_test.go diff --git a/beacon-chain/rpc/eth/config/handlers_test.go b/beacon-chain/rpc/eth/config/handlers_test.go index b269349c3960..d8837d5a0e27 100644 --- a/beacon-chain/rpc/eth/config/handlers_test.go +++ b/beacon-chain/rpc/eth/config/handlers_test.go @@ -21,6 +21,10 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/require" ) +// Variables defined in the placeholderFields will not be tested in `TestGetSpec`. +// These are variables that we don't use in Prysm. (i.e. future hardfork, light client... etc) +var placeholderFields = []string{"DOMAIN_BEACON_BUILDER", "DOMAIN_PTC_ATTESTER"} + func TestGetDepositContract(t *testing.T) { params.SetupTestConfigCleanup(t) config := params.BeaconConfig().Copy() @@ -190,7 +194,7 @@ func TestGetSpec(t *testing.T) { data, ok := resp.Data.(map[string]interface{}) require.Equal(t, true, ok) - assert.Equal(t, 152, len(data)) + assert.Equal(t, 154, len(data)) for k, v := range data { t.Run(k, func(t *testing.T) { switch k { @@ -522,6 +526,12 @@ func TestGetSpec(t *testing.T) { case "MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD": assert.Equal(t, "90", v) default: + for _, pf := range placeholderFields { + if k == pf { + t.Logf("Skipping placeholder field: %s", k) + return + } + } t.Errorf("Incorrect key: %s", k) } }) diff --git a/config/params/config.go b/config/params/config.go index bac8068f36a6..7f98a5acbc3d 100644 --- a/config/params/config.go +++ b/config/params/config.go @@ -126,8 +126,8 @@ type BeaconChainConfig struct { DomainApplicationBuilder [4]byte `yaml:"DOMAIN_APPLICATION_BUILDER" spec:"true"` // DomainApplicationBuilder defines the BLS signature domain for application builder. DomainBLSToExecutionChange [4]byte `yaml:"DOMAIN_BLS_TO_EXECUTION_CHANGE" spec:"true"` // DomainBLSToExecutionChange defines the BLS signature domain to change withdrawal addresses to ETH1 prefix DomainConsolidation [4]byte `yaml:"DOMAIN_CONSOLIDATION" spec:"true"` - DomainBeaconBuilder [4]byte `yaml:"DOMAIN_BEACON_BULDER" spec:"false"` // DomainBeaconBuilder defines the BLS signature domain used by builders [New in ePBS] - DomainPTCAttester [4]byte `yaml:"DOMAIN_PTC_ATTESTER" spec:"false"` // DomainPTCAttester defines the BLS signature domain used by PTC members [New in ePBS] + DomainBeaconBuilder [4]byte `yaml:"DOMAIN_BEACON_BUILDER" spec:"false"` // DomainBeaconBuilder defines the BLS signature domain used by builders [New in ePBS] + DomainPTCAttester [4]byte `yaml:"DOMAIN_PTC_ATTESTER" spec:"false"` // DomainPTCAttester defines the BLS signature domain used by PTC members [New in ePBS] // Prysm constants. GweiPerEth uint64 // GweiPerEth is the amount of gwei corresponding to 1 eth. diff --git a/proto/engine/v1/epbs.pb.go b/proto/engine/v1/epbs.pb.go index 324755ca910b..52210801db76 100755 --- a/proto/engine/v1/epbs.pb.go +++ b/proto/engine/v1/epbs.pb.go @@ -10,7 +10,6 @@ import ( reflect "reflect" sync "sync" - github_com_prysmaticlabs_go_bitfield "github.com/prysmaticlabs/go-bitfield" github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" _ "github.com/prysmaticlabs/prysm/v5/proto/eth/ext" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -24,195 +23,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type PayloadAttestationData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BeaconBlockRoot []byte `protobuf:"bytes,1,opt,name=beacon_block_root,json=beaconBlockRoot,proto3" json:"beacon_block_root,omitempty" ssz-size:"32"` - Slot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,2,opt,name=slot,proto3" json:"slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` - PayloadStatus github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.PTCStatus `protobuf:"varint,3,opt,name=payload_status,json=payloadStatus,proto3" json:"payload_status,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.PTCStatus"` -} - -func (x *PayloadAttestationData) Reset() { - *x = PayloadAttestationData{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PayloadAttestationData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PayloadAttestationData) ProtoMessage() {} - -func (x *PayloadAttestationData) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[0] - 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 PayloadAttestationData.ProtoReflect.Descriptor instead. -func (*PayloadAttestationData) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{0} -} - -func (x *PayloadAttestationData) GetBeaconBlockRoot() []byte { - if x != nil { - return x.BeaconBlockRoot - } - return nil -} - -func (x *PayloadAttestationData) GetSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { - if x != nil { - return x.Slot - } - return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) -} - -func (x *PayloadAttestationData) GetPayloadStatus() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.PTCStatus { - if x != nil { - return x.PayloadStatus - } - return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.PTCStatus(0) -} - -type PayloadAttestation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AggregationBits github_com_prysmaticlabs_go_bitfield.Bitvector512 `protobuf:"bytes,1,opt,name=aggregation_bits,json=aggregationBits,proto3" json:"aggregation_bits,omitempty" cast-type:"github.com/prysmaticlabs/go-bitfield.Bitvector512" ssz-size:"64"` - Data *PayloadAttestationData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` -} - -func (x *PayloadAttestation) Reset() { - *x = PayloadAttestation{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PayloadAttestation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PayloadAttestation) ProtoMessage() {} - -func (x *PayloadAttestation) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[1] - 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 PayloadAttestation.ProtoReflect.Descriptor instead. -func (*PayloadAttestation) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{1} -} - -func (x *PayloadAttestation) GetAggregationBits() github_com_prysmaticlabs_go_bitfield.Bitvector512 { - if x != nil { - return x.AggregationBits - } - return github_com_prysmaticlabs_go_bitfield.Bitvector512(nil) -} - -func (x *PayloadAttestation) GetData() *PayloadAttestationData { - if x != nil { - return x.Data - } - return nil -} - -func (x *PayloadAttestation) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -type PayloadAttestationMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ValidatorIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` - Data *PayloadAttestationData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` -} - -func (x *PayloadAttestationMessage) Reset() { - *x = PayloadAttestationMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PayloadAttestationMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PayloadAttestationMessage) ProtoMessage() {} - -func (x *PayloadAttestationMessage) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[2] - 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 PayloadAttestationMessage.ProtoReflect.Descriptor instead. -func (*PayloadAttestationMessage) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{2} -} - -func (x *PayloadAttestationMessage) GetValidatorIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { - if x != nil { - return x.ValidatorIndex - } - return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) -} - -func (x *PayloadAttestationMessage) GetData() *PayloadAttestationData { - if x != nil { - return x.Data - } - return nil -} - -func (x *PayloadAttestationMessage) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - type InclusionListSummary struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -226,7 +36,7 @@ type InclusionListSummary struct { func (x *InclusionListSummary) Reset() { *x = InclusionListSummary{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[3] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -239,7 +49,7 @@ func (x *InclusionListSummary) String() string { func (*InclusionListSummary) ProtoMessage() {} func (x *InclusionListSummary) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[3] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -252,7 +62,7 @@ func (x *InclusionListSummary) ProtoReflect() protoreflect.Message { // Deprecated: Use InclusionListSummary.ProtoReflect.Descriptor instead. func (*InclusionListSummary) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{3} + return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{0} } func (x *InclusionListSummary) GetProposerIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { @@ -288,7 +98,7 @@ type SignedInclusionListSummary struct { func (x *SignedInclusionListSummary) Reset() { *x = SignedInclusionListSummary{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[4] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -301,7 +111,7 @@ func (x *SignedInclusionListSummary) String() string { func (*SignedInclusionListSummary) ProtoMessage() {} func (x *SignedInclusionListSummary) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[4] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -314,7 +124,7 @@ func (x *SignedInclusionListSummary) ProtoReflect() protoreflect.Message { // Deprecated: Use SignedInclusionListSummary.ProtoReflect.Descriptor instead. func (*SignedInclusionListSummary) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{4} + return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{1} } func (x *SignedInclusionListSummary) GetMessage() *InclusionListSummary { @@ -344,7 +154,7 @@ type InclusionList struct { func (x *InclusionList) Reset() { *x = InclusionList{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[5] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -357,7 +167,7 @@ func (x *InclusionList) String() string { func (*InclusionList) ProtoMessage() {} func (x *InclusionList) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[5] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -370,7 +180,7 @@ func (x *InclusionList) ProtoReflect() protoreflect.Message { // Deprecated: Use InclusionList.ProtoReflect.Descriptor instead. func (*InclusionList) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{5} + return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{2} } func (x *InclusionList) GetSignedSummary() *SignedInclusionListSummary { @@ -411,7 +221,7 @@ type ExecutionPayloadHeaderEPBS struct { func (x *ExecutionPayloadHeaderEPBS) Reset() { *x = ExecutionPayloadHeaderEPBS{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[6] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -424,7 +234,7 @@ func (x *ExecutionPayloadHeaderEPBS) String() string { func (*ExecutionPayloadHeaderEPBS) ProtoMessage() {} func (x *ExecutionPayloadHeaderEPBS) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[6] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -437,7 +247,7 @@ func (x *ExecutionPayloadHeaderEPBS) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadHeaderEPBS.ProtoReflect.Descriptor instead. func (*ExecutionPayloadHeaderEPBS) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{6} + return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{3} } func (x *ExecutionPayloadHeaderEPBS) GetParentBlockHash() []byte { @@ -517,7 +327,7 @@ type ExecutionPayloadEPBS struct { func (x *ExecutionPayloadEPBS) Reset() { *x = ExecutionPayloadEPBS{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[7] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -530,7 +340,7 @@ func (x *ExecutionPayloadEPBS) String() string { func (*ExecutionPayloadEPBS) ProtoMessage() {} func (x *ExecutionPayloadEPBS) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[7] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -543,7 +353,7 @@ func (x *ExecutionPayloadEPBS) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadEPBS.ProtoReflect.Descriptor instead. func (*ExecutionPayloadEPBS) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{7} + return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{4} } func (x *ExecutionPayloadEPBS) GetParentHash() []byte { @@ -684,7 +494,7 @@ type SignedExecutionPayloadHeader struct { func (x *SignedExecutionPayloadHeader) Reset() { *x = SignedExecutionPayloadHeader{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[8] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -697,7 +507,7 @@ func (x *SignedExecutionPayloadHeader) String() string { func (*SignedExecutionPayloadHeader) ProtoMessage() {} func (x *SignedExecutionPayloadHeader) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[8] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -710,7 +520,7 @@ func (x *SignedExecutionPayloadHeader) ProtoReflect() protoreflect.Message { // Deprecated: Use SignedExecutionPayloadHeader.ProtoReflect.Descriptor instead. func (*SignedExecutionPayloadHeader) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{8} + return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{5} } func (x *SignedExecutionPayloadHeader) GetMessage() *ExecutionPayloadHeader { @@ -746,7 +556,7 @@ type ExecutionPayloadEnvelope struct { func (x *ExecutionPayloadEnvelope) Reset() { *x = ExecutionPayloadEnvelope{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[9] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -759,7 +569,7 @@ func (x *ExecutionPayloadEnvelope) String() string { func (*ExecutionPayloadEnvelope) ProtoMessage() {} func (x *ExecutionPayloadEnvelope) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[9] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -772,7 +582,7 @@ func (x *ExecutionPayloadEnvelope) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadEnvelope.ProtoReflect.Descriptor instead. func (*ExecutionPayloadEnvelope) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{9} + return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{6} } func (x *ExecutionPayloadEnvelope) GetPayload() *ExecutionPayloadEPBS { @@ -850,7 +660,7 @@ type SignedExecutionPayloadEnvelope struct { func (x *SignedExecutionPayloadEnvelope) Reset() { *x = SignedExecutionPayloadEnvelope{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[10] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -863,7 +673,7 @@ func (x *SignedExecutionPayloadEnvelope) String() string { func (*SignedExecutionPayloadEnvelope) ProtoMessage() {} func (x *SignedExecutionPayloadEnvelope) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[10] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -876,7 +686,7 @@ func (x *SignedExecutionPayloadEnvelope) ProtoReflect() protoreflect.Message { // Deprecated: Use SignedExecutionPayloadEnvelope.ProtoReflect.Descriptor instead. func (*SignedExecutionPayloadEnvelope) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{10} + return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{7} } func (x *SignedExecutionPayloadEnvelope) GetMessage() *ExecutionPayloadEnvelope { @@ -903,55 +713,7 @@ var file_proto_engine_v1_epbs_proto_rawDesc = []byte{ 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 0x02, 0x0a, 0x16, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, - 0x12, 0x32, 0x0a, 0x11, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 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, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x02, 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, - 0x71, 0x0a, 0x0e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4a, 0x82, 0xb5, 0x18, 0x46, 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, 0x50, 0x54, 0x43, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x22, 0xe2, 0x01, 0x0a, 0x12, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x66, 0x0a, 0x10, 0x61, 0x67, 0x67, - 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x3b, 0x82, 0xb5, 0x18, 0x31, 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, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, - 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x35, 0x31, 0x32, 0x8a, 0xb5, 0x18, 0x02, 0x36, 0x34, - 0x52, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, - 0x73, 0x12, 0x3e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xfb, 0x01, 0x0a, 0x19, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 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, - 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, - 0x3e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, - 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x95, 0x02, 0x0a, 0x14, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x95, 0x02, 0x0a, 0x14, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, @@ -1161,36 +923,31 @@ func file_proto_engine_v1_epbs_proto_rawDescGZIP() []byte { return file_proto_engine_v1_epbs_proto_rawDescData } -var file_proto_engine_v1_epbs_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_proto_engine_v1_epbs_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_proto_engine_v1_epbs_proto_goTypes = []interface{}{ - (*PayloadAttestationData)(nil), // 0: ethereum.engine.v1.PayloadAttestationData - (*PayloadAttestation)(nil), // 1: ethereum.engine.v1.PayloadAttestation - (*PayloadAttestationMessage)(nil), // 2: ethereum.engine.v1.PayloadAttestationMessage - (*InclusionListSummary)(nil), // 3: ethereum.engine.v1.InclusionListSummary - (*SignedInclusionListSummary)(nil), // 4: ethereum.engine.v1.SignedInclusionListSummary - (*InclusionList)(nil), // 5: ethereum.engine.v1.InclusionList - (*ExecutionPayloadHeaderEPBS)(nil), // 6: ethereum.engine.v1.ExecutionPayloadHeaderEPBS - (*ExecutionPayloadEPBS)(nil), // 7: ethereum.engine.v1.ExecutionPayloadEPBS - (*SignedExecutionPayloadHeader)(nil), // 8: ethereum.engine.v1.SignedExecutionPayloadHeader - (*ExecutionPayloadEnvelope)(nil), // 9: ethereum.engine.v1.ExecutionPayloadEnvelope - (*SignedExecutionPayloadEnvelope)(nil), // 10: ethereum.engine.v1.SignedExecutionPayloadEnvelope - (*Withdrawal)(nil), // 11: ethereum.engine.v1.Withdrawal - (*ExecutionPayloadHeader)(nil), // 12: ethereum.engine.v1.ExecutionPayloadHeader + (*InclusionListSummary)(nil), // 0: ethereum.engine.v1.InclusionListSummary + (*SignedInclusionListSummary)(nil), // 1: ethereum.engine.v1.SignedInclusionListSummary + (*InclusionList)(nil), // 2: ethereum.engine.v1.InclusionList + (*ExecutionPayloadHeaderEPBS)(nil), // 3: ethereum.engine.v1.ExecutionPayloadHeaderEPBS + (*ExecutionPayloadEPBS)(nil), // 4: ethereum.engine.v1.ExecutionPayloadEPBS + (*SignedExecutionPayloadHeader)(nil), // 5: ethereum.engine.v1.SignedExecutionPayloadHeader + (*ExecutionPayloadEnvelope)(nil), // 6: ethereum.engine.v1.ExecutionPayloadEnvelope + (*SignedExecutionPayloadEnvelope)(nil), // 7: ethereum.engine.v1.SignedExecutionPayloadEnvelope + (*Withdrawal)(nil), // 8: ethereum.engine.v1.Withdrawal + (*ExecutionPayloadHeader)(nil), // 9: ethereum.engine.v1.ExecutionPayloadHeader } var file_proto_engine_v1_epbs_proto_depIdxs = []int32{ - 0, // 0: ethereum.engine.v1.PayloadAttestation.data:type_name -> ethereum.engine.v1.PayloadAttestationData - 0, // 1: ethereum.engine.v1.PayloadAttestationMessage.data:type_name -> ethereum.engine.v1.PayloadAttestationData - 3, // 2: ethereum.engine.v1.SignedInclusionListSummary.message:type_name -> ethereum.engine.v1.InclusionListSummary - 4, // 3: ethereum.engine.v1.InclusionList.signed_summary:type_name -> ethereum.engine.v1.SignedInclusionListSummary - 11, // 4: ethereum.engine.v1.ExecutionPayloadEPBS.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 12, // 5: ethereum.engine.v1.SignedExecutionPayloadHeader.message:type_name -> ethereum.engine.v1.ExecutionPayloadHeader - 7, // 6: ethereum.engine.v1.ExecutionPayloadEnvelope.payload:type_name -> ethereum.engine.v1.ExecutionPayloadEPBS - 9, // 7: ethereum.engine.v1.SignedExecutionPayloadEnvelope.message:type_name -> ethereum.engine.v1.ExecutionPayloadEnvelope - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 0, // 0: ethereum.engine.v1.SignedInclusionListSummary.message:type_name -> ethereum.engine.v1.InclusionListSummary + 1, // 1: ethereum.engine.v1.InclusionList.signed_summary:type_name -> ethereum.engine.v1.SignedInclusionListSummary + 8, // 2: ethereum.engine.v1.ExecutionPayloadEPBS.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 9, // 3: ethereum.engine.v1.SignedExecutionPayloadHeader.message:type_name -> ethereum.engine.v1.ExecutionPayloadHeader + 4, // 4: ethereum.engine.v1.ExecutionPayloadEnvelope.payload:type_name -> ethereum.engine.v1.ExecutionPayloadEPBS + 6, // 5: ethereum.engine.v1.SignedExecutionPayloadEnvelope.message:type_name -> ethereum.engine.v1.ExecutionPayloadEnvelope + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_proto_engine_v1_epbs_proto_init() } @@ -1201,42 +958,6 @@ func file_proto_engine_v1_epbs_proto_init() { file_proto_engine_v1_execution_engine_proto_init() if !protoimpl.UnsafeEnabled { file_proto_engine_v1_epbs_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PayloadAttestationData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_engine_v1_epbs_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PayloadAttestation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_engine_v1_epbs_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PayloadAttestationMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_engine_v1_epbs_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InclusionListSummary); i { case 0: return &v.state @@ -1248,7 +969,7 @@ func file_proto_engine_v1_epbs_proto_init() { return nil } } - file_proto_engine_v1_epbs_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_epbs_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignedInclusionListSummary); i { case 0: return &v.state @@ -1260,7 +981,7 @@ func file_proto_engine_v1_epbs_proto_init() { return nil } } - file_proto_engine_v1_epbs_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_epbs_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InclusionList); i { case 0: return &v.state @@ -1272,7 +993,7 @@ func file_proto_engine_v1_epbs_proto_init() { return nil } } - file_proto_engine_v1_epbs_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_epbs_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadHeaderEPBS); i { case 0: return &v.state @@ -1284,7 +1005,7 @@ func file_proto_engine_v1_epbs_proto_init() { return nil } } - file_proto_engine_v1_epbs_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_epbs_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadEPBS); i { case 0: return &v.state @@ -1296,7 +1017,7 @@ func file_proto_engine_v1_epbs_proto_init() { return nil } } - file_proto_engine_v1_epbs_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_epbs_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignedExecutionPayloadHeader); i { case 0: return &v.state @@ -1308,7 +1029,7 @@ func file_proto_engine_v1_epbs_proto_init() { return nil } } - file_proto_engine_v1_epbs_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_epbs_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadEnvelope); i { case 0: return &v.state @@ -1320,7 +1041,7 @@ func file_proto_engine_v1_epbs_proto_init() { return nil } } - file_proto_engine_v1_epbs_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_epbs_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignedExecutionPayloadEnvelope); i { case 0: return &v.state @@ -1339,7 +1060,7 @@ func file_proto_engine_v1_epbs_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_engine_v1_epbs_proto_rawDesc, NumEnums: 0, - NumMessages: 11, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/engine/v1/epbs.proto b/proto/engine/v1/epbs.proto index 48f775e95a33..a708bca39529 100644 --- a/proto/engine/v1/epbs.proto +++ b/proto/engine/v1/epbs.proto @@ -25,25 +25,6 @@ option java_outer_classname = "ExecutionEngineProto"; option java_package = "org.ethereum.engine.v1"; option php_namespace = "Ethereum\\Engine\\v1"; - -message PayloadAttestationData { - bytes beacon_block_root = 1 [(ethereum.eth.ext.ssz_size) = "32"]; - uint64 slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; - uint64 payload_status = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.PTCStatus"]; -} - -message PayloadAttestation { - bytes aggregation_bits = 1 [(ethereum.eth.ext.ssz_size) = "ptc.size", (ethereum.eth.ext.cast_type) = "ptc.type"]; - PayloadAttestationData data = 2; - bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"]; -} - -message PayloadAttestationMessage { - uint64 validator_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; - PayloadAttestationData data = 2; - bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"]; -} - message InclusionListSummary { uint64 proposer_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; uint64 slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; diff --git a/proto/engine/v1/generated.ssz.go b/proto/engine/v1/generated.ssz.go index 1591221bc622..1dba2f4b9d0a 100644 --- a/proto/engine/v1/generated.ssz.go +++ b/proto/engine/v1/generated.ssz.go @@ -7,293 +7,6 @@ import ( github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ) -// MarshalSSZ ssz marshals the PayloadAttestationData object -func (p *PayloadAttestationData) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} - -// MarshalSSZTo ssz marshals the PayloadAttestationData object to a target array -func (p *PayloadAttestationData) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'BeaconBlockRoot' - if size := len(p.BeaconBlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) - return - } - dst = append(dst, p.BeaconBlockRoot...) - - // Field (1) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(p.Slot)) - - // Field (2) 'PayloadStatus' - dst = ssz.MarshalUint64(dst, uint64(p.PayloadStatus)) - - return -} - -// UnmarshalSSZ ssz unmarshals the PayloadAttestationData object -func (p *PayloadAttestationData) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 48 { - return ssz.ErrSize - } - - // Field (0) 'BeaconBlockRoot' - if cap(p.BeaconBlockRoot) == 0 { - p.BeaconBlockRoot = make([]byte, 0, len(buf[0:32])) - } - p.BeaconBlockRoot = append(p.BeaconBlockRoot, buf[0:32]...) - - // Field (1) 'Slot' - p.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[32:40])) - - // Field (2) 'PayloadStatus' - p.PayloadStatus = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.PTCStatus(ssz.UnmarshallUint64(buf[40:48])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the PayloadAttestationData object -func (p *PayloadAttestationData) SizeSSZ() (size int) { - size = 48 - return -} - -// HashTreeRoot ssz hashes the PayloadAttestationData object -func (p *PayloadAttestationData) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the PayloadAttestationData object with a hasher -func (p *PayloadAttestationData) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'BeaconBlockRoot' - if size := len(p.BeaconBlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) - return - } - hh.PutBytes(p.BeaconBlockRoot) - - // Field (1) 'Slot' - hh.PutUint64(uint64(p.Slot)) - - // Field (2) 'PayloadStatus' - hh.PutUint64(uint64(p.PayloadStatus)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the PayloadAttestation object -func (p *PayloadAttestation) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} - -// MarshalSSZTo ssz marshals the PayloadAttestation object to a target array -func (p *PayloadAttestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'AggregationBits' - if size := len(p.AggregationBits); size != 64 { - err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 64) - return - } - dst = append(dst, p.AggregationBits...) - - // Field (1) 'Data' - if p.Data == nil { - p.Data = new(PayloadAttestationData) - } - if dst, err = p.Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(p.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, p.Signature...) - - return -} - -// UnmarshalSSZ ssz unmarshals the PayloadAttestation object -func (p *PayloadAttestation) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 208 { - return ssz.ErrSize - } - - // Field (0) 'AggregationBits' - if cap(p.AggregationBits) == 0 { - p.AggregationBits = make([]byte, 0, len(buf[0:64])) - } - p.AggregationBits = append(p.AggregationBits, buf[0:64]...) - - // Field (1) 'Data' - if p.Data == nil { - p.Data = new(PayloadAttestationData) - } - if err = p.Data.UnmarshalSSZ(buf[64:112]); err != nil { - return err - } - - // Field (2) 'Signature' - if cap(p.Signature) == 0 { - p.Signature = make([]byte, 0, len(buf[112:208])) - } - p.Signature = append(p.Signature, buf[112:208]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the PayloadAttestation object -func (p *PayloadAttestation) SizeSSZ() (size int) { - size = 208 - return -} - -// HashTreeRoot ssz hashes the PayloadAttestation object -func (p *PayloadAttestation) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the PayloadAttestation object with a hasher -func (p *PayloadAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AggregationBits' - if size := len(p.AggregationBits); size != 64 { - err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 64) - return - } - hh.PutBytes(p.AggregationBits) - - // Field (1) 'Data' - if err = p.Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(p.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(p.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the PayloadAttestationMessage object -func (p *PayloadAttestationMessage) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} - -// MarshalSSZTo ssz marshals the PayloadAttestationMessage object to a target array -func (p *PayloadAttestationMessage) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'ValidatorIndex' - dst = ssz.MarshalUint64(dst, uint64(p.ValidatorIndex)) - - // Field (1) 'Data' - if p.Data == nil { - p.Data = new(PayloadAttestationData) - } - if dst, err = p.Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(p.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, p.Signature...) - - return -} - -// UnmarshalSSZ ssz unmarshals the PayloadAttestationMessage object -func (p *PayloadAttestationMessage) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 152 { - return ssz.ErrSize - } - - // Field (0) 'ValidatorIndex' - p.ValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'Data' - if p.Data == nil { - p.Data = new(PayloadAttestationData) - } - if err = p.Data.UnmarshalSSZ(buf[8:56]); err != nil { - return err - } - - // Field (2) 'Signature' - if cap(p.Signature) == 0 { - p.Signature = make([]byte, 0, len(buf[56:152])) - } - p.Signature = append(p.Signature, buf[56:152]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the PayloadAttestationMessage object -func (p *PayloadAttestationMessage) SizeSSZ() (size int) { - size = 152 - return -} - -// HashTreeRoot ssz hashes the PayloadAttestationMessage object -func (p *PayloadAttestationMessage) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the PayloadAttestationMessage object with a hasher -func (p *PayloadAttestationMessage) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'ValidatorIndex' - hh.PutUint64(uint64(p.ValidatorIndex)) - - // Field (1) 'Data' - if err = p.Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(p.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(p.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - // MarshalSSZ ssz marshals the InclusionListSummary object func (i *InclusionListSummary) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(i) diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index 5b2fc9024102..86b6026441c6 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -151,6 +151,9 @@ ssz_gen_marshal( "Consolidation", "SignedConsolidation", "PendingConsolidation", + "PayloadAttestationData", + "PayloadAttestation", + "PayloadAttestationMessage", ], ) @@ -252,6 +255,7 @@ ssz_proto_files( "beacon_block.proto", "beacon_state.proto", "blobs.proto", + "payload_attestation.proto", "sync_committee.proto", "withdrawals.proto", ], diff --git a/proto/prysm/v1alpha1/beacon_block.pb.go b/proto/prysm/v1alpha1/beacon_block.pb.go index 9df3bdc0f2a0..663eedb31a4b 100755 --- a/proto/prysm/v1alpha1/beacon_block.pb.go +++ b/proto/prysm/v1alpha1/beacon_block.pb.go @@ -4789,7 +4789,7 @@ type BeaconBlockBodyePBS struct { SyncAggregate *SyncAggregate `protobuf:"bytes,9,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"` BlsToExecutionChanges []*SignedBLSToExecutionChange `protobuf:"bytes,10,rep,name=bls_to_execution_changes,json=blsToExecutionChanges,proto3" json:"bls_to_execution_changes,omitempty" ssz-max:"16"` SignedExecutionPayloadHeader *v1.SignedExecutionPayloadHeader `protobuf:"bytes,11,opt,name=signed_execution_payload_header,json=signedExecutionPayloadHeader,proto3" json:"signed_execution_payload_header,omitempty"` - PayloadAttestations []*v1.PayloadAttestation `protobuf:"bytes,12,rep,name=payload_attestations,json=payloadAttestations,proto3" json:"payload_attestations,omitempty" ssz-max:"4"` + PayloadAttestations []*PayloadAttestation `protobuf:"bytes,12,rep,name=payload_attestations,json=payloadAttestations,proto3" json:"payload_attestations,omitempty" ssz-max:"4"` } func (x *BeaconBlockBodyePBS) Reset() { @@ -4901,7 +4901,7 @@ func (x *BeaconBlockBodyePBS) GetSignedExecutionPayloadHeader() *v1.SignedExecut return nil } -func (x *BeaconBlockBodyePBS) GetPayloadAttestations() []*v1.PayloadAttestation { +func (x *BeaconBlockBodyePBS) GetPayloadAttestations() []*PayloadAttestation { if x != nil { return x.PayloadAttestations } @@ -5045,6 +5045,9 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x70, @@ -6375,7 +6378,7 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x2a, 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, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x65, 0x50, 0x42, 0x53, 0x52, 0x04, 0x62, 0x6f, 0x64, - 0x79, 0x22, 0xf1, 0x07, 0x0a, 0x13, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, + 0x79, 0x22, 0xf4, 0x07, 0x0a, 0x13, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x65, 0x50, 0x42, 0x53, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, @@ -6432,31 +6435,31 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_rawDesc = []byte{ 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x1c, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x12, 0x60, 0x0a, 0x14, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x63, 0x0a, 0x14, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, - 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x34, - 0x52, 0x13, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x7b, 0x0a, 0x15, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, - 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x50, 0x42, 0x53, 0x12, 0x3c, - 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 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, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x65, 0x50, 0x42, 0x53, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 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, 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, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 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, + 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x05, 0x92, 0xb5, + 0x18, 0x01, 0x34, 0x52, 0x13, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x7b, 0x0a, 0x15, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x50, 0x42, + 0x53, 0x12, 0x3c, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x26, 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, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x50, 0x42, 0x53, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 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, 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, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 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 ( @@ -6550,7 +6553,7 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_goTypes = []interface{}{ (*SignedConsolidation)(nil), // 74: ethereum.eth.v1alpha1.SignedConsolidation (*v1.ExecutionPayloadHeaderElectra)(nil), // 75: ethereum.engine.v1.ExecutionPayloadHeaderElectra (*v1.SignedExecutionPayloadHeader)(nil), // 76: ethereum.engine.v1.SignedExecutionPayloadHeader - (*v1.PayloadAttestation)(nil), // 77: ethereum.engine.v1.PayloadAttestation + (*PayloadAttestation)(nil), // 77: ethereum.eth.v1alpha1.PayloadAttestation } var file_proto_prysm_v1alpha1_beacon_block_proto_depIdxs = []int32{ 3, // 0: ethereum.eth.v1alpha1.GenericSignedBeaconBlock.phase0:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlock @@ -6715,7 +6718,7 @@ var file_proto_prysm_v1alpha1_beacon_block_proto_depIdxs = []int32{ 19, // 159: ethereum.eth.v1alpha1.BeaconBlockBodyePBS.sync_aggregate:type_name -> ethereum.eth.v1alpha1.SyncAggregate 68, // 160: ethereum.eth.v1alpha1.BeaconBlockBodyePBS.bls_to_execution_changes:type_name -> ethereum.eth.v1alpha1.SignedBLSToExecutionChange 76, // 161: ethereum.eth.v1alpha1.BeaconBlockBodyePBS.signed_execution_payload_header:type_name -> ethereum.engine.v1.SignedExecutionPayloadHeader - 77, // 162: ethereum.eth.v1alpha1.BeaconBlockBodyePBS.payload_attestations:type_name -> ethereum.engine.v1.PayloadAttestation + 77, // 162: ethereum.eth.v1alpha1.BeaconBlockBodyePBS.payload_attestations:type_name -> ethereum.eth.v1alpha1.PayloadAttestation 59, // 163: ethereum.eth.v1alpha1.SignedBeaconBlockePBS.block:type_name -> ethereum.eth.v1alpha1.BeaconBlockePBS 164, // [164:164] is the sub-list for method output_type 164, // [164:164] is the sub-list for method input_type @@ -6730,6 +6733,7 @@ func file_proto_prysm_v1alpha1_beacon_block_proto_init() { return } file_proto_prysm_v1alpha1_attestation_proto_init() + file_proto_prysm_v1alpha1_payload_attestation_proto_init() file_proto_prysm_v1alpha1_withdrawals_proto_init() file_proto_prysm_v1alpha1_eip_7251_proto_init() if !protoimpl.UnsafeEnabled { diff --git a/proto/prysm/v1alpha1/beacon_block.proto b/proto/prysm/v1alpha1/beacon_block.proto index 5024bf5beba1..bfde42dfbcc6 100644 --- a/proto/prysm/v1alpha1/beacon_block.proto +++ b/proto/prysm/v1alpha1/beacon_block.proto @@ -17,6 +17,7 @@ package ethereum.eth.v1alpha1; import "proto/eth/ext/options.proto"; import "proto/prysm/v1alpha1/attestation.proto"; +import "proto/prysm/v1alpha1/payload_attestation.proto"; import "proto/prysm/v1alpha1/withdrawals.proto"; import "proto/engine/v1/execution_engine.proto"; import "proto/prysm/v1alpha1/eip_7251.proto"; @@ -1017,7 +1018,7 @@ message BeaconBlockBodyePBS { ethereum.engine.v1.SignedExecutionPayloadHeader signed_execution_payload_header = 11; // Payload attestations. New in ePBS - repeated ethereum.engine.v1.PayloadAttestation payload_attestations = 12 [(ethereum.eth.ext.ssz_max) = "payload_attestation.size"]; + repeated PayloadAttestation payload_attestations = 12 [(ethereum.eth.ext.ssz_max) = "payload_attestation.size"]; } message SignedBeaconBlockePBS { diff --git a/proto/prysm/v1alpha1/generated.ssz.go b/proto/prysm/v1alpha1/generated.ssz.go index e7b387d5c2ce..ff9b93de16f1 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: cc8e907ec1a66a4edcfd9f8fd0180b75523c1b0b370704931022436aa7c10091 +// Hash: 995662707399e895c09a761cc6ba5bb215a8c01c9d172c5c56c7ef021b9a74f4 package eth import ( @@ -12633,10 +12633,10 @@ func (b *BeaconBlockBodyePBS) UnmarshalSSZ(buf []byte) error { if err != nil { return err } - b.PayloadAttestations = make([]*v1.PayloadAttestation, num) + b.PayloadAttestations = make([]*PayloadAttestation, num) for ii := 0; ii < num; ii++ { if b.PayloadAttestations[ii] == nil { - b.PayloadAttestations[ii] = new(v1.PayloadAttestation) + b.PayloadAttestations[ii] = new(PayloadAttestation) } if err = b.PayloadAttestations[ii].UnmarshalSSZ(buf[ii*208 : (ii+1)*208]); err != nil { return err @@ -20703,6 +20703,293 @@ func (b *BlobSidecarsByRangeRequest) HashTreeRootWith(hh *ssz.Hasher) (err error return } +// MarshalSSZ ssz marshals the PayloadAttestationData object +func (p *PayloadAttestationData) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(p) +} + +// MarshalSSZTo ssz marshals the PayloadAttestationData object to a target array +func (p *PayloadAttestationData) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'BeaconBlockRoot' + if size := len(p.BeaconBlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) + return + } + dst = append(dst, p.BeaconBlockRoot...) + + // Field (1) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(p.Slot)) + + // Field (2) 'PayloadStatus' + dst = ssz.MarshalUint64(dst, uint64(p.PayloadStatus)) + + return +} + +// UnmarshalSSZ ssz unmarshals the PayloadAttestationData object +func (p *PayloadAttestationData) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 48 { + return ssz.ErrSize + } + + // Field (0) 'BeaconBlockRoot' + if cap(p.BeaconBlockRoot) == 0 { + p.BeaconBlockRoot = make([]byte, 0, len(buf[0:32])) + } + p.BeaconBlockRoot = append(p.BeaconBlockRoot, buf[0:32]...) + + // Field (1) 'Slot' + p.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[32:40])) + + // Field (2) 'PayloadStatus' + p.PayloadStatus = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.PTCStatus(ssz.UnmarshallUint64(buf[40:48])) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the PayloadAttestationData object +func (p *PayloadAttestationData) SizeSSZ() (size int) { + size = 48 + return +} + +// HashTreeRoot ssz hashes the PayloadAttestationData object +func (p *PayloadAttestationData) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(p) +} + +// HashTreeRootWith ssz hashes the PayloadAttestationData object with a hasher +func (p *PayloadAttestationData) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'BeaconBlockRoot' + if size := len(p.BeaconBlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) + return + } + hh.PutBytes(p.BeaconBlockRoot) + + // Field (1) 'Slot' + hh.PutUint64(uint64(p.Slot)) + + // Field (2) 'PayloadStatus' + hh.PutUint64(uint64(p.PayloadStatus)) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the PayloadAttestation object +func (p *PayloadAttestation) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(p) +} + +// MarshalSSZTo ssz marshals the PayloadAttestation object to a target array +func (p *PayloadAttestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'AggregationBits' + if size := len(p.AggregationBits); size != 64 { + err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 64) + return + } + dst = append(dst, p.AggregationBits...) + + // Field (1) 'Data' + if p.Data == nil { + p.Data = new(PayloadAttestationData) + } + if dst, err = p.Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'Signature' + if size := len(p.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, p.Signature...) + + return +} + +// UnmarshalSSZ ssz unmarshals the PayloadAttestation object +func (p *PayloadAttestation) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 208 { + return ssz.ErrSize + } + + // Field (0) 'AggregationBits' + if cap(p.AggregationBits) == 0 { + p.AggregationBits = make([]byte, 0, len(buf[0:64])) + } + p.AggregationBits = append(p.AggregationBits, buf[0:64]...) + + // Field (1) 'Data' + if p.Data == nil { + p.Data = new(PayloadAttestationData) + } + if err = p.Data.UnmarshalSSZ(buf[64:112]); err != nil { + return err + } + + // Field (2) 'Signature' + if cap(p.Signature) == 0 { + p.Signature = make([]byte, 0, len(buf[112:208])) + } + p.Signature = append(p.Signature, buf[112:208]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the PayloadAttestation object +func (p *PayloadAttestation) SizeSSZ() (size int) { + size = 208 + return +} + +// HashTreeRoot ssz hashes the PayloadAttestation object +func (p *PayloadAttestation) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(p) +} + +// HashTreeRootWith ssz hashes the PayloadAttestation object with a hasher +func (p *PayloadAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AggregationBits' + if size := len(p.AggregationBits); size != 64 { + err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 64) + return + } + hh.PutBytes(p.AggregationBits) + + // Field (1) 'Data' + if err = p.Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Signature' + if size := len(p.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(p.Signature) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + +// MarshalSSZ ssz marshals the PayloadAttestationMessage object +func (p *PayloadAttestationMessage) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(p) +} + +// MarshalSSZTo ssz marshals the PayloadAttestationMessage object to a target array +func (p *PayloadAttestationMessage) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'ValidatorIndex' + dst = ssz.MarshalUint64(dst, uint64(p.ValidatorIndex)) + + // Field (1) 'Data' + if p.Data == nil { + p.Data = new(PayloadAttestationData) + } + if dst, err = p.Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'Signature' + if size := len(p.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, p.Signature...) + + return +} + +// UnmarshalSSZ ssz unmarshals the PayloadAttestationMessage object +func (p *PayloadAttestationMessage) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 152 { + return ssz.ErrSize + } + + // Field (0) 'ValidatorIndex' + p.ValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'Data' + if p.Data == nil { + p.Data = new(PayloadAttestationData) + } + if err = p.Data.UnmarshalSSZ(buf[8:56]); err != nil { + return err + } + + // Field (2) 'Signature' + if cap(p.Signature) == 0 { + p.Signature = make([]byte, 0, len(buf[56:152])) + } + p.Signature = append(p.Signature, buf[56:152]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the PayloadAttestationMessage object +func (p *PayloadAttestationMessage) SizeSSZ() (size int) { + size = 152 + return +} + +// HashTreeRoot ssz hashes the PayloadAttestationMessage object +func (p *PayloadAttestationMessage) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(p) +} + +// HashTreeRootWith ssz hashes the PayloadAttestationMessage object with a hasher +func (p *PayloadAttestationMessage) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'ValidatorIndex' + hh.PutUint64(uint64(p.ValidatorIndex)) + + // Field (1) 'Data' + if err = p.Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Signature' + if size := len(p.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(p.Signature) + + if ssz.EnableVectorizedHTR { + hh.MerkleizeVectorizedHTR(indx) + } else { + hh.Merkleize(indx) + } + return +} + // MarshalSSZ ssz marshals the DepositSnapshot object func (d *DepositSnapshot) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(d) diff --git a/proto/prysm/v1alpha1/payload_attestation.pb.go b/proto/prysm/v1alpha1/payload_attestation.pb.go new file mode 100755 index 000000000000..1d62c2ea7ace --- /dev/null +++ b/proto/prysm/v1alpha1/payload_attestation.pb.go @@ -0,0 +1,376 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.25.1 +// source: proto/prysm/v1alpha1/payload_attestation.proto + +package eth + +import ( + reflect "reflect" + sync "sync" + + github_com_prysmaticlabs_go_bitfield "github.com/prysmaticlabs/go-bitfield" + github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + _ "github.com/prysmaticlabs/prysm/v5/proto/eth/ext" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PayloadAttestationData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BeaconBlockRoot []byte `protobuf:"bytes,1,opt,name=beacon_block_root,json=beaconBlockRoot,proto3" json:"beacon_block_root,omitempty" ssz-size:"32"` + Slot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,2,opt,name=slot,proto3" json:"slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` + PayloadStatus github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.PTCStatus `protobuf:"varint,3,opt,name=payload_status,json=payloadStatus,proto3" json:"payload_status,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.PTCStatus"` +} + +func (x *PayloadAttestationData) Reset() { + *x = PayloadAttestationData{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_payload_attestation_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PayloadAttestationData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PayloadAttestationData) ProtoMessage() {} + +func (x *PayloadAttestationData) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_payload_attestation_proto_msgTypes[0] + 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 PayloadAttestationData.ProtoReflect.Descriptor instead. +func (*PayloadAttestationData) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_payload_attestation_proto_rawDescGZIP(), []int{0} +} + +func (x *PayloadAttestationData) GetBeaconBlockRoot() []byte { + if x != nil { + return x.BeaconBlockRoot + } + return nil +} + +func (x *PayloadAttestationData) GetSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { + if x != nil { + return x.Slot + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) +} + +func (x *PayloadAttestationData) GetPayloadStatus() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.PTCStatus { + if x != nil { + return x.PayloadStatus + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.PTCStatus(0) +} + +type PayloadAttestation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AggregationBits github_com_prysmaticlabs_go_bitfield.Bitvector512 `protobuf:"bytes,1,opt,name=aggregation_bits,json=aggregationBits,proto3" json:"aggregation_bits,omitempty" cast-type:"github.com/prysmaticlabs/go-bitfield.Bitvector512" ssz-size:"64"` + Data *PayloadAttestationData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` +} + +func (x *PayloadAttestation) Reset() { + *x = PayloadAttestation{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_payload_attestation_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PayloadAttestation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PayloadAttestation) ProtoMessage() {} + +func (x *PayloadAttestation) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_payload_attestation_proto_msgTypes[1] + 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 PayloadAttestation.ProtoReflect.Descriptor instead. +func (*PayloadAttestation) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_payload_attestation_proto_rawDescGZIP(), []int{1} +} + +func (x *PayloadAttestation) GetAggregationBits() github_com_prysmaticlabs_go_bitfield.Bitvector512 { + if x != nil { + return x.AggregationBits + } + return github_com_prysmaticlabs_go_bitfield.Bitvector512(nil) +} + +func (x *PayloadAttestation) GetData() *PayloadAttestationData { + if x != nil { + return x.Data + } + return nil +} + +func (x *PayloadAttestation) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type PayloadAttestationMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ValidatorIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` + Data *PayloadAttestationData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` +} + +func (x *PayloadAttestationMessage) Reset() { + *x = PayloadAttestationMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_payload_attestation_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PayloadAttestationMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PayloadAttestationMessage) ProtoMessage() {} + +func (x *PayloadAttestationMessage) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_payload_attestation_proto_msgTypes[2] + 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 PayloadAttestationMessage.ProtoReflect.Descriptor instead. +func (*PayloadAttestationMessage) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_payload_attestation_proto_rawDescGZIP(), []int{2} +} + +func (x *PayloadAttestationMessage) GetValidatorIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { + if x != nil { + return x.ValidatorIndex + } + return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) +} + +func (x *PayloadAttestationMessage) GetData() *PayloadAttestationData { + if x != nil { + return x.Data + } + return nil +} + +func (x *PayloadAttestationMessage) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +var File_proto_prysm_v1alpha1_payload_attestation_proto protoreflect.FileDescriptor + +var file_proto_prysm_v1alpha1_payload_attestation_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x15, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, + 0x74, 0x68, 0x2f, 0x65, 0x78, 0x74, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 0x02, 0x0a, 0x16, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x32, 0x0a, 0x11, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 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, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x02, 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, 0x71, + 0x0a, 0x0e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4a, 0x82, 0xb5, 0x18, 0x46, 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, 0x50, 0x54, 0x43, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x22, 0xe5, 0x01, 0x0a, 0x12, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x66, 0x0a, 0x10, 0x61, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x3b, 0x82, 0xb5, 0x18, 0x31, 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, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, 0x74, + 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x35, 0x31, 0x32, 0x8a, 0xb5, 0x18, 0x02, 0x36, 0x34, 0x52, + 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, + 0x12, 0x41, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 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, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xfe, 0x01, 0x0a, 0x19, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 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, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x12, 0x41, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 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, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x42, 0xa2, 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, 0x17, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 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 ( + file_proto_prysm_v1alpha1_payload_attestation_proto_rawDescOnce sync.Once + file_proto_prysm_v1alpha1_payload_attestation_proto_rawDescData = file_proto_prysm_v1alpha1_payload_attestation_proto_rawDesc +) + +func file_proto_prysm_v1alpha1_payload_attestation_proto_rawDescGZIP() []byte { + file_proto_prysm_v1alpha1_payload_attestation_proto_rawDescOnce.Do(func() { + file_proto_prysm_v1alpha1_payload_attestation_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_prysm_v1alpha1_payload_attestation_proto_rawDescData) + }) + return file_proto_prysm_v1alpha1_payload_attestation_proto_rawDescData +} + +var file_proto_prysm_v1alpha1_payload_attestation_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_proto_prysm_v1alpha1_payload_attestation_proto_goTypes = []interface{}{ + (*PayloadAttestationData)(nil), // 0: ethereum.eth.v1alpha1.PayloadAttestationData + (*PayloadAttestation)(nil), // 1: ethereum.eth.v1alpha1.PayloadAttestation + (*PayloadAttestationMessage)(nil), // 2: ethereum.eth.v1alpha1.PayloadAttestationMessage +} +var file_proto_prysm_v1alpha1_payload_attestation_proto_depIdxs = []int32{ + 0, // 0: ethereum.eth.v1alpha1.PayloadAttestation.data:type_name -> ethereum.eth.v1alpha1.PayloadAttestationData + 0, // 1: ethereum.eth.v1alpha1.PayloadAttestationMessage.data:type_name -> ethereum.eth.v1alpha1.PayloadAttestationData + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_proto_prysm_v1alpha1_payload_attestation_proto_init() } +func file_proto_prysm_v1alpha1_payload_attestation_proto_init() { + if File_proto_prysm_v1alpha1_payload_attestation_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_prysm_v1alpha1_payload_attestation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PayloadAttestationData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_payload_attestation_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PayloadAttestation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_prysm_v1alpha1_payload_attestation_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PayloadAttestationMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_prysm_v1alpha1_payload_attestation_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_proto_prysm_v1alpha1_payload_attestation_proto_goTypes, + DependencyIndexes: file_proto_prysm_v1alpha1_payload_attestation_proto_depIdxs, + MessageInfos: file_proto_prysm_v1alpha1_payload_attestation_proto_msgTypes, + }.Build() + File_proto_prysm_v1alpha1_payload_attestation_proto = out.File + file_proto_prysm_v1alpha1_payload_attestation_proto_rawDesc = nil + file_proto_prysm_v1alpha1_payload_attestation_proto_goTypes = nil + file_proto_prysm_v1alpha1_payload_attestation_proto_depIdxs = nil +} diff --git a/proto/prysm/v1alpha1/payload_attestation.pb.gw.go b/proto/prysm/v1alpha1/payload_attestation.pb.gw.go new file mode 100755 index 000000000000..cdd03643f0c7 --- /dev/null +++ b/proto/prysm/v1alpha1/payload_attestation.pb.gw.go @@ -0,0 +1,4 @@ +//go:build ignore +// +build ignore + +package ignore diff --git a/proto/prysm/v1alpha1/payload_attestation.proto b/proto/prysm/v1alpha1/payload_attestation.proto new file mode 100644 index 000000000000..7778245688ef --- /dev/null +++ b/proto/prysm/v1alpha1/payload_attestation.proto @@ -0,0 +1,43 @@ +// Copyright 2024 Prysmatic Labs. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +syntax = "proto3"; + +package ethereum.eth.v1alpha1; + +import "proto/eth/ext/options.proto"; + +option csharp_namespace = "Ethereum.Eth.v1alpha1"; +option go_package = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1;eth"; +option java_multiple_files = true; +option java_outer_classname = "PayloadAttestationProto"; +option java_package = "org.ethereum.eth.v1alpha1"; +option php_namespace = "Ethereum\\Eth\\v1alpha1"; + +message PayloadAttestationData { + bytes beacon_block_root = 1 [(ethereum.eth.ext.ssz_size) = "32"]; + uint64 slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; + uint64 payload_status = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.PTCStatus"]; +} + +message PayloadAttestation { + bytes aggregation_bits = 1 [(ethereum.eth.ext.ssz_size) = "ptc.size", (ethereum.eth.ext.cast_type) = "ptc.type"]; + PayloadAttestationData data = 2; + bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"]; +} + +message PayloadAttestationMessage { + uint64 validator_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; + PayloadAttestationData data = 2; + bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"]; +} diff --git a/proto/prysm/v1alpha1/validator-client/keymanager.pb.go b/proto/prysm/v1alpha1/validator-client/keymanager.pb.go index caf68d3882f1..c619a2e0f411 100755 --- a/proto/prysm/v1alpha1/validator-client/keymanager.pb.go +++ b/proto/prysm/v1alpha1/validator-client/keymanager.pb.go @@ -107,6 +107,7 @@ type SignRequest struct { // *SignRequest_BlindedBlockDeneb // *SignRequest_BlockElectra // *SignRequest_BlindedBlockElectra + // *SignRequest_PayloadAttestationData Object isSignRequest_Object `protobuf_oneof:"object"` SigningSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,6,opt,name=signing_slot,json=signingSlot,proto3" json:"signing_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` } @@ -304,6 +305,13 @@ func (x *SignRequest) GetBlindedBlockElectra() *v1alpha1.BlindedBeaconBlockElect return nil } +func (x *SignRequest) GetPayloadAttestationData() *v1alpha1.PayloadAttestationData { + if x, ok := x.GetObject().(*SignRequest_PayloadAttestationData); ok { + return x.PayloadAttestationData + } + return nil +} + func (x *SignRequest) GetSigningSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { if x != nil { return x.SigningSlot @@ -391,6 +399,10 @@ type SignRequest_BlindedBlockElectra struct { BlindedBlockElectra *v1alpha1.BlindedBeaconBlockElectra `protobuf:"bytes,119,opt,name=blinded_block_electra,json=blindedBlockElectra,proto3,oneof"` } +type SignRequest_PayloadAttestationData struct { + PayloadAttestationData *v1alpha1.PayloadAttestationData `protobuf:"bytes,120,opt,name=payload_attestation_data,json=payloadAttestationData,proto3,oneof"` +} + func (*SignRequest_Block) isSignRequest_Object() {} func (*SignRequest_AttestationData) isSignRequest_Object() {} @@ -429,6 +441,8 @@ func (*SignRequest_BlockElectra) isSignRequest_Object() {} func (*SignRequest_BlindedBlockElectra) isSignRequest_Object() {} +func (*SignRequest_PayloadAttestationData) isSignRequest_Object() {} + type SignResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -679,6 +693,9 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDesc = []byte 0x65, 0x74, 0x68, 0x2f, 0x65, 0x78, 0x74, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x61, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, @@ -687,7 +704,7 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDesc = []byte 0x63, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x29, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x74, 0x65, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa8, 0x0f, 0x0a, 0x0b, 0x53, + 0x74, 0x74, 0x65, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x93, 0x10, 0x0a, 0x0b, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x69, 0x67, @@ -802,85 +819,91 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDesc = []byte 0x70, 0x68, 0x61, 0x31, 0x2e, 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, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, - 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x68, 0x0a, 0x0c, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, - 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x06, 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, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x53, 0x6c, 0x6f, 0x74, 0x42, - 0x08, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, - 0x04, 0x08, 0x05, 0x10, 0x06, 0x22, 0xb7, 0x01, 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x12, 0x4b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x22, 0x3c, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, - 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x55, 0x43, 0x43, - 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4e, 0x49, 0x45, - 0x44, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x03, 0x22, - 0xb3, 0x01, 0x0a, 0x15, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x65, 0x65, - 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x47, - 0x0a, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x69, 0x0a, 0x18, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x78, 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, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x16, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, + 0x12, 0x68, 0x0a, 0x0c, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x6c, 0x6f, 0x74, + 0x18, 0x06, 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, 0x0b, 0x73, + 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x53, 0x6c, 0x6f, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, + 0x22, 0xb7, 0x01, 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, + 0x4b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, - 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x67, 0x72, 0x61, - 0x66, 0x66, 0x69, 0x74, 0x69, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x67, 0x72, 0x61, - 0x66, 0x66, 0x69, 0x74, 0x69, 0x22, 0xa6, 0x01, 0x0a, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, - 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x12, 0x63, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 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, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x08, 0x67, 0x61, - 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x22, 0xe7, - 0x02, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x74, 0x0a, 0x0f, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3c, 0x0a, 0x06, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x55, 0x43, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, + 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0a, + 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x03, 0x22, 0xb3, 0x01, 0x0a, 0x15, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, + 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x65, 0x65, + 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x07, 0x62, 0x75, 0x69, + 0x6c, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x69, 0x6c, + 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64, + 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, + 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, + 0x22, 0xa6, 0x01, 0x0a, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x63, 0x0a, 0x09, + 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 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, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x06, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x22, 0xe7, 0x02, 0x0a, 0x17, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x74, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4b, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x5c, 0x0a, 0x0e, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x50, 0x72, 0x6f, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x78, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x5c, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, - 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x78, - 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 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, 0x4b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0xce, 0x01, 0x0a, 0x22, 0x6f, 0x72, 0x67, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x42, - 0x0f, 0x4b, 0x65, 0x79, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x53, 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, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3b, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x70, 0x62, 0xaa, 0x02, 0x1e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x1e, 0x45, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x5c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5c, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x4b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x42, 0xce, 0x01, 0x0a, 0x22, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x42, 0x0f, 0x4b, 0x65, 0x79, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x53, 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, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2d, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x70, 0x62, 0xaa, 0x02, 0x1e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x2e, 0x56, 0x32, 0xca, 0x02, 0x1e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x5c, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -921,6 +944,7 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_goTypes = []inte (*v1alpha1.BlindedBeaconBlockDeneb)(nil), // 20: ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb (*v1alpha1.BeaconBlockElectra)(nil), // 21: ethereum.eth.v1alpha1.BeaconBlockElectra (*v1alpha1.BlindedBeaconBlockElectra)(nil), // 22: ethereum.eth.v1alpha1.BlindedBeaconBlockElectra + (*v1alpha1.PayloadAttestationData)(nil), // 23: ethereum.eth.v1alpha1.PayloadAttestationData } var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_depIdxs = []int32{ 7, // 0: ethereum.validator.accounts.v2.SignRequest.block:type_name -> ethereum.eth.v1alpha1.BeaconBlock @@ -939,16 +963,17 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_depIdxs = []int3 20, // 13: ethereum.validator.accounts.v2.SignRequest.blinded_block_deneb:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb 21, // 14: ethereum.validator.accounts.v2.SignRequest.block_electra:type_name -> ethereum.eth.v1alpha1.BeaconBlockElectra 22, // 15: ethereum.validator.accounts.v2.SignRequest.blinded_block_electra:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockElectra - 0, // 16: ethereum.validator.accounts.v2.SignResponse.status:type_name -> ethereum.validator.accounts.v2.SignResponse.Status - 4, // 17: ethereum.validator.accounts.v2.ProposerOptionPayload.builder:type_name -> ethereum.validator.accounts.v2.BuilderConfig - 6, // 18: ethereum.validator.accounts.v2.ProposerSettingsPayload.proposer_config:type_name -> ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry - 3, // 19: ethereum.validator.accounts.v2.ProposerSettingsPayload.default_config:type_name -> ethereum.validator.accounts.v2.ProposerOptionPayload - 3, // 20: ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry.value:type_name -> ethereum.validator.accounts.v2.ProposerOptionPayload - 21, // [21:21] is the sub-list for method output_type - 21, // [21:21] is the sub-list for method input_type - 21, // [21:21] is the sub-list for extension type_name - 21, // [21:21] is the sub-list for extension extendee - 0, // [0:21] is the sub-list for field type_name + 23, // 16: ethereum.validator.accounts.v2.SignRequest.payload_attestation_data:type_name -> ethereum.eth.v1alpha1.PayloadAttestationData + 0, // 17: ethereum.validator.accounts.v2.SignResponse.status:type_name -> ethereum.validator.accounts.v2.SignResponse.Status + 4, // 18: ethereum.validator.accounts.v2.ProposerOptionPayload.builder:type_name -> ethereum.validator.accounts.v2.BuilderConfig + 6, // 19: ethereum.validator.accounts.v2.ProposerSettingsPayload.proposer_config:type_name -> ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry + 3, // 20: ethereum.validator.accounts.v2.ProposerSettingsPayload.default_config:type_name -> ethereum.validator.accounts.v2.ProposerOptionPayload + 3, // 21: ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry.value:type_name -> ethereum.validator.accounts.v2.ProposerOptionPayload + 22, // [22:22] is the sub-list for method output_type + 22, // [22:22] 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 } func init() { file_proto_prysm_v1alpha1_validator_client_keymanager_proto_init() } @@ -1038,6 +1063,7 @@ func file_proto_prysm_v1alpha1_validator_client_keymanager_proto_init() { (*SignRequest_BlindedBlockDeneb)(nil), (*SignRequest_BlockElectra)(nil), (*SignRequest_BlindedBlockElectra)(nil), + (*SignRequest_PayloadAttestationData)(nil), } file_proto_prysm_v1alpha1_validator_client_keymanager_proto_msgTypes[2].OneofWrappers = []interface{}{} type x struct{} diff --git a/proto/prysm/v1alpha1/validator-client/keymanager.proto b/proto/prysm/v1alpha1/validator-client/keymanager.proto index 455cff32a2a6..14c94485c799 100644 --- a/proto/prysm/v1alpha1/validator-client/keymanager.proto +++ b/proto/prysm/v1alpha1/validator-client/keymanager.proto @@ -4,6 +4,7 @@ package ethereum.validator.accounts.v2; import "google/protobuf/wrappers.proto"; import "proto/eth/ext/options.proto"; import "proto/prysm/v1alpha1/attestation.proto"; +import "proto/prysm/v1alpha1/payload_attestation.proto"; import "proto/prysm/v1alpha1/beacon_block.proto"; import "proto/prysm/v1alpha1/beacon_state.proto"; import "proto/prysm/v1alpha1/sync_committee.proto"; @@ -65,6 +66,9 @@ message SignRequest { // Electra objects. ethereum.eth.v1alpha1.BeaconBlockElectra block_electra = 118; ethereum.eth.v1alpha1.BlindedBeaconBlockElectra blinded_block_electra = 119; + + // ePBS objects. + ethereum.eth.v1alpha1.PayloadAttestationData payload_attestation_data = 120; } reserved 4, 5; // Reserving old, deleted fields. uint64 signing_slot = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; diff --git a/testing/util/BUILD.bazel b/testing/util/BUILD.bazel index 3f6c1e6121be..b51ba73c3bdb 100644 --- a/testing/util/BUILD.bazel +++ b/testing/util/BUILD.bazel @@ -18,6 +18,7 @@ go_library( "deposits.go", "helpers.go", "merge.go", + "payload_attestation.go", "state.go", "sync_aggregate.go", "sync_committee.go", diff --git a/testing/util/payload_attestation.go b/testing/util/payload_attestation.go new file mode 100644 index 000000000000..a66a4d1e5a7b --- /dev/null +++ b/testing/util/payload_attestation.go @@ -0,0 +1,45 @@ +package util + +import ( + "crypto/rand" + "math/big" + "testing" + + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" +) + +// GenerateRandomPayloadAttestationData generates a random PayloadAttestationData for testing purposes. +func GenerateRandomPayloadAttestationData(t *testing.T) *ethpb.PayloadAttestationData { + // Generate a random BeaconBlockRoot + randomBytes := make([]byte, fieldparams.RootLength) + _, err := rand.Read(randomBytes) + if err != nil { + t.Fatalf("Failed to generate random BeaconBlockRoot: %v", err) + } + + // Generate a random Slot value + randomSlot, err := rand.Int(rand.Reader, big.NewInt(10000)) + if err != nil { + t.Fatalf("Failed to generate random Slot: %v", err) + } + + payloadStatuses := []primitives.PTCStatus{ + primitives.PAYLOAD_ABSENT, + primitives.PAYLOAD_PRESENT, + primitives.PAYLOAD_WITHHELD, + } + // Select a random PayloadStatus + index, err := rand.Int(rand.Reader, big.NewInt(int64(len(payloadStatuses)))) + if err != nil { + t.Fatalf("Failed to select random PayloadStatus: %v", err) + } + randomPayloadStatus := payloadStatuses[index.Int64()] + + return ðpb.PayloadAttestationData{ + BeaconBlockRoot: randomBytes, + Slot: primitives.Slot(randomSlot.Uint64()), + PayloadStatus: randomPayloadStatus, + } +} diff --git a/validator/client/BUILD.bazel b/validator/client/BUILD.bazel index bbcab6f56385..5c683dd218e5 100644 --- a/validator/client/BUILD.bazel +++ b/validator/client/BUILD.bazel @@ -9,6 +9,7 @@ go_library( "log.go", "metrics.go", "multiple_endpoints_grpc_resolver.go", + "payload_attestation.go", "propose.go", "registration.go", "runner.go", @@ -105,6 +106,7 @@ go_test( "attest_test.go", "key_reload_test.go", "metrics_test.go", + "payload_attestation_test.go", "propose_test.go", "registration_test.go", "runner_test.go", diff --git a/validator/client/payload_attestation.go b/validator/client/payload_attestation.go new file mode 100644 index 000000000000..3b405227dfd4 --- /dev/null +++ b/validator/client/payload_attestation.go @@ -0,0 +1,49 @@ +package client + +import ( + "context" + + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" + fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" + "github.com/prysmaticlabs/prysm/v5/config/params" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" + "github.com/prysmaticlabs/prysm/v5/time/slots" +) + +func (v *validator) signPayloadAttestation(ctx context.Context, p *ethpb.PayloadAttestationData, pubKey [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { + // Get domain data + epoch := slots.ToEpoch(p.Slot) + domain, err := v.domainData(ctx, epoch, params.BeaconConfig().DomainPTCAttester[:]) + if err != nil { + return nil, errors.Wrap(err, domainDataErr) + } + if domain == nil { + return nil, errors.New(domainDataErr) + } + + // Compute signing root + signingRoot, err := signing.ComputeSigningRoot(p, domain.SignatureDomain) + if err != nil { + return nil, errors.Wrap(err, signingRootErr) + } + + // Create signature request + signReq := &validatorpb.SignRequest{ + PublicKey: pubKey[:], + SigningRoot: signingRoot[:], + SignatureDomain: domain.SignatureDomain, + Object: &validatorpb.SignRequest_PayloadAttestationData{PayloadAttestationData: p}, + SigningSlot: p.Slot, + } + + // Sign the payload attestation data + sig, err := v.keyManager.Sign(ctx, signReq) + if err != nil { + return nil, errors.Wrap(err, "could not sign payload attestation") + } + + // Marshal the signature into bytes + return sig.Marshal(), nil +} diff --git a/validator/client/payload_attestation_test.go b/validator/client/payload_attestation_test.go new file mode 100644 index 000000000000..6c2f356404f5 --- /dev/null +++ b/validator/client/payload_attestation_test.go @@ -0,0 +1,51 @@ +package client + +import ( + "context" + "testing" + + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" + "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + "github.com/prysmaticlabs/prysm/v5/crypto/bls" + "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" + ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v5/testing/require" + "github.com/prysmaticlabs/prysm/v5/testing/util" + "go.uber.org/mock/gomock" +) + +func Test_validator_signPayloadAttestation(t *testing.T) { + v, m, vk, finish := setup(t, false) + defer finish() + + // Define constants and mock expectations + e := primitives.Epoch(1000) + m.validatorClient.EXPECT(). + DomainData(gomock.Any(), // ctx + ðpb.DomainRequest{ + Epoch: e, + Domain: params.BeaconConfig().DomainPTCAttester[:], + }). // epoch + Return(ðpb.DomainResponse{ + SignatureDomain: bytesutil.PadTo([]byte("signatureDomain"), 32), + }, nil) + + // Generate random payload attestation data + pa := util.GenerateRandomPayloadAttestationData(t) + pa.Slot = primitives.Slot(e) * params.BeaconConfig().SlotsPerEpoch // Verify that go mock EXPECT() gets the correct epoch. + + // Perform the signature operation + ctx := context.Background() + sig, err := v.signPayloadAttestation(ctx, pa, [48]byte(vk.PublicKey().Marshal())) + require.NoError(t, err) + + // Verify the signature + pb, err := bls.PublicKeyFromBytes(vk.PublicKey().Marshal()) + require.NoError(t, err) + signature, err := bls.SignatureFromBytes(sig) + require.NoError(t, err) + sr, err := signing.ComputeSigningRoot(pa, bytesutil.PadTo([]byte("signatureDomain"), 32)) + require.NoError(t, err) + require.Equal(t, true, signature.Verify(pb, sr[:])) +}