Light Client consensus types (#14518)

* protos/SSZ

* interfaces

* types

* cleanup/dedup

* changelog

* use createBranch in headers

* error handling

---------

Co-authored-by: rkapka <radoslaw.kapka@gmail.com>
This commit is contained in:
Bastin
2024-10-08 19:07:56 +02:00
committed by GitHub
parent cfbfccb203
commit 7fc5c714a1
21 changed files with 5564 additions and 14 deletions

View File

@@ -81,6 +81,11 @@ ssz_altair_objs = [
"BeaconBlockBodyAltair",
"BeaconStateAltair",
"ContributionAndProof",
"LightClientBootstrapAltair",
"LightClientFinalityUpdateAltair",
"LightClientHeaderAltair",
"LightClientOptimisticUpdateAltair",
"LightClientUpdateAltair",
"SignedBeaconBlockAltair",
"SignedContributionAndProof",
"SyncAggregate",
@@ -110,6 +115,11 @@ ssz_capella_objs = [
"BlindedBeaconBlockCapella",
"BuilderBidCapella",
"HistoricalSummary",
"LightClientBootstrapCapella",
"LightClientFinalityUpdateCapella",
"LightClientHeaderCapella",
"LightClientOptimisticUpdateCapella",
"LightClientUpdateCapella",
"SignedBLSToExecutionChange",
"SignedBeaconBlockCapella",
"SignedBlindedBeaconBlockCapella",
@@ -127,6 +137,11 @@ ssz_deneb_objs = [
"BlobSidecar",
"BlobSidecars",
"BuilderBidDeneb",
"LightClientBootstrapDeneb",
"LightClientFinalityUpdateDeneb",
"LightClientHeaderDeneb",
"LightClientOptimisticUpdateDeneb",
"LightClientUpdateDeneb",
"SignedBeaconBlockContentsDeneb",
"SignedBeaconBlockDeneb",
"SignedBlindedBeaconBlockDeneb",
@@ -334,6 +349,7 @@ ssz_proto_files(
"beacon_block.proto",
"beacon_state.proto",
"blobs.proto",
"light_client.proto",
"sync_committee.proto",
"withdrawals.proto",
],

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT.
// Hash: bb838fc0c2dfdadd4a8274dd1b438b1051f7b84d7c8e7470900621284dba8f43
// Hash: 54ff8b768faa21e2d838e9f6be78af4dfeb76d3d46b32072c09faa16bd2393ea
package eth
import (
@@ -1747,6 +1747,651 @@ func (s *SyncAggregatorSelectionData) HashTreeRootWith(hh *ssz.Hasher) (err erro
return
}
// MarshalSSZ ssz marshals the LightClientHeaderAltair object
func (l *LightClientHeaderAltair) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(l)
}
// MarshalSSZTo ssz marshals the LightClientHeaderAltair object to a target array
func (l *LightClientHeaderAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
// Field (0) 'Beacon'
if l.Beacon == nil {
l.Beacon = new(BeaconBlockHeader)
}
if dst, err = l.Beacon.MarshalSSZTo(dst); err != nil {
return
}
return
}
// UnmarshalSSZ ssz unmarshals the LightClientHeaderAltair object
func (l *LightClientHeaderAltair) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size != 112 {
return ssz.ErrSize
}
// Field (0) 'Beacon'
if l.Beacon == nil {
l.Beacon = new(BeaconBlockHeader)
}
if err = l.Beacon.UnmarshalSSZ(buf[0:112]); err != nil {
return err
}
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the LightClientHeaderAltair object
func (l *LightClientHeaderAltair) SizeSSZ() (size int) {
size = 112
return
}
// HashTreeRoot ssz hashes the LightClientHeaderAltair object
func (l *LightClientHeaderAltair) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(l)
}
// HashTreeRootWith ssz hashes the LightClientHeaderAltair object with a hasher
func (l *LightClientHeaderAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'Beacon'
if err = l.Beacon.HashTreeRootWith(hh); err != nil {
return
}
hh.Merkleize(indx)
return
}
// MarshalSSZ ssz marshals the LightClientBootstrapAltair object
func (l *LightClientBootstrapAltair) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(l)
}
// MarshalSSZTo ssz marshals the LightClientBootstrapAltair object to a target array
func (l *LightClientBootstrapAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
// Field (0) 'Header'
if l.Header == nil {
l.Header = new(LightClientHeaderAltair)
}
if dst, err = l.Header.MarshalSSZTo(dst); err != nil {
return
}
// Field (1) 'CurrentSyncCommittee'
if l.CurrentSyncCommittee == nil {
l.CurrentSyncCommittee = new(SyncCommittee)
}
if dst, err = l.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil {
return
}
// Field (2) 'CurrentSyncCommitteeBranch'
if size := len(l.CurrentSyncCommitteeBranch); size != 5 {
err = ssz.ErrVectorLengthFn("--.CurrentSyncCommitteeBranch", size, 5)
return
}
for ii := 0; ii < 5; ii++ {
if size := len(l.CurrentSyncCommitteeBranch[ii]); size != 32 {
err = ssz.ErrBytesLengthFn("--.CurrentSyncCommitteeBranch[ii]", size, 32)
return
}
dst = append(dst, l.CurrentSyncCommitteeBranch[ii]...)
}
return
}
// UnmarshalSSZ ssz unmarshals the LightClientBootstrapAltair object
func (l *LightClientBootstrapAltair) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size != 24896 {
return ssz.ErrSize
}
// Field (0) 'Header'
if l.Header == nil {
l.Header = new(LightClientHeaderAltair)
}
if err = l.Header.UnmarshalSSZ(buf[0:112]); err != nil {
return err
}
// Field (1) 'CurrentSyncCommittee'
if l.CurrentSyncCommittee == nil {
l.CurrentSyncCommittee = new(SyncCommittee)
}
if err = l.CurrentSyncCommittee.UnmarshalSSZ(buf[112:24736]); err != nil {
return err
}
// Field (2) 'CurrentSyncCommitteeBranch'
l.CurrentSyncCommitteeBranch = make([][]byte, 5)
for ii := 0; ii < 5; ii++ {
if cap(l.CurrentSyncCommitteeBranch[ii]) == 0 {
l.CurrentSyncCommitteeBranch[ii] = make([]byte, 0, len(buf[24736:24896][ii*32:(ii+1)*32]))
}
l.CurrentSyncCommitteeBranch[ii] = append(l.CurrentSyncCommitteeBranch[ii], buf[24736:24896][ii*32:(ii+1)*32]...)
}
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the LightClientBootstrapAltair object
func (l *LightClientBootstrapAltair) SizeSSZ() (size int) {
size = 24896
return
}
// HashTreeRoot ssz hashes the LightClientBootstrapAltair object
func (l *LightClientBootstrapAltair) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(l)
}
// HashTreeRootWith ssz hashes the LightClientBootstrapAltair object with a hasher
func (l *LightClientBootstrapAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'Header'
if err = l.Header.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'CurrentSyncCommittee'
if err = l.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil {
return
}
// Field (2) 'CurrentSyncCommitteeBranch'
{
if size := len(l.CurrentSyncCommitteeBranch); size != 5 {
err = ssz.ErrVectorLengthFn("--.CurrentSyncCommitteeBranch", size, 5)
return
}
subIndx := hh.Index()
for _, i := range l.CurrentSyncCommitteeBranch {
if len(i) != 32 {
err = ssz.ErrBytesLength
return
}
hh.Append(i)
}
hh.Merkleize(subIndx)
}
hh.Merkleize(indx)
return
}
// MarshalSSZ ssz marshals the LightClientUpdateAltair object
func (l *LightClientUpdateAltair) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(l)
}
// MarshalSSZTo ssz marshals the LightClientUpdateAltair object to a target array
func (l *LightClientUpdateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
// Field (0) 'AttestedHeader'
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderAltair)
}
if dst, err = l.AttestedHeader.MarshalSSZTo(dst); err != nil {
return
}
// Field (1) 'NextSyncCommittee'
if l.NextSyncCommittee == nil {
l.NextSyncCommittee = new(SyncCommittee)
}
if dst, err = l.NextSyncCommittee.MarshalSSZTo(dst); err != nil {
return
}
// Field (2) 'NextSyncCommitteeBranch'
if size := len(l.NextSyncCommitteeBranch); size != 5 {
err = ssz.ErrVectorLengthFn("--.NextSyncCommitteeBranch", size, 5)
return
}
for ii := 0; ii < 5; ii++ {
if size := len(l.NextSyncCommitteeBranch[ii]); size != 32 {
err = ssz.ErrBytesLengthFn("--.NextSyncCommitteeBranch[ii]", size, 32)
return
}
dst = append(dst, l.NextSyncCommitteeBranch[ii]...)
}
// Field (3) 'FinalizedHeader'
if l.FinalizedHeader == nil {
l.FinalizedHeader = new(LightClientHeaderAltair)
}
if dst, err = l.FinalizedHeader.MarshalSSZTo(dst); err != nil {
return
}
// Field (4) 'FinalityBranch'
if size := len(l.FinalityBranch); size != 6 {
err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6)
return
}
for ii := 0; ii < 6; ii++ {
if size := len(l.FinalityBranch[ii]); size != 32 {
err = ssz.ErrBytesLengthFn("--.FinalityBranch[ii]", size, 32)
return
}
dst = append(dst, l.FinalityBranch[ii]...)
}
// Field (5) 'SyncAggregate'
if l.SyncAggregate == nil {
l.SyncAggregate = new(SyncAggregate)
}
if dst, err = l.SyncAggregate.MarshalSSZTo(dst); err != nil {
return
}
// Field (6) 'SignatureSlot'
dst = ssz.MarshalUint64(dst, uint64(l.SignatureSlot))
return
}
// UnmarshalSSZ ssz unmarshals the LightClientUpdateAltair object
func (l *LightClientUpdateAltair) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size != 25368 {
return ssz.ErrSize
}
// Field (0) 'AttestedHeader'
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderAltair)
}
if err = l.AttestedHeader.UnmarshalSSZ(buf[0:112]); err != nil {
return err
}
// Field (1) 'NextSyncCommittee'
if l.NextSyncCommittee == nil {
l.NextSyncCommittee = new(SyncCommittee)
}
if err = l.NextSyncCommittee.UnmarshalSSZ(buf[112:24736]); err != nil {
return err
}
// Field (2) 'NextSyncCommitteeBranch'
l.NextSyncCommitteeBranch = make([][]byte, 5)
for ii := 0; ii < 5; ii++ {
if cap(l.NextSyncCommitteeBranch[ii]) == 0 {
l.NextSyncCommitteeBranch[ii] = make([]byte, 0, len(buf[24736:24896][ii*32:(ii+1)*32]))
}
l.NextSyncCommitteeBranch[ii] = append(l.NextSyncCommitteeBranch[ii], buf[24736:24896][ii*32:(ii+1)*32]...)
}
// Field (3) 'FinalizedHeader'
if l.FinalizedHeader == nil {
l.FinalizedHeader = new(LightClientHeaderAltair)
}
if err = l.FinalizedHeader.UnmarshalSSZ(buf[24896:25008]); err != nil {
return err
}
// Field (4) 'FinalityBranch'
l.FinalityBranch = make([][]byte, 6)
for ii := 0; ii < 6; ii++ {
if cap(l.FinalityBranch[ii]) == 0 {
l.FinalityBranch[ii] = make([]byte, 0, len(buf[25008:25200][ii*32:(ii+1)*32]))
}
l.FinalityBranch[ii] = append(l.FinalityBranch[ii], buf[25008:25200][ii*32:(ii+1)*32]...)
}
// Field (5) 'SyncAggregate'
if l.SyncAggregate == nil {
l.SyncAggregate = new(SyncAggregate)
}
if err = l.SyncAggregate.UnmarshalSSZ(buf[25200:25360]); err != nil {
return err
}
// Field (6) 'SignatureSlot'
l.SignatureSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[25360:25368]))
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the LightClientUpdateAltair object
func (l *LightClientUpdateAltair) SizeSSZ() (size int) {
size = 25368
return
}
// HashTreeRoot ssz hashes the LightClientUpdateAltair object
func (l *LightClientUpdateAltair) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(l)
}
// HashTreeRootWith ssz hashes the LightClientUpdateAltair object with a hasher
func (l *LightClientUpdateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'AttestedHeader'
if err = l.AttestedHeader.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'NextSyncCommittee'
if err = l.NextSyncCommittee.HashTreeRootWith(hh); err != nil {
return
}
// Field (2) 'NextSyncCommitteeBranch'
{
if size := len(l.NextSyncCommitteeBranch); size != 5 {
err = ssz.ErrVectorLengthFn("--.NextSyncCommitteeBranch", size, 5)
return
}
subIndx := hh.Index()
for _, i := range l.NextSyncCommitteeBranch {
if len(i) != 32 {
err = ssz.ErrBytesLength
return
}
hh.Append(i)
}
hh.Merkleize(subIndx)
}
// Field (3) 'FinalizedHeader'
if err = l.FinalizedHeader.HashTreeRootWith(hh); err != nil {
return
}
// Field (4) 'FinalityBranch'
{
if size := len(l.FinalityBranch); size != 6 {
err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6)
return
}
subIndx := hh.Index()
for _, i := range l.FinalityBranch {
if len(i) != 32 {
err = ssz.ErrBytesLength
return
}
hh.Append(i)
}
hh.Merkleize(subIndx)
}
// Field (5) 'SyncAggregate'
if err = l.SyncAggregate.HashTreeRootWith(hh); err != nil {
return
}
// Field (6) 'SignatureSlot'
hh.PutUint64(uint64(l.SignatureSlot))
hh.Merkleize(indx)
return
}
// MarshalSSZ ssz marshals the LightClientFinalityUpdateAltair object
func (l *LightClientFinalityUpdateAltair) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(l)
}
// MarshalSSZTo ssz marshals the LightClientFinalityUpdateAltair object to a target array
func (l *LightClientFinalityUpdateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
// Field (0) 'AttestedHeader'
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderAltair)
}
if dst, err = l.AttestedHeader.MarshalSSZTo(dst); err != nil {
return
}
// Field (1) 'FinalizedHeader'
if l.FinalizedHeader == nil {
l.FinalizedHeader = new(LightClientHeaderAltair)
}
if dst, err = l.FinalizedHeader.MarshalSSZTo(dst); err != nil {
return
}
// Field (2) 'FinalityBranch'
if size := len(l.FinalityBranch); size != 6 {
err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6)
return
}
for ii := 0; ii < 6; ii++ {
if size := len(l.FinalityBranch[ii]); size != 32 {
err = ssz.ErrBytesLengthFn("--.FinalityBranch[ii]", size, 32)
return
}
dst = append(dst, l.FinalityBranch[ii]...)
}
// Field (3) 'SyncAggregate'
if l.SyncAggregate == nil {
l.SyncAggregate = new(SyncAggregate)
}
if dst, err = l.SyncAggregate.MarshalSSZTo(dst); err != nil {
return
}
// Field (4) 'SignatureSlot'
dst = ssz.MarshalUint64(dst, uint64(l.SignatureSlot))
return
}
// UnmarshalSSZ ssz unmarshals the LightClientFinalityUpdateAltair object
func (l *LightClientFinalityUpdateAltair) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size != 584 {
return ssz.ErrSize
}
// Field (0) 'AttestedHeader'
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderAltair)
}
if err = l.AttestedHeader.UnmarshalSSZ(buf[0:112]); err != nil {
return err
}
// Field (1) 'FinalizedHeader'
if l.FinalizedHeader == nil {
l.FinalizedHeader = new(LightClientHeaderAltair)
}
if err = l.FinalizedHeader.UnmarshalSSZ(buf[112:224]); err != nil {
return err
}
// Field (2) 'FinalityBranch'
l.FinalityBranch = make([][]byte, 6)
for ii := 0; ii < 6; ii++ {
if cap(l.FinalityBranch[ii]) == 0 {
l.FinalityBranch[ii] = make([]byte, 0, len(buf[224:416][ii*32:(ii+1)*32]))
}
l.FinalityBranch[ii] = append(l.FinalityBranch[ii], buf[224:416][ii*32:(ii+1)*32]...)
}
// Field (3) 'SyncAggregate'
if l.SyncAggregate == nil {
l.SyncAggregate = new(SyncAggregate)
}
if err = l.SyncAggregate.UnmarshalSSZ(buf[416:576]); err != nil {
return err
}
// Field (4) 'SignatureSlot'
l.SignatureSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[576:584]))
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the LightClientFinalityUpdateAltair object
func (l *LightClientFinalityUpdateAltair) SizeSSZ() (size int) {
size = 584
return
}
// HashTreeRoot ssz hashes the LightClientFinalityUpdateAltair object
func (l *LightClientFinalityUpdateAltair) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(l)
}
// HashTreeRootWith ssz hashes the LightClientFinalityUpdateAltair object with a hasher
func (l *LightClientFinalityUpdateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'AttestedHeader'
if err = l.AttestedHeader.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'FinalizedHeader'
if err = l.FinalizedHeader.HashTreeRootWith(hh); err != nil {
return
}
// Field (2) 'FinalityBranch'
{
if size := len(l.FinalityBranch); size != 6 {
err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6)
return
}
subIndx := hh.Index()
for _, i := range l.FinalityBranch {
if len(i) != 32 {
err = ssz.ErrBytesLength
return
}
hh.Append(i)
}
hh.Merkleize(subIndx)
}
// Field (3) 'SyncAggregate'
if err = l.SyncAggregate.HashTreeRootWith(hh); err != nil {
return
}
// Field (4) 'SignatureSlot'
hh.PutUint64(uint64(l.SignatureSlot))
hh.Merkleize(indx)
return
}
// MarshalSSZ ssz marshals the LightClientOptimisticUpdateAltair object
func (l *LightClientOptimisticUpdateAltair) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(l)
}
// MarshalSSZTo ssz marshals the LightClientOptimisticUpdateAltair object to a target array
func (l *LightClientOptimisticUpdateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
// Field (0) 'AttestedHeader'
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderAltair)
}
if dst, err = l.AttestedHeader.MarshalSSZTo(dst); err != nil {
return
}
// Field (1) 'SyncAggregate'
if l.SyncAggregate == nil {
l.SyncAggregate = new(SyncAggregate)
}
if dst, err = l.SyncAggregate.MarshalSSZTo(dst); err != nil {
return
}
// Field (2) 'SignatureSlot'
dst = ssz.MarshalUint64(dst, uint64(l.SignatureSlot))
return
}
// UnmarshalSSZ ssz unmarshals the LightClientOptimisticUpdateAltair object
func (l *LightClientOptimisticUpdateAltair) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size != 280 {
return ssz.ErrSize
}
// Field (0) 'AttestedHeader'
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderAltair)
}
if err = l.AttestedHeader.UnmarshalSSZ(buf[0:112]); err != nil {
return err
}
// Field (1) 'SyncAggregate'
if l.SyncAggregate == nil {
l.SyncAggregate = new(SyncAggregate)
}
if err = l.SyncAggregate.UnmarshalSSZ(buf[112:272]); err != nil {
return err
}
// Field (2) 'SignatureSlot'
l.SignatureSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[272:280]))
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the LightClientOptimisticUpdateAltair object
func (l *LightClientOptimisticUpdateAltair) SizeSSZ() (size int) {
size = 280
return
}
// HashTreeRoot ssz hashes the LightClientOptimisticUpdateAltair object
func (l *LightClientOptimisticUpdateAltair) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(l)
}
// HashTreeRootWith ssz hashes the LightClientOptimisticUpdateAltair object with a hasher
func (l *LightClientOptimisticUpdateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'AttestedHeader'
if err = l.AttestedHeader.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'SyncAggregate'
if err = l.SyncAggregate.HashTreeRootWith(hh); err != nil {
return
}
// Field (2) 'SignatureSlot'
hh.PutUint64(uint64(l.SignatureSlot))
hh.Merkleize(indx)
return
}
// MarshalSSZ ssz marshals the SyncCommitteeMessage object
func (s *SyncCommitteeMessage) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(s)

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT.
// Hash: a5507ef7d71897486989f37eb4dbb19fc2c49e7c47f244291a9f3122c9bfe546
// Hash: 7133c698cd96aab07bbef1347ea98e6ccbd2c5c30d1e7d0f32977b9a7335d9d3
package eth
import (
@@ -2729,6 +2729,877 @@ func (h *HistoricalSummary) HashTreeRootWith(hh *ssz.Hasher) (err error) {
return
}
// MarshalSSZ ssz marshals the LightClientHeaderCapella object
func (l *LightClientHeaderCapella) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(l)
}
// MarshalSSZTo ssz marshals the LightClientHeaderCapella object to a target array
func (l *LightClientHeaderCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
offset := int(244)
// Field (0) 'Beacon'
if l.Beacon == nil {
l.Beacon = new(BeaconBlockHeader)
}
if dst, err = l.Beacon.MarshalSSZTo(dst); err != nil {
return
}
// Offset (1) 'Execution'
dst = ssz.WriteOffset(dst, offset)
if l.Execution == nil {
l.Execution = new(v1.ExecutionPayloadHeaderCapella)
}
offset += l.Execution.SizeSSZ()
// Field (2) 'ExecutionBranch'
if size := len(l.ExecutionBranch); size != 4 {
err = ssz.ErrVectorLengthFn("--.ExecutionBranch", size, 4)
return
}
for ii := 0; ii < 4; ii++ {
if size := len(l.ExecutionBranch[ii]); size != 32 {
err = ssz.ErrBytesLengthFn("--.ExecutionBranch[ii]", size, 32)
return
}
dst = append(dst, l.ExecutionBranch[ii]...)
}
// Field (1) 'Execution'
if dst, err = l.Execution.MarshalSSZTo(dst); err != nil {
return
}
return
}
// UnmarshalSSZ ssz unmarshals the LightClientHeaderCapella object
func (l *LightClientHeaderCapella) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size < 244 {
return ssz.ErrSize
}
tail := buf
var o1 uint64
// Field (0) 'Beacon'
if l.Beacon == nil {
l.Beacon = new(BeaconBlockHeader)
}
if err = l.Beacon.UnmarshalSSZ(buf[0:112]); err != nil {
return err
}
// Offset (1) 'Execution'
if o1 = ssz.ReadOffset(buf[112:116]); o1 > size {
return ssz.ErrOffset
}
if o1 != 244 {
return ssz.ErrInvalidVariableOffset
}
// Field (2) 'ExecutionBranch'
l.ExecutionBranch = make([][]byte, 4)
for ii := 0; ii < 4; ii++ {
if cap(l.ExecutionBranch[ii]) == 0 {
l.ExecutionBranch[ii] = make([]byte, 0, len(buf[116:244][ii*32:(ii+1)*32]))
}
l.ExecutionBranch[ii] = append(l.ExecutionBranch[ii], buf[116:244][ii*32:(ii+1)*32]...)
}
// Field (1) 'Execution'
{
buf = tail[o1:]
if l.Execution == nil {
l.Execution = new(v1.ExecutionPayloadHeaderCapella)
}
if err = l.Execution.UnmarshalSSZ(buf); err != nil {
return err
}
}
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the LightClientHeaderCapella object
func (l *LightClientHeaderCapella) SizeSSZ() (size int) {
size = 244
// Field (1) 'Execution'
if l.Execution == nil {
l.Execution = new(v1.ExecutionPayloadHeaderCapella)
}
size += l.Execution.SizeSSZ()
return
}
// HashTreeRoot ssz hashes the LightClientHeaderCapella object
func (l *LightClientHeaderCapella) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(l)
}
// HashTreeRootWith ssz hashes the LightClientHeaderCapella object with a hasher
func (l *LightClientHeaderCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'Beacon'
if err = l.Beacon.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'Execution'
if err = l.Execution.HashTreeRootWith(hh); err != nil {
return
}
// Field (2) 'ExecutionBranch'
{
if size := len(l.ExecutionBranch); size != 4 {
err = ssz.ErrVectorLengthFn("--.ExecutionBranch", size, 4)
return
}
subIndx := hh.Index()
for _, i := range l.ExecutionBranch {
if len(i) != 32 {
err = ssz.ErrBytesLength
return
}
hh.Append(i)
}
hh.Merkleize(subIndx)
}
hh.Merkleize(indx)
return
}
// MarshalSSZ ssz marshals the LightClientBootstrapCapella object
func (l *LightClientBootstrapCapella) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(l)
}
// MarshalSSZTo ssz marshals the LightClientBootstrapCapella object to a target array
func (l *LightClientBootstrapCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
offset := int(24788)
// Offset (0) 'Header'
dst = ssz.WriteOffset(dst, offset)
if l.Header == nil {
l.Header = new(LightClientHeaderCapella)
}
offset += l.Header.SizeSSZ()
// Field (1) 'CurrentSyncCommittee'
if l.CurrentSyncCommittee == nil {
l.CurrentSyncCommittee = new(SyncCommittee)
}
if dst, err = l.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil {
return
}
// Field (2) 'CurrentSyncCommitteeBranch'
if size := len(l.CurrentSyncCommitteeBranch); size != 5 {
err = ssz.ErrVectorLengthFn("--.CurrentSyncCommitteeBranch", size, 5)
return
}
for ii := 0; ii < 5; ii++ {
if size := len(l.CurrentSyncCommitteeBranch[ii]); size != 32 {
err = ssz.ErrBytesLengthFn("--.CurrentSyncCommitteeBranch[ii]", size, 32)
return
}
dst = append(dst, l.CurrentSyncCommitteeBranch[ii]...)
}
// Field (0) 'Header'
if dst, err = l.Header.MarshalSSZTo(dst); err != nil {
return
}
return
}
// UnmarshalSSZ ssz unmarshals the LightClientBootstrapCapella object
func (l *LightClientBootstrapCapella) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size < 24788 {
return ssz.ErrSize
}
tail := buf
var o0 uint64
// Offset (0) 'Header'
if o0 = ssz.ReadOffset(buf[0:4]); o0 > size {
return ssz.ErrOffset
}
if o0 != 24788 {
return ssz.ErrInvalidVariableOffset
}
// Field (1) 'CurrentSyncCommittee'
if l.CurrentSyncCommittee == nil {
l.CurrentSyncCommittee = new(SyncCommittee)
}
if err = l.CurrentSyncCommittee.UnmarshalSSZ(buf[4:24628]); err != nil {
return err
}
// Field (2) 'CurrentSyncCommitteeBranch'
l.CurrentSyncCommitteeBranch = make([][]byte, 5)
for ii := 0; ii < 5; ii++ {
if cap(l.CurrentSyncCommitteeBranch[ii]) == 0 {
l.CurrentSyncCommitteeBranch[ii] = make([]byte, 0, len(buf[24628:24788][ii*32:(ii+1)*32]))
}
l.CurrentSyncCommitteeBranch[ii] = append(l.CurrentSyncCommitteeBranch[ii], buf[24628:24788][ii*32:(ii+1)*32]...)
}
// Field (0) 'Header'
{
buf = tail[o0:]
if l.Header == nil {
l.Header = new(LightClientHeaderCapella)
}
if err = l.Header.UnmarshalSSZ(buf); err != nil {
return err
}
}
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the LightClientBootstrapCapella object
func (l *LightClientBootstrapCapella) SizeSSZ() (size int) {
size = 24788
// Field (0) 'Header'
if l.Header == nil {
l.Header = new(LightClientHeaderCapella)
}
size += l.Header.SizeSSZ()
return
}
// HashTreeRoot ssz hashes the LightClientBootstrapCapella object
func (l *LightClientBootstrapCapella) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(l)
}
// HashTreeRootWith ssz hashes the LightClientBootstrapCapella object with a hasher
func (l *LightClientBootstrapCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'Header'
if err = l.Header.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'CurrentSyncCommittee'
if err = l.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil {
return
}
// Field (2) 'CurrentSyncCommitteeBranch'
{
if size := len(l.CurrentSyncCommitteeBranch); size != 5 {
err = ssz.ErrVectorLengthFn("--.CurrentSyncCommitteeBranch", size, 5)
return
}
subIndx := hh.Index()
for _, i := range l.CurrentSyncCommitteeBranch {
if len(i) != 32 {
err = ssz.ErrBytesLength
return
}
hh.Append(i)
}
hh.Merkleize(subIndx)
}
hh.Merkleize(indx)
return
}
// MarshalSSZ ssz marshals the LightClientUpdateCapella object
func (l *LightClientUpdateCapella) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(l)
}
// MarshalSSZTo ssz marshals the LightClientUpdateCapella object to a target array
func (l *LightClientUpdateCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
offset := int(25152)
// Offset (0) 'AttestedHeader'
dst = ssz.WriteOffset(dst, offset)
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderCapella)
}
offset += l.AttestedHeader.SizeSSZ()
// Field (1) 'NextSyncCommittee'
if l.NextSyncCommittee == nil {
l.NextSyncCommittee = new(SyncCommittee)
}
if dst, err = l.NextSyncCommittee.MarshalSSZTo(dst); err != nil {
return
}
// Field (2) 'NextSyncCommitteeBranch'
if size := len(l.NextSyncCommitteeBranch); size != 5 {
err = ssz.ErrVectorLengthFn("--.NextSyncCommitteeBranch", size, 5)
return
}
for ii := 0; ii < 5; ii++ {
if size := len(l.NextSyncCommitteeBranch[ii]); size != 32 {
err = ssz.ErrBytesLengthFn("--.NextSyncCommitteeBranch[ii]", size, 32)
return
}
dst = append(dst, l.NextSyncCommitteeBranch[ii]...)
}
// Offset (3) 'FinalizedHeader'
dst = ssz.WriteOffset(dst, offset)
if l.FinalizedHeader == nil {
l.FinalizedHeader = new(LightClientHeaderCapella)
}
offset += l.FinalizedHeader.SizeSSZ()
// Field (4) 'FinalityBranch'
if size := len(l.FinalityBranch); size != 6 {
err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6)
return
}
for ii := 0; ii < 6; ii++ {
if size := len(l.FinalityBranch[ii]); size != 32 {
err = ssz.ErrBytesLengthFn("--.FinalityBranch[ii]", size, 32)
return
}
dst = append(dst, l.FinalityBranch[ii]...)
}
// Field (5) 'SyncAggregate'
if l.SyncAggregate == nil {
l.SyncAggregate = new(SyncAggregate)
}
if dst, err = l.SyncAggregate.MarshalSSZTo(dst); err != nil {
return
}
// Field (6) 'SignatureSlot'
dst = ssz.MarshalUint64(dst, uint64(l.SignatureSlot))
// Field (0) 'AttestedHeader'
if dst, err = l.AttestedHeader.MarshalSSZTo(dst); err != nil {
return
}
// Field (3) 'FinalizedHeader'
if dst, err = l.FinalizedHeader.MarshalSSZTo(dst); err != nil {
return
}
return
}
// UnmarshalSSZ ssz unmarshals the LightClientUpdateCapella object
func (l *LightClientUpdateCapella) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size < 25152 {
return ssz.ErrSize
}
tail := buf
var o0, o3 uint64
// Offset (0) 'AttestedHeader'
if o0 = ssz.ReadOffset(buf[0:4]); o0 > size {
return ssz.ErrOffset
}
if o0 != 25152 {
return ssz.ErrInvalidVariableOffset
}
// Field (1) 'NextSyncCommittee'
if l.NextSyncCommittee == nil {
l.NextSyncCommittee = new(SyncCommittee)
}
if err = l.NextSyncCommittee.UnmarshalSSZ(buf[4:24628]); err != nil {
return err
}
// Field (2) 'NextSyncCommitteeBranch'
l.NextSyncCommitteeBranch = make([][]byte, 5)
for ii := 0; ii < 5; ii++ {
if cap(l.NextSyncCommitteeBranch[ii]) == 0 {
l.NextSyncCommitteeBranch[ii] = make([]byte, 0, len(buf[24628:24788][ii*32:(ii+1)*32]))
}
l.NextSyncCommitteeBranch[ii] = append(l.NextSyncCommitteeBranch[ii], buf[24628:24788][ii*32:(ii+1)*32]...)
}
// Offset (3) 'FinalizedHeader'
if o3 = ssz.ReadOffset(buf[24788:24792]); o3 > size || o0 > o3 {
return ssz.ErrOffset
}
// Field (4) 'FinalityBranch'
l.FinalityBranch = make([][]byte, 6)
for ii := 0; ii < 6; ii++ {
if cap(l.FinalityBranch[ii]) == 0 {
l.FinalityBranch[ii] = make([]byte, 0, len(buf[24792:24984][ii*32:(ii+1)*32]))
}
l.FinalityBranch[ii] = append(l.FinalityBranch[ii], buf[24792:24984][ii*32:(ii+1)*32]...)
}
// Field (5) 'SyncAggregate'
if l.SyncAggregate == nil {
l.SyncAggregate = new(SyncAggregate)
}
if err = l.SyncAggregate.UnmarshalSSZ(buf[24984:25144]); err != nil {
return err
}
// Field (6) 'SignatureSlot'
l.SignatureSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[25144:25152]))
// Field (0) 'AttestedHeader'
{
buf = tail[o0:o3]
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderCapella)
}
if err = l.AttestedHeader.UnmarshalSSZ(buf); err != nil {
return err
}
}
// Field (3) 'FinalizedHeader'
{
buf = tail[o3:]
if l.FinalizedHeader == nil {
l.FinalizedHeader = new(LightClientHeaderCapella)
}
if err = l.FinalizedHeader.UnmarshalSSZ(buf); err != nil {
return err
}
}
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the LightClientUpdateCapella object
func (l *LightClientUpdateCapella) SizeSSZ() (size int) {
size = 25152
// Field (0) 'AttestedHeader'
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderCapella)
}
size += l.AttestedHeader.SizeSSZ()
// Field (3) 'FinalizedHeader'
if l.FinalizedHeader == nil {
l.FinalizedHeader = new(LightClientHeaderCapella)
}
size += l.FinalizedHeader.SizeSSZ()
return
}
// HashTreeRoot ssz hashes the LightClientUpdateCapella object
func (l *LightClientUpdateCapella) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(l)
}
// HashTreeRootWith ssz hashes the LightClientUpdateCapella object with a hasher
func (l *LightClientUpdateCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'AttestedHeader'
if err = l.AttestedHeader.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'NextSyncCommittee'
if err = l.NextSyncCommittee.HashTreeRootWith(hh); err != nil {
return
}
// Field (2) 'NextSyncCommitteeBranch'
{
if size := len(l.NextSyncCommitteeBranch); size != 5 {
err = ssz.ErrVectorLengthFn("--.NextSyncCommitteeBranch", size, 5)
return
}
subIndx := hh.Index()
for _, i := range l.NextSyncCommitteeBranch {
if len(i) != 32 {
err = ssz.ErrBytesLength
return
}
hh.Append(i)
}
hh.Merkleize(subIndx)
}
// Field (3) 'FinalizedHeader'
if err = l.FinalizedHeader.HashTreeRootWith(hh); err != nil {
return
}
// Field (4) 'FinalityBranch'
{
if size := len(l.FinalityBranch); size != 6 {
err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6)
return
}
subIndx := hh.Index()
for _, i := range l.FinalityBranch {
if len(i) != 32 {
err = ssz.ErrBytesLength
return
}
hh.Append(i)
}
hh.Merkleize(subIndx)
}
// Field (5) 'SyncAggregate'
if err = l.SyncAggregate.HashTreeRootWith(hh); err != nil {
return
}
// Field (6) 'SignatureSlot'
hh.PutUint64(uint64(l.SignatureSlot))
hh.Merkleize(indx)
return
}
// MarshalSSZ ssz marshals the LightClientFinalityUpdateCapella object
func (l *LightClientFinalityUpdateCapella) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(l)
}
// MarshalSSZTo ssz marshals the LightClientFinalityUpdateCapella object to a target array
func (l *LightClientFinalityUpdateCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
offset := int(368)
// Offset (0) 'AttestedHeader'
dst = ssz.WriteOffset(dst, offset)
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderCapella)
}
offset += l.AttestedHeader.SizeSSZ()
// Offset (1) 'FinalizedHeader'
dst = ssz.WriteOffset(dst, offset)
if l.FinalizedHeader == nil {
l.FinalizedHeader = new(LightClientHeaderCapella)
}
offset += l.FinalizedHeader.SizeSSZ()
// Field (2) 'FinalityBranch'
if size := len(l.FinalityBranch); size != 6 {
err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6)
return
}
for ii := 0; ii < 6; ii++ {
if size := len(l.FinalityBranch[ii]); size != 32 {
err = ssz.ErrBytesLengthFn("--.FinalityBranch[ii]", size, 32)
return
}
dst = append(dst, l.FinalityBranch[ii]...)
}
// Field (3) 'SyncAggregate'
if l.SyncAggregate == nil {
l.SyncAggregate = new(SyncAggregate)
}
if dst, err = l.SyncAggregate.MarshalSSZTo(dst); err != nil {
return
}
// Field (4) 'SignatureSlot'
dst = ssz.MarshalUint64(dst, uint64(l.SignatureSlot))
// Field (0) 'AttestedHeader'
if dst, err = l.AttestedHeader.MarshalSSZTo(dst); err != nil {
return
}
// Field (1) 'FinalizedHeader'
if dst, err = l.FinalizedHeader.MarshalSSZTo(dst); err != nil {
return
}
return
}
// UnmarshalSSZ ssz unmarshals the LightClientFinalityUpdateCapella object
func (l *LightClientFinalityUpdateCapella) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size < 368 {
return ssz.ErrSize
}
tail := buf
var o0, o1 uint64
// Offset (0) 'AttestedHeader'
if o0 = ssz.ReadOffset(buf[0:4]); o0 > size {
return ssz.ErrOffset
}
if o0 != 368 {
return ssz.ErrInvalidVariableOffset
}
// Offset (1) 'FinalizedHeader'
if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 {
return ssz.ErrOffset
}
// Field (2) 'FinalityBranch'
l.FinalityBranch = make([][]byte, 6)
for ii := 0; ii < 6; ii++ {
if cap(l.FinalityBranch[ii]) == 0 {
l.FinalityBranch[ii] = make([]byte, 0, len(buf[8:200][ii*32:(ii+1)*32]))
}
l.FinalityBranch[ii] = append(l.FinalityBranch[ii], buf[8:200][ii*32:(ii+1)*32]...)
}
// Field (3) 'SyncAggregate'
if l.SyncAggregate == nil {
l.SyncAggregate = new(SyncAggregate)
}
if err = l.SyncAggregate.UnmarshalSSZ(buf[200:360]); err != nil {
return err
}
// Field (4) 'SignatureSlot'
l.SignatureSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[360:368]))
// Field (0) 'AttestedHeader'
{
buf = tail[o0:o1]
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderCapella)
}
if err = l.AttestedHeader.UnmarshalSSZ(buf); err != nil {
return err
}
}
// Field (1) 'FinalizedHeader'
{
buf = tail[o1:]
if l.FinalizedHeader == nil {
l.FinalizedHeader = new(LightClientHeaderCapella)
}
if err = l.FinalizedHeader.UnmarshalSSZ(buf); err != nil {
return err
}
}
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the LightClientFinalityUpdateCapella object
func (l *LightClientFinalityUpdateCapella) SizeSSZ() (size int) {
size = 368
// Field (0) 'AttestedHeader'
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderCapella)
}
size += l.AttestedHeader.SizeSSZ()
// Field (1) 'FinalizedHeader'
if l.FinalizedHeader == nil {
l.FinalizedHeader = new(LightClientHeaderCapella)
}
size += l.FinalizedHeader.SizeSSZ()
return
}
// HashTreeRoot ssz hashes the LightClientFinalityUpdateCapella object
func (l *LightClientFinalityUpdateCapella) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(l)
}
// HashTreeRootWith ssz hashes the LightClientFinalityUpdateCapella object with a hasher
func (l *LightClientFinalityUpdateCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'AttestedHeader'
if err = l.AttestedHeader.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'FinalizedHeader'
if err = l.FinalizedHeader.HashTreeRootWith(hh); err != nil {
return
}
// Field (2) 'FinalityBranch'
{
if size := len(l.FinalityBranch); size != 6 {
err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6)
return
}
subIndx := hh.Index()
for _, i := range l.FinalityBranch {
if len(i) != 32 {
err = ssz.ErrBytesLength
return
}
hh.Append(i)
}
hh.Merkleize(subIndx)
}
// Field (3) 'SyncAggregate'
if err = l.SyncAggregate.HashTreeRootWith(hh); err != nil {
return
}
// Field (4) 'SignatureSlot'
hh.PutUint64(uint64(l.SignatureSlot))
hh.Merkleize(indx)
return
}
// MarshalSSZ ssz marshals the LightClientOptimisticUpdateCapella object
func (l *LightClientOptimisticUpdateCapella) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(l)
}
// MarshalSSZTo ssz marshals the LightClientOptimisticUpdateCapella object to a target array
func (l *LightClientOptimisticUpdateCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
offset := int(172)
// Offset (0) 'AttestedHeader'
dst = ssz.WriteOffset(dst, offset)
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderCapella)
}
offset += l.AttestedHeader.SizeSSZ()
// Field (1) 'SyncAggregate'
if l.SyncAggregate == nil {
l.SyncAggregate = new(SyncAggregate)
}
if dst, err = l.SyncAggregate.MarshalSSZTo(dst); err != nil {
return
}
// Field (2) 'SignatureSlot'
dst = ssz.MarshalUint64(dst, uint64(l.SignatureSlot))
// Field (0) 'AttestedHeader'
if dst, err = l.AttestedHeader.MarshalSSZTo(dst); err != nil {
return
}
return
}
// UnmarshalSSZ ssz unmarshals the LightClientOptimisticUpdateCapella object
func (l *LightClientOptimisticUpdateCapella) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size < 172 {
return ssz.ErrSize
}
tail := buf
var o0 uint64
// Offset (0) 'AttestedHeader'
if o0 = ssz.ReadOffset(buf[0:4]); o0 > size {
return ssz.ErrOffset
}
if o0 != 172 {
return ssz.ErrInvalidVariableOffset
}
// Field (1) 'SyncAggregate'
if l.SyncAggregate == nil {
l.SyncAggregate = new(SyncAggregate)
}
if err = l.SyncAggregate.UnmarshalSSZ(buf[4:164]); err != nil {
return err
}
// Field (2) 'SignatureSlot'
l.SignatureSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[164:172]))
// Field (0) 'AttestedHeader'
{
buf = tail[o0:]
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderCapella)
}
if err = l.AttestedHeader.UnmarshalSSZ(buf); err != nil {
return err
}
}
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the LightClientOptimisticUpdateCapella object
func (l *LightClientOptimisticUpdateCapella) SizeSSZ() (size int) {
size = 172
// Field (0) 'AttestedHeader'
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderCapella)
}
size += l.AttestedHeader.SizeSSZ()
return
}
// HashTreeRoot ssz hashes the LightClientOptimisticUpdateCapella object
func (l *LightClientOptimisticUpdateCapella) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(l)
}
// HashTreeRootWith ssz hashes the LightClientOptimisticUpdateCapella object with a hasher
func (l *LightClientOptimisticUpdateCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'AttestedHeader'
if err = l.AttestedHeader.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'SyncAggregate'
if err = l.SyncAggregate.HashTreeRootWith(hh); err != nil {
return
}
// Field (2) 'SignatureSlot'
hh.PutUint64(uint64(l.SignatureSlot))
hh.Merkleize(indx)
return
}
// MarshalSSZ ssz marshals the BLSToExecutionChange object
func (b *BLSToExecutionChange) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(b)

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT.
// Hash: 4c3e6932bf84838e8de21e5c121c14d03cbccb051c3990d3b924932f531f4d30
// Hash: b829ba09699058dc63b76a5eb5a03ce3d7d19b0d94b9e7fca06056f9f2f8b317
package eth
import (
@@ -3593,3 +3593,874 @@ func (b *BlobIdentifier) HashTreeRootWith(hh *ssz.Hasher) (err error) {
hh.Merkleize(indx)
return
}
// MarshalSSZ ssz marshals the LightClientHeaderDeneb object
func (l *LightClientHeaderDeneb) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(l)
}
// MarshalSSZTo ssz marshals the LightClientHeaderDeneb object to a target array
func (l *LightClientHeaderDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
offset := int(244)
// Field (0) 'Beacon'
if l.Beacon == nil {
l.Beacon = new(BeaconBlockHeader)
}
if dst, err = l.Beacon.MarshalSSZTo(dst); err != nil {
return
}
// Offset (1) 'Execution'
dst = ssz.WriteOffset(dst, offset)
if l.Execution == nil {
l.Execution = new(v1.ExecutionPayloadHeaderDeneb)
}
offset += l.Execution.SizeSSZ()
// Field (2) 'ExecutionBranch'
if size := len(l.ExecutionBranch); size != 4 {
err = ssz.ErrVectorLengthFn("--.ExecutionBranch", size, 4)
return
}
for ii := 0; ii < 4; ii++ {
if size := len(l.ExecutionBranch[ii]); size != 32 {
err = ssz.ErrBytesLengthFn("--.ExecutionBranch[ii]", size, 32)
return
}
dst = append(dst, l.ExecutionBranch[ii]...)
}
// Field (1) 'Execution'
if dst, err = l.Execution.MarshalSSZTo(dst); err != nil {
return
}
return
}
// UnmarshalSSZ ssz unmarshals the LightClientHeaderDeneb object
func (l *LightClientHeaderDeneb) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size < 244 {
return ssz.ErrSize
}
tail := buf
var o1 uint64
// Field (0) 'Beacon'
if l.Beacon == nil {
l.Beacon = new(BeaconBlockHeader)
}
if err = l.Beacon.UnmarshalSSZ(buf[0:112]); err != nil {
return err
}
// Offset (1) 'Execution'
if o1 = ssz.ReadOffset(buf[112:116]); o1 > size {
return ssz.ErrOffset
}
if o1 != 244 {
return ssz.ErrInvalidVariableOffset
}
// Field (2) 'ExecutionBranch'
l.ExecutionBranch = make([][]byte, 4)
for ii := 0; ii < 4; ii++ {
if cap(l.ExecutionBranch[ii]) == 0 {
l.ExecutionBranch[ii] = make([]byte, 0, len(buf[116:244][ii*32:(ii+1)*32]))
}
l.ExecutionBranch[ii] = append(l.ExecutionBranch[ii], buf[116:244][ii*32:(ii+1)*32]...)
}
// Field (1) 'Execution'
{
buf = tail[o1:]
if l.Execution == nil {
l.Execution = new(v1.ExecutionPayloadHeaderDeneb)
}
if err = l.Execution.UnmarshalSSZ(buf); err != nil {
return err
}
}
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the LightClientHeaderDeneb object
func (l *LightClientHeaderDeneb) SizeSSZ() (size int) {
size = 244
// Field (1) 'Execution'
if l.Execution == nil {
l.Execution = new(v1.ExecutionPayloadHeaderDeneb)
}
size += l.Execution.SizeSSZ()
return
}
// HashTreeRoot ssz hashes the LightClientHeaderDeneb object
func (l *LightClientHeaderDeneb) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(l)
}
// HashTreeRootWith ssz hashes the LightClientHeaderDeneb object with a hasher
func (l *LightClientHeaderDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'Beacon'
if err = l.Beacon.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'Execution'
if err = l.Execution.HashTreeRootWith(hh); err != nil {
return
}
// Field (2) 'ExecutionBranch'
{
if size := len(l.ExecutionBranch); size != 4 {
err = ssz.ErrVectorLengthFn("--.ExecutionBranch", size, 4)
return
}
subIndx := hh.Index()
for _, i := range l.ExecutionBranch {
if len(i) != 32 {
err = ssz.ErrBytesLength
return
}
hh.Append(i)
}
hh.Merkleize(subIndx)
}
hh.Merkleize(indx)
return
}
// MarshalSSZ ssz marshals the LightClientBootstrapDeneb object
func (l *LightClientBootstrapDeneb) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(l)
}
// MarshalSSZTo ssz marshals the LightClientBootstrapDeneb object to a target array
func (l *LightClientBootstrapDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
offset := int(24788)
// Offset (0) 'Header'
dst = ssz.WriteOffset(dst, offset)
if l.Header == nil {
l.Header = new(LightClientHeaderDeneb)
}
offset += l.Header.SizeSSZ()
// Field (1) 'CurrentSyncCommittee'
if l.CurrentSyncCommittee == nil {
l.CurrentSyncCommittee = new(SyncCommittee)
}
if dst, err = l.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil {
return
}
// Field (2) 'CurrentSyncCommitteeBranch'
if size := len(l.CurrentSyncCommitteeBranch); size != 5 {
err = ssz.ErrVectorLengthFn("--.CurrentSyncCommitteeBranch", size, 5)
return
}
for ii := 0; ii < 5; ii++ {
if size := len(l.CurrentSyncCommitteeBranch[ii]); size != 32 {
err = ssz.ErrBytesLengthFn("--.CurrentSyncCommitteeBranch[ii]", size, 32)
return
}
dst = append(dst, l.CurrentSyncCommitteeBranch[ii]...)
}
// Field (0) 'Header'
if dst, err = l.Header.MarshalSSZTo(dst); err != nil {
return
}
return
}
// UnmarshalSSZ ssz unmarshals the LightClientBootstrapDeneb object
func (l *LightClientBootstrapDeneb) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size < 24788 {
return ssz.ErrSize
}
tail := buf
var o0 uint64
// Offset (0) 'Header'
if o0 = ssz.ReadOffset(buf[0:4]); o0 > size {
return ssz.ErrOffset
}
if o0 != 24788 {
return ssz.ErrInvalidVariableOffset
}
// Field (1) 'CurrentSyncCommittee'
if l.CurrentSyncCommittee == nil {
l.CurrentSyncCommittee = new(SyncCommittee)
}
if err = l.CurrentSyncCommittee.UnmarshalSSZ(buf[4:24628]); err != nil {
return err
}
// Field (2) 'CurrentSyncCommitteeBranch'
l.CurrentSyncCommitteeBranch = make([][]byte, 5)
for ii := 0; ii < 5; ii++ {
if cap(l.CurrentSyncCommitteeBranch[ii]) == 0 {
l.CurrentSyncCommitteeBranch[ii] = make([]byte, 0, len(buf[24628:24788][ii*32:(ii+1)*32]))
}
l.CurrentSyncCommitteeBranch[ii] = append(l.CurrentSyncCommitteeBranch[ii], buf[24628:24788][ii*32:(ii+1)*32]...)
}
// Field (0) 'Header'
{
buf = tail[o0:]
if l.Header == nil {
l.Header = new(LightClientHeaderDeneb)
}
if err = l.Header.UnmarshalSSZ(buf); err != nil {
return err
}
}
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the LightClientBootstrapDeneb object
func (l *LightClientBootstrapDeneb) SizeSSZ() (size int) {
size = 24788
// Field (0) 'Header'
if l.Header == nil {
l.Header = new(LightClientHeaderDeneb)
}
size += l.Header.SizeSSZ()
return
}
// HashTreeRoot ssz hashes the LightClientBootstrapDeneb object
func (l *LightClientBootstrapDeneb) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(l)
}
// HashTreeRootWith ssz hashes the LightClientBootstrapDeneb object with a hasher
func (l *LightClientBootstrapDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'Header'
if err = l.Header.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'CurrentSyncCommittee'
if err = l.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil {
return
}
// Field (2) 'CurrentSyncCommitteeBranch'
{
if size := len(l.CurrentSyncCommitteeBranch); size != 5 {
err = ssz.ErrVectorLengthFn("--.CurrentSyncCommitteeBranch", size, 5)
return
}
subIndx := hh.Index()
for _, i := range l.CurrentSyncCommitteeBranch {
if len(i) != 32 {
err = ssz.ErrBytesLength
return
}
hh.Append(i)
}
hh.Merkleize(subIndx)
}
hh.Merkleize(indx)
return
}
// MarshalSSZ ssz marshals the LightClientUpdateDeneb object
func (l *LightClientUpdateDeneb) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(l)
}
// MarshalSSZTo ssz marshals the LightClientUpdateDeneb object to a target array
func (l *LightClientUpdateDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
offset := int(25152)
// Offset (0) 'AttestedHeader'
dst = ssz.WriteOffset(dst, offset)
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderDeneb)
}
offset += l.AttestedHeader.SizeSSZ()
// Field (1) 'NextSyncCommittee'
if l.NextSyncCommittee == nil {
l.NextSyncCommittee = new(SyncCommittee)
}
if dst, err = l.NextSyncCommittee.MarshalSSZTo(dst); err != nil {
return
}
// Field (2) 'NextSyncCommitteeBranch'
if size := len(l.NextSyncCommitteeBranch); size != 5 {
err = ssz.ErrVectorLengthFn("--.NextSyncCommitteeBranch", size, 5)
return
}
for ii := 0; ii < 5; ii++ {
if size := len(l.NextSyncCommitteeBranch[ii]); size != 32 {
err = ssz.ErrBytesLengthFn("--.NextSyncCommitteeBranch[ii]", size, 32)
return
}
dst = append(dst, l.NextSyncCommitteeBranch[ii]...)
}
// Offset (3) 'FinalizedHeader'
dst = ssz.WriteOffset(dst, offset)
if l.FinalizedHeader == nil {
l.FinalizedHeader = new(LightClientHeaderDeneb)
}
offset += l.FinalizedHeader.SizeSSZ()
// Field (4) 'FinalityBranch'
if size := len(l.FinalityBranch); size != 6 {
err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6)
return
}
for ii := 0; ii < 6; ii++ {
if size := len(l.FinalityBranch[ii]); size != 32 {
err = ssz.ErrBytesLengthFn("--.FinalityBranch[ii]", size, 32)
return
}
dst = append(dst, l.FinalityBranch[ii]...)
}
// Field (5) 'SyncAggregate'
if l.SyncAggregate == nil {
l.SyncAggregate = new(SyncAggregate)
}
if dst, err = l.SyncAggregate.MarshalSSZTo(dst); err != nil {
return
}
// Field (6) 'SignatureSlot'
dst = ssz.MarshalUint64(dst, uint64(l.SignatureSlot))
// Field (0) 'AttestedHeader'
if dst, err = l.AttestedHeader.MarshalSSZTo(dst); err != nil {
return
}
// Field (3) 'FinalizedHeader'
if dst, err = l.FinalizedHeader.MarshalSSZTo(dst); err != nil {
return
}
return
}
// UnmarshalSSZ ssz unmarshals the LightClientUpdateDeneb object
func (l *LightClientUpdateDeneb) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size < 25152 {
return ssz.ErrSize
}
tail := buf
var o0, o3 uint64
// Offset (0) 'AttestedHeader'
if o0 = ssz.ReadOffset(buf[0:4]); o0 > size {
return ssz.ErrOffset
}
if o0 != 25152 {
return ssz.ErrInvalidVariableOffset
}
// Field (1) 'NextSyncCommittee'
if l.NextSyncCommittee == nil {
l.NextSyncCommittee = new(SyncCommittee)
}
if err = l.NextSyncCommittee.UnmarshalSSZ(buf[4:24628]); err != nil {
return err
}
// Field (2) 'NextSyncCommitteeBranch'
l.NextSyncCommitteeBranch = make([][]byte, 5)
for ii := 0; ii < 5; ii++ {
if cap(l.NextSyncCommitteeBranch[ii]) == 0 {
l.NextSyncCommitteeBranch[ii] = make([]byte, 0, len(buf[24628:24788][ii*32:(ii+1)*32]))
}
l.NextSyncCommitteeBranch[ii] = append(l.NextSyncCommitteeBranch[ii], buf[24628:24788][ii*32:(ii+1)*32]...)
}
// Offset (3) 'FinalizedHeader'
if o3 = ssz.ReadOffset(buf[24788:24792]); o3 > size || o0 > o3 {
return ssz.ErrOffset
}
// Field (4) 'FinalityBranch'
l.FinalityBranch = make([][]byte, 6)
for ii := 0; ii < 6; ii++ {
if cap(l.FinalityBranch[ii]) == 0 {
l.FinalityBranch[ii] = make([]byte, 0, len(buf[24792:24984][ii*32:(ii+1)*32]))
}
l.FinalityBranch[ii] = append(l.FinalityBranch[ii], buf[24792:24984][ii*32:(ii+1)*32]...)
}
// Field (5) 'SyncAggregate'
if l.SyncAggregate == nil {
l.SyncAggregate = new(SyncAggregate)
}
if err = l.SyncAggregate.UnmarshalSSZ(buf[24984:25144]); err != nil {
return err
}
// Field (6) 'SignatureSlot'
l.SignatureSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[25144:25152]))
// Field (0) 'AttestedHeader'
{
buf = tail[o0:o3]
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderDeneb)
}
if err = l.AttestedHeader.UnmarshalSSZ(buf); err != nil {
return err
}
}
// Field (3) 'FinalizedHeader'
{
buf = tail[o3:]
if l.FinalizedHeader == nil {
l.FinalizedHeader = new(LightClientHeaderDeneb)
}
if err = l.FinalizedHeader.UnmarshalSSZ(buf); err != nil {
return err
}
}
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the LightClientUpdateDeneb object
func (l *LightClientUpdateDeneb) SizeSSZ() (size int) {
size = 25152
// Field (0) 'AttestedHeader'
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderDeneb)
}
size += l.AttestedHeader.SizeSSZ()
// Field (3) 'FinalizedHeader'
if l.FinalizedHeader == nil {
l.FinalizedHeader = new(LightClientHeaderDeneb)
}
size += l.FinalizedHeader.SizeSSZ()
return
}
// HashTreeRoot ssz hashes the LightClientUpdateDeneb object
func (l *LightClientUpdateDeneb) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(l)
}
// HashTreeRootWith ssz hashes the LightClientUpdateDeneb object with a hasher
func (l *LightClientUpdateDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'AttestedHeader'
if err = l.AttestedHeader.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'NextSyncCommittee'
if err = l.NextSyncCommittee.HashTreeRootWith(hh); err != nil {
return
}
// Field (2) 'NextSyncCommitteeBranch'
{
if size := len(l.NextSyncCommitteeBranch); size != 5 {
err = ssz.ErrVectorLengthFn("--.NextSyncCommitteeBranch", size, 5)
return
}
subIndx := hh.Index()
for _, i := range l.NextSyncCommitteeBranch {
if len(i) != 32 {
err = ssz.ErrBytesLength
return
}
hh.Append(i)
}
hh.Merkleize(subIndx)
}
// Field (3) 'FinalizedHeader'
if err = l.FinalizedHeader.HashTreeRootWith(hh); err != nil {
return
}
// Field (4) 'FinalityBranch'
{
if size := len(l.FinalityBranch); size != 6 {
err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6)
return
}
subIndx := hh.Index()
for _, i := range l.FinalityBranch {
if len(i) != 32 {
err = ssz.ErrBytesLength
return
}
hh.Append(i)
}
hh.Merkleize(subIndx)
}
// Field (5) 'SyncAggregate'
if err = l.SyncAggregate.HashTreeRootWith(hh); err != nil {
return
}
// Field (6) 'SignatureSlot'
hh.PutUint64(uint64(l.SignatureSlot))
hh.Merkleize(indx)
return
}
// MarshalSSZ ssz marshals the LightClientFinalityUpdateDeneb object
func (l *LightClientFinalityUpdateDeneb) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(l)
}
// MarshalSSZTo ssz marshals the LightClientFinalityUpdateDeneb object to a target array
func (l *LightClientFinalityUpdateDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
offset := int(368)
// Offset (0) 'AttestedHeader'
dst = ssz.WriteOffset(dst, offset)
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderDeneb)
}
offset += l.AttestedHeader.SizeSSZ()
// Offset (1) 'FinalizedHeader'
dst = ssz.WriteOffset(dst, offset)
if l.FinalizedHeader == nil {
l.FinalizedHeader = new(LightClientHeaderDeneb)
}
offset += l.FinalizedHeader.SizeSSZ()
// Field (2) 'FinalityBranch'
if size := len(l.FinalityBranch); size != 6 {
err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6)
return
}
for ii := 0; ii < 6; ii++ {
if size := len(l.FinalityBranch[ii]); size != 32 {
err = ssz.ErrBytesLengthFn("--.FinalityBranch[ii]", size, 32)
return
}
dst = append(dst, l.FinalityBranch[ii]...)
}
// Field (3) 'SyncAggregate'
if l.SyncAggregate == nil {
l.SyncAggregate = new(SyncAggregate)
}
if dst, err = l.SyncAggregate.MarshalSSZTo(dst); err != nil {
return
}
// Field (4) 'SignatureSlot'
dst = ssz.MarshalUint64(dst, uint64(l.SignatureSlot))
// Field (0) 'AttestedHeader'
if dst, err = l.AttestedHeader.MarshalSSZTo(dst); err != nil {
return
}
// Field (1) 'FinalizedHeader'
if dst, err = l.FinalizedHeader.MarshalSSZTo(dst); err != nil {
return
}
return
}
// UnmarshalSSZ ssz unmarshals the LightClientFinalityUpdateDeneb object
func (l *LightClientFinalityUpdateDeneb) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size < 368 {
return ssz.ErrSize
}
tail := buf
var o0, o1 uint64
// Offset (0) 'AttestedHeader'
if o0 = ssz.ReadOffset(buf[0:4]); o0 > size {
return ssz.ErrOffset
}
if o0 != 368 {
return ssz.ErrInvalidVariableOffset
}
// Offset (1) 'FinalizedHeader'
if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 {
return ssz.ErrOffset
}
// Field (2) 'FinalityBranch'
l.FinalityBranch = make([][]byte, 6)
for ii := 0; ii < 6; ii++ {
if cap(l.FinalityBranch[ii]) == 0 {
l.FinalityBranch[ii] = make([]byte, 0, len(buf[8:200][ii*32:(ii+1)*32]))
}
l.FinalityBranch[ii] = append(l.FinalityBranch[ii], buf[8:200][ii*32:(ii+1)*32]...)
}
// Field (3) 'SyncAggregate'
if l.SyncAggregate == nil {
l.SyncAggregate = new(SyncAggregate)
}
if err = l.SyncAggregate.UnmarshalSSZ(buf[200:360]); err != nil {
return err
}
// Field (4) 'SignatureSlot'
l.SignatureSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[360:368]))
// Field (0) 'AttestedHeader'
{
buf = tail[o0:o1]
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderDeneb)
}
if err = l.AttestedHeader.UnmarshalSSZ(buf); err != nil {
return err
}
}
// Field (1) 'FinalizedHeader'
{
buf = tail[o1:]
if l.FinalizedHeader == nil {
l.FinalizedHeader = new(LightClientHeaderDeneb)
}
if err = l.FinalizedHeader.UnmarshalSSZ(buf); err != nil {
return err
}
}
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the LightClientFinalityUpdateDeneb object
func (l *LightClientFinalityUpdateDeneb) SizeSSZ() (size int) {
size = 368
// Field (0) 'AttestedHeader'
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderDeneb)
}
size += l.AttestedHeader.SizeSSZ()
// Field (1) 'FinalizedHeader'
if l.FinalizedHeader == nil {
l.FinalizedHeader = new(LightClientHeaderDeneb)
}
size += l.FinalizedHeader.SizeSSZ()
return
}
// HashTreeRoot ssz hashes the LightClientFinalityUpdateDeneb object
func (l *LightClientFinalityUpdateDeneb) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(l)
}
// HashTreeRootWith ssz hashes the LightClientFinalityUpdateDeneb object with a hasher
func (l *LightClientFinalityUpdateDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'AttestedHeader'
if err = l.AttestedHeader.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'FinalizedHeader'
if err = l.FinalizedHeader.HashTreeRootWith(hh); err != nil {
return
}
// Field (2) 'FinalityBranch'
{
if size := len(l.FinalityBranch); size != 6 {
err = ssz.ErrVectorLengthFn("--.FinalityBranch", size, 6)
return
}
subIndx := hh.Index()
for _, i := range l.FinalityBranch {
if len(i) != 32 {
err = ssz.ErrBytesLength
return
}
hh.Append(i)
}
hh.Merkleize(subIndx)
}
// Field (3) 'SyncAggregate'
if err = l.SyncAggregate.HashTreeRootWith(hh); err != nil {
return
}
// Field (4) 'SignatureSlot'
hh.PutUint64(uint64(l.SignatureSlot))
hh.Merkleize(indx)
return
}
// MarshalSSZ ssz marshals the LightClientOptimisticUpdateDeneb object
func (l *LightClientOptimisticUpdateDeneb) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(l)
}
// MarshalSSZTo ssz marshals the LightClientOptimisticUpdateDeneb object to a target array
func (l *LightClientOptimisticUpdateDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
offset := int(172)
// Offset (0) 'AttestedHeader'
dst = ssz.WriteOffset(dst, offset)
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderDeneb)
}
offset += l.AttestedHeader.SizeSSZ()
// Field (1) 'SyncAggregate'
if l.SyncAggregate == nil {
l.SyncAggregate = new(SyncAggregate)
}
if dst, err = l.SyncAggregate.MarshalSSZTo(dst); err != nil {
return
}
// Field (2) 'SignatureSlot'
dst = ssz.MarshalUint64(dst, uint64(l.SignatureSlot))
// Field (0) 'AttestedHeader'
if dst, err = l.AttestedHeader.MarshalSSZTo(dst); err != nil {
return
}
return
}
// UnmarshalSSZ ssz unmarshals the LightClientOptimisticUpdateDeneb object
func (l *LightClientOptimisticUpdateDeneb) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size < 172 {
return ssz.ErrSize
}
tail := buf
var o0 uint64
// Offset (0) 'AttestedHeader'
if o0 = ssz.ReadOffset(buf[0:4]); o0 > size {
return ssz.ErrOffset
}
if o0 != 172 {
return ssz.ErrInvalidVariableOffset
}
// Field (1) 'SyncAggregate'
if l.SyncAggregate == nil {
l.SyncAggregate = new(SyncAggregate)
}
if err = l.SyncAggregate.UnmarshalSSZ(buf[4:164]); err != nil {
return err
}
// Field (2) 'SignatureSlot'
l.SignatureSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[164:172]))
// Field (0) 'AttestedHeader'
{
buf = tail[o0:]
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderDeneb)
}
if err = l.AttestedHeader.UnmarshalSSZ(buf); err != nil {
return err
}
}
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the LightClientOptimisticUpdateDeneb object
func (l *LightClientOptimisticUpdateDeneb) SizeSSZ() (size int) {
size = 172
// Field (0) 'AttestedHeader'
if l.AttestedHeader == nil {
l.AttestedHeader = new(LightClientHeaderDeneb)
}
size += l.AttestedHeader.SizeSSZ()
return
}
// HashTreeRoot ssz hashes the LightClientOptimisticUpdateDeneb object
func (l *LightClientOptimisticUpdateDeneb) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(l)
}
// HashTreeRootWith ssz hashes the LightClientOptimisticUpdateDeneb object with a hasher
func (l *LightClientOptimisticUpdateDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'AttestedHeader'
if err = l.AttestedHeader.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'SyncAggregate'
if err = l.SyncAggregate.HashTreeRootWith(hh); err != nil {
return
}
// Field (2) 'SignatureSlot'
hh.PutUint64(uint64(l.SignatureSlot))
hh.Merkleize(indx)
return
}

1759
proto/prysm/v1alpha1/light_client.pb.go generated Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,134 @@
// Copyright 2024 Prysmatic Labs.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package ethereum.eth.v1alpha1;
import "proto/eth/ext/options.proto";
import "proto/prysm/v1alpha1/beacon_block.proto";
import "proto/engine/v1/execution_engine.proto";
import "proto/prysm/v1alpha1/beacon_state.proto";
option csharp_namespace = "Ethereum.Eth.V1alpha1";
option go_package = "github.com/prysmaticlabs/prysm/v5/proto/eth/v1alpha1;eth";
option java_multiple_files = true;
option java_outer_classname = "LightClientProto";
option java_package = "org.ethereum.eth.v1alpha1";
option php_namespace = "Ethereum\\Eth\\v1alpha1";
message LightClientHeaderAltair {
BeaconBlockHeader beacon = 1;
}
message LightClientHeaderCapella {
BeaconBlockHeader beacon = 1;
ethereum.engine.v1.ExecutionPayloadHeaderCapella execution = 2;
repeated bytes execution_branch = 3 [(ethereum.eth.ext.ssz_size) = "4,32"];
}
message LightClientHeaderDeneb {
BeaconBlockHeader beacon = 1;
ethereum.engine.v1.ExecutionPayloadHeaderDeneb execution = 2;
repeated bytes execution_branch = 3 [(ethereum.eth.ext.ssz_size) = "4,32"];
}
message LightClientBootstrapAltair {
LightClientHeaderAltair header = 1;
SyncCommittee current_sync_committee = 2;
repeated bytes current_sync_committee_branch = 3 [(ethereum.eth.ext.ssz_size) = "5,32"];
}
message LightClientBootstrapCapella {
LightClientHeaderCapella header = 1;
SyncCommittee current_sync_committee = 2;
repeated bytes current_sync_committee_branch = 3 [(ethereum.eth.ext.ssz_size) = "5,32"];
}
message LightClientBootstrapDeneb {
LightClientHeaderDeneb header = 1;
SyncCommittee current_sync_committee = 2;
repeated bytes current_sync_committee_branch = 3 [(ethereum.eth.ext.ssz_size) = "5,32"];
}
message LightClientUpdateAltair {
LightClientHeaderAltair attested_header = 1;
SyncCommittee next_sync_committee = 2;
repeated bytes next_sync_committee_branch = 3 [(ethereum.eth.ext.ssz_size) = "5,32"];
LightClientHeaderAltair finalized_header = 4;
repeated bytes finality_branch = 5 [(ethereum.eth.ext.ssz_size) = "6,32"];
SyncAggregate sync_aggregate = 6;
uint64 signature_slot = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"];
}
message LightClientUpdateCapella {
LightClientHeaderCapella attested_header = 1;
SyncCommittee next_sync_committee = 2;
repeated bytes next_sync_committee_branch = 3 [(ethereum.eth.ext.ssz_size) = "5,32"];
LightClientHeaderCapella finalized_header = 4;
repeated bytes finality_branch = 5 [(ethereum.eth.ext.ssz_size) = "6,32"];
SyncAggregate sync_aggregate = 6;
uint64 signature_slot = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"];
}
message LightClientUpdateDeneb {
LightClientHeaderDeneb attested_header = 1;
SyncCommittee next_sync_committee = 2;
repeated bytes next_sync_committee_branch = 3 [(ethereum.eth.ext.ssz_size) = "5,32"];
LightClientHeaderDeneb finalized_header = 4;
repeated bytes finality_branch = 5 [(ethereum.eth.ext.ssz_size) = "6,32"];
SyncAggregate sync_aggregate = 6;
uint64 signature_slot = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"];
}
message LightClientFinalityUpdateAltair {
LightClientHeaderAltair attested_header = 1;
LightClientHeaderAltair finalized_header = 2;
repeated bytes finality_branch = 3 [(ethereum.eth.ext.ssz_size) = "6,32"];
SyncAggregate sync_aggregate = 4;
uint64 signature_slot = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"];
}
message LightClientFinalityUpdateCapella {
LightClientHeaderCapella attested_header = 1;
LightClientHeaderCapella finalized_header = 2;
repeated bytes finality_branch = 3 [(ethereum.eth.ext.ssz_size) = "6,32"];
SyncAggregate sync_aggregate = 4;
uint64 signature_slot = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"];
}
message LightClientFinalityUpdateDeneb {
LightClientHeaderDeneb attested_header = 1;
LightClientHeaderDeneb finalized_header = 2;
repeated bytes finality_branch = 3 [(ethereum.eth.ext.ssz_size) = "6,32"];
SyncAggregate sync_aggregate = 4;
uint64 signature_slot = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"];
}
message LightClientOptimisticUpdateAltair {
LightClientHeaderAltair attested_header = 1;
SyncAggregate sync_aggregate = 2;
uint64 signature_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"];
}
message LightClientOptimisticUpdateCapella {
LightClientHeaderCapella attested_header = 1;
SyncAggregate sync_aggregate = 2;
uint64 signature_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"];
}
message LightClientOptimisticUpdateDeneb {
LightClientHeaderDeneb attested_header = 1;
SyncAggregate sync_aggregate = 2;
uint64 signature_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"];
}