diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index 16d9fae009ed..18c4dba952c1 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -142,8 +142,6 @@ ssz_deneb_objs = [ "LightClientHeaderDeneb", "LightClientOptimisticUpdateDeneb", "LightClientUpdateDeneb", - "DataColumnIdentifier", - "DataColumnSidecar", "SignedBeaconBlockContentsDeneb", "SignedBeaconBlockDeneb", "SignedBlindedBeaconBlockDeneb", @@ -174,6 +172,11 @@ ssz_electra_objs = [ "SignedConsolidation", ] +ssz_fulu_objs = [ + "DataColumnIdentifier", + "DataColumnSidecar", +] + ssz_gen_marshal( name = "ssz_generated_phase0", out = "phase0.ssz.go", @@ -251,6 +254,19 @@ ssz_gen_marshal( objs = ssz_electra_objs, ) +ssz_gen_marshal( + name = "ssz_generated_fulu", + out = "fulu.ssz.go", + exclude_objs = ssz_phase0_objs + ssz_altair_objs + ssz_bellatrix_objs + ssz_capella_objs + ssz_deneb_objs + ssz_electra_objs, + go_proto = ":go_proto", + includes = [ + "//consensus-types/primitives:go_default_library", + "//math:go_default_library", + "//proto/engine/v1:go_default_library", + ], + objs = ssz_fulu_objs, +) + ssz_gen_marshal( name = "ssz_generated_non_core", out = "non-core.ssz.go", @@ -315,6 +331,7 @@ go_library( ":ssz_generated_capella", # keep ":ssz_generated_deneb", # keep ":ssz_generated_electra", # keep + ":ssz_generated_fulu", # keep ":ssz_generated_non_core", # keep ":ssz_generated_phase0", # keep ], diff --git a/proto/prysm/v1alpha1/deneb.ssz.go b/proto/prysm/v1alpha1/deneb.ssz.go index 58f5992d2773..89d3ef023ad4 100644 --- a/proto/prysm/v1alpha1/deneb.ssz.go +++ b/proto/prysm/v1alpha1/deneb.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: c2b2a116a8ff79e3b87def124afa35a4a5fc4b626c4019d6d9b07effa8ac13de +// Hash: d459fe26ab0901f86002834d6db476e56964cd1019cbc69391aca7fb6d4a8d7f package eth import ( @@ -3594,376 +3594,6 @@ func (b *BlobIdentifier) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } -// MarshalSSZ ssz marshals the DataColumnSidecar object -func (d *DataColumnSidecar) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(d) -} - -// MarshalSSZTo ssz marshals the DataColumnSidecar object to a target array -func (d *DataColumnSidecar) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(356) - - // Field (0) 'ColumnIndex' - dst = ssz.MarshalUint64(dst, d.ColumnIndex) - - // Offset (1) 'DataColumn' - dst = ssz.WriteOffset(dst, offset) - offset += len(d.DataColumn) * 2048 - - // Offset (2) 'KzgCommitments' - dst = ssz.WriteOffset(dst, offset) - offset += len(d.KzgCommitments) * 48 - - // Offset (3) 'KzgProof' - dst = ssz.WriteOffset(dst, offset) - offset += len(d.KzgProof) * 48 - - // Field (4) 'SignedBlockHeader' - if d.SignedBlockHeader == nil { - d.SignedBlockHeader = new(SignedBeaconBlockHeader) - } - if dst, err = d.SignedBlockHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (5) 'KzgCommitmentsInclusionProof' - if size := len(d.KzgCommitmentsInclusionProof); size != 4 { - err = ssz.ErrVectorLengthFn("--.KzgCommitmentsInclusionProof", size, 4) - return - } - for ii := 0; ii < 4; ii++ { - if size := len(d.KzgCommitmentsInclusionProof[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.KzgCommitmentsInclusionProof[ii]", size, 32) - return - } - dst = append(dst, d.KzgCommitmentsInclusionProof[ii]...) - } - - // Field (1) 'DataColumn' - if size := len(d.DataColumn); size > 4096 { - err = ssz.ErrListTooBigFn("--.DataColumn", size, 4096) - return - } - for ii := 0; ii < len(d.DataColumn); ii++ { - if size := len(d.DataColumn[ii]); size != 2048 { - err = ssz.ErrBytesLengthFn("--.DataColumn[ii]", size, 2048) - return - } - dst = append(dst, d.DataColumn[ii]...) - } - - // Field (2) 'KzgCommitments' - if size := len(d.KzgCommitments); size > 4096 { - err = ssz.ErrListTooBigFn("--.KzgCommitments", size, 4096) - return - } - for ii := 0; ii < len(d.KzgCommitments); ii++ { - if size := len(d.KzgCommitments[ii]); size != 48 { - err = ssz.ErrBytesLengthFn("--.KzgCommitments[ii]", size, 48) - return - } - dst = append(dst, d.KzgCommitments[ii]...) - } - - // Field (3) 'KzgProof' - if size := len(d.KzgProof); size > 4096 { - err = ssz.ErrListTooBigFn("--.KzgProof", size, 4096) - return - } - for ii := 0; ii < len(d.KzgProof); ii++ { - if size := len(d.KzgProof[ii]); size != 48 { - err = ssz.ErrBytesLengthFn("--.KzgProof[ii]", size, 48) - return - } - dst = append(dst, d.KzgProof[ii]...) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the DataColumnSidecar object -func (d *DataColumnSidecar) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 356 { - return ssz.ErrSize - } - - tail := buf - var o1, o2, o3 uint64 - - // Field (0) 'ColumnIndex' - d.ColumnIndex = ssz.UnmarshallUint64(buf[0:8]) - - // Offset (1) 'DataColumn' - if o1 = ssz.ReadOffset(buf[8:12]); o1 > size { - return ssz.ErrOffset - } - - if o1 != 356 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (2) 'KzgCommitments' - if o2 = ssz.ReadOffset(buf[12:16]); o2 > size || o1 > o2 { - return ssz.ErrOffset - } - - // Offset (3) 'KzgProof' - if o3 = ssz.ReadOffset(buf[16:20]); o3 > size || o2 > o3 { - return ssz.ErrOffset - } - - // Field (4) 'SignedBlockHeader' - if d.SignedBlockHeader == nil { - d.SignedBlockHeader = new(SignedBeaconBlockHeader) - } - if err = d.SignedBlockHeader.UnmarshalSSZ(buf[20:228]); err != nil { - return err - } - - // Field (5) 'KzgCommitmentsInclusionProof' - d.KzgCommitmentsInclusionProof = make([][]byte, 4) - for ii := 0; ii < 4; ii++ { - if cap(d.KzgCommitmentsInclusionProof[ii]) == 0 { - d.KzgCommitmentsInclusionProof[ii] = make([]byte, 0, len(buf[228:356][ii*32:(ii+1)*32])) - } - d.KzgCommitmentsInclusionProof[ii] = append(d.KzgCommitmentsInclusionProof[ii], buf[228:356][ii*32:(ii+1)*32]...) - } - - // Field (1) 'DataColumn' - { - buf = tail[o1:o2] - num, err := ssz.DivideInt2(len(buf), 2048, 4096) - if err != nil { - return err - } - d.DataColumn = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(d.DataColumn[ii]) == 0 { - d.DataColumn[ii] = make([]byte, 0, len(buf[ii*2048:(ii+1)*2048])) - } - d.DataColumn[ii] = append(d.DataColumn[ii], buf[ii*2048:(ii+1)*2048]...) - } - } - - // Field (2) 'KzgCommitments' - { - buf = tail[o2:o3] - num, err := ssz.DivideInt2(len(buf), 48, 4096) - if err != nil { - return err - } - d.KzgCommitments = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(d.KzgCommitments[ii]) == 0 { - d.KzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) - } - d.KzgCommitments[ii] = append(d.KzgCommitments[ii], buf[ii*48:(ii+1)*48]...) - } - } - - // Field (3) 'KzgProof' - { - buf = tail[o3:] - num, err := ssz.DivideInt2(len(buf), 48, 4096) - if err != nil { - return err - } - d.KzgProof = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(d.KzgProof[ii]) == 0 { - d.KzgProof[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) - } - d.KzgProof[ii] = append(d.KzgProof[ii], buf[ii*48:(ii+1)*48]...) - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the DataColumnSidecar object -func (d *DataColumnSidecar) SizeSSZ() (size int) { - size = 356 - - // Field (1) 'DataColumn' - size += len(d.DataColumn) * 2048 - - // Field (2) 'KzgCommitments' - size += len(d.KzgCommitments) * 48 - - // Field (3) 'KzgProof' - size += len(d.KzgProof) * 48 - - return -} - -// HashTreeRoot ssz hashes the DataColumnSidecar object -func (d *DataColumnSidecar) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(d) -} - -// HashTreeRootWith ssz hashes the DataColumnSidecar object with a hasher -func (d *DataColumnSidecar) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'ColumnIndex' - hh.PutUint64(d.ColumnIndex) - - // Field (1) 'DataColumn' - { - if size := len(d.DataColumn); size > 4096 { - err = ssz.ErrListTooBigFn("--.DataColumn", size, 4096) - return - } - subIndx := hh.Index() - for _, i := range d.DataColumn { - if len(i) != 2048 { - err = ssz.ErrBytesLength - return - } - hh.PutBytes(i) - } - - numItems := uint64(len(d.DataColumn)) - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - - // Field (2) 'KzgCommitments' - { - if size := len(d.KzgCommitments); size > 4096 { - err = ssz.ErrListTooBigFn("--.KzgCommitments", size, 4096) - return - } - subIndx := hh.Index() - for _, i := range d.KzgCommitments { - if len(i) != 48 { - err = ssz.ErrBytesLength - return - } - hh.PutBytes(i) - } - - numItems := uint64(len(d.KzgCommitments)) - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - - // Field (3) 'KzgProof' - { - if size := len(d.KzgProof); size > 4096 { - err = ssz.ErrListTooBigFn("--.KzgProof", size, 4096) - return - } - subIndx := hh.Index() - for _, i := range d.KzgProof { - if len(i) != 48 { - err = ssz.ErrBytesLength - return - } - hh.PutBytes(i) - } - - numItems := uint64(len(d.KzgProof)) - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - - // Field (4) 'SignedBlockHeader' - if err = d.SignedBlockHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (5) 'KzgCommitmentsInclusionProof' - { - if size := len(d.KzgCommitmentsInclusionProof); size != 4 { - err = ssz.ErrVectorLengthFn("--.KzgCommitmentsInclusionProof", size, 4) - return - } - subIndx := hh.Index() - for _, i := range d.KzgCommitmentsInclusionProof { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - hh.Merkleize(subIndx) - } - - hh.Merkleize(indx) - return -} - -// MarshalSSZ ssz marshals the DataColumnIdentifier object -func (d *DataColumnIdentifier) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(d) -} - -// MarshalSSZTo ssz marshals the DataColumnIdentifier object to a target array -func (d *DataColumnIdentifier) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'BlockRoot' - if size := len(d.BlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) - return - } - dst = append(dst, d.BlockRoot...) - - // Field (1) 'ColumnIndex' - dst = ssz.MarshalUint64(dst, d.ColumnIndex) - - return -} - -// UnmarshalSSZ ssz unmarshals the DataColumnIdentifier object -func (d *DataColumnIdentifier) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 40 { - return ssz.ErrSize - } - - // 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]...) - - // Field (1) 'ColumnIndex' - d.ColumnIndex = ssz.UnmarshallUint64(buf[32:40]) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the DataColumnIdentifier object -func (d *DataColumnIdentifier) SizeSSZ() (size int) { - size = 40 - return -} - -// HashTreeRoot ssz hashes the DataColumnIdentifier object -func (d *DataColumnIdentifier) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(d) -} - -// HashTreeRootWith ssz hashes the DataColumnIdentifier object with a hasher -func (d *DataColumnIdentifier) 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) 'ColumnIndex' - hh.PutUint64(d.ColumnIndex) - - hh.Merkleize(indx) - return -} - // MarshalSSZ ssz marshals the LightClientHeaderDeneb object func (l *LightClientHeaderDeneb) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(l) diff --git a/proto/prysm/v1alpha1/fulu.ssz.go b/proto/prysm/v1alpha1/fulu.ssz.go new file mode 100644 index 000000000000..65c8c6807c06 --- /dev/null +++ b/proto/prysm/v1alpha1/fulu.ssz.go @@ -0,0 +1,377 @@ +// Code generated by fastssz. DO NOT EDIT. +// Hash: 4b563d7ec9ba33597c204e7e4cd7a02138fd17bdd03089cc935e552640ebd72d +package eth + +import ( + ssz "github.com/prysmaticlabs/fastssz" +) + +// MarshalSSZ ssz marshals the DataColumnSidecar object +func (d *DataColumnSidecar) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(d) +} + +// MarshalSSZTo ssz marshals the DataColumnSidecar object to a target array +func (d *DataColumnSidecar) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(356) + + // Field (0) 'ColumnIndex' + dst = ssz.MarshalUint64(dst, d.ColumnIndex) + + // Offset (1) 'DataColumn' + dst = ssz.WriteOffset(dst, offset) + offset += len(d.DataColumn) * 2048 + + // Offset (2) 'KzgCommitments' + dst = ssz.WriteOffset(dst, offset) + offset += len(d.KzgCommitments) * 48 + + // Offset (3) 'KzgProof' + dst = ssz.WriteOffset(dst, offset) + offset += len(d.KzgProof) * 48 + + // Field (4) 'SignedBlockHeader' + if d.SignedBlockHeader == nil { + d.SignedBlockHeader = new(SignedBeaconBlockHeader) + } + if dst, err = d.SignedBlockHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (5) 'KzgCommitmentsInclusionProof' + if size := len(d.KzgCommitmentsInclusionProof); size != 4 { + err = ssz.ErrVectorLengthFn("--.KzgCommitmentsInclusionProof", size, 4) + return + } + for ii := 0; ii < 4; ii++ { + if size := len(d.KzgCommitmentsInclusionProof[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.KzgCommitmentsInclusionProof[ii]", size, 32) + return + } + dst = append(dst, d.KzgCommitmentsInclusionProof[ii]...) + } + + // Field (1) 'DataColumn' + if size := len(d.DataColumn); size > 4096 { + err = ssz.ErrListTooBigFn("--.DataColumn", size, 4096) + return + } + for ii := 0; ii < len(d.DataColumn); ii++ { + if size := len(d.DataColumn[ii]); size != 2048 { + err = ssz.ErrBytesLengthFn("--.DataColumn[ii]", size, 2048) + return + } + dst = append(dst, d.DataColumn[ii]...) + } + + // Field (2) 'KzgCommitments' + if size := len(d.KzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.KzgCommitments", size, 4096) + return + } + for ii := 0; ii < len(d.KzgCommitments); ii++ { + if size := len(d.KzgCommitments[ii]); size != 48 { + err = ssz.ErrBytesLengthFn("--.KzgCommitments[ii]", size, 48) + return + } + dst = append(dst, d.KzgCommitments[ii]...) + } + + // Field (3) 'KzgProof' + if size := len(d.KzgProof); size > 4096 { + err = ssz.ErrListTooBigFn("--.KzgProof", size, 4096) + return + } + for ii := 0; ii < len(d.KzgProof); ii++ { + if size := len(d.KzgProof[ii]); size != 48 { + err = ssz.ErrBytesLengthFn("--.KzgProof[ii]", size, 48) + return + } + dst = append(dst, d.KzgProof[ii]...) + } + + return +} + +// UnmarshalSSZ ssz unmarshals the DataColumnSidecar object +func (d *DataColumnSidecar) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 356 { + return ssz.ErrSize + } + + tail := buf + var o1, o2, o3 uint64 + + // Field (0) 'ColumnIndex' + d.ColumnIndex = ssz.UnmarshallUint64(buf[0:8]) + + // Offset (1) 'DataColumn' + if o1 = ssz.ReadOffset(buf[8:12]); o1 > size { + return ssz.ErrOffset + } + + if o1 != 356 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (2) 'KzgCommitments' + if o2 = ssz.ReadOffset(buf[12:16]); o2 > size || o1 > o2 { + return ssz.ErrOffset + } + + // Offset (3) 'KzgProof' + if o3 = ssz.ReadOffset(buf[16:20]); o3 > size || o2 > o3 { + return ssz.ErrOffset + } + + // Field (4) 'SignedBlockHeader' + if d.SignedBlockHeader == nil { + d.SignedBlockHeader = new(SignedBeaconBlockHeader) + } + if err = d.SignedBlockHeader.UnmarshalSSZ(buf[20:228]); err != nil { + return err + } + + // Field (5) 'KzgCommitmentsInclusionProof' + d.KzgCommitmentsInclusionProof = make([][]byte, 4) + for ii := 0; ii < 4; ii++ { + if cap(d.KzgCommitmentsInclusionProof[ii]) == 0 { + d.KzgCommitmentsInclusionProof[ii] = make([]byte, 0, len(buf[228:356][ii*32:(ii+1)*32])) + } + d.KzgCommitmentsInclusionProof[ii] = append(d.KzgCommitmentsInclusionProof[ii], buf[228:356][ii*32:(ii+1)*32]...) + } + + // Field (1) 'DataColumn' + { + buf = tail[o1:o2] + num, err := ssz.DivideInt2(len(buf), 2048, 4096) + if err != nil { + return err + } + d.DataColumn = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(d.DataColumn[ii]) == 0 { + d.DataColumn[ii] = make([]byte, 0, len(buf[ii*2048:(ii+1)*2048])) + } + d.DataColumn[ii] = append(d.DataColumn[ii], buf[ii*2048:(ii+1)*2048]...) + } + } + + // Field (2) 'KzgCommitments' + { + buf = tail[o2:o3] + num, err := ssz.DivideInt2(len(buf), 48, 4096) + if err != nil { + return err + } + d.KzgCommitments = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(d.KzgCommitments[ii]) == 0 { + d.KzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) + } + d.KzgCommitments[ii] = append(d.KzgCommitments[ii], buf[ii*48:(ii+1)*48]...) + } + } + + // Field (3) 'KzgProof' + { + buf = tail[o3:] + num, err := ssz.DivideInt2(len(buf), 48, 4096) + if err != nil { + return err + } + d.KzgProof = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(d.KzgProof[ii]) == 0 { + d.KzgProof[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) + } + d.KzgProof[ii] = append(d.KzgProof[ii], buf[ii*48:(ii+1)*48]...) + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the DataColumnSidecar object +func (d *DataColumnSidecar) SizeSSZ() (size int) { + size = 356 + + // Field (1) 'DataColumn' + size += len(d.DataColumn) * 2048 + + // Field (2) 'KzgCommitments' + size += len(d.KzgCommitments) * 48 + + // Field (3) 'KzgProof' + size += len(d.KzgProof) * 48 + + return +} + +// HashTreeRoot ssz hashes the DataColumnSidecar object +func (d *DataColumnSidecar) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(d) +} + +// HashTreeRootWith ssz hashes the DataColumnSidecar object with a hasher +func (d *DataColumnSidecar) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'ColumnIndex' + hh.PutUint64(d.ColumnIndex) + + // Field (1) 'DataColumn' + { + if size := len(d.DataColumn); size > 4096 { + err = ssz.ErrListTooBigFn("--.DataColumn", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range d.DataColumn { + if len(i) != 2048 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(d.DataColumn)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) + } + + // Field (2) 'KzgCommitments' + { + if size := len(d.KzgCommitments); size > 4096 { + err = ssz.ErrListTooBigFn("--.KzgCommitments", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range d.KzgCommitments { + if len(i) != 48 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(d.KzgCommitments)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) + } + + // Field (3) 'KzgProof' + { + if size := len(d.KzgProof); size > 4096 { + err = ssz.ErrListTooBigFn("--.KzgProof", size, 4096) + return + } + subIndx := hh.Index() + for _, i := range d.KzgProof { + if len(i) != 48 { + err = ssz.ErrBytesLength + return + } + hh.PutBytes(i) + } + + numItems := uint64(len(d.KzgProof)) + hh.MerkleizeWithMixin(subIndx, numItems, 4096) + } + + // Field (4) 'SignedBlockHeader' + if err = d.SignedBlockHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (5) 'KzgCommitmentsInclusionProof' + { + if size := len(d.KzgCommitmentsInclusionProof); size != 4 { + err = ssz.ErrVectorLengthFn("--.KzgCommitmentsInclusionProof", size, 4) + return + } + subIndx := hh.Index() + for _, i := range d.KzgCommitmentsInclusionProof { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the DataColumnIdentifier object +func (d *DataColumnIdentifier) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(d) +} + +// MarshalSSZTo ssz marshals the DataColumnIdentifier object to a target array +func (d *DataColumnIdentifier) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'BlockRoot' + if size := len(d.BlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) + return + } + dst = append(dst, d.BlockRoot...) + + // Field (1) 'ColumnIndex' + dst = ssz.MarshalUint64(dst, d.ColumnIndex) + + return +} + +// UnmarshalSSZ ssz unmarshals the DataColumnIdentifier object +func (d *DataColumnIdentifier) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 40 { + return ssz.ErrSize + } + + // 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]...) + + // Field (1) 'ColumnIndex' + d.ColumnIndex = ssz.UnmarshallUint64(buf[32:40]) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the DataColumnIdentifier object +func (d *DataColumnIdentifier) SizeSSZ() (size int) { + size = 40 + return +} + +// HashTreeRoot ssz hashes the DataColumnIdentifier object +func (d *DataColumnIdentifier) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(d) +} + +// HashTreeRootWith ssz hashes the DataColumnIdentifier object with a hasher +func (d *DataColumnIdentifier) 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) 'ColumnIndex' + hh.PutUint64(d.ColumnIndex) + + hh.Merkleize(indx) + return +}