Add getpayloadbodies (#11973)

* el payload bodies code

* Add getPayloadBodies

* Add error 38004

* Add unmarshal

* Add ExecutionPayloadBodyV1 to proto

* Add EnableCapellaEngineMethods flag

* Small fixes

* Add proto files

* gazelle

* passing tests

* compile

* Add remaining tests

* fix tests

* Cleanup

* Fix gazelle

* Remove comments

* Rename the flag + add missing description

---------

Co-authored-by: rauljordan <raul@prysmaticlabs.com>
Co-authored-by: terencechain <terence@prysmaticlabs.com>
This commit is contained in:
Sammy Rosso
2023-03-14 16:52:16 +01:00
committed by GitHub
parent 8aec170f9b
commit 49f0c44dfe
10 changed files with 767 additions and 73 deletions

View File

@@ -78,7 +78,7 @@ func (x PayloadStatus_Status) Number() protoreflect.EnumNumber {
// Deprecated: Use PayloadStatus_Status.Descriptor instead.
func (PayloadStatus_Status) EnumDescriptor() ([]byte, []int) {
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{8, 0}
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{9, 0}
}
type ExecutionPayload struct {
@@ -232,6 +232,61 @@ func (x *ExecutionPayload) GetTransactions() [][]byte {
return nil
}
type ExecutionPayloadBodyV1 struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Transactions [][]byte `protobuf:"bytes,1,rep,name=transactions,proto3" json:"transactions,omitempty"`
Withdrawals []*Withdrawal `protobuf:"bytes,2,rep,name=withdrawals,proto3" json:"withdrawals,omitempty"`
}
func (x *ExecutionPayloadBodyV1) Reset() {
*x = ExecutionPayloadBodyV1{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExecutionPayloadBodyV1) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExecutionPayloadBodyV1) ProtoMessage() {}
func (x *ExecutionPayloadBodyV1) ProtoReflect() protoreflect.Message {
mi := &file_proto_engine_v1_execution_engine_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 ExecutionPayloadBodyV1.ProtoReflect.Descriptor instead.
func (*ExecutionPayloadBodyV1) Descriptor() ([]byte, []int) {
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{1}
}
func (x *ExecutionPayloadBodyV1) GetTransactions() [][]byte {
if x != nil {
return x.Transactions
}
return nil
}
func (x *ExecutionPayloadBodyV1) GetWithdrawals() []*Withdrawal {
if x != nil {
return x.Withdrawals
}
return nil
}
type ExecutionPayloadCapella struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -257,7 +312,7 @@ type ExecutionPayloadCapella struct {
func (x *ExecutionPayloadCapella) Reset() {
*x = ExecutionPayloadCapella{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[1]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -270,7 +325,7 @@ func (x *ExecutionPayloadCapella) String() string {
func (*ExecutionPayloadCapella) ProtoMessage() {}
func (x *ExecutionPayloadCapella) ProtoReflect() protoreflect.Message {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[1]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -283,7 +338,7 @@ func (x *ExecutionPayloadCapella) ProtoReflect() protoreflect.Message {
// Deprecated: Use ExecutionPayloadCapella.ProtoReflect.Descriptor instead.
func (*ExecutionPayloadCapella) Descriptor() ([]byte, []int) {
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{1}
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{2}
}
func (x *ExecutionPayloadCapella) GetParentHash() []byte {
@@ -403,7 +458,7 @@ type ExecutionPayloadCapellaWithValue struct {
func (x *ExecutionPayloadCapellaWithValue) Reset() {
*x = ExecutionPayloadCapellaWithValue{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[2]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -416,7 +471,7 @@ func (x *ExecutionPayloadCapellaWithValue) String() string {
func (*ExecutionPayloadCapellaWithValue) ProtoMessage() {}
func (x *ExecutionPayloadCapellaWithValue) ProtoReflect() protoreflect.Message {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[2]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -429,7 +484,7 @@ func (x *ExecutionPayloadCapellaWithValue) ProtoReflect() protoreflect.Message {
// Deprecated: Use ExecutionPayloadCapellaWithValue.ProtoReflect.Descriptor instead.
func (*ExecutionPayloadCapellaWithValue) Descriptor() ([]byte, []int) {
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{2}
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{3}
}
func (x *ExecutionPayloadCapellaWithValue) GetPayload() *ExecutionPayloadCapella {
@@ -470,7 +525,7 @@ type ExecutionPayloadHeader struct {
func (x *ExecutionPayloadHeader) Reset() {
*x = ExecutionPayloadHeader{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[3]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -483,7 +538,7 @@ func (x *ExecutionPayloadHeader) String() string {
func (*ExecutionPayloadHeader) ProtoMessage() {}
func (x *ExecutionPayloadHeader) ProtoReflect() protoreflect.Message {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[3]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -496,7 +551,7 @@ func (x *ExecutionPayloadHeader) ProtoReflect() protoreflect.Message {
// Deprecated: Use ExecutionPayloadHeader.ProtoReflect.Descriptor instead.
func (*ExecutionPayloadHeader) Descriptor() ([]byte, []int) {
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{3}
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{4}
}
func (x *ExecutionPayloadHeader) GetParentHash() []byte {
@@ -622,7 +677,7 @@ type ExecutionPayloadHeaderCapella struct {
func (x *ExecutionPayloadHeaderCapella) Reset() {
*x = ExecutionPayloadHeaderCapella{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -635,7 +690,7 @@ func (x *ExecutionPayloadHeaderCapella) String() string {
func (*ExecutionPayloadHeaderCapella) ProtoMessage() {}
func (x *ExecutionPayloadHeaderCapella) ProtoReflect() protoreflect.Message {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -648,7 +703,7 @@ func (x *ExecutionPayloadHeaderCapella) ProtoReflect() protoreflect.Message {
// Deprecated: Use ExecutionPayloadHeaderCapella.ProtoReflect.Descriptor instead.
func (*ExecutionPayloadHeaderCapella) Descriptor() ([]byte, []int) {
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{4}
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{5}
}
func (x *ExecutionPayloadHeaderCapella) GetParentHash() []byte {
@@ -769,7 +824,7 @@ type TransitionConfiguration struct {
func (x *TransitionConfiguration) Reset() {
*x = TransitionConfiguration{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -782,7 +837,7 @@ func (x *TransitionConfiguration) String() string {
func (*TransitionConfiguration) ProtoMessage() {}
func (x *TransitionConfiguration) ProtoReflect() protoreflect.Message {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -795,7 +850,7 @@ func (x *TransitionConfiguration) ProtoReflect() protoreflect.Message {
// Deprecated: Use TransitionConfiguration.ProtoReflect.Descriptor instead.
func (*TransitionConfiguration) Descriptor() ([]byte, []int) {
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{5}
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{6}
}
func (x *TransitionConfiguration) GetTerminalTotalDifficulty() string {
@@ -832,7 +887,7 @@ type PayloadAttributes struct {
func (x *PayloadAttributes) Reset() {
*x = PayloadAttributes{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -845,7 +900,7 @@ func (x *PayloadAttributes) String() string {
func (*PayloadAttributes) ProtoMessage() {}
func (x *PayloadAttributes) ProtoReflect() protoreflect.Message {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -858,7 +913,7 @@ func (x *PayloadAttributes) ProtoReflect() protoreflect.Message {
// Deprecated: Use PayloadAttributes.ProtoReflect.Descriptor instead.
func (*PayloadAttributes) Descriptor() ([]byte, []int) {
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{6}
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{7}
}
func (x *PayloadAttributes) GetTimestamp() uint64 {
@@ -896,7 +951,7 @@ type PayloadAttributesV2 struct {
func (x *PayloadAttributesV2) Reset() {
*x = PayloadAttributesV2{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -909,7 +964,7 @@ func (x *PayloadAttributesV2) String() string {
func (*PayloadAttributesV2) ProtoMessage() {}
func (x *PayloadAttributesV2) ProtoReflect() protoreflect.Message {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -922,7 +977,7 @@ func (x *PayloadAttributesV2) ProtoReflect() protoreflect.Message {
// Deprecated: Use PayloadAttributesV2.ProtoReflect.Descriptor instead.
func (*PayloadAttributesV2) Descriptor() ([]byte, []int) {
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{7}
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{8}
}
func (x *PayloadAttributesV2) GetTimestamp() uint64 {
@@ -966,7 +1021,7 @@ type PayloadStatus struct {
func (x *PayloadStatus) Reset() {
*x = PayloadStatus{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -979,7 +1034,7 @@ func (x *PayloadStatus) String() string {
func (*PayloadStatus) ProtoMessage() {}
func (x *PayloadStatus) ProtoReflect() protoreflect.Message {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[8]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -992,7 +1047,7 @@ func (x *PayloadStatus) ProtoReflect() protoreflect.Message {
// Deprecated: Use PayloadStatus.ProtoReflect.Descriptor instead.
func (*PayloadStatus) Descriptor() ([]byte, []int) {
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{8}
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{9}
}
func (x *PayloadStatus) GetStatus() PayloadStatus_Status {
@@ -1029,7 +1084,7 @@ type ForkchoiceState struct {
func (x *ForkchoiceState) Reset() {
*x = ForkchoiceState{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1042,7 +1097,7 @@ func (x *ForkchoiceState) String() string {
func (*ForkchoiceState) ProtoMessage() {}
func (x *ForkchoiceState) ProtoReflect() protoreflect.Message {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[9]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1055,7 +1110,7 @@ func (x *ForkchoiceState) ProtoReflect() protoreflect.Message {
// Deprecated: Use ForkchoiceState.ProtoReflect.Descriptor instead.
func (*ForkchoiceState) Descriptor() ([]byte, []int) {
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{9}
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{10}
}
func (x *ForkchoiceState) GetHeadBlockHash() []byte {
@@ -1093,7 +1148,7 @@ type Withdrawal struct {
func (x *Withdrawal) Reset() {
*x = Withdrawal{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1106,7 +1161,7 @@ func (x *Withdrawal) String() string {
func (*Withdrawal) ProtoMessage() {}
func (x *Withdrawal) ProtoReflect() protoreflect.Message {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[10]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1119,7 +1174,7 @@ func (x *Withdrawal) ProtoReflect() protoreflect.Message {
// Deprecated: Use Withdrawal.ProtoReflect.Descriptor instead.
func (*Withdrawal) Descriptor() ([]byte, []int) {
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{10}
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{11}
}
func (x *Withdrawal) GetIndex() uint64 {
@@ -1164,7 +1219,7 @@ type BlobsBundle struct {
func (x *BlobsBundle) Reset() {
*x = BlobsBundle{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1177,7 +1232,7 @@ func (x *BlobsBundle) String() string {
func (*BlobsBundle) ProtoMessage() {}
func (x *BlobsBundle) ProtoReflect() protoreflect.Message {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[11]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1190,7 +1245,7 @@ func (x *BlobsBundle) ProtoReflect() protoreflect.Message {
// Deprecated: Use BlobsBundle.ProtoReflect.Descriptor instead.
func (*BlobsBundle) Descriptor() ([]byte, []int) {
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{11}
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{12}
}
func (x *BlobsBundle) GetBlockHash() []byte {
@@ -1232,7 +1287,7 @@ type Blob struct {
func (x *Blob) Reset() {
*x = Blob{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1245,7 +1300,7 @@ func (x *Blob) String() string {
func (*Blob) ProtoMessage() {}
func (x *Blob) ProtoReflect() protoreflect.Message {
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[12]
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1258,7 +1313,7 @@ func (x *Blob) ProtoReflect() protoreflect.Message {
// Deprecated: Use Blob.ProtoReflect.Descriptor instead.
func (*Blob) Descriptor() ([]byte, []int) {
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{12}
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{13}
}
func (x *Blob) GetData() []byte {
@@ -1313,7 +1368,15 @@ var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{
0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x1d, 0x8a, 0xb5, 0x18, 0x03, 0x3f, 0x2c, 0x3f,
0x92, 0xb5, 0x18, 0x12, 0x31, 0x30, 0x34, 0x38, 0x35, 0x37, 0x36, 0x2c, 0x31, 0x30, 0x37, 0x33,
0x37, 0x34, 0x31, 0x38, 0x32, 0x34, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x22, 0x99, 0x05, 0x0a, 0x17, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69,
0x69, 0x6f, 0x6e, 0x73, 0x22, 0x7e, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f,
0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6f, 0x64, 0x79, 0x56, 0x31, 0x12, 0x22,
0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c,
0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65,
0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74,
0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61,
0x77, 0x61, 0x6c, 0x73, 0x22, 0x99, 0x05, 0x0a, 0x17, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69,
0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61,
0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70,
@@ -1559,34 +1622,36 @@ func file_proto_engine_v1_execution_engine_proto_rawDescGZIP() []byte {
}
var file_proto_engine_v1_execution_engine_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_proto_engine_v1_execution_engine_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
var file_proto_engine_v1_execution_engine_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
var file_proto_engine_v1_execution_engine_proto_goTypes = []interface{}{
(PayloadStatus_Status)(0), // 0: ethereum.engine.v1.PayloadStatus.Status
(*ExecutionPayload)(nil), // 1: ethereum.engine.v1.ExecutionPayload
(*ExecutionPayloadCapella)(nil), // 2: ethereum.engine.v1.ExecutionPayloadCapella
(*ExecutionPayloadCapellaWithValue)(nil), // 3: ethereum.engine.v1.ExecutionPayloadCapellaWithValue
(*ExecutionPayloadHeader)(nil), // 4: ethereum.engine.v1.ExecutionPayloadHeader
(*ExecutionPayloadHeaderCapella)(nil), // 5: ethereum.engine.v1.ExecutionPayloadHeaderCapella
(*TransitionConfiguration)(nil), // 6: ethereum.engine.v1.TransitionConfiguration
(*PayloadAttributes)(nil), // 7: ethereum.engine.v1.PayloadAttributes
(*PayloadAttributesV2)(nil), // 8: ethereum.engine.v1.PayloadAttributesV2
(*PayloadStatus)(nil), // 9: ethereum.engine.v1.PayloadStatus
(*ForkchoiceState)(nil), // 10: ethereum.engine.v1.ForkchoiceState
(*Withdrawal)(nil), // 11: ethereum.engine.v1.Withdrawal
(*BlobsBundle)(nil), // 12: ethereum.engine.v1.BlobsBundle
(*Blob)(nil), // 13: ethereum.engine.v1.Blob
(*ExecutionPayloadBodyV1)(nil), // 2: ethereum.engine.v1.ExecutionPayloadBodyV1
(*ExecutionPayloadCapella)(nil), // 3: ethereum.engine.v1.ExecutionPayloadCapella
(*ExecutionPayloadCapellaWithValue)(nil), // 4: ethereum.engine.v1.ExecutionPayloadCapellaWithValue
(*ExecutionPayloadHeader)(nil), // 5: ethereum.engine.v1.ExecutionPayloadHeader
(*ExecutionPayloadHeaderCapella)(nil), // 6: ethereum.engine.v1.ExecutionPayloadHeaderCapella
(*TransitionConfiguration)(nil), // 7: ethereum.engine.v1.TransitionConfiguration
(*PayloadAttributes)(nil), // 8: ethereum.engine.v1.PayloadAttributes
(*PayloadAttributesV2)(nil), // 9: ethereum.engine.v1.PayloadAttributesV2
(*PayloadStatus)(nil), // 10: ethereum.engine.v1.PayloadStatus
(*ForkchoiceState)(nil), // 11: ethereum.engine.v1.ForkchoiceState
(*Withdrawal)(nil), // 12: ethereum.engine.v1.Withdrawal
(*BlobsBundle)(nil), // 13: ethereum.engine.v1.BlobsBundle
(*Blob)(nil), // 14: ethereum.engine.v1.Blob
}
var file_proto_engine_v1_execution_engine_proto_depIdxs = []int32{
11, // 0: ethereum.engine.v1.ExecutionPayloadCapella.withdrawals:type_name -> ethereum.engine.v1.Withdrawal
2, // 1: ethereum.engine.v1.ExecutionPayloadCapellaWithValue.payload:type_name -> ethereum.engine.v1.ExecutionPayloadCapella
11, // 2: ethereum.engine.v1.PayloadAttributesV2.withdrawals:type_name -> ethereum.engine.v1.Withdrawal
0, // 3: ethereum.engine.v1.PayloadStatus.status:type_name -> ethereum.engine.v1.PayloadStatus.Status
13, // 4: ethereum.engine.v1.BlobsBundle.blobs:type_name -> ethereum.engine.v1.Blob
5, // [5:5] is the sub-list for method output_type
5, // [5:5] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
12, // 0: ethereum.engine.v1.ExecutionPayloadBodyV1.withdrawals:type_name -> ethereum.engine.v1.Withdrawal
12, // 1: ethereum.engine.v1.ExecutionPayloadCapella.withdrawals:type_name -> ethereum.engine.v1.Withdrawal
3, // 2: ethereum.engine.v1.ExecutionPayloadCapellaWithValue.payload:type_name -> ethereum.engine.v1.ExecutionPayloadCapella
12, // 3: ethereum.engine.v1.PayloadAttributesV2.withdrawals:type_name -> ethereum.engine.v1.Withdrawal
0, // 4: ethereum.engine.v1.PayloadStatus.status:type_name -> ethereum.engine.v1.PayloadStatus.Status
14, // 5: ethereum.engine.v1.BlobsBundle.blobs:type_name -> ethereum.engine.v1.Blob
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_execution_engine_proto_init() }
@@ -1608,7 +1673,7 @@ func file_proto_engine_v1_execution_engine_proto_init() {
}
}
file_proto_engine_v1_execution_engine_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExecutionPayloadCapella); i {
switch v := v.(*ExecutionPayloadBodyV1); i {
case 0:
return &v.state
case 1:
@@ -1620,7 +1685,7 @@ func file_proto_engine_v1_execution_engine_proto_init() {
}
}
file_proto_engine_v1_execution_engine_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExecutionPayloadCapellaWithValue); i {
switch v := v.(*ExecutionPayloadCapella); i {
case 0:
return &v.state
case 1:
@@ -1632,7 +1697,7 @@ func file_proto_engine_v1_execution_engine_proto_init() {
}
}
file_proto_engine_v1_execution_engine_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExecutionPayloadHeader); i {
switch v := v.(*ExecutionPayloadCapellaWithValue); i {
case 0:
return &v.state
case 1:
@@ -1644,7 +1709,7 @@ func file_proto_engine_v1_execution_engine_proto_init() {
}
}
file_proto_engine_v1_execution_engine_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExecutionPayloadHeaderCapella); i {
switch v := v.(*ExecutionPayloadHeader); i {
case 0:
return &v.state
case 1:
@@ -1656,7 +1721,7 @@ func file_proto_engine_v1_execution_engine_proto_init() {
}
}
file_proto_engine_v1_execution_engine_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TransitionConfiguration); i {
switch v := v.(*ExecutionPayloadHeaderCapella); i {
case 0:
return &v.state
case 1:
@@ -1668,7 +1733,7 @@ func file_proto_engine_v1_execution_engine_proto_init() {
}
}
file_proto_engine_v1_execution_engine_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PayloadAttributes); i {
switch v := v.(*TransitionConfiguration); i {
case 0:
return &v.state
case 1:
@@ -1680,7 +1745,7 @@ func file_proto_engine_v1_execution_engine_proto_init() {
}
}
file_proto_engine_v1_execution_engine_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PayloadAttributesV2); i {
switch v := v.(*PayloadAttributes); i {
case 0:
return &v.state
case 1:
@@ -1692,7 +1757,7 @@ func file_proto_engine_v1_execution_engine_proto_init() {
}
}
file_proto_engine_v1_execution_engine_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PayloadStatus); i {
switch v := v.(*PayloadAttributesV2); i {
case 0:
return &v.state
case 1:
@@ -1704,7 +1769,7 @@ func file_proto_engine_v1_execution_engine_proto_init() {
}
}
file_proto_engine_v1_execution_engine_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ForkchoiceState); i {
switch v := v.(*PayloadStatus); i {
case 0:
return &v.state
case 1:
@@ -1716,7 +1781,7 @@ func file_proto_engine_v1_execution_engine_proto_init() {
}
}
file_proto_engine_v1_execution_engine_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Withdrawal); i {
switch v := v.(*ForkchoiceState); i {
case 0:
return &v.state
case 1:
@@ -1728,7 +1793,7 @@ func file_proto_engine_v1_execution_engine_proto_init() {
}
}
file_proto_engine_v1_execution_engine_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BlobsBundle); i {
switch v := v.(*Withdrawal); i {
case 0:
return &v.state
case 1:
@@ -1740,6 +1805,18 @@ func file_proto_engine_v1_execution_engine_proto_init() {
}
}
file_proto_engine_v1_execution_engine_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BlobsBundle); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_engine_v1_execution_engine_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Blob); i {
case 0:
return &v.state
@@ -1758,7 +1835,7 @@ func file_proto_engine_v1_execution_engine_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_proto_engine_v1_execution_engine_proto_rawDesc,
NumEnums: 1,
NumMessages: 13,
NumMessages: 14,
NumExtensions: 0,
NumServices: 0,
},

View File

@@ -41,6 +41,11 @@ message ExecutionPayload {
repeated bytes transactions = 14 [(ethereum.eth.ext.ssz_size) = "?,?", (ethereum.eth.ext.ssz_max) = "1048576,1073741824"];
}
message ExecutionPayloadBodyV1 {
repeated bytes transactions = 1;
repeated Withdrawal withdrawals = 2;
}
message ExecutionPayloadCapella {
bytes parent_hash = 1 [(ethereum.eth.ext.ssz_size) = "32"];
bytes fee_recipient = 2 [(ethereum.eth.ext.ssz_size) = "20"];

View File

@@ -638,3 +638,42 @@ func (f *ForkchoiceState) UnmarshalJSON(enc []byte) error {
f.FinalizedBlockHash = dec.FinalizedBlockHash
return nil
}
type executionPayloadBodyV1JSON struct {
Transactions []hexutil.Bytes `json:"transactions"`
Withdrawals []*Withdrawal `json:"withdrawals"`
}
func (b *ExecutionPayloadBodyV1) MarshalJSON() ([]byte, error) {
transactions := make([]hexutil.Bytes, len(b.Transactions))
for i, tx := range b.Transactions {
transactions[i] = tx
}
if len(b.Withdrawals) == 0 {
b.Withdrawals = make([]*Withdrawal, 0)
}
return json.Marshal(executionPayloadBodyV1JSON{
Transactions: transactions,
Withdrawals: b.Withdrawals,
})
}
func (b *ExecutionPayloadBodyV1) UnmarshalJSON(enc []byte) error {
var decoded *executionPayloadBodyV1JSON
err := json.Unmarshal(enc, &decoded)
if err != nil {
return err
}
if len(decoded.Transactions) == 0 {
b.Transactions = make([][]byte, 0)
}
if len(decoded.Withdrawals) == 0 {
b.Withdrawals = make([]*Withdrawal, 0)
}
transactions := make([][]byte, len(decoded.Transactions))
for i, tx := range decoded.Transactions {
transactions[i] = tx
}
b.Transactions = transactions
return nil
}