// Code generated by fastssz. DO NOT EDIT. // Hash: e1b3713d854395a4c86aa7a0bf0249d9f2764183a636fcc53badddeaf38990f2 package eth import ( ssz "github.com/prysmaticlabs/fastssz" github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" v11 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" v1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" ) // MarshalSSZ ssz marshals the SignedBeaconBlockAltair object func (s *SignedBeaconBlockAltair) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) } // MarshalSSZTo ssz marshals the SignedBeaconBlockAltair object to a target array func (s *SignedBeaconBlockAltair) 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(BeaconBlockAltair) } 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 SignedBeaconBlockAltair object func (s *SignedBeaconBlockAltair) 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(BeaconBlockAltair) } if err = s.Message.UnmarshalSSZ(buf); err != nil { return err } } return err } // SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockAltair object func (s *SignedBeaconBlockAltair) SizeSSZ() (size int) { size = 100 // Field (0) 'Message' if s.Message == nil { s.Message = new(BeaconBlockAltair) } size += s.Message.SizeSSZ() return } // HashTreeRoot ssz hashes the SignedBeaconBlockAltair object func (s *SignedBeaconBlockAltair) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(s) } // HashTreeRootWith ssz hashes the SignedBeaconBlockAltair object with a hasher func (s *SignedBeaconBlockAltair) 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 SignedBeaconBlockBellatrix object func (s *SignedBeaconBlockBellatrix) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) } // MarshalSSZTo ssz marshals the SignedBeaconBlockBellatrix object to a target array func (s *SignedBeaconBlockBellatrix) 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(BeaconBlockBellatrix) } 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 SignedBeaconBlockBellatrix object func (s *SignedBeaconBlockBellatrix) 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(BeaconBlockBellatrix) } if err = s.Message.UnmarshalSSZ(buf); err != nil { return err } } return err } // SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockBellatrix object func (s *SignedBeaconBlockBellatrix) SizeSSZ() (size int) { size = 100 // Field (0) 'Message' if s.Message == nil { s.Message = new(BeaconBlockBellatrix) } size += s.Message.SizeSSZ() return } // HashTreeRoot ssz hashes the SignedBeaconBlockBellatrix object func (s *SignedBeaconBlockBellatrix) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(s) } // HashTreeRootWith ssz hashes the SignedBeaconBlockBellatrix object with a hasher func (s *SignedBeaconBlockBellatrix) 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 SignedBeaconBlockCapella object func (s *SignedBeaconBlockCapella) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) } // MarshalSSZTo ssz marshals the SignedBeaconBlockCapella object to a target array func (s *SignedBeaconBlockCapella) 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(BeaconBlockCapella) } 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 SignedBeaconBlockCapella object func (s *SignedBeaconBlockCapella) 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(BeaconBlockCapella) } if err = s.Message.UnmarshalSSZ(buf); err != nil { return err } } return err } // SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockCapella object func (s *SignedBeaconBlockCapella) SizeSSZ() (size int) { size = 100 // Field (0) 'Message' if s.Message == nil { s.Message = new(BeaconBlockCapella) } size += s.Message.SizeSSZ() return } // HashTreeRoot ssz hashes the SignedBeaconBlockCapella object func (s *SignedBeaconBlockCapella) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(s) } // HashTreeRootWith ssz hashes the SignedBeaconBlockCapella object with a hasher func (s *SignedBeaconBlockCapella) 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 SignedBeaconBlockDeneb object func (s *SignedBeaconBlockDeneb) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) } // MarshalSSZTo ssz marshals the SignedBeaconBlockDeneb object to a target array func (s *SignedBeaconBlockDeneb) 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(BeaconBlockDeneb) } 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 SignedBeaconBlockDeneb object func (s *SignedBeaconBlockDeneb) 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(BeaconBlockDeneb) } if err = s.Message.UnmarshalSSZ(buf); err != nil { return err } } return err } // SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockDeneb object func (s *SignedBeaconBlockDeneb) SizeSSZ() (size int) { size = 100 // Field (0) 'Message' if s.Message == nil { s.Message = new(BeaconBlockDeneb) } size += s.Message.SizeSSZ() return } // HashTreeRoot ssz hashes the SignedBeaconBlockDeneb object func (s *SignedBeaconBlockDeneb) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(s) } // HashTreeRootWith ssz hashes the SignedBeaconBlockDeneb object with a hasher func (s *SignedBeaconBlockDeneb) 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 SignedBlindedBeaconBlockBellatrix object func (s *SignedBlindedBeaconBlockBellatrix) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) } // MarshalSSZTo ssz marshals the SignedBlindedBeaconBlockBellatrix object to a target array func (s *SignedBlindedBeaconBlockBellatrix) 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(BlindedBeaconBlockBellatrix) } 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 SignedBlindedBeaconBlockBellatrix object func (s *SignedBlindedBeaconBlockBellatrix) 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(BlindedBeaconBlockBellatrix) } if err = s.Message.UnmarshalSSZ(buf); err != nil { return err } } return err } // SizeSSZ returns the ssz encoded size in bytes for the SignedBlindedBeaconBlockBellatrix object func (s *SignedBlindedBeaconBlockBellatrix) SizeSSZ() (size int) { size = 100 // Field (0) 'Message' if s.Message == nil { s.Message = new(BlindedBeaconBlockBellatrix) } size += s.Message.SizeSSZ() return } // HashTreeRoot ssz hashes the SignedBlindedBeaconBlockBellatrix object func (s *SignedBlindedBeaconBlockBellatrix) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(s) } // HashTreeRootWith ssz hashes the SignedBlindedBeaconBlockBellatrix object with a hasher func (s *SignedBlindedBeaconBlockBellatrix) 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 SignedBlindedBeaconBlockCapella object func (s *SignedBlindedBeaconBlockCapella) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) } // MarshalSSZTo ssz marshals the SignedBlindedBeaconBlockCapella object to a target array func (s *SignedBlindedBeaconBlockCapella) 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(BlindedBeaconBlockCapella) } 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 SignedBlindedBeaconBlockCapella object func (s *SignedBlindedBeaconBlockCapella) 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(BlindedBeaconBlockCapella) } if err = s.Message.UnmarshalSSZ(buf); err != nil { return err } } return err } // SizeSSZ returns the ssz encoded size in bytes for the SignedBlindedBeaconBlockCapella object func (s *SignedBlindedBeaconBlockCapella) SizeSSZ() (size int) { size = 100 // Field (0) 'Message' if s.Message == nil { s.Message = new(BlindedBeaconBlockCapella) } size += s.Message.SizeSSZ() return } // HashTreeRoot ssz hashes the SignedBlindedBeaconBlockCapella object func (s *SignedBlindedBeaconBlockCapella) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(s) } // HashTreeRootWith ssz hashes the SignedBlindedBeaconBlockCapella object with a hasher func (s *SignedBlindedBeaconBlockCapella) 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 SignedBlindedBeaconBlockDeneb object func (s *SignedBlindedBeaconBlockDeneb) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) } // MarshalSSZTo ssz marshals the SignedBlindedBeaconBlockDeneb object to a target array func (s *SignedBlindedBeaconBlockDeneb) 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(BlindedBeaconBlockDeneb) } 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 SignedBlindedBeaconBlockDeneb object func (s *SignedBlindedBeaconBlockDeneb) 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(BlindedBeaconBlockDeneb) } if err = s.Message.UnmarshalSSZ(buf); err != nil { return err } } return err } // SizeSSZ returns the ssz encoded size in bytes for the SignedBlindedBeaconBlockDeneb object func (s *SignedBlindedBeaconBlockDeneb) SizeSSZ() (size int) { size = 100 // Field (0) 'Message' if s.Message == nil { s.Message = new(BlindedBeaconBlockDeneb) } size += s.Message.SizeSSZ() return } // HashTreeRoot ssz hashes the SignedBlindedBeaconBlockDeneb object func (s *SignedBlindedBeaconBlockDeneb) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(s) } // HashTreeRootWith ssz hashes the SignedBlindedBeaconBlockDeneb object with a hasher func (s *SignedBlindedBeaconBlockDeneb) 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 BeaconBlockAltair object func (b *BeaconBlockAltair) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } // MarshalSSZTo ssz marshals the BeaconBlockAltair object to a target array func (b *BeaconBlockAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf offset := int(84) // Field (0) 'Slot' dst = ssz.MarshalUint64(dst, uint64(b.Slot)) // Field (1) 'ProposerIndex' dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' if size := len(b.ParentRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } dst = append(dst, b.ParentRoot...) // Field (3) 'StateRoot' if size := len(b.StateRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, b.StateRoot...) // Offset (4) 'Body' dst = ssz.WriteOffset(dst, offset) if b.Body == nil { b.Body = new(BeaconBlockBodyAltair) } offset += b.Body.SizeSSZ() // Field (4) 'Body' if dst, err = b.Body.MarshalSSZTo(dst); err != nil { return } return } // UnmarshalSSZ ssz unmarshals the BeaconBlockAltair object func (b *BeaconBlockAltair) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size < 84 { return ssz.ErrSize } tail := buf var o4 uint64 // Field (0) 'Slot' b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) // Field (1) 'ProposerIndex' b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) // Field (2) 'ParentRoot' if cap(b.ParentRoot) == 0 { b.ParentRoot = make([]byte, 0, len(buf[16:48])) } b.ParentRoot = append(b.ParentRoot, buf[16:48]...) // Field (3) 'StateRoot' if cap(b.StateRoot) == 0 { b.StateRoot = make([]byte, 0, len(buf[48:80])) } b.StateRoot = append(b.StateRoot, buf[48:80]...) // Offset (4) 'Body' if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { return ssz.ErrOffset } if o4 != 84 { return ssz.ErrInvalidVariableOffset } // Field (4) 'Body' { buf = tail[o4:] if b.Body == nil { b.Body = new(BeaconBlockBodyAltair) } if err = b.Body.UnmarshalSSZ(buf); err != nil { return err } } return err } // SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockAltair object func (b *BeaconBlockAltair) SizeSSZ() (size int) { size = 84 // Field (4) 'Body' if b.Body == nil { b.Body = new(BeaconBlockBodyAltair) } size += b.Body.SizeSSZ() return } // HashTreeRoot ssz hashes the BeaconBlockAltair object func (b *BeaconBlockAltair) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } // HashTreeRootWith ssz hashes the BeaconBlockAltair object with a hasher func (b *BeaconBlockAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'Slot' hh.PutUint64(uint64(b.Slot)) // Field (1) 'ProposerIndex' hh.PutUint64(uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' if size := len(b.ParentRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } hh.PutBytes(b.ParentRoot) // Field (3) 'StateRoot' if size := len(b.StateRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(b.StateRoot) // Field (4) 'Body' if err = b.Body.HashTreeRootWith(hh); err != nil { return } hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the BeaconBlockBellatrix object func (b *BeaconBlockBellatrix) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } // MarshalSSZTo ssz marshals the BeaconBlockBellatrix object to a target array func (b *BeaconBlockBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf offset := int(84) // Field (0) 'Slot' dst = ssz.MarshalUint64(dst, uint64(b.Slot)) // Field (1) 'ProposerIndex' dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' if size := len(b.ParentRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } dst = append(dst, b.ParentRoot...) // Field (3) 'StateRoot' if size := len(b.StateRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, b.StateRoot...) // Offset (4) 'Body' dst = ssz.WriteOffset(dst, offset) if b.Body == nil { b.Body = new(BeaconBlockBodyBellatrix) } offset += b.Body.SizeSSZ() // Field (4) 'Body' if dst, err = b.Body.MarshalSSZTo(dst); err != nil { return } return } // UnmarshalSSZ ssz unmarshals the BeaconBlockBellatrix object func (b *BeaconBlockBellatrix) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size < 84 { return ssz.ErrSize } tail := buf var o4 uint64 // Field (0) 'Slot' b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) // Field (1) 'ProposerIndex' b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) // Field (2) 'ParentRoot' if cap(b.ParentRoot) == 0 { b.ParentRoot = make([]byte, 0, len(buf[16:48])) } b.ParentRoot = append(b.ParentRoot, buf[16:48]...) // Field (3) 'StateRoot' if cap(b.StateRoot) == 0 { b.StateRoot = make([]byte, 0, len(buf[48:80])) } b.StateRoot = append(b.StateRoot, buf[48:80]...) // Offset (4) 'Body' if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { return ssz.ErrOffset } if o4 != 84 { return ssz.ErrInvalidVariableOffset } // Field (4) 'Body' { buf = tail[o4:] if b.Body == nil { b.Body = new(BeaconBlockBodyBellatrix) } if err = b.Body.UnmarshalSSZ(buf); err != nil { return err } } return err } // SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBellatrix object func (b *BeaconBlockBellatrix) SizeSSZ() (size int) { size = 84 // Field (4) 'Body' if b.Body == nil { b.Body = new(BeaconBlockBodyBellatrix) } size += b.Body.SizeSSZ() return } // HashTreeRoot ssz hashes the BeaconBlockBellatrix object func (b *BeaconBlockBellatrix) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } // HashTreeRootWith ssz hashes the BeaconBlockBellatrix object with a hasher func (b *BeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'Slot' hh.PutUint64(uint64(b.Slot)) // Field (1) 'ProposerIndex' hh.PutUint64(uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' if size := len(b.ParentRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } hh.PutBytes(b.ParentRoot) // Field (3) 'StateRoot' if size := len(b.StateRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(b.StateRoot) // Field (4) 'Body' if err = b.Body.HashTreeRootWith(hh); err != nil { return } hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the BlindedBeaconBlockBellatrix object func (b *BlindedBeaconBlockBellatrix) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } // MarshalSSZTo ssz marshals the BlindedBeaconBlockBellatrix object to a target array func (b *BlindedBeaconBlockBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf offset := int(84) // Field (0) 'Slot' dst = ssz.MarshalUint64(dst, uint64(b.Slot)) // Field (1) 'ProposerIndex' dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' if size := len(b.ParentRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } dst = append(dst, b.ParentRoot...) // Field (3) 'StateRoot' if size := len(b.StateRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, b.StateRoot...) // Offset (4) 'Body' dst = ssz.WriteOffset(dst, offset) if b.Body == nil { b.Body = new(BlindedBeaconBlockBodyBellatrix) } offset += b.Body.SizeSSZ() // Field (4) 'Body' if dst, err = b.Body.MarshalSSZTo(dst); err != nil { return } return } // UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockBellatrix object func (b *BlindedBeaconBlockBellatrix) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size < 84 { return ssz.ErrSize } tail := buf var o4 uint64 // Field (0) 'Slot' b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) // Field (1) 'ProposerIndex' b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) // Field (2) 'ParentRoot' if cap(b.ParentRoot) == 0 { b.ParentRoot = make([]byte, 0, len(buf[16:48])) } b.ParentRoot = append(b.ParentRoot, buf[16:48]...) // Field (3) 'StateRoot' if cap(b.StateRoot) == 0 { b.StateRoot = make([]byte, 0, len(buf[48:80])) } b.StateRoot = append(b.StateRoot, buf[48:80]...) // Offset (4) 'Body' if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { return ssz.ErrOffset } if o4 != 84 { return ssz.ErrInvalidVariableOffset } // Field (4) 'Body' { buf = tail[o4:] if b.Body == nil { b.Body = new(BlindedBeaconBlockBodyBellatrix) } if err = b.Body.UnmarshalSSZ(buf); err != nil { return err } } return err } // SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBellatrix object func (b *BlindedBeaconBlockBellatrix) SizeSSZ() (size int) { size = 84 // Field (4) 'Body' if b.Body == nil { b.Body = new(BlindedBeaconBlockBodyBellatrix) } size += b.Body.SizeSSZ() return } // HashTreeRoot ssz hashes the BlindedBeaconBlockBellatrix object func (b *BlindedBeaconBlockBellatrix) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } // HashTreeRootWith ssz hashes the BlindedBeaconBlockBellatrix object with a hasher func (b *BlindedBeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'Slot' hh.PutUint64(uint64(b.Slot)) // Field (1) 'ProposerIndex' hh.PutUint64(uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' if size := len(b.ParentRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } hh.PutBytes(b.ParentRoot) // Field (3) 'StateRoot' if size := len(b.StateRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(b.StateRoot) // Field (4) 'Body' if err = b.Body.HashTreeRootWith(hh); err != nil { return } hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the BeaconBlockCapella object func (b *BeaconBlockCapella) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } // MarshalSSZTo ssz marshals the BeaconBlockCapella object to a target array func (b *BeaconBlockCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf offset := int(84) // Field (0) 'Slot' dst = ssz.MarshalUint64(dst, uint64(b.Slot)) // Field (1) 'ProposerIndex' dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' if size := len(b.ParentRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } dst = append(dst, b.ParentRoot...) // Field (3) 'StateRoot' if size := len(b.StateRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, b.StateRoot...) // Offset (4) 'Body' dst = ssz.WriteOffset(dst, offset) if b.Body == nil { b.Body = new(BeaconBlockBodyCapella) } offset += b.Body.SizeSSZ() // Field (4) 'Body' if dst, err = b.Body.MarshalSSZTo(dst); err != nil { return } return } // UnmarshalSSZ ssz unmarshals the BeaconBlockCapella object func (b *BeaconBlockCapella) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size < 84 { return ssz.ErrSize } tail := buf var o4 uint64 // Field (0) 'Slot' b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) // Field (1) 'ProposerIndex' b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) // Field (2) 'ParentRoot' if cap(b.ParentRoot) == 0 { b.ParentRoot = make([]byte, 0, len(buf[16:48])) } b.ParentRoot = append(b.ParentRoot, buf[16:48]...) // Field (3) 'StateRoot' if cap(b.StateRoot) == 0 { b.StateRoot = make([]byte, 0, len(buf[48:80])) } b.StateRoot = append(b.StateRoot, buf[48:80]...) // Offset (4) 'Body' if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { return ssz.ErrOffset } if o4 != 84 { return ssz.ErrInvalidVariableOffset } // Field (4) 'Body' { buf = tail[o4:] if b.Body == nil { b.Body = new(BeaconBlockBodyCapella) } if err = b.Body.UnmarshalSSZ(buf); err != nil { return err } } return err } // SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockCapella object func (b *BeaconBlockCapella) SizeSSZ() (size int) { size = 84 // Field (4) 'Body' if b.Body == nil { b.Body = new(BeaconBlockBodyCapella) } size += b.Body.SizeSSZ() return } // HashTreeRoot ssz hashes the BeaconBlockCapella object func (b *BeaconBlockCapella) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } // HashTreeRootWith ssz hashes the BeaconBlockCapella object with a hasher func (b *BeaconBlockCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'Slot' hh.PutUint64(uint64(b.Slot)) // Field (1) 'ProposerIndex' hh.PutUint64(uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' if size := len(b.ParentRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } hh.PutBytes(b.ParentRoot) // Field (3) 'StateRoot' if size := len(b.StateRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(b.StateRoot) // Field (4) 'Body' if err = b.Body.HashTreeRootWith(hh); err != nil { return } hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the BlindedBeaconBlockCapella object func (b *BlindedBeaconBlockCapella) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } // MarshalSSZTo ssz marshals the BlindedBeaconBlockCapella object to a target array func (b *BlindedBeaconBlockCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf offset := int(84) // Field (0) 'Slot' dst = ssz.MarshalUint64(dst, uint64(b.Slot)) // Field (1) 'ProposerIndex' dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' if size := len(b.ParentRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } dst = append(dst, b.ParentRoot...) // Field (3) 'StateRoot' if size := len(b.StateRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, b.StateRoot...) // Offset (4) 'Body' dst = ssz.WriteOffset(dst, offset) if b.Body == nil { b.Body = new(BlindedBeaconBlockBodyCapella) } offset += b.Body.SizeSSZ() // Field (4) 'Body' if dst, err = b.Body.MarshalSSZTo(dst); err != nil { return } return } // UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockCapella object func (b *BlindedBeaconBlockCapella) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size < 84 { return ssz.ErrSize } tail := buf var o4 uint64 // Field (0) 'Slot' b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) // Field (1) 'ProposerIndex' b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) // Field (2) 'ParentRoot' if cap(b.ParentRoot) == 0 { b.ParentRoot = make([]byte, 0, len(buf[16:48])) } b.ParentRoot = append(b.ParentRoot, buf[16:48]...) // Field (3) 'StateRoot' if cap(b.StateRoot) == 0 { b.StateRoot = make([]byte, 0, len(buf[48:80])) } b.StateRoot = append(b.StateRoot, buf[48:80]...) // Offset (4) 'Body' if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { return ssz.ErrOffset } if o4 != 84 { return ssz.ErrInvalidVariableOffset } // Field (4) 'Body' { buf = tail[o4:] if b.Body == nil { b.Body = new(BlindedBeaconBlockBodyCapella) } if err = b.Body.UnmarshalSSZ(buf); err != nil { return err } } return err } // SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockCapella object func (b *BlindedBeaconBlockCapella) SizeSSZ() (size int) { size = 84 // Field (4) 'Body' if b.Body == nil { b.Body = new(BlindedBeaconBlockBodyCapella) } size += b.Body.SizeSSZ() return } // HashTreeRoot ssz hashes the BlindedBeaconBlockCapella object func (b *BlindedBeaconBlockCapella) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } // HashTreeRootWith ssz hashes the BlindedBeaconBlockCapella object with a hasher func (b *BlindedBeaconBlockCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'Slot' hh.PutUint64(uint64(b.Slot)) // Field (1) 'ProposerIndex' hh.PutUint64(uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' if size := len(b.ParentRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } hh.PutBytes(b.ParentRoot) // Field (3) 'StateRoot' if size := len(b.StateRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(b.StateRoot) // Field (4) 'Body' if err = b.Body.HashTreeRootWith(hh); err != nil { return } hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the BeaconBlockDeneb object func (b *BeaconBlockDeneb) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } // MarshalSSZTo ssz marshals the BeaconBlockDeneb object to a target array func (b *BeaconBlockDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf offset := int(84) // Field (0) 'Slot' dst = ssz.MarshalUint64(dst, uint64(b.Slot)) // Field (1) 'ProposerIndex' dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' if size := len(b.ParentRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } dst = append(dst, b.ParentRoot...) // Field (3) 'StateRoot' if size := len(b.StateRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, b.StateRoot...) // Offset (4) 'Body' dst = ssz.WriteOffset(dst, offset) if b.Body == nil { b.Body = new(BeaconBlockBodyDeneb) } offset += b.Body.SizeSSZ() // Field (4) 'Body' if dst, err = b.Body.MarshalSSZTo(dst); err != nil { return } return } // UnmarshalSSZ ssz unmarshals the BeaconBlockDeneb object func (b *BeaconBlockDeneb) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size < 84 { return ssz.ErrSize } tail := buf var o4 uint64 // Field (0) 'Slot' b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) // Field (1) 'ProposerIndex' b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) // Field (2) 'ParentRoot' if cap(b.ParentRoot) == 0 { b.ParentRoot = make([]byte, 0, len(buf[16:48])) } b.ParentRoot = append(b.ParentRoot, buf[16:48]...) // Field (3) 'StateRoot' if cap(b.StateRoot) == 0 { b.StateRoot = make([]byte, 0, len(buf[48:80])) } b.StateRoot = append(b.StateRoot, buf[48:80]...) // Offset (4) 'Body' if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { return ssz.ErrOffset } if o4 != 84 { return ssz.ErrInvalidVariableOffset } // Field (4) 'Body' { buf = tail[o4:] if b.Body == nil { b.Body = new(BeaconBlockBodyDeneb) } if err = b.Body.UnmarshalSSZ(buf); err != nil { return err } } return err } // SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockDeneb object func (b *BeaconBlockDeneb) SizeSSZ() (size int) { size = 84 // Field (4) 'Body' if b.Body == nil { b.Body = new(BeaconBlockBodyDeneb) } size += b.Body.SizeSSZ() return } // HashTreeRoot ssz hashes the BeaconBlockDeneb object func (b *BeaconBlockDeneb) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } // HashTreeRootWith ssz hashes the BeaconBlockDeneb object with a hasher func (b *BeaconBlockDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'Slot' hh.PutUint64(uint64(b.Slot)) // Field (1) 'ProposerIndex' hh.PutUint64(uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' if size := len(b.ParentRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } hh.PutBytes(b.ParentRoot) // Field (3) 'StateRoot' if size := len(b.StateRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(b.StateRoot) // Field (4) 'Body' if err = b.Body.HashTreeRootWith(hh); err != nil { return } hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the BlindedBeaconBlockDeneb object func (b *BlindedBeaconBlockDeneb) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } // MarshalSSZTo ssz marshals the BlindedBeaconBlockDeneb object to a target array func (b *BlindedBeaconBlockDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf offset := int(84) // Field (0) 'Slot' dst = ssz.MarshalUint64(dst, uint64(b.Slot)) // Field (1) 'ProposerIndex' dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' if size := len(b.ParentRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } dst = append(dst, b.ParentRoot...) // Field (3) 'StateRoot' if size := len(b.StateRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, b.StateRoot...) // Offset (4) 'Body' dst = ssz.WriteOffset(dst, offset) if b.Body == nil { b.Body = new(BlindedBeaconBlockBodyDeneb) } offset += b.Body.SizeSSZ() // Field (4) 'Body' if dst, err = b.Body.MarshalSSZTo(dst); err != nil { return } return } // UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockDeneb object func (b *BlindedBeaconBlockDeneb) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size < 84 { return ssz.ErrSize } tail := buf var o4 uint64 // Field (0) 'Slot' b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) // Field (1) 'ProposerIndex' b.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) // Field (2) 'ParentRoot' if cap(b.ParentRoot) == 0 { b.ParentRoot = make([]byte, 0, len(buf[16:48])) } b.ParentRoot = append(b.ParentRoot, buf[16:48]...) // Field (3) 'StateRoot' if cap(b.StateRoot) == 0 { b.StateRoot = make([]byte, 0, len(buf[48:80])) } b.StateRoot = append(b.StateRoot, buf[48:80]...) // Offset (4) 'Body' if o4 = ssz.ReadOffset(buf[80:84]); o4 > size { return ssz.ErrOffset } if o4 != 84 { return ssz.ErrInvalidVariableOffset } // Field (4) 'Body' { buf = tail[o4:] if b.Body == nil { b.Body = new(BlindedBeaconBlockBodyDeneb) } if err = b.Body.UnmarshalSSZ(buf); err != nil { return err } } return err } // SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockDeneb object func (b *BlindedBeaconBlockDeneb) SizeSSZ() (size int) { size = 84 // Field (4) 'Body' if b.Body == nil { b.Body = new(BlindedBeaconBlockBodyDeneb) } size += b.Body.SizeSSZ() return } // HashTreeRoot ssz hashes the BlindedBeaconBlockDeneb object func (b *BlindedBeaconBlockDeneb) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } // HashTreeRootWith ssz hashes the BlindedBeaconBlockDeneb object with a hasher func (b *BlindedBeaconBlockDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'Slot' hh.PutUint64(uint64(b.Slot)) // Field (1) 'ProposerIndex' hh.PutUint64(uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' if size := len(b.ParentRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } hh.PutBytes(b.ParentRoot) // Field (3) 'StateRoot' if size := len(b.StateRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(b.StateRoot) // Field (4) 'Body' if err = b.Body.HashTreeRootWith(hh); err != nil { return } hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the BeaconBlockBodyAltair object func (b *BeaconBlockBodyAltair) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } // MarshalSSZTo ssz marshals the BeaconBlockBodyAltair object to a target array func (b *BeaconBlockBodyAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf offset := int(380) // Field (0) 'RandaoReveal' if size := len(b.RandaoReveal); size != 96 { err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } dst = append(dst, b.RandaoReveal...) // Field (1) 'Eth1Data' if b.Eth1Data == nil { b.Eth1Data = new(v1.Eth1Data) } if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { return } // Field (2) 'Graffiti' if size := len(b.Graffiti); size != 32 { err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } dst = append(dst, b.Graffiti...) // Offset (3) 'ProposerSlashings' dst = ssz.WriteOffset(dst, offset) offset += len(b.ProposerSlashings) * 416 // Offset (4) 'AttesterSlashings' dst = ssz.WriteOffset(dst, offset) for ii := 0; ii < len(b.AttesterSlashings); ii++ { offset += 4 offset += b.AttesterSlashings[ii].SizeSSZ() } // Offset (5) 'Attestations' dst = ssz.WriteOffset(dst, offset) for ii := 0; ii < len(b.Attestations); ii++ { offset += 4 offset += b.Attestations[ii].SizeSSZ() } // Offset (6) 'Deposits' dst = ssz.WriteOffset(dst, offset) offset += len(b.Deposits) * 1240 // Offset (7) 'VoluntaryExits' dst = ssz.WriteOffset(dst, offset) offset += len(b.VoluntaryExits) * 112 // Field (8) 'SyncAggregate' if b.SyncAggregate == nil { b.SyncAggregate = new(v1.SyncAggregate) } if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { return } // Field (3) 'ProposerSlashings' if size := len(b.ProposerSlashings); size > 16 { err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) return } for ii := 0; ii < len(b.ProposerSlashings); ii++ { if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { return } } // Field (4) 'AttesterSlashings' if size := len(b.AttesterSlashings); size > 2 { err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) return } { offset = 4 * len(b.AttesterSlashings) for ii := 0; ii < len(b.AttesterSlashings); ii++ { dst = ssz.WriteOffset(dst, offset) offset += b.AttesterSlashings[ii].SizeSSZ() } } for ii := 0; ii < len(b.AttesterSlashings); ii++ { if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { return } } // Field (5) 'Attestations' if size := len(b.Attestations); size > 128 { err = ssz.ErrListTooBigFn("--.Attestations", size, 128) return } { offset = 4 * len(b.Attestations) for ii := 0; ii < len(b.Attestations); ii++ { dst = ssz.WriteOffset(dst, offset) offset += b.Attestations[ii].SizeSSZ() } } for ii := 0; ii < len(b.Attestations); ii++ { if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { return } } // Field (6) 'Deposits' if size := len(b.Deposits); size > 16 { err = ssz.ErrListTooBigFn("--.Deposits", size, 16) return } for ii := 0; ii < len(b.Deposits); ii++ { if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { return } } // Field (7) 'VoluntaryExits' if size := len(b.VoluntaryExits); size > 16 { err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) return } for ii := 0; ii < len(b.VoluntaryExits); ii++ { if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { return } } return } // UnmarshalSSZ ssz unmarshals the BeaconBlockBodyAltair object func (b *BeaconBlockBodyAltair) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size < 380 { return ssz.ErrSize } tail := buf var o3, o4, o5, o6, o7 uint64 // Field (0) 'RandaoReveal' if cap(b.RandaoReveal) == 0 { b.RandaoReveal = make([]byte, 0, len(buf[0:96])) } b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) // Field (1) 'Eth1Data' if b.Eth1Data == nil { b.Eth1Data = new(v1.Eth1Data) } if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { return err } // Field (2) 'Graffiti' if cap(b.Graffiti) == 0 { b.Graffiti = make([]byte, 0, len(buf[168:200])) } b.Graffiti = append(b.Graffiti, buf[168:200]...) // Offset (3) 'ProposerSlashings' if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { return ssz.ErrOffset } if o3 != 380 { return ssz.ErrInvalidVariableOffset } // Offset (4) 'AttesterSlashings' if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { return ssz.ErrOffset } // Offset (5) 'Attestations' if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { return ssz.ErrOffset } // Offset (6) 'Deposits' if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { return ssz.ErrOffset } // Offset (7) 'VoluntaryExits' if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { return ssz.ErrOffset } // Field (8) 'SyncAggregate' if b.SyncAggregate == nil { b.SyncAggregate = new(v1.SyncAggregate) } if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { return err } // Field (3) 'ProposerSlashings' { buf = tail[o3:o4] num, err := ssz.DivideInt2(len(buf), 416, 16) if err != nil { return err } b.ProposerSlashings = make([]*v1.ProposerSlashing, num) for ii := 0; ii < num; ii++ { if b.ProposerSlashings[ii] == nil { b.ProposerSlashings[ii] = new(v1.ProposerSlashing) } if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { return err } } } // Field (4) 'AttesterSlashings' { buf = tail[o4:o5] num, err := ssz.DecodeDynamicLength(buf, 2) if err != nil { return err } b.AttesterSlashings = make([]*v1.AttesterSlashing, num) err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { if b.AttesterSlashings[indx] == nil { b.AttesterSlashings[indx] = new(v1.AttesterSlashing) } if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { return err } return nil }) if err != nil { return err } } // Field (5) 'Attestations' { buf = tail[o5:o6] num, err := ssz.DecodeDynamicLength(buf, 128) if err != nil { return err } b.Attestations = make([]*v1.Attestation, num) err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { if b.Attestations[indx] == nil { b.Attestations[indx] = new(v1.Attestation) } if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { return err } return nil }) if err != nil { return err } } // Field (6) 'Deposits' { buf = tail[o6:o7] num, err := ssz.DivideInt2(len(buf), 1240, 16) if err != nil { return err } b.Deposits = make([]*v1.Deposit, num) for ii := 0; ii < num; ii++ { if b.Deposits[ii] == nil { b.Deposits[ii] = new(v1.Deposit) } if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { return err } } } // Field (7) 'VoluntaryExits' { buf = tail[o7:] num, err := ssz.DivideInt2(len(buf), 112, 16) if err != nil { return err } b.VoluntaryExits = make([]*v1.SignedVoluntaryExit, num) for ii := 0; ii < num; ii++ { if b.VoluntaryExits[ii] == nil { b.VoluntaryExits[ii] = new(v1.SignedVoluntaryExit) } if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { return err } } } return err } // SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyAltair object func (b *BeaconBlockBodyAltair) SizeSSZ() (size int) { size = 380 // Field (3) 'ProposerSlashings' size += len(b.ProposerSlashings) * 416 // Field (4) 'AttesterSlashings' for ii := 0; ii < len(b.AttesterSlashings); ii++ { size += 4 size += b.AttesterSlashings[ii].SizeSSZ() } // Field (5) 'Attestations' for ii := 0; ii < len(b.Attestations); ii++ { size += 4 size += b.Attestations[ii].SizeSSZ() } // Field (6) 'Deposits' size += len(b.Deposits) * 1240 // Field (7) 'VoluntaryExits' size += len(b.VoluntaryExits) * 112 return } // HashTreeRoot ssz hashes the BeaconBlockBodyAltair object func (b *BeaconBlockBodyAltair) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } // HashTreeRootWith ssz hashes the BeaconBlockBodyAltair object with a hasher func (b *BeaconBlockBodyAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'RandaoReveal' if size := len(b.RandaoReveal); size != 96 { err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } hh.PutBytes(b.RandaoReveal) // Field (1) 'Eth1Data' if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { return } // Field (2) 'Graffiti' if size := len(b.Graffiti); size != 32 { err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } hh.PutBytes(b.Graffiti) // Field (3) 'ProposerSlashings' { subIndx := hh.Index() num := uint64(len(b.ProposerSlashings)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.ProposerSlashings { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (4) 'AttesterSlashings' { subIndx := hh.Index() num := uint64(len(b.AttesterSlashings)) if num > 2 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.AttesterSlashings { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 2) } // Field (5) 'Attestations' { subIndx := hh.Index() num := uint64(len(b.Attestations)) if num > 128 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.Attestations { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 128) } // Field (6) 'Deposits' { subIndx := hh.Index() num := uint64(len(b.Deposits)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.Deposits { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (7) 'VoluntaryExits' { subIndx := hh.Index() num := uint64(len(b.VoluntaryExits)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.VoluntaryExits { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (8) 'SyncAggregate' if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { return } hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the BeaconBlockBodyBellatrix object func (b *BeaconBlockBodyBellatrix) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } // MarshalSSZTo ssz marshals the BeaconBlockBodyBellatrix object to a target array func (b *BeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf offset := int(384) // Field (0) 'RandaoReveal' if size := len(b.RandaoReveal); size != 96 { err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } dst = append(dst, b.RandaoReveal...) // Field (1) 'Eth1Data' if b.Eth1Data == nil { b.Eth1Data = new(v1.Eth1Data) } if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { return } // Field (2) 'Graffiti' if size := len(b.Graffiti); size != 32 { err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } dst = append(dst, b.Graffiti...) // Offset (3) 'ProposerSlashings' dst = ssz.WriteOffset(dst, offset) offset += len(b.ProposerSlashings) * 416 // Offset (4) 'AttesterSlashings' dst = ssz.WriteOffset(dst, offset) for ii := 0; ii < len(b.AttesterSlashings); ii++ { offset += 4 offset += b.AttesterSlashings[ii].SizeSSZ() } // Offset (5) 'Attestations' dst = ssz.WriteOffset(dst, offset) for ii := 0; ii < len(b.Attestations); ii++ { offset += 4 offset += b.Attestations[ii].SizeSSZ() } // Offset (6) 'Deposits' dst = ssz.WriteOffset(dst, offset) offset += len(b.Deposits) * 1240 // Offset (7) 'VoluntaryExits' dst = ssz.WriteOffset(dst, offset) offset += len(b.VoluntaryExits) * 112 // Field (8) 'SyncAggregate' if b.SyncAggregate == nil { b.SyncAggregate = new(v1.SyncAggregate) } if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { return } // Offset (9) 'ExecutionPayload' dst = ssz.WriteOffset(dst, offset) if b.ExecutionPayload == nil { b.ExecutionPayload = new(v11.ExecutionPayload) } offset += b.ExecutionPayload.SizeSSZ() // Field (3) 'ProposerSlashings' if size := len(b.ProposerSlashings); size > 16 { err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) return } for ii := 0; ii < len(b.ProposerSlashings); ii++ { if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { return } } // Field (4) 'AttesterSlashings' if size := len(b.AttesterSlashings); size > 2 { err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) return } { offset = 4 * len(b.AttesterSlashings) for ii := 0; ii < len(b.AttesterSlashings); ii++ { dst = ssz.WriteOffset(dst, offset) offset += b.AttesterSlashings[ii].SizeSSZ() } } for ii := 0; ii < len(b.AttesterSlashings); ii++ { if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { return } } // Field (5) 'Attestations' if size := len(b.Attestations); size > 128 { err = ssz.ErrListTooBigFn("--.Attestations", size, 128) return } { offset = 4 * len(b.Attestations) for ii := 0; ii < len(b.Attestations); ii++ { dst = ssz.WriteOffset(dst, offset) offset += b.Attestations[ii].SizeSSZ() } } for ii := 0; ii < len(b.Attestations); ii++ { if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { return } } // Field (6) 'Deposits' if size := len(b.Deposits); size > 16 { err = ssz.ErrListTooBigFn("--.Deposits", size, 16) return } for ii := 0; ii < len(b.Deposits); ii++ { if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { return } } // Field (7) 'VoluntaryExits' if size := len(b.VoluntaryExits); size > 16 { err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) return } for ii := 0; ii < len(b.VoluntaryExits); ii++ { if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { return } } // Field (9) 'ExecutionPayload' if dst, err = b.ExecutionPayload.MarshalSSZTo(dst); err != nil { return } return } // UnmarshalSSZ ssz unmarshals the BeaconBlockBodyBellatrix object func (b *BeaconBlockBodyBellatrix) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size < 384 { return ssz.ErrSize } tail := buf var o3, o4, o5, o6, o7, o9 uint64 // Field (0) 'RandaoReveal' if cap(b.RandaoReveal) == 0 { b.RandaoReveal = make([]byte, 0, len(buf[0:96])) } b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) // Field (1) 'Eth1Data' if b.Eth1Data == nil { b.Eth1Data = new(v1.Eth1Data) } if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { return err } // Field (2) 'Graffiti' if cap(b.Graffiti) == 0 { b.Graffiti = make([]byte, 0, len(buf[168:200])) } b.Graffiti = append(b.Graffiti, buf[168:200]...) // Offset (3) 'ProposerSlashings' if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { return ssz.ErrOffset } if o3 != 384 { return ssz.ErrInvalidVariableOffset } // Offset (4) 'AttesterSlashings' if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { return ssz.ErrOffset } // Offset (5) 'Attestations' if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { return ssz.ErrOffset } // Offset (6) 'Deposits' if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { return ssz.ErrOffset } // Offset (7) 'VoluntaryExits' if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { return ssz.ErrOffset } // Field (8) 'SyncAggregate' if b.SyncAggregate == nil { b.SyncAggregate = new(v1.SyncAggregate) } if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { return err } // Offset (9) 'ExecutionPayload' if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { return ssz.ErrOffset } // Field (3) 'ProposerSlashings' { buf = tail[o3:o4] num, err := ssz.DivideInt2(len(buf), 416, 16) if err != nil { return err } b.ProposerSlashings = make([]*v1.ProposerSlashing, num) for ii := 0; ii < num; ii++ { if b.ProposerSlashings[ii] == nil { b.ProposerSlashings[ii] = new(v1.ProposerSlashing) } if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { return err } } } // Field (4) 'AttesterSlashings' { buf = tail[o4:o5] num, err := ssz.DecodeDynamicLength(buf, 2) if err != nil { return err } b.AttesterSlashings = make([]*v1.AttesterSlashing, num) err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { if b.AttesterSlashings[indx] == nil { b.AttesterSlashings[indx] = new(v1.AttesterSlashing) } if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { return err } return nil }) if err != nil { return err } } // Field (5) 'Attestations' { buf = tail[o5:o6] num, err := ssz.DecodeDynamicLength(buf, 128) if err != nil { return err } b.Attestations = make([]*v1.Attestation, num) err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { if b.Attestations[indx] == nil { b.Attestations[indx] = new(v1.Attestation) } if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { return err } return nil }) if err != nil { return err } } // Field (6) 'Deposits' { buf = tail[o6:o7] num, err := ssz.DivideInt2(len(buf), 1240, 16) if err != nil { return err } b.Deposits = make([]*v1.Deposit, num) for ii := 0; ii < num; ii++ { if b.Deposits[ii] == nil { b.Deposits[ii] = new(v1.Deposit) } if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { return err } } } // Field (7) 'VoluntaryExits' { buf = tail[o7:o9] num, err := ssz.DivideInt2(len(buf), 112, 16) if err != nil { return err } b.VoluntaryExits = make([]*v1.SignedVoluntaryExit, num) for ii := 0; ii < num; ii++ { if b.VoluntaryExits[ii] == nil { b.VoluntaryExits[ii] = new(v1.SignedVoluntaryExit) } if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { return err } } } // Field (9) 'ExecutionPayload' { buf = tail[o9:] if b.ExecutionPayload == nil { b.ExecutionPayload = new(v11.ExecutionPayload) } if err = b.ExecutionPayload.UnmarshalSSZ(buf); err != nil { return err } } return err } // SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyBellatrix object func (b *BeaconBlockBodyBellatrix) SizeSSZ() (size int) { size = 384 // Field (3) 'ProposerSlashings' size += len(b.ProposerSlashings) * 416 // Field (4) 'AttesterSlashings' for ii := 0; ii < len(b.AttesterSlashings); ii++ { size += 4 size += b.AttesterSlashings[ii].SizeSSZ() } // Field (5) 'Attestations' for ii := 0; ii < len(b.Attestations); ii++ { size += 4 size += b.Attestations[ii].SizeSSZ() } // Field (6) 'Deposits' size += len(b.Deposits) * 1240 // Field (7) 'VoluntaryExits' size += len(b.VoluntaryExits) * 112 // Field (9) 'ExecutionPayload' if b.ExecutionPayload == nil { b.ExecutionPayload = new(v11.ExecutionPayload) } size += b.ExecutionPayload.SizeSSZ() return } // HashTreeRoot ssz hashes the BeaconBlockBodyBellatrix object func (b *BeaconBlockBodyBellatrix) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } // HashTreeRootWith ssz hashes the BeaconBlockBodyBellatrix object with a hasher func (b *BeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'RandaoReveal' if size := len(b.RandaoReveal); size != 96 { err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } hh.PutBytes(b.RandaoReveal) // Field (1) 'Eth1Data' if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { return } // Field (2) 'Graffiti' if size := len(b.Graffiti); size != 32 { err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } hh.PutBytes(b.Graffiti) // Field (3) 'ProposerSlashings' { subIndx := hh.Index() num := uint64(len(b.ProposerSlashings)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.ProposerSlashings { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (4) 'AttesterSlashings' { subIndx := hh.Index() num := uint64(len(b.AttesterSlashings)) if num > 2 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.AttesterSlashings { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 2) } // Field (5) 'Attestations' { subIndx := hh.Index() num := uint64(len(b.Attestations)) if num > 128 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.Attestations { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 128) } // Field (6) 'Deposits' { subIndx := hh.Index() num := uint64(len(b.Deposits)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.Deposits { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (7) 'VoluntaryExits' { subIndx := hh.Index() num := uint64(len(b.VoluntaryExits)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.VoluntaryExits { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (8) 'SyncAggregate' if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { return } // Field (9) 'ExecutionPayload' if err = b.ExecutionPayload.HashTreeRootWith(hh); err != nil { return } hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the BlindedBeaconBlockBodyBellatrix object func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } // MarshalSSZTo ssz marshals the BlindedBeaconBlockBodyBellatrix object to a target array func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf offset := int(384) // Field (0) 'RandaoReveal' if size := len(b.RandaoReveal); size != 96 { err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } dst = append(dst, b.RandaoReveal...) // Field (1) 'Eth1Data' if b.Eth1Data == nil { b.Eth1Data = new(v1.Eth1Data) } if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { return } // Field (2) 'Graffiti' if size := len(b.Graffiti); size != 32 { err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } dst = append(dst, b.Graffiti...) // Offset (3) 'ProposerSlashings' dst = ssz.WriteOffset(dst, offset) offset += len(b.ProposerSlashings) * 416 // Offset (4) 'AttesterSlashings' dst = ssz.WriteOffset(dst, offset) for ii := 0; ii < len(b.AttesterSlashings); ii++ { offset += 4 offset += b.AttesterSlashings[ii].SizeSSZ() } // Offset (5) 'Attestations' dst = ssz.WriteOffset(dst, offset) for ii := 0; ii < len(b.Attestations); ii++ { offset += 4 offset += b.Attestations[ii].SizeSSZ() } // Offset (6) 'Deposits' dst = ssz.WriteOffset(dst, offset) offset += len(b.Deposits) * 1240 // Offset (7) 'VoluntaryExits' dst = ssz.WriteOffset(dst, offset) offset += len(b.VoluntaryExits) * 112 // Field (8) 'SyncAggregate' if b.SyncAggregate == nil { b.SyncAggregate = new(v1.SyncAggregate) } if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { return } // Offset (9) 'ExecutionPayloadHeader' dst = ssz.WriteOffset(dst, offset) if b.ExecutionPayloadHeader == nil { b.ExecutionPayloadHeader = new(v11.ExecutionPayloadHeader) } offset += b.ExecutionPayloadHeader.SizeSSZ() // Field (3) 'ProposerSlashings' if size := len(b.ProposerSlashings); size > 16 { err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) return } for ii := 0; ii < len(b.ProposerSlashings); ii++ { if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { return } } // Field (4) 'AttesterSlashings' if size := len(b.AttesterSlashings); size > 2 { err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) return } { offset = 4 * len(b.AttesterSlashings) for ii := 0; ii < len(b.AttesterSlashings); ii++ { dst = ssz.WriteOffset(dst, offset) offset += b.AttesterSlashings[ii].SizeSSZ() } } for ii := 0; ii < len(b.AttesterSlashings); ii++ { if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { return } } // Field (5) 'Attestations' if size := len(b.Attestations); size > 128 { err = ssz.ErrListTooBigFn("--.Attestations", size, 128) return } { offset = 4 * len(b.Attestations) for ii := 0; ii < len(b.Attestations); ii++ { dst = ssz.WriteOffset(dst, offset) offset += b.Attestations[ii].SizeSSZ() } } for ii := 0; ii < len(b.Attestations); ii++ { if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { return } } // Field (6) 'Deposits' if size := len(b.Deposits); size > 16 { err = ssz.ErrListTooBigFn("--.Deposits", size, 16) return } for ii := 0; ii < len(b.Deposits); ii++ { if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { return } } // Field (7) 'VoluntaryExits' if size := len(b.VoluntaryExits); size > 16 { err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) return } for ii := 0; ii < len(b.VoluntaryExits); ii++ { if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { return } } // Field (9) 'ExecutionPayloadHeader' if dst, err = b.ExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { return } return } // UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockBodyBellatrix object func (b *BlindedBeaconBlockBodyBellatrix) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size < 384 { return ssz.ErrSize } tail := buf var o3, o4, o5, o6, o7, o9 uint64 // Field (0) 'RandaoReveal' if cap(b.RandaoReveal) == 0 { b.RandaoReveal = make([]byte, 0, len(buf[0:96])) } b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) // Field (1) 'Eth1Data' if b.Eth1Data == nil { b.Eth1Data = new(v1.Eth1Data) } if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { return err } // Field (2) 'Graffiti' if cap(b.Graffiti) == 0 { b.Graffiti = make([]byte, 0, len(buf[168:200])) } b.Graffiti = append(b.Graffiti, buf[168:200]...) // Offset (3) 'ProposerSlashings' if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { return ssz.ErrOffset } if o3 != 384 { return ssz.ErrInvalidVariableOffset } // Offset (4) 'AttesterSlashings' if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { return ssz.ErrOffset } // Offset (5) 'Attestations' if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { return ssz.ErrOffset } // Offset (6) 'Deposits' if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { return ssz.ErrOffset } // Offset (7) 'VoluntaryExits' if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { return ssz.ErrOffset } // Field (8) 'SyncAggregate' if b.SyncAggregate == nil { b.SyncAggregate = new(v1.SyncAggregate) } if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { return err } // Offset (9) 'ExecutionPayloadHeader' if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { return ssz.ErrOffset } // Field (3) 'ProposerSlashings' { buf = tail[o3:o4] num, err := ssz.DivideInt2(len(buf), 416, 16) if err != nil { return err } b.ProposerSlashings = make([]*v1.ProposerSlashing, num) for ii := 0; ii < num; ii++ { if b.ProposerSlashings[ii] == nil { b.ProposerSlashings[ii] = new(v1.ProposerSlashing) } if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { return err } } } // Field (4) 'AttesterSlashings' { buf = tail[o4:o5] num, err := ssz.DecodeDynamicLength(buf, 2) if err != nil { return err } b.AttesterSlashings = make([]*v1.AttesterSlashing, num) err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { if b.AttesterSlashings[indx] == nil { b.AttesterSlashings[indx] = new(v1.AttesterSlashing) } if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { return err } return nil }) if err != nil { return err } } // Field (5) 'Attestations' { buf = tail[o5:o6] num, err := ssz.DecodeDynamicLength(buf, 128) if err != nil { return err } b.Attestations = make([]*v1.Attestation, num) err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { if b.Attestations[indx] == nil { b.Attestations[indx] = new(v1.Attestation) } if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { return err } return nil }) if err != nil { return err } } // Field (6) 'Deposits' { buf = tail[o6:o7] num, err := ssz.DivideInt2(len(buf), 1240, 16) if err != nil { return err } b.Deposits = make([]*v1.Deposit, num) for ii := 0; ii < num; ii++ { if b.Deposits[ii] == nil { b.Deposits[ii] = new(v1.Deposit) } if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { return err } } } // Field (7) 'VoluntaryExits' { buf = tail[o7:o9] num, err := ssz.DivideInt2(len(buf), 112, 16) if err != nil { return err } b.VoluntaryExits = make([]*v1.SignedVoluntaryExit, num) for ii := 0; ii < num; ii++ { if b.VoluntaryExits[ii] == nil { b.VoluntaryExits[ii] = new(v1.SignedVoluntaryExit) } if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { return err } } } // Field (9) 'ExecutionPayloadHeader' { buf = tail[o9:] if b.ExecutionPayloadHeader == nil { b.ExecutionPayloadHeader = new(v11.ExecutionPayloadHeader) } if err = b.ExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { return err } } return err } // SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBodyBellatrix object func (b *BlindedBeaconBlockBodyBellatrix) SizeSSZ() (size int) { size = 384 // Field (3) 'ProposerSlashings' size += len(b.ProposerSlashings) * 416 // Field (4) 'AttesterSlashings' for ii := 0; ii < len(b.AttesterSlashings); ii++ { size += 4 size += b.AttesterSlashings[ii].SizeSSZ() } // Field (5) 'Attestations' for ii := 0; ii < len(b.Attestations); ii++ { size += 4 size += b.Attestations[ii].SizeSSZ() } // Field (6) 'Deposits' size += len(b.Deposits) * 1240 // Field (7) 'VoluntaryExits' size += len(b.VoluntaryExits) * 112 // Field (9) 'ExecutionPayloadHeader' if b.ExecutionPayloadHeader == nil { b.ExecutionPayloadHeader = new(v11.ExecutionPayloadHeader) } size += b.ExecutionPayloadHeader.SizeSSZ() return } // HashTreeRoot ssz hashes the BlindedBeaconBlockBodyBellatrix object func (b *BlindedBeaconBlockBodyBellatrix) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } // HashTreeRootWith ssz hashes the BlindedBeaconBlockBodyBellatrix object with a hasher func (b *BlindedBeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'RandaoReveal' if size := len(b.RandaoReveal); size != 96 { err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } hh.PutBytes(b.RandaoReveal) // Field (1) 'Eth1Data' if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { return } // Field (2) 'Graffiti' if size := len(b.Graffiti); size != 32 { err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } hh.PutBytes(b.Graffiti) // Field (3) 'ProposerSlashings' { subIndx := hh.Index() num := uint64(len(b.ProposerSlashings)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.ProposerSlashings { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (4) 'AttesterSlashings' { subIndx := hh.Index() num := uint64(len(b.AttesterSlashings)) if num > 2 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.AttesterSlashings { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 2) } // Field (5) 'Attestations' { subIndx := hh.Index() num := uint64(len(b.Attestations)) if num > 128 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.Attestations { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 128) } // Field (6) 'Deposits' { subIndx := hh.Index() num := uint64(len(b.Deposits)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.Deposits { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (7) 'VoluntaryExits' { subIndx := hh.Index() num := uint64(len(b.VoluntaryExits)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.VoluntaryExits { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (8) 'SyncAggregate' if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { return } // Field (9) 'ExecutionPayloadHeader' if err = b.ExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { return } hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the BeaconBlockBodyCapella object func (b *BeaconBlockBodyCapella) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } // MarshalSSZTo ssz marshals the BeaconBlockBodyCapella object to a target array func (b *BeaconBlockBodyCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf offset := int(388) // Field (0) 'RandaoReveal' if size := len(b.RandaoReveal); size != 96 { err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } dst = append(dst, b.RandaoReveal...) // Field (1) 'Eth1Data' if b.Eth1Data == nil { b.Eth1Data = new(v1.Eth1Data) } if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { return } // Field (2) 'Graffiti' if size := len(b.Graffiti); size != 32 { err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } dst = append(dst, b.Graffiti...) // Offset (3) 'ProposerSlashings' dst = ssz.WriteOffset(dst, offset) offset += len(b.ProposerSlashings) * 416 // Offset (4) 'AttesterSlashings' dst = ssz.WriteOffset(dst, offset) for ii := 0; ii < len(b.AttesterSlashings); ii++ { offset += 4 offset += b.AttesterSlashings[ii].SizeSSZ() } // Offset (5) 'Attestations' dst = ssz.WriteOffset(dst, offset) for ii := 0; ii < len(b.Attestations); ii++ { offset += 4 offset += b.Attestations[ii].SizeSSZ() } // Offset (6) 'Deposits' dst = ssz.WriteOffset(dst, offset) offset += len(b.Deposits) * 1240 // Offset (7) 'VoluntaryExits' dst = ssz.WriteOffset(dst, offset) offset += len(b.VoluntaryExits) * 112 // Field (8) 'SyncAggregate' if b.SyncAggregate == nil { b.SyncAggregate = new(v1.SyncAggregate) } if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { return } // Offset (9) 'ExecutionPayload' dst = ssz.WriteOffset(dst, offset) if b.ExecutionPayload == nil { b.ExecutionPayload = new(v11.ExecutionPayloadCapella) } offset += b.ExecutionPayload.SizeSSZ() // Offset (10) 'BlsToExecutionChanges' dst = ssz.WriteOffset(dst, offset) offset += len(b.BlsToExecutionChanges) * 172 // Field (3) 'ProposerSlashings' if size := len(b.ProposerSlashings); size > 16 { err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) return } for ii := 0; ii < len(b.ProposerSlashings); ii++ { if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { return } } // Field (4) 'AttesterSlashings' if size := len(b.AttesterSlashings); size > 2 { err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) return } { offset = 4 * len(b.AttesterSlashings) for ii := 0; ii < len(b.AttesterSlashings); ii++ { dst = ssz.WriteOffset(dst, offset) offset += b.AttesterSlashings[ii].SizeSSZ() } } for ii := 0; ii < len(b.AttesterSlashings); ii++ { if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { return } } // Field (5) 'Attestations' if size := len(b.Attestations); size > 128 { err = ssz.ErrListTooBigFn("--.Attestations", size, 128) return } { offset = 4 * len(b.Attestations) for ii := 0; ii < len(b.Attestations); ii++ { dst = ssz.WriteOffset(dst, offset) offset += b.Attestations[ii].SizeSSZ() } } for ii := 0; ii < len(b.Attestations); ii++ { if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { return } } // Field (6) 'Deposits' if size := len(b.Deposits); size > 16 { err = ssz.ErrListTooBigFn("--.Deposits", size, 16) return } for ii := 0; ii < len(b.Deposits); ii++ { if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { return } } // Field (7) 'VoluntaryExits' if size := len(b.VoluntaryExits); size > 16 { err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) return } for ii := 0; ii < len(b.VoluntaryExits); ii++ { if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { return } } // Field (9) 'ExecutionPayload' if dst, err = b.ExecutionPayload.MarshalSSZTo(dst); err != nil { return } // Field (10) 'BlsToExecutionChanges' if size := len(b.BlsToExecutionChanges); size > 16 { err = ssz.ErrListTooBigFn("--.BlsToExecutionChanges", size, 16) return } for ii := 0; ii < len(b.BlsToExecutionChanges); ii++ { if dst, err = b.BlsToExecutionChanges[ii].MarshalSSZTo(dst); err != nil { return } } return } // UnmarshalSSZ ssz unmarshals the BeaconBlockBodyCapella object func (b *BeaconBlockBodyCapella) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size < 388 { return ssz.ErrSize } tail := buf var o3, o4, o5, o6, o7, o9, o10 uint64 // Field (0) 'RandaoReveal' if cap(b.RandaoReveal) == 0 { b.RandaoReveal = make([]byte, 0, len(buf[0:96])) } b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) // Field (1) 'Eth1Data' if b.Eth1Data == nil { b.Eth1Data = new(v1.Eth1Data) } if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { return err } // Field (2) 'Graffiti' if cap(b.Graffiti) == 0 { b.Graffiti = make([]byte, 0, len(buf[168:200])) } b.Graffiti = append(b.Graffiti, buf[168:200]...) // Offset (3) 'ProposerSlashings' if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { return ssz.ErrOffset } if o3 != 388 { return ssz.ErrInvalidVariableOffset } // Offset (4) 'AttesterSlashings' if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { return ssz.ErrOffset } // Offset (5) 'Attestations' if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { return ssz.ErrOffset } // Offset (6) 'Deposits' if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { return ssz.ErrOffset } // Offset (7) 'VoluntaryExits' if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { return ssz.ErrOffset } // Field (8) 'SyncAggregate' if b.SyncAggregate == nil { b.SyncAggregate = new(v1.SyncAggregate) } if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { return err } // Offset (9) 'ExecutionPayload' if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { return ssz.ErrOffset } // Offset (10) 'BlsToExecutionChanges' if o10 = ssz.ReadOffset(buf[384:388]); o10 > size || o9 > o10 { return ssz.ErrOffset } // Field (3) 'ProposerSlashings' { buf = tail[o3:o4] num, err := ssz.DivideInt2(len(buf), 416, 16) if err != nil { return err } b.ProposerSlashings = make([]*v1.ProposerSlashing, num) for ii := 0; ii < num; ii++ { if b.ProposerSlashings[ii] == nil { b.ProposerSlashings[ii] = new(v1.ProposerSlashing) } if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { return err } } } // Field (4) 'AttesterSlashings' { buf = tail[o4:o5] num, err := ssz.DecodeDynamicLength(buf, 2) if err != nil { return err } b.AttesterSlashings = make([]*v1.AttesterSlashing, num) err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { if b.AttesterSlashings[indx] == nil { b.AttesterSlashings[indx] = new(v1.AttesterSlashing) } if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { return err } return nil }) if err != nil { return err } } // Field (5) 'Attestations' { buf = tail[o5:o6] num, err := ssz.DecodeDynamicLength(buf, 128) if err != nil { return err } b.Attestations = make([]*v1.Attestation, num) err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { if b.Attestations[indx] == nil { b.Attestations[indx] = new(v1.Attestation) } if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { return err } return nil }) if err != nil { return err } } // Field (6) 'Deposits' { buf = tail[o6:o7] num, err := ssz.DivideInt2(len(buf), 1240, 16) if err != nil { return err } b.Deposits = make([]*v1.Deposit, num) for ii := 0; ii < num; ii++ { if b.Deposits[ii] == nil { b.Deposits[ii] = new(v1.Deposit) } if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { return err } } } // Field (7) 'VoluntaryExits' { buf = tail[o7:o9] num, err := ssz.DivideInt2(len(buf), 112, 16) if err != nil { return err } b.VoluntaryExits = make([]*v1.SignedVoluntaryExit, num) for ii := 0; ii < num; ii++ { if b.VoluntaryExits[ii] == nil { b.VoluntaryExits[ii] = new(v1.SignedVoluntaryExit) } if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { return err } } } // Field (9) 'ExecutionPayload' { buf = tail[o9:o10] if b.ExecutionPayload == nil { b.ExecutionPayload = new(v11.ExecutionPayloadCapella) } if err = b.ExecutionPayload.UnmarshalSSZ(buf); err != nil { return err } } // Field (10) 'BlsToExecutionChanges' { buf = tail[o10:] num, err := ssz.DivideInt2(len(buf), 172, 16) if err != nil { return err } b.BlsToExecutionChanges = make([]*SignedBLSToExecutionChange, num) for ii := 0; ii < num; ii++ { if b.BlsToExecutionChanges[ii] == nil { b.BlsToExecutionChanges[ii] = new(SignedBLSToExecutionChange) } if err = b.BlsToExecutionChanges[ii].UnmarshalSSZ(buf[ii*172 : (ii+1)*172]); err != nil { return err } } } return err } // SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyCapella object func (b *BeaconBlockBodyCapella) SizeSSZ() (size int) { size = 388 // Field (3) 'ProposerSlashings' size += len(b.ProposerSlashings) * 416 // Field (4) 'AttesterSlashings' for ii := 0; ii < len(b.AttesterSlashings); ii++ { size += 4 size += b.AttesterSlashings[ii].SizeSSZ() } // Field (5) 'Attestations' for ii := 0; ii < len(b.Attestations); ii++ { size += 4 size += b.Attestations[ii].SizeSSZ() } // Field (6) 'Deposits' size += len(b.Deposits) * 1240 // Field (7) 'VoluntaryExits' size += len(b.VoluntaryExits) * 112 // Field (9) 'ExecutionPayload' if b.ExecutionPayload == nil { b.ExecutionPayload = new(v11.ExecutionPayloadCapella) } size += b.ExecutionPayload.SizeSSZ() // Field (10) 'BlsToExecutionChanges' size += len(b.BlsToExecutionChanges) * 172 return } // HashTreeRoot ssz hashes the BeaconBlockBodyCapella object func (b *BeaconBlockBodyCapella) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } // HashTreeRootWith ssz hashes the BeaconBlockBodyCapella object with a hasher func (b *BeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'RandaoReveal' if size := len(b.RandaoReveal); size != 96 { err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } hh.PutBytes(b.RandaoReveal) // Field (1) 'Eth1Data' if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { return } // Field (2) 'Graffiti' if size := len(b.Graffiti); size != 32 { err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } hh.PutBytes(b.Graffiti) // Field (3) 'ProposerSlashings' { subIndx := hh.Index() num := uint64(len(b.ProposerSlashings)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.ProposerSlashings { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (4) 'AttesterSlashings' { subIndx := hh.Index() num := uint64(len(b.AttesterSlashings)) if num > 2 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.AttesterSlashings { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 2) } // Field (5) 'Attestations' { subIndx := hh.Index() num := uint64(len(b.Attestations)) if num > 128 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.Attestations { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 128) } // Field (6) 'Deposits' { subIndx := hh.Index() num := uint64(len(b.Deposits)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.Deposits { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (7) 'VoluntaryExits' { subIndx := hh.Index() num := uint64(len(b.VoluntaryExits)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.VoluntaryExits { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (8) 'SyncAggregate' if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { return } // Field (9) 'ExecutionPayload' if err = b.ExecutionPayload.HashTreeRootWith(hh); err != nil { return } // Field (10) 'BlsToExecutionChanges' { subIndx := hh.Index() num := uint64(len(b.BlsToExecutionChanges)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.BlsToExecutionChanges { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the BlindedBeaconBlockBodyCapella object func (b *BlindedBeaconBlockBodyCapella) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } // MarshalSSZTo ssz marshals the BlindedBeaconBlockBodyCapella object to a target array func (b *BlindedBeaconBlockBodyCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf offset := int(388) // Field (0) 'RandaoReveal' if size := len(b.RandaoReveal); size != 96 { err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } dst = append(dst, b.RandaoReveal...) // Field (1) 'Eth1Data' if b.Eth1Data == nil { b.Eth1Data = new(v1.Eth1Data) } if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { return } // Field (2) 'Graffiti' if size := len(b.Graffiti); size != 32 { err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } dst = append(dst, b.Graffiti...) // Offset (3) 'ProposerSlashings' dst = ssz.WriteOffset(dst, offset) offset += len(b.ProposerSlashings) * 416 // Offset (4) 'AttesterSlashings' dst = ssz.WriteOffset(dst, offset) for ii := 0; ii < len(b.AttesterSlashings); ii++ { offset += 4 offset += b.AttesterSlashings[ii].SizeSSZ() } // Offset (5) 'Attestations' dst = ssz.WriteOffset(dst, offset) for ii := 0; ii < len(b.Attestations); ii++ { offset += 4 offset += b.Attestations[ii].SizeSSZ() } // Offset (6) 'Deposits' dst = ssz.WriteOffset(dst, offset) offset += len(b.Deposits) * 1240 // Offset (7) 'VoluntaryExits' dst = ssz.WriteOffset(dst, offset) offset += len(b.VoluntaryExits) * 112 // Field (8) 'SyncAggregate' if b.SyncAggregate == nil { b.SyncAggregate = new(v1.SyncAggregate) } if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { return } // Offset (9) 'ExecutionPayloadHeader' dst = ssz.WriteOffset(dst, offset) if b.ExecutionPayloadHeader == nil { b.ExecutionPayloadHeader = new(v11.ExecutionPayloadHeaderCapella) } offset += b.ExecutionPayloadHeader.SizeSSZ() // Offset (10) 'BlsToExecutionChanges' dst = ssz.WriteOffset(dst, offset) offset += len(b.BlsToExecutionChanges) * 172 // Field (3) 'ProposerSlashings' if size := len(b.ProposerSlashings); size > 16 { err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) return } for ii := 0; ii < len(b.ProposerSlashings); ii++ { if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { return } } // Field (4) 'AttesterSlashings' if size := len(b.AttesterSlashings); size > 2 { err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) return } { offset = 4 * len(b.AttesterSlashings) for ii := 0; ii < len(b.AttesterSlashings); ii++ { dst = ssz.WriteOffset(dst, offset) offset += b.AttesterSlashings[ii].SizeSSZ() } } for ii := 0; ii < len(b.AttesterSlashings); ii++ { if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { return } } // Field (5) 'Attestations' if size := len(b.Attestations); size > 128 { err = ssz.ErrListTooBigFn("--.Attestations", size, 128) return } { offset = 4 * len(b.Attestations) for ii := 0; ii < len(b.Attestations); ii++ { dst = ssz.WriteOffset(dst, offset) offset += b.Attestations[ii].SizeSSZ() } } for ii := 0; ii < len(b.Attestations); ii++ { if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { return } } // Field (6) 'Deposits' if size := len(b.Deposits); size > 16 { err = ssz.ErrListTooBigFn("--.Deposits", size, 16) return } for ii := 0; ii < len(b.Deposits); ii++ { if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { return } } // Field (7) 'VoluntaryExits' if size := len(b.VoluntaryExits); size > 16 { err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) return } for ii := 0; ii < len(b.VoluntaryExits); ii++ { if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { return } } // Field (9) 'ExecutionPayloadHeader' if dst, err = b.ExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { return } // Field (10) 'BlsToExecutionChanges' if size := len(b.BlsToExecutionChanges); size > 16 { err = ssz.ErrListTooBigFn("--.BlsToExecutionChanges", size, 16) return } for ii := 0; ii < len(b.BlsToExecutionChanges); ii++ { if dst, err = b.BlsToExecutionChanges[ii].MarshalSSZTo(dst); err != nil { return } } return } // UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockBodyCapella object func (b *BlindedBeaconBlockBodyCapella) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size < 388 { return ssz.ErrSize } tail := buf var o3, o4, o5, o6, o7, o9, o10 uint64 // Field (0) 'RandaoReveal' if cap(b.RandaoReveal) == 0 { b.RandaoReveal = make([]byte, 0, len(buf[0:96])) } b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) // Field (1) 'Eth1Data' if b.Eth1Data == nil { b.Eth1Data = new(v1.Eth1Data) } if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { return err } // Field (2) 'Graffiti' if cap(b.Graffiti) == 0 { b.Graffiti = make([]byte, 0, len(buf[168:200])) } b.Graffiti = append(b.Graffiti, buf[168:200]...) // Offset (3) 'ProposerSlashings' if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { return ssz.ErrOffset } if o3 != 388 { return ssz.ErrInvalidVariableOffset } // Offset (4) 'AttesterSlashings' if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { return ssz.ErrOffset } // Offset (5) 'Attestations' if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { return ssz.ErrOffset } // Offset (6) 'Deposits' if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { return ssz.ErrOffset } // Offset (7) 'VoluntaryExits' if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { return ssz.ErrOffset } // Field (8) 'SyncAggregate' if b.SyncAggregate == nil { b.SyncAggregate = new(v1.SyncAggregate) } if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { return err } // Offset (9) 'ExecutionPayloadHeader' if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { return ssz.ErrOffset } // Offset (10) 'BlsToExecutionChanges' if o10 = ssz.ReadOffset(buf[384:388]); o10 > size || o9 > o10 { return ssz.ErrOffset } // Field (3) 'ProposerSlashings' { buf = tail[o3:o4] num, err := ssz.DivideInt2(len(buf), 416, 16) if err != nil { return err } b.ProposerSlashings = make([]*v1.ProposerSlashing, num) for ii := 0; ii < num; ii++ { if b.ProposerSlashings[ii] == nil { b.ProposerSlashings[ii] = new(v1.ProposerSlashing) } if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { return err } } } // Field (4) 'AttesterSlashings' { buf = tail[o4:o5] num, err := ssz.DecodeDynamicLength(buf, 2) if err != nil { return err } b.AttesterSlashings = make([]*v1.AttesterSlashing, num) err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { if b.AttesterSlashings[indx] == nil { b.AttesterSlashings[indx] = new(v1.AttesterSlashing) } if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { return err } return nil }) if err != nil { return err } } // Field (5) 'Attestations' { buf = tail[o5:o6] num, err := ssz.DecodeDynamicLength(buf, 128) if err != nil { return err } b.Attestations = make([]*v1.Attestation, num) err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { if b.Attestations[indx] == nil { b.Attestations[indx] = new(v1.Attestation) } if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { return err } return nil }) if err != nil { return err } } // Field (6) 'Deposits' { buf = tail[o6:o7] num, err := ssz.DivideInt2(len(buf), 1240, 16) if err != nil { return err } b.Deposits = make([]*v1.Deposit, num) for ii := 0; ii < num; ii++ { if b.Deposits[ii] == nil { b.Deposits[ii] = new(v1.Deposit) } if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { return err } } } // Field (7) 'VoluntaryExits' { buf = tail[o7:o9] num, err := ssz.DivideInt2(len(buf), 112, 16) if err != nil { return err } b.VoluntaryExits = make([]*v1.SignedVoluntaryExit, num) for ii := 0; ii < num; ii++ { if b.VoluntaryExits[ii] == nil { b.VoluntaryExits[ii] = new(v1.SignedVoluntaryExit) } if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { return err } } } // Field (9) 'ExecutionPayloadHeader' { buf = tail[o9:o10] if b.ExecutionPayloadHeader == nil { b.ExecutionPayloadHeader = new(v11.ExecutionPayloadHeaderCapella) } if err = b.ExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { return err } } // Field (10) 'BlsToExecutionChanges' { buf = tail[o10:] num, err := ssz.DivideInt2(len(buf), 172, 16) if err != nil { return err } b.BlsToExecutionChanges = make([]*SignedBLSToExecutionChange, num) for ii := 0; ii < num; ii++ { if b.BlsToExecutionChanges[ii] == nil { b.BlsToExecutionChanges[ii] = new(SignedBLSToExecutionChange) } if err = b.BlsToExecutionChanges[ii].UnmarshalSSZ(buf[ii*172 : (ii+1)*172]); err != nil { return err } } } return err } // SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBodyCapella object func (b *BlindedBeaconBlockBodyCapella) SizeSSZ() (size int) { size = 388 // Field (3) 'ProposerSlashings' size += len(b.ProposerSlashings) * 416 // Field (4) 'AttesterSlashings' for ii := 0; ii < len(b.AttesterSlashings); ii++ { size += 4 size += b.AttesterSlashings[ii].SizeSSZ() } // Field (5) 'Attestations' for ii := 0; ii < len(b.Attestations); ii++ { size += 4 size += b.Attestations[ii].SizeSSZ() } // Field (6) 'Deposits' size += len(b.Deposits) * 1240 // Field (7) 'VoluntaryExits' size += len(b.VoluntaryExits) * 112 // Field (9) 'ExecutionPayloadHeader' if b.ExecutionPayloadHeader == nil { b.ExecutionPayloadHeader = new(v11.ExecutionPayloadHeaderCapella) } size += b.ExecutionPayloadHeader.SizeSSZ() // Field (10) 'BlsToExecutionChanges' size += len(b.BlsToExecutionChanges) * 172 return } // HashTreeRoot ssz hashes the BlindedBeaconBlockBodyCapella object func (b *BlindedBeaconBlockBodyCapella) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } // HashTreeRootWith ssz hashes the BlindedBeaconBlockBodyCapella object with a hasher func (b *BlindedBeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'RandaoReveal' if size := len(b.RandaoReveal); size != 96 { err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } hh.PutBytes(b.RandaoReveal) // Field (1) 'Eth1Data' if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { return } // Field (2) 'Graffiti' if size := len(b.Graffiti); size != 32 { err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } hh.PutBytes(b.Graffiti) // Field (3) 'ProposerSlashings' { subIndx := hh.Index() num := uint64(len(b.ProposerSlashings)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.ProposerSlashings { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (4) 'AttesterSlashings' { subIndx := hh.Index() num := uint64(len(b.AttesterSlashings)) if num > 2 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.AttesterSlashings { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 2) } // Field (5) 'Attestations' { subIndx := hh.Index() num := uint64(len(b.Attestations)) if num > 128 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.Attestations { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 128) } // Field (6) 'Deposits' { subIndx := hh.Index() num := uint64(len(b.Deposits)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.Deposits { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (7) 'VoluntaryExits' { subIndx := hh.Index() num := uint64(len(b.VoluntaryExits)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.VoluntaryExits { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (8) 'SyncAggregate' if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { return } // Field (9) 'ExecutionPayloadHeader' if err = b.ExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { return } // Field (10) 'BlsToExecutionChanges' { subIndx := hh.Index() num := uint64(len(b.BlsToExecutionChanges)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.BlsToExecutionChanges { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the BlindedBeaconBlockBodyDeneb object func (b *BlindedBeaconBlockBodyDeneb) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } // MarshalSSZTo ssz marshals the BlindedBeaconBlockBodyDeneb object to a target array func (b *BlindedBeaconBlockBodyDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf offset := int(392) // Field (0) 'RandaoReveal' if size := len(b.RandaoReveal); size != 96 { err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } dst = append(dst, b.RandaoReveal...) // Field (1) 'Eth1Data' if b.Eth1Data == nil { b.Eth1Data = new(v1.Eth1Data) } if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { return } // Field (2) 'Graffiti' if size := len(b.Graffiti); size != 32 { err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } dst = append(dst, b.Graffiti...) // Offset (3) 'ProposerSlashings' dst = ssz.WriteOffset(dst, offset) offset += len(b.ProposerSlashings) * 416 // Offset (4) 'AttesterSlashings' dst = ssz.WriteOffset(dst, offset) for ii := 0; ii < len(b.AttesterSlashings); ii++ { offset += 4 offset += b.AttesterSlashings[ii].SizeSSZ() } // Offset (5) 'Attestations' dst = ssz.WriteOffset(dst, offset) for ii := 0; ii < len(b.Attestations); ii++ { offset += 4 offset += b.Attestations[ii].SizeSSZ() } // Offset (6) 'Deposits' dst = ssz.WriteOffset(dst, offset) offset += len(b.Deposits) * 1240 // Offset (7) 'VoluntaryExits' dst = ssz.WriteOffset(dst, offset) offset += len(b.VoluntaryExits) * 112 // Field (8) 'SyncAggregate' if b.SyncAggregate == nil { b.SyncAggregate = new(v1.SyncAggregate) } if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { return } // Offset (9) 'ExecutionPayloadHeader' dst = ssz.WriteOffset(dst, offset) if b.ExecutionPayloadHeader == nil { b.ExecutionPayloadHeader = new(v11.ExecutionPayloadHeaderDeneb) } offset += b.ExecutionPayloadHeader.SizeSSZ() // Offset (10) 'BlsToExecutionChanges' dst = ssz.WriteOffset(dst, offset) offset += len(b.BlsToExecutionChanges) * 172 // Offset (11) 'BlobKzgCommitments' dst = ssz.WriteOffset(dst, offset) offset += len(b.BlobKzgCommitments) * 48 // Field (3) 'ProposerSlashings' if size := len(b.ProposerSlashings); size > 16 { err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) return } for ii := 0; ii < len(b.ProposerSlashings); ii++ { if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { return } } // Field (4) 'AttesterSlashings' if size := len(b.AttesterSlashings); size > 2 { err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) return } { offset = 4 * len(b.AttesterSlashings) for ii := 0; ii < len(b.AttesterSlashings); ii++ { dst = ssz.WriteOffset(dst, offset) offset += b.AttesterSlashings[ii].SizeSSZ() } } for ii := 0; ii < len(b.AttesterSlashings); ii++ { if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { return } } // Field (5) 'Attestations' if size := len(b.Attestations); size > 128 { err = ssz.ErrListTooBigFn("--.Attestations", size, 128) return } { offset = 4 * len(b.Attestations) for ii := 0; ii < len(b.Attestations); ii++ { dst = ssz.WriteOffset(dst, offset) offset += b.Attestations[ii].SizeSSZ() } } for ii := 0; ii < len(b.Attestations); ii++ { if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { return } } // Field (6) 'Deposits' if size := len(b.Deposits); size > 16 { err = ssz.ErrListTooBigFn("--.Deposits", size, 16) return } for ii := 0; ii < len(b.Deposits); ii++ { if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { return } } // Field (7) 'VoluntaryExits' if size := len(b.VoluntaryExits); size > 16 { err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) return } for ii := 0; ii < len(b.VoluntaryExits); ii++ { if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { return } } // Field (9) 'ExecutionPayloadHeader' if dst, err = b.ExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { return } // Field (10) 'BlsToExecutionChanges' if size := len(b.BlsToExecutionChanges); size > 16 { err = ssz.ErrListTooBigFn("--.BlsToExecutionChanges", size, 16) return } for ii := 0; ii < len(b.BlsToExecutionChanges); ii++ { if dst, err = b.BlsToExecutionChanges[ii].MarshalSSZTo(dst); err != nil { return } } // Field (11) 'BlobKzgCommitments' if size := len(b.BlobKzgCommitments); size > 4096 { err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) return } for ii := 0; ii < len(b.BlobKzgCommitments); ii++ { if size := len(b.BlobKzgCommitments[ii]); size != 48 { err = ssz.ErrBytesLengthFn("--.BlobKzgCommitments[ii]", size, 48) return } dst = append(dst, b.BlobKzgCommitments[ii]...) } return } // UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockBodyDeneb object func (b *BlindedBeaconBlockBodyDeneb) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size < 392 { return ssz.ErrSize } tail := buf var o3, o4, o5, o6, o7, o9, o10, o11 uint64 // Field (0) 'RandaoReveal' if cap(b.RandaoReveal) == 0 { b.RandaoReveal = make([]byte, 0, len(buf[0:96])) } b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) // Field (1) 'Eth1Data' if b.Eth1Data == nil { b.Eth1Data = new(v1.Eth1Data) } if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { return err } // Field (2) 'Graffiti' if cap(b.Graffiti) == 0 { b.Graffiti = make([]byte, 0, len(buf[168:200])) } b.Graffiti = append(b.Graffiti, buf[168:200]...) // Offset (3) 'ProposerSlashings' if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { return ssz.ErrOffset } if o3 != 392 { return ssz.ErrInvalidVariableOffset } // Offset (4) 'AttesterSlashings' if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { return ssz.ErrOffset } // Offset (5) 'Attestations' if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { return ssz.ErrOffset } // Offset (6) 'Deposits' if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { return ssz.ErrOffset } // Offset (7) 'VoluntaryExits' if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { return ssz.ErrOffset } // Field (8) 'SyncAggregate' if b.SyncAggregate == nil { b.SyncAggregate = new(v1.SyncAggregate) } if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { return err } // Offset (9) 'ExecutionPayloadHeader' if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { return ssz.ErrOffset } // Offset (10) 'BlsToExecutionChanges' if o10 = ssz.ReadOffset(buf[384:388]); o10 > size || o9 > o10 { return ssz.ErrOffset } // Offset (11) 'BlobKzgCommitments' if o11 = ssz.ReadOffset(buf[388:392]); o11 > size || o10 > o11 { return ssz.ErrOffset } // Field (3) 'ProposerSlashings' { buf = tail[o3:o4] num, err := ssz.DivideInt2(len(buf), 416, 16) if err != nil { return err } b.ProposerSlashings = make([]*v1.ProposerSlashing, num) for ii := 0; ii < num; ii++ { if b.ProposerSlashings[ii] == nil { b.ProposerSlashings[ii] = new(v1.ProposerSlashing) } if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { return err } } } // Field (4) 'AttesterSlashings' { buf = tail[o4:o5] num, err := ssz.DecodeDynamicLength(buf, 2) if err != nil { return err } b.AttesterSlashings = make([]*v1.AttesterSlashing, num) err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { if b.AttesterSlashings[indx] == nil { b.AttesterSlashings[indx] = new(v1.AttesterSlashing) } if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { return err } return nil }) if err != nil { return err } } // Field (5) 'Attestations' { buf = tail[o5:o6] num, err := ssz.DecodeDynamicLength(buf, 128) if err != nil { return err } b.Attestations = make([]*v1.Attestation, num) err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { if b.Attestations[indx] == nil { b.Attestations[indx] = new(v1.Attestation) } if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { return err } return nil }) if err != nil { return err } } // Field (6) 'Deposits' { buf = tail[o6:o7] num, err := ssz.DivideInt2(len(buf), 1240, 16) if err != nil { return err } b.Deposits = make([]*v1.Deposit, num) for ii := 0; ii < num; ii++ { if b.Deposits[ii] == nil { b.Deposits[ii] = new(v1.Deposit) } if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { return err } } } // Field (7) 'VoluntaryExits' { buf = tail[o7:o9] num, err := ssz.DivideInt2(len(buf), 112, 16) if err != nil { return err } b.VoluntaryExits = make([]*v1.SignedVoluntaryExit, num) for ii := 0; ii < num; ii++ { if b.VoluntaryExits[ii] == nil { b.VoluntaryExits[ii] = new(v1.SignedVoluntaryExit) } if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { return err } } } // Field (9) 'ExecutionPayloadHeader' { buf = tail[o9:o10] if b.ExecutionPayloadHeader == nil { b.ExecutionPayloadHeader = new(v11.ExecutionPayloadHeaderDeneb) } if err = b.ExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { return err } } // Field (10) 'BlsToExecutionChanges' { buf = tail[o10:o11] num, err := ssz.DivideInt2(len(buf), 172, 16) if err != nil { return err } b.BlsToExecutionChanges = make([]*SignedBLSToExecutionChange, num) for ii := 0; ii < num; ii++ { if b.BlsToExecutionChanges[ii] == nil { b.BlsToExecutionChanges[ii] = new(SignedBLSToExecutionChange) } if err = b.BlsToExecutionChanges[ii].UnmarshalSSZ(buf[ii*172 : (ii+1)*172]); err != nil { return err } } } // Field (11) 'BlobKzgCommitments' { buf = tail[o11:] num, err := ssz.DivideInt2(len(buf), 48, 4096) if err != nil { return err } b.BlobKzgCommitments = make([][]byte, num) for ii := 0; ii < num; ii++ { if cap(b.BlobKzgCommitments[ii]) == 0 { b.BlobKzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) } b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) } } return err } // SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBodyDeneb object func (b *BlindedBeaconBlockBodyDeneb) SizeSSZ() (size int) { size = 392 // Field (3) 'ProposerSlashings' size += len(b.ProposerSlashings) * 416 // Field (4) 'AttesterSlashings' for ii := 0; ii < len(b.AttesterSlashings); ii++ { size += 4 size += b.AttesterSlashings[ii].SizeSSZ() } // Field (5) 'Attestations' for ii := 0; ii < len(b.Attestations); ii++ { size += 4 size += b.Attestations[ii].SizeSSZ() } // Field (6) 'Deposits' size += len(b.Deposits) * 1240 // Field (7) 'VoluntaryExits' size += len(b.VoluntaryExits) * 112 // Field (9) 'ExecutionPayloadHeader' if b.ExecutionPayloadHeader == nil { b.ExecutionPayloadHeader = new(v11.ExecutionPayloadHeaderDeneb) } size += b.ExecutionPayloadHeader.SizeSSZ() // Field (10) 'BlsToExecutionChanges' size += len(b.BlsToExecutionChanges) * 172 // Field (11) 'BlobKzgCommitments' size += len(b.BlobKzgCommitments) * 48 return } // HashTreeRoot ssz hashes the BlindedBeaconBlockBodyDeneb object func (b *BlindedBeaconBlockBodyDeneb) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } // HashTreeRootWith ssz hashes the BlindedBeaconBlockBodyDeneb object with a hasher func (b *BlindedBeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'RandaoReveal' if size := len(b.RandaoReveal); size != 96 { err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } hh.PutBytes(b.RandaoReveal) // Field (1) 'Eth1Data' if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { return } // Field (2) 'Graffiti' if size := len(b.Graffiti); size != 32 { err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } hh.PutBytes(b.Graffiti) // Field (3) 'ProposerSlashings' { subIndx := hh.Index() num := uint64(len(b.ProposerSlashings)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.ProposerSlashings { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (4) 'AttesterSlashings' { subIndx := hh.Index() num := uint64(len(b.AttesterSlashings)) if num > 2 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.AttesterSlashings { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 2) } // Field (5) 'Attestations' { subIndx := hh.Index() num := uint64(len(b.Attestations)) if num > 128 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.Attestations { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 128) } // Field (6) 'Deposits' { subIndx := hh.Index() num := uint64(len(b.Deposits)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.Deposits { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (7) 'VoluntaryExits' { subIndx := hh.Index() num := uint64(len(b.VoluntaryExits)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.VoluntaryExits { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (8) 'SyncAggregate' if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { return } // Field (9) 'ExecutionPayloadHeader' if err = b.ExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { return } // Field (10) 'BlsToExecutionChanges' { subIndx := hh.Index() num := uint64(len(b.BlsToExecutionChanges)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.BlsToExecutionChanges { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (11) 'BlobKzgCommitments' { if size := len(b.BlobKzgCommitments); size > 4096 { err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) return } subIndx := hh.Index() for _, i := range b.BlobKzgCommitments { if len(i) != 48 { err = ssz.ErrBytesLength return } hh.PutBytes(i) } numItems := uint64(len(b.BlobKzgCommitments)) hh.MerkleizeWithMixin(subIndx, numItems, 4096) } hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the BeaconBlockBodyDeneb object func (b *BeaconBlockBodyDeneb) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } // MarshalSSZTo ssz marshals the BeaconBlockBodyDeneb object to a target array func (b *BeaconBlockBodyDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf offset := int(392) // Field (0) 'RandaoReveal' if size := len(b.RandaoReveal); size != 96 { err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } dst = append(dst, b.RandaoReveal...) // Field (1) 'Eth1Data' if b.Eth1Data == nil { b.Eth1Data = new(v1.Eth1Data) } if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { return } // Field (2) 'Graffiti' if size := len(b.Graffiti); size != 32 { err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } dst = append(dst, b.Graffiti...) // Offset (3) 'ProposerSlashings' dst = ssz.WriteOffset(dst, offset) offset += len(b.ProposerSlashings) * 416 // Offset (4) 'AttesterSlashings' dst = ssz.WriteOffset(dst, offset) for ii := 0; ii < len(b.AttesterSlashings); ii++ { offset += 4 offset += b.AttesterSlashings[ii].SizeSSZ() } // Offset (5) 'Attestations' dst = ssz.WriteOffset(dst, offset) for ii := 0; ii < len(b.Attestations); ii++ { offset += 4 offset += b.Attestations[ii].SizeSSZ() } // Offset (6) 'Deposits' dst = ssz.WriteOffset(dst, offset) offset += len(b.Deposits) * 1240 // Offset (7) 'VoluntaryExits' dst = ssz.WriteOffset(dst, offset) offset += len(b.VoluntaryExits) * 112 // Field (8) 'SyncAggregate' if b.SyncAggregate == nil { b.SyncAggregate = new(v1.SyncAggregate) } if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { return } // Offset (9) 'ExecutionPayload' dst = ssz.WriteOffset(dst, offset) if b.ExecutionPayload == nil { b.ExecutionPayload = new(v11.ExecutionPayloadDeneb) } offset += b.ExecutionPayload.SizeSSZ() // Offset (10) 'BlsToExecutionChanges' dst = ssz.WriteOffset(dst, offset) offset += len(b.BlsToExecutionChanges) * 172 // Offset (11) 'BlobKzgCommitments' dst = ssz.WriteOffset(dst, offset) offset += len(b.BlobKzgCommitments) * 48 // Field (3) 'ProposerSlashings' if size := len(b.ProposerSlashings); size > 16 { err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) return } for ii := 0; ii < len(b.ProposerSlashings); ii++ { if dst, err = b.ProposerSlashings[ii].MarshalSSZTo(dst); err != nil { return } } // Field (4) 'AttesterSlashings' if size := len(b.AttesterSlashings); size > 2 { err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) return } { offset = 4 * len(b.AttesterSlashings) for ii := 0; ii < len(b.AttesterSlashings); ii++ { dst = ssz.WriteOffset(dst, offset) offset += b.AttesterSlashings[ii].SizeSSZ() } } for ii := 0; ii < len(b.AttesterSlashings); ii++ { if dst, err = b.AttesterSlashings[ii].MarshalSSZTo(dst); err != nil { return } } // Field (5) 'Attestations' if size := len(b.Attestations); size > 128 { err = ssz.ErrListTooBigFn("--.Attestations", size, 128) return } { offset = 4 * len(b.Attestations) for ii := 0; ii < len(b.Attestations); ii++ { dst = ssz.WriteOffset(dst, offset) offset += b.Attestations[ii].SizeSSZ() } } for ii := 0; ii < len(b.Attestations); ii++ { if dst, err = b.Attestations[ii].MarshalSSZTo(dst); err != nil { return } } // Field (6) 'Deposits' if size := len(b.Deposits); size > 16 { err = ssz.ErrListTooBigFn("--.Deposits", size, 16) return } for ii := 0; ii < len(b.Deposits); ii++ { if dst, err = b.Deposits[ii].MarshalSSZTo(dst); err != nil { return } } // Field (7) 'VoluntaryExits' if size := len(b.VoluntaryExits); size > 16 { err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) return } for ii := 0; ii < len(b.VoluntaryExits); ii++ { if dst, err = b.VoluntaryExits[ii].MarshalSSZTo(dst); err != nil { return } } // Field (9) 'ExecutionPayload' if dst, err = b.ExecutionPayload.MarshalSSZTo(dst); err != nil { return } // Field (10) 'BlsToExecutionChanges' if size := len(b.BlsToExecutionChanges); size > 16 { err = ssz.ErrListTooBigFn("--.BlsToExecutionChanges", size, 16) return } for ii := 0; ii < len(b.BlsToExecutionChanges); ii++ { if dst, err = b.BlsToExecutionChanges[ii].MarshalSSZTo(dst); err != nil { return } } // Field (11) 'BlobKzgCommitments' if size := len(b.BlobKzgCommitments); size > 4096 { err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) return } for ii := 0; ii < len(b.BlobKzgCommitments); ii++ { if size := len(b.BlobKzgCommitments[ii]); size != 48 { err = ssz.ErrBytesLengthFn("--.BlobKzgCommitments[ii]", size, 48) return } dst = append(dst, b.BlobKzgCommitments[ii]...) } return } // UnmarshalSSZ ssz unmarshals the BeaconBlockBodyDeneb object func (b *BeaconBlockBodyDeneb) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size < 392 { return ssz.ErrSize } tail := buf var o3, o4, o5, o6, o7, o9, o10, o11 uint64 // Field (0) 'RandaoReveal' if cap(b.RandaoReveal) == 0 { b.RandaoReveal = make([]byte, 0, len(buf[0:96])) } b.RandaoReveal = append(b.RandaoReveal, buf[0:96]...) // Field (1) 'Eth1Data' if b.Eth1Data == nil { b.Eth1Data = new(v1.Eth1Data) } if err = b.Eth1Data.UnmarshalSSZ(buf[96:168]); err != nil { return err } // Field (2) 'Graffiti' if cap(b.Graffiti) == 0 { b.Graffiti = make([]byte, 0, len(buf[168:200])) } b.Graffiti = append(b.Graffiti, buf[168:200]...) // Offset (3) 'ProposerSlashings' if o3 = ssz.ReadOffset(buf[200:204]); o3 > size { return ssz.ErrOffset } if o3 != 392 { return ssz.ErrInvalidVariableOffset } // Offset (4) 'AttesterSlashings' if o4 = ssz.ReadOffset(buf[204:208]); o4 > size || o3 > o4 { return ssz.ErrOffset } // Offset (5) 'Attestations' if o5 = ssz.ReadOffset(buf[208:212]); o5 > size || o4 > o5 { return ssz.ErrOffset } // Offset (6) 'Deposits' if o6 = ssz.ReadOffset(buf[212:216]); o6 > size || o5 > o6 { return ssz.ErrOffset } // Offset (7) 'VoluntaryExits' if o7 = ssz.ReadOffset(buf[216:220]); o7 > size || o6 > o7 { return ssz.ErrOffset } // Field (8) 'SyncAggregate' if b.SyncAggregate == nil { b.SyncAggregate = new(v1.SyncAggregate) } if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { return err } // Offset (9) 'ExecutionPayload' if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { return ssz.ErrOffset } // Offset (10) 'BlsToExecutionChanges' if o10 = ssz.ReadOffset(buf[384:388]); o10 > size || o9 > o10 { return ssz.ErrOffset } // Offset (11) 'BlobKzgCommitments' if o11 = ssz.ReadOffset(buf[388:392]); o11 > size || o10 > o11 { return ssz.ErrOffset } // Field (3) 'ProposerSlashings' { buf = tail[o3:o4] num, err := ssz.DivideInt2(len(buf), 416, 16) if err != nil { return err } b.ProposerSlashings = make([]*v1.ProposerSlashing, num) for ii := 0; ii < num; ii++ { if b.ProposerSlashings[ii] == nil { b.ProposerSlashings[ii] = new(v1.ProposerSlashing) } if err = b.ProposerSlashings[ii].UnmarshalSSZ(buf[ii*416 : (ii+1)*416]); err != nil { return err } } } // Field (4) 'AttesterSlashings' { buf = tail[o4:o5] num, err := ssz.DecodeDynamicLength(buf, 2) if err != nil { return err } b.AttesterSlashings = make([]*v1.AttesterSlashing, num) err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { if b.AttesterSlashings[indx] == nil { b.AttesterSlashings[indx] = new(v1.AttesterSlashing) } if err = b.AttesterSlashings[indx].UnmarshalSSZ(buf); err != nil { return err } return nil }) if err != nil { return err } } // Field (5) 'Attestations' { buf = tail[o5:o6] num, err := ssz.DecodeDynamicLength(buf, 128) if err != nil { return err } b.Attestations = make([]*v1.Attestation, num) err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { if b.Attestations[indx] == nil { b.Attestations[indx] = new(v1.Attestation) } if err = b.Attestations[indx].UnmarshalSSZ(buf); err != nil { return err } return nil }) if err != nil { return err } } // Field (6) 'Deposits' { buf = tail[o6:o7] num, err := ssz.DivideInt2(len(buf), 1240, 16) if err != nil { return err } b.Deposits = make([]*v1.Deposit, num) for ii := 0; ii < num; ii++ { if b.Deposits[ii] == nil { b.Deposits[ii] = new(v1.Deposit) } if err = b.Deposits[ii].UnmarshalSSZ(buf[ii*1240 : (ii+1)*1240]); err != nil { return err } } } // Field (7) 'VoluntaryExits' { buf = tail[o7:o9] num, err := ssz.DivideInt2(len(buf), 112, 16) if err != nil { return err } b.VoluntaryExits = make([]*v1.SignedVoluntaryExit, num) for ii := 0; ii < num; ii++ { if b.VoluntaryExits[ii] == nil { b.VoluntaryExits[ii] = new(v1.SignedVoluntaryExit) } if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { return err } } } // Field (9) 'ExecutionPayload' { buf = tail[o9:o10] if b.ExecutionPayload == nil { b.ExecutionPayload = new(v11.ExecutionPayloadDeneb) } if err = b.ExecutionPayload.UnmarshalSSZ(buf); err != nil { return err } } // Field (10) 'BlsToExecutionChanges' { buf = tail[o10:o11] num, err := ssz.DivideInt2(len(buf), 172, 16) if err != nil { return err } b.BlsToExecutionChanges = make([]*SignedBLSToExecutionChange, num) for ii := 0; ii < num; ii++ { if b.BlsToExecutionChanges[ii] == nil { b.BlsToExecutionChanges[ii] = new(SignedBLSToExecutionChange) } if err = b.BlsToExecutionChanges[ii].UnmarshalSSZ(buf[ii*172 : (ii+1)*172]); err != nil { return err } } } // Field (11) 'BlobKzgCommitments' { buf = tail[o11:] num, err := ssz.DivideInt2(len(buf), 48, 4096) if err != nil { return err } b.BlobKzgCommitments = make([][]byte, num) for ii := 0; ii < num; ii++ { if cap(b.BlobKzgCommitments[ii]) == 0 { b.BlobKzgCommitments[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) } b.BlobKzgCommitments[ii] = append(b.BlobKzgCommitments[ii], buf[ii*48:(ii+1)*48]...) } } return err } // SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyDeneb object func (b *BeaconBlockBodyDeneb) SizeSSZ() (size int) { size = 392 // Field (3) 'ProposerSlashings' size += len(b.ProposerSlashings) * 416 // Field (4) 'AttesterSlashings' for ii := 0; ii < len(b.AttesterSlashings); ii++ { size += 4 size += b.AttesterSlashings[ii].SizeSSZ() } // Field (5) 'Attestations' for ii := 0; ii < len(b.Attestations); ii++ { size += 4 size += b.Attestations[ii].SizeSSZ() } // Field (6) 'Deposits' size += len(b.Deposits) * 1240 // Field (7) 'VoluntaryExits' size += len(b.VoluntaryExits) * 112 // Field (9) 'ExecutionPayload' if b.ExecutionPayload == nil { b.ExecutionPayload = new(v11.ExecutionPayloadDeneb) } size += b.ExecutionPayload.SizeSSZ() // Field (10) 'BlsToExecutionChanges' size += len(b.BlsToExecutionChanges) * 172 // Field (11) 'BlobKzgCommitments' size += len(b.BlobKzgCommitments) * 48 return } // HashTreeRoot ssz hashes the BeaconBlockBodyDeneb object func (b *BeaconBlockBodyDeneb) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } // HashTreeRootWith ssz hashes the BeaconBlockBodyDeneb object with a hasher func (b *BeaconBlockBodyDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'RandaoReveal' if size := len(b.RandaoReveal); size != 96 { err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } hh.PutBytes(b.RandaoReveal) // Field (1) 'Eth1Data' if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { return } // Field (2) 'Graffiti' if size := len(b.Graffiti); size != 32 { err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } hh.PutBytes(b.Graffiti) // Field (3) 'ProposerSlashings' { subIndx := hh.Index() num := uint64(len(b.ProposerSlashings)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.ProposerSlashings { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (4) 'AttesterSlashings' { subIndx := hh.Index() num := uint64(len(b.AttesterSlashings)) if num > 2 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.AttesterSlashings { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 2) } // Field (5) 'Attestations' { subIndx := hh.Index() num := uint64(len(b.Attestations)) if num > 128 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.Attestations { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 128) } // Field (6) 'Deposits' { subIndx := hh.Index() num := uint64(len(b.Deposits)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.Deposits { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (7) 'VoluntaryExits' { subIndx := hh.Index() num := uint64(len(b.VoluntaryExits)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.VoluntaryExits { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (8) 'SyncAggregate' if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { return } // Field (9) 'ExecutionPayload' if err = b.ExecutionPayload.HashTreeRootWith(hh); err != nil { return } // Field (10) 'BlsToExecutionChanges' { subIndx := hh.Index() num := uint64(len(b.BlsToExecutionChanges)) if num > 16 { err = ssz.ErrIncorrectListSize return } for _, elem := range b.BlsToExecutionChanges { if err = elem.HashTreeRootWith(hh); err != nil { return } } hh.MerkleizeWithMixin(subIndx, num, 16) } // Field (11) 'BlobKzgCommitments' { if size := len(b.BlobKzgCommitments); size > 4096 { err = ssz.ErrListTooBigFn("--.BlobKzgCommitments", size, 4096) return } subIndx := hh.Index() for _, i := range b.BlobKzgCommitments { if len(i) != 48 { err = ssz.ErrBytesLength return } hh.PutBytes(i) } numItems := uint64(len(b.BlobKzgCommitments)) hh.MerkleizeWithMixin(subIndx, numItems, 4096) } hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the SignedBeaconBlockContentsDeneb object func (s *SignedBeaconBlockContentsDeneb) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) } // MarshalSSZTo ssz marshals the SignedBeaconBlockContentsDeneb object to a target array func (s *SignedBeaconBlockContentsDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf offset := int(12) // Offset (0) 'SignedBlock' dst = ssz.WriteOffset(dst, offset) if s.SignedBlock == nil { s.SignedBlock = new(SignedBeaconBlockDeneb) } offset += s.SignedBlock.SizeSSZ() // Offset (1) 'KzgProofs' dst = ssz.WriteOffset(dst, offset) offset += len(s.KzgProofs) * 48 // Offset (2) 'Blobs' dst = ssz.WriteOffset(dst, offset) offset += len(s.Blobs) * 131072 // Field (0) 'SignedBlock' if dst, err = s.SignedBlock.MarshalSSZTo(dst); err != nil { return } // Field (1) 'KzgProofs' if size := len(s.KzgProofs); size > 4096 { err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096) return } for ii := 0; ii < len(s.KzgProofs); ii++ { if size := len(s.KzgProofs[ii]); size != 48 { err = ssz.ErrBytesLengthFn("--.KzgProofs[ii]", size, 48) return } dst = append(dst, s.KzgProofs[ii]...) } // Field (2) 'Blobs' if size := len(s.Blobs); size > 4096 { err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) return } for ii := 0; ii < len(s.Blobs); ii++ { if size := len(s.Blobs[ii]); size != 131072 { err = ssz.ErrBytesLengthFn("--.Blobs[ii]", size, 131072) return } dst = append(dst, s.Blobs[ii]...) } return } // UnmarshalSSZ ssz unmarshals the SignedBeaconBlockContentsDeneb object func (s *SignedBeaconBlockContentsDeneb) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size < 12 { return ssz.ErrSize } tail := buf var o0, o1, o2 uint64 // Offset (0) 'SignedBlock' if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { return ssz.ErrOffset } if o0 != 12 { return ssz.ErrInvalidVariableOffset } // Offset (1) 'KzgProofs' if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { return ssz.ErrOffset } // Offset (2) 'Blobs' if o2 = ssz.ReadOffset(buf[8:12]); o2 > size || o1 > o2 { return ssz.ErrOffset } // Field (0) 'SignedBlock' { buf = tail[o0:o1] if s.SignedBlock == nil { s.SignedBlock = new(SignedBeaconBlockDeneb) } if err = s.SignedBlock.UnmarshalSSZ(buf); err != nil { return err } } // Field (1) 'KzgProofs' { buf = tail[o1:o2] num, err := ssz.DivideInt2(len(buf), 48, 4096) if err != nil { return err } s.KzgProofs = make([][]byte, num) for ii := 0; ii < num; ii++ { if cap(s.KzgProofs[ii]) == 0 { s.KzgProofs[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) } s.KzgProofs[ii] = append(s.KzgProofs[ii], buf[ii*48:(ii+1)*48]...) } } // Field (2) 'Blobs' { buf = tail[o2:] num, err := ssz.DivideInt2(len(buf), 131072, 4096) if err != nil { return err } s.Blobs = make([][]byte, num) for ii := 0; ii < num; ii++ { if cap(s.Blobs[ii]) == 0 { s.Blobs[ii] = make([]byte, 0, len(buf[ii*131072:(ii+1)*131072])) } s.Blobs[ii] = append(s.Blobs[ii], buf[ii*131072:(ii+1)*131072]...) } } return err } // SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockContentsDeneb object func (s *SignedBeaconBlockContentsDeneb) SizeSSZ() (size int) { size = 12 // Field (0) 'SignedBlock' if s.SignedBlock == nil { s.SignedBlock = new(SignedBeaconBlockDeneb) } size += s.SignedBlock.SizeSSZ() // Field (1) 'KzgProofs' size += len(s.KzgProofs) * 48 // Field (2) 'Blobs' size += len(s.Blobs) * 131072 return } // HashTreeRoot ssz hashes the SignedBeaconBlockContentsDeneb object func (s *SignedBeaconBlockContentsDeneb) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(s) } // HashTreeRootWith ssz hashes the SignedBeaconBlockContentsDeneb object with a hasher func (s *SignedBeaconBlockContentsDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'SignedBlock' if err = s.SignedBlock.HashTreeRootWith(hh); err != nil { return } // Field (1) 'KzgProofs' { if size := len(s.KzgProofs); size > 4096 { err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096) return } subIndx := hh.Index() for _, i := range s.KzgProofs { if len(i) != 48 { err = ssz.ErrBytesLength return } hh.PutBytes(i) } numItems := uint64(len(s.KzgProofs)) hh.MerkleizeWithMixin(subIndx, numItems, 4096) } // Field (2) 'Blobs' { if size := len(s.Blobs); size > 4096 { err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) return } subIndx := hh.Index() for _, i := range s.Blobs { if len(i) != 131072 { err = ssz.ErrBytesLength return } hh.PutBytes(i) } numItems := uint64(len(s.Blobs)) hh.MerkleizeWithMixin(subIndx, numItems, 4096) } hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the BeaconBlockContentsDeneb object func (b *BeaconBlockContentsDeneb) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } // MarshalSSZTo ssz marshals the BeaconBlockContentsDeneb object to a target array func (b *BeaconBlockContentsDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf offset := int(12) // Offset (0) 'Block' dst = ssz.WriteOffset(dst, offset) if b.Block == nil { b.Block = new(BeaconBlockDeneb) } offset += b.Block.SizeSSZ() // Offset (1) 'KzgProofs' dst = ssz.WriteOffset(dst, offset) offset += len(b.KzgProofs) * 48 // Offset (2) 'Blobs' dst = ssz.WriteOffset(dst, offset) offset += len(b.Blobs) * 131072 // Field (0) 'Block' if dst, err = b.Block.MarshalSSZTo(dst); err != nil { return } // Field (1) 'KzgProofs' if size := len(b.KzgProofs); size > 4096 { err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096) return } for ii := 0; ii < len(b.KzgProofs); ii++ { if size := len(b.KzgProofs[ii]); size != 48 { err = ssz.ErrBytesLengthFn("--.KzgProofs[ii]", size, 48) return } dst = append(dst, b.KzgProofs[ii]...) } // Field (2) 'Blobs' if size := len(b.Blobs); size > 4096 { err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) return } for ii := 0; ii < len(b.Blobs); ii++ { if size := len(b.Blobs[ii]); size != 131072 { err = ssz.ErrBytesLengthFn("--.Blobs[ii]", size, 131072) return } dst = append(dst, b.Blobs[ii]...) } return } // UnmarshalSSZ ssz unmarshals the BeaconBlockContentsDeneb object func (b *BeaconBlockContentsDeneb) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size < 12 { return ssz.ErrSize } tail := buf var o0, o1, o2 uint64 // Offset (0) 'Block' if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { return ssz.ErrOffset } if o0 != 12 { return ssz.ErrInvalidVariableOffset } // Offset (1) 'KzgProofs' if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { return ssz.ErrOffset } // Offset (2) 'Blobs' if o2 = ssz.ReadOffset(buf[8:12]); o2 > size || o1 > o2 { return ssz.ErrOffset } // Field (0) 'Block' { buf = tail[o0:o1] if b.Block == nil { b.Block = new(BeaconBlockDeneb) } if err = b.Block.UnmarshalSSZ(buf); err != nil { return err } } // Field (1) 'KzgProofs' { buf = tail[o1:o2] num, err := ssz.DivideInt2(len(buf), 48, 4096) if err != nil { return err } b.KzgProofs = make([][]byte, num) for ii := 0; ii < num; ii++ { if cap(b.KzgProofs[ii]) == 0 { b.KzgProofs[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48])) } b.KzgProofs[ii] = append(b.KzgProofs[ii], buf[ii*48:(ii+1)*48]...) } } // Field (2) 'Blobs' { buf = tail[o2:] num, err := ssz.DivideInt2(len(buf), 131072, 4096) if err != nil { return err } b.Blobs = make([][]byte, num) for ii := 0; ii < num; ii++ { if cap(b.Blobs[ii]) == 0 { b.Blobs[ii] = make([]byte, 0, len(buf[ii*131072:(ii+1)*131072])) } b.Blobs[ii] = append(b.Blobs[ii], buf[ii*131072:(ii+1)*131072]...) } } return err } // SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockContentsDeneb object func (b *BeaconBlockContentsDeneb) SizeSSZ() (size int) { size = 12 // Field (0) 'Block' if b.Block == nil { b.Block = new(BeaconBlockDeneb) } size += b.Block.SizeSSZ() // Field (1) 'KzgProofs' size += len(b.KzgProofs) * 48 // Field (2) 'Blobs' size += len(b.Blobs) * 131072 return } // HashTreeRoot ssz hashes the BeaconBlockContentsDeneb object func (b *BeaconBlockContentsDeneb) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } // HashTreeRootWith ssz hashes the BeaconBlockContentsDeneb object with a hasher func (b *BeaconBlockContentsDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'Block' if err = b.Block.HashTreeRootWith(hh); err != nil { return } // Field (1) 'KzgProofs' { if size := len(b.KzgProofs); size > 4096 { err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096) return } subIndx := hh.Index() for _, i := range b.KzgProofs { if len(i) != 48 { err = ssz.ErrBytesLength return } hh.PutBytes(i) } numItems := uint64(len(b.KzgProofs)) hh.MerkleizeWithMixin(subIndx, numItems, 4096) } // Field (2) 'Blobs' { if size := len(b.Blobs); size > 4096 { err = ssz.ErrListTooBigFn("--.Blobs", size, 4096) return } subIndx := hh.Index() for _, i := range b.Blobs { if len(i) != 131072 { err = ssz.ErrBytesLength return } hh.PutBytes(i) } numItems := uint64(len(b.Blobs)) hh.MerkleizeWithMixin(subIndx, numItems, 4096) } hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the BlobIdentifier object func (b *BlobIdentifier) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } // MarshalSSZTo ssz marshals the BlobIdentifier object to a target array func (b *BlobIdentifier) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'BlockRoot' if size := len(b.BlockRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) return } dst = append(dst, b.BlockRoot...) // Field (1) 'Index' dst = ssz.MarshalUint64(dst, b.Index) return } // UnmarshalSSZ ssz unmarshals the BlobIdentifier object func (b *BlobIdentifier) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size != 40 { return ssz.ErrSize } // Field (0) 'BlockRoot' if cap(b.BlockRoot) == 0 { b.BlockRoot = make([]byte, 0, len(buf[0:32])) } b.BlockRoot = append(b.BlockRoot, buf[0:32]...) // Field (1) 'Index' b.Index = ssz.UnmarshallUint64(buf[32:40]) return err } // SizeSSZ returns the ssz encoded size in bytes for the BlobIdentifier object func (b *BlobIdentifier) SizeSSZ() (size int) { size = 40 return } // HashTreeRoot ssz hashes the BlobIdentifier object func (b *BlobIdentifier) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } // HashTreeRootWith ssz hashes the BlobIdentifier object with a hasher func (b *BlobIdentifier) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'BlockRoot' if size := len(b.BlockRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) return } hh.PutBytes(b.BlockRoot) // Field (1) 'Index' hh.PutUint64(b.Index) hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the SyncCommittee object func (s *SyncCommittee) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) } // MarshalSSZTo ssz marshals the SyncCommittee object to a target array func (s *SyncCommittee) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'Pubkeys' if size := len(s.Pubkeys); size != 512 { err = ssz.ErrVectorLengthFn("--.Pubkeys", size, 512) return } for ii := 0; ii < 512; ii++ { if size := len(s.Pubkeys[ii]); size != 48 { err = ssz.ErrBytesLengthFn("--.Pubkeys[ii]", size, 48) return } dst = append(dst, s.Pubkeys[ii]...) } // Field (1) 'AggregatePubkey' if size := len(s.AggregatePubkey); size != 48 { err = ssz.ErrBytesLengthFn("--.AggregatePubkey", size, 48) return } dst = append(dst, s.AggregatePubkey...) return } // UnmarshalSSZ ssz unmarshals the SyncCommittee object func (s *SyncCommittee) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size != 24624 { return ssz.ErrSize } // Field (0) 'Pubkeys' s.Pubkeys = make([][]byte, 512) for ii := 0; ii < 512; ii++ { if cap(s.Pubkeys[ii]) == 0 { s.Pubkeys[ii] = make([]byte, 0, len(buf[0:24576][ii*48:(ii+1)*48])) } s.Pubkeys[ii] = append(s.Pubkeys[ii], buf[0:24576][ii*48:(ii+1)*48]...) } // Field (1) 'AggregatePubkey' if cap(s.AggregatePubkey) == 0 { s.AggregatePubkey = make([]byte, 0, len(buf[24576:24624])) } s.AggregatePubkey = append(s.AggregatePubkey, buf[24576:24624]...) return err } // SizeSSZ returns the ssz encoded size in bytes for the SyncCommittee object func (s *SyncCommittee) SizeSSZ() (size int) { size = 24624 return } // HashTreeRoot ssz hashes the SyncCommittee object func (s *SyncCommittee) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(s) } // HashTreeRootWith ssz hashes the SyncCommittee object with a hasher func (s *SyncCommittee) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'Pubkeys' { if size := len(s.Pubkeys); size != 512 { err = ssz.ErrVectorLengthFn("--.Pubkeys", size, 512) return } subIndx := hh.Index() for _, i := range s.Pubkeys { if len(i) != 48 { err = ssz.ErrBytesLength return } hh.PutBytes(i) } hh.Merkleize(subIndx) } // Field (1) 'AggregatePubkey' if size := len(s.AggregatePubkey); size != 48 { err = ssz.ErrBytesLengthFn("--.AggregatePubkey", size, 48) return } hh.PutBytes(s.AggregatePubkey) hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the BLSToExecutionChange object func (b *BLSToExecutionChange) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(b) } // MarshalSSZTo ssz marshals the BLSToExecutionChange object to a target array func (b *BLSToExecutionChange) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'ValidatorIndex' dst = ssz.MarshalUint64(dst, uint64(b.ValidatorIndex)) // Field (1) 'FromBlsPubkey' if size := len(b.FromBlsPubkey); size != 48 { err = ssz.ErrBytesLengthFn("--.FromBlsPubkey", size, 48) return } dst = append(dst, b.FromBlsPubkey...) // Field (2) 'ToExecutionAddress' if size := len(b.ToExecutionAddress); size != 20 { err = ssz.ErrBytesLengthFn("--.ToExecutionAddress", size, 20) return } dst = append(dst, b.ToExecutionAddress...) return } // UnmarshalSSZ ssz unmarshals the BLSToExecutionChange object func (b *BLSToExecutionChange) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size != 76 { return ssz.ErrSize } // Field (0) 'ValidatorIndex' b.ValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) // Field (1) 'FromBlsPubkey' if cap(b.FromBlsPubkey) == 0 { b.FromBlsPubkey = make([]byte, 0, len(buf[8:56])) } b.FromBlsPubkey = append(b.FromBlsPubkey, buf[8:56]...) // Field (2) 'ToExecutionAddress' if cap(b.ToExecutionAddress) == 0 { b.ToExecutionAddress = make([]byte, 0, len(buf[56:76])) } b.ToExecutionAddress = append(b.ToExecutionAddress, buf[56:76]...) return err } // SizeSSZ returns the ssz encoded size in bytes for the BLSToExecutionChange object func (b *BLSToExecutionChange) SizeSSZ() (size int) { size = 76 return } // HashTreeRoot ssz hashes the BLSToExecutionChange object func (b *BLSToExecutionChange) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(b) } // HashTreeRootWith ssz hashes the BLSToExecutionChange object with a hasher func (b *BLSToExecutionChange) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'ValidatorIndex' hh.PutUint64(uint64(b.ValidatorIndex)) // Field (1) 'FromBlsPubkey' if size := len(b.FromBlsPubkey); size != 48 { err = ssz.ErrBytesLengthFn("--.FromBlsPubkey", size, 48) return } hh.PutBytes(b.FromBlsPubkey) // Field (2) 'ToExecutionAddress' if size := len(b.ToExecutionAddress); size != 20 { err = ssz.ErrBytesLengthFn("--.ToExecutionAddress", size, 20) return } hh.PutBytes(b.ToExecutionAddress) hh.Merkleize(indx) return } // MarshalSSZ ssz marshals the SignedBLSToExecutionChange object func (s *SignedBLSToExecutionChange) MarshalSSZ() ([]byte, error) { return ssz.MarshalSSZ(s) } // MarshalSSZTo ssz marshals the SignedBLSToExecutionChange object to a target array func (s *SignedBLSToExecutionChange) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'Message' if s.Message == nil { s.Message = new(BLSToExecutionChange) } if dst, err = s.Message.MarshalSSZTo(dst); err != nil { return } // Field (1) 'Signature' if size := len(s.Signature); size != 96 { err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) return } // UnmarshalSSZ ssz unmarshals the SignedBLSToExecutionChange object func (s *SignedBLSToExecutionChange) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) if size != 172 { return ssz.ErrSize } // Field (0) 'Message' if s.Message == nil { s.Message = new(BLSToExecutionChange) } if err = s.Message.UnmarshalSSZ(buf[0:76]); err != nil { return err } // Field (1) 'Signature' if cap(s.Signature) == 0 { s.Signature = make([]byte, 0, len(buf[76:172])) } s.Signature = append(s.Signature, buf[76:172]...) return err } // SizeSSZ returns the ssz encoded size in bytes for the SignedBLSToExecutionChange object func (s *SignedBLSToExecutionChange) SizeSSZ() (size int) { size = 172 return } // HashTreeRoot ssz hashes the SignedBLSToExecutionChange object func (s *SignedBLSToExecutionChange) HashTreeRoot() ([32]byte, error) { return ssz.HashWithDefaultHasher(s) } // HashTreeRootWith ssz hashes the SignedBLSToExecutionChange object with a hasher func (s *SignedBLSToExecutionChange) 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 }