Deneb produce blockv3 (#12708)

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
james-prysm
2023-09-01 05:51:27 -05:00
committed by GitHub
parent 3a8be9fcf8
commit 9a7393a2e3
34 changed files with 8182 additions and 2520 deletions

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT.
// Hash: 4140c14176015ace6edb7d8611bd16207ad64fe872f3ea0170279fbde82b5303
// Hash: 86494c66845c0e5ec7b1a6c6f0e34a770ce57f86114b161b5e0d8c7b04219b77
package enginev1
import (

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT.
// Hash: e48b579f1c4ced0b36ba1329204c668ac6db966ce37b7bda314aabddbd5f1662
// Hash: 07349f3ccd696e6980796cf0b8dc149b14d1791dce8dbc553e506af598c11ebb
package v1
import (

View File

@@ -519,7 +519,7 @@ message BeaconBlockBodyDeneb {
bytes graffiti = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// Block operations
// Refer to spec constants at https://github.com/ethereum/consensus-specs/blob/dev/specs/core/0_beacon-chain.md#max-operations-per-block
// Refer to spec constants at https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#max-operations-per-block
// At most MAX_PROPOSER_SLASHINGS.
repeated v1.ProposerSlashing proposer_slashings = 4 [(ethereum.eth.ext.ssz_max) = "16"];

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT.
// Hash: d835aa3a6a3cf037dfb4ffca7686e527835b94bb660983f23017bdb8a972f81d
// Hash: eaf49253855a8c44a53cb851548885777d203c0cdcd3249906ea5f9a7b6e93c6
package eth
import (

View File

@@ -76,8 +76,12 @@ ssz_gen_marshal(
"BlindedBeaconBlockCapella",
"BlindedBeaconBlockBodyCapella",
"SignedBlindedBeaconBlockDeneb",
"BeaconBlockAndBlobsDeneb",
"SignedBeaconBlockAndBlobsDeneb",
"BlindedBeaconBlockDeneb",
"BlindedBeaconBlockBodyDeneb",
"SignedBlindedBeaconBlockAndBlobsDeneb",
"BlindedBeaconBlockAndBlobsDeneb",
"SyncAggregate",
"SyncCommitteeMessage",
"SyncCommitteeContribution",

File diff suppressed because it is too large Load Diff

View File

@@ -54,6 +54,8 @@ message GenericSignedBeaconBlock {
// Representing a signed, post-Deneb fork blinded beacon block content.
SignedBlindedBeaconBlockAndBlobsDeneb blinded_deneb = 8;
}
bool is_blinded = 100;
uint64 payload_value = 101;
}
message GenericBeaconBlock {
@@ -82,6 +84,8 @@ message GenericBeaconBlock {
// Representing a signed, post-Deneb fork blinded beacon block content.
BlindedBeaconBlockAndBlobsDeneb blinded_deneb = 8;
}
bool is_blinded = 100;
uint64 payload_value = 101;
}
// The Ethereum consensus beacon block. The message does not contain a validator signature.

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT.
// Hash: a4cef4276bc2874bce7cd893bfee3da13f3b3f3183686029b2ce9c6ef4a32817
// Hash: 2a9c193ab6b4d9257fe266b49ce98b5cfecc990e6757a8aabb9dd0931a797f1c
package eth
import (
@@ -4613,6 +4613,160 @@ func (b *BlindedBeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err
return
}
// MarshalSSZ ssz marshals the SignedBeaconBlockAndBlobsDeneb object
func (s *SignedBeaconBlockAndBlobsDeneb) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(s)
}
// MarshalSSZTo ssz marshals the SignedBeaconBlockAndBlobsDeneb object to a target array
func (s *SignedBeaconBlockAndBlobsDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
offset := int(8)
// Offset (0) 'Block'
dst = ssz.WriteOffset(dst, offset)
if s.Block == nil {
s.Block = new(SignedBeaconBlockDeneb)
}
offset += s.Block.SizeSSZ()
// Offset (1) 'Blobs'
dst = ssz.WriteOffset(dst, offset)
offset += len(s.Blobs) * 131352
// Field (0) 'Block'
if dst, err = s.Block.MarshalSSZTo(dst); err != nil {
return
}
// Field (1) 'Blobs'
if size := len(s.Blobs); size > 6 {
err = ssz.ErrListTooBigFn("--.Blobs", size, 6)
return
}
for ii := 0; ii < len(s.Blobs); ii++ {
if dst, err = s.Blobs[ii].MarshalSSZTo(dst); err != nil {
return
}
}
return
}
// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockAndBlobsDeneb object
func (s *SignedBeaconBlockAndBlobsDeneb) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size < 8 {
return ssz.ErrSize
}
tail := buf
var o0, o1 uint64
// Offset (0) 'Block'
if o0 = ssz.ReadOffset(buf[0:4]); o0 > size {
return ssz.ErrOffset
}
if o0 < 8 {
return ssz.ErrInvalidVariableOffset
}
// Offset (1) 'Blobs'
if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 {
return ssz.ErrOffset
}
// Field (0) 'Block'
{
buf = tail[o0:o1]
if s.Block == nil {
s.Block = new(SignedBeaconBlockDeneb)
}
if err = s.Block.UnmarshalSSZ(buf); err != nil {
return err
}
}
// Field (1) 'Blobs'
{
buf = tail[o1:]
num, err := ssz.DivideInt2(len(buf), 131352, 6)
if err != nil {
return err
}
s.Blobs = make([]*SignedBlobSidecar, num)
for ii := 0; ii < num; ii++ {
if s.Blobs[ii] == nil {
s.Blobs[ii] = new(SignedBlobSidecar)
}
if err = s.Blobs[ii].UnmarshalSSZ(buf[ii*131352 : (ii+1)*131352]); err != nil {
return err
}
}
}
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockAndBlobsDeneb object
func (s *SignedBeaconBlockAndBlobsDeneb) SizeSSZ() (size int) {
size = 8
// Field (0) 'Block'
if s.Block == nil {
s.Block = new(SignedBeaconBlockDeneb)
}
size += s.Block.SizeSSZ()
// Field (1) 'Blobs'
size += len(s.Blobs) * 131352
return
}
// HashTreeRoot ssz hashes the SignedBeaconBlockAndBlobsDeneb object
func (s *SignedBeaconBlockAndBlobsDeneb) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(s)
}
// HashTreeRootWith ssz hashes the SignedBeaconBlockAndBlobsDeneb object with a hasher
func (s *SignedBeaconBlockAndBlobsDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'Block'
if err = s.Block.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'Blobs'
{
subIndx := hh.Index()
num := uint64(len(s.Blobs))
if num > 6 {
err = ssz.ErrIncorrectListSize
return
}
for _, elem := range s.Blobs {
if err = elem.HashTreeRootWith(hh); err != nil {
return
}
}
if ssz.EnableVectorizedHTR {
hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 6)
} else {
hh.MerkleizeWithMixin(subIndx, num, 6)
}
}
if ssz.EnableVectorizedHTR {
hh.MerkleizeVectorizedHTR(indx)
} else {
hh.Merkleize(indx)
}
return
}
// MarshalSSZ ssz marshals the SignedBeaconBlockDeneb object
func (s *SignedBeaconBlockDeneb) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(s)
@@ -4726,6 +4880,160 @@ func (s *SignedBeaconBlockDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) {
return
}
// MarshalSSZ ssz marshals the BeaconBlockAndBlobsDeneb object
func (b *BeaconBlockAndBlobsDeneb) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(b)
}
// MarshalSSZTo ssz marshals the BeaconBlockAndBlobsDeneb object to a target array
func (b *BeaconBlockAndBlobsDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
offset := int(8)
// Offset (0) 'Block'
dst = ssz.WriteOffset(dst, offset)
if b.Block == nil {
b.Block = new(BeaconBlockDeneb)
}
offset += b.Block.SizeSSZ()
// Offset (1) 'Blobs'
dst = ssz.WriteOffset(dst, offset)
offset += len(b.Blobs) * 131256
// Field (0) 'Block'
if dst, err = b.Block.MarshalSSZTo(dst); err != nil {
return
}
// Field (1) 'Blobs'
if size := len(b.Blobs); size > 6 {
err = ssz.ErrListTooBigFn("--.Blobs", size, 6)
return
}
for ii := 0; ii < len(b.Blobs); ii++ {
if dst, err = b.Blobs[ii].MarshalSSZTo(dst); err != nil {
return
}
}
return
}
// UnmarshalSSZ ssz unmarshals the BeaconBlockAndBlobsDeneb object
func (b *BeaconBlockAndBlobsDeneb) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size < 8 {
return ssz.ErrSize
}
tail := buf
var o0, o1 uint64
// Offset (0) 'Block'
if o0 = ssz.ReadOffset(buf[0:4]); o0 > size {
return ssz.ErrOffset
}
if o0 < 8 {
return ssz.ErrInvalidVariableOffset
}
// Offset (1) 'Blobs'
if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 {
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) 'Blobs'
{
buf = tail[o1:]
num, err := ssz.DivideInt2(len(buf), 131256, 6)
if err != nil {
return err
}
b.Blobs = make([]*BlobSidecar, num)
for ii := 0; ii < num; ii++ {
if b.Blobs[ii] == nil {
b.Blobs[ii] = new(BlobSidecar)
}
if err = b.Blobs[ii].UnmarshalSSZ(buf[ii*131256 : (ii+1)*131256]); err != nil {
return err
}
}
}
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockAndBlobsDeneb object
func (b *BeaconBlockAndBlobsDeneb) SizeSSZ() (size int) {
size = 8
// Field (0) 'Block'
if b.Block == nil {
b.Block = new(BeaconBlockDeneb)
}
size += b.Block.SizeSSZ()
// Field (1) 'Blobs'
size += len(b.Blobs) * 131256
return
}
// HashTreeRoot ssz hashes the BeaconBlockAndBlobsDeneb object
func (b *BeaconBlockAndBlobsDeneb) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(b)
}
// HashTreeRootWith ssz hashes the BeaconBlockAndBlobsDeneb object with a hasher
func (b *BeaconBlockAndBlobsDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'Block'
if err = b.Block.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'Blobs'
{
subIndx := hh.Index()
num := uint64(len(b.Blobs))
if num > 6 {
err = ssz.ErrIncorrectListSize
return
}
for _, elem := range b.Blobs {
if err = elem.HashTreeRootWith(hh); err != nil {
return
}
}
if ssz.EnableVectorizedHTR {
hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 6)
} else {
hh.MerkleizeWithMixin(subIndx, num, 6)
}
}
if ssz.EnableVectorizedHTR {
hh.MerkleizeVectorizedHTR(indx)
} else {
hh.Merkleize(indx)
}
return
}
// MarshalSSZ ssz marshals the BeaconBlockDeneb object
func (b *BeaconBlockDeneb) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(b)
@@ -7194,6 +7502,314 @@ func (b *BlindedBeaconBlockBodyCapella) HashTreeRootWith(hh *ssz.Hasher) (err er
return
}
// MarshalSSZ ssz marshals the SignedBlindedBeaconBlockAndBlobsDeneb object
func (s *SignedBlindedBeaconBlockAndBlobsDeneb) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(s)
}
// MarshalSSZTo ssz marshals the SignedBlindedBeaconBlockAndBlobsDeneb object to a target array
func (s *SignedBlindedBeaconBlockAndBlobsDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
offset := int(8)
// Offset (0) 'Block'
dst = ssz.WriteOffset(dst, offset)
if s.Block == nil {
s.Block = new(SignedBlindedBeaconBlockDeneb)
}
offset += s.Block.SizeSSZ()
// Offset (1) 'Blobs'
dst = ssz.WriteOffset(dst, offset)
offset += len(s.Blobs) * 312
// Field (0) 'Block'
if dst, err = s.Block.MarshalSSZTo(dst); err != nil {
return
}
// Field (1) 'Blobs'
if size := len(s.Blobs); size > 6 {
err = ssz.ErrListTooBigFn("--.Blobs", size, 6)
return
}
for ii := 0; ii < len(s.Blobs); ii++ {
if dst, err = s.Blobs[ii].MarshalSSZTo(dst); err != nil {
return
}
}
return
}
// UnmarshalSSZ ssz unmarshals the SignedBlindedBeaconBlockAndBlobsDeneb object
func (s *SignedBlindedBeaconBlockAndBlobsDeneb) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size < 8 {
return ssz.ErrSize
}
tail := buf
var o0, o1 uint64
// Offset (0) 'Block'
if o0 = ssz.ReadOffset(buf[0:4]); o0 > size {
return ssz.ErrOffset
}
if o0 < 8 {
return ssz.ErrInvalidVariableOffset
}
// Offset (1) 'Blobs'
if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 {
return ssz.ErrOffset
}
// Field (0) 'Block'
{
buf = tail[o0:o1]
if s.Block == nil {
s.Block = new(SignedBlindedBeaconBlockDeneb)
}
if err = s.Block.UnmarshalSSZ(buf); err != nil {
return err
}
}
// Field (1) 'Blobs'
{
buf = tail[o1:]
num, err := ssz.DivideInt2(len(buf), 312, 6)
if err != nil {
return err
}
s.Blobs = make([]*SignedBlindedBlobSidecar, num)
for ii := 0; ii < num; ii++ {
if s.Blobs[ii] == nil {
s.Blobs[ii] = new(SignedBlindedBlobSidecar)
}
if err = s.Blobs[ii].UnmarshalSSZ(buf[ii*312 : (ii+1)*312]); err != nil {
return err
}
}
}
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the SignedBlindedBeaconBlockAndBlobsDeneb object
func (s *SignedBlindedBeaconBlockAndBlobsDeneb) SizeSSZ() (size int) {
size = 8
// Field (0) 'Block'
if s.Block == nil {
s.Block = new(SignedBlindedBeaconBlockDeneb)
}
size += s.Block.SizeSSZ()
// Field (1) 'Blobs'
size += len(s.Blobs) * 312
return
}
// HashTreeRoot ssz hashes the SignedBlindedBeaconBlockAndBlobsDeneb object
func (s *SignedBlindedBeaconBlockAndBlobsDeneb) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(s)
}
// HashTreeRootWith ssz hashes the SignedBlindedBeaconBlockAndBlobsDeneb object with a hasher
func (s *SignedBlindedBeaconBlockAndBlobsDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'Block'
if err = s.Block.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'Blobs'
{
subIndx := hh.Index()
num := uint64(len(s.Blobs))
if num > 6 {
err = ssz.ErrIncorrectListSize
return
}
for _, elem := range s.Blobs {
if err = elem.HashTreeRootWith(hh); err != nil {
return
}
}
if ssz.EnableVectorizedHTR {
hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 6)
} else {
hh.MerkleizeWithMixin(subIndx, num, 6)
}
}
if ssz.EnableVectorizedHTR {
hh.MerkleizeVectorizedHTR(indx)
} else {
hh.Merkleize(indx)
}
return
}
// MarshalSSZ ssz marshals the BlindedBeaconBlockAndBlobsDeneb object
func (b *BlindedBeaconBlockAndBlobsDeneb) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(b)
}
// MarshalSSZTo ssz marshals the BlindedBeaconBlockAndBlobsDeneb object to a target array
func (b *BlindedBeaconBlockAndBlobsDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
offset := int(8)
// Offset (0) 'Block'
dst = ssz.WriteOffset(dst, offset)
if b.Block == nil {
b.Block = new(BlindedBeaconBlockDeneb)
}
offset += b.Block.SizeSSZ()
// Offset (1) 'Blobs'
dst = ssz.WriteOffset(dst, offset)
offset += len(b.Blobs) * 216
// Field (0) 'Block'
if dst, err = b.Block.MarshalSSZTo(dst); err != nil {
return
}
// Field (1) 'Blobs'
if size := len(b.Blobs); size > 6 {
err = ssz.ErrListTooBigFn("--.Blobs", size, 6)
return
}
for ii := 0; ii < len(b.Blobs); ii++ {
if dst, err = b.Blobs[ii].MarshalSSZTo(dst); err != nil {
return
}
}
return
}
// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockAndBlobsDeneb object
func (b *BlindedBeaconBlockAndBlobsDeneb) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size < 8 {
return ssz.ErrSize
}
tail := buf
var o0, o1 uint64
// Offset (0) 'Block'
if o0 = ssz.ReadOffset(buf[0:4]); o0 > size {
return ssz.ErrOffset
}
if o0 < 8 {
return ssz.ErrInvalidVariableOffset
}
// Offset (1) 'Blobs'
if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 {
return ssz.ErrOffset
}
// Field (0) 'Block'
{
buf = tail[o0:o1]
if b.Block == nil {
b.Block = new(BlindedBeaconBlockDeneb)
}
if err = b.Block.UnmarshalSSZ(buf); err != nil {
return err
}
}
// Field (1) 'Blobs'
{
buf = tail[o1:]
num, err := ssz.DivideInt2(len(buf), 216, 6)
if err != nil {
return err
}
b.Blobs = make([]*BlindedBlobSidecar, num)
for ii := 0; ii < num; ii++ {
if b.Blobs[ii] == nil {
b.Blobs[ii] = new(BlindedBlobSidecar)
}
if err = b.Blobs[ii].UnmarshalSSZ(buf[ii*216 : (ii+1)*216]); err != nil {
return err
}
}
}
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockAndBlobsDeneb object
func (b *BlindedBeaconBlockAndBlobsDeneb) SizeSSZ() (size int) {
size = 8
// Field (0) 'Block'
if b.Block == nil {
b.Block = new(BlindedBeaconBlockDeneb)
}
size += b.Block.SizeSSZ()
// Field (1) 'Blobs'
size += len(b.Blobs) * 216
return
}
// HashTreeRoot ssz hashes the BlindedBeaconBlockAndBlobsDeneb object
func (b *BlindedBeaconBlockAndBlobsDeneb) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(b)
}
// HashTreeRootWith ssz hashes the BlindedBeaconBlockAndBlobsDeneb object with a hasher
func (b *BlindedBeaconBlockAndBlobsDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'Block'
if err = b.Block.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'Blobs'
{
subIndx := hh.Index()
num := uint64(len(b.Blobs))
if num > 6 {
err = ssz.ErrIncorrectListSize
return
}
for _, elem := range b.Blobs {
if err = elem.HashTreeRootWith(hh); err != nil {
return
}
}
if ssz.EnableVectorizedHTR {
hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 6)
} else {
hh.MerkleizeWithMixin(subIndx, num, 6)
}
}
if ssz.EnableVectorizedHTR {
hh.MerkleizeVectorizedHTR(indx)
} else {
hh.Merkleize(indx)
}
return
}
// MarshalSSZ ssz marshals the SignedBlindedBeaconBlockDeneb object
func (s *SignedBlindedBeaconBlockDeneb) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(s)
@@ -14545,6 +15161,266 @@ func (s *SignedBlobSidecar) HashTreeRootWith(hh *ssz.Hasher) (err error) {
return
}
// MarshalSSZ ssz marshals the BlindedBlobSidecar object
func (b *BlindedBlobSidecar) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(b)
}
// MarshalSSZTo ssz marshals the BlindedBlobSidecar object to a target array
func (b *BlindedBlobSidecar) 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)
// Field (2) 'Slot'
dst = ssz.MarshalUint64(dst, uint64(b.Slot))
// Field (3) 'BlockParentRoot'
if size := len(b.BlockParentRoot); size != 32 {
err = ssz.ErrBytesLengthFn("--.BlockParentRoot", size, 32)
return
}
dst = append(dst, b.BlockParentRoot...)
// Field (4) 'ProposerIndex'
dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex))
// Field (5) 'BlobRoot'
if size := len(b.BlobRoot); size != 32 {
err = ssz.ErrBytesLengthFn("--.BlobRoot", size, 32)
return
}
dst = append(dst, b.BlobRoot...)
// Field (6) 'KzgCommitment'
if size := len(b.KzgCommitment); size != 48 {
err = ssz.ErrBytesLengthFn("--.KzgCommitment", size, 48)
return
}
dst = append(dst, b.KzgCommitment...)
// Field (7) 'KzgProof'
if size := len(b.KzgProof); size != 48 {
err = ssz.ErrBytesLengthFn("--.KzgProof", size, 48)
return
}
dst = append(dst, b.KzgProof...)
return
}
// UnmarshalSSZ ssz unmarshals the BlindedBlobSidecar object
func (b *BlindedBlobSidecar) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size != 216 {
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])
// Field (2) 'Slot'
b.Slot = github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48]))
// Field (3) 'BlockParentRoot'
if cap(b.BlockParentRoot) == 0 {
b.BlockParentRoot = make([]byte, 0, len(buf[48:80]))
}
b.BlockParentRoot = append(b.BlockParentRoot, buf[48:80]...)
// Field (4) 'ProposerIndex'
b.ProposerIndex = github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[80:88]))
// Field (5) 'BlobRoot'
if cap(b.BlobRoot) == 0 {
b.BlobRoot = make([]byte, 0, len(buf[88:120]))
}
b.BlobRoot = append(b.BlobRoot, buf[88:120]...)
// Field (6) 'KzgCommitment'
if cap(b.KzgCommitment) == 0 {
b.KzgCommitment = make([]byte, 0, len(buf[120:168]))
}
b.KzgCommitment = append(b.KzgCommitment, buf[120:168]...)
// Field (7) 'KzgProof'
if cap(b.KzgProof) == 0 {
b.KzgProof = make([]byte, 0, len(buf[168:216]))
}
b.KzgProof = append(b.KzgProof, buf[168:216]...)
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the BlindedBlobSidecar object
func (b *BlindedBlobSidecar) SizeSSZ() (size int) {
size = 216
return
}
// HashTreeRoot ssz hashes the BlindedBlobSidecar object
func (b *BlindedBlobSidecar) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(b)
}
// HashTreeRootWith ssz hashes the BlindedBlobSidecar object with a hasher
func (b *BlindedBlobSidecar) 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)
// Field (2) 'Slot'
hh.PutUint64(uint64(b.Slot))
// Field (3) 'BlockParentRoot'
if size := len(b.BlockParentRoot); size != 32 {
err = ssz.ErrBytesLengthFn("--.BlockParentRoot", size, 32)
return
}
hh.PutBytes(b.BlockParentRoot)
// Field (4) 'ProposerIndex'
hh.PutUint64(uint64(b.ProposerIndex))
// Field (5) 'BlobRoot'
if size := len(b.BlobRoot); size != 32 {
err = ssz.ErrBytesLengthFn("--.BlobRoot", size, 32)
return
}
hh.PutBytes(b.BlobRoot)
// Field (6) 'KzgCommitment'
if size := len(b.KzgCommitment); size != 48 {
err = ssz.ErrBytesLengthFn("--.KzgCommitment", size, 48)
return
}
hh.PutBytes(b.KzgCommitment)
// Field (7) 'KzgProof'
if size := len(b.KzgProof); size != 48 {
err = ssz.ErrBytesLengthFn("--.KzgProof", size, 48)
return
}
hh.PutBytes(b.KzgProof)
if ssz.EnableVectorizedHTR {
hh.MerkleizeVectorizedHTR(indx)
} else {
hh.Merkleize(indx)
}
return
}
// MarshalSSZ ssz marshals the SignedBlindedBlobSidecar object
func (s *SignedBlindedBlobSidecar) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(s)
}
// MarshalSSZTo ssz marshals the SignedBlindedBlobSidecar object to a target array
func (s *SignedBlindedBlobSidecar) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
// Field (0) 'Message'
if s.Message == nil {
s.Message = new(BlindedBlobSidecar)
}
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 SignedBlindedBlobSidecar object
func (s *SignedBlindedBlobSidecar) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size != 312 {
return ssz.ErrSize
}
// Field (0) 'Message'
if s.Message == nil {
s.Message = new(BlindedBlobSidecar)
}
if err = s.Message.UnmarshalSSZ(buf[0:216]); err != nil {
return err
}
// Field (1) 'Signature'
if cap(s.Signature) == 0 {
s.Signature = make([]byte, 0, len(buf[216:312]))
}
s.Signature = append(s.Signature, buf[216:312]...)
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the SignedBlindedBlobSidecar object
func (s *SignedBlindedBlobSidecar) SizeSSZ() (size int) {
size = 312
return
}
// HashTreeRoot ssz hashes the SignedBlindedBlobSidecar object
func (s *SignedBlindedBlobSidecar) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(s)
}
// HashTreeRootWith ssz hashes the SignedBlindedBlobSidecar object with a hasher
func (s *SignedBlindedBlobSidecar) 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)
if ssz.EnableVectorizedHTR {
hh.MerkleizeVectorizedHTR(indx)
} else {
hh.Merkleize(indx)
}
return
}
// MarshalSSZ ssz marshals the BlobIdentifier object
func (b *BlobIdentifier) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(b)