diff --git a/changelog/tt_eggplant.md b/changelog/tt_eggplant.md new file mode 100644 index 0000000000..3d23ee274e --- /dev/null +++ b/changelog/tt_eggplant.md @@ -0,0 +1,3 @@ +### Added + +- ssz static spec tests for fulu \ No newline at end of file diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index 399ac0b50e..4887d6b420 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -186,6 +186,7 @@ ssz_fulu_objs = [ "BeaconBlockContentsFulu", "BlindedBeaconBlockFulu", "DataColumnIdentifier", + "DataColumnsByRootIdentifier", "DataColumnSidecar", "SignedBeaconBlockContentsFulu", "SignedBeaconBlockFulu", diff --git a/proto/prysm/v1alpha1/data_columns.pb.go b/proto/prysm/v1alpha1/data_columns.pb.go index 9a4c5fcc8f..20d4e9f249 100755 --- a/proto/prysm/v1alpha1/data_columns.pb.go +++ b/proto/prysm/v1alpha1/data_columns.pb.go @@ -164,6 +164,61 @@ func (x *DataColumnIdentifier) GetIndex() uint64 { return 0 } +type DataColumnsByRootIdentifier struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockRoot []byte `protobuf:"bytes,1,opt,name=block_root,json=blockRoot,proto3" json:"block_root,omitempty" ssz-size:"32"` + Columns []uint64 `protobuf:"varint,2,rep,packed,name=columns,proto3" json:"columns,omitempty" ssz-max:"128"` +} + +func (x *DataColumnsByRootIdentifier) Reset() { + *x = DataColumnsByRootIdentifier{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_prysm_v1alpha1_data_columns_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataColumnsByRootIdentifier) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataColumnsByRootIdentifier) ProtoMessage() {} + +func (x *DataColumnsByRootIdentifier) ProtoReflect() protoreflect.Message { + mi := &file_proto_prysm_v1alpha1_data_columns_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DataColumnsByRootIdentifier.ProtoReflect.Descriptor instead. +func (*DataColumnsByRootIdentifier) Descriptor() ([]byte, []int) { + return file_proto_prysm_v1alpha1_data_columns_proto_rawDescGZIP(), []int{2} +} + +func (x *DataColumnsByRootIdentifier) GetBlockRoot() []byte { + if x != nil { + return x.BlockRoot + } + return nil +} + +func (x *DataColumnsByRootIdentifier) GetColumns() []uint64 { + if x != nil { + return x.Columns + } + return nil +} + var File_proto_prysm_v1alpha1_data_columns_proto protoreflect.FileDescriptor var file_proto_prysm_v1alpha1_data_columns_proto_rawDesc = []byte{ @@ -204,17 +259,23 @@ var file_proto_prysm_v1alpha1_data_columns_proto_rawDesc = []byte{ 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x42, 0x9a, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, - 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4f, - 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x4c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x36, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, - 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0x67, 0x0a, 0x1b, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x42, + 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, + 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x21, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x42, 0x07, 0x92, 0xb5, 0x18, 0x03, 0x31, 0x32, 0x38, + 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x42, 0x9a, 0x01, 0x0a, 0x19, 0x6f, 0x72, + 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6c, + 0x75, 0x6d, 0x6e, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x4c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x36, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, + 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -229,14 +290,15 @@ func file_proto_prysm_v1alpha1_data_columns_proto_rawDescGZIP() []byte { return file_proto_prysm_v1alpha1_data_columns_proto_rawDescData } -var file_proto_prysm_v1alpha1_data_columns_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_proto_prysm_v1alpha1_data_columns_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_proto_prysm_v1alpha1_data_columns_proto_goTypes = []interface{}{ - (*DataColumnSidecar)(nil), // 0: ethereum.eth.v1alpha1.DataColumnSidecar - (*DataColumnIdentifier)(nil), // 1: ethereum.eth.v1alpha1.DataColumnIdentifier - (*SignedBeaconBlockHeader)(nil), // 2: ethereum.eth.v1alpha1.SignedBeaconBlockHeader + (*DataColumnSidecar)(nil), // 0: ethereum.eth.v1alpha1.DataColumnSidecar + (*DataColumnIdentifier)(nil), // 1: ethereum.eth.v1alpha1.DataColumnIdentifier + (*DataColumnsByRootIdentifier)(nil), // 2: ethereum.eth.v1alpha1.DataColumnsByRootIdentifier + (*SignedBeaconBlockHeader)(nil), // 3: ethereum.eth.v1alpha1.SignedBeaconBlockHeader } var file_proto_prysm_v1alpha1_data_columns_proto_depIdxs = []int32{ - 2, // 0: ethereum.eth.v1alpha1.DataColumnSidecar.signed_block_header:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockHeader + 3, // 0: ethereum.eth.v1alpha1.DataColumnSidecar.signed_block_header:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlockHeader 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name @@ -275,6 +337,18 @@ func file_proto_prysm_v1alpha1_data_columns_proto_init() { return nil } } + file_proto_prysm_v1alpha1_data_columns_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataColumnsByRootIdentifier); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -282,7 +356,7 @@ func file_proto_prysm_v1alpha1_data_columns_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_prysm_v1alpha1_data_columns_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/prysm/v1alpha1/data_columns.proto b/proto/prysm/v1alpha1/data_columns.proto index cd3cb52b4c..fd8fc4db04 100644 --- a/proto/prysm/v1alpha1/data_columns.proto +++ b/proto/prysm/v1alpha1/data_columns.proto @@ -48,4 +48,9 @@ message DataColumnSidecar { message DataColumnIdentifier { bytes block_root = 1 [ (ethereum.eth.ext.ssz_size) = "32" ]; uint64 index = 2; -} \ No newline at end of file +} + +message DataColumnsByRootIdentifier { + bytes block_root = 1 [ (ethereum.eth.ext.ssz_size) = "32" ]; + repeated uint64 columns = 2 [ (ethereum.eth.ext.ssz_max) = "128" ]; +} diff --git a/proto/prysm/v1alpha1/fulu.ssz.go b/proto/prysm/v1alpha1/fulu.ssz.go index 4e340d719c..47cf25c415 100644 --- a/proto/prysm/v1alpha1/fulu.ssz.go +++ b/proto/prysm/v1alpha1/fulu.ssz.go @@ -1158,3 +1158,123 @@ func (d *DataColumnIdentifier) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.Merkleize(indx) return } + +// MarshalSSZ ssz marshals the DataColumnsByRootIdentifier object +func (d *DataColumnsByRootIdentifier) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(d) +} + +// MarshalSSZTo ssz marshals the DataColumnsByRootIdentifier object to a target array +func (d *DataColumnsByRootIdentifier) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(36) + + // Field (0) 'BlockRoot' + if size := len(d.BlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) + return + } + dst = append(dst, d.BlockRoot...) + + // Offset (1) 'Columns' + dst = ssz.WriteOffset(dst, offset) + offset += len(d.Columns) * 8 + + // Field (1) 'Columns' + if size := len(d.Columns); size > 128 { + err = ssz.ErrListTooBigFn("--.Columns", size, 128) + return + } + for ii := 0; ii < len(d.Columns); ii++ { + dst = ssz.MarshalUint64(dst, d.Columns[ii]) + } + + return +} + +// UnmarshalSSZ ssz unmarshals the DataColumnsByRootIdentifier object +func (d *DataColumnsByRootIdentifier) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 36 { + return ssz.ErrSize + } + + tail := buf + var o1 uint64 + + // Field (0) 'BlockRoot' + if cap(d.BlockRoot) == 0 { + d.BlockRoot = make([]byte, 0, len(buf[0:32])) + } + d.BlockRoot = append(d.BlockRoot, buf[0:32]...) + + // Offset (1) 'Columns' + if o1 = ssz.ReadOffset(buf[32:36]); o1 > size { + return ssz.ErrOffset + } + + if o1 != 36 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Columns' + { + buf = tail[o1:] + num, err := ssz.DivideInt2(len(buf), 8, 128) + if err != nil { + return err + } + d.Columns = ssz.ExtendUint64(d.Columns, num) + for ii := 0; ii < num; ii++ { + d.Columns[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the DataColumnsByRootIdentifier object +func (d *DataColumnsByRootIdentifier) SizeSSZ() (size int) { + size = 36 + + // Field (1) 'Columns' + size += len(d.Columns) * 8 + + return +} + +// HashTreeRoot ssz hashes the DataColumnsByRootIdentifier object +func (d *DataColumnsByRootIdentifier) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(d) +} + +// HashTreeRootWith ssz hashes the DataColumnsByRootIdentifier object with a hasher +func (d *DataColumnsByRootIdentifier) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'BlockRoot' + if size := len(d.BlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) + return + } + hh.PutBytes(d.BlockRoot) + + // Field (1) 'Columns' + { + if size := len(d.Columns); size > 128 { + err = ssz.ErrListTooBigFn("--.Columns", size, 128) + return + } + subIndx := hh.Index() + for _, i := range d.Columns { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(d.Columns)) + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(128, numItems, 8)) + } + + hh.Merkleize(indx) + return +} diff --git a/testing/spectest/mainnet/fulu/ssz_static/BUILD.bazel b/testing/spectest/mainnet/fulu/ssz_static/BUILD.bazel new file mode 100644 index 0000000000..b0948bcd30 --- /dev/null +++ b/testing/spectest/mainnet/fulu/ssz_static/BUILD.bazel @@ -0,0 +1,12 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + size = "small", + srcs = ["ssz_static_test.go"], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_mainnet//:test_data", + ], + tags = ["spectest"], + deps = ["//testing/spectest/shared/fulu/ssz_static:go_default_library"], +) diff --git a/testing/spectest/mainnet/fulu/ssz_static/ssz_static_test.go b/testing/spectest/mainnet/fulu/ssz_static/ssz_static_test.go new file mode 100644 index 0000000000..2c26168dc4 --- /dev/null +++ b/testing/spectest/mainnet/fulu/ssz_static/ssz_static_test.go @@ -0,0 +1,11 @@ +package ssz_static + +import ( + "testing" + + "github.com/OffchainLabs/prysm/v6/testing/spectest/shared/fulu/ssz_static" +) + +func TestMainnet_Fulu_SSZStatic(t *testing.T) { + ssz_static.RunSSZStaticTests(t, "mainnet") +} diff --git a/testing/spectest/minimal/fulu/ssz_static/BUILD.bazel b/testing/spectest/minimal/fulu/ssz_static/BUILD.bazel new file mode 100644 index 0000000000..1b775618ed --- /dev/null +++ b/testing/spectest/minimal/fulu/ssz_static/BUILD.bazel @@ -0,0 +1,16 @@ +load("@prysm//tools/go:def.bzl", "go_test") + +go_test( + name = "go_default_test", + size = "small", + srcs = ["ssz_static_test.go"], + data = glob(["*.yaml"]) + [ + "@consensus_spec_tests_minimal//:test_data", + ], + eth_network = "minimal", + tags = [ + "minimal", + "spectest", + ], + deps = ["//testing/spectest/shared/fulu/ssz_static:go_default_library"], +) diff --git a/testing/spectest/minimal/fulu/ssz_static/ssz_static_test.go b/testing/spectest/minimal/fulu/ssz_static/ssz_static_test.go new file mode 100644 index 0000000000..5d678a5126 --- /dev/null +++ b/testing/spectest/minimal/fulu/ssz_static/ssz_static_test.go @@ -0,0 +1,11 @@ +package ssz_static + +import ( + "testing" + + "github.com/OffchainLabs/prysm/v6/testing/spectest/shared/fulu/ssz_static" +) + +func TestMinimal_Fulu_SSZStatic(t *testing.T) { + ssz_static.RunSSZStaticTests(t, "minimal") +} diff --git a/testing/spectest/shared/fulu/ssz_static/BUILD.bazel b/testing/spectest/shared/fulu/ssz_static/BUILD.bazel new file mode 100644 index 0000000000..809506e029 --- /dev/null +++ b/testing/spectest/shared/fulu/ssz_static/BUILD.bazel @@ -0,0 +1,17 @@ +load("@prysm//tools/go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + testonly = True, + srcs = ["ssz_static.go"], + importpath = "github.com/OffchainLabs/prysm/v6/testing/spectest/shared/fulu/ssz_static", + visibility = ["//testing/spectest:__subpackages__"], + deps = [ + "//beacon-chain/state/state-native:go_default_library", + "//proto/engine/v1:go_default_library", + "//proto/prysm/v1alpha1:go_default_library", + "//testing/require:go_default_library", + "//testing/spectest/shared/common/ssz_static:go_default_library", + "@com_github_prysmaticlabs_fastssz//:go_default_library", + ], +) diff --git a/testing/spectest/shared/fulu/ssz_static/ssz_static.go b/testing/spectest/shared/fulu/ssz_static/ssz_static.go new file mode 100644 index 0000000000..8403ff11cc --- /dev/null +++ b/testing/spectest/shared/fulu/ssz_static/ssz_static.go @@ -0,0 +1,168 @@ +package ssz_static + +import ( + "context" + "errors" + "testing" + + state_native "github.com/OffchainLabs/prysm/v6/beacon-chain/state/state-native" + enginev1 "github.com/OffchainLabs/prysm/v6/proto/engine/v1" + ethpb "github.com/OffchainLabs/prysm/v6/proto/prysm/v1alpha1" + "github.com/OffchainLabs/prysm/v6/testing/require" + common "github.com/OffchainLabs/prysm/v6/testing/spectest/shared/common/ssz_static" + fssz "github.com/prysmaticlabs/fastssz" +) + +// RunSSZStaticTests executes "ssz_static" tests. +func RunSSZStaticTests(t *testing.T, config string) { + common.RunSSZStaticTests(t, config, "fulu", UnmarshalledSSZ, customHtr) +} + +func customHtr(t *testing.T, htrs []common.HTR, object interface{}) []common.HTR { + _, ok := object.(*ethpb.BeaconStateElectra) + if !ok { + return htrs + } + + htrs = append(htrs, func(s interface{}) ([32]byte, error) { + beaconState, err := state_native.InitializeFromProtoElectra(s.(*ethpb.BeaconStateElectra)) + require.NoError(t, err) + return beaconState.HashTreeRoot(context.Background()) + }) + return htrs +} + +// UnmarshalledSSZ unmarshalls serialized input. +func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (interface{}, error) { + var obj interface{} + switch folderName { + case "ExecutionPayload": + obj = &enginev1.ExecutionPayloadDeneb{} + case "ExecutionPayloadHeader": + obj = &enginev1.ExecutionPayloadHeaderDeneb{} + case "Attestation": + obj = ðpb.AttestationElectra{} + case "AttestationData": + obj = ðpb.AttestationData{} + case "AttesterSlashing": + obj = ðpb.AttesterSlashingElectra{} + case "AggregateAndProof": + obj = ðpb.AggregateAttestationAndProofElectra{} + case "BeaconBlock": + obj = ðpb.BeaconBlockElectra{} + case "BeaconBlockBody": + obj = ðpb.BeaconBlockBodyElectra{} + case "BeaconBlockHeader": + obj = ðpb.BeaconBlockHeader{} + case "BeaconState": + obj = ðpb.BeaconStateElectra{} + case "Checkpoint": + obj = ðpb.Checkpoint{} + case "Deposit": + obj = ðpb.Deposit{} + case "DepositMessage": + obj = ðpb.DepositMessage{} + case "DepositData": + obj = ðpb.Deposit_Data{} + case "Eth1Data": + obj = ðpb.Eth1Data{} + case "Eth1Block": + t.Skip("Unused type") + return nil, nil + case "Fork": + obj = ðpb.Fork{} + case "ForkData": + obj = ðpb.ForkData{} + case "HistoricalBatch": + obj = ðpb.HistoricalBatch{} + case "IndexedAttestation": + obj = ðpb.IndexedAttestationElectra{} + case "PendingAttestation": + obj = ðpb.PendingAttestation{} + case "ProposerSlashing": + obj = ðpb.ProposerSlashing{} + case "SignedAggregateAndProof": + obj = ðpb.SignedAggregateAttestationAndProofElectra{} + case "SignedBeaconBlock": + obj = ðpb.SignedBeaconBlockElectra{} + case "SignedBeaconBlockHeader": + obj = ðpb.SignedBeaconBlockHeader{} + case "SignedVoluntaryExit": + obj = ðpb.SignedVoluntaryExit{} + case "SigningData": + obj = ðpb.SigningData{} + case "Validator": + obj = ðpb.Validator{} + case "VoluntaryExit": + obj = ðpb.VoluntaryExit{} + case "SyncCommitteeMessage": + obj = ðpb.SyncCommitteeMessage{} + case "SyncCommitteeContribution": + obj = ðpb.SyncCommitteeContribution{} + case "ContributionAndProof": + obj = ðpb.ContributionAndProof{} + case "SignedContributionAndProof": + obj = ðpb.SignedContributionAndProof{} + case "SingleAttestation": + obj = ðpb.SingleAttestation{} + case "SyncAggregate": + obj = ðpb.SyncAggregate{} + case "SyncAggregatorSelectionData": + obj = ðpb.SyncAggregatorSelectionData{} + case "SyncCommittee": + obj = ðpb.SyncCommittee{} + case "LightClientOptimisticUpdate": + obj = ðpb.LightClientOptimisticUpdateDeneb{} + case "LightClientFinalityUpdate": + obj = ðpb.LightClientFinalityUpdateElectra{} + case "LightClientBootstrap": + obj = ðpb.LightClientBootstrapElectra{} + case "LightClientUpdate": + obj = ðpb.LightClientUpdateElectra{} + case "LightClientHeader": + obj = ðpb.LightClientHeaderDeneb{} + case "BlobIdentifier": + obj = ðpb.BlobIdentifier{} + case "BlobSidecar": + obj = ðpb.BlobSidecar{} + case "PowBlock": + obj = ðpb.PowBlock{} + case "Withdrawal": + obj = &enginev1.Withdrawal{} + case "HistoricalSummary": + obj = ðpb.HistoricalSummary{} + case "BLSToExecutionChange": + obj = ðpb.BLSToExecutionChange{} + case "SignedBLSToExecutionChange": + obj = ðpb.SignedBLSToExecutionChange{} + case "PendingDeposit": + obj = ðpb.PendingDeposit{} + case "PendingPartialWithdrawal": + obj = ðpb.PendingPartialWithdrawal{} + case "PendingConsolidation": + obj = ðpb.PendingConsolidation{} + case "WithdrawalRequest": + obj = &enginev1.WithdrawalRequest{} + case "DepositRequest": + obj = &enginev1.DepositRequest{} + case "ConsolidationRequest": + obj = &enginev1.ConsolidationRequest{} + case "ExecutionRequests": + obj = &enginev1.ExecutionRequests{} + case "DataColumnSidecar": + obj = ðpb.DataColumnSidecar{} + case "DataColumnsByRootIdentifier": + obj = ðpb.DataColumnsByRootIdentifier{} + case "MatrixEntry": + t.Skip("Unused type") + default: + return nil, errors.New("type not found") + } + var err error + if o, ok := obj.(fssz.Unmarshaler); ok { + err = o.UnmarshalSSZ(serializedBytes) + } else { + err = errors.New("could not unmarshal object, not a fastssz compatible object") + } + return obj, err +}