From 62dca085c3549dee063fbf3e973bece2358b4217 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 21 Feb 2025 09:35:47 -0600 Subject: [PATCH 01/12] wip --- api/client/builder/client.go | 133 ++++- proto/engine/v1/BUILD.bazel | 1 + proto/engine/v1/engine.ssz.go | 128 +++++ proto/engine/v1/execution_engine.pb.go | 723 ++++++++++++++----------- proto/engine/v1/execution_engine.proto | 5 + proto/prysm/v1alpha1/BUILD.bazel | 6 +- proto/prysm/v1alpha1/bellatrix.ssz.go | 238 ++++++++ proto/prysm/v1alpha1/capella.ssz.go | 109 ++++ proto/prysm/v1alpha1/deneb.ssz.go | 109 ++++ proto/prysm/v1alpha1/electra.ssz.go | 109 ++++ 10 files changed, 1224 insertions(+), 337 deletions(-) diff --git a/api/client/builder/client.go b/api/client/builder/client.go index 34b791fbf2fa..27f4e2f74062 100644 --- a/api/client/builder/client.go +++ b/api/client/builder/client.go @@ -25,6 +25,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" log "github.com/sirupsen/logrus" + "google.golang.org/protobuf/proto" ) const ( @@ -51,6 +52,12 @@ func WithObserver(m observer) ClientOpt { } } +func WithSSZ() ClientOpt { + return func(c *Client) { + c.sszEnabled = true + } +} + type requestLogger struct{} func (*requestLogger) observe(r *http.Request) (e error) { @@ -94,9 +101,10 @@ type BuilderClient interface { // Client provides a collection of helper methods for calling Builder API endpoints. type Client struct { - hc *http.Client - baseURL *url.URL - obvs []observer + hc *http.Client + baseURL *url.URL + obvs []observer + sszEnabled bool } // NewClient constructs a new client with the provided options (ex WithTimeout). @@ -138,7 +146,7 @@ func (c *Client) NodeURL() string { type reqOption func(*http.Request) // do is a generic, opinionated request function to reduce boilerplate amongst the methods in this package api/client/builder. -func (c *Client) do(ctx context.Context, method string, path string, body io.Reader, opts ...reqOption) (res []byte, err error) { +func (c *Client) do(ctx context.Context, method string, path string, body io.Reader, opts ...reqOption) (res []byte, header http.Header, err error) { ctx, span := trace.StartSpan(ctx, "builder.client.do") defer func() { tracing.AnnotateError(span, err) @@ -186,6 +194,7 @@ func (c *Client) do(ctx context.Context, method string, path string, body io.Rea err = errors.Wrap(err, "error reading http response body from builder server") return } + header = r.Header return } @@ -215,20 +224,34 @@ func (c *Client) GetHeader(ctx context.Context, slot primitives.Slot, parentHash if err != nil { return nil, err } - hb, err := c.do(ctx, http.MethodGet, path, nil) + hb, header, err := c.do(ctx, http.MethodGet, path, nil) if err != nil { - return nil, err + return nil, errors.Wrap(err, "error getting header from builder server") } - v := &VersionResponse{} - if err := json.Unmarshal(hb, v); err != nil { - return nil, errors.Wrapf(err, "error unmarshaling the builder GetHeader response, using slot=%d, parentHash=%#x, pubkey=%#x", slot, parentHash, pubkey) + + var versionHeader string + if c.sszEnabled || header.Get(api.VersionHeader) != "" { + versionHeader = header.Get(api.VersionHeader) + } else { + v := &VersionResponse{} + if err := json.Unmarshal(hb, v); err != nil { + return nil, errors.Wrapf(err, "error unmarshaling the builder GetHeader response, using slot=%d, parentHash=%#x, pubkey=%#x", slot, parentHash, pubkey) + } + versionHeader = strings.ToLower(v.Version) } - ver, err := version.FromString(strings.ToLower(v.Version)) + ver, err := version.FromString(versionHeader) if err != nil { - return nil, errors.Wrap(err, fmt.Sprintf("unsupported header version %s", strings.ToLower(v.Version))) + return nil, errors.Wrap(err, fmt.Sprintf("unsupported header version %s", versionHeader)) } if ver >= version.Electra { + if c.sszEnabled { + sb := ðpb.SignedBuilderBidElectra{} + if err := sb.UnmarshalSSZ(hb); err != nil { + return nil, errors.Wrapf(err, "could not extract proto message from header") + } + return WrappedSignedBuilderBidElectra(sb) + } hr := &ExecHeaderResponseElectra{} if err := json.Unmarshal(hb, hr); err != nil { return nil, errors.Wrapf(err, "error unmarshaling the builder GetHeader response, using slot=%d, parentHash=%#x, pubkey=%#x", slot, parentHash, pubkey) @@ -240,6 +263,13 @@ func (c *Client) GetHeader(ctx context.Context, slot primitives.Slot, parentHash return WrappedSignedBuilderBidElectra(p) } if ver >= version.Deneb { + if c.sszEnabled { + sb := ðpb.SignedBuilderBidDeneb{} + if err := sb.UnmarshalSSZ(hb); err != nil { + return nil, errors.Wrapf(err, "could not extract proto message from header") + } + return WrappedSignedBuilderBidDeneb(sb) + } hr := &ExecHeaderResponseDeneb{} if err := json.Unmarshal(hb, hr); err != nil { return nil, errors.Wrapf(err, "error unmarshaling the builder GetHeader response, using slot=%d, parentHash=%#x, pubkey=%#x", slot, parentHash, pubkey) @@ -251,6 +281,13 @@ func (c *Client) GetHeader(ctx context.Context, slot primitives.Slot, parentHash return WrappedSignedBuilderBidDeneb(p) } if ver >= version.Capella { + if c.sszEnabled { + sb := ðpb.SignedBuilderBidCapella{} + if err := sb.UnmarshalSSZ(hb); err != nil { + return nil, errors.Wrapf(err, "could not extract proto message from header") + } + return WrappedSignedBuilderBidCapella(sb) + } hr := &ExecHeaderResponseCapella{} if err := json.Unmarshal(hb, hr); err != nil { return nil, errors.Wrapf(err, "error unmarshaling the builder GetHeader response, using slot=%d, parentHash=%#x, pubkey=%#x", slot, parentHash, pubkey) @@ -262,6 +299,13 @@ func (c *Client) GetHeader(ctx context.Context, slot primitives.Slot, parentHash return WrappedSignedBuilderBidCapella(p) } if ver >= version.Bellatrix { + if c.sszEnabled { + sb := ðpb.SignedBuilderBid{} + if err := sb.UnmarshalSSZ(hb); err != nil { + return nil, errors.Wrapf(err, "could not extract proto message from header") + } + return WrappedSignedBuilderBid(sb) + } hr := &ExecHeaderResponse{} if err := json.Unmarshal(hb, hr); err != nil { return nil, errors.Wrapf(err, "error unmarshaling the builder GetHeader response, using slot=%d, parentHash=%#x, pubkey=%#x", slot, parentHash, pubkey) @@ -272,7 +316,7 @@ func (c *Client) GetHeader(ctx context.Context, slot primitives.Slot, parentHash } return WrappedSignedBuilderBid(p) } - return nil, fmt.Errorf("unsupported header version %s", strings.ToLower(v.Version)) + return nil, fmt.Errorf("unsupported header version %s", versionHeader) } // RegisterValidator encodes the SignedValidatorRegistrationV1 message to json (including hex-encoding the byte @@ -298,7 +342,12 @@ func (c *Client) RegisterValidator(ctx context.Context, svr []*ethpb.SignedValid return err } - _, err = c.do(ctx, http.MethodPost, postRegisterValidatorPath, bytes.NewBuffer(body)) + postOpts := func(r *http.Request) { + r.Header.Set("Content-Type", api.JsonMediaType) + r.Header.Set("Accept", api.JsonMediaType) + } + + _, _, err = c.do(ctx, http.MethodPost, postRegisterValidatorPath, bytes.NewBuffer(body), postOpts) if err != nil { return err } @@ -332,10 +381,64 @@ func (c *Client) SubmitBlindedBlock(ctx context.Context, sb interfaces.ReadOnlyS } // post the blinded block - the execution payload response should contain the unblinded payload, along with the // blobs bundle if it is post deneb. - rb, err := c.do(ctx, http.MethodPost, postBlindedBeaconBlockPath, bytes.NewBuffer(body), postOpts) + rb, header, err := c.do(ctx, http.MethodPost, postBlindedBeaconBlockPath, bytes.NewBuffer(body), postOpts) if err != nil { return nil, nil, errors.Wrap(err, "error posting the blinded block to the builder api") } + + var versionHeader string + if c.sszEnabled || header.Get(api.VersionHeader) != "" { + versionHeader = header.Get(api.VersionHeader) + } else { + v := &VersionResponse{} + if err := json.Unmarshal(rb, v); err != nil { + return nil, nil, errors.Wrapf(err, "error") + } + versionHeader = strings.ToLower(v.Version) + } + + ver, err := version.FromString(versionHeader) + if err != nil { + return nil, nil, errors.Wrap(err, fmt.Sprintf("unsupported header version %s", versionHeader)) + } + + if c.sszEnabled { + if ver >= version.Deneb { + payload := v1.ExecutionPayloadDenebAndBlobsBundle{} + if err := payload.UnmarshalSSZ(rb); err != nil { + return nil, nil, errors.Wrapf(err, "error") + } + ed, err := blocks.NewWrappedExecutionData(proto.Message(&payload)) + if err != nil { + return nil, nil, err + } + return ed, nil, nil + } + if ver >= version.Capella { + payload := v1.ExecutionPayloadCapella{} + if err := payload.UnmarshalSSZ(rb); err != nil { + return nil, nil, errors.Wrapf(err, "error") + } + ed, err := blocks.NewWrappedExecutionData(proto.Message(&payload)) + if err != nil { + return nil, nil, err + } + return ed, nil, nil + } + if ver >= version.Bellatrix { + payload := v1.ExecutionPayload{} + if err := payload.UnmarshalSSZ(rb); err != nil { + return nil, nil, errors.Wrapf(err, "error") + } + ed, err := blocks.NewWrappedExecutionData(proto.Message(&payload)) + if err != nil { + return nil, nil, err + } + return ed, nil, nil + } + return nil, nil, fmt.Errorf("unsupported header version %s", versionHeader) + } + // ExecutionPayloadResponse parses just the outer container and the Value key, enabling it to use the .Value // key to determine which underlying data type to use to finish the unmarshaling. ep := &ExecutionPayloadResponse{} @@ -374,7 +477,7 @@ func (c *Client) SubmitBlindedBlock(ctx context.Context, sb interfaces.ReadOnlyS // response, and an error response may have an error message. This method will return a nil value for error in the // happy path, and an error with information about the server response body for a non-200 response. func (c *Client) Status(ctx context.Context) error { - _, err := c.do(ctx, http.MethodGet, getStatus, nil) + _, _, err := c.do(ctx, http.MethodGet, getStatus, nil) return err } diff --git a/proto/engine/v1/BUILD.bazel b/proto/engine/v1/BUILD.bazel index fad2e889531d..d5ce1a58fd1d 100644 --- a/proto/engine/v1/BUILD.bazel +++ b/proto/engine/v1/BUILD.bazel @@ -42,6 +42,7 @@ ssz_gen_marshal( "ExecutionPayloadHeaderCapella", "ExecutionPayloadHeaderDeneb", "ExecutionPayloadDeneb", + 'ExecutionPayloadDenebAndBlobsBundle', "BlindedBlobsBundle", "BlobsBundle", "Withdrawal", diff --git a/proto/engine/v1/engine.ssz.go b/proto/engine/v1/engine.ssz.go index b298fb0891a0..a979bcb947a2 100644 --- a/proto/engine/v1/engine.ssz.go +++ b/proto/engine/v1/engine.ssz.go @@ -1791,6 +1791,134 @@ func (e *ExecutionPayloadDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } +// MarshalSSZ ssz marshals the ExecutionPayloadDenebAndBlobsBundle object +func (e *ExecutionPayloadDenebAndBlobsBundle) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(e) +} + +// MarshalSSZTo ssz marshals the ExecutionPayloadDenebAndBlobsBundle object to a target array +func (e *ExecutionPayloadDenebAndBlobsBundle) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(8) + + // Offset (0) 'Payload' + dst = ssz.WriteOffset(dst, offset) + if e.Payload == nil { + e.Payload = new(ExecutionPayloadDeneb) + } + offset += e.Payload.SizeSSZ() + + // Offset (1) 'BlobsBundle' + dst = ssz.WriteOffset(dst, offset) + if e.BlobsBundle == nil { + e.BlobsBundle = new(BlobsBundle) + } + offset += e.BlobsBundle.SizeSSZ() + + // Field (0) 'Payload' + if dst, err = e.Payload.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'BlobsBundle' + if dst, err = e.BlobsBundle.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the ExecutionPayloadDenebAndBlobsBundle object +func (e *ExecutionPayloadDenebAndBlobsBundle) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 8 { + return ssz.ErrSize + } + + tail := buf + var o0, o1 uint64 + + // Offset (0) 'Payload' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 8 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (1) 'BlobsBundle' + if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { + return ssz.ErrOffset + } + + // Field (0) 'Payload' + { + buf = tail[o0:o1] + if e.Payload == nil { + e.Payload = new(ExecutionPayloadDeneb) + } + if err = e.Payload.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (1) 'BlobsBundle' + { + buf = tail[o1:] + if e.BlobsBundle == nil { + e.BlobsBundle = new(BlobsBundle) + } + if err = e.BlobsBundle.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadDenebAndBlobsBundle object +func (e *ExecutionPayloadDenebAndBlobsBundle) SizeSSZ() (size int) { + size = 8 + + // Field (0) 'Payload' + if e.Payload == nil { + e.Payload = new(ExecutionPayloadDeneb) + } + size += e.Payload.SizeSSZ() + + // Field (1) 'BlobsBundle' + if e.BlobsBundle == nil { + e.BlobsBundle = new(BlobsBundle) + } + size += e.BlobsBundle.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the ExecutionPayloadDenebAndBlobsBundle object +func (e *ExecutionPayloadDenebAndBlobsBundle) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(e) +} + +// HashTreeRootWith ssz hashes the ExecutionPayloadDenebAndBlobsBundle object with a hasher +func (e *ExecutionPayloadDenebAndBlobsBundle) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Payload' + if err = e.Payload.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'BlobsBundle' + if err = e.BlobsBundle.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + // MarshalSSZ ssz marshals the ExecutionPayloadHeader object func (e *ExecutionPayloadHeader) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(e) diff --git a/proto/engine/v1/execution_engine.pb.go b/proto/engine/v1/execution_engine.pb.go index 3dc96423ecf2..90a31ec4bbd1 100755 --- a/proto/engine/v1/execution_engine.pb.go +++ b/proto/engine/v1/execution_engine.pb.go @@ -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{11, 0} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{12, 0} } type ExecutionPayload struct { @@ -621,6 +621,61 @@ func (x *ExecutionPayloadCapellaWithValue) GetValue() []byte { return nil } +type ExecutionPayloadDenebAndBlobsBundle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payload *ExecutionPayloadDeneb `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + BlobsBundle *BlobsBundle `protobuf:"bytes,2,opt,name=blobs_bundle,json=blobsBundle,proto3" json:"blobs_bundle,omitempty"` +} + +func (x *ExecutionPayloadDenebAndBlobsBundle) Reset() { + *x = ExecutionPayloadDenebAndBlobsBundle{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExecutionPayloadDenebAndBlobsBundle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecutionPayloadDenebAndBlobsBundle) ProtoMessage() {} + +func (x *ExecutionPayloadDenebAndBlobsBundle) ProtoReflect() protoreflect.Message { + 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 { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExecutionPayloadDenebAndBlobsBundle.ProtoReflect.Descriptor instead. +func (*ExecutionPayloadDenebAndBlobsBundle) Descriptor() ([]byte, []int) { + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{4} +} + +func (x *ExecutionPayloadDenebAndBlobsBundle) GetPayload() *ExecutionPayloadDeneb { + if x != nil { + return x.Payload + } + return nil +} + +func (x *ExecutionPayloadDenebAndBlobsBundle) GetBlobsBundle() *BlobsBundle { + if x != nil { + return x.BlobsBundle + } + return nil +} + type ExecutionPayloadDenebWithValueAndBlobsBundle struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -635,7 +690,7 @@ type ExecutionPayloadDenebWithValueAndBlobsBundle struct { func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) Reset() { *x = ExecutionPayloadDenebWithValueAndBlobsBundle{} 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) } @@ -648,7 +703,7 @@ func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) String() string { func (*ExecutionPayloadDenebWithValueAndBlobsBundle) ProtoMessage() {} func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) 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 { @@ -661,7 +716,7 @@ func (x *ExecutionPayloadDenebWithValueAndBlobsBundle) ProtoReflect() protorefle // Deprecated: Use ExecutionPayloadDenebWithValueAndBlobsBundle.ProtoReflect.Descriptor instead. func (*ExecutionPayloadDenebWithValueAndBlobsBundle) 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 *ExecutionPayloadDenebWithValueAndBlobsBundle) GetPayload() *ExecutionPayloadDeneb { @@ -716,7 +771,7 @@ type ExecutionPayloadHeader struct { func (x *ExecutionPayloadHeader) Reset() { *x = ExecutionPayloadHeader{} 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) } @@ -729,7 +784,7 @@ func (x *ExecutionPayloadHeader) String() string { func (*ExecutionPayloadHeader) ProtoMessage() {} func (x *ExecutionPayloadHeader) 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 { @@ -742,7 +797,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{5} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{6} } func (x *ExecutionPayloadHeader) GetParentHash() []byte { @@ -868,7 +923,7 @@ type ExecutionPayloadHeaderCapella struct { func (x *ExecutionPayloadHeaderCapella) Reset() { *x = ExecutionPayloadHeaderCapella{} 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) } @@ -881,7 +936,7 @@ func (x *ExecutionPayloadHeaderCapella) String() string { func (*ExecutionPayloadHeaderCapella) ProtoMessage() {} func (x *ExecutionPayloadHeaderCapella) 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 { @@ -894,7 +949,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{6} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{7} } func (x *ExecutionPayloadHeaderCapella) GetParentHash() []byte { @@ -1029,7 +1084,7 @@ type ExecutionPayloadHeaderDeneb struct { func (x *ExecutionPayloadHeaderDeneb) Reset() { *x = ExecutionPayloadHeaderDeneb{} 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) } @@ -1042,7 +1097,7 @@ func (x *ExecutionPayloadHeaderDeneb) String() string { func (*ExecutionPayloadHeaderDeneb) ProtoMessage() {} func (x *ExecutionPayloadHeaderDeneb) 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 { @@ -1055,7 +1110,7 @@ func (x *ExecutionPayloadHeaderDeneb) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadHeaderDeneb.ProtoReflect.Descriptor instead. func (*ExecutionPayloadHeaderDeneb) 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 *ExecutionPayloadHeaderDeneb) GetParentHash() []byte { @@ -1190,7 +1245,7 @@ type PayloadAttributes struct { func (x *PayloadAttributes) Reset() { *x = PayloadAttributes{} 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) } @@ -1203,7 +1258,7 @@ func (x *PayloadAttributes) String() string { func (*PayloadAttributes) ProtoMessage() {} func (x *PayloadAttributes) 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 { @@ -1216,7 +1271,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{8} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{9} } func (x *PayloadAttributes) GetTimestamp() uint64 { @@ -1254,7 +1309,7 @@ type PayloadAttributesV2 struct { func (x *PayloadAttributesV2) Reset() { *x = PayloadAttributesV2{} 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) } @@ -1267,7 +1322,7 @@ func (x *PayloadAttributesV2) String() string { func (*PayloadAttributesV2) ProtoMessage() {} func (x *PayloadAttributesV2) 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 { @@ -1280,7 +1335,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{9} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{10} } func (x *PayloadAttributesV2) GetTimestamp() uint64 { @@ -1326,7 +1381,7 @@ type PayloadAttributesV3 struct { func (x *PayloadAttributesV3) Reset() { *x = PayloadAttributesV3{} 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) } @@ -1339,7 +1394,7 @@ func (x *PayloadAttributesV3) String() string { func (*PayloadAttributesV3) ProtoMessage() {} func (x *PayloadAttributesV3) 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 { @@ -1352,7 +1407,7 @@ func (x *PayloadAttributesV3) ProtoReflect() protoreflect.Message { // Deprecated: Use PayloadAttributesV3.ProtoReflect.Descriptor instead. func (*PayloadAttributesV3) 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 *PayloadAttributesV3) GetTimestamp() uint64 { @@ -1403,7 +1458,7 @@ type PayloadStatus struct { func (x *PayloadStatus) Reset() { *x = PayloadStatus{} 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) } @@ -1416,7 +1471,7 @@ func (x *PayloadStatus) String() string { func (*PayloadStatus) ProtoMessage() {} func (x *PayloadStatus) 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 { @@ -1429,7 +1484,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{11} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{12} } func (x *PayloadStatus) GetStatus() PayloadStatus_Status { @@ -1466,7 +1521,7 @@ type ForkchoiceState struct { func (x *ForkchoiceState) Reset() { *x = ForkchoiceState{} 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) } @@ -1479,7 +1534,7 @@ func (x *ForkchoiceState) String() string { func (*ForkchoiceState) ProtoMessage() {} func (x *ForkchoiceState) 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 { @@ -1492,7 +1547,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{12} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{13} } func (x *ForkchoiceState) GetHeadBlockHash() []byte { @@ -1530,7 +1585,7 @@ type Withdrawal struct { func (x *Withdrawal) Reset() { *x = Withdrawal{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1543,7 +1598,7 @@ func (x *Withdrawal) String() string { func (*Withdrawal) ProtoMessage() {} func (x *Withdrawal) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[13] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1556,7 +1611,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{13} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{14} } func (x *Withdrawal) GetIndex() uint64 { @@ -1600,7 +1655,7 @@ type BlobsBundle struct { func (x *BlobsBundle) Reset() { *x = BlobsBundle{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1613,7 +1668,7 @@ func (x *BlobsBundle) String() string { func (*BlobsBundle) ProtoMessage() {} func (x *BlobsBundle) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[14] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1626,7 +1681,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{14} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{15} } func (x *BlobsBundle) GetKzgCommitments() [][]byte { @@ -1661,7 +1716,7 @@ type Blob struct { func (x *Blob) Reset() { *x = Blob{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1674,7 +1729,7 @@ func (x *Blob) String() string { func (*Blob) ProtoMessage() {} func (x *Blob) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[15] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1687,7 +1742,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{15} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{16} } func (x *Blob) GetData() []byte { @@ -1709,7 +1764,7 @@ type BlobAndProof struct { func (x *BlobAndProof) Reset() { *x = BlobAndProof{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1722,7 +1777,7 @@ func (x *BlobAndProof) String() string { func (*BlobAndProof) ProtoMessage() {} func (x *BlobAndProof) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[16] + mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1735,7 +1790,7 @@ func (x *BlobAndProof) ProtoReflect() protoreflect.Message { // Deprecated: Use BlobAndProof.ProtoReflect.Descriptor instead. func (*BlobAndProof) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{16} + return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{17} } func (x *BlobAndProof) GetBlob() []byte { @@ -1893,145 +1948,166 @@ var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{ 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x85, 0x02, 0x0a, 0x2c, 0x45, 0x78, 0x65, 0x63, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xae, 0x01, 0x0a, 0x23, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, - 0x62, 0x57, 0x69, 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, - 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x43, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, - 0x65, 0x6e, 0x65, 0x62, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x5f, 0x62, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, - 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, - 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x73, 0x68, 0x6f, 0x75, 0x6c, - 0x64, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, - 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x22, - 0xc0, 0x04, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 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, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, - 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, - 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, - 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, - 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, - 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, - 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, - 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, - 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, - 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, - 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, - 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, - 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, - 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, - 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, - 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, - 0x6f, 0x74, 0x22, 0xfa, 0x04, 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 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, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, - 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, - 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, - 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, - 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, - 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, - 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, - 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, - 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, - 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, - 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, - 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, - 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, - 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, - 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, - 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, - 0xc4, 0x05, 0x0a, 0x1b, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 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, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, - 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, - 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, - 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, - 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, - 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, - 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, - 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, - 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, - 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, - 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, - 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, - 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, - 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, - 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, - 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, - 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, - 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, - 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x22, 0x9a, 0x01, 0x0a, 0x11, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, + 0x62, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, + 0x43, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x07, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x42, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x5f, 0x62, 0x75, + 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0b, 0x62, 0x6c, 0x6f, + 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x85, 0x02, 0x0a, 0x2c, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x65, 0x6e, + 0x65, 0x62, 0x57, 0x69, 0x74, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x6e, 0x64, 0x42, 0x6c, + 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x43, 0x0a, 0x07, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x5f, 0x62, 0x75, + 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0b, 0x62, 0x6c, 0x6f, + 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x73, 0x68, 0x6f, 0x75, + 0x6c, 0x64, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, + 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, 0x68, 0x6f, 0x75, 0x6c, + 0x64, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, + 0x22, 0xc0, 0x04, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 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, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, + 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, + 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, + 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, + 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, + 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, + 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, + 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, + 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, + 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, + 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, + 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, + 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, + 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, + 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, + 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, + 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, + 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x6f, 0x6f, 0x74, 0x22, 0xfa, 0x04, 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 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, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, + 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, + 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, + 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, + 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, + 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, + 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, + 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, + 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, + 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, + 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, + 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, + 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, + 0x22, 0xc4, 0x05, 0x0a, 0x1b, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, + 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, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, + 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, + 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, + 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, + 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, + 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, + 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, + 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, + 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, + 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, + 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, + 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, + 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, + 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, + 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, + 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x62, + 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, + 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, + 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, + 0x42, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x22, 0x9a, 0x01, 0x0a, 0x11, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x0a, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, + 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, + 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, + 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, + 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, + 0x69, 0x65, 0x6e, 0x74, 0x22, 0xe6, 0x01, 0x0a, 0x13, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x32, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, @@ -2040,110 +2116,100 @@ var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{ 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, - 0x65, 0x6e, 0x74, 0x22, 0xe6, 0x01, 0x0a, 0x13, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, - 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x32, 0x12, 0x1c, 0x0a, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, - 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, - 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, - 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, - 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, - 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, - 0x73, 0x18, 0x04, 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, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, - 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x22, 0xa7, 0x02, 0x0a, - 0x13, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x73, 0x56, 0x33, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, - 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, 0x73, - 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, - 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, - 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x77, - 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x04, 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, - 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, - 0x61, 0x77, 0x61, 0x6c, 0x73, 0x12, 0x3f, 0x0a, 0x18, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, - 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, - 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x15, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x92, 0x02, 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x40, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 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, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x32, 0x0a, 0x11, 0x6c, 0x61, - 0x74, 0x65, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x6c, - 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, 0x29, - 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x60, 0x0a, 0x06, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, - 0x12, 0x09, 0x0a, 0x05, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x49, - 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x59, 0x4e, 0x43, - 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, - 0x44, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x42, - 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x48, 0x41, 0x53, 0x48, 0x10, 0x05, 0x22, 0xab, 0x01, 0x0a, 0x0f, - 0x46, 0x6f, 0x72, 0x6b, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x2e, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, - 0x2e, 0x0a, 0x0f, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x0d, 0x73, 0x61, 0x66, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, - 0x38, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0xd6, 0x01, 0x0a, 0x0a, 0x57, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x78, - 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 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, 0x20, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, - 0x30, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x0f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, - 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x0e, 0x6b, - 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x28, 0x0a, - 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, - 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, - 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, 0x31, 0x33, - 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, 0x62, 0x6c, - 0x6f, 0x62, 0x73, 0x22, 0x26, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x1e, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x06, 0x31, - 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x53, 0x0a, 0x0c, 0x42, - 0x6c, 0x6f, 0x62, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x1e, 0x0a, 0x04, 0x62, - 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x06, 0x31, - 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x12, 0x23, 0x0a, 0x09, 0x6b, - 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x08, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x42, 0x96, 0x01, 0x0a, 0x16, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x45, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 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, 0x65, 0x6e, 0x67, - 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x76, 0x31, 0xaa, - 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, - 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, - 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x65, 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, + 0x6c, 0x73, 0x18, 0x04, 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, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, + 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x22, 0xa7, 0x02, + 0x0a, 0x13, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x56, 0x33, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, + 0x61, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x3e, 0x0a, 0x17, + 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, + 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, + 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0b, + 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x04, 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, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x12, 0x3f, 0x0a, 0x18, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x5f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x15, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x92, 0x02, 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x40, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 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, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x32, 0x0a, 0x11, 0x6c, + 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, + 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, + 0x29, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x60, 0x0a, 0x06, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, + 0x00, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, + 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x59, 0x4e, + 0x43, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, + 0x45, 0x44, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, + 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x48, 0x41, 0x53, 0x48, 0x10, 0x05, 0x22, 0xab, 0x01, 0x0a, + 0x0f, 0x46, 0x6f, 0x72, 0x6b, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x2e, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x2e, 0x0a, 0x0f, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x0d, 0x73, 0x61, 0x66, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x38, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, + 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0xd6, 0x01, 0x0a, 0x0a, 0x57, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, + 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, + 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 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, 0x20, 0x0a, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x32, 0x30, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, + 0x64, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x0f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, + 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x0e, + 0x6b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x28, + 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, + 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, + 0x52, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x08, 0x3f, 0x2c, 0x31, + 0x33, 0x31, 0x30, 0x37, 0x32, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x05, 0x62, + 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x26, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x1e, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x06, + 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x53, 0x0a, 0x0c, + 0x42, 0x6c, 0x6f, 0x62, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x1e, 0x0a, 0x04, + 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x06, + 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x12, 0x23, 0x0a, 0x09, + 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x08, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, + 0x66, 0x42, 0x96, 0x01, 0x0a, 0x16, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 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, 0x65, 0x6e, + 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x76, 0x31, + 0xaa, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x5c, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -2159,41 +2225,44 @@ 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, 17) +var file_proto_engine_v1_execution_engine_proto_msgTypes = make([]protoimpl.MessageInfo, 18) 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 (*ExecutionPayloadDeneb)(nil), // 3: ethereum.engine.v1.ExecutionPayloadDeneb (*ExecutionPayloadCapellaWithValue)(nil), // 4: ethereum.engine.v1.ExecutionPayloadCapellaWithValue - (*ExecutionPayloadDenebWithValueAndBlobsBundle)(nil), // 5: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle - (*ExecutionPayloadHeader)(nil), // 6: ethereum.engine.v1.ExecutionPayloadHeader - (*ExecutionPayloadHeaderCapella)(nil), // 7: ethereum.engine.v1.ExecutionPayloadHeaderCapella - (*ExecutionPayloadHeaderDeneb)(nil), // 8: ethereum.engine.v1.ExecutionPayloadHeaderDeneb - (*PayloadAttributes)(nil), // 9: ethereum.engine.v1.PayloadAttributes - (*PayloadAttributesV2)(nil), // 10: ethereum.engine.v1.PayloadAttributesV2 - (*PayloadAttributesV3)(nil), // 11: ethereum.engine.v1.PayloadAttributesV3 - (*PayloadStatus)(nil), // 12: ethereum.engine.v1.PayloadStatus - (*ForkchoiceState)(nil), // 13: ethereum.engine.v1.ForkchoiceState - (*Withdrawal)(nil), // 14: ethereum.engine.v1.Withdrawal - (*BlobsBundle)(nil), // 15: ethereum.engine.v1.BlobsBundle - (*Blob)(nil), // 16: ethereum.engine.v1.Blob - (*BlobAndProof)(nil), // 17: ethereum.engine.v1.BlobAndProof + (*ExecutionPayloadDenebAndBlobsBundle)(nil), // 5: ethereum.engine.v1.ExecutionPayloadDenebAndBlobsBundle + (*ExecutionPayloadDenebWithValueAndBlobsBundle)(nil), // 6: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle + (*ExecutionPayloadHeader)(nil), // 7: ethereum.engine.v1.ExecutionPayloadHeader + (*ExecutionPayloadHeaderCapella)(nil), // 8: ethereum.engine.v1.ExecutionPayloadHeaderCapella + (*ExecutionPayloadHeaderDeneb)(nil), // 9: ethereum.engine.v1.ExecutionPayloadHeaderDeneb + (*PayloadAttributes)(nil), // 10: ethereum.engine.v1.PayloadAttributes + (*PayloadAttributesV2)(nil), // 11: ethereum.engine.v1.PayloadAttributesV2 + (*PayloadAttributesV3)(nil), // 12: ethereum.engine.v1.PayloadAttributesV3 + (*PayloadStatus)(nil), // 13: ethereum.engine.v1.PayloadStatus + (*ForkchoiceState)(nil), // 14: ethereum.engine.v1.ForkchoiceState + (*Withdrawal)(nil), // 15: ethereum.engine.v1.Withdrawal + (*BlobsBundle)(nil), // 16: ethereum.engine.v1.BlobsBundle + (*Blob)(nil), // 17: ethereum.engine.v1.Blob + (*BlobAndProof)(nil), // 18: ethereum.engine.v1.BlobAndProof } var file_proto_engine_v1_execution_engine_proto_depIdxs = []int32{ - 14, // 0: ethereum.engine.v1.ExecutionPayloadCapella.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 14, // 1: ethereum.engine.v1.ExecutionPayloadDeneb.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 15, // 0: ethereum.engine.v1.ExecutionPayloadCapella.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 15, // 1: ethereum.engine.v1.ExecutionPayloadDeneb.withdrawals:type_name -> ethereum.engine.v1.Withdrawal 2, // 2: ethereum.engine.v1.ExecutionPayloadCapellaWithValue.payload:type_name -> ethereum.engine.v1.ExecutionPayloadCapella - 3, // 3: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadDeneb - 15, // 4: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle - 14, // 5: ethereum.engine.v1.PayloadAttributesV2.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 14, // 6: ethereum.engine.v1.PayloadAttributesV3.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 0, // 7: ethereum.engine.v1.PayloadStatus.status:type_name -> ethereum.engine.v1.PayloadStatus.Status - 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 + 3, // 3: ethereum.engine.v1.ExecutionPayloadDenebAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadDeneb + 16, // 4: ethereum.engine.v1.ExecutionPayloadDenebAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle + 3, // 5: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.payload:type_name -> ethereum.engine.v1.ExecutionPayloadDeneb + 16, // 6: ethereum.engine.v1.ExecutionPayloadDenebWithValueAndBlobsBundle.blobs_bundle:type_name -> ethereum.engine.v1.BlobsBundle + 15, // 7: ethereum.engine.v1.PayloadAttributesV2.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 15, // 8: ethereum.engine.v1.PayloadAttributesV3.withdrawals:type_name -> ethereum.engine.v1.Withdrawal + 0, // 9: ethereum.engine.v1.PayloadStatus.status:type_name -> ethereum.engine.v1.PayloadStatus.Status + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_proto_engine_v1_execution_engine_proto_init() } @@ -2251,7 +2320,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.(*ExecutionPayloadDenebWithValueAndBlobsBundle); i { + switch v := v.(*ExecutionPayloadDenebAndBlobsBundle); i { case 0: return &v.state case 1: @@ -2263,7 +2332,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.(*ExecutionPayloadHeader); i { + switch v := v.(*ExecutionPayloadDenebWithValueAndBlobsBundle); i { case 0: return &v.state case 1: @@ -2275,7 +2344,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.(*ExecutionPayloadHeaderCapella); i { + switch v := v.(*ExecutionPayloadHeader); i { case 0: return &v.state case 1: @@ -2287,7 +2356,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.(*ExecutionPayloadHeaderDeneb); i { + switch v := v.(*ExecutionPayloadHeaderCapella); i { case 0: return &v.state case 1: @@ -2299,7 +2368,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.(*PayloadAttributes); i { + switch v := v.(*ExecutionPayloadHeaderDeneb); i { case 0: return &v.state case 1: @@ -2311,7 +2380,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.(*PayloadAttributesV2); i { + switch v := v.(*PayloadAttributes); i { case 0: return &v.state case 1: @@ -2323,7 +2392,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.(*PayloadAttributesV3); i { + switch v := v.(*PayloadAttributesV2); i { case 0: return &v.state case 1: @@ -2335,7 +2404,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.(*PayloadStatus); i { + switch v := v.(*PayloadAttributesV3); i { case 0: return &v.state case 1: @@ -2347,7 +2416,7 @@ 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.(*ForkchoiceState); i { + switch v := v.(*PayloadStatus); i { case 0: return &v.state case 1: @@ -2359,7 +2428,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Withdrawal); i { + switch v := v.(*ForkchoiceState); i { case 0: return &v.state case 1: @@ -2371,7 +2440,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlobsBundle); i { + switch v := v.(*Withdrawal); i { case 0: return &v.state case 1: @@ -2383,7 +2452,7 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Blob); i { + switch v := v.(*BlobsBundle); i { case 0: return &v.state case 1: @@ -2395,6 +2464,18 @@ func file_proto_engine_v1_execution_engine_proto_init() { } } file_proto_engine_v1_execution_engine_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Blob); 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[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlobAndProof); i { case 0: return &v.state @@ -2413,7 +2494,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: 17, + NumMessages: 18, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/engine/v1/execution_engine.proto b/proto/engine/v1/execution_engine.proto index 70960d0adf27..462ee8daea43 100644 --- a/proto/engine/v1/execution_engine.proto +++ b/proto/engine/v1/execution_engine.proto @@ -97,6 +97,11 @@ message ExecutionPayloadCapellaWithValue { bytes value = 2; } +message ExecutionPayloadDenebAndBlobsBundle { + ExecutionPayloadDeneb payload = 1; + BlobsBundle blobs_bundle = 2; +} + message ExecutionPayloadDenebWithValueAndBlobsBundle { ExecutionPayloadDeneb payload = 1; bytes value = 2; diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index 309f0e8d385e..a5759b9fe545 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -104,6 +104,7 @@ ssz_bellatrix_objs = [ "BlindedBeaconBlockBodyBellatrix", "SignedBeaconBlockBellatrix", "SignedBlindedBeaconBlockBellatrix", + "SignedBuilderBid", ] ssz_capella_objs = [ @@ -124,6 +125,7 @@ ssz_capella_objs = [ "SignedBeaconBlockCapella", "SignedBlindedBeaconBlockCapella", "Withdrawal", + "SignedBuilderBidCapella", ] ssz_deneb_objs = [ @@ -145,6 +147,7 @@ ssz_deneb_objs = [ "SignedBeaconBlockContentsDeneb", "SignedBeaconBlockDeneb", "SignedBlindedBeaconBlockDeneb", + "SignedBuilderBidDeneb", ] ssz_electra_objs = [ @@ -175,7 +178,8 @@ ssz_electra_objs = [ "SignedBeaconBlockElectra", "SignedBlindedBeaconBlockElectra", "SignedConsolidation", - "SingleAttestation" + "SingleAttestation", + "SignedBuilderBidElectra", ] ssz_fulu_objs = [ diff --git a/proto/prysm/v1alpha1/bellatrix.ssz.go b/proto/prysm/v1alpha1/bellatrix.ssz.go index c7adfed44990..dda806248e38 100644 --- a/proto/prysm/v1alpha1/bellatrix.ssz.go +++ b/proto/prysm/v1alpha1/bellatrix.ssz.go @@ -7,6 +7,244 @@ import ( v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ) +// MarshalSSZ ssz marshals the SignedBuilderBid object +func (s *SignedBuilderBid) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBuilderBid object to a target array +func (s *SignedBuilderBid) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Message' + dst = ssz.WriteOffset(dst, offset) + if s.Message == nil { + s.Message = new(BuilderBid) + } + offset += s.Message.SizeSSZ() + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + // Field (0) 'Message' + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBuilderBid object +func (s *SignedBuilderBid) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Message' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Message' + { + buf = tail[o0:] + if s.Message == nil { + s.Message = new(BuilderBid) + } + if err = s.Message.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBuilderBid object +func (s *SignedBuilderBid) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(BuilderBid) + } + size += s.Message.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBuilderBid object +func (s *SignedBuilderBid) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBuilderBid object with a hasher +func (s *SignedBuilderBid) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the BuilderBid object +func (b *BuilderBid) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BuilderBid object to a target array +func (b *BuilderBid) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(84) + + // Offset (0) 'Header' + dst = ssz.WriteOffset(dst, offset) + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeader) + } + offset += b.Header.SizeSSZ() + + // Field (1) 'Value' + if size := len(b.Value); size != 32 { + err = ssz.ErrBytesLengthFn("--.Value", size, 32) + return + } + dst = append(dst, b.Value...) + + // Field (2) 'Pubkey' + if size := len(b.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + return + } + dst = append(dst, b.Pubkey...) + + // Field (0) 'Header' + if dst, err = b.Header.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BuilderBid object +func (b *BuilderBid) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 84 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Header' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 84 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Value' + if cap(b.Value) == 0 { + b.Value = make([]byte, 0, len(buf[4:36])) + } + b.Value = append(b.Value, buf[4:36]...) + + // Field (2) 'Pubkey' + if cap(b.Pubkey) == 0 { + b.Pubkey = make([]byte, 0, len(buf[36:84])) + } + b.Pubkey = append(b.Pubkey, buf[36:84]...) + + // Field (0) 'Header' + { + buf = tail[o0:] + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeader) + } + if err = b.Header.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BuilderBid object +func (b *BuilderBid) SizeSSZ() (size int) { + size = 84 + + // Field (0) 'Header' + if b.Header == nil { + b.Header = new(v1.ExecutionPayloadHeader) + } + size += b.Header.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BuilderBid object +func (b *BuilderBid) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BuilderBid object with a hasher +func (b *BuilderBid) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Header' + if err = b.Header.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Value' + if size := len(b.Value); size != 32 { + err = ssz.ErrBytesLengthFn("--.Value", size, 32) + return + } + hh.PutBytes(b.Value) + + // Field (2) 'Pubkey' + if size := len(b.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) + return + } + hh.PutBytes(b.Pubkey) + + hh.Merkleize(indx) + return +} + // MarshalSSZ ssz marshals the SignedBeaconBlockBellatrix object func (s *SignedBeaconBlockBellatrix) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) diff --git a/proto/prysm/v1alpha1/capella.ssz.go b/proto/prysm/v1alpha1/capella.ssz.go index 503f6a720fff..ead896bee95f 100644 --- a/proto/prysm/v1alpha1/capella.ssz.go +++ b/proto/prysm/v1alpha1/capella.ssz.go @@ -1613,6 +1613,115 @@ func (b *BlindedBeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err er return } +// MarshalSSZ ssz marshals the SignedBuilderBidCapella object +func (s *SignedBuilderBidCapella) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBuilderBidCapella object to a target array +func (s *SignedBuilderBidCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Message' + dst = ssz.WriteOffset(dst, offset) + if s.Message == nil { + s.Message = new(BuilderBidCapella) + } + offset += s.Message.SizeSSZ() + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + // Field (0) 'Message' + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBuilderBidCapella object +func (s *SignedBuilderBidCapella) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Message' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Message' + { + buf = tail[o0:] + if s.Message == nil { + s.Message = new(BuilderBidCapella) + } + if err = s.Message.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBuilderBidCapella object +func (s *SignedBuilderBidCapella) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(BuilderBidCapella) + } + size += s.Message.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBuilderBidCapella object +func (s *SignedBuilderBidCapella) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBuilderBidCapella object with a hasher +func (s *SignedBuilderBidCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + // MarshalSSZ ssz marshals the BuilderBidCapella object func (b *BuilderBidCapella) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) diff --git a/proto/prysm/v1alpha1/deneb.ssz.go b/proto/prysm/v1alpha1/deneb.ssz.go index 4eeab97e97c8..3cd1ca48e106 100644 --- a/proto/prysm/v1alpha1/deneb.ssz.go +++ b/proto/prysm/v1alpha1/deneb.ssz.go @@ -2151,6 +2151,115 @@ func (b *BlindedBeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err erro return } +// MarshalSSZ ssz marshals the SignedBuilderBidDeneb object +func (s *SignedBuilderBidDeneb) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBuilderBidDeneb object to a target array +func (s *SignedBuilderBidDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Message' + dst = ssz.WriteOffset(dst, offset) + if s.Message == nil { + s.Message = new(BuilderBidDeneb) + } + offset += s.Message.SizeSSZ() + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + // Field (0) 'Message' + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBuilderBidDeneb object +func (s *SignedBuilderBidDeneb) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Message' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Message' + { + buf = tail[o0:] + if s.Message == nil { + s.Message = new(BuilderBidDeneb) + } + if err = s.Message.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBuilderBidDeneb object +func (s *SignedBuilderBidDeneb) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(BuilderBidDeneb) + } + size += s.Message.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBuilderBidDeneb object +func (s *SignedBuilderBidDeneb) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBuilderBidDeneb object with a hasher +func (s *SignedBuilderBidDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + // MarshalSSZ ssz marshals the BuilderBidDeneb object func (b *BuilderBidDeneb) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) diff --git a/proto/prysm/v1alpha1/electra.ssz.go b/proto/prysm/v1alpha1/electra.ssz.go index 1fb5892f8f3c..dde5e5d3f330 100644 --- a/proto/prysm/v1alpha1/electra.ssz.go +++ b/proto/prysm/v1alpha1/electra.ssz.go @@ -887,6 +887,115 @@ func (b *BuilderBidElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } +// MarshalSSZ ssz marshals the SignedBuilderBidElectra object +func (s *SignedBuilderBidElectra) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBuilderBidElectra object to a target array +func (s *SignedBuilderBidElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Message' + dst = ssz.WriteOffset(dst, offset) + if s.Message == nil { + s.Message = new(BuilderBidElectra) + } + offset += s.Message.SizeSSZ() + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + // Field (0) 'Message' + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBuilderBidElectra object +func (s *SignedBuilderBidElectra) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Message' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Message' + { + buf = tail[o0:] + if s.Message == nil { + s.Message = new(BuilderBidElectra) + } + if err = s.Message.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBuilderBidElectra object +func (s *SignedBuilderBidElectra) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(BuilderBidElectra) + } + size += s.Message.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBuilderBidElectra object +func (s *SignedBuilderBidElectra) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBuilderBidElectra object with a hasher +func (s *SignedBuilderBidElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + // MarshalSSZ ssz marshals the SignedBeaconBlockContentsElectra object func (s *SignedBeaconBlockContentsElectra) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) From 91754b9bd3db4fe7721e504746832adcb4459e25 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 21 Feb 2025 13:57:37 -0600 Subject: [PATCH 02/12] refactoring functions for easier readability --- api/client/builder/client.go | 379 +++++++++++++++++--------- api/client/builder/client_test.go | 2 +- beacon-chain/builder/option.go | 7 +- cmd/beacon-chain/flags/base.go | 8 + cmd/beacon-chain/usage.go | 1 + proto/prysm/v1alpha1/BUILD.bazel | 2 +- proto/prysm/v1alpha1/bellatrix.ssz.go | 238 ---------------- proto/prysm/v1alpha1/non-core.ssz.go | 109 ++++++++ 8 files changed, 370 insertions(+), 376 deletions(-) diff --git a/api/client/builder/client.go b/api/client/builder/client.go index 27f4e2f74062..c62f16e714dd 100644 --- a/api/client/builder/client.go +++ b/api/client/builder/client.go @@ -162,10 +162,6 @@ func (c *Client) do(ctx context.Context, method string, path string, body io.Rea if err != nil { return } - if method == http.MethodPost { - req.Header.Set("Content-Type", api.JsonMediaType) - } - req.Header.Set("Accept", api.JsonMediaType) req.Header.Add("User-Agent", version.BuildData()) for _, o := range opts { o(req) @@ -224,18 +220,46 @@ func (c *Client) GetHeader(ctx context.Context, slot primitives.Slot, parentHash if err != nil { return nil, err } - hb, header, err := c.do(ctx, http.MethodGet, path, nil) + var getOpts reqOption + if c.sszEnabled { + getOpts = func(r *http.Request) { + r.Header.Set("Accept", api.OctetStreamMediaType) + } + } else { + getOpts = func(r *http.Request) { + r.Header.Set("Accept", api.JsonMediaType) + } + } + data, header, err := c.do(ctx, http.MethodGet, path, nil, getOpts) if err != nil { return nil, errors.Wrap(err, "error getting header from builder server") } + bid, err := c.parseHeaderResponse(data, header) + if err != nil { + return nil, errors.Wrapf( + err, + "error rendering exec header template with slot=%d, parentHash=%#x, pubkey=%#x", + slot, + parentHash, + pubkey, + ) + } + return bid, nil +} + +func (c *Client) parseHeaderResponse(data []byte, header http.Header) (SignedBid, error) { var versionHeader string if c.sszEnabled || header.Get(api.VersionHeader) != "" { versionHeader = header.Get(api.VersionHeader) } else { + // If we don't have a version header, attempt to parse JSON for version v := &VersionResponse{} - if err := json.Unmarshal(hb, v); err != nil { - return nil, errors.Wrapf(err, "error unmarshaling the builder GetHeader response, using slot=%d, parentHash=%#x, pubkey=%#x", slot, parentHash, pubkey) + if err := json.Unmarshal(data, v); err != nil { + return nil, errors.Wrap( + err, + "error unmarshaling builder GetHeader response", + ) } versionHeader = strings.ToLower(v.Version) } @@ -244,79 +268,95 @@ func (c *Client) GetHeader(ctx context.Context, slot primitives.Slot, parentHash if err != nil { return nil, errors.Wrap(err, fmt.Sprintf("unsupported header version %s", versionHeader)) } - if ver >= version.Electra { - if c.sszEnabled { - sb := ðpb.SignedBuilderBidElectra{} - if err := sb.UnmarshalSSZ(hb); err != nil { - return nil, errors.Wrapf(err, "could not extract proto message from header") - } - return WrappedSignedBuilderBidElectra(sb) - } - hr := &ExecHeaderResponseElectra{} - if err := json.Unmarshal(hb, hr); err != nil { - return nil, errors.Wrapf(err, "error unmarshaling the builder GetHeader response, using slot=%d, parentHash=%#x, pubkey=%#x", slot, parentHash, pubkey) - } - p, err := hr.ToProto() - if err != nil { - return nil, errors.Wrapf(err, "could not extract proto message from header") - } - return WrappedSignedBuilderBidElectra(p) - } - if ver >= version.Deneb { - if c.sszEnabled { - sb := ðpb.SignedBuilderBidDeneb{} - if err := sb.UnmarshalSSZ(hb); err != nil { - return nil, errors.Wrapf(err, "could not extract proto message from header") - } - return WrappedSignedBuilderBidDeneb(sb) - } - hr := &ExecHeaderResponseDeneb{} - if err := json.Unmarshal(hb, hr); err != nil { - return nil, errors.Wrapf(err, "error unmarshaling the builder GetHeader response, using slot=%d, parentHash=%#x, pubkey=%#x", slot, parentHash, pubkey) - } - p, err := hr.ToProto() - if err != nil { - return nil, errors.Wrapf(err, "could not extract proto message from header") - } - return WrappedSignedBuilderBidDeneb(p) - } - if ver >= version.Capella { - if c.sszEnabled { - sb := ðpb.SignedBuilderBidCapella{} - if err := sb.UnmarshalSSZ(hb); err != nil { - return nil, errors.Wrapf(err, "could not extract proto message from header") - } - return WrappedSignedBuilderBidCapella(sb) - } - hr := &ExecHeaderResponseCapella{} - if err := json.Unmarshal(hb, hr); err != nil { - return nil, errors.Wrapf(err, "error unmarshaling the builder GetHeader response, using slot=%d, parentHash=%#x, pubkey=%#x", slot, parentHash, pubkey) - } - p, err := hr.ToProto() - if err != nil { - return nil, errors.Wrapf(err, "could not extract proto message from header") + + switch { + case ver >= version.Electra: + return c.parseHeaderElectra(data) + case ver >= version.Deneb: + return c.parseHeaderDeneb(data) + case ver >= version.Capella: + return c.parseHeaderCapella(data) + case ver >= version.Bellatrix: + return c.parseHeaderBellatrix(data) + default: + return nil, fmt.Errorf("unsupported header version %s", versionHeader) + } +} + +func (c *Client) parseHeaderElectra(data []byte) (SignedBid, error) { + if c.sszEnabled { + sb := ðpb.SignedBuilderBidElectra{} + if err := sb.UnmarshalSSZ(data); err != nil { + return nil, errors.Wrap(err, "could not unmarshal SignedBuilderBidElectra SSZ") } - return WrappedSignedBuilderBidCapella(p) - } - if ver >= version.Bellatrix { - if c.sszEnabled { - sb := ðpb.SignedBuilderBid{} - if err := sb.UnmarshalSSZ(hb); err != nil { - return nil, errors.Wrapf(err, "could not extract proto message from header") - } - return WrappedSignedBuilderBid(sb) + return WrappedSignedBuilderBidElectra(sb) + } + hr := &ExecHeaderResponseElectra{} + if err := json.Unmarshal(data, hr); err != nil { + return nil, errors.Wrap(err, "could not unmarshal ExecHeaderResponseElectra JSON") + } + p, err := hr.ToProto() + if err != nil { + return nil, errors.Wrap(err, "could not convert ExecHeaderResponseElectra to proto") + } + return WrappedSignedBuilderBidElectra(p) +} + +func (c *Client) parseHeaderDeneb(data []byte) (SignedBid, error) { + if c.sszEnabled { + sb := ðpb.SignedBuilderBidDeneb{} + if err := sb.UnmarshalSSZ(data); err != nil { + return nil, errors.Wrap(err, "could not unmarshal SignedBuilderBidDeneb SSZ") } - hr := &ExecHeaderResponse{} - if err := json.Unmarshal(hb, hr); err != nil { - return nil, errors.Wrapf(err, "error unmarshaling the builder GetHeader response, using slot=%d, parentHash=%#x, pubkey=%#x", slot, parentHash, pubkey) + return WrappedSignedBuilderBidDeneb(sb) + } + hr := &ExecHeaderResponseDeneb{} + if err := json.Unmarshal(data, hr); err != nil { + return nil, errors.Wrap(err, "could not unmarshal ExecHeaderResponseDeneb JSON") + } + p, err := hr.ToProto() + if err != nil { + return nil, errors.Wrap(err, "could not convert ExecHeaderResponseDeneb to proto") + } + return WrappedSignedBuilderBidDeneb(p) +} + +func (c *Client) parseHeaderCapella(data []byte) (SignedBid, error) { + if c.sszEnabled { + sb := ðpb.SignedBuilderBidCapella{} + if err := sb.UnmarshalSSZ(data); err != nil { + return nil, errors.Wrap(err, "could not unmarshal SignedBuilderBidCapella SSZ") } - p, err := hr.ToProto() - if err != nil { - return nil, errors.Wrap(err, "could not extract proto message from header") + return WrappedSignedBuilderBidCapella(sb) + } + hr := &ExecHeaderResponseCapella{} + if err := json.Unmarshal(data, hr); err != nil { + return nil, errors.Wrap(err, "could not unmarshal ExecHeaderResponseCapella JSON") + } + p, err := hr.ToProto() + if err != nil { + return nil, errors.Wrap(err, "could not convert ExecHeaderResponseCapella to proto") + } + return WrappedSignedBuilderBidCapella(p) +} + +func (c *Client) parseHeaderBellatrix(data []byte) (SignedBid, error) { + if c.sszEnabled { + sb := ðpb.SignedBuilderBid{} + if err := sb.UnmarshalSSZ(data); err != nil { + return nil, errors.Wrap(err, "could not unmarshal SignedBuilderBid SSZ") } - return WrappedSignedBuilderBid(p) + return WrappedSignedBuilderBid(sb) + } + hr := &ExecHeaderResponse{} + if err := json.Unmarshal(data, hr); err != nil { + return nil, errors.Wrap(err, "could not unmarshal ExecHeaderResponse JSON") + } + p, err := hr.ToProto() + if err != nil { + return nil, errors.Wrap(err, "could not convert ExecHeaderResponse to proto") } - return nil, fmt.Errorf("unsupported header version %s", versionHeader) + return WrappedSignedBuilderBid(p) } // RegisterValidator encodes the SignedValidatorRegistrationV1 message to json (including hex-encoding the byte @@ -360,100 +400,164 @@ var errResponseVersionMismatch = errors.New("builder API response uses a differe // SubmitBlindedBlock calls the builder API endpoint that binds the validator to the builder and submits the block. // The response is the full execution payload used to create the blinded block. func (c *Client) SubmitBlindedBlock(ctx context.Context, sb interfaces.ReadOnlySignedBeaconBlock) (interfaces.ExecutionData, *v1.BlobsBundle, error) { - if !sb.IsBlinded() { - return nil, nil, errNotBlinded + body, postOpts, err := c.buildBlindedBlockRequest(sb) + if err != nil { + return nil, nil, err } - // massage the proto struct type data into the api response type. - mj, err := structs.SignedBeaconBlockMessageJsoner(sb) + // post the blinded block - the execution payload response should contain the unblinded payload, along with the + // blobs bundle if it is post deneb. + data, header, err := c.do(ctx, http.MethodPost, postBlindedBeaconBlockPath, bytes.NewBuffer(body), postOpts) if err != nil { - return nil, nil, errors.Wrap(err, "error generating blinded beacon block post request") + return nil, nil, errors.Wrap(err, "error posting the blinded block to the builder api") } - body, err := json.Marshal(mj) + ver, err := c.checkVersion(data, header) if err != nil { - return nil, nil, errors.Wrap(err, "error marshaling blinded block post request to json") + return nil, nil, err } - postOpts := func(r *http.Request) { - r.Header.Add("Eth-Consensus-Version", version.String(sb.Version())) - r.Header.Set("Content-Type", api.JsonMediaType) - r.Header.Set("Accept", api.JsonMediaType) + + // check if sent blinded block version matches received payload version + if version.String(ver) != version.String(sb.Version()) { + return nil, nil, errors.Wrapf(errResponseVersionMismatch, "req=%s, recv=%s", version.String(ver), version.String(sb.Version())) } - // post the blinded block - the execution payload response should contain the unblinded payload, along with the - // blobs bundle if it is post deneb. - rb, header, err := c.do(ctx, http.MethodPost, postBlindedBeaconBlockPath, bytes.NewBuffer(body), postOpts) + + ed, blobs, err := c.parseBlindedBlockResponse(data, ver) if err != nil { - return nil, nil, errors.Wrap(err, "error posting the blinded block to the builder api") + return nil, nil, err } + return ed, blobs, nil +} + +func (c *Client) checkVersion(respBytes []byte, header http.Header) (int, error) { var versionHeader string if c.sszEnabled || header.Get(api.VersionHeader) != "" { versionHeader = header.Get(api.VersionHeader) } else { + // fallback to JSON-based version extraction v := &VersionResponse{} - if err := json.Unmarshal(rb, v); err != nil { - return nil, nil, errors.Wrapf(err, "error") + if err := json.Unmarshal(respBytes, v); err != nil { + return 0, errors.Wrapf(err, "error unmarshaling JSON version fallback") } versionHeader = strings.ToLower(v.Version) } ver, err := version.FromString(versionHeader) if err != nil { - return nil, nil, errors.Wrap(err, fmt.Sprintf("unsupported header version %s", versionHeader)) + return 0, errors.Wrapf(err, "unsupported header version %s", versionHeader) + } + + return ver, nil +} + +// Helper: build request body for SubmitBlindedBlock +func (c *Client) buildBlindedBlockRequest(sb interfaces.ReadOnlySignedBeaconBlock) ([]byte, reqOption, error) { + if !sb.IsBlinded() { + return nil, nil, errNotBlinded } if c.sszEnabled { - if ver >= version.Deneb { - payload := v1.ExecutionPayloadDenebAndBlobsBundle{} - if err := payload.UnmarshalSSZ(rb); err != nil { - return nil, nil, errors.Wrapf(err, "error") - } - ed, err := blocks.NewWrappedExecutionData(proto.Message(&payload)) - if err != nil { - return nil, nil, err - } - return ed, nil, nil + body, err := sb.MarshalSSZ() + if err != nil { + return nil, nil, errors.Wrap(err, "could not marshal SSZ for blinded block") } - if ver >= version.Capella { - payload := v1.ExecutionPayloadCapella{} - if err := payload.UnmarshalSSZ(rb); err != nil { - return nil, nil, errors.Wrapf(err, "error") - } - ed, err := blocks.NewWrappedExecutionData(proto.Message(&payload)) - if err != nil { - return nil, nil, err - } - return ed, nil, nil + opt := func(r *http.Request) { + r.Header.Add("Eth-Consensus-Version", version.String(sb.Version())) + r.Header.Set("Content-Type", api.OctetStreamMediaType) + r.Header.Set("Accept", api.OctetStreamMediaType) } - if ver >= version.Bellatrix { - payload := v1.ExecutionPayload{} - if err := payload.UnmarshalSSZ(rb); err != nil { - return nil, nil, errors.Wrapf(err, "error") - } - ed, err := blocks.NewWrappedExecutionData(proto.Message(&payload)) - if err != nil { - return nil, nil, err - } - return ed, nil, nil + return body, opt, nil + } + + mj, err := structs.SignedBeaconBlockMessageJsoner(sb) + if err != nil { + return nil, nil, errors.Wrap(err, "error generating blinded beacon block post request") + } + body, err := json.Marshal(mj) + if err != nil { + return nil, nil, errors.Wrap(err, "error marshaling blinded block to JSON") + } + opt := func(r *http.Request) { + r.Header.Add("Eth-Consensus-Version", version.String(sb.Version())) + r.Header.Set("Content-Type", api.JsonMediaType) + r.Header.Set("Accept", api.JsonMediaType) + } + return body, opt, nil +} + +// Helper: parse the response returned by SubmitBlindedBlock +func (c *Client) parseBlindedBlockResponse( + respBytes []byte, + forkVersion int, +) (interfaces.ExecutionData, *v1.BlobsBundle, error) { + if c.sszEnabled { + return c.parseBlindedBlockResponseSSZ(respBytes, forkVersion) + } + return c.parseBlindedBlockResponseJSON(respBytes, forkVersion) +} + +func (c *Client) parseBlindedBlockResponseSSZ( + respBytes []byte, + forkVersion int, +) (interfaces.ExecutionData, *v1.BlobsBundle, error) { + switch { + case forkVersion >= version.Deneb: + payload := v1.ExecutionPayloadDenebAndBlobsBundle{} + if err := payload.UnmarshalSSZ(respBytes); err != nil { + return nil, nil, errors.Wrap(err, "unable to unmarshal ExecutionPayloadDenebAndBlobsBundle SSZ") } - return nil, nil, fmt.Errorf("unsupported header version %s", versionHeader) + ed, err := blocks.NewWrappedExecutionData(proto.Message(&payload)) + if err != nil { + return nil, nil, errors.Wrap(err, "unable to wrap execution data for Deneb") + } + return ed, payload.BlobsBundle, nil + case forkVersion >= version.Capella: + payload := v1.ExecutionPayloadCapella{} + if err := payload.UnmarshalSSZ(respBytes); err != nil { + return nil, nil, errors.Wrap(err, "unable to unmarshal ExecutionPayloadCapella SSZ") + } + ed, err := blocks.NewWrappedExecutionData(proto.Message(&payload)) + if err != nil { + return nil, nil, errors.Wrap(err, "unable to wrap execution data for Capella") + } + return ed, nil, nil + case forkVersion >= version.Bellatrix: + payload := v1.ExecutionPayload{} + if err := payload.UnmarshalSSZ(respBytes); err != nil { + return nil, nil, errors.Wrap(err, "unable to unmarshal ExecutionPayload SSZ") + } + ed, err := blocks.NewWrappedExecutionData(proto.Message(&payload)) + if err != nil { + return nil, nil, errors.Wrap(err, "unable to wrap execution data for Bellatrix") + } + return ed, nil, nil + default: + return nil, nil, fmt.Errorf("unsupported header version %s", version.String(forkVersion)) } +} + +func (c *Client) parseBlindedBlockResponseJSON( + respBytes []byte, + forkVersion int, +) (interfaces.ExecutionData, *v1.BlobsBundle, error) { - // ExecutionPayloadResponse parses just the outer container and the Value key, enabling it to use the .Value - // key to determine which underlying data type to use to finish the unmarshaling. ep := &ExecutionPayloadResponse{} - if err := json.Unmarshal(rb, ep); err != nil { - return nil, nil, errors.Wrap(err, "error unmarshaling the builder ExecutionPayloadResponse") + if err := json.Unmarshal(respBytes, ep); err != nil { + return nil, nil, errors.Wrap(err, "error unmarshaling ExecutionPayloadResponse") } - if strings.ToLower(ep.Version) != version.String(sb.Version()) { - return nil, nil, errors.Wrapf(errResponseVersionMismatch, "req=%s, recv=%s", strings.ToLower(ep.Version), version.String(sb.Version())) + if strings.ToLower(ep.Version) != version.String(forkVersion) { + return nil, nil, errors.Wrapf( + errResponseVersionMismatch, + "req=%s, recv=%s", + strings.ToLower(ep.Version), + version.String(forkVersion), + ) } - // This parses the rest of the response and returns the inner data field. pp, err := ep.ParsePayload() if err != nil { - return nil, nil, errors.Wrapf(err, "failed to parse execution payload from builder with version=%s", ep.Version) + return nil, nil, errors.Wrapf(err, "failed to parse payload with version=%s", ep.Version) } - // Get the payload as a proto.Message so it can be wrapped as an execution payload interface. pb, err := pp.PayloadProto() if err != nil { return nil, nil, err @@ -462,11 +566,13 @@ func (c *Client) SubmitBlindedBlock(ctx context.Context, sb interfaces.ReadOnlyS if err != nil { return nil, nil, err } + + // Check if it contains blobs bb, ok := pp.(BlobBundler) if ok { bbpb, err := bb.BundleProto() if err != nil { - return nil, nil, errors.Wrapf(err, "failed to extract blobs bundle from builder response with version=%s", ep.Version) + return nil, nil, errors.Wrapf(err, "failed to extract blobs bundle from version=%s", ep.Version) } return ed, bbpb, nil } @@ -477,7 +583,10 @@ func (c *Client) SubmitBlindedBlock(ctx context.Context, sb interfaces.ReadOnlyS // response, and an error response may have an error message. This method will return a nil value for error in the // happy path, and an error with information about the server response body for a non-200 response. func (c *Client) Status(ctx context.Context) error { - _, _, err := c.do(ctx, http.MethodGet, getStatus, nil) + getOpts := func(r *http.Request) { + r.Header.Set("Accept", api.JsonMediaType) + } + _, _, err := c.do(ctx, http.MethodGet, getStatus, nil, getOpts) return err } diff --git a/api/client/builder/client_test.go b/api/client/builder/client_test.go index 3d80d547ed02..22aec92b4d42 100644 --- a/api/client/builder/client_test.go +++ b/api/client/builder/client_test.go @@ -293,7 +293,7 @@ func TestClient_GetHeader(t *testing.T) { baseURL: &url.URL{Host: "localhost:3500", Scheme: "http"}, } _, err := c.GetHeader(ctx, slot, bytesutil.ToBytes32(parentHash), bytesutil.ToBytes48(pubkey)) - require.ErrorContains(t, "could not extract proto message from header: too many blob commitments: 7", err) + require.ErrorContains(t, "could not convert ExecHeaderResponseDeneb to proto: too many blob commitments: 7", err) }) t.Run("electra", func(t *testing.T) { hc := &http.Client{ diff --git a/beacon-chain/builder/option.go b/beacon-chain/builder/option.go index 2d1850e1bd00..051feeb4f6d3 100644 --- a/beacon-chain/builder/option.go +++ b/beacon-chain/builder/option.go @@ -14,10 +14,15 @@ type Option func(s *Service) error // FlagOptions for builder service flag configurations. func FlagOptions(c *cli.Context) ([]Option, error) { endpoint := c.String(flags.MevRelayEndpoint.Name) + sszEnabled := c.Bool(flags.EnableBuilderSSZ.Name) var client *builder.Client if endpoint != "" { + var opts []builder.ClientOpt + if sszEnabled { + opts = append(opts, builder.WithSSZ()) + } var err error - client, err = builder.NewClient(endpoint) + client, err = builder.NewClient(endpoint, opts...) if err != nil { return nil, err } diff --git a/cmd/beacon-chain/flags/base.go b/cmd/beacon-chain/flags/base.go index e4f0881cebfa..3525cf8dc819 100644 --- a/cmd/beacon-chain/flags/base.go +++ b/cmd/beacon-chain/flags/base.go @@ -28,6 +28,14 @@ var ( Usage: "A MEV builder relay string http endpoint, this will be used to interact MEV builder network using API defined in: https://ethereum.github.io/builder-specs/#/Builder", Value: "", } + + // EnableBuilderSSZ enables Builder APIs to send and receive in SSZ format + EnableBuilderSSZ = &cli.BoolFlag{ + Name: "enable-builder-ssz", + Aliases: []string{"builder-ssz"}, + Usage: "Enables Builder APIs to send and receive in SSZ format", + } + MaxBuilderConsecutiveMissedSlots = &cli.IntFlag{ Name: "max-builder-consecutive-missed-slots", Usage: "Number of consecutive skip slot to fallback from using relay/builder to local execution engine for block construction", diff --git a/cmd/beacon-chain/usage.go b/cmd/beacon-chain/usage.go index 6c5fda7d5aa6..8b3bad5ea169 100644 --- a/cmd/beacon-chain/usage.go +++ b/cmd/beacon-chain/usage.go @@ -127,6 +127,7 @@ var appHelpFlagGroups = []flagGroup{ flags.MevRelayEndpoint, flags.MaxBuilderEpochMissedSlots, flags.MaxBuilderConsecutiveMissedSlots, + flags.EnableBuilderSSZ, flags.EngineEndpointTimeoutSeconds, flags.SlasherDirFlag, flags.LocalBlockValueBoost, diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index a5759b9fe545..dffa51e8e8ed 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -104,7 +104,6 @@ ssz_bellatrix_objs = [ "BlindedBeaconBlockBodyBellatrix", "SignedBeaconBlockBellatrix", "SignedBlindedBeaconBlockBellatrix", - "SignedBuilderBid", ] ssz_capella_objs = [ @@ -301,6 +300,7 @@ ssz_gen_marshal( "SignedValidatorRegistrationV1", "ValidatorRegistrationV1", "BuilderBid", + "SignedBuilderBid", "DepositSnapshot", ], ) diff --git a/proto/prysm/v1alpha1/bellatrix.ssz.go b/proto/prysm/v1alpha1/bellatrix.ssz.go index dda806248e38..c7adfed44990 100644 --- a/proto/prysm/v1alpha1/bellatrix.ssz.go +++ b/proto/prysm/v1alpha1/bellatrix.ssz.go @@ -7,244 +7,6 @@ import ( v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" ) -// MarshalSSZ ssz marshals the SignedBuilderBid object -func (s *SignedBuilderBid) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBuilderBid object to a target array -func (s *SignedBuilderBid) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(100) - - // Offset (0) 'Message' - dst = ssz.WriteOffset(dst, offset) - if s.Message == nil { - s.Message = new(BuilderBid) - } - offset += s.Message.SizeSSZ() - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, s.Signature...) - - // Field (0) 'Message' - if dst, err = s.Message.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedBuilderBid object -func (s *SignedBuilderBid) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 100 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Message' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 != 100 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[4:100])) - } - s.Signature = append(s.Signature, buf[4:100]...) - - // Field (0) 'Message' - { - buf = tail[o0:] - if s.Message == nil { - s.Message = new(BuilderBid) - } - if err = s.Message.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBuilderBid object -func (s *SignedBuilderBid) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(BuilderBid) - } - size += s.Message.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedBuilderBid object -func (s *SignedBuilderBid) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBuilderBid object with a hasher -func (s *SignedBuilderBid) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Message' - if err = s.Message.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Signature' - if size := len(s.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(s.Signature) - - hh.Merkleize(indx) - return -} - -// MarshalSSZ ssz marshals the BuilderBid object -func (b *BuilderBid) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BuilderBid object to a target array -func (b *BuilderBid) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(84) - - // Offset (0) 'Header' - dst = ssz.WriteOffset(dst, offset) - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeader) - } - offset += b.Header.SizeSSZ() - - // Field (1) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) - return - } - dst = append(dst, b.Value...) - - // Field (2) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - dst = append(dst, b.Pubkey...) - - // Field (0) 'Header' - if dst, err = b.Header.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BuilderBid object -func (b *BuilderBid) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 84 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Header' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 != 84 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Value' - if cap(b.Value) == 0 { - b.Value = make([]byte, 0, len(buf[4:36])) - } - b.Value = append(b.Value, buf[4:36]...) - - // Field (2) 'Pubkey' - if cap(b.Pubkey) == 0 { - b.Pubkey = make([]byte, 0, len(buf[36:84])) - } - b.Pubkey = append(b.Pubkey, buf[36:84]...) - - // Field (0) 'Header' - { - buf = tail[o0:] - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeader) - } - if err = b.Header.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BuilderBid object -func (b *BuilderBid) SizeSSZ() (size int) { - size = 84 - - // Field (0) 'Header' - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeader) - } - size += b.Header.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BuilderBid object -func (b *BuilderBid) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BuilderBid object with a hasher -func (b *BuilderBid) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Header' - if err = b.Header.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) - return - } - hh.PutBytes(b.Value) - - // Field (2) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - hh.PutBytes(b.Pubkey) - - hh.Merkleize(indx) - return -} - // MarshalSSZ ssz marshals the SignedBeaconBlockBellatrix object func (s *SignedBeaconBlockBellatrix) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) diff --git a/proto/prysm/v1alpha1/non-core.ssz.go b/proto/prysm/v1alpha1/non-core.ssz.go index 58e5e30d402d..c42e4ae4db8e 100644 --- a/proto/prysm/v1alpha1/non-core.ssz.go +++ b/proto/prysm/v1alpha1/non-core.ssz.go @@ -190,6 +190,115 @@ func (v *ValidatorRegistrationV1) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } +// MarshalSSZ ssz marshals the SignedBuilderBid object +func (s *SignedBuilderBid) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBuilderBid object to a target array +func (s *SignedBuilderBid) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Message' + dst = ssz.WriteOffset(dst, offset) + if s.Message == nil { + s.Message = new(BuilderBid) + } + offset += s.Message.SizeSSZ() + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, s.Signature...) + + // Field (0) 'Message' + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBuilderBid object +func (s *SignedBuilderBid) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Message' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 != 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + if cap(s.Signature) == 0 { + s.Signature = make([]byte, 0, len(buf[4:100])) + } + s.Signature = append(s.Signature, buf[4:100]...) + + // Field (0) 'Message' + { + buf = tail[o0:] + if s.Message == nil { + s.Message = new(BuilderBid) + } + if err = s.Message.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBuilderBid object +func (s *SignedBuilderBid) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(BuilderBid) + } + size += s.Message.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBuilderBid object +func (s *SignedBuilderBid) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBuilderBid object with a hasher +func (s *SignedBuilderBid) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(s.Signature) + + hh.Merkleize(indx) + return +} + // MarshalSSZ ssz marshals the BuilderBid object func (b *BuilderBid) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) From 8a2dc575b97dd3da5e2988841f12a7a921fe2bbb Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 21 Feb 2025 14:35:01 -0600 Subject: [PATCH 03/12] allow ssz for register validator --- api/client/builder/client.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/api/client/builder/client.go b/api/client/builder/client.go index c62f16e714dd..90d9bab47c1d 100644 --- a/api/client/builder/client.go +++ b/api/client/builder/client.go @@ -382,9 +382,17 @@ func (c *Client) RegisterValidator(ctx context.Context, svr []*ethpb.SignedValid return err } - postOpts := func(r *http.Request) { - r.Header.Set("Content-Type", api.JsonMediaType) - r.Header.Set("Accept", api.JsonMediaType) + var postOpts reqOption + if c.sszEnabled { + postOpts = func(r *http.Request) { + r.Header.Set("Content-Type", api.OctetStreamMediaType) + r.Header.Set("Accept", api.OctetStreamMediaType) + } + } else { + postOpts = func(r *http.Request) { + r.Header.Set("Content-Type", api.JsonMediaType) + r.Header.Set("Accept", api.JsonMediaType) + } } _, _, err = c.do(ctx, http.MethodPost, postRegisterValidatorPath, bytes.NewBuffer(body), postOpts) From 0a677c9f5ebdd35ac2f2b049a9b86dcf65efb29f Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 21 Feb 2025 14:42:06 -0600 Subject: [PATCH 04/12] changelog --- changelog/james-prysm_builder-ssz.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog/james-prysm_builder-ssz.md diff --git a/changelog/james-prysm_builder-ssz.md b/changelog/james-prysm_builder-ssz.md new file mode 100644 index 000000000000..4af61978ad9b --- /dev/null +++ b/changelog/james-prysm_builder-ssz.md @@ -0,0 +1,3 @@ +### Added + +- enable SSZ for builder API calls \ No newline at end of file From 750abf3406a5e49680b6d5166c8712b0837b6c90 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 21 Feb 2025 17:05:05 -0600 Subject: [PATCH 05/12] adding in blinded block submission tests --- api/client/builder/client.go | 63 ++--- api/client/builder/client_test.go | 414 +++++++++++++++++++++++++++++- 2 files changed, 436 insertions(+), 41 deletions(-) diff --git a/api/client/builder/client.go b/api/client/builder/client.go index 00a91e1d701e..f2fb28d7b446 100644 --- a/api/client/builder/client.go +++ b/api/client/builder/client.go @@ -25,7 +25,6 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime/version" log "github.com/sirupsen/logrus" - "google.golang.org/protobuf/proto" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" ) @@ -39,6 +38,13 @@ const ( var errMalformedHostname = errors.New("hostname must include port, separated by one colon, like example.com:3500") var errMalformedRequest = errors.New("required request data are missing") var errNotBlinded = errors.New("submitted block is not blinded") +var blockToPayloadMapping = map[int]int{ + version.Bellatrix: version.Bellatrix, + version.Capella: version.Capella, + version.Deneb: version.Deneb, + version.Electra: version.Deneb, + version.Fulu: version.Deneb, +} // ClientOpt is a functional option for the Client type (http.Client wrapper) type ClientOpt func(*Client) @@ -421,14 +427,21 @@ func (c *Client) SubmitBlindedBlock(ctx context.Context, sb interfaces.ReadOnlyS return nil, nil, errors.Wrap(err, "error posting the blinded block to the builder api") } - ver, err := c.checkVersion(data, header) + ver, err := c.checkBlockVersion(data, header) if err != nil { return nil, nil, err } - // check if sent blinded block version matches received payload version - if version.String(ver) != version.String(sb.Version()) { - return nil, nil, errors.Wrapf(errResponseVersionMismatch, "req=%s, recv=%s", version.String(ver), version.String(sb.Version())) + expectedPayloadVer, ok := blockToPayloadMapping[sb.Version()] + if !ok { + return nil, nil, errors.Errorf("unsupported block version %d", sb.Version()) + } + gotPayloadVer, ok := blockToPayloadMapping[ver] + if !ok { + return nil, nil, errors.Errorf("unsupported block version %d", ver) + } + if expectedPayloadVer != gotPayloadVer { + return nil, nil, errors.Wrapf(errResponseVersionMismatch, "expected payload version %d, got %d", expectedPayloadVer, gotPayloadVer) } ed, blobs, err := c.parseBlindedBlockResponse(data, ver) @@ -439,10 +452,10 @@ func (c *Client) SubmitBlindedBlock(ctx context.Context, sb interfaces.ReadOnlyS return ed, blobs, nil } -func (c *Client) checkVersion(respBytes []byte, header http.Header) (int, error) { +func (c *Client) checkBlockVersion(respBytes []byte, header http.Header) (int, error) { var versionHeader string - if c.sszEnabled || header.Get(api.VersionHeader) != "" { - versionHeader = header.Get(api.VersionHeader) + if c.sszEnabled { + versionHeader = strings.ToLower(header.Get(api.VersionHeader)) } else { // fallback to JSON-based version extraction v := &VersionResponse{} @@ -472,7 +485,7 @@ func (c *Client) buildBlindedBlockRequest(sb interfaces.ReadOnlySignedBeaconBloc return nil, nil, errors.Wrap(err, "could not marshal SSZ for blinded block") } opt := func(r *http.Request) { - r.Header.Add("Eth-Consensus-Version", version.String(sb.Version())) + r.Header.Set(api.VersionHeader, version.String(sb.Version())) r.Header.Set("Content-Type", api.OctetStreamMediaType) r.Header.Set("Accept", api.OctetStreamMediaType) } @@ -488,7 +501,7 @@ func (c *Client) buildBlindedBlockRequest(sb interfaces.ReadOnlySignedBeaconBloc return nil, nil, errors.Wrap(err, "error marshaling blinded block to JSON") } opt := func(r *http.Request) { - r.Header.Add("Eth-Consensus-Version", version.String(sb.Version())) + r.Header.Set(api.VersionHeader, version.String(sb.Version())) r.Header.Set("Content-Type", api.JsonMediaType) r.Header.Set("Accept", api.JsonMediaType) } @@ -512,33 +525,33 @@ func (c *Client) parseBlindedBlockResponseSSZ( ) (interfaces.ExecutionData, *v1.BlobsBundle, error) { switch { case forkVersion >= version.Deneb: - payload := v1.ExecutionPayloadDenebAndBlobsBundle{} - if err := payload.UnmarshalSSZ(respBytes); err != nil { + payloadAndBlobs := &v1.ExecutionPayloadDenebAndBlobsBundle{} + if err := payloadAndBlobs.UnmarshalSSZ(respBytes); err != nil { return nil, nil, errors.Wrap(err, "unable to unmarshal ExecutionPayloadDenebAndBlobsBundle SSZ") } - ed, err := blocks.NewWrappedExecutionData(proto.Message(&payload)) + ed, err := blocks.NewWrappedExecutionData(payloadAndBlobs.Payload) if err != nil { - return nil, nil, errors.Wrap(err, "unable to wrap execution data for Deneb") + return nil, nil, errors.Wrapf(err, "unable to wrap execution data for %s", version.String(forkVersion)) } - return ed, payload.BlobsBundle, nil + return ed, payloadAndBlobs.BlobsBundle, nil case forkVersion >= version.Capella: - payload := v1.ExecutionPayloadCapella{} + payload := &v1.ExecutionPayloadCapella{} if err := payload.UnmarshalSSZ(respBytes); err != nil { return nil, nil, errors.Wrap(err, "unable to unmarshal ExecutionPayloadCapella SSZ") } - ed, err := blocks.NewWrappedExecutionData(proto.Message(&payload)) + ed, err := blocks.NewWrappedExecutionData(payload) if err != nil { - return nil, nil, errors.Wrap(err, "unable to wrap execution data for Capella") + return nil, nil, errors.Wrapf(err, "unable to wrap execution data for %s", version.String(forkVersion)) } return ed, nil, nil case forkVersion >= version.Bellatrix: - payload := v1.ExecutionPayload{} + payload := &v1.ExecutionPayload{} if err := payload.UnmarshalSSZ(respBytes); err != nil { return nil, nil, errors.Wrap(err, "unable to unmarshal ExecutionPayload SSZ") } - ed, err := blocks.NewWrappedExecutionData(proto.Message(&payload)) + ed, err := blocks.NewWrappedExecutionData(payload) if err != nil { - return nil, nil, errors.Wrap(err, "unable to wrap execution data for Bellatrix") + return nil, nil, errors.Wrapf(err, "unable to wrap execution data for %s", version.String(forkVersion)) } return ed, nil, nil default: @@ -555,14 +568,6 @@ func (c *Client) parseBlindedBlockResponseJSON( if err := json.Unmarshal(respBytes, ep); err != nil { return nil, nil, errors.Wrap(err, "error unmarshaling ExecutionPayloadResponse") } - if strings.ToLower(ep.Version) != version.String(forkVersion) { - return nil, nil, errors.Wrapf( - errResponseVersionMismatch, - "req=%s, recv=%s", - strings.ToLower(ep.Version), - version.String(forkVersion), - ) - } pp, err := ep.ParsePayload() if err != nil { return nil, nil, errors.Wrapf(err, "failed to parse payload with version=%s", ep.Version) diff --git a/api/client/builder/client_test.go b/api/client/builder/client_test.go index 22aec92b4d42..4b6e3cd0c614 100644 --- a/api/client/builder/client_test.go +++ b/api/client/builder/client_test.go @@ -8,7 +8,6 @@ import ( "io" "net/http" "net/url" - "strconv" "testing" "github.com/prysmaticlabs/go-bitfield" @@ -390,11 +389,51 @@ func TestSubmitBlindedBlock(t *testing.T) { require.Equal(t, fmt.Sprintf("%#x", bfpg.SSZBytes()), fmt.Sprintf("%#x", ep.BaseFeePerGas())) require.Equal(t, uint64(1), ep.GasLimit()) }) + t.Run("bellatrix ssz", func(t *testing.T) { + hc := &http.Client{ + Transport: roundtrip(func(r *http.Request) (*http.Response, error) { + require.Equal(t, postBlindedBeaconBlockPath, r.URL.Path) + require.Equal(t, "bellatrix", r.Header.Get(api.VersionHeader)) + require.Equal(t, api.OctetStreamMediaType, r.Header.Get("Content-Type")) + require.Equal(t, api.OctetStreamMediaType, r.Header.Get("Accept")) + epr := &ExecutionPayloadResponse{} + require.NoError(t, json.Unmarshal([]byte(testExampleExecutionPayload), epr)) + ep := &ExecutionPayload{} + require.NoError(t, json.Unmarshal(epr.Data, ep)) + pro, err := ep.ToProto() + require.NoError(t, err) + ssz, err := pro.MarshalSSZ() + require.NoError(t, err) + header := http.Header{} + header.Set(api.VersionHeader, "bellatrix") + return &http.Response{ + StatusCode: http.StatusOK, + Header: header, + Body: io.NopCloser(bytes.NewBuffer(ssz)), + Request: r.Clone(ctx), + }, nil + }), + } + c := &Client{ + hc: hc, + baseURL: &url.URL{Host: "localhost:3500", Scheme: "http"}, + sszEnabled: true, + } + sbbb, err := blocks.NewSignedBeaconBlock(testSignedBlindedBeaconBlockBellatrix(t)) + require.NoError(t, err) + ep, _, err := c.SubmitBlindedBlock(ctx, sbbb) + require.NoError(t, err) + require.Equal(t, true, bytes.Equal(ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), ep.ParentHash())) + bfpg, err := stringToUint256("452312848583266388373324160190187140051835877600158453279131187530910662656") + require.NoError(t, err) + require.Equal(t, fmt.Sprintf("%#x", bfpg.SSZBytes()), fmt.Sprintf("%#x", ep.BaseFeePerGas())) + require.Equal(t, uint64(1), ep.GasLimit()) + }) t.Run("capella", func(t *testing.T) { hc := &http.Client{ Transport: roundtrip(func(r *http.Request) (*http.Response, error) { require.Equal(t, postBlindedBeaconBlockPath, r.URL.Path) - require.Equal(t, "capella", r.Header.Get("Eth-Consensus-Version")) + require.Equal(t, "capella", r.Header.Get(api.VersionHeader)) require.Equal(t, api.JsonMediaType, r.Header.Get("Content-Type")) require.Equal(t, api.JsonMediaType, r.Header.Get("Accept")) return &http.Response{ @@ -420,12 +459,54 @@ func TestSubmitBlindedBlock(t *testing.T) { assert.DeepEqual(t, ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943"), withdrawals[0].Address) assert.Equal(t, uint64(1), withdrawals[0].Amount) }) + t.Run("capella ssz", func(t *testing.T) { + hc := &http.Client{ + Transport: roundtrip(func(r *http.Request) (*http.Response, error) { + require.Equal(t, postBlindedBeaconBlockPath, r.URL.Path) + require.Equal(t, "capella", r.Header.Get(api.VersionHeader)) + require.Equal(t, api.OctetStreamMediaType, r.Header.Get("Content-Type")) + require.Equal(t, api.OctetStreamMediaType, r.Header.Get("Accept")) + epr := &ExecutionPayloadResponse{} + require.NoError(t, json.Unmarshal([]byte(testExampleExecutionPayloadCapella), epr)) + ep := &ExecutionPayloadCapella{} + require.NoError(t, json.Unmarshal(epr.Data, ep)) + pro, err := ep.ToProto() + require.NoError(t, err) + ssz, err := pro.MarshalSSZ() + require.NoError(t, err) + header := http.Header{} + header.Set(api.VersionHeader, "capella") + return &http.Response{ + StatusCode: http.StatusOK, + Header: header, + Body: io.NopCloser(bytes.NewBuffer(ssz)), + Request: r.Clone(ctx), + }, nil + }), + } + c := &Client{ + hc: hc, + baseURL: &url.URL{Host: "localhost:3500", Scheme: "http"}, + sszEnabled: true, + } + sbb, err := blocks.NewSignedBeaconBlock(testSignedBlindedBeaconBlockCapella(t)) + require.NoError(t, err) + ep, _, err := c.SubmitBlindedBlock(ctx, sbb) + require.NoError(t, err) + withdrawals, err := ep.Withdrawals() + require.NoError(t, err) + require.Equal(t, 1, len(withdrawals)) + assert.Equal(t, uint64(1), withdrawals[0].Index) + assert.Equal(t, primitives.ValidatorIndex(1), withdrawals[0].ValidatorIndex) + assert.DeepEqual(t, ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943"), withdrawals[0].Address) + assert.Equal(t, uint64(1), withdrawals[0].Amount) + }) t.Run("deneb", func(t *testing.T) { test := testSignedBlindedBeaconBlockDeneb(t) hc := &http.Client{ Transport: roundtrip(func(r *http.Request) (*http.Response, error) { require.Equal(t, postBlindedBeaconBlockPath, r.URL.Path) - require.Equal(t, "deneb", r.Header.Get("Eth-Consensus-Version")) + require.Equal(t, "deneb", r.Header.Get(api.VersionHeader)) require.Equal(t, api.JsonMediaType, r.Header.Get("Content-Type")) require.Equal(t, api.JsonMediaType, r.Header.Get("Accept")) var req structs.SignedBlindedBeaconBlockDeneb @@ -460,6 +541,140 @@ func TestSubmitBlindedBlock(t *testing.T) { assert.Equal(t, uint64(1), withdrawals[0].Amount) require.NotNil(t, blobBundle) }) + t.Run("deneb ssz", func(t *testing.T) { + test := testSignedBlindedBeaconBlockDeneb(t) + hc := &http.Client{ + Transport: roundtrip(func(r *http.Request) (*http.Response, error) { + require.Equal(t, postBlindedBeaconBlockPath, r.URL.Path) + require.Equal(t, "deneb", r.Header.Get(api.VersionHeader)) + require.Equal(t, api.OctetStreamMediaType, r.Header.Get("Content-Type")) + require.Equal(t, api.OctetStreamMediaType, r.Header.Get("Accept")) + epr := &ExecPayloadResponseDeneb{} + require.NoError(t, json.Unmarshal([]byte(testExampleExecutionPayloadDeneb), epr)) + pro, blob, err := epr.ToProto() + require.NoError(t, err) + combined := &v1.ExecutionPayloadDenebAndBlobsBundle{ + Payload: pro, + BlobsBundle: blob, + } + ssz, err := combined.MarshalSSZ() + require.NoError(t, err) + header := http.Header{} + header.Set(api.VersionHeader, "deneb") + return &http.Response{ + StatusCode: http.StatusOK, + Header: header, + Body: io.NopCloser(bytes.NewBuffer(ssz)), + Request: r.Clone(ctx), + }, nil + }), + } + c := &Client{ + hc: hc, + baseURL: &url.URL{Host: "localhost:3500", Scheme: "http"}, + sszEnabled: true, + } + sbb, err := blocks.NewSignedBeaconBlock(test) + require.NoError(t, err) + + ep, blobBundle, err := c.SubmitBlindedBlock(ctx, sbb) + require.NoError(t, err) + withdrawals, err := ep.Withdrawals() + require.NoError(t, err) + require.Equal(t, 1, len(withdrawals)) + assert.Equal(t, uint64(1), withdrawals[0].Index) + assert.Equal(t, primitives.ValidatorIndex(1), withdrawals[0].ValidatorIndex) + assert.DeepEqual(t, ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943"), withdrawals[0].Address) + assert.Equal(t, uint64(1), withdrawals[0].Amount) + require.NotNil(t, blobBundle) + }) + t.Run("electra", func(t *testing.T) { + test := testSignedBlindedBeaconBlockElectra(t) + hc := &http.Client{ + Transport: roundtrip(func(r *http.Request) (*http.Response, error) { + require.Equal(t, postBlindedBeaconBlockPath, r.URL.Path) + require.Equal(t, "electra", r.Header.Get(api.VersionHeader)) + require.Equal(t, api.JsonMediaType, r.Header.Get("Content-Type")) + require.Equal(t, api.JsonMediaType, r.Header.Get("Accept")) + var req structs.SignedBlindedBeaconBlockElectra + err := json.NewDecoder(r.Body).Decode(&req) + require.NoError(t, err) + block, err := req.ToConsensus() + require.NoError(t, err) + require.DeepEqual(t, block, test) + return &http.Response{ + StatusCode: http.StatusOK, + Body: io.NopCloser(bytes.NewBufferString(testExampleExecutionPayloadDeneb)), + Request: r.Clone(ctx), + }, nil + }), + } + c := &Client{ + hc: hc, + baseURL: &url.URL{Host: "localhost:3500", Scheme: "http"}, + } + + sbb, err := blocks.NewSignedBeaconBlock(test) + require.NoError(t, err) + + ep, blobBundle, err := c.SubmitBlindedBlock(ctx, sbb) + require.NoError(t, err) + withdrawals, err := ep.Withdrawals() + require.NoError(t, err) + require.Equal(t, 1, len(withdrawals)) + assert.Equal(t, uint64(1), withdrawals[0].Index) + assert.Equal(t, primitives.ValidatorIndex(1), withdrawals[0].ValidatorIndex) + assert.DeepEqual(t, ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943"), withdrawals[0].Address) + assert.Equal(t, uint64(1), withdrawals[0].Amount) + require.NotNil(t, blobBundle) + }) + t.Run("electra ssz", func(t *testing.T) { + test := testSignedBlindedBeaconBlockElectra(t) + hc := &http.Client{ + Transport: roundtrip(func(r *http.Request) (*http.Response, error) { + require.Equal(t, postBlindedBeaconBlockPath, r.URL.Path) + require.Equal(t, "electra", r.Header.Get(api.VersionHeader)) + require.Equal(t, api.OctetStreamMediaType, r.Header.Get("Content-Type")) + require.Equal(t, api.OctetStreamMediaType, r.Header.Get("Accept")) + epr := &ExecPayloadResponseDeneb{} + require.NoError(t, json.Unmarshal([]byte(testExampleExecutionPayloadDeneb), epr)) + pro, blob, err := epr.ToProto() + require.NoError(t, err) + combined := &v1.ExecutionPayloadDenebAndBlobsBundle{ + Payload: pro, + BlobsBundle: blob, + } + ssz, err := combined.MarshalSSZ() + require.NoError(t, err) + header := http.Header{} + header.Set(api.VersionHeader, "electra") + return &http.Response{ + StatusCode: http.StatusOK, + Header: header, + Body: io.NopCloser(bytes.NewBuffer(ssz)), + Request: r.Clone(ctx), + }, nil + }), + } + c := &Client{ + hc: hc, + baseURL: &url.URL{Host: "localhost:3500", Scheme: "http"}, + sszEnabled: true, + } + sbb, err := blocks.NewSignedBeaconBlock(test) + require.NoError(t, err) + + ep, blobBundle, err := c.SubmitBlindedBlock(ctx, sbb) + require.NoError(t, err) + withdrawals, err := ep.Withdrawals() + require.NoError(t, err) + require.Equal(t, 1, len(withdrawals)) + assert.Equal(t, uint64(1), withdrawals[0].Index) + assert.Equal(t, primitives.ValidatorIndex(1), withdrawals[0].ValidatorIndex) + assert.DeepEqual(t, ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943"), withdrawals[0].Address) + assert.Equal(t, uint64(1), withdrawals[0].Amount) + require.NotNil(t, blobBundle) + }) t.Run("mismatched versions, expected bellatrix got capella", func(t *testing.T) { hc := &http.Client{ Transport: roundtrip(func(r *http.Request) (*http.Response, error) { @@ -586,7 +801,13 @@ func testSignedBlindedBeaconBlockBellatrix(t *testing.T) *eth.SignedBlindedBeaco }, Deposits: []*eth.Deposit{ { - Proof: [][]byte{ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2")}, + Proof: func() [][]byte { + b := make([][]byte, 33) + for i := range b { + b[i] = ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2") + } + return b + }(), Data: ð.Deposit_Data{ PublicKey: ezDecode(t, "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a"), WithdrawalCredentials: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), @@ -605,8 +826,8 @@ func testSignedBlindedBeaconBlockBellatrix(t *testing.T) *eth.SignedBlindedBeaco }, }, SyncAggregate: ð.SyncAggregate{ - SyncCommitteeSignature: make([]byte, 48), - SyncCommitteeBits: bitfield.Bitvector512{0x01}, + SyncCommitteeSignature: make([]byte, 96), + SyncCommitteeBits: make(bitfield.Bitvector512, 64), }, ExecutionPayloadHeader: &v1.ExecutionPayloadHeader{ ParentHash: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), @@ -620,7 +841,7 @@ func testSignedBlindedBeaconBlockBellatrix(t *testing.T) *eth.SignedBlindedBeaco GasUsed: 1, Timestamp: 1, ExtraData: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), - BaseFeePerGas: []byte(strconv.FormatUint(1, 10)), + BaseFeePerGas: ezDecode(t, "0x4523128485832663883733241601901871400518358776001584532791311875"), BlockHash: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), TransactionsRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), }, @@ -728,7 +949,13 @@ func testSignedBlindedBeaconBlockCapella(t *testing.T) *eth.SignedBlindedBeaconB }, Deposits: []*eth.Deposit{ { - Proof: [][]byte{ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2")}, + Proof: func() [][]byte { + b := make([][]byte, 33) + for i := range b { + b[i] = ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2") + } + return b + }(), Data: ð.Deposit_Data{ PublicKey: ezDecode(t, "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a"), WithdrawalCredentials: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), @@ -747,8 +974,8 @@ func testSignedBlindedBeaconBlockCapella(t *testing.T) *eth.SignedBlindedBeaconB }, }, SyncAggregate: ð.SyncAggregate{ - SyncCommitteeSignature: make([]byte, 48), - SyncCommitteeBits: bitfield.Bitvector512{0x01}, + SyncCommitteeSignature: make([]byte, 96), + SyncCommitteeBits: make(bitfield.Bitvector512, 64), }, ExecutionPayloadHeader: &v1.ExecutionPayloadHeaderCapella{ ParentHash: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), @@ -762,7 +989,7 @@ func testSignedBlindedBeaconBlockCapella(t *testing.T) *eth.SignedBlindedBeaconB GasUsed: 1, Timestamp: 1, ExtraData: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), - BaseFeePerGas: []byte(strconv.FormatUint(1, 10)), + BaseFeePerGas: ezDecode(t, "0x4523128485832663883733241601901871400518358776001584532791311875"), BlockHash: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), TransactionsRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), WithdrawalsRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), @@ -875,7 +1102,169 @@ func testSignedBlindedBeaconBlockDeneb(t *testing.T) *eth.SignedBlindedBeaconBlo }, Deposits: []*eth.Deposit{ { - Proof: [][]byte{ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2")}, + Proof: func() [][]byte { + b := make([][]byte, 33) + for i := range b { + b[i] = ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2") + } + return b + }(), + Data: ð.Deposit_Data{ + PublicKey: ezDecode(t, "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a"), + WithdrawalCredentials: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + Amount: 1, + Signature: ezDecode(t, "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"), + }, + }, + }, + VoluntaryExits: []*eth.SignedVoluntaryExit{ + { + Exit: ð.VoluntaryExit{ + Epoch: 1, + ValidatorIndex: 1, + }, + Signature: ezDecode(t, "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"), + }, + }, + SyncAggregate: ð.SyncAggregate{ + SyncCommitteeSignature: make([]byte, 96), + SyncCommitteeBits: ezDecode(t, "0x6451e9f951ebf05edc01de67e593484b672877054f055903ff0df1a1a945cf30ca26bb4d4b154f94a1bc776bcf5d0efb3603e1f9b8ee2499ccdcfe2a18cef458"), + }, + ExecutionPayloadHeader: &v1.ExecutionPayloadHeaderDeneb{ + ParentHash: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + FeeRecipient: ezDecode(t, "0xabcf8e0d4e9587369b2301d0790347320302cc09"), + StateRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + ReceiptsRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + LogsBloom: ezDecode(t, "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), + PrevRandao: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + BlockNumber: 1, + GasLimit: 1, + GasUsed: 1, + Timestamp: 1, + ExtraData: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + BaseFeePerGas: basebytes, + BlockHash: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + TransactionsRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + WithdrawalsRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + BlobGasUsed: 1, + ExcessBlobGas: 2, + }, + }, + }, + Signature: ezDecode(t, "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"), + } +} + +func testSignedBlindedBeaconBlockElectra(t *testing.T) *eth.SignedBlindedBeaconBlockElectra { + basebytes, err := bytesutil.Uint256ToSSZBytes("14074904626401341155369551180448584754667373453244490859944217516317499064576") + if err != nil { + log.Error(err) + } + return ð.SignedBlindedBeaconBlockElectra{ + Message: ð.BlindedBeaconBlockElectra{ + Slot: 1, + ProposerIndex: 1, + ParentRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + StateRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + Body: ð.BlindedBeaconBlockBodyElectra{ + RandaoReveal: ezDecode(t, "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"), + Eth1Data: ð.Eth1Data{ + DepositRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + DepositCount: 1, + BlockHash: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + }, + Graffiti: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + ProposerSlashings: []*eth.ProposerSlashing{ + { + Header_1: ð.SignedBeaconBlockHeader{ + Header: ð.BeaconBlockHeader{ + Slot: 1, + ProposerIndex: 1, + ParentRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + StateRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + BodyRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + }, + Signature: ezDecode(t, "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"), + }, + Header_2: ð.SignedBeaconBlockHeader{ + Header: ð.BeaconBlockHeader{ + Slot: 1, + ProposerIndex: 1, + ParentRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + StateRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + BodyRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + }, + Signature: ezDecode(t, "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"), + }, + }, + }, + AttesterSlashings: []*eth.AttesterSlashingElectra{ + { + Attestation_1: ð.IndexedAttestationElectra{ + AttestingIndices: []uint64{1}, + Data: ð.AttestationData{ + Slot: 1, + CommitteeIndex: 1, + BeaconBlockRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + Source: ð.Checkpoint{ + Epoch: 1, + Root: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + }, + Target: ð.Checkpoint{ + Epoch: 1, + Root: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + }, + }, + Signature: ezDecode(t, "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"), + }, + Attestation_2: ð.IndexedAttestationElectra{ + AttestingIndices: []uint64{1}, + Data: ð.AttestationData{ + Slot: 1, + CommitteeIndex: 1, + BeaconBlockRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + Source: ð.Checkpoint{ + Epoch: 1, + Root: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + }, + Target: ð.Checkpoint{ + Epoch: 1, + Root: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + }, + }, + Signature: ezDecode(t, "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"), + }, + }, + }, + Attestations: []*eth.AttestationElectra{ + { + AggregationBits: bitfield.Bitlist{0x01}, + Data: ð.AttestationData{ + Slot: 1, + CommitteeIndex: 1, + BeaconBlockRoot: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + Source: ð.Checkpoint{ + Epoch: 1, + Root: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + }, + Target: ð.Checkpoint{ + Epoch: 1, + Root: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), + }, + }, + CommitteeBits: make(bitfield.Bitvector64, 8), + Signature: ezDecode(t, "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"), + }, + }, + Deposits: []*eth.Deposit{ + { + Proof: func() [][]byte { + b := make([][]byte, 33) + for i := range b { + b[i] = ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2") + } + return b + }(), Data: ð.Deposit_Data{ PublicKey: ezDecode(t, "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a"), WithdrawalCredentials: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), @@ -897,6 +1286,7 @@ func testSignedBlindedBeaconBlockDeneb(t *testing.T) *eth.SignedBlindedBeaconBlo SyncCommitteeSignature: make([]byte, 96), SyncCommitteeBits: ezDecode(t, "0x6451e9f951ebf05edc01de67e593484b672877054f055903ff0df1a1a945cf30ca26bb4d4b154f94a1bc776bcf5d0efb3603e1f9b8ee2499ccdcfe2a18cef458"), }, + ExecutionRequests: &v1.ExecutionRequests{}, ExecutionPayloadHeader: &v1.ExecutionPayloadHeaderDeneb{ ParentHash: ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"), FeeRecipient: ezDecode(t, "0xabcf8e0d4e9587369b2301d0790347320302cc09"), From 17338be8395d1e9d6f7d7ddb3b23016b1c57e943 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 21 Feb 2025 17:21:27 -0600 Subject: [PATCH 06/12] adding in tests for header ssz --- api/client/builder/client_test.go | 190 ++++++++++++++++++++++++++++++ 1 file changed, 190 insertions(+) diff --git a/api/client/builder/client_test.go b/api/client/builder/client_test.go index 4b6e3cd0c614..3597667f0110 100644 --- a/api/client/builder/client_test.go +++ b/api/client/builder/client_test.go @@ -206,6 +206,51 @@ func TestClient_GetHeader(t *testing.T) { require.Equal(t, 0, value.Int.Cmp(primitives.WeiToBigInt(bid.Value()))) require.Equal(t, bidStr, primitives.WeiToBigInt(bid.Value()).String()) }) + t.Run("bellatrix ssz", func(t *testing.T) { + hc := &http.Client{ + Transport: roundtrip(func(r *http.Request) (*http.Response, error) { + require.Equal(t, expectedPath, r.URL.Path) + epr := &ExecHeaderResponse{} + require.NoError(t, json.Unmarshal([]byte(testExampleHeaderResponse), epr)) + pro, err := epr.ToProto() + require.NoError(t, err) + ssz, err := pro.MarshalSSZ() + require.NoError(t, err) + header := http.Header{} + header.Set(api.VersionHeader, "bellatrix") + return &http.Response{ + StatusCode: http.StatusOK, + Header: header, + Body: io.NopCloser(bytes.NewBuffer(ssz)), + Request: r.Clone(ctx), + }, nil + }), + } + c := &Client{ + hc: hc, + baseURL: &url.URL{Host: "localhost:3500", Scheme: "http"}, + sszEnabled: true, + } + h, err := c.GetHeader(ctx, slot, bytesutil.ToBytes32(parentHash), bytesutil.ToBytes48(pubkey)) + require.NoError(t, err) + expectedSig := ezDecode(t, "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505") + require.Equal(t, true, bytes.Equal(expectedSig, h.Signature())) + expectedTxRoot := ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2") + bid, err := h.Message() + require.NoError(t, err) + bidHeader, err := bid.Header() + require.NoError(t, err) + withdrawalsRoot, err := bidHeader.TransactionsRoot() + require.NoError(t, err) + require.Equal(t, true, bytes.Equal(expectedTxRoot, withdrawalsRoot)) + require.Equal(t, uint64(1), bidHeader.GasUsed()) + // this matches the value in the testExampleHeaderResponse + bidStr := "652312848583266388373324160190187140051835877600158453279131187530910662656" + value, err := stringToUint256(bidStr) + require.NoError(t, err) + require.Equal(t, 0, value.Int.Cmp(primitives.WeiToBigInt(bid.Value()))) + require.Equal(t, bidStr, primitives.WeiToBigInt(bid.Value()).String()) + }) t.Run("capella", func(t *testing.T) { hc := &http.Client{ Transport: roundtrip(func(r *http.Request) (*http.Response, error) { @@ -237,6 +282,47 @@ func TestClient_GetHeader(t *testing.T) { require.Equal(t, 0, value.Int.Cmp(primitives.WeiToBigInt(bid.Value()))) require.Equal(t, bidStr, primitives.WeiToBigInt(bid.Value()).String()) }) + t.Run("capella ssz", func(t *testing.T) { + hc := &http.Client{ + Transport: roundtrip(func(r *http.Request) (*http.Response, error) { + require.Equal(t, expectedPath, r.URL.Path) + epr := &ExecHeaderResponseCapella{} + require.NoError(t, json.Unmarshal([]byte(testExampleHeaderResponseCapella), epr)) + pro, err := epr.ToProto() + require.NoError(t, err) + ssz, err := pro.MarshalSSZ() + require.NoError(t, err) + header := http.Header{} + header.Set(api.VersionHeader, "capella") + return &http.Response{ + StatusCode: http.StatusOK, + Header: header, + Body: io.NopCloser(bytes.NewBuffer(ssz)), + Request: r.Clone(ctx), + }, nil + }), + } + c := &Client{ + hc: hc, + baseURL: &url.URL{Host: "localhost:3500", Scheme: "http"}, + sszEnabled: true, + } + h, err := c.GetHeader(ctx, slot, bytesutil.ToBytes32(parentHash), bytesutil.ToBytes48(pubkey)) + require.NoError(t, err) + expectedWithdrawalsRoot := ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2") + bid, err := h.Message() + require.NoError(t, err) + bidHeader, err := bid.Header() + require.NoError(t, err) + withdrawalsRoot, err := bidHeader.WithdrawalsRoot() + require.NoError(t, err) + require.Equal(t, true, bytes.Equal(expectedWithdrawalsRoot, withdrawalsRoot)) + bidStr := "652312848583266388373324160190187140051835877600158453279131187530910662656" + value, err := stringToUint256(bidStr) + require.NoError(t, err) + require.Equal(t, 0, value.Int.Cmp(primitives.WeiToBigInt(bid.Value()))) + require.Equal(t, bidStr, primitives.WeiToBigInt(bid.Value()).String()) + }) t.Run("deneb", func(t *testing.T) { hc := &http.Client{ Transport: roundtrip(func(r *http.Request) (*http.Response, error) { @@ -276,10 +362,60 @@ func TestClient_GetHeader(t *testing.T) { require.Equal(t, len(kcgCommitments[i]) == 48, true) } }) + t.Run("deneb ssz", func(t *testing.T) { + hc := &http.Client{ + Transport: roundtrip(func(r *http.Request) (*http.Response, error) { + require.Equal(t, expectedPath, r.URL.Path) + epr := &ExecHeaderResponseDeneb{} + require.NoError(t, json.Unmarshal([]byte(testExampleHeaderResponseDeneb), epr)) + pro, err := epr.ToProto() + require.NoError(t, err) + ssz, err := pro.MarshalSSZ() + require.NoError(t, err) + header := http.Header{} + header.Set(api.VersionHeader, "deneb") + return &http.Response{ + StatusCode: http.StatusOK, + Header: header, + Body: io.NopCloser(bytes.NewBuffer(ssz)), + Request: r.Clone(ctx), + }, nil + }), + } + c := &Client{ + hc: hc, + baseURL: &url.URL{Host: "localhost:3500", Scheme: "http"}, + sszEnabled: true, + } + h, err := c.GetHeader(ctx, slot, bytesutil.ToBytes32(parentHash), bytesutil.ToBytes48(pubkey)) + require.NoError(t, err) + expectedWithdrawalsRoot := ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2") + bid, err := h.Message() + require.NoError(t, err) + bidHeader, err := bid.Header() + require.NoError(t, err) + withdrawalsRoot, err := bidHeader.WithdrawalsRoot() + require.NoError(t, err) + require.Equal(t, true, bytes.Equal(expectedWithdrawalsRoot, withdrawalsRoot)) + + bidStr := "652312848583266388373324160190187140051835877600158453279131187530910662656" + value, err := stringToUint256(bidStr) + require.NoError(t, err) + require.Equal(t, 0, value.Int.Cmp(primitives.WeiToBigInt(bid.Value()))) + require.Equal(t, bidStr, primitives.WeiToBigInt(bid.Value()).String()) + dbid, ok := bid.(builderBidDeneb) + require.Equal(t, true, ok) + kcgCommitments := dbid.BlobKzgCommitments() + require.Equal(t, len(kcgCommitments) > 0, true) + for i := range kcgCommitments { + require.Equal(t, len(kcgCommitments[i]) == 48, true) + } + }) t.Run("deneb, too many kzg commitments", func(t *testing.T) { hc := &http.Client{ Transport: roundtrip(func(r *http.Request) (*http.Response, error) { require.Equal(t, expectedPath, r.URL.Path) + require.Equal(t, api.OctetStreamMediaType, r.Header.Get("Accept")) return &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(bytes.NewBufferString(testExampleHeaderResponseDenebTooManyBlobs)), @@ -337,6 +473,60 @@ func TestClient_GetHeader(t *testing.T) { require.Equal(t, 1, len(requests.Withdrawals)) require.Equal(t, 1, len(requests.Consolidations)) + }) + t.Run("electra ssz", func(t *testing.T) { + hc := &http.Client{ + Transport: roundtrip(func(r *http.Request) (*http.Response, error) { + require.Equal(t, expectedPath, r.URL.Path) + epr := &ExecHeaderResponseElectra{} + require.NoError(t, json.Unmarshal([]byte(testExampleHeaderResponseElectra), epr)) + pro, err := epr.ToProto() + require.NoError(t, err) + ssz, err := pro.MarshalSSZ() + require.NoError(t, err) + header := http.Header{} + header.Set(api.VersionHeader, "electra") + return &http.Response{ + StatusCode: http.StatusOK, + Header: header, + Body: io.NopCloser(bytes.NewBuffer(ssz)), + Request: r.Clone(ctx), + }, nil + }), + } + c := &Client{ + hc: hc, + baseURL: &url.URL{Host: "localhost:3500", Scheme: "http"}, + sszEnabled: true, + } + h, err := c.GetHeader(ctx, slot, bytesutil.ToBytes32(parentHash), bytesutil.ToBytes48(pubkey)) + require.NoError(t, err) + expectedWithdrawalsRoot := ezDecode(t, "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2") + bid, err := h.Message() + require.NoError(t, err) + bidHeader, err := bid.Header() + require.NoError(t, err) + withdrawalsRoot, err := bidHeader.WithdrawalsRoot() + require.NoError(t, err) + require.Equal(t, true, bytes.Equal(expectedWithdrawalsRoot, withdrawalsRoot)) + + bidStr := "652312848583266388373324160190187140051835877600158453279131187530910662656" + value, err := stringToUint256(bidStr) + require.NoError(t, err) + require.Equal(t, 0, value.Int.Cmp(primitives.WeiToBigInt(bid.Value()))) + require.Equal(t, bidStr, primitives.WeiToBigInt(bid.Value()).String()) + ebid, ok := bid.(builderBidElectra) + require.Equal(t, true, ok) + kcgCommitments := ebid.BlobKzgCommitments() + require.Equal(t, len(kcgCommitments) > 0, true) + for i := range kcgCommitments { + require.Equal(t, len(kcgCommitments[i]) == 48, true) + } + requests := ebid.ExecutionRequests() + require.Equal(t, 1, len(requests.Deposits)) + require.Equal(t, 1, len(requests.Withdrawals)) + require.Equal(t, 1, len(requests.Consolidations)) + }) t.Run("unsupported version", func(t *testing.T) { hc := &http.Client{ From b1a80360c781beab8367c4a3dd93e05f20ebc57d Mon Sep 17 00:00:00 2001 From: james-prysm Date: Mon, 24 Feb 2025 09:53:42 -0600 Subject: [PATCH 07/12] fixing linting and tests --- api/client/builder/client.go | 1 - api/client/builder/client_test.go | 1 - cmd/beacon-chain/main.go | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/api/client/builder/client.go b/api/client/builder/client.go index f2fb28d7b446..4398dcde7df6 100644 --- a/api/client/builder/client.go +++ b/api/client/builder/client.go @@ -563,7 +563,6 @@ func (c *Client) parseBlindedBlockResponseJSON( respBytes []byte, forkVersion int, ) (interfaces.ExecutionData, *v1.BlobsBundle, error) { - ep := &ExecutionPayloadResponse{} if err := json.Unmarshal(respBytes, ep); err != nil { return nil, nil, errors.Wrap(err, "error unmarshaling ExecutionPayloadResponse") diff --git a/api/client/builder/client_test.go b/api/client/builder/client_test.go index 3597667f0110..5a8568a8b09b 100644 --- a/api/client/builder/client_test.go +++ b/api/client/builder/client_test.go @@ -415,7 +415,6 @@ func TestClient_GetHeader(t *testing.T) { hc := &http.Client{ Transport: roundtrip(func(r *http.Request) (*http.Response, error) { require.Equal(t, expectedPath, r.URL.Path) - require.Equal(t, api.OctetStreamMediaType, r.Header.Get("Accept")) return &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(bytes.NewBufferString(testExampleHeaderResponseDenebTooManyBlobs)), diff --git a/cmd/beacon-chain/main.go b/cmd/beacon-chain/main.go index 70184dac2eac..02c6739cc360 100644 --- a/cmd/beacon-chain/main.go +++ b/cmd/beacon-chain/main.go @@ -84,6 +84,7 @@ var appFlags = []cli.Flag{ flags.MinBuilderDiff, flags.BeaconDBPruning, flags.PrunerRetentionEpochs, + flags.EnableBuilderSSZ, cmd.BackupWebhookOutputDir, cmd.MinimalConfigFlag, cmd.E2EConfigFlag, From 33adbf6a160ac6948fdaac27e5da03ba841cdefb Mon Sep 17 00:00:00 2001 From: james-prysm Date: Mon, 24 Feb 2025 11:47:14 -0600 Subject: [PATCH 08/12] adding in custom errors and fixing ssz validator registration --- api/client/builder/client.go | 88 +++++++++++++++++----- api/client/builder/client_test.go | 119 +++++++++++++++++++++--------- api/client/builder/errors.go | 6 ++ 3 files changed, 160 insertions(+), 53 deletions(-) diff --git a/api/client/builder/client.go b/api/client/builder/client.go index 4398dcde7df6..f1b44beac4ce 100644 --- a/api/client/builder/client.go +++ b/api/client/builder/client.go @@ -16,6 +16,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/api" "github.com/prysmaticlabs/prysm/v5/api/client" "github.com/prysmaticlabs/prysm/v5/api/server/structs" + "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" @@ -35,16 +36,20 @@ const ( postRegisterValidatorPath = "/eth/v1/builder/validators" ) -var errMalformedHostname = errors.New("hostname must include port, separated by one colon, like example.com:3500") -var errMalformedRequest = errors.New("required request data are missing") -var errNotBlinded = errors.New("submitted block is not blinded") -var blockToPayloadMapping = map[int]int{ - version.Bellatrix: version.Bellatrix, - version.Capella: version.Capella, - version.Deneb: version.Deneb, - version.Electra: version.Deneb, - version.Fulu: version.Deneb, -} +var ( + vrExample = ðpb.SignedValidatorRegistrationV1{} + vrSize = vrExample.SizeSSZ() + errMalformedHostname = errors.New("hostname must include port, separated by one colon, like example.com:3500") + errMalformedRequest = errors.New("required request data are missing") + errNotBlinded = errors.New("submitted block is not blinded") + blockToPayloadMapping = map[int]int{ + version.Bellatrix: version.Bellatrix, + version.Capella: version.Capella, + version.Deneb: version.Deneb, + version.Electra: version.Deneb, + version.Fulu: version.Deneb, + } +) // ClientOpt is a functional option for the Client type (http.Client wrapper) type ClientOpt func(*Client) @@ -378,28 +383,32 @@ func (c *Client) RegisterValidator(ctx context.Context, svr []*ethpb.SignedValid tracing.AnnotateError(span, err) return err } - vs := make([]*structs.SignedValidatorRegistration, len(svr)) - for i := 0; i < len(svr); i++ { - vs[i] = structs.SignedValidatorRegistrationFromConsensus(svr[i]) - } - body, err := json.Marshal(vs) - if err != nil { - err := errors.Wrap(err, "error encoding the SignedValidatorRegistration value body in RegisterValidator") - tracing.AnnotateError(span, err) - return err - } + var body []byte + var err error var postOpts reqOption if c.sszEnabled { postOpts = func(r *http.Request) { r.Header.Set("Content-Type", api.OctetStreamMediaType) r.Header.Set("Accept", api.OctetStreamMediaType) } + body, err = sszValidatorRegisterRequest(svr) + if err != nil { + err := errors.Wrap(err, "error ssz encoding the SignedValidatorRegistration value body in RegisterValidator") + tracing.AnnotateError(span, err) + return err + } } else { postOpts = func(r *http.Request) { r.Header.Set("Content-Type", api.JsonMediaType) r.Header.Set("Accept", api.JsonMediaType) } + body, err = jsonValidatorRegisterRequest(svr) + if err != nil { + err := errors.Wrap(err, "error json encoding the SignedValidatorRegistration value body in RegisterValidator") + tracing.AnnotateError(span, err) + return err + } } _, _, err = c.do(ctx, http.MethodPost, postRegisterValidatorPath, bytes.NewBuffer(body), postOpts) @@ -410,6 +419,33 @@ func (c *Client) RegisterValidator(ctx context.Context, svr []*ethpb.SignedValid return nil } +func jsonValidatorRegisterRequest(svr []*ethpb.SignedValidatorRegistrationV1) ([]byte, error) { + vs := make([]*structs.SignedValidatorRegistration, len(svr)) + for i := 0; i < len(svr); i++ { + vs[i] = structs.SignedValidatorRegistrationFromConsensus(svr[i]) + } + body, err := json.Marshal(vs) + if err != nil { + return nil, err + } + return body, nil +} + +func sszValidatorRegisterRequest(svr []*ethpb.SignedValidatorRegistrationV1) ([]byte, error) { + if uint64(len(svr)) > params.BeaconConfig().ValidatorRegistryLimit { + return nil, errors.Wrap(errMalformedRequest, "validator registry limit exceeded") + } + ssz := make([]byte, vrSize*len(svr)) + for i, vr := range svr { + sszrep, err := vr.MarshalSSZ() + if err != nil { + return nil, errors.Wrap(err, "failed to marshal validator registry ssz") + } + copy(ssz[i*vrSize:(i+1)*vrSize], sszrep) + } + return ssz, nil +} + var errResponseVersionMismatch = errors.New("builder API response uses a different version than requested in " + api.VersionHeader + " header") // SubmitBlindedBlock calls the builder API endpoint that binds the validator to the builder and submits the block. @@ -614,6 +650,18 @@ func non200Err(response *http.Response) error { } msg := fmt.Sprintf("code=%d, url=%s, body=%s", response.StatusCode, response.Request.URL, body) switch response.StatusCode { + case http.StatusUnsupportedMediaType: + log.WithError(ErrUnsupportedMediaType).Debugf(msg) + if jsonErr := json.Unmarshal(bodyBytes, &errMessage); jsonErr != nil { + return errors.Wrap(jsonErr, "unable to read response body") + } + return errors.Wrap(ErrUnsupportedMediaType, errMessage.Message) + case http.StatusNotAcceptable: + log.WithError(ErrNotAcceptable).Debugf(msg) + if jsonErr := json.Unmarshal(bodyBytes, &errMessage); jsonErr != nil { + return errors.Wrap(jsonErr, "unable to read response body") + } + return errors.Wrap(ErrNotAcceptable, errMessage.Message) case http.StatusNoContent: log.WithError(ErrNoContent).Debug(msg) return ErrNoContent diff --git a/api/client/builder/client_test.go b/api/client/builder/client_test.go index 5a8568a8b09b..5ebf6cfd3816 100644 --- a/api/client/builder/client_test.go +++ b/api/client/builder/client_test.go @@ -87,39 +87,84 @@ func TestClient_RegisterValidator(t *testing.T) { ctx := context.Background() expectedBody := `[{"message":{"fee_recipient":"0x0000000000000000000000000000000000000000","gas_limit":"23","timestamp":"42","pubkey":"0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a"},"signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"}]` expectedPath := "/eth/v1/builder/validators" - hc := &http.Client{ - Transport: roundtrip(func(r *http.Request) (*http.Response, error) { - require.Equal(t, api.JsonMediaType, r.Header.Get("Content-Type")) - require.Equal(t, api.JsonMediaType, r.Header.Get("Accept")) - body, err := io.ReadAll(r.Body) - defer func() { - require.NoError(t, r.Body.Close()) - }() - require.NoError(t, err) - require.Equal(t, expectedBody, string(body)) - require.Equal(t, expectedPath, r.URL.Path) - require.Equal(t, http.MethodPost, r.Method) - return &http.Response{ - StatusCode: http.StatusOK, - Body: io.NopCloser(bytes.NewBuffer(nil)), - Request: r.Clone(ctx), - }, nil - }), - } - c := &Client{ - hc: hc, - baseURL: &url.URL{Host: "localhost:3500", Scheme: "http"}, - } - reg := ð.SignedValidatorRegistrationV1{ - Message: ð.ValidatorRegistrationV1{ - FeeRecipient: ezDecode(t, params.BeaconConfig().EthBurnAddressHex), - GasLimit: 23, - Timestamp: 42, - Pubkey: ezDecode(t, "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a"), - }, - Signature: ezDecode(t, "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"), - } - require.NoError(t, c.RegisterValidator(ctx, []*eth.SignedValidatorRegistrationV1{reg})) + t.Run("JSON success", func(t *testing.T) { + hc := &http.Client{ + Transport: roundtrip(func(r *http.Request) (*http.Response, error) { + require.Equal(t, api.JsonMediaType, r.Header.Get("Content-Type")) + require.Equal(t, api.JsonMediaType, r.Header.Get("Accept")) + body, err := io.ReadAll(r.Body) + defer func() { + require.NoError(t, r.Body.Close()) + }() + require.NoError(t, err) + require.Equal(t, expectedBody, string(body)) + require.Equal(t, expectedPath, r.URL.Path) + require.Equal(t, http.MethodPost, r.Method) + return &http.Response{ + StatusCode: http.StatusOK, + Body: io.NopCloser(bytes.NewBuffer(nil)), + Request: r.Clone(ctx), + }, nil + }), + } + c := &Client{ + hc: hc, + baseURL: &url.URL{Host: "localhost:3500", Scheme: "http"}, + } + reg := ð.SignedValidatorRegistrationV1{ + Message: ð.ValidatorRegistrationV1{ + FeeRecipient: ezDecode(t, params.BeaconConfig().EthBurnAddressHex), + GasLimit: 23, + Timestamp: 42, + Pubkey: ezDecode(t, "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a"), + }, + Signature: ezDecode(t, "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"), + } + require.NoError(t, c.RegisterValidator(ctx, []*eth.SignedValidatorRegistrationV1{reg})) + }) + t.Run("SSZ success", func(t *testing.T) { + hc := &http.Client{ + Transport: roundtrip(func(r *http.Request) (*http.Response, error) { + require.Equal(t, api.OctetStreamMediaType, r.Header.Get("Content-Type")) + require.Equal(t, api.OctetStreamMediaType, r.Header.Get("Accept")) + body, err := io.ReadAll(r.Body) + defer func() { + require.NoError(t, r.Body.Close()) + }() + require.NoError(t, err) + request := ð.SignedValidatorRegistrationV1{} + itemBytes := body[:request.SizeSSZ()] + require.NoError(t, request.UnmarshalSSZ(itemBytes)) + jsRequest := structs.SignedValidatorRegistrationFromConsensus(request) + js, err := json.Marshal([]*structs.SignedValidatorRegistration{jsRequest}) + require.NoError(t, err) + + require.Equal(t, expectedBody, string(js)) + require.Equal(t, expectedPath, r.URL.Path) + require.Equal(t, http.MethodPost, r.Method) + return &http.Response{ + StatusCode: http.StatusOK, + Body: io.NopCloser(bytes.NewBuffer(nil)), + Request: r.Clone(ctx), + }, nil + }), + } + c := &Client{ + hc: hc, + baseURL: &url.URL{Host: "localhost:3500", Scheme: "http"}, + sszEnabled: true, + } + reg := ð.SignedValidatorRegistrationV1{ + Message: ð.ValidatorRegistrationV1{ + FeeRecipient: ezDecode(t, params.BeaconConfig().EthBurnAddressHex), + GasLimit: 23, + Timestamp: 42, + Pubkey: ezDecode(t, "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a"), + }, + Signature: ezDecode(t, "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"), + } + require.NoError(t, c.RegisterValidator(ctx, []*eth.SignedValidatorRegistrationV1{reg})) + }) } func TestClient_GetHeader(t *testing.T) { @@ -175,6 +220,7 @@ func TestClient_GetHeader(t *testing.T) { hc := &http.Client{ Transport: roundtrip(func(r *http.Request) (*http.Response, error) { require.Equal(t, expectedPath, r.URL.Path) + require.Equal(t, api.JsonMediaType, r.Header.Get("Accept")) return &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(bytes.NewBufferString(testExampleHeaderResponse)), @@ -209,6 +255,7 @@ func TestClient_GetHeader(t *testing.T) { t.Run("bellatrix ssz", func(t *testing.T) { hc := &http.Client{ Transport: roundtrip(func(r *http.Request) (*http.Response, error) { + require.Equal(t, api.OctetStreamMediaType, r.Header.Get("Accept")) require.Equal(t, expectedPath, r.URL.Path) epr := &ExecHeaderResponse{} require.NoError(t, json.Unmarshal([]byte(testExampleHeaderResponse), epr)) @@ -254,6 +301,7 @@ func TestClient_GetHeader(t *testing.T) { t.Run("capella", func(t *testing.T) { hc := &http.Client{ Transport: roundtrip(func(r *http.Request) (*http.Response, error) { + require.Equal(t, api.JsonMediaType, r.Header.Get("Accept")) require.Equal(t, expectedPath, r.URL.Path) return &http.Response{ StatusCode: http.StatusOK, @@ -285,6 +333,7 @@ func TestClient_GetHeader(t *testing.T) { t.Run("capella ssz", func(t *testing.T) { hc := &http.Client{ Transport: roundtrip(func(r *http.Request) (*http.Response, error) { + require.Equal(t, api.OctetStreamMediaType, r.Header.Get("Accept")) require.Equal(t, expectedPath, r.URL.Path) epr := &ExecHeaderResponseCapella{} require.NoError(t, json.Unmarshal([]byte(testExampleHeaderResponseCapella), epr)) @@ -326,6 +375,7 @@ func TestClient_GetHeader(t *testing.T) { t.Run("deneb", func(t *testing.T) { hc := &http.Client{ Transport: roundtrip(func(r *http.Request) (*http.Response, error) { + require.Equal(t, api.JsonMediaType, r.Header.Get("Accept")) require.Equal(t, expectedPath, r.URL.Path) return &http.Response{ StatusCode: http.StatusOK, @@ -365,6 +415,7 @@ func TestClient_GetHeader(t *testing.T) { t.Run("deneb ssz", func(t *testing.T) { hc := &http.Client{ Transport: roundtrip(func(r *http.Request) (*http.Response, error) { + require.Equal(t, api.OctetStreamMediaType, r.Header.Get("Accept")) require.Equal(t, expectedPath, r.URL.Path) epr := &ExecHeaderResponseDeneb{} require.NoError(t, json.Unmarshal([]byte(testExampleHeaderResponseDeneb), epr)) @@ -432,6 +483,7 @@ func TestClient_GetHeader(t *testing.T) { t.Run("electra", func(t *testing.T) { hc := &http.Client{ Transport: roundtrip(func(r *http.Request) (*http.Response, error) { + require.Equal(t, api.JsonMediaType, r.Header.Get("Accept")) require.Equal(t, expectedPath, r.URL.Path) return &http.Response{ StatusCode: http.StatusOK, @@ -476,6 +528,7 @@ func TestClient_GetHeader(t *testing.T) { t.Run("electra ssz", func(t *testing.T) { hc := &http.Client{ Transport: roundtrip(func(r *http.Request) (*http.Response, error) { + require.Equal(t, api.OctetStreamMediaType, r.Header.Get("Accept")) require.Equal(t, expectedPath, r.URL.Path) epr := &ExecHeaderResponseElectra{} require.NoError(t, json.Unmarshal([]byte(testExampleHeaderResponseElectra), epr)) diff --git a/api/client/builder/errors.go b/api/client/builder/errors.go index a19016f857a7..92b3a71bafc6 100644 --- a/api/client/builder/errors.go +++ b/api/client/builder/errors.go @@ -15,3 +15,9 @@ var ErrBadRequest = errors.Wrap(ErrNotOK, "recv 400 BadRequest response from API // ErrNoContent specifically means that a '204 - No Content' response was received from the API. // Typically, a 204 is a success but in this case for the Header API means No header is available var ErrNoContent = errors.New("recv 204 no content response from API, No header is available") + +// ErrUnsupportedMediaType specifically means that a '415 - Unsupported Media Type' was received from the API. +var ErrUnsupportedMediaType = errors.Wrap(ErrNotOK, "The media type in \"Content-Type\" header is unsupported, and the request has been rejected. This occurs when a HTTP request supplies a payload in a content-type that the server is not able to handle.") + +// ErrNotAcceptable specifically means that a '406 - Not Acceptable' was received from the API. +var ErrNotAcceptable = errors.Wrap(ErrNotOK, "The accept header value is not acceptable") From d032738dbe7e23e5a7dcc315640f5f313b862a47 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Tue, 4 Mar 2025 08:58:35 -0600 Subject: [PATCH 09/12] Update api/client/builder/client.go Co-authored-by: Manu NALEPA --- api/client/builder/client.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/api/client/builder/client.go b/api/client/builder/client.go index f1b44beac4ce..4fb6360e7c26 100644 --- a/api/client/builder/client.go +++ b/api/client/builder/client.go @@ -384,9 +384,11 @@ func (c *Client) RegisterValidator(ctx context.Context, svr []*ethpb.SignedValid return err } - var body []byte - var err error - var postOpts reqOption + var ( + body []byte + err error + postOpts reqOption + ) if c.sszEnabled { postOpts = func(r *http.Request) { r.Header.Set("Content-Type", api.OctetStreamMediaType) From 325b6b596d39da33197de591a04e95b27b863495 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Tue, 4 Mar 2025 08:58:47 -0600 Subject: [PATCH 10/12] Update api/client/builder/client.go Co-authored-by: Manu NALEPA --- api/client/builder/client.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/api/client/builder/client.go b/api/client/builder/client.go index 4fb6360e7c26..5a5752e87784 100644 --- a/api/client/builder/client.go +++ b/api/client/builder/client.go @@ -413,9 +413,8 @@ func (c *Client) RegisterValidator(ctx context.Context, svr []*ethpb.SignedValid } } - _, _, err = c.do(ctx, http.MethodPost, postRegisterValidatorPath, bytes.NewBuffer(body), postOpts) - if err != nil { - return err + if _, _, err = c.do(ctx, http.MethodPost, postRegisterValidatorPath, bytes.NewBuffer(body), postOpts); err != nil { + return errors.Wrap(err, "do") } log.WithField("registrationCount", len(svr)).Debug("Successfully registered validator(s) on builder") return nil From 5a792a6d515288f70f00c1a22847915d6d88352b Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 4 Mar 2025 13:13:25 -0600 Subject: [PATCH 11/12] manu's feedback --- api/client/builder/client.go | 53 ++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/api/client/builder/client.go b/api/client/builder/client.go index 5a5752e87784..e6d292b2e6c2 100644 --- a/api/client/builder/client.go +++ b/api/client/builder/client.go @@ -42,13 +42,7 @@ var ( errMalformedHostname = errors.New("hostname must include port, separated by one colon, like example.com:3500") errMalformedRequest = errors.New("required request data are missing") errNotBlinded = errors.New("submitted block is not blinded") - blockToPayloadMapping = map[int]int{ - version.Bellatrix: version.Bellatrix, - version.Capella: version.Capella, - version.Deneb: version.Deneb, - version.Electra: version.Deneb, - version.Fulu: version.Deneb, - } + errVersionUnsupported = errors.New("version is not supported") ) // ClientOpt is a functional option for the Client type (http.Client wrapper) @@ -281,16 +275,15 @@ func (c *Client) parseHeaderResponse(data []byte, header http.Header) (SignedBid return nil, errors.Wrap(err, fmt.Sprintf("unsupported header version %s", versionHeader)) } - switch { - case ver >= version.Electra: + if ver >= version.Electra { return c.parseHeaderElectra(data) - case ver >= version.Deneb: + } else if ver >= version.Deneb { return c.parseHeaderDeneb(data) - case ver >= version.Capella: + } else if ver >= version.Capella { return c.parseHeaderCapella(data) - case ver >= version.Bellatrix: + } else if ver >= version.Bellatrix { return c.parseHeaderBellatrix(data) - default: + } else { return nil, fmt.Errorf("unsupported header version %s", versionHeader) } } @@ -449,6 +442,18 @@ func sszValidatorRegisterRequest(svr []*ethpb.SignedValidatorRegistrationV1) ([] var errResponseVersionMismatch = errors.New("builder API response uses a different version than requested in " + api.VersionHeader + " header") +func getVersionsBlockToPayload(blockVersion int) (int, error) { + if blockVersion >= version.Deneb { + return version.Deneb, nil + } else if blockVersion == version.Capella { + return version.Capella, nil + } else if blockVersion == version.Bellatrix { + return version.Bellatrix, nil + } else { + return 0, errors.Wrapf(errVersionUnsupported, "block version %d", blockVersion) + } +} + // SubmitBlindedBlock calls the builder API endpoint that binds the validator to the builder and submits the block. // The response is the full execution payload used to create the blinded block. func (c *Client) SubmitBlindedBlock(ctx context.Context, sb interfaces.ReadOnlySignedBeaconBlock) (interfaces.ExecutionData, *v1.BlobsBundle, error) { @@ -469,13 +474,13 @@ func (c *Client) SubmitBlindedBlock(ctx context.Context, sb interfaces.ReadOnlyS return nil, nil, err } - expectedPayloadVer, ok := blockToPayloadMapping[sb.Version()] - if !ok { - return nil, nil, errors.Errorf("unsupported block version %d", sb.Version()) + expectedPayloadVer, err := getVersionsBlockToPayload(sb.Version()) + if err != nil { + return nil, nil, err } - gotPayloadVer, ok := blockToPayloadMapping[ver] - if !ok { - return nil, nil, errors.Errorf("unsupported block version %d", ver) + gotPayloadVer, err := getVersionsBlockToPayload(ver) + if err != nil { + return nil, nil, err } if expectedPayloadVer != gotPayloadVer { return nil, nil, errors.Wrapf(errResponseVersionMismatch, "expected payload version %d, got %d", expectedPayloadVer, gotPayloadVer) @@ -560,8 +565,8 @@ func (c *Client) parseBlindedBlockResponseSSZ( respBytes []byte, forkVersion int, ) (interfaces.ExecutionData, *v1.BlobsBundle, error) { - switch { - case forkVersion >= version.Deneb: + + if forkVersion >= version.Deneb { payloadAndBlobs := &v1.ExecutionPayloadDenebAndBlobsBundle{} if err := payloadAndBlobs.UnmarshalSSZ(respBytes); err != nil { return nil, nil, errors.Wrap(err, "unable to unmarshal ExecutionPayloadDenebAndBlobsBundle SSZ") @@ -571,7 +576,7 @@ func (c *Client) parseBlindedBlockResponseSSZ( return nil, nil, errors.Wrapf(err, "unable to wrap execution data for %s", version.String(forkVersion)) } return ed, payloadAndBlobs.BlobsBundle, nil - case forkVersion >= version.Capella: + } else if forkVersion >= version.Capella { payload := &v1.ExecutionPayloadCapella{} if err := payload.UnmarshalSSZ(respBytes); err != nil { return nil, nil, errors.Wrap(err, "unable to unmarshal ExecutionPayloadCapella SSZ") @@ -581,7 +586,7 @@ func (c *Client) parseBlindedBlockResponseSSZ( return nil, nil, errors.Wrapf(err, "unable to wrap execution data for %s", version.String(forkVersion)) } return ed, nil, nil - case forkVersion >= version.Bellatrix: + } else if forkVersion >= version.Bellatrix { payload := &v1.ExecutionPayload{} if err := payload.UnmarshalSSZ(respBytes); err != nil { return nil, nil, errors.Wrap(err, "unable to unmarshal ExecutionPayload SSZ") @@ -591,7 +596,7 @@ func (c *Client) parseBlindedBlockResponseSSZ( return nil, nil, errors.Wrapf(err, "unable to wrap execution data for %s", version.String(forkVersion)) } return ed, nil, nil - default: + } else { return nil, nil, fmt.Errorf("unsupported header version %s", version.String(forkVersion)) } } From 8047191f3df8af75257cee6b53cb6a8ece9e41e6 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 4 Mar 2025 13:26:19 -0600 Subject: [PATCH 12/12] linting --- api/client/builder/client.go | 1 - cmd/beacon-chain/usage.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/api/client/builder/client.go b/api/client/builder/client.go index e6d292b2e6c2..d31fd14d9b1f 100644 --- a/api/client/builder/client.go +++ b/api/client/builder/client.go @@ -565,7 +565,6 @@ func (c *Client) parseBlindedBlockResponseSSZ( respBytes []byte, forkVersion int, ) (interfaces.ExecutionData, *v1.BlobsBundle, error) { - if forkVersion >= version.Deneb { payloadAndBlobs := &v1.ExecutionPayloadDenebAndBlobsBundle{} if err := payloadAndBlobs.UnmarshalSSZ(respBytes); err != nil { diff --git a/cmd/beacon-chain/usage.go b/cmd/beacon-chain/usage.go index a1cfd28a43ee..196da0465544 100644 --- a/cmd/beacon-chain/usage.go +++ b/cmd/beacon-chain/usage.go @@ -136,7 +136,7 @@ var appHelpFlagGroups = []flagGroup{ flags.MinBuilderBid, flags.MinBuilderDiff, flags.SuggestedFeeRecipient, - flags.EnableBuilderSSZ, + flags.EnableBuilderSSZ, }, }, { // Flags relevant to syncing the beacon chain.