diff --git a/beacon-chain/state/interfaces_epbs.go b/beacon-chain/state/interfaces_epbs.go index 5f5edfcb98a1..9b73985fd727 100644 --- a/beacon-chain/state/interfaces_epbs.go +++ b/beacon-chain/state/interfaces_epbs.go @@ -6,10 +6,6 @@ import ( ) type ReadOnlyEpbsFields interface { - PreviousInclusionListSlot() primitives.Slot - PreviousInclusionListProposer() primitives.ValidatorIndex - LatestInclusionListSlot() primitives.Slot - LatestInclusionListProposer() primitives.ValidatorIndex IsParentBlockFull() bool ExecutionPayloadHeader() *enginev1.ExecutionPayloadHeaderEPBS LatestBlockHash() []byte @@ -19,9 +15,6 @@ type ReadOnlyEpbsFields interface { type WriteOnlyEpbsFields interface { SetExecutionPayloadHeader(val *enginev1.ExecutionPayloadHeaderEPBS) - UpdatePreviousInclusionListData() - SetLatestInclusionListSlot(val primitives.Slot) - SetLatestInclusionListProposer(val primitives.ValidatorIndex) SetLatestBlockHash(val []byte) SetLatestFullSlot(val primitives.Slot) SetLastWithdrawalsRoot(val []byte) diff --git a/beacon-chain/state/state-native/beacon_state_mainnet.go b/beacon-chain/state/state-native/beacon_state_mainnet.go index 15ecd1a623ef..bdfa29bede48 100644 --- a/beacon-chain/state/state-native/beacon_state_mainnet.go +++ b/beacon-chain/state/state-native/beacon_state_mainnet.go @@ -61,14 +61,10 @@ type BeaconState struct { nextWithdrawalIndex uint64 nextWithdrawalValidatorIndex primitives.ValidatorIndex // ePBS fields - previousInclusionListProposer primitives.ValidatorIndex - previousInclusionListSlot primitives.Slot - latestInclusionListProposer primitives.ValidatorIndex - latestInclusionListSlot primitives.Slot - latestBlockHash [32]byte - latestFullSlot primitives.Slot - executionPayloadHeader *enginev1.ExecutionPayloadHeaderEPBS - lastWithdrawalsRoot [32]byte + latestBlockHash [32]byte + latestFullSlot primitives.Slot + executionPayloadHeader *enginev1.ExecutionPayloadHeaderEPBS + lastWithdrawalsRoot [32]byte // Electra fields depositRequestsStartIndex uint64 diff --git a/beacon-chain/state/state-native/beacon_state_minimal.go b/beacon-chain/state/state-native/beacon_state_minimal.go index 88005277c0b2..d1ac32cc31d0 100644 --- a/beacon-chain/state/state-native/beacon_state_minimal.go +++ b/beacon-chain/state/state-native/beacon_state_minimal.go @@ -61,14 +61,10 @@ type BeaconState struct { nextWithdrawalIndex uint64 nextWithdrawalValidatorIndex primitives.ValidatorIndex // ePBS fields - previousInclusionListProposer primitives.ValidatorIndex - previousInclusionListSlot primitives.Slot - latestInclusionListProposer primitives.ValidatorIndex - latestInclusionListSlot primitives.Slot - latestBlockHash [32]byte - latestFullSlot primitives.Slot - executionPayloadHeader *enginev1.ExecutionPayloadHeaderEPBS - lastWithdrawalsRoot [32]byte + latestBlockHash [32]byte + latestFullSlot primitives.Slot + executionPayloadHeader *enginev1.ExecutionPayloadHeaderEPBS + lastWithdrawalsRoot [32]byte // Electra fields depositRequestsStartIndex uint64 diff --git a/beacon-chain/state/state-native/getters_epbs.go b/beacon-chain/state/state-native/getters_epbs.go index b5677c8a17a9..e2697422f97a 100644 --- a/beacon-chain/state/state-native/getters_epbs.go +++ b/beacon-chain/state/state-native/getters_epbs.go @@ -26,38 +26,6 @@ func (b *BeaconState) IsParentBlockFull() bool { return headerBlockHash == b.latestBlockHash } -// LatestInclusionListProposer returns the proposer index from the latest inclusion list. -func (b *BeaconState) LatestInclusionListProposer() primitives.ValidatorIndex { - b.lock.RLock() - defer b.lock.RUnlock() - - return b.latestInclusionListProposer -} - -// LatestInclusionListSlot returns the slot from the latest inclusion list. -func (b *BeaconState) LatestInclusionListSlot() primitives.Slot { - b.lock.RLock() - defer b.lock.RUnlock() - - return b.latestInclusionListSlot -} - -// PreviousInclusionListProposer returns the proposer index from the previous inclusion list. -func (b *BeaconState) PreviousInclusionListProposer() primitives.ValidatorIndex { - b.lock.RLock() - defer b.lock.RUnlock() - - return b.previousInclusionListProposer -} - -// PreviousInclusionListSlot returns the slot from the previous inclusion list. -func (b *BeaconState) PreviousInclusionListSlot() primitives.Slot { - b.lock.RLock() - defer b.lock.RUnlock() - - return b.previousInclusionListSlot -} - // LatestBlockHash returns the latest block hash. func (b *BeaconState) LatestBlockHash() []byte { b.lock.RLock() diff --git a/beacon-chain/state/state-native/getters_setters_epbs_test.go b/beacon-chain/state/state-native/getters_setters_epbs_test.go index 17980dc54eed..e60c87b28d56 100644 --- a/beacon-chain/state/state-native/getters_setters_epbs_test.go +++ b/beacon-chain/state/state-native/getters_setters_epbs_test.go @@ -33,43 +33,6 @@ func Test_SetExecutionPayloadHeader(t *testing.T) { require.DeepEqual(t, got, header) } -func Test_UpdatePreviousInclusionListData(t *testing.T) { - s := &BeaconState{version: version.EPBS, dirtyFields: make(map[types.FieldIndex]bool)} - p := s.PreviousInclusionListProposer() - require.Equal(t, primitives.ValidatorIndex(0), p) - ss := s.PreviousInclusionListSlot() - require.Equal(t, primitives.Slot(0), ss) - - s.SetLatestInclusionListProposer(1) - s.SetLatestInclusionListSlot(2) - s.UpdatePreviousInclusionListData() - require.Equal(t, true, s.dirtyFields[types.PreviousInclusionListProposer]) - require.Equal(t, true, s.dirtyFields[types.PreviousInclusionListSlot]) - - p = s.PreviousInclusionListProposer() - require.Equal(t, primitives.ValidatorIndex(1), p) - ss = s.PreviousInclusionListSlot() - require.Equal(t, primitives.Slot(2), ss) -} - -func Test_SetLatestInclusionListProposer(t *testing.T) { - s := &BeaconState{version: version.EPBS, dirtyFields: make(map[types.FieldIndex]bool)} - s.SetLatestInclusionListProposer(1) - require.Equal(t, true, s.dirtyFields[types.LatestInclusionListProposer]) - - got := s.LatestInclusionListProposer() - require.Equal(t, primitives.ValidatorIndex(1), got) -} - -func Test_SetLatestInclusionListSlot(t *testing.T) { - s := &BeaconState{version: version.EPBS, dirtyFields: make(map[types.FieldIndex]bool)} - s.SetLatestInclusionListSlot(2) - require.Equal(t, true, s.dirtyFields[types.LatestInclusionListSlot]) - - got := s.LatestInclusionListSlot() - require.Equal(t, primitives.Slot(2), got) -} - func Test_SetLatestBlockHash(t *testing.T) { s := &BeaconState{version: version.EPBS, dirtyFields: make(map[types.FieldIndex]bool)} b := make([]byte, fieldparams.RootLength) diff --git a/beacon-chain/state/state-native/getters_state.go b/beacon-chain/state/state-native/getters_state.go index b4ee04dae4aa..9a598c92e73b 100644 --- a/beacon-chain/state/state-native/getters_state.go +++ b/beacon-chain/state/state-native/getters_state.go @@ -250,13 +250,9 @@ func (b *BeaconState) ToProtoUnsafe() interface{} { PendingBalanceDeposits: b.pendingBalanceDeposits, PendingPartialWithdrawals: b.pendingPartialWithdrawals, PendingConsolidations: b.pendingConsolidations, - PreviousInclusionListProposer: b.previousInclusionListProposer, - PreviousInclusionListSlot: b.previousInclusionListSlot, - LatestInclusionListProposer: b.latestInclusionListProposer, - LatestInclusionListSlot: b.latestInclusionListSlot, LatestBlockHash: b.latestBlockHash[:], LatestFullSlot: b.latestFullSlot, - ExecutionPayloadHeader: b.executionPayloadHeader, + LatestExecutionPayloadHeader: b.executionPayloadHeader, LastWithdrawalsRoot: b.lastWithdrawalsRoot[:], } default: @@ -506,13 +502,9 @@ func (b *BeaconState) ToProto() interface{} { PendingBalanceDeposits: b.pendingBalanceDepositsVal(), PendingPartialWithdrawals: b.pendingPartialWithdrawalsVal(), PendingConsolidations: b.pendingConsolidationsVal(), - PreviousInclusionListProposer: b.previousInclusionListProposer, - PreviousInclusionListSlot: b.previousInclusionListSlot, - LatestInclusionListProposer: b.latestInclusionListProposer, - LatestInclusionListSlot: b.latestInclusionListSlot, LatestBlockHash: LatestBlockHashCopy[:], LatestFullSlot: b.latestFullSlot, - ExecutionPayloadHeader: b.executionPayloadHeaderVal(), + LatestExecutionPayloadHeader: b.executionPayloadHeaderVal(), LastWithdrawalsRoot: lastWithdrawalsRootCopy[:], } default: diff --git a/beacon-chain/state/state-native/hasher.go b/beacon-chain/state/state-native/hasher.go index 87c44e67bbde..223e074700f1 100644 --- a/beacon-chain/state/state-native/hasher.go +++ b/beacon-chain/state/state-native/hasher.go @@ -338,22 +338,6 @@ func ComputeFieldRootsWithHasher(ctx context.Context, state *BeaconState) ([][]b } if state.version >= version.EPBS { - // Previous inclusion list proposer root. - prevInclusionListProposerRoot := ssz.Uint64Root(uint64(state.previousInclusionListProposer)) - fieldRoots[types.PreviousInclusionListProposer.RealPosition()] = prevInclusionListProposerRoot[:] - - // Previous inclusion list slot root. - prevInclusionListSlotRoot := ssz.Uint64Root(uint64(state.previousInclusionListSlot)) - fieldRoots[types.PreviousInclusionListSlot.RealPosition()] = prevInclusionListSlotRoot[:] - - // Latest inclusion list proposer root. - latestInclusionListProposerRoot := ssz.Uint64Root(uint64(state.latestInclusionListProposer)) - fieldRoots[types.LatestInclusionListProposer.RealPosition()] = latestInclusionListProposerRoot[:] - - // Latest inclusion list slot root. - latestInclusionListSlotRoot := ssz.Uint64Root(uint64(state.latestInclusionListSlot)) - fieldRoots[types.LatestInclusionListSlot.RealPosition()] = latestInclusionListSlotRoot[:] - // Latest block hash root. latestBlockHashRoot := state.latestBlockHash[:] fieldRoots[types.LatestBlockHash.RealPosition()] = latestBlockHashRoot diff --git a/beacon-chain/state/state-native/setters_epbs.go b/beacon-chain/state/state-native/setters_epbs.go index 0a522dedef38..e986b8821764 100644 --- a/beacon-chain/state/state-native/setters_epbs.go +++ b/beacon-chain/state/state-native/setters_epbs.go @@ -16,35 +16,6 @@ func (b *BeaconState) SetExecutionPayloadHeader(h *enginev1.ExecutionPayloadHead b.markFieldAsDirty(types.ExecutionPayloadHeader) } -// UpdatePreviousInclusionListData updates the data of previous inclusion list with latest values. -func (b *BeaconState) UpdatePreviousInclusionListData() { - b.lock.Lock() - defer b.lock.Unlock() - - b.previousInclusionListProposer = b.latestInclusionListProposer - b.previousInclusionListSlot = b.latestInclusionListSlot - b.markFieldAsDirty(types.PreviousInclusionListProposer) - b.markFieldAsDirty(types.PreviousInclusionListSlot) -} - -// SetLatestInclusionListProposer sets the latest inclusion list proposer for the beacon state. -func (b *BeaconState) SetLatestInclusionListProposer(i primitives.ValidatorIndex) { - b.lock.Lock() - defer b.lock.Unlock() - - b.latestInclusionListProposer = i - b.markFieldAsDirty(types.LatestInclusionListProposer) -} - -// SetLatestInclusionListSlot sets the latest inclusion list slot for the beacon state. -func (b *BeaconState) SetLatestInclusionListSlot(s primitives.Slot) { - b.lock.Lock() - defer b.lock.Unlock() - - b.latestInclusionListSlot = s - b.markFieldAsDirty(types.LatestInclusionListSlot) -} - // SetLatestBlockHash sets the latest block hash for the beacon state. func (b *BeaconState) SetLatestBlockHash(h []byte) { b.lock.Lock() diff --git a/beacon-chain/state/state-native/state_trie.go b/beacon-chain/state/state-native/state_trie.go index 790e42c2bd0c..bb42803cdebb 100644 --- a/beacon-chain/state/state-native/state_trie.go +++ b/beacon-chain/state/state-native/state_trie.go @@ -126,11 +126,7 @@ var epbsFields = append( types.PendingBalanceDeposits, types.PendingPartialWithdrawals, types.PendingConsolidations, - types.PreviousInclusionListProposer, // ePBS fields start here - types.PreviousInclusionListSlot, - types.LatestInclusionListProposer, - types.LatestInclusionListSlot, - types.LatestBlockHash, + types.LatestBlockHash, // ePBS fields start here types.LatestFullSlot, types.ExecutionPayloadHeader, types.LastWithdrawalsRoot, @@ -902,10 +898,6 @@ func (b *BeaconState) Copy() state.BeaconState { earliestExitEpoch: b.earliestExitEpoch, consolidationBalanceToConsume: b.consolidationBalanceToConsume, earliestConsolidationEpoch: b.earliestConsolidationEpoch, - previousInclusionListProposer: b.previousInclusionListProposer, - previousInclusionListSlot: b.previousInclusionListSlot, - latestInclusionListProposer: b.latestInclusionListProposer, - latestInclusionListSlot: b.latestInclusionListSlot, latestBlockHash: b.latestBlockHash, latestFullSlot: b.latestFullSlot, lastWithdrawalsRoot: b.lastWithdrawalsRoot, @@ -1352,14 +1344,6 @@ func (b *BeaconState) rootSelector(ctx context.Context, field types.FieldIndex) return stateutil.PendingPartialWithdrawalsRoot(b.pendingPartialWithdrawals) case types.PendingConsolidations: return stateutil.PendingConsolidationsRoot(b.pendingConsolidations) - case types.PreviousInclusionListProposer: - return ssz.Uint64Root(uint64(b.previousInclusionListProposer)), nil - case types.PreviousInclusionListSlot: - return ssz.Uint64Root(uint64(b.previousInclusionListSlot)), nil - case types.LatestInclusionListProposer: - return ssz.Uint64Root(uint64(b.latestInclusionListProposer)), nil - case types.LatestInclusionListSlot: - return ssz.Uint64Root(uint64(b.latestInclusionListSlot)), nil case types.LatestBlockHash: return b.latestBlockHash, nil case types.LatestFullSlot: diff --git a/beacon-chain/state/state-native/state_trie_epbs.go b/beacon-chain/state/state-native/state_trie_epbs.go index 3c811fd8e9e6..5e9b4d867de2 100644 --- a/beacon-chain/state/state-native/state_trie_epbs.go +++ b/beacon-chain/state/state-native/state_trie_epbs.go @@ -64,14 +64,10 @@ func InitializeFromProtoUnsafeEpbs(st *ethpb.BeaconStateEPBS) (*BeaconState, err pendingConsolidations: st.PendingConsolidations, // ePBS fields - previousInclusionListProposer: st.PreviousInclusionListProposer, - previousInclusionListSlot: st.PreviousInclusionListSlot, - latestInclusionListProposer: st.LatestInclusionListProposer, - latestInclusionListSlot: st.LatestInclusionListSlot, - latestBlockHash: bytesutil.ToBytes32(st.LatestBlockHash), - latestFullSlot: st.LatestFullSlot, - executionPayloadHeader: st.ExecutionPayloadHeader, - lastWithdrawalsRoot: bytesutil.ToBytes32(st.LastWithdrawalsRoot), + latestBlockHash: bytesutil.ToBytes32(st.LatestBlockHash), + latestFullSlot: st.LatestFullSlot, + executionPayloadHeader: st.LatestExecutionPayloadHeader, + lastWithdrawalsRoot: bytesutil.ToBytes32(st.LastWithdrawalsRoot), dirtyFields: make(map[types.FieldIndex]bool, fieldCount), dirtyIndices: make(map[types.FieldIndex][]uint64, fieldCount), diff --git a/beacon-chain/state/state-native/state_trie_epbs_test.go b/beacon-chain/state/state-native/state_trie_epbs_test.go index 97577eade066..71dc1ea3528b 100644 --- a/beacon-chain/state/state-native/state_trie_epbs_test.go +++ b/beacon-chain/state/state-native/state_trie_epbs_test.go @@ -12,27 +12,15 @@ func Test_InitializeFromProtoEpbs(t *testing.T) { st := random.BeaconState(t) // Cache initial values to check against after initialization. - prevInclusionListProposer := st.PreviousInclusionListProposer - prevInclusionListSlot := st.PreviousInclusionListSlot - latestInclusionListProposer := st.LatestInclusionListProposer - latestInclusionListSlot := st.LatestInclusionListSlot latestBlockHash := st.LatestBlockHash latestFullSlot := st.LatestFullSlot - header := st.ExecutionPayloadHeader + header := st.LatestExecutionPayloadHeader lastWithdrawalsRoot := st.LastWithdrawalsRoot s, err := InitializeFromProtoEpbs(st) require.NoError(t, err) // Assert that initial values match those in the new state. - gotPrevInclusionListProposer := s.PreviousInclusionListProposer() - require.Equal(t, prevInclusionListProposer, gotPrevInclusionListProposer) - gotPrevInclusionListSlot := s.PreviousInclusionListSlot() - require.Equal(t, prevInclusionListSlot, gotPrevInclusionListSlot) - gotLatestInclusionListProposer := s.LatestInclusionListProposer() - require.Equal(t, latestInclusionListProposer, gotLatestInclusionListProposer) - gotLatestInclusionListSlot := s.LatestInclusionListSlot() - require.Equal(t, latestInclusionListSlot, gotLatestInclusionListSlot) gotLatestBlockHash := s.LatestBlockHash() require.DeepEqual(t, latestBlockHash, gotLatestBlockHash) gotLatestFullSlot := s.LatestFullSlot() diff --git a/beacon-chain/state/state-native/types/types.go b/beacon-chain/state/state-native/types/types.go index 2d9a769215be..ca07ac2d951f 100644 --- a/beacon-chain/state/state-native/types/types.go +++ b/beacon-chain/state/state-native/types/types.go @@ -114,15 +114,7 @@ func (f FieldIndex) String() string { return "pendingPartialWithdrawals" case PendingConsolidations: return "pendingConsolidations" - case PreviousInclusionListProposer: // ePBS fields start here - return "PreviousInclusionListProposer" - case PreviousInclusionListSlot: - return "PreviousInclusionListSlot" - case LatestInclusionListProposer: - return "LatestInclusionListProposer" - case LatestInclusionListSlot: - return "LatestInclusionListSlot" - case LatestBlockHash: + case LatestBlockHash: // ePBS fields start here return "LatestBlockHash" case LatestFullSlot: return "LatestFullSlot" @@ -214,15 +206,7 @@ func (f FieldIndex) RealPosition() int { return 35 case PendingConsolidations: return 36 - case PreviousInclusionListProposer: // ePBS fields start here - return 37 - case PreviousInclusionListSlot: - return 38 - case LatestInclusionListProposer: - return 39 - case LatestInclusionListSlot: - return 40 - case LatestBlockHash: + case LatestBlockHash: // ePBS fields start here return 41 case LatestFullSlot: return 42 @@ -281,6 +265,7 @@ const ( LatestExecutionPayloadHeaderCapella LatestExecutionPayloadHeaderDeneb LatestExecutionPayloadHeaderElectra + ExecutionPayloadHeader NextWithdrawalIndex NextWithdrawalValidatorIndex HistoricalSummaries @@ -293,13 +278,8 @@ const ( PendingBalanceDeposits // Electra: EIP-7251 PendingPartialWithdrawals // Electra: EIP-7251 PendingConsolidations // Electra: EIP-7251 - PreviousInclusionListProposer // ePBS fields start here - PreviousInclusionListSlot - LatestInclusionListProposer - LatestInclusionListSlot - LatestBlockHash + LatestBlockHash // ePBS fields start here LatestFullSlot - ExecutionPayloadHeader LastWithdrawalsRoot ) diff --git a/config/fieldparams/mainnet.go b/config/fieldparams/mainnet.go index 56ddb24d87ea..94fb5ead6090 100644 --- a/config/fieldparams/mainnet.go +++ b/config/fieldparams/mainnet.go @@ -30,7 +30,6 @@ const ( MaxBlobsPerBlock = 6 // MaxBlobsPerBlock defines the maximum number of blobs with respect to consensus rule can be included in a block. MaxBlobCommitmentsPerBlock = 4096 // MaxBlobCommitmentsPerBlock defines the theoretical limit of blobs can be included in a block. MaxPayloadAttestationsPerBlock = 4 // MAX_PAYLOAD_ATTESTATIONS [New in ePBS] - MaxTransactionsPerInclusionList = 1024 // MAX_TRANSACTIONS_PER_INCLUSION_LIST [New in ePBS] LogMaxBlobCommitments = 12 // Log_2 of MaxBlobCommitmentsPerBlock BlobLength = 131072 // BlobLength defines the byte length of a blob. BlobSize = 131072 // defined to match blob.size in bazel ssz codegen diff --git a/config/fieldparams/minimal.go b/config/fieldparams/minimal.go index 425f955ef1cf..ad47d1fc19a3 100644 --- a/config/fieldparams/minimal.go +++ b/config/fieldparams/minimal.go @@ -30,7 +30,6 @@ const ( MaxBlobsPerBlock = 6 // MaxBlobsPerBlock defines the maximum number of blobs with respect to consensus rule can be included in a block. MaxBlobCommitmentsPerBlock = 16 // MaxBlobCommitmentsPerBlock defines the theoretical limit of blobs can be included in a block. MaxPayloadAttestationsPerBlock = 4 // MAX_PAYLOAD_ATTESTATIONS [New in ePBS] - MaxTransactionsPerInclusionList = 16 // MAX_TRANSACTIONS_PER_INCLUSION_LIST [New in ePBS] LogMaxBlobCommitments = 4 // Log_2 of MaxBlobCommitmentsPerBlock BlobLength = 131072 // BlobLength defines the byte length of a blob. BlobSize = 131072 // defined to match blob.size in bazel ssz codegen diff --git a/consensus-types/blocks/getters_epbs_test.go b/consensus-types/blocks/getters_epbs_test.go index ccc8601191af..c2d75f4b1314 100644 --- a/consensus-types/blocks/getters_epbs_test.go +++ b/consensus-types/blocks/getters_epbs_test.go @@ -23,6 +23,7 @@ func Test_EpbsBlock_Copy(t *testing.T) { Slot: 2, Value: 3, BlobKzgCommitmentsRoot: bytesutil.PadTo([]byte("blobkzgcommitmentsroot"), fieldparams.RootLength), + GasLimit: 4, }, Signature: bytesutil.PadTo([]byte("signature"), fieldparams.BLSSignatureLength), } diff --git a/consensus-types/blocks/proto_test.go b/consensus-types/blocks/proto_test.go index 060e1564a908..e35333a8542c 100644 --- a/consensus-types/blocks/proto_test.go +++ b/consensus-types/blocks/proto_test.go @@ -1771,6 +1771,7 @@ func getFields() fields { Slot: 2, Value: 3, BlobKzgCommitmentsRoot: bytesutil.PadTo([]byte("blobkzgcommitmentsroot"), fieldparams.RootLength), + GasLimit: 4, }, Signature: bytesutil.PadTo([]byte("signature"), fieldparams.BLSSignatureLength), } diff --git a/consensus-types/blocks/setters_test.go b/consensus-types/blocks/setters_test.go index 40418106d2fa..961d165288dc 100644 --- a/consensus-types/blocks/setters_test.go +++ b/consensus-types/blocks/setters_test.go @@ -62,6 +62,7 @@ func Test_EpbsBlock_SetSignedExecutionPayloadHeader(t *testing.T) { Slot: 2, Value: 3, BlobKzgCommitmentsRoot: []byte("blobKzgCommitmentsRoot"), + GasLimit: 4, }, Signature: []byte("signature"), } diff --git a/proto/engine/v1/BUILD.bazel b/proto/engine/v1/BUILD.bazel index cc4902629bbb..fc7cddf2860e 100644 --- a/proto/engine/v1/BUILD.bazel +++ b/proto/engine/v1/BUILD.bazel @@ -47,12 +47,7 @@ ssz_gen_marshal( "PayloadAttestationData", "PayloadAttestation", "PayloadAttestationMessage", - "InclusionListSummaryEntry", - "InclusionListSummary", - "SignedInclusionListSummary", - "InclusionList", "ExecutionPayloadHeaderEPBS", - "ExecutionPayloadEPBS", "ExecutionPayloadEnvelope", "SignedExecutionPayloadHeader", "SignedExecutionPayloadEnvelope", diff --git a/proto/engine/v1/engine.ssz.go b/proto/engine/v1/engine.ssz.go index f3f42e523534..55ece253d5cd 100644 --- a/proto/engine/v1/engine.ssz.go +++ b/proto/engine/v1/engine.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: bdbc74649983e9eaaf1bafa335c21274f9abb3cf75505019386aef56246b55f0 +// Hash: 267522f5fc96f69efb25124116e9f3ed9853b6ff1f9be9868875ddb26ef0c20b package enginev1 import ( @@ -7,1142 +7,161 @@ import ( github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ) -// MarshalSSZ ssz marshals the InclusionListSummary object -func (i *InclusionListSummary) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(i) -} - -// MarshalSSZTo ssz marshals the InclusionListSummary object to a target array -func (i *InclusionListSummary) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(20) - - // Field (0) 'ProposerIndex' - dst = ssz.MarshalUint64(dst, uint64(i.ProposerIndex)) - - // Field (1) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(i.Slot)) - - // Offset (2) 'Summary' - dst = ssz.WriteOffset(dst, offset) - offset += len(i.Summary) * 20 - - // Field (2) 'Summary' - if size := len(i.Summary); size > 1024 { - err = ssz.ErrListTooBigFn("--.Summary", size, 1024) - return - } - for ii := 0; ii < len(i.Summary); ii++ { - if size := len(i.Summary[ii]); size != 20 { - err = ssz.ErrBytesLengthFn("--.Summary[ii]", size, 20) - return - } - dst = append(dst, i.Summary[ii]...) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the InclusionListSummary object -func (i *InclusionListSummary) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 20 { - return ssz.ErrSize - } - - tail := buf - var o2 uint64 - - // Field (0) 'ProposerIndex' - i.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'Slot' - i.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[8:16])) - - // Offset (2) 'Summary' - if o2 = ssz.ReadOffset(buf[16:20]); o2 > size { - return ssz.ErrOffset - } - - if o2 < 20 { - return ssz.ErrInvalidVariableOffset - } - - // Field (2) 'Summary' - { - buf = tail[o2:] - num, err := ssz.DivideInt2(len(buf), 20, 1024) - if err != nil { - return err - } - i.Summary = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(i.Summary[ii]) == 0 { - i.Summary[ii] = make([]byte, 0, len(buf[ii*20:(ii+1)*20])) - } - i.Summary[ii] = append(i.Summary[ii], buf[ii*20:(ii+1)*20]...) - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the InclusionListSummary object -func (i *InclusionListSummary) SizeSSZ() (size int) { - size = 20 - - // Field (2) 'Summary' - size += len(i.Summary) * 20 - - return -} - -// HashTreeRoot ssz hashes the InclusionListSummary object -func (i *InclusionListSummary) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(i) -} - -// HashTreeRootWith ssz hashes the InclusionListSummary object with a hasher -func (i *InclusionListSummary) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'ProposerIndex' - hh.PutUint64(uint64(i.ProposerIndex)) - - // Field (1) 'Slot' - hh.PutUint64(uint64(i.Slot)) - - // Field (2) 'Summary' - { - if size := len(i.Summary); size > 1024 { - err = ssz.ErrListTooBigFn("--.Summary", size, 1024) - return - } - subIndx := hh.Index() - for _, i := range i.Summary { - if len(i) != 20 { - err = ssz.ErrBytesLength - return - } - hh.PutBytes(i) - } - - numItems := uint64(len(i.Summary)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 1024) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 1024) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedInclusionListSummary object -func (s *SignedInclusionListSummary) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedInclusionListSummary object to a target array -func (s *SignedInclusionListSummary) 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(InclusionListSummary) - } - 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 SignedInclusionListSummary object -func (s *SignedInclusionListSummary) 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(InclusionListSummary) - } - if err = s.Message.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedInclusionListSummary object -func (s *SignedInclusionListSummary) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(InclusionListSummary) - } - size += s.Message.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedInclusionListSummary object -func (s *SignedInclusionListSummary) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedInclusionListSummary object with a hasher -func (s *SignedInclusionListSummary) 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 InclusionList object -func (i *InclusionList) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(i) -} - -// MarshalSSZTo ssz marshals the InclusionList object to a target array -func (i *InclusionList) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(40) - - // Offset (0) 'SignedSummary' - dst = ssz.WriteOffset(dst, offset) - if i.SignedSummary == nil { - i.SignedSummary = new(SignedInclusionListSummary) - } - offset += i.SignedSummary.SizeSSZ() - - // Field (1) 'ParentBlockHash' - if size := len(i.ParentBlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentBlockHash", size, 32) - return - } - dst = append(dst, i.ParentBlockHash...) - - // Offset (2) 'Transactions' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(i.Transactions); ii++ { - offset += 4 - offset += len(i.Transactions[ii]) - } - - // Field (0) 'SignedSummary' - if dst, err = i.SignedSummary.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Transactions' - if size := len(i.Transactions); size > 1024 { - err = ssz.ErrListTooBigFn("--.Transactions", size, 1024) - return - } - { - offset = 4 * len(i.Transactions) - for ii := 0; ii < len(i.Transactions); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += len(i.Transactions[ii]) - } - } - for ii := 0; ii < len(i.Transactions); ii++ { - if size := len(i.Transactions[ii]); size > 1073741824 { - err = ssz.ErrBytesLengthFn("--.Transactions[ii]", size, 1073741824) - return - } - dst = append(dst, i.Transactions[ii]...) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the InclusionList object -func (i *InclusionList) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 40 { - return ssz.ErrSize - } - - tail := buf - var o0, o2 uint64 - - // Offset (0) 'SignedSummary' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 40 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'ParentBlockHash' - if cap(i.ParentBlockHash) == 0 { - i.ParentBlockHash = make([]byte, 0, len(buf[4:36])) - } - i.ParentBlockHash = append(i.ParentBlockHash, buf[4:36]...) - - // Offset (2) 'Transactions' - if o2 = ssz.ReadOffset(buf[36:40]); o2 > size || o0 > o2 { - return ssz.ErrOffset - } - - // Field (0) 'SignedSummary' - { - buf = tail[o0:o2] - if i.SignedSummary == nil { - i.SignedSummary = new(SignedInclusionListSummary) - } - if err = i.SignedSummary.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (2) 'Transactions' - { - buf = tail[o2:] - num, err := ssz.DecodeDynamicLength(buf, 1024) - if err != nil { - return err - } - i.Transactions = make([][]byte, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if len(buf) > 1073741824 { - return ssz.ErrBytesLength - } - if cap(i.Transactions[indx]) == 0 { - i.Transactions[indx] = make([]byte, 0, len(buf)) - } - i.Transactions[indx] = append(i.Transactions[indx], buf...) - return nil - }) - if err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the InclusionList object -func (i *InclusionList) SizeSSZ() (size int) { - size = 40 - - // Field (0) 'SignedSummary' - if i.SignedSummary == nil { - i.SignedSummary = new(SignedInclusionListSummary) - } - size += i.SignedSummary.SizeSSZ() - - // Field (2) 'Transactions' - for ii := 0; ii < len(i.Transactions); ii++ { - size += 4 - size += len(i.Transactions[ii]) - } - - return -} - -// HashTreeRoot ssz hashes the InclusionList object -func (i *InclusionList) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(i) -} - -// HashTreeRootWith ssz hashes the InclusionList object with a hasher -func (i *InclusionList) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'SignedSummary' - if err = i.SignedSummary.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'ParentBlockHash' - if size := len(i.ParentBlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentBlockHash", size, 32) - return - } - hh.PutBytes(i.ParentBlockHash) - - // Field (2) 'Transactions' - { - subIndx := hh.Index() - num := uint64(len(i.Transactions)) - if num > 1024 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range i.Transactions { - { - elemIndx := hh.Index() - byteLen := uint64(len(elem)) - if byteLen > 1073741824 { - err = ssz.ErrIncorrectListSize - return - } - hh.AppendBytes32(elem) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1073741824+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1073741824+31)/32) - } - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1024) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1024) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the ExecutionPayloadHeaderEPBS object -func (e *ExecutionPayloadHeaderEPBS) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(e) -} - -// MarshalSSZTo ssz marshals the ExecutionPayloadHeaderEPBS object to a target array -func (e *ExecutionPayloadHeaderEPBS) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'ParentBlockHash' - if size := len(e.ParentBlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentBlockHash", size, 32) - return - } - dst = append(dst, e.ParentBlockHash...) - - // Field (1) 'ParentBlockRoot' - if size := len(e.ParentBlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentBlockRoot", size, 32) - return - } - dst = append(dst, e.ParentBlockRoot...) - - // Field (2) 'BlockHash' - if size := len(e.BlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) - return - } - dst = append(dst, e.BlockHash...) - - // Field (3) 'BuilderIndex' - dst = ssz.MarshalUint64(dst, uint64(e.BuilderIndex)) - - // Field (4) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(e.Slot)) - - // Field (5) 'Value' - dst = ssz.MarshalUint64(dst, e.Value) - - // Field (6) 'BlobKzgCommitmentsRoot' - if size := len(e.BlobKzgCommitmentsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlobKzgCommitmentsRoot", size, 32) - return - } - dst = append(dst, e.BlobKzgCommitmentsRoot...) - - return -} - -// UnmarshalSSZ ssz unmarshals the ExecutionPayloadHeaderEPBS object -func (e *ExecutionPayloadHeaderEPBS) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 152 { - return ssz.ErrSize - } - - // Field (0) 'ParentBlockHash' - if cap(e.ParentBlockHash) == 0 { - e.ParentBlockHash = make([]byte, 0, len(buf[0:32])) - } - e.ParentBlockHash = append(e.ParentBlockHash, buf[0:32]...) - - // Field (1) 'ParentBlockRoot' - if cap(e.ParentBlockRoot) == 0 { - e.ParentBlockRoot = make([]byte, 0, len(buf[32:64])) - } - e.ParentBlockRoot = append(e.ParentBlockRoot, buf[32:64]...) - - // Field (2) 'BlockHash' - if cap(e.BlockHash) == 0 { - e.BlockHash = make([]byte, 0, len(buf[64:96])) - } - e.BlockHash = append(e.BlockHash, buf[64:96]...) - - // Field (3) 'BuilderIndex' - e.BuilderIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[96:104])) - - // Field (4) 'Slot' - e.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[104:112])) - - // Field (5) 'Value' - e.Value = ssz.UnmarshallUint64(buf[112:120]) - - // Field (6) 'BlobKzgCommitmentsRoot' - if cap(e.BlobKzgCommitmentsRoot) == 0 { - e.BlobKzgCommitmentsRoot = make([]byte, 0, len(buf[120:152])) - } - e.BlobKzgCommitmentsRoot = append(e.BlobKzgCommitmentsRoot, buf[120:152]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadHeaderEPBS object -func (e *ExecutionPayloadHeaderEPBS) SizeSSZ() (size int) { - size = 152 - return -} - -// HashTreeRoot ssz hashes the ExecutionPayloadHeaderEPBS object -func (e *ExecutionPayloadHeaderEPBS) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(e) -} - -// HashTreeRootWith ssz hashes the ExecutionPayloadHeaderEPBS object with a hasher -func (e *ExecutionPayloadHeaderEPBS) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'ParentBlockHash' - if size := len(e.ParentBlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentBlockHash", size, 32) - return - } - hh.PutBytes(e.ParentBlockHash) - - // Field (1) 'ParentBlockRoot' - if size := len(e.ParentBlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentBlockRoot", size, 32) - return - } - hh.PutBytes(e.ParentBlockRoot) - - // Field (2) 'BlockHash' - if size := len(e.BlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) - return - } - hh.PutBytes(e.BlockHash) - - // Field (3) 'BuilderIndex' - hh.PutUint64(uint64(e.BuilderIndex)) - - // Field (4) 'Slot' - hh.PutUint64(uint64(e.Slot)) - - // Field (5) 'Value' - hh.PutUint64(e.Value) - - // Field (6) 'BlobKzgCommitmentsRoot' - if size := len(e.BlobKzgCommitmentsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlobKzgCommitmentsRoot", size, 32) - return - } - hh.PutBytes(e.BlobKzgCommitmentsRoot) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the ExecutionPayloadEPBS object -func (e *ExecutionPayloadEPBS) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(e) -} - -// MarshalSSZTo ssz marshals the ExecutionPayloadEPBS object to a target array -func (e *ExecutionPayloadEPBS) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(532) - - // Field (0) 'ParentHash' - if size := len(e.ParentHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) - return - } - dst = append(dst, e.ParentHash...) - - // Field (1) 'FeeRecipient' - if size := len(e.FeeRecipient); size != 20 { - err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) - return - } - dst = append(dst, e.FeeRecipient...) - - // Field (2) 'StateRoot' - if size := len(e.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - dst = append(dst, e.StateRoot...) - - // Field (3) 'ReceiptsRoot' - if size := len(e.ReceiptsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ReceiptsRoot", size, 32) - return - } - dst = append(dst, e.ReceiptsRoot...) - - // Field (4) 'LogsBloom' - if size := len(e.LogsBloom); size != 256 { - err = ssz.ErrBytesLengthFn("--.LogsBloom", size, 256) - return - } - dst = append(dst, e.LogsBloom...) - - // Field (5) 'PrevRandao' - if size := len(e.PrevRandao); size != 32 { - err = ssz.ErrBytesLengthFn("--.PrevRandao", size, 32) - return - } - dst = append(dst, e.PrevRandao...) - - // Field (6) 'BlockNumber' - dst = ssz.MarshalUint64(dst, e.BlockNumber) - - // Field (7) 'GasLimit' - dst = ssz.MarshalUint64(dst, e.GasLimit) - - // Field (8) 'GasUsed' - dst = ssz.MarshalUint64(dst, e.GasUsed) - - // Field (9) 'Timestamp' - dst = ssz.MarshalUint64(dst, e.Timestamp) - - // Offset (10) 'ExtraData' - dst = ssz.WriteOffset(dst, offset) - offset += len(e.ExtraData) - - // Field (11) 'BaseFeePerGas' - if size := len(e.BaseFeePerGas); size != 32 { - err = ssz.ErrBytesLengthFn("--.BaseFeePerGas", size, 32) - return - } - dst = append(dst, e.BaseFeePerGas...) - - // Field (12) 'BlockHash' - if size := len(e.BlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) - return - } - dst = append(dst, e.BlockHash...) - - // Offset (13) 'Transactions' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(e.Transactions); ii++ { - offset += 4 - offset += len(e.Transactions[ii]) - } - - // Offset (14) 'Withdrawals' - dst = ssz.WriteOffset(dst, offset) - offset += len(e.Withdrawals) * 44 - - // Field (15) 'BlobGasUsed' - dst = ssz.MarshalUint64(dst, e.BlobGasUsed) - - // Field (16) 'ExcessBlobGas' - dst = ssz.MarshalUint64(dst, e.ExcessBlobGas) - - // Offset (17) 'InclusionListSummary' - dst = ssz.WriteOffset(dst, offset) - offset += len(e.InclusionListSummary) * 20 - - // Field (10) 'ExtraData' - if size := len(e.ExtraData); size > 32 { - err = ssz.ErrBytesLengthFn("--.ExtraData", size, 32) - return - } - dst = append(dst, e.ExtraData...) - - // Field (13) 'Transactions' - if size := len(e.Transactions); size > 1048576 { - err = ssz.ErrListTooBigFn("--.Transactions", size, 1048576) - return - } - { - offset = 4 * len(e.Transactions) - for ii := 0; ii < len(e.Transactions); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += len(e.Transactions[ii]) - } - } - for ii := 0; ii < len(e.Transactions); ii++ { - if size := len(e.Transactions[ii]); size > 1073741824 { - err = ssz.ErrBytesLengthFn("--.Transactions[ii]", size, 1073741824) - return - } - dst = append(dst, e.Transactions[ii]...) - } - - // Field (14) 'Withdrawals' - if size := len(e.Withdrawals); size > 16 { - err = ssz.ErrListTooBigFn("--.Withdrawals", size, 16) - return - } - for ii := 0; ii < len(e.Withdrawals); ii++ { - if dst, err = e.Withdrawals[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (17) 'InclusionListSummary' - if size := len(e.InclusionListSummary); size > 1024 { - err = ssz.ErrListTooBigFn("--.InclusionListSummary", size, 1024) - return - } - for ii := 0; ii < len(e.InclusionListSummary); ii++ { - if size := len(e.InclusionListSummary[ii]); size != 20 { - err = ssz.ErrBytesLengthFn("--.InclusionListSummary[ii]", size, 20) - return - } - dst = append(dst, e.InclusionListSummary[ii]...) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the ExecutionPayloadEPBS object -func (e *ExecutionPayloadEPBS) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 532 { - return ssz.ErrSize - } - - tail := buf - var o10, o13, o14, o17 uint64 - - // Field (0) 'ParentHash' - if cap(e.ParentHash) == 0 { - e.ParentHash = make([]byte, 0, len(buf[0:32])) - } - e.ParentHash = append(e.ParentHash, buf[0:32]...) - - // Field (1) 'FeeRecipient' - if cap(e.FeeRecipient) == 0 { - e.FeeRecipient = make([]byte, 0, len(buf[32:52])) - } - e.FeeRecipient = append(e.FeeRecipient, buf[32:52]...) - - // Field (2) 'StateRoot' - if cap(e.StateRoot) == 0 { - e.StateRoot = make([]byte, 0, len(buf[52:84])) - } - e.StateRoot = append(e.StateRoot, buf[52:84]...) - - // Field (3) 'ReceiptsRoot' - if cap(e.ReceiptsRoot) == 0 { - e.ReceiptsRoot = make([]byte, 0, len(buf[84:116])) - } - e.ReceiptsRoot = append(e.ReceiptsRoot, buf[84:116]...) - - // Field (4) 'LogsBloom' - if cap(e.LogsBloom) == 0 { - e.LogsBloom = make([]byte, 0, len(buf[116:372])) - } - e.LogsBloom = append(e.LogsBloom, buf[116:372]...) - - // Field (5) 'PrevRandao' - if cap(e.PrevRandao) == 0 { - e.PrevRandao = make([]byte, 0, len(buf[372:404])) - } - e.PrevRandao = append(e.PrevRandao, buf[372:404]...) - - // Field (6) 'BlockNumber' - e.BlockNumber = ssz.UnmarshallUint64(buf[404:412]) - - // Field (7) 'GasLimit' - e.GasLimit = ssz.UnmarshallUint64(buf[412:420]) - - // Field (8) 'GasUsed' - e.GasUsed = ssz.UnmarshallUint64(buf[420:428]) - - // Field (9) 'Timestamp' - e.Timestamp = ssz.UnmarshallUint64(buf[428:436]) - - // Offset (10) 'ExtraData' - if o10 = ssz.ReadOffset(buf[436:440]); o10 > size { - return ssz.ErrOffset - } - - if o10 < 532 { - return ssz.ErrInvalidVariableOffset - } - - // Field (11) 'BaseFeePerGas' - if cap(e.BaseFeePerGas) == 0 { - e.BaseFeePerGas = make([]byte, 0, len(buf[440:472])) - } - e.BaseFeePerGas = append(e.BaseFeePerGas, buf[440:472]...) - - // Field (12) 'BlockHash' - if cap(e.BlockHash) == 0 { - e.BlockHash = make([]byte, 0, len(buf[472:504])) - } - e.BlockHash = append(e.BlockHash, buf[472:504]...) - - // Offset (13) 'Transactions' - if o13 = ssz.ReadOffset(buf[504:508]); o13 > size || o10 > o13 { - return ssz.ErrOffset - } - - // Offset (14) 'Withdrawals' - if o14 = ssz.ReadOffset(buf[508:512]); o14 > size || o13 > o14 { - return ssz.ErrOffset - } - - // Field (15) 'BlobGasUsed' - e.BlobGasUsed = ssz.UnmarshallUint64(buf[512:520]) - - // Field (16) 'ExcessBlobGas' - e.ExcessBlobGas = ssz.UnmarshallUint64(buf[520:528]) - - // Offset (17) 'InclusionListSummary' - if o17 = ssz.ReadOffset(buf[528:532]); o17 > size || o14 > o17 { - return ssz.ErrOffset - } - - // Field (10) 'ExtraData' - { - buf = tail[o10:o13] - if len(buf) > 32 { - return ssz.ErrBytesLength - } - if cap(e.ExtraData) == 0 { - e.ExtraData = make([]byte, 0, len(buf)) - } - e.ExtraData = append(e.ExtraData, buf...) - } - - // Field (13) 'Transactions' - { - buf = tail[o13:o14] - num, err := ssz.DecodeDynamicLength(buf, 1048576) - if err != nil { - return err - } - e.Transactions = make([][]byte, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if len(buf) > 1073741824 { - return ssz.ErrBytesLength - } - if cap(e.Transactions[indx]) == 0 { - e.Transactions[indx] = make([]byte, 0, len(buf)) - } - e.Transactions[indx] = append(e.Transactions[indx], buf...) - return nil - }) - if err != nil { - return err - } +// MarshalSSZ ssz marshals the ExecutionPayloadHeaderEPBS object +func (e *ExecutionPayloadHeaderEPBS) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(e) +} + +// MarshalSSZTo ssz marshals the ExecutionPayloadHeaderEPBS object to a target array +func (e *ExecutionPayloadHeaderEPBS) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'ParentBlockHash' + if size := len(e.ParentBlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentBlockHash", size, 32) + return } + dst = append(dst, e.ParentBlockHash...) - // Field (14) 'Withdrawals' - { - buf = tail[o14:o17] - num, err := ssz.DivideInt2(len(buf), 44, 16) - if err != nil { - return err - } - e.Withdrawals = make([]*Withdrawal, num) - for ii := 0; ii < num; ii++ { - if e.Withdrawals[ii] == nil { - e.Withdrawals[ii] = new(Withdrawal) - } - if err = e.Withdrawals[ii].UnmarshalSSZ(buf[ii*44 : (ii+1)*44]); err != nil { - return err - } - } + // Field (1) 'ParentBlockRoot' + if size := len(e.ParentBlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentBlockRoot", size, 32) + return } + dst = append(dst, e.ParentBlockRoot...) - // Field (17) 'InclusionListSummary' - { - buf = tail[o17:] - num, err := ssz.DivideInt2(len(buf), 20, 1024) - if err != nil { - return err - } - e.InclusionListSummary = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(e.InclusionListSummary[ii]) == 0 { - e.InclusionListSummary[ii] = make([]byte, 0, len(buf[ii*20:(ii+1)*20])) - } - e.InclusionListSummary[ii] = append(e.InclusionListSummary[ii], buf[ii*20:(ii+1)*20]...) - } + // Field (2) 'BlockHash' + if size := len(e.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) + return } - return err -} + dst = append(dst, e.BlockHash...) -// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadEPBS object -func (e *ExecutionPayloadEPBS) SizeSSZ() (size int) { - size = 532 + // Field (3) 'GasLimit' + dst = ssz.MarshalUint64(dst, e.GasLimit) - // Field (10) 'ExtraData' - size += len(e.ExtraData) + // Field (4) 'BuilderIndex' + dst = ssz.MarshalUint64(dst, uint64(e.BuilderIndex)) - // Field (13) 'Transactions' - for ii := 0; ii < len(e.Transactions); ii++ { - size += 4 - size += len(e.Transactions[ii]) - } + // Field (5) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(e.Slot)) - // Field (14) 'Withdrawals' - size += len(e.Withdrawals) * 44 + // Field (6) 'Value' + dst = ssz.MarshalUint64(dst, e.Value) - // Field (17) 'InclusionListSummary' - size += len(e.InclusionListSummary) * 20 + // Field (7) 'BlobKzgCommitmentsRoot' + if size := len(e.BlobKzgCommitmentsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlobKzgCommitmentsRoot", size, 32) + return + } + dst = append(dst, e.BlobKzgCommitmentsRoot...) return } -// HashTreeRoot ssz hashes the ExecutionPayloadEPBS object -func (e *ExecutionPayloadEPBS) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(e) -} - -// HashTreeRootWith ssz hashes the ExecutionPayloadEPBS object with a hasher -func (e *ExecutionPayloadEPBS) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'ParentHash' - if size := len(e.ParentHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) - return +// UnmarshalSSZ ssz unmarshals the ExecutionPayloadHeaderEPBS object +func (e *ExecutionPayloadHeaderEPBS) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 160 { + return ssz.ErrSize } - hh.PutBytes(e.ParentHash) - // Field (1) 'FeeRecipient' - if size := len(e.FeeRecipient); size != 20 { - err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) - return + // Field (0) 'ParentBlockHash' + if cap(e.ParentBlockHash) == 0 { + e.ParentBlockHash = make([]byte, 0, len(buf[0:32])) } - hh.PutBytes(e.FeeRecipient) + e.ParentBlockHash = append(e.ParentBlockHash, buf[0:32]...) - // Field (2) 'StateRoot' - if size := len(e.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return + // Field (1) 'ParentBlockRoot' + if cap(e.ParentBlockRoot) == 0 { + e.ParentBlockRoot = make([]byte, 0, len(buf[32:64])) } - hh.PutBytes(e.StateRoot) + e.ParentBlockRoot = append(e.ParentBlockRoot, buf[32:64]...) - // Field (3) 'ReceiptsRoot' - if size := len(e.ReceiptsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ReceiptsRoot", size, 32) - return + // Field (2) 'BlockHash' + if cap(e.BlockHash) == 0 { + e.BlockHash = make([]byte, 0, len(buf[64:96])) } - hh.PutBytes(e.ReceiptsRoot) + e.BlockHash = append(e.BlockHash, buf[64:96]...) - // Field (4) 'LogsBloom' - if size := len(e.LogsBloom); size != 256 { - err = ssz.ErrBytesLengthFn("--.LogsBloom", size, 256) - return - } - hh.PutBytes(e.LogsBloom) + // Field (3) 'GasLimit' + e.GasLimit = ssz.UnmarshallUint64(buf[96:104]) - // Field (5) 'PrevRandao' - if size := len(e.PrevRandao); size != 32 { - err = ssz.ErrBytesLengthFn("--.PrevRandao", size, 32) - return + // Field (4) 'BuilderIndex' + e.BuilderIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[104:112])) + + // Field (5) 'Slot' + e.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[112:120])) + + // Field (6) 'Value' + e.Value = ssz.UnmarshallUint64(buf[120:128]) + + // Field (7) 'BlobKzgCommitmentsRoot' + if cap(e.BlobKzgCommitmentsRoot) == 0 { + e.BlobKzgCommitmentsRoot = make([]byte, 0, len(buf[128:160])) } - hh.PutBytes(e.PrevRandao) + e.BlobKzgCommitmentsRoot = append(e.BlobKzgCommitmentsRoot, buf[128:160]...) - // Field (6) 'BlockNumber' - hh.PutUint64(e.BlockNumber) + return err +} - // Field (7) 'GasLimit' - hh.PutUint64(e.GasLimit) +// SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadHeaderEPBS object +func (e *ExecutionPayloadHeaderEPBS) SizeSSZ() (size int) { + size = 160 + return +} - // Field (8) 'GasUsed' - hh.PutUint64(e.GasUsed) +// HashTreeRoot ssz hashes the ExecutionPayloadHeaderEPBS object +func (e *ExecutionPayloadHeaderEPBS) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(e) +} - // Field (9) 'Timestamp' - hh.PutUint64(e.Timestamp) +// HashTreeRootWith ssz hashes the ExecutionPayloadHeaderEPBS object with a hasher +func (e *ExecutionPayloadHeaderEPBS) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() - // Field (10) 'ExtraData' - { - elemIndx := hh.Index() - byteLen := uint64(len(e.ExtraData)) - if byteLen > 32 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(e.ExtraData) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (32+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (32+31)/32) - } + // Field (0) 'ParentBlockHash' + if size := len(e.ParentBlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentBlockHash", size, 32) + return } + hh.PutBytes(e.ParentBlockHash) - // Field (11) 'BaseFeePerGas' - if size := len(e.BaseFeePerGas); size != 32 { - err = ssz.ErrBytesLengthFn("--.BaseFeePerGas", size, 32) + // Field (1) 'ParentBlockRoot' + if size := len(e.ParentBlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentBlockRoot", size, 32) return } - hh.PutBytes(e.BaseFeePerGas) + hh.PutBytes(e.ParentBlockRoot) - // Field (12) 'BlockHash' + // Field (2) 'BlockHash' if size := len(e.BlockHash); size != 32 { err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) return } hh.PutBytes(e.BlockHash) - // Field (13) 'Transactions' - { - subIndx := hh.Index() - num := uint64(len(e.Transactions)) - if num > 1048576 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range e.Transactions { - { - elemIndx := hh.Index() - byteLen := uint64(len(elem)) - if byteLen > 1073741824 { - err = ssz.ErrIncorrectListSize - return - } - hh.AppendBytes32(elem) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1073741824+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1073741824+31)/32) - } - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1048576) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1048576) - } - } - - // Field (14) 'Withdrawals' - { - subIndx := hh.Index() - num := uint64(len(e.Withdrawals)) - if num > 16 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range e.Withdrawals { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } + // Field (3) 'GasLimit' + hh.PutUint64(e.GasLimit) - // Field (15) 'BlobGasUsed' - hh.PutUint64(e.BlobGasUsed) + // Field (4) 'BuilderIndex' + hh.PutUint64(uint64(e.BuilderIndex)) - // Field (16) 'ExcessBlobGas' - hh.PutUint64(e.ExcessBlobGas) + // Field (5) 'Slot' + hh.PutUint64(uint64(e.Slot)) - // Field (17) 'InclusionListSummary' - { - if size := len(e.InclusionListSummary); size > 1024 { - err = ssz.ErrListTooBigFn("--.InclusionListSummary", size, 1024) - return - } - subIndx := hh.Index() - for _, i := range e.InclusionListSummary { - if len(i) != 20 { - err = ssz.ErrBytesLength - return - } - hh.PutBytes(i) - } + // Field (6) 'Value' + hh.PutUint64(e.Value) - numItems := uint64(len(e.InclusionListSummary)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 1024) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 1024) - } + // Field (7) 'BlobKzgCommitmentsRoot' + if size := len(e.BlobKzgCommitmentsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlobKzgCommitmentsRoot", size, 32) + return } + hh.PutBytes(e.BlobKzgCommitmentsRoot) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1177,7 +196,7 @@ func (s *SignedExecutionPayloadHeader) MarshalSSZTo(buf []byte) (dst []byte, err func (s *SignedExecutionPayloadHeader) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size != 248 { + if size != 256 { return ssz.ErrSize } @@ -1185,22 +204,22 @@ func (s *SignedExecutionPayloadHeader) UnmarshalSSZ(buf []byte) error { if s.Message == nil { s.Message = new(ExecutionPayloadHeaderEPBS) } - if err = s.Message.UnmarshalSSZ(buf[0:152]); err != nil { + if err = s.Message.UnmarshalSSZ(buf[0:160]); err != nil { return err } // Field (1) 'Signature' if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[152:248])) + s.Signature = make([]byte, 0, len(buf[160:256])) } - s.Signature = append(s.Signature, buf[152:248]...) + s.Signature = append(s.Signature, buf[160:256]...) return err } // SizeSSZ returns the ssz encoded size in bytes for the SignedExecutionPayloadHeader object func (s *SignedExecutionPayloadHeader) SizeSSZ() (size int) { - size = 248 + size = 256 return } @@ -1225,11 +244,7 @@ func (s *SignedExecutionPayloadHeader) HashTreeRootWith(hh *ssz.Hasher) (err err } hh.PutBytes(s.Signature) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1241,12 +256,12 @@ func (e *ExecutionPayloadEnvelope) MarshalSSZ() ([]byte, error) { // MarshalSSZTo ssz marshals the ExecutionPayloadEnvelope object to a target array func (e *ExecutionPayloadEnvelope) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - offset := int(193) + offset := int(81) // Offset (0) 'Payload' dst = ssz.WriteOffset(dst, offset) if e.Payload == nil { - e.Payload = new(ExecutionPayloadEPBS) + e.Payload = new(ExecutionPayloadElectra) } offset += e.Payload.SizeSSZ() @@ -1264,23 +279,10 @@ func (e *ExecutionPayloadEnvelope) MarshalSSZTo(buf []byte) (dst []byte, err err dst = ssz.WriteOffset(dst, offset) offset += len(e.BlobKzgCommitments) * 48 - // Field (4) 'InclusionListProposerIndex' - dst = ssz.MarshalUint64(dst, uint64(e.InclusionListProposerIndex)) - - // Field (5) 'InclusionListSlot' - dst = ssz.MarshalUint64(dst, uint64(e.InclusionListSlot)) - - // Field (6) 'InclusionListSignature' - if size := len(e.InclusionListSignature); size != 96 { - err = ssz.ErrBytesLengthFn("--.InclusionListSignature", size, 96) - return - } - dst = append(dst, e.InclusionListSignature...) - - // Field (7) 'PayloadWithheld' + // Field (4) 'PayloadWithheld' dst = ssz.MarshalBool(dst, e.PayloadWithheld) - // Field (8) 'StateRoot' + // Field (5) 'StateRoot' if size := len(e.StateRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return @@ -1312,7 +314,7 @@ func (e *ExecutionPayloadEnvelope) MarshalSSZTo(buf []byte) (dst []byte, err err func (e *ExecutionPayloadEnvelope) UnmarshalSSZ(buf []byte) error { var err error size := uint64(len(buf)) - if size < 193 { + if size < 81 { return ssz.ErrSize } @@ -1324,7 +326,7 @@ func (e *ExecutionPayloadEnvelope) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o0 < 193 { + if o0 != 81 { return ssz.ErrInvalidVariableOffset } @@ -1342,32 +344,20 @@ func (e *ExecutionPayloadEnvelope) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - // Field (4) 'InclusionListProposerIndex' - e.InclusionListProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[48:56])) - - // Field (5) 'InclusionListSlot' - e.InclusionListSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[56:64])) - - // Field (6) 'InclusionListSignature' - if cap(e.InclusionListSignature) == 0 { - e.InclusionListSignature = make([]byte, 0, len(buf[64:160])) - } - e.InclusionListSignature = append(e.InclusionListSignature, buf[64:160]...) - - // Field (7) 'PayloadWithheld' - e.PayloadWithheld = ssz.UnmarshalBool(buf[160:161]) + // Field (4) 'PayloadWithheld' + e.PayloadWithheld = ssz.UnmarshalBool(buf[48:49]) - // Field (8) 'StateRoot' + // Field (5) 'StateRoot' if cap(e.StateRoot) == 0 { - e.StateRoot = make([]byte, 0, len(buf[161:193])) + e.StateRoot = make([]byte, 0, len(buf[49:81])) } - e.StateRoot = append(e.StateRoot, buf[161:193]...) + e.StateRoot = append(e.StateRoot, buf[49:81]...) // Field (0) 'Payload' { buf = tail[o0:o3] if e.Payload == nil { - e.Payload = new(ExecutionPayloadEPBS) + e.Payload = new(ExecutionPayloadElectra) } if err = e.Payload.UnmarshalSSZ(buf); err != nil { return err @@ -1394,11 +384,11 @@ func (e *ExecutionPayloadEnvelope) UnmarshalSSZ(buf []byte) error { // SizeSSZ returns the ssz encoded size in bytes for the ExecutionPayloadEnvelope object func (e *ExecutionPayloadEnvelope) SizeSSZ() (size int) { - size = 193 + size = 81 // Field (0) 'Payload' if e.Payload == nil { - e.Payload = new(ExecutionPayloadEPBS) + e.Payload = new(ExecutionPayloadElectra) } size += e.Payload.SizeSSZ() @@ -1448,41 +438,20 @@ func (e *ExecutionPayloadEnvelope) HashTreeRootWith(hh *ssz.Hasher) (err error) } numItems := uint64(len(e.BlobKzgCommitments)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - } - - // Field (4) 'InclusionListProposerIndex' - hh.PutUint64(uint64(e.InclusionListProposerIndex)) - - // Field (5) 'InclusionListSlot' - hh.PutUint64(uint64(e.InclusionListSlot)) - - // Field (6) 'InclusionListSignature' - if size := len(e.InclusionListSignature); size != 96 { - err = ssz.ErrBytesLengthFn("--.InclusionListSignature", size, 96) - return + hh.MerkleizeWithMixin(subIndx, numItems, 4096) } - hh.PutBytes(e.InclusionListSignature) - // Field (7) 'PayloadWithheld' + // Field (4) 'PayloadWithheld' hh.PutBool(e.PayloadWithheld) - // Field (8) 'StateRoot' + // Field (5) 'StateRoot' if size := len(e.StateRoot); size != 32 { err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(e.StateRoot) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } @@ -1534,7 +503,7 @@ func (s *SignedExecutionPayloadEnvelope) UnmarshalSSZ(buf []byte) error { return ssz.ErrOffset } - if o0 < 100 { + if o0 != 100 { return ssz.ErrInvalidVariableOffset } @@ -1591,11 +560,7 @@ func (s *SignedExecutionPayloadEnvelope) HashTreeRootWith(hh *ssz.Hasher) (err e } hh.PutBytes(s.Signature) - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } + hh.Merkleize(indx) return } diff --git a/proto/engine/v1/epbs.pb.go b/proto/engine/v1/epbs.pb.go index d500ec13de5a..51f8ea8131bc 100755 --- a/proto/engine/v1/epbs.pb.go +++ b/proto/engine/v1/epbs.pb.go @@ -23,187 +23,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type InclusionListSummary struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProposerIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=proposer_index,json=proposerIndex,proto3" json:"proposer_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` - Slot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,2,opt,name=slot,proto3" json:"slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` - Summary [][]byte `protobuf:"bytes,3,rep,name=summary,proto3" json:"summary,omitempty" ssz-max:"1024" ssz-size:"?,20"` -} - -func (x *InclusionListSummary) Reset() { - *x = InclusionListSummary{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InclusionListSummary) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InclusionListSummary) ProtoMessage() {} - -func (x *InclusionListSummary) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InclusionListSummary.ProtoReflect.Descriptor instead. -func (*InclusionListSummary) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{0} -} - -func (x *InclusionListSummary) GetProposerIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { - if x != nil { - return x.ProposerIndex - } - return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) -} - -func (x *InclusionListSummary) GetSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { - if x != nil { - return x.Slot - } - return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) -} - -func (x *InclusionListSummary) GetSummary() [][]byte { - if x != nil { - return x.Summary - } - return nil -} - -type SignedInclusionListSummary struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Message *InclusionListSummary `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"` -} - -func (x *SignedInclusionListSummary) Reset() { - *x = SignedInclusionListSummary{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignedInclusionListSummary) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignedInclusionListSummary) ProtoMessage() {} - -func (x *SignedInclusionListSummary) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignedInclusionListSummary.ProtoReflect.Descriptor instead. -func (*SignedInclusionListSummary) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{1} -} - -func (x *SignedInclusionListSummary) GetMessage() *InclusionListSummary { - if x != nil { - return x.Message - } - return nil -} - -func (x *SignedInclusionListSummary) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -type InclusionList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SignedSummary *SignedInclusionListSummary `protobuf:"bytes,1,opt,name=signed_summary,json=signedSummary,proto3" json:"signed_summary,omitempty"` - ParentBlockHash []byte `protobuf:"bytes,2,opt,name=parent_block_hash,json=parentBlockHash,proto3" json:"parent_block_hash,omitempty" ssz-size:"32"` - Transactions [][]byte `protobuf:"bytes,3,rep,name=transactions,proto3" json:"transactions,omitempty" ssz-max:"1024,1073741824" ssz-size:"?,?"` -} - -func (x *InclusionList) Reset() { - *x = InclusionList{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InclusionList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InclusionList) ProtoMessage() {} - -func (x *InclusionList) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InclusionList.ProtoReflect.Descriptor instead. -func (*InclusionList) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{2} -} - -func (x *InclusionList) GetSignedSummary() *SignedInclusionListSummary { - if x != nil { - return x.SignedSummary - } - return nil -} - -func (x *InclusionList) GetParentBlockHash() []byte { - if x != nil { - return x.ParentBlockHash - } - return nil -} - -func (x *InclusionList) GetTransactions() [][]byte { - if x != nil { - return x.Transactions - } - return nil -} - type ExecutionPayloadHeaderEPBS struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -212,16 +31,17 @@ type ExecutionPayloadHeaderEPBS struct { ParentBlockHash []byte `protobuf:"bytes,1,opt,name=parent_block_hash,json=parentBlockHash,proto3" json:"parent_block_hash,omitempty" ssz-size:"32"` ParentBlockRoot []byte `protobuf:"bytes,2,opt,name=parent_block_root,json=parentBlockRoot,proto3" json:"parent_block_root,omitempty" ssz-size:"32"` BlockHash []byte `protobuf:"bytes,3,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty" ssz-size:"32"` - BuilderIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,4,opt,name=builder_index,json=builderIndex,proto3" json:"builder_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` - Slot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,5,opt,name=slot,proto3" json:"slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` - Value uint64 `protobuf:"varint,6,opt,name=value,proto3" json:"value,omitempty"` - BlobKzgCommitmentsRoot []byte `protobuf:"bytes,7,opt,name=blob_kzg_commitments_root,json=blobKzgCommitmentsRoot,proto3" json:"blob_kzg_commitments_root,omitempty" ssz-size:"32"` + GasLimit uint64 `protobuf:"varint,4,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` + BuilderIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,5,opt,name=builder_index,json=builderIndex,proto3" json:"builder_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` + Slot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,6,opt,name=slot,proto3" json:"slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` + Value uint64 `protobuf:"varint,7,opt,name=value,proto3" json:"value,omitempty"` + BlobKzgCommitmentsRoot []byte `protobuf:"bytes,8,opt,name=blob_kzg_commitments_root,json=blobKzgCommitmentsRoot,proto3" json:"blob_kzg_commitments_root,omitempty" ssz-size:"32"` } func (x *ExecutionPayloadHeaderEPBS) Reset() { *x = ExecutionPayloadHeaderEPBS{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[3] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -234,7 +54,7 @@ func (x *ExecutionPayloadHeaderEPBS) String() string { func (*ExecutionPayloadHeaderEPBS) ProtoMessage() {} func (x *ExecutionPayloadHeaderEPBS) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[3] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -247,7 +67,7 @@ func (x *ExecutionPayloadHeaderEPBS) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadHeaderEPBS.ProtoReflect.Descriptor instead. func (*ExecutionPayloadHeaderEPBS) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{3} + return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{0} } func (x *ExecutionPayloadHeaderEPBS) GetParentBlockHash() []byte { @@ -271,6 +91,13 @@ func (x *ExecutionPayloadHeaderEPBS) GetBlockHash() []byte { return nil } +func (x *ExecutionPayloadHeaderEPBS) GetGasLimit() uint64 { + if x != nil { + return x.GasLimit + } + return 0 +} + func (x *ExecutionPayloadHeaderEPBS) GetBuilderIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { if x != nil { return x.BuilderIndex @@ -299,189 +126,6 @@ func (x *ExecutionPayloadHeaderEPBS) GetBlobKzgCommitmentsRoot() []byte { return nil } -type ExecutionPayloadEPBS struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ParentHash []byte `protobuf:"bytes,1,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty" ssz-size:"32"` - FeeRecipient []byte `protobuf:"bytes,2,opt,name=fee_recipient,json=feeRecipient,proto3" json:"fee_recipient,omitempty" ssz-size:"20"` - StateRoot []byte `protobuf:"bytes,3,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"` - ReceiptsRoot []byte `protobuf:"bytes,4,opt,name=receipts_root,json=receiptsRoot,proto3" json:"receipts_root,omitempty" ssz-size:"32"` - LogsBloom []byte `protobuf:"bytes,5,opt,name=logs_bloom,json=logsBloom,proto3" json:"logs_bloom,omitempty" ssz-size:"256"` - PrevRandao []byte `protobuf:"bytes,6,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"` - BlockNumber uint64 `protobuf:"varint,7,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` - GasLimit uint64 `protobuf:"varint,8,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` - GasUsed uint64 `protobuf:"varint,9,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` - Timestamp uint64 `protobuf:"varint,10,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - ExtraData []byte `protobuf:"bytes,11,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty" ssz-max:"32"` - BaseFeePerGas []byte `protobuf:"bytes,12,opt,name=base_fee_per_gas,json=baseFeePerGas,proto3" json:"base_fee_per_gas,omitempty" ssz-size:"32"` - BlockHash []byte `protobuf:"bytes,13,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty" ssz-size:"32"` - Transactions [][]byte `protobuf:"bytes,14,rep,name=transactions,proto3" json:"transactions,omitempty" ssz-max:"1048576,1073741824" ssz-size:"?,?"` - Withdrawals []*Withdrawal `protobuf:"bytes,15,rep,name=withdrawals,proto3" json:"withdrawals,omitempty" ssz-max:"16"` - BlobGasUsed uint64 `protobuf:"varint,16,opt,name=blob_gas_used,json=blobGasUsed,proto3" json:"blob_gas_used,omitempty"` - ExcessBlobGas uint64 `protobuf:"varint,17,opt,name=excess_blob_gas,json=excessBlobGas,proto3" json:"excess_blob_gas,omitempty"` - InclusionListSummary [][]byte `protobuf:"bytes,18,rep,name=inclusion_list_summary,json=inclusionListSummary,proto3" json:"inclusion_list_summary,omitempty" ssz-max:"1024" ssz-size:"?,20"` -} - -func (x *ExecutionPayloadEPBS) Reset() { - *x = ExecutionPayloadEPBS{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExecutionPayloadEPBS) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExecutionPayloadEPBS) ProtoMessage() {} - -func (x *ExecutionPayloadEPBS) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExecutionPayloadEPBS.ProtoReflect.Descriptor instead. -func (*ExecutionPayloadEPBS) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{4} -} - -func (x *ExecutionPayloadEPBS) GetParentHash() []byte { - if x != nil { - return x.ParentHash - } - return nil -} - -func (x *ExecutionPayloadEPBS) GetFeeRecipient() []byte { - if x != nil { - return x.FeeRecipient - } - return nil -} - -func (x *ExecutionPayloadEPBS) GetStateRoot() []byte { - if x != nil { - return x.StateRoot - } - return nil -} - -func (x *ExecutionPayloadEPBS) GetReceiptsRoot() []byte { - if x != nil { - return x.ReceiptsRoot - } - return nil -} - -func (x *ExecutionPayloadEPBS) GetLogsBloom() []byte { - if x != nil { - return x.LogsBloom - } - return nil -} - -func (x *ExecutionPayloadEPBS) GetPrevRandao() []byte { - if x != nil { - return x.PrevRandao - } - return nil -} - -func (x *ExecutionPayloadEPBS) GetBlockNumber() uint64 { - if x != nil { - return x.BlockNumber - } - return 0 -} - -func (x *ExecutionPayloadEPBS) GetGasLimit() uint64 { - if x != nil { - return x.GasLimit - } - return 0 -} - -func (x *ExecutionPayloadEPBS) GetGasUsed() uint64 { - if x != nil { - return x.GasUsed - } - return 0 -} - -func (x *ExecutionPayloadEPBS) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *ExecutionPayloadEPBS) GetExtraData() []byte { - if x != nil { - return x.ExtraData - } - return nil -} - -func (x *ExecutionPayloadEPBS) GetBaseFeePerGas() []byte { - if x != nil { - return x.BaseFeePerGas - } - return nil -} - -func (x *ExecutionPayloadEPBS) GetBlockHash() []byte { - if x != nil { - return x.BlockHash - } - return nil -} - -func (x *ExecutionPayloadEPBS) GetTransactions() [][]byte { - if x != nil { - return x.Transactions - } - return nil -} - -func (x *ExecutionPayloadEPBS) GetWithdrawals() []*Withdrawal { - if x != nil { - return x.Withdrawals - } - return nil -} - -func (x *ExecutionPayloadEPBS) GetBlobGasUsed() uint64 { - if x != nil { - return x.BlobGasUsed - } - return 0 -} - -func (x *ExecutionPayloadEPBS) GetExcessBlobGas() uint64 { - if x != nil { - return x.ExcessBlobGas - } - return 0 -} - -func (x *ExecutionPayloadEPBS) GetInclusionListSummary() [][]byte { - if x != nil { - return x.InclusionListSummary - } - return nil -} - type SignedExecutionPayloadHeader struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -494,7 +138,7 @@ type SignedExecutionPayloadHeader struct { func (x *SignedExecutionPayloadHeader) Reset() { *x = SignedExecutionPayloadHeader{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[5] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -507,7 +151,7 @@ func (x *SignedExecutionPayloadHeader) String() string { func (*SignedExecutionPayloadHeader) ProtoMessage() {} func (x *SignedExecutionPayloadHeader) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[5] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -520,7 +164,7 @@ func (x *SignedExecutionPayloadHeader) ProtoReflect() protoreflect.Message { // Deprecated: Use SignedExecutionPayloadHeader.ProtoReflect.Descriptor instead. func (*SignedExecutionPayloadHeader) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{5} + return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{1} } func (x *SignedExecutionPayloadHeader) GetMessage() *ExecutionPayloadHeaderEPBS { @@ -542,21 +186,18 @@ type ExecutionPayloadEnvelope struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Payload *ExecutionPayloadEPBS `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - BuilderIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,2,opt,name=builder_index,json=builderIndex,proto3" json:"builder_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` - BeaconBlockRoot []byte `protobuf:"bytes,3,opt,name=beacon_block_root,json=beaconBlockRoot,proto3" json:"beacon_block_root,omitempty" ssz-size:"32"` - BlobKzgCommitments [][]byte `protobuf:"bytes,4,rep,name=blob_kzg_commitments,json=blobKzgCommitments,proto3" json:"blob_kzg_commitments,omitempty" ssz-max:"4096" ssz-size:"?,48"` - InclusionListProposerIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,5,opt,name=inclusion_list_proposer_index,json=inclusionListProposerIndex,proto3" json:"inclusion_list_proposer_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` - InclusionListSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,6,opt,name=inclusion_list_slot,json=inclusionListSlot,proto3" json:"inclusion_list_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` - InclusionListSignature []byte `protobuf:"bytes,7,opt,name=inclusion_list_signature,json=inclusionListSignature,proto3" json:"inclusion_list_signature,omitempty" ssz-size:"96"` - PayloadWithheld bool `protobuf:"varint,8,opt,name=payload_withheld,json=payloadWithheld,proto3" json:"payload_withheld,omitempty"` - StateRoot []byte `protobuf:"bytes,9,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"` + Payload *ExecutionPayloadElectra `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + BuilderIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,2,opt,name=builder_index,json=builderIndex,proto3" json:"builder_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` + BeaconBlockRoot []byte `protobuf:"bytes,3,opt,name=beacon_block_root,json=beaconBlockRoot,proto3" json:"beacon_block_root,omitempty" ssz-size:"32"` + BlobKzgCommitments [][]byte `protobuf:"bytes,4,rep,name=blob_kzg_commitments,json=blobKzgCommitments,proto3" json:"blob_kzg_commitments,omitempty" ssz-max:"4096" ssz-size:"?,48"` + PayloadWithheld bool `protobuf:"varint,8,opt,name=payload_withheld,json=payloadWithheld,proto3" json:"payload_withheld,omitempty"` + StateRoot []byte `protobuf:"bytes,9,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"` } func (x *ExecutionPayloadEnvelope) Reset() { *x = ExecutionPayloadEnvelope{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[6] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -569,7 +210,7 @@ func (x *ExecutionPayloadEnvelope) String() string { func (*ExecutionPayloadEnvelope) ProtoMessage() {} func (x *ExecutionPayloadEnvelope) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[6] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -582,10 +223,10 @@ func (x *ExecutionPayloadEnvelope) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionPayloadEnvelope.ProtoReflect.Descriptor instead. func (*ExecutionPayloadEnvelope) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{6} + return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{2} } -func (x *ExecutionPayloadEnvelope) GetPayload() *ExecutionPayloadEPBS { +func (x *ExecutionPayloadEnvelope) GetPayload() *ExecutionPayloadElectra { if x != nil { return x.Payload } @@ -613,27 +254,6 @@ func (x *ExecutionPayloadEnvelope) GetBlobKzgCommitments() [][]byte { return nil } -func (x *ExecutionPayloadEnvelope) GetInclusionListProposerIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { - if x != nil { - return x.InclusionListProposerIndex - } - return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) -} - -func (x *ExecutionPayloadEnvelope) GetInclusionListSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { - if x != nil { - return x.InclusionListSlot - } - return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) -} - -func (x *ExecutionPayloadEnvelope) GetInclusionListSignature() []byte { - if x != nil { - return x.InclusionListSignature - } - return nil -} - func (x *ExecutionPayloadEnvelope) GetPayloadWithheld() bool { if x != nil { return x.PayloadWithheld @@ -660,7 +280,7 @@ type SignedExecutionPayloadEnvelope struct { func (x *SignedExecutionPayloadEnvelope) Reset() { *x = SignedExecutionPayloadEnvelope{} if protoimpl.UnsafeEnabled { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[7] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -673,7 +293,7 @@ func (x *SignedExecutionPayloadEnvelope) String() string { func (*SignedExecutionPayloadEnvelope) ProtoMessage() {} func (x *SignedExecutionPayloadEnvelope) ProtoReflect() protoreflect.Message { - mi := &file_proto_engine_v1_epbs_proto_msgTypes[7] + mi := &file_proto_engine_v1_epbs_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -686,7 +306,7 @@ func (x *SignedExecutionPayloadEnvelope) ProtoReflect() protoreflect.Message { // Deprecated: Use SignedExecutionPayloadEnvelope.ProtoReflect.Descriptor instead. func (*SignedExecutionPayloadEnvelope) Descriptor() ([]byte, []int) { - return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{7} + return file_proto_engine_v1_epbs_proto_rawDescGZIP(), []int{3} } func (x *SignedExecutionPayloadEnvelope) GetMessage() *ExecutionPayloadEnvelope { @@ -713,202 +333,93 @@ var file_proto_engine_v1_epbs_proto_rawDesc = []byte{ 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x95, 0x02, 0x0a, 0x14, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, - 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x76, - 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, - 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, - 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x02, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf2, 0x03, 0x0a, 0x1a, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x45, 0x50, 0x42, 0x53, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, + 0x61, 0x73, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x12, 0x74, 0x0a, 0x0d, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, + 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, + 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0c, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, - 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x32, 0x30, 0x92, 0xb5, 0x18, 0x04, - 0x31, 0x30, 0x32, 0x34, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x22, 0x86, 0x01, - 0x0a, 0x1a, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, - 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x42, 0x0a, 0x07, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, - 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xda, 0x01, 0x0a, 0x0d, 0x49, 0x6e, 0x63, 0x6c, 0x75, - 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x55, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, - 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x49, 0x6e, 0x63, 0x6c, - 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, - 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, - 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, - 0x61, 0x73, 0x68, 0x12, 0x3e, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x1a, 0x8a, 0xb5, 0x18, 0x03, 0x3f, - 0x2c, 0x3f, 0x92, 0xb5, 0x18, 0x0f, 0x31, 0x30, 0x32, 0x34, 0x2c, 0x31, 0x30, 0x37, 0x33, 0x37, - 0x34, 0x31, 0x38, 0x32, 0x34, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x22, 0xd5, 0x03, 0x0a, 0x1a, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x50, - 0x42, 0x53, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, - 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, - 0x68, 0x12, 0x74, 0x0a, 0x0d, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, - 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0c, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, - 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, - 0x6f, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x19, 0x62, 0x6c, 0x6f, 0x62, - 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x16, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xaa, 0x06, 0x0a, 0x14, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x45, 0x50, 0x42, 0x53, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, - 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, - 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, - 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, - 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, - 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, - 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, - 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, - 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, - 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, - 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, - 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, - 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, - 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, - 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x41, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x1d, 0x8a, - 0xb5, 0x18, 0x03, 0x3f, 0x2c, 0x3f, 0x92, 0xb5, 0x18, 0x12, 0x31, 0x30, 0x34, 0x38, 0x35, 0x37, - 0x36, 0x2c, 0x31, 0x30, 0x37, 0x33, 0x37, 0x34, 0x31, 0x38, 0x32, 0x34, 0x52, 0x0c, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x48, 0x0a, 0x0b, 0x77, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, - 0x06, 0x92, 0xb5, 0x18, 0x02, 0x31, 0x36, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, - 0x77, 0x61, 0x6c, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, - 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, - 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, - 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, - 0x12, 0x46, 0x0a, 0x16, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, - 0x73, 0x74, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0c, - 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x32, 0x30, 0x92, 0xb5, 0x18, 0x04, 0x31, 0x30, - 0x32, 0x34, 0x52, 0x14, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, - 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x22, 0x8e, 0x01, 0x0a, 0x1c, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x50, 0x42, 0x53, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xec, 0x05, 0x0a, 0x18, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6e, - 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x42, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x50, 0x42, - 0x53, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x74, 0x0a, 0x0d, 0x62, 0x75, - 0x69, 0x6c, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x52, 0x0c, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x12, 0x32, 0x0a, 0x11, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x0f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x7a, 0x67, - 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, - 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x92, 0x01, 0x0a, 0x1d, 0x69, 0x6e, 0x63, - 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, - 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x52, 0x1a, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, - 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x75, 0x0a, - 0x13, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, - 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, - 0x74, 0x52, 0x11, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, - 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x40, 0x0a, 0x18, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, - 0x6e, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x16, - 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x68, 0x65, 0x6c, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x57, 0x69, 0x74, 0x68, 0x68, 0x65, 0x6c, - 0x64, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x8e, 0x01, 0x0a, 0x1e, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x46, 0x0a, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, + 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x19, 0x62, 0x6c, 0x6f, 0x62, 0x5f, + 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x5f, + 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x16, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x8e, 0x01, 0x0a, 0x1c, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x42, 0x96, 0x01, 0x0a, 0x16, 0x6f, 0x72, - 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, - 0x65, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x45, - 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, - 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, - 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x76, 0x31, 0xaa, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, - 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5c, - 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x50, 0x42, 0x53, 0x52, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, + 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xa1, 0x03, 0x0a, 0x18, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, + 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, + 0x74, 0x0a, 0x0d, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0c, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x32, 0x0a, 0x11, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, + 0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, + 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, + 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x29, 0x0a, + 0x10, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x68, 0x65, 0x6c, + 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x57, 0x69, 0x74, 0x68, 0x68, 0x65, 0x6c, 0x64, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x22, + 0x8e, 0x01, 0x0a, 0x1e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, + 0x70, 0x65, 0x12, 0x46, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, + 0x65, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x42, 0x96, 0x01, 0x0a, 0x16, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, + 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x76, 0x31, 0xaa, + 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, + 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, + 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -923,30 +434,23 @@ func file_proto_engine_v1_epbs_proto_rawDescGZIP() []byte { return file_proto_engine_v1_epbs_proto_rawDescData } -var file_proto_engine_v1_epbs_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_proto_engine_v1_epbs_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_proto_engine_v1_epbs_proto_goTypes = []interface{}{ - (*InclusionListSummary)(nil), // 0: ethereum.engine.v1.InclusionListSummary - (*SignedInclusionListSummary)(nil), // 1: ethereum.engine.v1.SignedInclusionListSummary - (*InclusionList)(nil), // 2: ethereum.engine.v1.InclusionList - (*ExecutionPayloadHeaderEPBS)(nil), // 3: ethereum.engine.v1.ExecutionPayloadHeaderEPBS - (*ExecutionPayloadEPBS)(nil), // 4: ethereum.engine.v1.ExecutionPayloadEPBS - (*SignedExecutionPayloadHeader)(nil), // 5: ethereum.engine.v1.SignedExecutionPayloadHeader - (*ExecutionPayloadEnvelope)(nil), // 6: ethereum.engine.v1.ExecutionPayloadEnvelope - (*SignedExecutionPayloadEnvelope)(nil), // 7: ethereum.engine.v1.SignedExecutionPayloadEnvelope - (*Withdrawal)(nil), // 8: ethereum.engine.v1.Withdrawal + (*ExecutionPayloadHeaderEPBS)(nil), // 0: ethereum.engine.v1.ExecutionPayloadHeaderEPBS + (*SignedExecutionPayloadHeader)(nil), // 1: ethereum.engine.v1.SignedExecutionPayloadHeader + (*ExecutionPayloadEnvelope)(nil), // 2: ethereum.engine.v1.ExecutionPayloadEnvelope + (*SignedExecutionPayloadEnvelope)(nil), // 3: ethereum.engine.v1.SignedExecutionPayloadEnvelope + (*ExecutionPayloadElectra)(nil), // 4: ethereum.engine.v1.ExecutionPayloadElectra } var file_proto_engine_v1_epbs_proto_depIdxs = []int32{ - 0, // 0: ethereum.engine.v1.SignedInclusionListSummary.message:type_name -> ethereum.engine.v1.InclusionListSummary - 1, // 1: ethereum.engine.v1.InclusionList.signed_summary:type_name -> ethereum.engine.v1.SignedInclusionListSummary - 8, // 2: ethereum.engine.v1.ExecutionPayloadEPBS.withdrawals:type_name -> ethereum.engine.v1.Withdrawal - 3, // 3: ethereum.engine.v1.SignedExecutionPayloadHeader.message:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderEPBS - 4, // 4: ethereum.engine.v1.ExecutionPayloadEnvelope.payload:type_name -> ethereum.engine.v1.ExecutionPayloadEPBS - 6, // 5: ethereum.engine.v1.SignedExecutionPayloadEnvelope.message:type_name -> ethereum.engine.v1.ExecutionPayloadEnvelope - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 0, // 0: ethereum.engine.v1.SignedExecutionPayloadHeader.message:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderEPBS + 4, // 1: ethereum.engine.v1.ExecutionPayloadEnvelope.payload:type_name -> ethereum.engine.v1.ExecutionPayloadElectra + 2, // 2: ethereum.engine.v1.SignedExecutionPayloadEnvelope.message:type_name -> ethereum.engine.v1.ExecutionPayloadEnvelope + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_proto_engine_v1_epbs_proto_init() } @@ -957,42 +461,6 @@ func file_proto_engine_v1_epbs_proto_init() { file_proto_engine_v1_execution_engine_proto_init() if !protoimpl.UnsafeEnabled { file_proto_engine_v1_epbs_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InclusionListSummary); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_engine_v1_epbs_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedInclusionListSummary); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_engine_v1_epbs_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InclusionList); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_engine_v1_epbs_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadHeaderEPBS); i { case 0: return &v.state @@ -1004,19 +472,7 @@ func file_proto_engine_v1_epbs_proto_init() { return nil } } - file_proto_engine_v1_epbs_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecutionPayloadEPBS); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_engine_v1_epbs_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_epbs_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignedExecutionPayloadHeader); i { case 0: return &v.state @@ -1028,7 +484,7 @@ func file_proto_engine_v1_epbs_proto_init() { return nil } } - file_proto_engine_v1_epbs_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_epbs_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionPayloadEnvelope); i { case 0: return &v.state @@ -1040,7 +496,7 @@ func file_proto_engine_v1_epbs_proto_init() { return nil } } - file_proto_engine_v1_epbs_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_proto_engine_v1_epbs_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignedExecutionPayloadEnvelope); i { case 0: return &v.state @@ -1059,7 +515,7 @@ func file_proto_engine_v1_epbs_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_engine_v1_epbs_proto_rawDesc, NumEnums: 0, - NumMessages: 8, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/engine/v1/epbs.proto b/proto/engine/v1/epbs.proto index 42f0fcd62af9..3918d4fa8b77 100644 --- a/proto/engine/v1/epbs.proto +++ b/proto/engine/v1/epbs.proto @@ -25,53 +25,15 @@ option java_outer_classname = "ExecutionEngineProto"; option java_package = "org.ethereum.engine.v1"; option php_namespace = "Ethereum\\Engine\\v1"; -message InclusionListSummary { - uint64 proposer_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; - uint64 slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; - repeated bytes summary = 3 [(ethereum.eth.ext.ssz_size) = "?,20", (ethereum.eth.ext.ssz_max) = "max_inclusion_list.size"]; -} - -message SignedInclusionListSummary { - InclusionListSummary message = 1; - bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"]; -} - -message InclusionList { - SignedInclusionListSummary signed_summary = 1; - bytes parent_block_hash = 2 [(ethereum.eth.ext.ssz_size) = "32"]; - repeated bytes transactions = 3 [(ethereum.eth.ext.ssz_size) = "?,?", (ethereum.eth.ext.ssz_max) = "max_inclusion_list.size,1073741824"]; -} - message ExecutionPayloadHeaderEPBS { bytes parent_block_hash = 1 [(ethereum.eth.ext.ssz_size) = "32"]; bytes parent_block_root = 2 [(ethereum.eth.ext.ssz_size) = "32"]; bytes block_hash = 3 [(ethereum.eth.ext.ssz_size) = "32"]; - uint64 builder_index = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; - uint64 slot = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; - uint64 value = 6; - bytes blob_kzg_commitments_root = 7 [(ethereum.eth.ext.ssz_size) = "32"]; -} - -message ExecutionPayloadEPBS { - bytes parent_hash = 1 [(ethereum.eth.ext.ssz_size) = "32"]; - bytes fee_recipient = 2 [(ethereum.eth.ext.ssz_size) = "20"]; - bytes state_root = 3 [(ethereum.eth.ext.ssz_size) = "32"]; - bytes receipts_root = 4 [(ethereum.eth.ext.ssz_size) = "32"]; - bytes logs_bloom = 5 [(ethereum.eth.ext.ssz_size) = "logs_bloom.size"]; - bytes prev_randao = 6 [(ethereum.eth.ext.ssz_size) = "32"]; - uint64 block_number = 7; - uint64 gas_limit = 8; - uint64 gas_used = 9; - uint64 timestamp = 10; - bytes extra_data = 11 [(ethereum.eth.ext.ssz_max) = "extra_data.size"]; - bytes base_fee_per_gas = 12 [(ethereum.eth.ext.ssz_size) = "32"]; - bytes block_hash = 13 [(ethereum.eth.ext.ssz_size) = "32"]; - repeated bytes transactions = 14 [(ethereum.eth.ext.ssz_size) = "?,?", (ethereum.eth.ext.ssz_max) = "1048576,1073741824"]; - repeated Withdrawal withdrawals = 15 [(ethereum.eth.ext.ssz_max) = "withdrawal.size"]; - uint64 blob_gas_used = 16; - uint64 excess_blob_gas = 17; - repeated bytes inclusion_list_summary = 18 [(ethereum.eth.ext.ssz_size) -= "?,20", (ethereum.eth.ext.ssz_max) = "max_inclusion_list.size"]; + uint64 gas_limit = 4; + uint64 builder_index = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; + uint64 slot = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; + uint64 value = 7; + bytes blob_kzg_commitments_root = 8 [(ethereum.eth.ext.ssz_size) = "32"]; } message SignedExecutionPayloadHeader{ @@ -80,13 +42,10 @@ message SignedExecutionPayloadHeader{ } message ExecutionPayloadEnvelope { - ExecutionPayloadEPBS payload = 1; + ExecutionPayloadElectra payload = 1; uint64 builder_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; bytes beacon_block_root = 3 [(ethereum.eth.ext.ssz_size) = "32"]; repeated bytes blob_kzg_commitments = 4 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"]; - uint64 inclusion_list_proposer_index = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; - uint64 inclusion_list_slot = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; - bytes inclusion_list_signature = 7 [(ethereum.eth.ext.ssz_size) = "96"]; bool payload_withheld = 8; bytes state_root = 9 [(ethereum.eth.ext.ssz_size) = "32"]; } diff --git a/proto/eth/v1/gateway.ssz.go b/proto/eth/v1/gateway.ssz.go index 630663138b11..9917b1fadc17 100644 --- a/proto/eth/v1/gateway.ssz.go +++ b/proto/eth/v1/gateway.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: dc11029a7f019f6c900b35f68bbe0a9ff6ca31ba1f7d8c18518cad810690300d +// Hash: 13c946aa898cca1afa84687b619bc5a10fc79a46340e98dcfb07dde835d39a0c package v1 import ( diff --git a/proto/eth/v2/grpc.ssz.go b/proto/eth/v2/grpc.ssz.go index 3ccde83580b6..af4fd70ce818 100644 --- a/proto/eth/v2/grpc.ssz.go +++ b/proto/eth/v2/grpc.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 6f33097dd41d3dd49d35b7cfceef5a1afca20f05d65b18215748b459db16f99b +// Hash: e1b3713d854395a4c86aa7a0bf0249d9f2764183a636fcc53badddeaf38990f2 package eth import ( diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index 03d33cc07ca7..99441c92867d 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -161,8 +161,6 @@ ssz_epbs_objs = [ "PayloadAttestationData", "PayloadAttestation", "PayloadAttestationMessage", - "BuilderBid", - "DepositSnapshot", "SignedBlindPayloadEnvelope", "BlindPayloadEnvelope", ] @@ -274,6 +272,8 @@ ssz_gen_marshal( "MetaDataV1", "SignedValidatorRegistrationV1", "ValidatorRegistrationV1", + "BuilderBid", + "DepositSnapshot", ], ) diff --git a/proto/prysm/v1alpha1/altair.ssz.go b/proto/prysm/v1alpha1/altair.ssz.go index 45521fbe747e..13c76a98135c 100644 --- a/proto/prysm/v1alpha1/altair.ssz.go +++ b/proto/prysm/v1alpha1/altair.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: c00c1be829cdae457076ef3e840f3af313626147927e503e90fb5585cf242d36 +// Hash: 13886a7dc01bef909efea797dde51a17c0baae4565f852350e4a39d6d4d81e6b package eth import ( diff --git a/proto/prysm/v1alpha1/beacon_state.pb.go b/proto/prysm/v1alpha1/beacon_state.pb.go index 219883c066ef..6b794d14af91 100755 --- a/proto/prysm/v1alpha1/beacon_state.pb.go +++ b/proto/prysm/v1alpha1/beacon_state.pb.go @@ -2198,6 +2198,7 @@ type BeaconStateEPBS struct { InactivityScores []uint64 `protobuf:"varint,9001,rep,packed,name=inactivity_scores,json=inactivityScores,proto3" json:"inactivity_scores,omitempty" ssz-max:"1099511627776"` CurrentSyncCommittee *SyncCommittee `protobuf:"bytes,9002,opt,name=current_sync_committee,json=currentSyncCommittee,proto3" json:"current_sync_committee,omitempty"` NextSyncCommittee *SyncCommittee `protobuf:"bytes,9003,opt,name=next_sync_committee,json=nextSyncCommittee,proto3" json:"next_sync_committee,omitempty"` + LatestExecutionPayloadHeader *v1.ExecutionPayloadHeaderEPBS `protobuf:"bytes,10001,opt,name=latest_execution_payload_header,json=latestExecutionPayloadHeader,proto3" json:"latest_execution_payload_header,omitempty"` NextWithdrawalIndex uint64 `protobuf:"varint,11001,opt,name=next_withdrawal_index,json=nextWithdrawalIndex,proto3" json:"next_withdrawal_index,omitempty"` NextWithdrawalValidatorIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,11002,opt,name=next_withdrawal_validator_index,json=nextWithdrawalValidatorIndex,proto3" json:"next_withdrawal_validator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` HistoricalSummaries []*HistoricalSummary `protobuf:"bytes,11003,rep,name=historical_summaries,json=historicalSummaries,proto3" json:"historical_summaries,omitempty" ssz-max:"16777216"` @@ -2210,14 +2211,9 @@ type BeaconStateEPBS struct { PendingBalanceDeposits []*PendingBalanceDeposit `protobuf:"bytes,12007,rep,name=pending_balance_deposits,json=pendingBalanceDeposits,proto3" json:"pending_balance_deposits,omitempty" ssz-max:"134217728"` PendingPartialWithdrawals []*PendingPartialWithdrawal `protobuf:"bytes,12008,rep,name=pending_partial_withdrawals,json=pendingPartialWithdrawals,proto3" json:"pending_partial_withdrawals,omitempty" ssz-max:"134217728"` PendingConsolidations []*PendingConsolidation `protobuf:"bytes,12009,rep,name=pending_consolidations,json=pendingConsolidations,proto3" json:"pending_consolidations,omitempty" ssz-max:"262144"` - PreviousInclusionListProposer github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,13001,opt,name=previous_inclusion_list_proposer,json=previousInclusionListProposer,proto3" json:"previous_inclusion_list_proposer,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` - PreviousInclusionListSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,13002,opt,name=previous_inclusion_list_slot,json=previousInclusionListSlot,proto3" json:"previous_inclusion_list_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` - LatestInclusionListProposer github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,13003,opt,name=latest_inclusion_list_proposer,json=latestInclusionListProposer,proto3" json:"latest_inclusion_list_proposer,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` - LatestInclusionListSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,13004,opt,name=latest_inclusion_list_slot,json=latestInclusionListSlot,proto3" json:"latest_inclusion_list_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` - LatestBlockHash []byte `protobuf:"bytes,13005,opt,name=latest_block_hash,json=latestBlockHash,proto3" json:"latest_block_hash,omitempty" ssz-size:"32"` - LatestFullSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,13006,opt,name=latest_full_slot,json=latestFullSlot,proto3" json:"latest_full_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` - ExecutionPayloadHeader *v1.ExecutionPayloadHeaderEPBS `protobuf:"bytes,13007,opt,name=execution_payload_header,json=executionPayloadHeader,proto3" json:"execution_payload_header,omitempty"` - LastWithdrawalsRoot []byte `protobuf:"bytes,13008,opt,name=last_withdrawals_root,json=lastWithdrawalsRoot,proto3" json:"last_withdrawals_root,omitempty" ssz-size:"32"` + LatestBlockHash []byte `protobuf:"bytes,13001,opt,name=latest_block_hash,json=latestBlockHash,proto3" json:"latest_block_hash,omitempty" ssz-size:"32"` + LatestFullSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,13002,opt,name=latest_full_slot,json=latestFullSlot,proto3" json:"latest_full_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` + LastWithdrawalsRoot []byte `protobuf:"bytes,13003,opt,name=last_withdrawals_root,json=lastWithdrawalsRoot,proto3" json:"last_withdrawals_root,omitempty" ssz-size:"32"` } func (x *BeaconStateEPBS) Reset() { @@ -2420,6 +2416,13 @@ func (x *BeaconStateEPBS) GetNextSyncCommittee() *SyncCommittee { return nil } +func (x *BeaconStateEPBS) GetLatestExecutionPayloadHeader() *v1.ExecutionPayloadHeaderEPBS { + if x != nil { + return x.LatestExecutionPayloadHeader + } + return nil +} + func (x *BeaconStateEPBS) GetNextWithdrawalIndex() uint64 { if x != nil { return x.NextWithdrawalIndex @@ -2504,34 +2507,6 @@ func (x *BeaconStateEPBS) GetPendingConsolidations() []*PendingConsolidation { return nil } -func (x *BeaconStateEPBS) GetPreviousInclusionListProposer() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { - if x != nil { - return x.PreviousInclusionListProposer - } - return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) -} - -func (x *BeaconStateEPBS) GetPreviousInclusionListSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { - if x != nil { - return x.PreviousInclusionListSlot - } - return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) -} - -func (x *BeaconStateEPBS) GetLatestInclusionListProposer() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { - if x != nil { - return x.LatestInclusionListProposer - } - return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) -} - -func (x *BeaconStateEPBS) GetLatestInclusionListSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { - if x != nil { - return x.LatestInclusionListSlot - } - return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) -} - func (x *BeaconStateEPBS) GetLatestBlockHash() []byte { if x != nil { return x.LatestBlockHash @@ -2546,13 +2521,6 @@ func (x *BeaconStateEPBS) GetLatestFullSlot() github_com_prysmaticlabs_prysm_v5_ return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) } -func (x *BeaconStateEPBS) GetExecutionPayloadHeader() *v1.ExecutionPayloadHeaderEPBS { - if x != nil { - return x.ExecutionPayloadHeader - } - return nil -} - func (x *BeaconStateEPBS) GetLastWithdrawalsRoot() []byte { if x != nil { return x.LastWithdrawalsRoot @@ -3608,7 +3576,7 @@ var file_proto_prysm_v1alpha1_beacon_state_proto_rawDesc = []byte{ 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x92, 0xb5, 0x18, 0x06, 0x32, 0x36, 0x32, 0x31, 0x34, 0x34, 0x52, 0x15, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xe6, 0x1f, 0x0a, 0x0f, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, + 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xaf, 0x1b, 0x0a, 0x0f, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x50, 0x42, 0x53, 0x12, 0x22, 0x0a, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0xe9, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x17, @@ -3717,180 +3685,144 @@ var file_proto_prysm_v1alpha1_beacon_state_proto_rawDesc = []byte{ 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x11, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x33, 0x0a, 0x15, 0x6e, 0x65, 0x78, 0x74, 0x5f, - 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x18, 0xf9, 0x55, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, - 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x97, 0x01, 0x0a, - 0x1f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, - 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x18, 0xfa, 0x55, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x1c, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x6a, 0x0a, 0x14, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, - 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0xfb, - 0x55, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x69, - 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, - 0x0c, 0x92, 0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x13, 0x68, - 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, - 0x65, 0x73, 0x12, 0x40, 0x0a, 0x1c, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0xe1, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x19, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x12, 0x83, 0x01, 0x0a, 0x1a, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x73, - 0x75, 0x6d, 0x65, 0x18, 0xe2, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x47, 0x77, 0x65, - 0x69, 0x52, 0x17, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x7d, 0x0a, 0x17, 0x65, 0x78, - 0x69, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, - 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0xe3, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, - 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x47, - 0x77, 0x65, 0x69, 0x52, 0x14, 0x65, 0x78, 0x69, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x77, 0x0a, 0x13, 0x65, 0x61, 0x72, - 0x6c, 0x69, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x18, 0xe4, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, - 0x11, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x45, 0x78, 0x69, 0x74, 0x45, 0x70, 0x6f, - 0x63, 0x68, 0x12, 0x8f, 0x01, 0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, - 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0xe5, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, - 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x47, 0x77, 0x65, 0x69, 0x52, 0x1d, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, - 0x73, 0x75, 0x6d, 0x65, 0x12, 0x89, 0x01, 0x0a, 0x1c, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, - 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0xe6, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, - 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, - 0x70, 0x6f, 0x63, 0x68, 0x52, 0x1a, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x43, 0x6f, - 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, - 0x12, 0x76, 0x0a, 0x18, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0xe7, 0x5d, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x42, 0x0d, 0x92, 0xb5, 0x18, 0x09, 0x31, 0x33, 0x34, 0x32, 0x31, 0x37, 0x37, 0x32, 0x38, - 0x52, 0x16, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x7f, 0x0a, 0x1b, 0x70, 0x65, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x77, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0xe8, 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, - 0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, - 0x0d, 0x92, 0xb5, 0x18, 0x09, 0x31, 0x33, 0x34, 0x32, 0x31, 0x37, 0x37, 0x32, 0x38, 0x52, 0x19, - 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x12, 0x6f, 0x0a, 0x16, 0x70, 0x65, 0x6e, - 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0xe9, 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x92, 0xb5, 0x18, 0x06, 0x32, 0x36, 0x32, - 0x31, 0x34, 0x34, 0x52, 0x15, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, - 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x99, 0x01, 0x0a, 0x20, 0x70, - 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, - 0x6e, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x18, - 0xc9, 0x65, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, + 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x76, 0x0a, 0x1f, 0x6c, 0x61, 0x74, 0x65, 0x73, + 0x74, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x91, 0x4e, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, + 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x50, 0x42, + 0x53, 0x52, 0x1c, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x33, 0x0a, 0x15, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xf9, 0x55, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x13, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x12, 0x97, 0x01, 0x0a, 0x1f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, + 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xfa, 0x55, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x52, 0x1c, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x6a, + 0x0a, 0x14, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x6d, + 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0xfb, 0x55, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, + 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x0c, 0x92, 0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, + 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x13, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, + 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x12, 0x40, 0x0a, 0x1c, 0x64, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xe1, 0x5d, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x19, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x83, 0x01, 0x0a, + 0x1a, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0xe2, 0x5d, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, + 0x69, 0x76, 0x65, 0x73, 0x2e, 0x47, 0x77, 0x65, 0x69, 0x52, 0x17, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, + 0x6d, 0x65, 0x12, 0x7d, 0x0a, 0x17, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0xe3, 0x5d, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x47, 0x77, 0x65, 0x69, 0x52, 0x14, 0x65, 0x78, 0x69, + 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, + 0x65, 0x12, 0x77, 0x0a, 0x13, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, + 0x69, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0xe4, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x11, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, + 0x74, 0x45, 0x78, 0x69, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x8f, 0x01, 0x0a, 0x20, 0x63, + 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x61, 0x6c, + 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, + 0xe5, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, - 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, - 0x73, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x12, 0x87, 0x01, 0x0a, 0x1c, 0x70, 0x72, 0x65, 0x76, 0x69, - 0x6f, 0x75, 0x73, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, - 0x73, 0x74, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0xca, 0x65, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, - 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x19, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x49, - 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6c, 0x6f, 0x74, - 0x12, 0x95, 0x01, 0x0a, 0x1e, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6e, 0x63, 0x6c, - 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x72, 0x18, 0xcb, 0x65, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, - 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x1b, 0x6c, 0x61, 0x74, - 0x65, 0x73, 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, - 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x12, 0x83, 0x01, 0x0a, 0x1a, 0x6c, 0x61, 0x74, - 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, - 0x73, 0x74, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0xcc, 0x65, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, - 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x17, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x63, - 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x33, - 0x0a, 0x11, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, - 0x61, 0x73, 0x68, 0x18, 0xcd, 0x65, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, - 0x61, 0x73, 0x68, 0x12, 0x70, 0x0a, 0x10, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x66, 0x75, - 0x6c, 0x6c, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0xce, 0x65, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, - 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0e, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x46, 0x75, 0x6c, - 0x6c, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x69, 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x18, 0xcf, 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x45, 0x50, 0x42, 0x53, 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x12, 0x3b, 0x0a, 0x15, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, - 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0xd0, 0x65, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x13, 0x6c, 0x61, 0x73, 0x74, 0x57, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x8d, 0x01, - 0x0a, 0x08, 0x50, 0x6f, 0x77, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, - 0x68, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x31, 0x0a, 0x10, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x7f, 0x0a, - 0x11, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, - 0x72, 0x79, 0x12, 0x34, 0x0a, 0x12, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x75, 0x6d, 0x6d, - 0x61, 0x72, 0x79, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, - 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x6d, - 0x6d, 0x61, 0x72, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x34, 0x0a, 0x12, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0x9b, - 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0x41, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, - 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x47, 0x77, 0x65, 0x69, 0x52, 0x1d, 0x63, + 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x89, 0x01, 0x0a, + 0x1c, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0xe6, 0x5d, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x1a, 0x65, 0x61, + 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x76, 0x0a, 0x18, 0x70, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x73, 0x18, 0xe7, 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x42, 0x0d, 0x92, 0xb5, 0x18, 0x09, 0x31, + 0x33, 0x34, 0x32, 0x31, 0x37, 0x37, 0x32, 0x38, 0x52, 0x16, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, + 0x12, 0x7f, 0x0a, 0x1b, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x61, 0x72, 0x74, + 0x69, 0x61, 0x6c, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, + 0xe8, 0x5d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, + 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x42, 0x0d, 0x92, 0xb5, 0x18, 0x09, 0x31, 0x33, 0x34, + 0x32, 0x31, 0x37, 0x37, 0x32, 0x38, 0x52, 0x19, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, + 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, + 0x73, 0x12, 0x6f, 0x0a, 0x16, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, + 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe9, 0x5d, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, + 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x0a, 0x92, 0xb5, 0x18, 0x06, 0x32, 0x36, 0x32, 0x31, 0x34, 0x34, 0x52, 0x15, 0x70, 0x65, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x33, 0x0a, 0x11, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0xc9, 0x65, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x70, 0x0a, 0x10, 0x6c, 0x61, 0x74, 0x65, 0x73, + 0x74, 0x5f, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0xca, 0x65, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, + 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0e, 0x6c, 0x61, 0x74, 0x65, 0x73, + 0x74, 0x46, 0x75, 0x6c, 0x6c, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x3b, 0x0a, 0x15, 0x6c, 0x61, 0x73, + 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0xcb, 0x65, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x13, 0x6c, 0x61, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, + 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x8d, 0x01, 0x0a, 0x08, 0x50, 0x6f, 0x77, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, + 0x61, 0x73, 0x68, 0x12, 0x31, 0x0a, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x69, 0x66, + 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x69, 0x66, 0x66, + 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x7f, 0x0a, 0x11, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, + 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x34, 0x0a, 0x12, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x6f, 0x6f, + 0x74, 0x12, 0x34, 0x0a, 0x12, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, + 0x72, 0x79, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x73, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, + 0x61, 0x72, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, + 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4023,11 +3955,11 @@ var file_proto_prysm_v1alpha1_beacon_state_proto_depIdxs = []int32{ 22, // 79: ethereum.eth.v1alpha1.BeaconStateEPBS.finalized_checkpoint:type_name -> ethereum.eth.v1alpha1.Checkpoint 10, // 80: ethereum.eth.v1alpha1.BeaconStateEPBS.current_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee 10, // 81: ethereum.eth.v1alpha1.BeaconStateEPBS.next_sync_committee:type_name -> ethereum.eth.v1alpha1.SyncCommittee - 18, // 82: ethereum.eth.v1alpha1.BeaconStateEPBS.historical_summaries:type_name -> ethereum.eth.v1alpha1.HistoricalSummary - 28, // 83: ethereum.eth.v1alpha1.BeaconStateEPBS.pending_balance_deposits:type_name -> ethereum.eth.v1alpha1.PendingBalanceDeposit - 29, // 84: ethereum.eth.v1alpha1.BeaconStateEPBS.pending_partial_withdrawals:type_name -> ethereum.eth.v1alpha1.PendingPartialWithdrawal - 30, // 85: ethereum.eth.v1alpha1.BeaconStateEPBS.pending_consolidations:type_name -> ethereum.eth.v1alpha1.PendingConsolidation - 31, // 86: ethereum.eth.v1alpha1.BeaconStateEPBS.execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderEPBS + 31, // 82: ethereum.eth.v1alpha1.BeaconStateEPBS.latest_execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderEPBS + 18, // 83: ethereum.eth.v1alpha1.BeaconStateEPBS.historical_summaries:type_name -> ethereum.eth.v1alpha1.HistoricalSummary + 28, // 84: ethereum.eth.v1alpha1.BeaconStateEPBS.pending_balance_deposits:type_name -> ethereum.eth.v1alpha1.PendingBalanceDeposit + 29, // 85: ethereum.eth.v1alpha1.BeaconStateEPBS.pending_partial_withdrawals:type_name -> ethereum.eth.v1alpha1.PendingPartialWithdrawal + 30, // 86: ethereum.eth.v1alpha1.BeaconStateEPBS.pending_consolidations:type_name -> ethereum.eth.v1alpha1.PendingConsolidation 87, // [87:87] is the sub-list for method output_type 87, // [87:87] is the sub-list for method input_type 87, // [87:87] is the sub-list for extension type_name diff --git a/proto/prysm/v1alpha1/beacon_state.proto b/proto/prysm/v1alpha1/beacon_state.proto index 3d1cd75608db..bf22190f6ac6 100644 --- a/proto/prysm/v1alpha1/beacon_state.proto +++ b/proto/prysm/v1alpha1/beacon_state.proto @@ -454,6 +454,7 @@ message BeaconStateEPBS { // Fields introduced in Bellatrix fork [10001-11000] // ethereum.engine.v1.ExecutionPayloadHeaderDeneb latest_execution_payload_header = 10001; [Removed in ePBS] + ethereum.engine.v1.ExecutionPayloadHeaderEPBS latest_execution_payload_header = 10001; // Fields introduced in Capella fork [11001-12000] uint64 next_withdrawal_index = 11001; @@ -473,14 +474,9 @@ message BeaconStateEPBS { repeated PendingConsolidation pending_consolidations = 12009 [(ethereum.eth.ext.ssz_max) = "pending_consolidations_limit"]; // Fields introduced in ePBS fork [13001-14000] - uint64 previous_inclusion_list_proposer = 13001 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; - uint64 previous_inclusion_list_slot = 13002 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; - uint64 latest_inclusion_list_proposer = 13003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; - uint64 latest_inclusion_list_slot = 13004 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; - bytes latest_block_hash = 13005 [(ethereum.eth.ext.ssz_size) = "32"]; - uint64 latest_full_slot = 13006 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; - ethereum.engine.v1.ExecutionPayloadHeaderEPBS execution_payload_header = 13007; - bytes last_withdrawals_root = 13008 [(ethereum.eth.ext.ssz_size) = "32"]; + bytes latest_block_hash = 13001 [(ethereum.eth.ext.ssz_size) = "32"]; + uint64 latest_full_slot = 13002 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; + bytes last_withdrawals_root = 13003 [(ethereum.eth.ext.ssz_size) = "32"]; } diff --git a/proto/prysm/v1alpha1/bellatrix.ssz.go b/proto/prysm/v1alpha1/bellatrix.ssz.go index 6f1c86000129..d0063cfaa009 100644 --- a/proto/prysm/v1alpha1/bellatrix.ssz.go +++ b/proto/prysm/v1alpha1/bellatrix.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 61890aa32d72c0c0325f0bf6dd44776068840a9d50a102e4c3c53ac46cf66567 +// Hash: 5108004d574335ba2aec411e5a19fb39674986452fe6c4bda6c145283e9dac17 package eth import ( diff --git a/proto/prysm/v1alpha1/blind_payload_envelope.pb.go b/proto/prysm/v1alpha1/blind_payload_envelope.pb.go index 82552db4409f..c41a69a08212 100755 --- a/proto/prysm/v1alpha1/blind_payload_envelope.pb.go +++ b/proto/prysm/v1alpha1/blind_payload_envelope.pb.go @@ -83,15 +83,12 @@ type BlindPayloadEnvelope struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - PayloadRoot []byte `protobuf:"bytes,1,opt,name=payload_root,json=payloadRoot,proto3" json:"payload_root,omitempty" ssz-size:"32"` - BuilderIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,2,opt,name=builder_index,json=builderIndex,proto3" json:"builder_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` - BeaconBlockRoot []byte `protobuf:"bytes,3,opt,name=beacon_block_root,json=beaconBlockRoot,proto3" json:"beacon_block_root,omitempty" ssz-size:"32"` - BlobKzgCommitments [][]byte `protobuf:"bytes,4,rep,name=blob_kzg_commitments,json=blobKzgCommitments,proto3" json:"blob_kzg_commitments,omitempty" ssz-max:"4096" ssz-size:"?,48"` - InclusionListProposerIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,5,opt,name=inclusion_list_proposer_index,json=inclusionListProposerIndex,proto3" json:"inclusion_list_proposer_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` - InclusionListSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,6,opt,name=inclusion_list_slot,json=inclusionListSlot,proto3" json:"inclusion_list_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"` - InclusionListSignature []byte `protobuf:"bytes,7,opt,name=inclusion_list_signature,json=inclusionListSignature,proto3" json:"inclusion_list_signature,omitempty" ssz-size:"96"` - PayloadWithheld bool `protobuf:"varint,8,opt,name=payload_withheld,json=payloadWithheld,proto3" json:"payload_withheld,omitempty"` - StateRoot []byte `protobuf:"bytes,9,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"` + PayloadRoot []byte `protobuf:"bytes,1,opt,name=payload_root,json=payloadRoot,proto3" json:"payload_root,omitempty" ssz-size:"32"` + BuilderIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,2,opt,name=builder_index,json=builderIndex,proto3" json:"builder_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` + BeaconBlockRoot []byte `protobuf:"bytes,3,opt,name=beacon_block_root,json=beaconBlockRoot,proto3" json:"beacon_block_root,omitempty" ssz-size:"32"` + BlobKzgCommitments [][]byte `protobuf:"bytes,4,rep,name=blob_kzg_commitments,json=blobKzgCommitments,proto3" json:"blob_kzg_commitments,omitempty" ssz-max:"4096" ssz-size:"?,48"` + PayloadWithheld bool `protobuf:"varint,8,opt,name=payload_withheld,json=payloadWithheld,proto3" json:"payload_withheld,omitempty"` + StateRoot []byte `protobuf:"bytes,9,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"` } func (x *BlindPayloadEnvelope) Reset() { @@ -154,27 +151,6 @@ func (x *BlindPayloadEnvelope) GetBlobKzgCommitments() [][]byte { return nil } -func (x *BlindPayloadEnvelope) GetInclusionListProposerIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { - if x != nil { - return x.InclusionListProposerIndex - } - return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) -} - -func (x *BlindPayloadEnvelope) GetInclusionListSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot { - if x != nil { - return x.InclusionListSlot - } - return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(0) -} - -func (x *BlindPayloadEnvelope) GetInclusionListSignature() []byte { - if x != nil { - return x.InclusionListSignature - } - return nil -} - func (x *BlindPayloadEnvelope) GetPayloadWithheld() bool { if x != nil { return x.PayloadWithheld @@ -207,7 +183,7 @@ var file_proto_prysm_v1alpha1_blind_payload_envelope_proto_rawDesc = []byte{ 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x22, 0xcf, 0x05, 0x0a, 0x14, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x61, 0x79, + 0x75, 0x72, 0x65, 0x22, 0x81, 0x03, 0x0a, 0x14, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x29, 0x0a, 0x0c, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0b, 0x70, 0x61, 0x79, 0x6c, @@ -226,44 +202,23 @@ var file_proto_prysm_v1alpha1_blind_payload_envelope_proto_rawDesc = []byte{ 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x92, 0x01, 0x0a, 0x1d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, - 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, - 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x1a, - 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x75, 0x0a, 0x13, 0x69, 0x6e, - 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x6c, 0x6f, - 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x11, - 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6c, 0x6f, - 0x74, 0x12, 0x40, 0x0a, 0x18, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, - 0x69, 0x73, 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x16, 0x69, 0x6e, 0x63, - 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x77, - 0x69, 0x74, 0x68, 0x68, 0x65, 0x6c, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x70, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x57, 0x69, 0x74, 0x68, 0x68, 0x65, 0x6c, 0x64, 0x12, 0x25, - 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0xa4, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x42, 0x19, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, - 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, - 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, - 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x5f, 0x77, 0x69, 0x74, 0x68, 0x68, 0x65, 0x6c, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x57, 0x69, 0x74, 0x68, 0x68, 0x65, 0x6c, 0x64, + 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0xa4, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x19, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, + 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, + 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/prysm/v1alpha1/blind_payload_envelope.proto b/proto/prysm/v1alpha1/blind_payload_envelope.proto index 0af31d5ac36f..c1d4bb91346b 100644 --- a/proto/prysm/v1alpha1/blind_payload_envelope.proto +++ b/proto/prysm/v1alpha1/blind_payload_envelope.proto @@ -34,9 +34,6 @@ message BlindPayloadEnvelope { uint64 builder_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; bytes beacon_block_root = 3 [(ethereum.eth.ext.ssz_size) = "32"]; repeated bytes blob_kzg_commitments = 4 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"]; - uint64 inclusion_list_proposer_index = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"]; - uint64 inclusion_list_slot = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"]; - bytes inclusion_list_signature = 7 [(ethereum.eth.ext.ssz_size) = "96"]; bool payload_withheld = 8; bytes state_root = 9 [(ethereum.eth.ext.ssz_size) = "32"]; } diff --git a/proto/prysm/v1alpha1/capella.ssz.go b/proto/prysm/v1alpha1/capella.ssz.go index 48057c5b2a16..6a3d66f44674 100644 --- a/proto/prysm/v1alpha1/capella.ssz.go +++ b/proto/prysm/v1alpha1/capella.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 13b762a7d53ab6cf5d5ffb582d580edb05efc65de762692f09af914819d3bb3e +// Hash: 6626cf21a16cb4702d82c0f6f4c9de809ca53119e99d425a0f75e7418e1d22ae package eth import ( diff --git a/proto/prysm/v1alpha1/cloners.go b/proto/prysm/v1alpha1/cloners.go index 215329c293c6..f0908986918d 100644 --- a/proto/prysm/v1alpha1/cloners.go +++ b/proto/prysm/v1alpha1/cloners.go @@ -968,6 +968,7 @@ func CopyExecutionPayloadHeaderEPBS(payload *enginev1.ExecutionPayloadHeaderEPBS Slot: payload.Slot, Value: payload.Value, BlobKzgCommitmentsRoot: bytesutil.SafeCopyBytes(payload.BlobKzgCommitmentsRoot), + GasLimit: payload.GasLimit, } } diff --git a/proto/prysm/v1alpha1/deneb.ssz.go b/proto/prysm/v1alpha1/deneb.ssz.go index deeeacdb81df..6eb6ccd8ac77 100644 --- a/proto/prysm/v1alpha1/deneb.ssz.go +++ b/proto/prysm/v1alpha1/deneb.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: adfca9994daf736f0526568d87329503d997b98308a409e71cd510115380af5a +// Hash: 1c2056d2087d5e5535c1c125f368fbb793d72d7702cd72524c492a56fb9619c2 package eth import ( diff --git a/proto/prysm/v1alpha1/electra.ssz.go b/proto/prysm/v1alpha1/electra.ssz.go index 570dbbd6a2ad..bb34178db492 100644 --- a/proto/prysm/v1alpha1/electra.ssz.go +++ b/proto/prysm/v1alpha1/electra.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 84572d8fa233c45a41477bced891ee355cc1745ae0fad290f110b7f6b5ed12e1 +// Hash: f1455cb3f61835ec9bf9248243e44c8728765afdfa468108c2c60cdf510ac4f3 package eth import ( @@ -30,20 +30,20 @@ func (a *AttestationElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { return } - // Field (2) 'CommitteeBits' - if size := len(a.CommitteeBits); size != 8 { - err = ssz.ErrBytesLengthFn("--.CommitteeBits", size, 8) - return - } - dst = append(dst, a.CommitteeBits...) - - // Field (3) 'Signature' + // Field (2) 'Signature' if size := len(a.Signature); size != 96 { err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, a.Signature...) + // Field (3) 'CommitteeBits' + if size := len(a.CommitteeBits); size != 8 { + err = ssz.ErrBytesLengthFn("--.CommitteeBits", size, 8) + return + } + dst = append(dst, a.CommitteeBits...) + // Field (0) 'AggregationBits' if size := len(a.AggregationBits); size > 131072 { err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 131072) @@ -82,17 +82,17 @@ func (a *AttestationElectra) UnmarshalSSZ(buf []byte) error { return err } - // Field (2) 'CommitteeBits' - if cap(a.CommitteeBits) == 0 { - a.CommitteeBits = make([]byte, 0, len(buf[132:140])) + // Field (2) 'Signature' + if cap(a.Signature) == 0 { + a.Signature = make([]byte, 0, len(buf[132:228])) } - a.CommitteeBits = append(a.CommitteeBits, buf[132:140]...) + a.Signature = append(a.Signature, buf[132:228]...) - // Field (3) 'Signature' - if cap(a.Signature) == 0 { - a.Signature = make([]byte, 0, len(buf[140:236])) + // Field (3) 'CommitteeBits' + if cap(a.CommitteeBits) == 0 { + a.CommitteeBits = make([]byte, 0, len(buf[228:236])) } - a.Signature = append(a.Signature, buf[140:236]...) + a.CommitteeBits = append(a.CommitteeBits, buf[228:236]...) // Field (0) 'AggregationBits' { @@ -139,20 +139,20 @@ func (a *AttestationElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { return } - // Field (2) 'CommitteeBits' - if size := len(a.CommitteeBits); size != 8 { - err = ssz.ErrBytesLengthFn("--.CommitteeBits", size, 8) - return - } - hh.PutBytes(a.CommitteeBits) - - // Field (3) 'Signature' + // Field (2) 'Signature' if size := len(a.Signature); size != 96 { err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(a.Signature) + // Field (3) 'CommitteeBits' + if size := len(a.CommitteeBits); size != 8 { + err = ssz.ErrBytesLengthFn("--.CommitteeBits", size, 8) + return + } + hh.PutBytes(a.CommitteeBits) + hh.Merkleize(indx) return } diff --git a/proto/prysm/v1alpha1/epbs.ssz.go b/proto/prysm/v1alpha1/epbs.ssz.go new file mode 100644 index 000000000000..20663fcddf07 --- /dev/null +++ b/proto/prysm/v1alpha1/epbs.ssz.go @@ -0,0 +1,2583 @@ +// Code generated by fastssz. DO NOT EDIT. +// Hash: 11f71f0366fd023e29982696ca34379e212ab0ffdd8f320b71cb158abb0da192 +package eth + +import ( + ssz "github.com/prysmaticlabs/fastssz" + github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" + v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" +) + +// MarshalSSZ ssz marshals the BeaconBlockEpbs object +func (b *BeaconBlockEpbs) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconBlockEpbs object to a target array +func (b *BeaconBlockEpbs) 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(BeaconBlockBodyEpbs) + } + offset += b.Body.SizeSSZ() + + // Field (4) 'Body' + if dst, err = b.Body.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconBlockEpbs object +func (b *BeaconBlockEpbs) 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(BeaconBlockBodyEpbs) + } + if err = b.Body.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockEpbs object +func (b *BeaconBlockEpbs) SizeSSZ() (size int) { + size = 84 + + // Field (4) 'Body' + if b.Body == nil { + b.Body = new(BeaconBlockBodyEpbs) + } + size += b.Body.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BeaconBlockEpbs object +func (b *BeaconBlockEpbs) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconBlockEpbs object with a hasher +func (b *BeaconBlockEpbs) 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 BeaconBlockBodyEpbs object +func (b *BeaconBlockBodyEpbs) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconBlockBodyEpbs object to a target array +func (b *BeaconBlockBodyEpbs) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(644) + + // 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(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(SyncAggregate) + } + if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (9) 'BlsToExecutionChanges' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlsToExecutionChanges) * 172 + + // Field (10) 'SignedExecutionPayloadHeader' + if b.SignedExecutionPayloadHeader == nil { + b.SignedExecutionPayloadHeader = new(v1.SignedExecutionPayloadHeader) + } + if dst, err = b.SignedExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (11) 'PayloadAttestations' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.PayloadAttestations) * 208 + + // 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) '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) 'PayloadAttestations' + if size := len(b.PayloadAttestations); size > 4 { + err = ssz.ErrListTooBigFn("--.PayloadAttestations", size, 4) + return + } + for ii := 0; ii < len(b.PayloadAttestations); ii++ { + if dst, err = b.PayloadAttestations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconBlockBodyEpbs object +func (b *BeaconBlockBodyEpbs) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 644 { + return ssz.ErrSize + } + + tail := buf + var o3, o4, o5, o6, o7, o9, 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(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 != 644 { + 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(SyncAggregate) + } + if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { + return err + } + + // Offset (9) 'BlsToExecutionChanges' + if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } + + // Field (10) 'SignedExecutionPayloadHeader' + if b.SignedExecutionPayloadHeader == nil { + b.SignedExecutionPayloadHeader = new(v1.SignedExecutionPayloadHeader) + } + if err = b.SignedExecutionPayloadHeader.UnmarshalSSZ(buf[384:640]); err != nil { + return err + } + + // Offset (11) 'PayloadAttestations' + if o11 = ssz.ReadOffset(buf[640:644]); o11 > size || o9 > 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([]*ProposerSlashing, num) + for ii := 0; ii < num; ii++ { + if b.ProposerSlashings[ii] == nil { + b.ProposerSlashings[ii] = new(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([]*AttesterSlashing, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.AttesterSlashings[indx] == nil { + b.AttesterSlashings[indx] = new(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([]*Attestation, num) + err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { + if b.Attestations[indx] == nil { + b.Attestations[indx] = new(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([]*Deposit, num) + for ii := 0; ii < num; ii++ { + if b.Deposits[ii] == nil { + b.Deposits[ii] = new(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([]*SignedVoluntaryExit, num) + for ii := 0; ii < num; ii++ { + if b.VoluntaryExits[ii] == nil { + b.VoluntaryExits[ii] = new(SignedVoluntaryExit) + } + if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { + return err + } + } + } + + // Field (9) 'BlsToExecutionChanges' + { + buf = tail[o9: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) 'PayloadAttestations' + { + buf = tail[o11:] + num, err := ssz.DivideInt2(len(buf), 208, 4) + if err != nil { + return err + } + b.PayloadAttestations = make([]*PayloadAttestation, num) + for ii := 0; ii < num; ii++ { + if b.PayloadAttestations[ii] == nil { + b.PayloadAttestations[ii] = new(PayloadAttestation) + } + if err = b.PayloadAttestations[ii].UnmarshalSSZ(buf[ii*208 : (ii+1)*208]); err != nil { + return err + } + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyEpbs object +func (b *BeaconBlockBodyEpbs) SizeSSZ() (size int) { + size = 644 + + // 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) 'BlsToExecutionChanges' + size += len(b.BlsToExecutionChanges) * 172 + + // Field (11) 'PayloadAttestations' + size += len(b.PayloadAttestations) * 208 + + return +} + +// HashTreeRoot ssz hashes the BeaconBlockBodyEpbs object +func (b *BeaconBlockBodyEpbs) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconBlockBodyEpbs object with a hasher +func (b *BeaconBlockBodyEpbs) 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) '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 (10) 'SignedExecutionPayloadHeader' + if err = b.SignedExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (11) 'PayloadAttestations' + { + subIndx := hh.Index() + num := uint64(len(b.PayloadAttestations)) + if num > 4 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.PayloadAttestations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 4) + } + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SignedBeaconBlockEpbs object +func (s *SignedBeaconBlockEpbs) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBeaconBlockEpbs object to a target array +func (s *SignedBeaconBlockEpbs) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Block' + dst = ssz.WriteOffset(dst, offset) + if s.Block == nil { + s.Block = new(BeaconBlockEpbs) + } + offset += s.Block.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) 'Block' + if dst, err = s.Block.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockEpbs object +func (s *SignedBeaconBlockEpbs) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Block' + 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) 'Block' + { + buf = tail[o0:] + if s.Block == nil { + s.Block = new(BeaconBlockEpbs) + } + if err = s.Block.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockEpbs object +func (s *SignedBeaconBlockEpbs) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Block' + if s.Block == nil { + s.Block = new(BeaconBlockEpbs) + } + size += s.Block.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBeaconBlockEpbs object +func (s *SignedBeaconBlockEpbs) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBeaconBlockEpbs object with a hasher +func (s *SignedBeaconBlockEpbs) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'Block' + if err = s.Block.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 BeaconStateEPBS object +func (b *BeaconStateEPBS) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BeaconStateEPBS object to a target array +func (b *BeaconStateEPBS) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(2736941) + + // Field (0) 'GenesisTime' + dst = ssz.MarshalUint64(dst, b.GenesisTime) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + dst = append(dst, b.GenesisValidatorsRoot...) + + // Field (2) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (3) 'Fork' + if b.Fork == nil { + b.Fork = new(Fork) + } + if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { + return + } + + // Field (4) 'LatestBlockHeader' + if b.LatestBlockHeader == nil { + b.LatestBlockHeader = new(BeaconBlockHeader) + } + if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (5) 'BlockRoots' + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(b.BlockRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) + return + } + dst = append(dst, b.BlockRoots[ii]...) + } + + // Field (6) 'StateRoots' + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + if size := len(b.StateRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) + return + } + dst = append(dst, b.StateRoots[ii]...) + } + + // Offset (7) 'HistoricalRoots' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.HistoricalRoots) * 32 + + // Field (8) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (9) 'Eth1DataVotes' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Eth1DataVotes) * 72 + + // Field (10) 'Eth1DepositIndex' + dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) + + // Offset (11) 'Validators' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Validators) * 121 + + // Offset (12) 'Balances' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.Balances) * 8 + + // Field (13) 'RandaoMixes' + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) + return + } + for ii := 0; ii < 65536; ii++ { + if size := len(b.RandaoMixes[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) + return + } + dst = append(dst, b.RandaoMixes[ii]...) + } + + // Field (14) 'Slashings' + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) + return + } + for ii := 0; ii < 8192; ii++ { + dst = ssz.MarshalUint64(dst, b.Slashings[ii]) + } + + // Offset (15) 'PreviousEpochParticipation' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.PreviousEpochParticipation) + + // Offset (16) 'CurrentEpochParticipation' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.CurrentEpochParticipation) + + // Field (17) 'JustificationBits' + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + return + } + dst = append(dst, b.JustificationBits...) + + // Field (18) 'PreviousJustifiedCheckpoint' + if b.PreviousJustifiedCheckpoint == nil { + b.PreviousJustifiedCheckpoint = new(Checkpoint) + } + if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if b.CurrentJustifiedCheckpoint == nil { + b.CurrentJustifiedCheckpoint = new(Checkpoint) + } + if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Field (20) 'FinalizedCheckpoint' + if b.FinalizedCheckpoint == nil { + b.FinalizedCheckpoint = new(Checkpoint) + } + if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (21) 'InactivityScores' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.InactivityScores) * 8 + + // Field (22) 'CurrentSyncCommittee' + if b.CurrentSyncCommittee == nil { + b.CurrentSyncCommittee = new(SyncCommittee) + } + if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Field (23) 'NextSyncCommittee' + if b.NextSyncCommittee == nil { + b.NextSyncCommittee = new(SyncCommittee) + } + if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { + return + } + + // Field (24) 'LatestExecutionPayloadHeader' + if b.LatestExecutionPayloadHeader == nil { + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderEPBS) + } + if dst, err = b.LatestExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { + return + } + + // Field (25) 'NextWithdrawalIndex' + dst = ssz.MarshalUint64(dst, b.NextWithdrawalIndex) + + // Field (26) 'NextWithdrawalValidatorIndex' + dst = ssz.MarshalUint64(dst, uint64(b.NextWithdrawalValidatorIndex)) + + // Offset (27) 'HistoricalSummaries' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.HistoricalSummaries) * 64 + + // Field (28) 'DepositRequestsStartIndex' + dst = ssz.MarshalUint64(dst, b.DepositRequestsStartIndex) + + // Field (29) 'DepositBalanceToConsume' + dst = ssz.MarshalUint64(dst, uint64(b.DepositBalanceToConsume)) + + // Field (30) 'ExitBalanceToConsume' + dst = ssz.MarshalUint64(dst, uint64(b.ExitBalanceToConsume)) + + // Field (31) 'EarliestExitEpoch' + dst = ssz.MarshalUint64(dst, uint64(b.EarliestExitEpoch)) + + // Field (32) 'ConsolidationBalanceToConsume' + dst = ssz.MarshalUint64(dst, uint64(b.ConsolidationBalanceToConsume)) + + // Field (33) 'EarliestConsolidationEpoch' + dst = ssz.MarshalUint64(dst, uint64(b.EarliestConsolidationEpoch)) + + // Offset (34) 'PendingBalanceDeposits' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.PendingBalanceDeposits) * 16 + + // Offset (35) 'PendingPartialWithdrawals' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.PendingPartialWithdrawals) * 24 + + // Offset (36) 'PendingConsolidations' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.PendingConsolidations) * 16 + + // Field (37) 'LatestBlockHash' + if size := len(b.LatestBlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.LatestBlockHash", size, 32) + return + } + dst = append(dst, b.LatestBlockHash...) + + // Field (38) 'LatestFullSlot' + dst = ssz.MarshalUint64(dst, uint64(b.LatestFullSlot)) + + // Field (39) 'LastWithdrawalsRoot' + if size := len(b.LastWithdrawalsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.LastWithdrawalsRoot", size, 32) + return + } + dst = append(dst, b.LastWithdrawalsRoot...) + + // Field (7) 'HistoricalRoots' + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) + return + } + for ii := 0; ii < len(b.HistoricalRoots); ii++ { + if size := len(b.HistoricalRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) + return + } + dst = append(dst, b.HistoricalRoots[ii]...) + } + + // Field (9) 'Eth1DataVotes' + if size := len(b.Eth1DataVotes); size > 2048 { + err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) + return + } + for ii := 0; ii < len(b.Eth1DataVotes); ii++ { + if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (11) 'Validators' + if size := len(b.Validators); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) + return + } + for ii := 0; ii < len(b.Validators); ii++ { + if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (12) 'Balances' + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) + return + } + for ii := 0; ii < len(b.Balances); ii++ { + dst = ssz.MarshalUint64(dst, b.Balances[ii]) + } + + // Field (15) 'PreviousEpochParticipation' + if size := len(b.PreviousEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) + return + } + dst = append(dst, b.PreviousEpochParticipation...) + + // Field (16) 'CurrentEpochParticipation' + if size := len(b.CurrentEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) + return + } + dst = append(dst, b.CurrentEpochParticipation...) + + // Field (21) 'InactivityScores' + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) + return + } + for ii := 0; ii < len(b.InactivityScores); ii++ { + dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) + } + + // Field (27) 'HistoricalSummaries' + if size := len(b.HistoricalSummaries); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalSummaries", size, 16777216) + return + } + for ii := 0; ii < len(b.HistoricalSummaries); ii++ { + if dst, err = b.HistoricalSummaries[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (34) 'PendingBalanceDeposits' + if size := len(b.PendingBalanceDeposits); size > 134217728 { + err = ssz.ErrListTooBigFn("--.PendingBalanceDeposits", size, 134217728) + return + } + for ii := 0; ii < len(b.PendingBalanceDeposits); ii++ { + if dst, err = b.PendingBalanceDeposits[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (35) 'PendingPartialWithdrawals' + if size := len(b.PendingPartialWithdrawals); size > 134217728 { + err = ssz.ErrListTooBigFn("--.PendingPartialWithdrawals", size, 134217728) + return + } + for ii := 0; ii < len(b.PendingPartialWithdrawals); ii++ { + if dst, err = b.PendingPartialWithdrawals[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + // Field (36) 'PendingConsolidations' + if size := len(b.PendingConsolidations); size > 262144 { + err = ssz.ErrListTooBigFn("--.PendingConsolidations", size, 262144) + return + } + for ii := 0; ii < len(b.PendingConsolidations); ii++ { + if dst, err = b.PendingConsolidations[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BeaconStateEPBS object +func (b *BeaconStateEPBS) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 2736941 { + return ssz.ErrSize + } + + tail := buf + var o7, o9, o11, o12, o15, o16, o21, o27, o34, o35, o36 uint64 + + // Field (0) 'GenesisTime' + b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) + + // Field (1) 'GenesisValidatorsRoot' + if cap(b.GenesisValidatorsRoot) == 0 { + b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) + } + b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) + + // Field (2) 'Slot' + b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) + + // Field (3) 'Fork' + if b.Fork == nil { + b.Fork = new(Fork) + } + if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { + return err + } + + // Field (4) 'LatestBlockHeader' + if b.LatestBlockHeader == nil { + b.LatestBlockHeader = new(BeaconBlockHeader) + } + if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { + return err + } + + // Field (5) 'BlockRoots' + b.BlockRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(b.BlockRoots[ii]) == 0 { + b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) + } + b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) + } + + // Field (6) 'StateRoots' + b.StateRoots = make([][]byte, 8192) + for ii := 0; ii < 8192; ii++ { + if cap(b.StateRoots[ii]) == 0 { + b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) + } + b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) + } + + // Offset (7) 'HistoricalRoots' + if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { + return ssz.ErrOffset + } + + if o7 != 2736941 { + return ssz.ErrInvalidVariableOffset + } + + // Field (8) 'Eth1Data' + if b.Eth1Data == nil { + b.Eth1Data = new(Eth1Data) + } + if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { + return err + } + + // Offset (9) 'Eth1DataVotes' + if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { + return ssz.ErrOffset + } + + // Field (10) 'Eth1DepositIndex' + b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) + + // Offset (11) 'Validators' + if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { + return ssz.ErrOffset + } + + // Offset (12) 'Balances' + if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { + return ssz.ErrOffset + } + + // Field (13) 'RandaoMixes' + b.RandaoMixes = make([][]byte, 65536) + for ii := 0; ii < 65536; ii++ { + if cap(b.RandaoMixes[ii]) == 0 { + b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) + } + b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) + } + + // Field (14) 'Slashings' + b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) + for ii := 0; ii < 8192; ii++ { + b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) + } + + // Offset (15) 'PreviousEpochParticipation' + if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { + return ssz.ErrOffset + } + + // Offset (16) 'CurrentEpochParticipation' + if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { + return ssz.ErrOffset + } + + // Field (17) 'JustificationBits' + if cap(b.JustificationBits) == 0 { + b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) + } + b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) + + // Field (18) 'PreviousJustifiedCheckpoint' + if b.PreviousJustifiedCheckpoint == nil { + b.PreviousJustifiedCheckpoint = new(Checkpoint) + } + if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { + return err + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if b.CurrentJustifiedCheckpoint == nil { + b.CurrentJustifiedCheckpoint = new(Checkpoint) + } + if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { + return err + } + + // Field (20) 'FinalizedCheckpoint' + if b.FinalizedCheckpoint == nil { + b.FinalizedCheckpoint = new(Checkpoint) + } + if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { + return err + } + + // Offset (21) 'InactivityScores' + if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { + return ssz.ErrOffset + } + + // Field (22) 'CurrentSyncCommittee' + if b.CurrentSyncCommittee == nil { + b.CurrentSyncCommittee = new(SyncCommittee) + } + if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { + return err + } + + // Field (23) 'NextSyncCommittee' + if b.NextSyncCommittee == nil { + b.NextSyncCommittee = new(SyncCommittee) + } + if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { + return err + } + + // Field (24) 'LatestExecutionPayloadHeader' + if b.LatestExecutionPayloadHeader == nil { + b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderEPBS) + } + if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf[2736629:2736789]); err != nil { + return err + } + + // Field (25) 'NextWithdrawalIndex' + b.NextWithdrawalIndex = ssz.UnmarshallUint64(buf[2736789:2736797]) + + // Field (26) 'NextWithdrawalValidatorIndex' + b.NextWithdrawalValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[2736797:2736805])) + + // Offset (27) 'HistoricalSummaries' + if o27 = ssz.ReadOffset(buf[2736805:2736809]); o27 > size || o21 > o27 { + return ssz.ErrOffset + } + + // Field (28) 'DepositRequestsStartIndex' + b.DepositRequestsStartIndex = ssz.UnmarshallUint64(buf[2736809:2736817]) + + // Field (29) 'DepositBalanceToConsume' + b.DepositBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736817:2736825])) + + // Field (30) 'ExitBalanceToConsume' + b.ExitBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736825:2736833])) + + // Field (31) 'EarliestExitEpoch' + b.EarliestExitEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[2736833:2736841])) + + // Field (32) 'ConsolidationBalanceToConsume' + b.ConsolidationBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736841:2736849])) + + // Field (33) 'EarliestConsolidationEpoch' + b.EarliestConsolidationEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[2736849:2736857])) + + // Offset (34) 'PendingBalanceDeposits' + if o34 = ssz.ReadOffset(buf[2736857:2736861]); o34 > size || o27 > o34 { + return ssz.ErrOffset + } + + // Offset (35) 'PendingPartialWithdrawals' + if o35 = ssz.ReadOffset(buf[2736861:2736865]); o35 > size || o34 > o35 { + return ssz.ErrOffset + } + + // Offset (36) 'PendingConsolidations' + if o36 = ssz.ReadOffset(buf[2736865:2736869]); o36 > size || o35 > o36 { + return ssz.ErrOffset + } + + // Field (37) 'LatestBlockHash' + if cap(b.LatestBlockHash) == 0 { + b.LatestBlockHash = make([]byte, 0, len(buf[2736869:2736901])) + } + b.LatestBlockHash = append(b.LatestBlockHash, buf[2736869:2736901]...) + + // Field (38) 'LatestFullSlot' + b.LatestFullSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[2736901:2736909])) + + // Field (39) 'LastWithdrawalsRoot' + if cap(b.LastWithdrawalsRoot) == 0 { + b.LastWithdrawalsRoot = make([]byte, 0, len(buf[2736909:2736941])) + } + b.LastWithdrawalsRoot = append(b.LastWithdrawalsRoot, buf[2736909:2736941]...) + + // Field (7) 'HistoricalRoots' + { + buf = tail[o7:o9] + num, err := ssz.DivideInt2(len(buf), 32, 16777216) + if err != nil { + return err + } + b.HistoricalRoots = make([][]byte, num) + for ii := 0; ii < num; ii++ { + if cap(b.HistoricalRoots[ii]) == 0 { + b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) + } + b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) + } + } + + // Field (9) 'Eth1DataVotes' + { + buf = tail[o9:o11] + num, err := ssz.DivideInt2(len(buf), 72, 2048) + if err != nil { + return err + } + b.Eth1DataVotes = make([]*Eth1Data, num) + for ii := 0; ii < num; ii++ { + if b.Eth1DataVotes[ii] == nil { + b.Eth1DataVotes[ii] = new(Eth1Data) + } + if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { + return err + } + } + } + + // Field (11) 'Validators' + { + buf = tail[o11:o12] + num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) + if err != nil { + return err + } + b.Validators = make([]*Validator, num) + for ii := 0; ii < num; ii++ { + if b.Validators[ii] == nil { + b.Validators[ii] = new(Validator) + } + if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { + return err + } + } + } + + // Field (12) 'Balances' + { + buf = tail[o12:o15] + num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) + if err != nil { + return err + } + b.Balances = ssz.ExtendUint64(b.Balances, num) + for ii := 0; ii < num; ii++ { + b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } + + // Field (15) 'PreviousEpochParticipation' + { + buf = tail[o15:o16] + if len(buf) > 1099511627776 { + return ssz.ErrBytesLength + } + if cap(b.PreviousEpochParticipation) == 0 { + b.PreviousEpochParticipation = make([]byte, 0, len(buf)) + } + b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) + } + + // Field (16) 'CurrentEpochParticipation' + { + buf = tail[o16:o21] + if len(buf) > 1099511627776 { + return ssz.ErrBytesLength + } + if cap(b.CurrentEpochParticipation) == 0 { + b.CurrentEpochParticipation = make([]byte, 0, len(buf)) + } + b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) + } + + // Field (21) 'InactivityScores' + { + buf = tail[o21:o27] + num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) + if err != nil { + return err + } + b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) + for ii := 0; ii < num; ii++ { + b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) + } + } + + // Field (27) 'HistoricalSummaries' + { + buf = tail[o27:o34] + num, err := ssz.DivideInt2(len(buf), 64, 16777216) + if err != nil { + return err + } + b.HistoricalSummaries = make([]*HistoricalSummary, num) + for ii := 0; ii < num; ii++ { + if b.HistoricalSummaries[ii] == nil { + b.HistoricalSummaries[ii] = new(HistoricalSummary) + } + if err = b.HistoricalSummaries[ii].UnmarshalSSZ(buf[ii*64 : (ii+1)*64]); err != nil { + return err + } + } + } + + // Field (34) 'PendingBalanceDeposits' + { + buf = tail[o34:o35] + num, err := ssz.DivideInt2(len(buf), 16, 134217728) + if err != nil { + return err + } + b.PendingBalanceDeposits = make([]*PendingBalanceDeposit, num) + for ii := 0; ii < num; ii++ { + if b.PendingBalanceDeposits[ii] == nil { + b.PendingBalanceDeposits[ii] = new(PendingBalanceDeposit) + } + if err = b.PendingBalanceDeposits[ii].UnmarshalSSZ(buf[ii*16 : (ii+1)*16]); err != nil { + return err + } + } + } + + // Field (35) 'PendingPartialWithdrawals' + { + buf = tail[o35:o36] + num, err := ssz.DivideInt2(len(buf), 24, 134217728) + if err != nil { + return err + } + b.PendingPartialWithdrawals = make([]*PendingPartialWithdrawal, num) + for ii := 0; ii < num; ii++ { + if b.PendingPartialWithdrawals[ii] == nil { + b.PendingPartialWithdrawals[ii] = new(PendingPartialWithdrawal) + } + if err = b.PendingPartialWithdrawals[ii].UnmarshalSSZ(buf[ii*24 : (ii+1)*24]); err != nil { + return err + } + } + } + + // Field (36) 'PendingConsolidations' + { + buf = tail[o36:] + num, err := ssz.DivideInt2(len(buf), 16, 262144) + if err != nil { + return err + } + b.PendingConsolidations = make([]*PendingConsolidation, num) + for ii := 0; ii < num; ii++ { + if b.PendingConsolidations[ii] == nil { + b.PendingConsolidations[ii] = new(PendingConsolidation) + } + if err = b.PendingConsolidations[ii].UnmarshalSSZ(buf[ii*16 : (ii+1)*16]); err != nil { + return err + } + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateEPBS object +func (b *BeaconStateEPBS) SizeSSZ() (size int) { + size = 2736941 + + // Field (7) 'HistoricalRoots' + size += len(b.HistoricalRoots) * 32 + + // Field (9) 'Eth1DataVotes' + size += len(b.Eth1DataVotes) * 72 + + // Field (11) 'Validators' + size += len(b.Validators) * 121 + + // Field (12) 'Balances' + size += len(b.Balances) * 8 + + // Field (15) 'PreviousEpochParticipation' + size += len(b.PreviousEpochParticipation) + + // Field (16) 'CurrentEpochParticipation' + size += len(b.CurrentEpochParticipation) + + // Field (21) 'InactivityScores' + size += len(b.InactivityScores) * 8 + + // Field (27) 'HistoricalSummaries' + size += len(b.HistoricalSummaries) * 64 + + // Field (34) 'PendingBalanceDeposits' + size += len(b.PendingBalanceDeposits) * 16 + + // Field (35) 'PendingPartialWithdrawals' + size += len(b.PendingPartialWithdrawals) * 24 + + // Field (36) 'PendingConsolidations' + size += len(b.PendingConsolidations) * 16 + + return +} + +// HashTreeRoot ssz hashes the BeaconStateEPBS object +func (b *BeaconStateEPBS) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BeaconStateEPBS object with a hasher +func (b *BeaconStateEPBS) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'GenesisTime' + hh.PutUint64(b.GenesisTime) + + // Field (1) 'GenesisValidatorsRoot' + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) + return + } + hh.PutBytes(b.GenesisValidatorsRoot) + + // Field (2) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (3) 'Fork' + if err = b.Fork.HashTreeRootWith(hh); err != nil { + return + } + + // Field (4) 'LatestBlockHeader' + if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (5) 'BlockRoots' + { + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.BlockRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (6) 'StateRoots' + { + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.StateRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (7) 'HistoricalRoots' + { + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) + return + } + subIndx := hh.Index() + for _, i := range b.HistoricalRoots { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + + numItems := uint64(len(b.HistoricalRoots)) + hh.MerkleizeWithMixin(subIndx, numItems, 16777216) + } + + // Field (8) 'Eth1Data' + if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (9) 'Eth1DataVotes' + { + subIndx := hh.Index() + num := uint64(len(b.Eth1DataVotes)) + if num > 2048 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Eth1DataVotes { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 2048) + } + + // Field (10) 'Eth1DepositIndex' + hh.PutUint64(b.Eth1DepositIndex) + + // Field (11) 'Validators' + { + subIndx := hh.Index() + num := uint64(len(b.Validators)) + if num > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.Validators { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 1099511627776) + } + + // Field (12) 'Balances' + { + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) + return + } + subIndx := hh.Index() + for _, i := range b.Balances { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(b.Balances)) + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } + + // Field (13) 'RandaoMixes' + { + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) + return + } + subIndx := hh.Index() + for _, i := range b.RandaoMixes { + if len(i) != 32 { + err = ssz.ErrBytesLength + return + } + hh.Append(i) + } + hh.Merkleize(subIndx) + } + + // Field (14) 'Slashings' + { + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) + return + } + subIndx := hh.Index() + for _, i := range b.Slashings { + hh.AppendUint64(i) + } + hh.Merkleize(subIndx) + } + + // Field (15) 'PreviousEpochParticipation' + { + elemIndx := hh.Index() + byteLen := uint64(len(b.PreviousEpochParticipation)) + if byteLen > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + hh.PutBytes(b.PreviousEpochParticipation) + hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) + } + + // Field (16) 'CurrentEpochParticipation' + { + elemIndx := hh.Index() + byteLen := uint64(len(b.CurrentEpochParticipation)) + if byteLen > 1099511627776 { + err = ssz.ErrIncorrectListSize + return + } + hh.PutBytes(b.CurrentEpochParticipation) + hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) + } + + // Field (17) 'JustificationBits' + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) + return + } + hh.PutBytes(b.JustificationBits) + + // Field (18) 'PreviousJustifiedCheckpoint' + if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (19) 'CurrentJustifiedCheckpoint' + if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (20) 'FinalizedCheckpoint' + if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { + return + } + + // Field (21) 'InactivityScores' + { + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) + return + } + subIndx := hh.Index() + for _, i := range b.InactivityScores { + hh.AppendUint64(i) + } + hh.FillUpTo32() + + numItems := uint64(len(b.InactivityScores)) + hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) + } + + // Field (22) 'CurrentSyncCommittee' + if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + // Field (23) 'NextSyncCommittee' + if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { + return + } + + // Field (24) 'LatestExecutionPayloadHeader' + if err = b.LatestExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { + return + } + + // Field (25) 'NextWithdrawalIndex' + hh.PutUint64(b.NextWithdrawalIndex) + + // Field (26) 'NextWithdrawalValidatorIndex' + hh.PutUint64(uint64(b.NextWithdrawalValidatorIndex)) + + // Field (27) 'HistoricalSummaries' + { + subIndx := hh.Index() + num := uint64(len(b.HistoricalSummaries)) + if num > 16777216 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.HistoricalSummaries { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 16777216) + } + + // Field (28) 'DepositRequestsStartIndex' + hh.PutUint64(b.DepositRequestsStartIndex) + + // Field (29) 'DepositBalanceToConsume' + hh.PutUint64(uint64(b.DepositBalanceToConsume)) + + // Field (30) 'ExitBalanceToConsume' + hh.PutUint64(uint64(b.ExitBalanceToConsume)) + + // Field (31) 'EarliestExitEpoch' + hh.PutUint64(uint64(b.EarliestExitEpoch)) + + // Field (32) 'ConsolidationBalanceToConsume' + hh.PutUint64(uint64(b.ConsolidationBalanceToConsume)) + + // Field (33) 'EarliestConsolidationEpoch' + hh.PutUint64(uint64(b.EarliestConsolidationEpoch)) + + // Field (34) 'PendingBalanceDeposits' + { + subIndx := hh.Index() + num := uint64(len(b.PendingBalanceDeposits)) + if num > 134217728 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.PendingBalanceDeposits { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 134217728) + } + + // Field (35) 'PendingPartialWithdrawals' + { + subIndx := hh.Index() + num := uint64(len(b.PendingPartialWithdrawals)) + if num > 134217728 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.PendingPartialWithdrawals { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 134217728) + } + + // Field (36) 'PendingConsolidations' + { + subIndx := hh.Index() + num := uint64(len(b.PendingConsolidations)) + if num > 262144 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.PendingConsolidations { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 262144) + } + + // Field (37) 'LatestBlockHash' + if size := len(b.LatestBlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.LatestBlockHash", size, 32) + return + } + hh.PutBytes(b.LatestBlockHash) + + // Field (38) 'LatestFullSlot' + hh.PutUint64(uint64(b.LatestFullSlot)) + + // Field (39) 'LastWithdrawalsRoot' + if size := len(b.LastWithdrawalsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.LastWithdrawalsRoot", size, 32) + return + } + hh.PutBytes(b.LastWithdrawalsRoot) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the SignedBlindPayloadEnvelope object +func (s *SignedBlindPayloadEnvelope) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBlindPayloadEnvelope object to a target array +func (s *SignedBlindPayloadEnvelope) 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(BlindPayloadEnvelope) + } + 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 SignedBlindPayloadEnvelope object +func (s *SignedBlindPayloadEnvelope) 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(BlindPayloadEnvelope) + } + if err = s.Message.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBlindPayloadEnvelope object +func (s *SignedBlindPayloadEnvelope) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(BlindPayloadEnvelope) + } + size += s.Message.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBlindPayloadEnvelope object +func (s *SignedBlindPayloadEnvelope) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBlindPayloadEnvelope object with a hasher +func (s *SignedBlindPayloadEnvelope) 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 BlindPayloadEnvelope object +func (b *BlindPayloadEnvelope) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BlindPayloadEnvelope object to a target array +func (b *BlindPayloadEnvelope) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(109) + + // Field (0) 'PayloadRoot' + if size := len(b.PayloadRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.PayloadRoot", size, 32) + return + } + dst = append(dst, b.PayloadRoot...) + + // Field (1) 'BuilderIndex' + dst = ssz.MarshalUint64(dst, uint64(b.BuilderIndex)) + + // Field (2) 'BeaconBlockRoot' + if size := len(b.BeaconBlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) + return + } + dst = append(dst, b.BeaconBlockRoot...) + + // Offset (3) 'BlobKzgCommitments' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlobKzgCommitments) * 48 + + // Field (4) 'PayloadWithheld' + dst = ssz.MarshalBool(dst, b.PayloadWithheld) + + // Field (5) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + dst = append(dst, b.StateRoot...) + + // Field (3) '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 BlindPayloadEnvelope object +func (b *BlindPayloadEnvelope) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 109 { + return ssz.ErrSize + } + + tail := buf + var o3 uint64 + + // Field (0) 'PayloadRoot' + if cap(b.PayloadRoot) == 0 { + b.PayloadRoot = make([]byte, 0, len(buf[0:32])) + } + b.PayloadRoot = append(b.PayloadRoot, buf[0:32]...) + + // Field (1) 'BuilderIndex' + b.BuilderIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[32:40])) + + // Field (2) 'BeaconBlockRoot' + if cap(b.BeaconBlockRoot) == 0 { + b.BeaconBlockRoot = make([]byte, 0, len(buf[40:72])) + } + b.BeaconBlockRoot = append(b.BeaconBlockRoot, buf[40:72]...) + + // Offset (3) 'BlobKzgCommitments' + if o3 = ssz.ReadOffset(buf[72:76]); o3 > size { + return ssz.ErrOffset + } + + if o3 != 109 { + return ssz.ErrInvalidVariableOffset + } + + // Field (4) 'PayloadWithheld' + b.PayloadWithheld = ssz.UnmarshalBool(buf[76:77]) + + // Field (5) 'StateRoot' + if cap(b.StateRoot) == 0 { + b.StateRoot = make([]byte, 0, len(buf[77:109])) + } + b.StateRoot = append(b.StateRoot, buf[77:109]...) + + // Field (3) 'BlobKzgCommitments' + { + buf = tail[o3:] + 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 BlindPayloadEnvelope object +func (b *BlindPayloadEnvelope) SizeSSZ() (size int) { + size = 109 + + // Field (3) 'BlobKzgCommitments' + size += len(b.BlobKzgCommitments) * 48 + + return +} + +// HashTreeRoot ssz hashes the BlindPayloadEnvelope object +func (b *BlindPayloadEnvelope) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlindPayloadEnvelope object with a hasher +func (b *BlindPayloadEnvelope) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'PayloadRoot' + if size := len(b.PayloadRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.PayloadRoot", size, 32) + return + } + hh.PutBytes(b.PayloadRoot) + + // Field (1) 'BuilderIndex' + hh.PutUint64(uint64(b.BuilderIndex)) + + // Field (2) 'BeaconBlockRoot' + if size := len(b.BeaconBlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) + return + } + hh.PutBytes(b.BeaconBlockRoot) + + // Field (3) '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) + } + + // Field (4) 'PayloadWithheld' + hh.PutBool(b.PayloadWithheld) + + // Field (5) 'StateRoot' + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) + return + } + hh.PutBytes(b.StateRoot) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the PayloadAttestationData object +func (p *PayloadAttestationData) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(p) +} + +// MarshalSSZTo ssz marshals the PayloadAttestationData object to a target array +func (p *PayloadAttestationData) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'BeaconBlockRoot' + if size := len(p.BeaconBlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) + return + } + dst = append(dst, p.BeaconBlockRoot...) + + // Field (1) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(p.Slot)) + + // Field (2) 'PayloadStatus' + dst = ssz.MarshalUint64(dst, uint64(p.PayloadStatus)) + + return +} + +// UnmarshalSSZ ssz unmarshals the PayloadAttestationData object +func (p *PayloadAttestationData) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 48 { + return ssz.ErrSize + } + + // Field (0) 'BeaconBlockRoot' + if cap(p.BeaconBlockRoot) == 0 { + p.BeaconBlockRoot = make([]byte, 0, len(buf[0:32])) + } + p.BeaconBlockRoot = append(p.BeaconBlockRoot, buf[0:32]...) + + // Field (1) 'Slot' + p.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[32:40])) + + // Field (2) 'PayloadStatus' + p.PayloadStatus = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.PTCStatus(ssz.UnmarshallUint64(buf[40:48])) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the PayloadAttestationData object +func (p *PayloadAttestationData) SizeSSZ() (size int) { + size = 48 + return +} + +// HashTreeRoot ssz hashes the PayloadAttestationData object +func (p *PayloadAttestationData) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(p) +} + +// HashTreeRootWith ssz hashes the PayloadAttestationData object with a hasher +func (p *PayloadAttestationData) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'BeaconBlockRoot' + if size := len(p.BeaconBlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) + return + } + hh.PutBytes(p.BeaconBlockRoot) + + // Field (1) 'Slot' + hh.PutUint64(uint64(p.Slot)) + + // Field (2) 'PayloadStatus' + hh.PutUint64(uint64(p.PayloadStatus)) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the PayloadAttestation object +func (p *PayloadAttestation) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(p) +} + +// MarshalSSZTo ssz marshals the PayloadAttestation object to a target array +func (p *PayloadAttestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'AggregationBits' + if size := len(p.AggregationBits); size != 64 { + err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 64) + return + } + dst = append(dst, p.AggregationBits...) + + // Field (1) 'Data' + if p.Data == nil { + p.Data = new(PayloadAttestationData) + } + if dst, err = p.Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'Signature' + if size := len(p.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, p.Signature...) + + return +} + +// UnmarshalSSZ ssz unmarshals the PayloadAttestation object +func (p *PayloadAttestation) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 208 { + return ssz.ErrSize + } + + // Field (0) 'AggregationBits' + if cap(p.AggregationBits) == 0 { + p.AggregationBits = make([]byte, 0, len(buf[0:64])) + } + p.AggregationBits = append(p.AggregationBits, buf[0:64]...) + + // Field (1) 'Data' + if p.Data == nil { + p.Data = new(PayloadAttestationData) + } + if err = p.Data.UnmarshalSSZ(buf[64:112]); err != nil { + return err + } + + // Field (2) 'Signature' + if cap(p.Signature) == 0 { + p.Signature = make([]byte, 0, len(buf[112:208])) + } + p.Signature = append(p.Signature, buf[112:208]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the PayloadAttestation object +func (p *PayloadAttestation) SizeSSZ() (size int) { + size = 208 + return +} + +// HashTreeRoot ssz hashes the PayloadAttestation object +func (p *PayloadAttestation) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(p) +} + +// HashTreeRootWith ssz hashes the PayloadAttestation object with a hasher +func (p *PayloadAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'AggregationBits' + if size := len(p.AggregationBits); size != 64 { + err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 64) + return + } + hh.PutBytes(p.AggregationBits) + + // Field (1) 'Data' + if err = p.Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Signature' + if size := len(p.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(p.Signature) + + hh.Merkleize(indx) + return +} + +// MarshalSSZ ssz marshals the PayloadAttestationMessage object +func (p *PayloadAttestationMessage) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(p) +} + +// MarshalSSZTo ssz marshals the PayloadAttestationMessage object to a target array +func (p *PayloadAttestationMessage) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'ValidatorIndex' + dst = ssz.MarshalUint64(dst, uint64(p.ValidatorIndex)) + + // Field (1) 'Data' + if p.Data == nil { + p.Data = new(PayloadAttestationData) + } + if dst, err = p.Data.MarshalSSZTo(dst); err != nil { + return + } + + // Field (2) 'Signature' + if size := len(p.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + dst = append(dst, p.Signature...) + + return +} + +// UnmarshalSSZ ssz unmarshals the PayloadAttestationMessage object +func (p *PayloadAttestationMessage) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 152 { + return ssz.ErrSize + } + + // Field (0) 'ValidatorIndex' + p.ValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) + + // Field (1) 'Data' + if p.Data == nil { + p.Data = new(PayloadAttestationData) + } + if err = p.Data.UnmarshalSSZ(buf[8:56]); err != nil { + return err + } + + // Field (2) 'Signature' + if cap(p.Signature) == 0 { + p.Signature = make([]byte, 0, len(buf[56:152])) + } + p.Signature = append(p.Signature, buf[56:152]...) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the PayloadAttestationMessage object +func (p *PayloadAttestationMessage) SizeSSZ() (size int) { + size = 152 + return +} + +// HashTreeRoot ssz hashes the PayloadAttestationMessage object +func (p *PayloadAttestationMessage) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(p) +} + +// HashTreeRootWith ssz hashes the PayloadAttestationMessage object with a hasher +func (p *PayloadAttestationMessage) HashTreeRootWith(hh *ssz.Hasher) (err error) { + indx := hh.Index() + + // Field (0) 'ValidatorIndex' + hh.PutUint64(uint64(p.ValidatorIndex)) + + // Field (1) 'Data' + if err = p.Data.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Signature' + if size := len(p.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) + return + } + hh.PutBytes(p.Signature) + + hh.Merkleize(indx) + return +} diff --git a/proto/prysm/v1alpha1/generated.ssz.go b/proto/prysm/v1alpha1/generated.ssz.go deleted file mode 100644 index 29781e6da263..000000000000 --- a/proto/prysm/v1alpha1/generated.ssz.go +++ /dev/null @@ -1,23493 +0,0 @@ -// Code generated by fastssz. DO NOT EDIT. -// Hash: 6032ce00da94bec6155432e7b3b1834f1559d4d51ee0e30104552bc89106e344 -package eth - -import ( - ssz "github.com/prysmaticlabs/fastssz" - github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - v1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" -) - -// MarshalSSZ ssz marshals the Attestation object -func (a *Attestation) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(a) -} - -// MarshalSSZTo ssz marshals the Attestation object to a target array -func (a *Attestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(228) - - // Offset (0) 'AggregationBits' - dst = ssz.WriteOffset(dst, offset) - offset += len(a.AggregationBits) - - // Field (1) 'Data' - if a.Data == nil { - a.Data = new(AttestationData) - } - if dst, err = a.Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(a.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, a.Signature...) - - // Field (0) 'AggregationBits' - if size := len(a.AggregationBits); size > 2048 { - err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 2048) - return - } - dst = append(dst, a.AggregationBits...) - - return -} - -// UnmarshalSSZ ssz unmarshals the Attestation object -func (a *Attestation) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 228 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'AggregationBits' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 228 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Data' - if a.Data == nil { - a.Data = new(AttestationData) - } - if err = a.Data.UnmarshalSSZ(buf[4:132]); err != nil { - return err - } - - // Field (2) 'Signature' - if cap(a.Signature) == 0 { - a.Signature = make([]byte, 0, len(buf[132:228])) - } - a.Signature = append(a.Signature, buf[132:228]...) - - // Field (0) 'AggregationBits' - { - buf = tail[o0:] - if err = ssz.ValidateBitlist(buf, 2048); err != nil { - return err - } - if cap(a.AggregationBits) == 0 { - a.AggregationBits = make([]byte, 0, len(buf)) - } - a.AggregationBits = append(a.AggregationBits, buf...) - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Attestation object -func (a *Attestation) SizeSSZ() (size int) { - size = 228 - - // Field (0) 'AggregationBits' - size += len(a.AggregationBits) - - return -} - -// HashTreeRoot ssz hashes the Attestation object -func (a *Attestation) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(a) -} - -// HashTreeRootWith ssz hashes the Attestation object with a hasher -func (a *Attestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AggregationBits' - if len(a.AggregationBits) == 0 { - err = ssz.ErrEmptyBitlist - return - } - hh.PutBitlist(a.AggregationBits, 2048) - - // Field (1) 'Data' - if err = a.Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(a.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(a.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the AttestationElectra object -func (a *AttestationElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(a) -} - -// MarshalSSZTo ssz marshals the AttestationElectra object to a target array -func (a *AttestationElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(236) - - // Offset (0) 'AggregationBits' - dst = ssz.WriteOffset(dst, offset) - offset += len(a.AggregationBits) - - // Field (1) 'Data' - if a.Data == nil { - a.Data = new(AttestationData) - } - if dst, err = a.Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'CommitteeBits' - if size := len(a.CommitteeBits); size != 8 { - err = ssz.ErrBytesLengthFn("--.CommitteeBits", size, 8) - return - } - dst = append(dst, a.CommitteeBits...) - - // Field (3) 'Signature' - if size := len(a.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, a.Signature...) - - // Field (0) 'AggregationBits' - if size := len(a.AggregationBits); size > 131072 { - err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 131072) - return - } - dst = append(dst, a.AggregationBits...) - - return -} - -// UnmarshalSSZ ssz unmarshals the AttestationElectra object -func (a *AttestationElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 236 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'AggregationBits' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 236 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Data' - if a.Data == nil { - a.Data = new(AttestationData) - } - if err = a.Data.UnmarshalSSZ(buf[4:132]); err != nil { - return err - } - - // Field (2) 'CommitteeBits' - if cap(a.CommitteeBits) == 0 { - a.CommitteeBits = make([]byte, 0, len(buf[132:140])) - } - a.CommitteeBits = append(a.CommitteeBits, buf[132:140]...) - - // Field (3) 'Signature' - if cap(a.Signature) == 0 { - a.Signature = make([]byte, 0, len(buf[140:236])) - } - a.Signature = append(a.Signature, buf[140:236]...) - - // Field (0) 'AggregationBits' - { - buf = tail[o0:] - if err = ssz.ValidateBitlist(buf, 131072); err != nil { - return err - } - if cap(a.AggregationBits) == 0 { - a.AggregationBits = make([]byte, 0, len(buf)) - } - a.AggregationBits = append(a.AggregationBits, buf...) - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the AttestationElectra object -func (a *AttestationElectra) SizeSSZ() (size int) { - size = 236 - - // Field (0) 'AggregationBits' - size += len(a.AggregationBits) - - return -} - -// HashTreeRoot ssz hashes the AttestationElectra object -func (a *AttestationElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(a) -} - -// HashTreeRootWith ssz hashes the AttestationElectra object with a hasher -func (a *AttestationElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AggregationBits' - if len(a.AggregationBits) == 0 { - err = ssz.ErrEmptyBitlist - return - } - hh.PutBitlist(a.AggregationBits, 131072) - - // Field (1) 'Data' - if err = a.Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'CommitteeBits' - if size := len(a.CommitteeBits); size != 8 { - err = ssz.ErrBytesLengthFn("--.CommitteeBits", size, 8) - return - } - hh.PutBytes(a.CommitteeBits) - - // Field (3) 'Signature' - if size := len(a.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(a.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the AggregateAttestationAndProof object -func (a *AggregateAttestationAndProof) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(a) -} - -// MarshalSSZTo ssz marshals the AggregateAttestationAndProof object to a target array -func (a *AggregateAttestationAndProof) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(108) - - // Field (0) 'AggregatorIndex' - dst = ssz.MarshalUint64(dst, uint64(a.AggregatorIndex)) - - // Offset (1) 'Aggregate' - dst = ssz.WriteOffset(dst, offset) - if a.Aggregate == nil { - a.Aggregate = new(Attestation) - } - offset += a.Aggregate.SizeSSZ() - - // Field (2) 'SelectionProof' - if size := len(a.SelectionProof); size != 96 { - err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) - return - } - dst = append(dst, a.SelectionProof...) - - // Field (1) 'Aggregate' - if dst, err = a.Aggregate.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the AggregateAttestationAndProof object -func (a *AggregateAttestationAndProof) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 108 { - return ssz.ErrSize - } - - tail := buf - var o1 uint64 - - // Field (0) 'AggregatorIndex' - a.AggregatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Offset (1) 'Aggregate' - if o1 = ssz.ReadOffset(buf[8:12]); o1 > size { - return ssz.ErrOffset - } - - if o1 < 108 { - return ssz.ErrInvalidVariableOffset - } - - // Field (2) 'SelectionProof' - if cap(a.SelectionProof) == 0 { - a.SelectionProof = make([]byte, 0, len(buf[12:108])) - } - a.SelectionProof = append(a.SelectionProof, buf[12:108]...) - - // Field (1) 'Aggregate' - { - buf = tail[o1:] - if a.Aggregate == nil { - a.Aggregate = new(Attestation) - } - if err = a.Aggregate.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the AggregateAttestationAndProof object -func (a *AggregateAttestationAndProof) SizeSSZ() (size int) { - size = 108 - - // Field (1) 'Aggregate' - if a.Aggregate == nil { - a.Aggregate = new(Attestation) - } - size += a.Aggregate.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the AggregateAttestationAndProof object -func (a *AggregateAttestationAndProof) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(a) -} - -// HashTreeRootWith ssz hashes the AggregateAttestationAndProof object with a hasher -func (a *AggregateAttestationAndProof) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AggregatorIndex' - hh.PutUint64(uint64(a.AggregatorIndex)) - - // Field (1) 'Aggregate' - if err = a.Aggregate.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'SelectionProof' - if size := len(a.SelectionProof); size != 96 { - err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) - return - } - hh.PutBytes(a.SelectionProof) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the AggregateAttestationAndProofElectra object -func (a *AggregateAttestationAndProofElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(a) -} - -// MarshalSSZTo ssz marshals the AggregateAttestationAndProofElectra object to a target array -func (a *AggregateAttestationAndProofElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(108) - - // Field (0) 'AggregatorIndex' - dst = ssz.MarshalUint64(dst, uint64(a.AggregatorIndex)) - - // Offset (1) 'Aggregate' - dst = ssz.WriteOffset(dst, offset) - if a.Aggregate == nil { - a.Aggregate = new(AttestationElectra) - } - offset += a.Aggregate.SizeSSZ() - - // Field (2) 'SelectionProof' - if size := len(a.SelectionProof); size != 96 { - err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) - return - } - dst = append(dst, a.SelectionProof...) - - // Field (1) 'Aggregate' - if dst, err = a.Aggregate.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the AggregateAttestationAndProofElectra object -func (a *AggregateAttestationAndProofElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 108 { - return ssz.ErrSize - } - - tail := buf - var o1 uint64 - - // Field (0) 'AggregatorIndex' - a.AggregatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Offset (1) 'Aggregate' - if o1 = ssz.ReadOffset(buf[8:12]); o1 > size { - return ssz.ErrOffset - } - - if o1 < 108 { - return ssz.ErrInvalidVariableOffset - } - - // Field (2) 'SelectionProof' - if cap(a.SelectionProof) == 0 { - a.SelectionProof = make([]byte, 0, len(buf[12:108])) - } - a.SelectionProof = append(a.SelectionProof, buf[12:108]...) - - // Field (1) 'Aggregate' - { - buf = tail[o1:] - if a.Aggregate == nil { - a.Aggregate = new(AttestationElectra) - } - if err = a.Aggregate.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the AggregateAttestationAndProofElectra object -func (a *AggregateAttestationAndProofElectra) SizeSSZ() (size int) { - size = 108 - - // Field (1) 'Aggregate' - if a.Aggregate == nil { - a.Aggregate = new(AttestationElectra) - } - size += a.Aggregate.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the AggregateAttestationAndProofElectra object -func (a *AggregateAttestationAndProofElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(a) -} - -// HashTreeRootWith ssz hashes the AggregateAttestationAndProofElectra object with a hasher -func (a *AggregateAttestationAndProofElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AggregatorIndex' - hh.PutUint64(uint64(a.AggregatorIndex)) - - // Field (1) 'Aggregate' - if err = a.Aggregate.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'SelectionProof' - if size := len(a.SelectionProof); size != 96 { - err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) - return - } - hh.PutBytes(a.SelectionProof) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedAggregateAttestationAndProof object -func (s *SignedAggregateAttestationAndProof) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedAggregateAttestationAndProof object to a target array -func (s *SignedAggregateAttestationAndProof) 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(AggregateAttestationAndProof) - } - 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 SignedAggregateAttestationAndProof object -func (s *SignedAggregateAttestationAndProof) 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(AggregateAttestationAndProof) - } - if err = s.Message.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedAggregateAttestationAndProof object -func (s *SignedAggregateAttestationAndProof) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(AggregateAttestationAndProof) - } - size += s.Message.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedAggregateAttestationAndProof object -func (s *SignedAggregateAttestationAndProof) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedAggregateAttestationAndProof object with a hasher -func (s *SignedAggregateAttestationAndProof) 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 SignedAggregateAttestationAndProofElectra object -func (s *SignedAggregateAttestationAndProofElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedAggregateAttestationAndProofElectra object to a target array -func (s *SignedAggregateAttestationAndProofElectra) 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(AggregateAttestationAndProofElectra) - } - 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 SignedAggregateAttestationAndProofElectra object -func (s *SignedAggregateAttestationAndProofElectra) 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(AggregateAttestationAndProofElectra) - } - if err = s.Message.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedAggregateAttestationAndProofElectra object -func (s *SignedAggregateAttestationAndProofElectra) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(AggregateAttestationAndProofElectra) - } - size += s.Message.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedAggregateAttestationAndProofElectra object -func (s *SignedAggregateAttestationAndProofElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedAggregateAttestationAndProofElectra object with a hasher -func (s *SignedAggregateAttestationAndProofElectra) 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 AttestationData object -func (a *AttestationData) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(a) -} - -// MarshalSSZTo ssz marshals the AttestationData object to a target array -func (a *AttestationData) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(a.Slot)) - - // Field (1) 'CommitteeIndex' - dst = ssz.MarshalUint64(dst, uint64(a.CommitteeIndex)) - - // Field (2) 'BeaconBlockRoot' - if size := len(a.BeaconBlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) - return - } - dst = append(dst, a.BeaconBlockRoot...) - - // Field (3) 'Source' - if a.Source == nil { - a.Source = new(Checkpoint) - } - if dst, err = a.Source.MarshalSSZTo(dst); err != nil { - return - } - - // Field (4) 'Target' - if a.Target == nil { - a.Target = new(Checkpoint) - } - if dst, err = a.Target.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the AttestationData object -func (a *AttestationData) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 128 { - return ssz.ErrSize - } - - // Field (0) 'Slot' - a.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'CommitteeIndex' - a.CommitteeIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.CommitteeIndex(ssz.UnmarshallUint64(buf[8:16])) - - // Field (2) 'BeaconBlockRoot' - if cap(a.BeaconBlockRoot) == 0 { - a.BeaconBlockRoot = make([]byte, 0, len(buf[16:48])) - } - a.BeaconBlockRoot = append(a.BeaconBlockRoot, buf[16:48]...) - - // Field (3) 'Source' - if a.Source == nil { - a.Source = new(Checkpoint) - } - if err = a.Source.UnmarshalSSZ(buf[48:88]); err != nil { - return err - } - - // Field (4) 'Target' - if a.Target == nil { - a.Target = new(Checkpoint) - } - if err = a.Target.UnmarshalSSZ(buf[88:128]); err != nil { - return err - } - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the AttestationData object -func (a *AttestationData) SizeSSZ() (size int) { - size = 128 - return -} - -// HashTreeRoot ssz hashes the AttestationData object -func (a *AttestationData) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(a) -} - -// HashTreeRootWith ssz hashes the AttestationData object with a hasher -func (a *AttestationData) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(a.Slot)) - - // Field (1) 'CommitteeIndex' - hh.PutUint64(uint64(a.CommitteeIndex)) - - // Field (2) 'BeaconBlockRoot' - if size := len(a.BeaconBlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) - return - } - hh.PutBytes(a.BeaconBlockRoot) - - // Field (3) 'Source' - if err = a.Source.HashTreeRootWith(hh); err != nil { - return - } - - // Field (4) 'Target' - if err = a.Target.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the Checkpoint object -func (c *Checkpoint) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(c) -} - -// MarshalSSZTo ssz marshals the Checkpoint object to a target array -func (c *Checkpoint) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Epoch' - dst = ssz.MarshalUint64(dst, uint64(c.Epoch)) - - // Field (1) 'Root' - if size := len(c.Root); size != 32 { - err = ssz.ErrBytesLengthFn("--.Root", size, 32) - return - } - dst = append(dst, c.Root...) - - return -} - -// UnmarshalSSZ ssz unmarshals the Checkpoint object -func (c *Checkpoint) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 40 { - return ssz.ErrSize - } - - // Field (0) 'Epoch' - c.Epoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'Root' - if cap(c.Root) == 0 { - c.Root = make([]byte, 0, len(buf[8:40])) - } - c.Root = append(c.Root, buf[8:40]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Checkpoint object -func (c *Checkpoint) SizeSSZ() (size int) { - size = 40 - return -} - -// HashTreeRoot ssz hashes the Checkpoint object -func (c *Checkpoint) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(c) -} - -// HashTreeRootWith ssz hashes the Checkpoint object with a hasher -func (c *Checkpoint) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Epoch' - hh.PutUint64(uint64(c.Epoch)) - - // Field (1) 'Root' - if size := len(c.Root); size != 32 { - err = ssz.ErrBytesLengthFn("--.Root", size, 32) - return - } - hh.PutBytes(c.Root) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlock object -func (b *BeaconBlock) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlock object to a target array -func (b *BeaconBlock) 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(BeaconBlockBody) - } - offset += b.Body.SizeSSZ() - - // Field (4) 'Body' - if dst, err = b.Body.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlock object -func (b *BeaconBlock) 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(BeaconBlockBody) - } - if err = b.Body.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlock object -func (b *BeaconBlock) SizeSSZ() (size int) { - size = 84 - - // Field (4) 'Body' - if b.Body == nil { - b.Body = new(BeaconBlockBody) - } - size += b.Body.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BeaconBlock object -func (b *BeaconBlock) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlock object with a hasher -func (b *BeaconBlock) 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 - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBeaconBlock object -func (s *SignedBeaconBlock) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBeaconBlock object to a target array -func (s *SignedBeaconBlock) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(100) - - // Offset (0) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(BeaconBlock) - } - offset += s.Block.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) 'Block' - if dst, err = s.Block.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedBeaconBlock object -func (s *SignedBeaconBlock) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 100 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Block' - 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) 'Block' - { - buf = tail[o0:] - if s.Block == nil { - s.Block = new(BeaconBlock) - } - if err = s.Block.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlock object -func (s *SignedBeaconBlock) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Block' - if s.Block == nil { - s.Block = new(BeaconBlock) - } - size += s.Block.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedBeaconBlock object -func (s *SignedBeaconBlock) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBeaconBlock object with a hasher -func (s *SignedBeaconBlock) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Block' - if err = s.Block.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 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 - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// 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) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(BeaconBlockAltair) - } - offset += s.Block.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) 'Block' - if dst, err = s.Block.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) 'Block' - 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) 'Block' - { - buf = tail[o0:] - if s.Block == nil { - s.Block = new(BeaconBlockAltair) - } - if err = s.Block.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) 'Block' - if s.Block == nil { - s.Block = new(BeaconBlockAltair) - } - size += s.Block.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) 'Block' - if err = s.Block.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 BeaconBlockBody object -func (b *BeaconBlockBody) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockBody object to a target array -func (b *BeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(220) - - // 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(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 (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 BeaconBlockBody object -func (b *BeaconBlockBody) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 220 { - 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(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 < 220 { - 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 (3) 'ProposerSlashings' - { - buf = tail[o3:o4] - num, err := ssz.DivideInt2(len(buf), 416, 16) - if err != nil { - return err - } - b.ProposerSlashings = make([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(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([]*AttesterSlashing, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(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([]*Attestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(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([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(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([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(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 BeaconBlockBody object -func (b *BeaconBlockBody) SizeSSZ() (size int) { - size = 220 - - // 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 BeaconBlockBody object -func (b *BeaconBlockBody) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockBody object with a hasher -func (b *BeaconBlockBody) 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - 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(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(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(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(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([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(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([]*AttesterSlashing, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(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([]*Attestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(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([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(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([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (8) 'SyncAggregate' - if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the ProposerSlashing object -func (p *ProposerSlashing) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} - -// MarshalSSZTo ssz marshals the ProposerSlashing object to a target array -func (p *ProposerSlashing) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Header_1' - if p.Header_1 == nil { - p.Header_1 = new(SignedBeaconBlockHeader) - } - if dst, err = p.Header_1.MarshalSSZTo(dst); err != nil { - return - } - - // Field (1) 'Header_2' - if p.Header_2 == nil { - p.Header_2 = new(SignedBeaconBlockHeader) - } - if dst, err = p.Header_2.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the ProposerSlashing object -func (p *ProposerSlashing) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 416 { - return ssz.ErrSize - } - - // Field (0) 'Header_1' - if p.Header_1 == nil { - p.Header_1 = new(SignedBeaconBlockHeader) - } - if err = p.Header_1.UnmarshalSSZ(buf[0:208]); err != nil { - return err - } - - // Field (1) 'Header_2' - if p.Header_2 == nil { - p.Header_2 = new(SignedBeaconBlockHeader) - } - if err = p.Header_2.UnmarshalSSZ(buf[208:416]); err != nil { - return err - } - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the ProposerSlashing object -func (p *ProposerSlashing) SizeSSZ() (size int) { - size = 416 - return -} - -// HashTreeRoot ssz hashes the ProposerSlashing object -func (p *ProposerSlashing) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the ProposerSlashing object with a hasher -func (p *ProposerSlashing) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Header_1' - if err = p.Header_1.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Header_2' - if err = p.Header_2.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the AttesterSlashing object -func (a *AttesterSlashing) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(a) -} - -// MarshalSSZTo ssz marshals the AttesterSlashing object to a target array -func (a *AttesterSlashing) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(8) - - // Offset (0) 'Attestation_1' - dst = ssz.WriteOffset(dst, offset) - if a.Attestation_1 == nil { - a.Attestation_1 = new(IndexedAttestation) - } - offset += a.Attestation_1.SizeSSZ() - - // Offset (1) 'Attestation_2' - dst = ssz.WriteOffset(dst, offset) - if a.Attestation_2 == nil { - a.Attestation_2 = new(IndexedAttestation) - } - offset += a.Attestation_2.SizeSSZ() - - // Field (0) 'Attestation_1' - if dst, err = a.Attestation_1.MarshalSSZTo(dst); err != nil { - return - } - - // Field (1) 'Attestation_2' - if dst, err = a.Attestation_2.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the AttesterSlashing object -func (a *AttesterSlashing) 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) 'Attestation_1' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 8 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (1) 'Attestation_2' - if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { - return ssz.ErrOffset - } - - // Field (0) 'Attestation_1' - { - buf = tail[o0:o1] - if a.Attestation_1 == nil { - a.Attestation_1 = new(IndexedAttestation) - } - if err = a.Attestation_1.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (1) 'Attestation_2' - { - buf = tail[o1:] - if a.Attestation_2 == nil { - a.Attestation_2 = new(IndexedAttestation) - } - if err = a.Attestation_2.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the AttesterSlashing object -func (a *AttesterSlashing) SizeSSZ() (size int) { - size = 8 - - // Field (0) 'Attestation_1' - if a.Attestation_1 == nil { - a.Attestation_1 = new(IndexedAttestation) - } - size += a.Attestation_1.SizeSSZ() - - // Field (1) 'Attestation_2' - if a.Attestation_2 == nil { - a.Attestation_2 = new(IndexedAttestation) - } - size += a.Attestation_2.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the AttesterSlashing object -func (a *AttesterSlashing) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(a) -} - -// HashTreeRootWith ssz hashes the AttesterSlashing object with a hasher -func (a *AttesterSlashing) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Attestation_1' - if err = a.Attestation_1.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Attestation_2' - if err = a.Attestation_2.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the AttesterSlashingElectra object -func (a *AttesterSlashingElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(a) -} - -// MarshalSSZTo ssz marshals the AttesterSlashingElectra object to a target array -func (a *AttesterSlashingElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(8) - - // Offset (0) 'Attestation_1' - dst = ssz.WriteOffset(dst, offset) - if a.Attestation_1 == nil { - a.Attestation_1 = new(IndexedAttestationElectra) - } - offset += a.Attestation_1.SizeSSZ() - - // Offset (1) 'Attestation_2' - dst = ssz.WriteOffset(dst, offset) - if a.Attestation_2 == nil { - a.Attestation_2 = new(IndexedAttestationElectra) - } - offset += a.Attestation_2.SizeSSZ() - - // Field (0) 'Attestation_1' - if dst, err = a.Attestation_1.MarshalSSZTo(dst); err != nil { - return - } - - // Field (1) 'Attestation_2' - if dst, err = a.Attestation_2.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the AttesterSlashingElectra object -func (a *AttesterSlashingElectra) 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) 'Attestation_1' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 8 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (1) 'Attestation_2' - if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { - return ssz.ErrOffset - } - - // Field (0) 'Attestation_1' - { - buf = tail[o0:o1] - if a.Attestation_1 == nil { - a.Attestation_1 = new(IndexedAttestationElectra) - } - if err = a.Attestation_1.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (1) 'Attestation_2' - { - buf = tail[o1:] - if a.Attestation_2 == nil { - a.Attestation_2 = new(IndexedAttestationElectra) - } - if err = a.Attestation_2.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the AttesterSlashingElectra object -func (a *AttesterSlashingElectra) SizeSSZ() (size int) { - size = 8 - - // Field (0) 'Attestation_1' - if a.Attestation_1 == nil { - a.Attestation_1 = new(IndexedAttestationElectra) - } - size += a.Attestation_1.SizeSSZ() - - // Field (1) 'Attestation_2' - if a.Attestation_2 == nil { - a.Attestation_2 = new(IndexedAttestationElectra) - } - size += a.Attestation_2.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the AttesterSlashingElectra object -func (a *AttesterSlashingElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(a) -} - -// HashTreeRootWith ssz hashes the AttesterSlashingElectra object with a hasher -func (a *AttesterSlashingElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Attestation_1' - if err = a.Attestation_1.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Attestation_2' - if err = a.Attestation_2.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the Deposit object -func (d *Deposit) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(d) -} - -// MarshalSSZTo ssz marshals the Deposit object to a target array -func (d *Deposit) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Proof' - if size := len(d.Proof); size != 33 { - err = ssz.ErrVectorLengthFn("--.Proof", size, 33) - return - } - for ii := 0; ii < 33; ii++ { - if size := len(d.Proof[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.Proof[ii]", size, 32) - return - } - dst = append(dst, d.Proof[ii]...) - } - - // Field (1) 'Data' - if d.Data == nil { - d.Data = new(Deposit_Data) - } - if dst, err = d.Data.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the Deposit object -func (d *Deposit) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 1240 { - return ssz.ErrSize - } - - // Field (0) 'Proof' - d.Proof = make([][]byte, 33) - for ii := 0; ii < 33; ii++ { - if cap(d.Proof[ii]) == 0 { - d.Proof[ii] = make([]byte, 0, len(buf[0:1056][ii*32:(ii+1)*32])) - } - d.Proof[ii] = append(d.Proof[ii], buf[0:1056][ii*32:(ii+1)*32]...) - } - - // Field (1) 'Data' - if d.Data == nil { - d.Data = new(Deposit_Data) - } - if err = d.Data.UnmarshalSSZ(buf[1056:1240]); err != nil { - return err - } - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Deposit object -func (d *Deposit) SizeSSZ() (size int) { - size = 1240 - return -} - -// HashTreeRoot ssz hashes the Deposit object -func (d *Deposit) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(d) -} - -// HashTreeRootWith ssz hashes the Deposit object with a hasher -func (d *Deposit) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Proof' - { - if size := len(d.Proof); size != 33 { - err = ssz.ErrVectorLengthFn("--.Proof", size, 33) - return - } - subIndx := hh.Index() - for _, i := range d.Proof { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (1) 'Data' - if err = d.Data.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the VoluntaryExit object -func (v *VoluntaryExit) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(v) -} - -// MarshalSSZTo ssz marshals the VoluntaryExit object to a target array -func (v *VoluntaryExit) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Epoch' - dst = ssz.MarshalUint64(dst, uint64(v.Epoch)) - - // Field (1) 'ValidatorIndex' - dst = ssz.MarshalUint64(dst, uint64(v.ValidatorIndex)) - - return -} - -// UnmarshalSSZ ssz unmarshals the VoluntaryExit object -func (v *VoluntaryExit) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 16 { - return ssz.ErrSize - } - - // Field (0) 'Epoch' - v.Epoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'ValidatorIndex' - v.ValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the VoluntaryExit object -func (v *VoluntaryExit) SizeSSZ() (size int) { - size = 16 - return -} - -// HashTreeRoot ssz hashes the VoluntaryExit object -func (v *VoluntaryExit) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(v) -} - -// HashTreeRootWith ssz hashes the VoluntaryExit object with a hasher -func (v *VoluntaryExit) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Epoch' - hh.PutUint64(uint64(v.Epoch)) - - // Field (1) 'ValidatorIndex' - hh.PutUint64(uint64(v.ValidatorIndex)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedVoluntaryExit object -func (s *SignedVoluntaryExit) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedVoluntaryExit object to a target array -func (s *SignedVoluntaryExit) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Exit' - if s.Exit == nil { - s.Exit = new(VoluntaryExit) - } - if dst, err = s.Exit.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 SignedVoluntaryExit object -func (s *SignedVoluntaryExit) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 112 { - return ssz.ErrSize - } - - // Field (0) 'Exit' - if s.Exit == nil { - s.Exit = new(VoluntaryExit) - } - if err = s.Exit.UnmarshalSSZ(buf[0:16]); err != nil { - return err - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[16:112])) - } - s.Signature = append(s.Signature, buf[16:112]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedVoluntaryExit object -func (s *SignedVoluntaryExit) SizeSSZ() (size int) { - size = 112 - return -} - -// HashTreeRoot ssz hashes the SignedVoluntaryExit object -func (s *SignedVoluntaryExit) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedVoluntaryExit object with a hasher -func (s *SignedVoluntaryExit) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Exit' - if err = s.Exit.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 Eth1Data object -func (e *Eth1Data) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(e) -} - -// MarshalSSZTo ssz marshals the Eth1Data object to a target array -func (e *Eth1Data) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'DepositRoot' - if size := len(e.DepositRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.DepositRoot", size, 32) - return - } - dst = append(dst, e.DepositRoot...) - - // Field (1) 'DepositCount' - dst = ssz.MarshalUint64(dst, e.DepositCount) - - // Field (2) 'BlockHash' - if size := len(e.BlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) - return - } - dst = append(dst, e.BlockHash...) - - return -} - -// UnmarshalSSZ ssz unmarshals the Eth1Data object -func (e *Eth1Data) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 72 { - return ssz.ErrSize - } - - // Field (0) 'DepositRoot' - if cap(e.DepositRoot) == 0 { - e.DepositRoot = make([]byte, 0, len(buf[0:32])) - } - e.DepositRoot = append(e.DepositRoot, buf[0:32]...) - - // Field (1) 'DepositCount' - e.DepositCount = ssz.UnmarshallUint64(buf[32:40]) - - // Field (2) 'BlockHash' - if cap(e.BlockHash) == 0 { - e.BlockHash = make([]byte, 0, len(buf[40:72])) - } - e.BlockHash = append(e.BlockHash, buf[40:72]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Eth1Data object -func (e *Eth1Data) SizeSSZ() (size int) { - size = 72 - return -} - -// HashTreeRoot ssz hashes the Eth1Data object -func (e *Eth1Data) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(e) -} - -// HashTreeRootWith ssz hashes the Eth1Data object with a hasher -func (e *Eth1Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'DepositRoot' - if size := len(e.DepositRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.DepositRoot", size, 32) - return - } - hh.PutBytes(e.DepositRoot) - - // Field (1) 'DepositCount' - hh.PutUint64(e.DepositCount) - - // Field (2) 'BlockHash' - if size := len(e.BlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) - return - } - hh.PutBytes(e.BlockHash) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlockHeader object -func (b *BeaconBlockHeader) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockHeader object to a target array -func (b *BeaconBlockHeader) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // 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...) - - // Field (4) 'BodyRoot' - if size := len(b.BodyRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BodyRoot", size, 32) - return - } - dst = append(dst, b.BodyRoot...) - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlockHeader object -func (b *BeaconBlockHeader) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 112 { - return ssz.ErrSize - } - - // 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]...) - - // Field (4) 'BodyRoot' - if cap(b.BodyRoot) == 0 { - b.BodyRoot = make([]byte, 0, len(buf[80:112])) - } - b.BodyRoot = append(b.BodyRoot, buf[80:112]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockHeader object -func (b *BeaconBlockHeader) SizeSSZ() (size int) { - size = 112 - return -} - -// HashTreeRoot ssz hashes the BeaconBlockHeader object -func (b *BeaconBlockHeader) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockHeader object with a hasher -func (b *BeaconBlockHeader) 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) 'BodyRoot' - if size := len(b.BodyRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BodyRoot", size, 32) - return - } - hh.PutBytes(b.BodyRoot) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBeaconBlockHeader object -func (s *SignedBeaconBlockHeader) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBeaconBlockHeader object to a target array -func (s *SignedBeaconBlockHeader) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Header' - if s.Header == nil { - s.Header = new(BeaconBlockHeader) - } - if dst, err = s.Header.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 SignedBeaconBlockHeader object -func (s *SignedBeaconBlockHeader) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 208 { - return ssz.ErrSize - } - - // Field (0) 'Header' - if s.Header == nil { - s.Header = new(BeaconBlockHeader) - } - if err = s.Header.UnmarshalSSZ(buf[0:112]); err != nil { - return err - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[112:208])) - } - s.Signature = append(s.Signature, buf[112:208]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockHeader object -func (s *SignedBeaconBlockHeader) SizeSSZ() (size int) { - size = 208 - return -} - -// HashTreeRoot ssz hashes the SignedBeaconBlockHeader object -func (s *SignedBeaconBlockHeader) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBeaconBlockHeader object with a hasher -func (s *SignedBeaconBlockHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Header' - if err = s.Header.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 IndexedAttestation object -func (i *IndexedAttestation) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(i) -} - -// MarshalSSZTo ssz marshals the IndexedAttestation object to a target array -func (i *IndexedAttestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(228) - - // Offset (0) 'AttestingIndices' - dst = ssz.WriteOffset(dst, offset) - offset += len(i.AttestingIndices) * 8 - - // Field (1) 'Data' - if i.Data == nil { - i.Data = new(AttestationData) - } - if dst, err = i.Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(i.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, i.Signature...) - - // Field (0) 'AttestingIndices' - if size := len(i.AttestingIndices); size > 2048 { - err = ssz.ErrListTooBigFn("--.AttestingIndices", size, 2048) - return - } - for ii := 0; ii < len(i.AttestingIndices); ii++ { - dst = ssz.MarshalUint64(dst, i.AttestingIndices[ii]) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the IndexedAttestation object -func (i *IndexedAttestation) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 228 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'AttestingIndices' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 228 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Data' - if i.Data == nil { - i.Data = new(AttestationData) - } - if err = i.Data.UnmarshalSSZ(buf[4:132]); err != nil { - return err - } - - // Field (2) 'Signature' - if cap(i.Signature) == 0 { - i.Signature = make([]byte, 0, len(buf[132:228])) - } - i.Signature = append(i.Signature, buf[132:228]...) - - // Field (0) 'AttestingIndices' - { - buf = tail[o0:] - num, err := ssz.DivideInt2(len(buf), 8, 2048) - if err != nil { - return err - } - i.AttestingIndices = ssz.ExtendUint64(i.AttestingIndices, num) - for ii := 0; ii < num; ii++ { - i.AttestingIndices[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the IndexedAttestation object -func (i *IndexedAttestation) SizeSSZ() (size int) { - size = 228 - - // Field (0) 'AttestingIndices' - size += len(i.AttestingIndices) * 8 - - return -} - -// HashTreeRoot ssz hashes the IndexedAttestation object -func (i *IndexedAttestation) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(i) -} - -// HashTreeRootWith ssz hashes the IndexedAttestation object with a hasher -func (i *IndexedAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AttestingIndices' - { - if size := len(i.AttestingIndices); size > 2048 { - err = ssz.ErrListTooBigFn("--.AttestingIndices", size, 2048) - return - } - subIndx := hh.Index() - for _, i := range i.AttestingIndices { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(i.AttestingIndices)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(2048, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(2048, numItems, 8)) - } - } - - // Field (1) 'Data' - if err = i.Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(i.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(i.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the IndexedAttestationElectra object -func (i *IndexedAttestationElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(i) -} - -// MarshalSSZTo ssz marshals the IndexedAttestationElectra object to a target array -func (i *IndexedAttestationElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(228) - - // Offset (0) 'AttestingIndices' - dst = ssz.WriteOffset(dst, offset) - offset += len(i.AttestingIndices) * 8 - - // Field (1) 'Data' - if i.Data == nil { - i.Data = new(AttestationData) - } - if dst, err = i.Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(i.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, i.Signature...) - - // Field (0) 'AttestingIndices' - if size := len(i.AttestingIndices); size > 131072 { - err = ssz.ErrListTooBigFn("--.AttestingIndices", size, 131072) - return - } - for ii := 0; ii < len(i.AttestingIndices); ii++ { - dst = ssz.MarshalUint64(dst, i.AttestingIndices[ii]) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the IndexedAttestationElectra object -func (i *IndexedAttestationElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 228 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'AttestingIndices' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 228 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Data' - if i.Data == nil { - i.Data = new(AttestationData) - } - if err = i.Data.UnmarshalSSZ(buf[4:132]); err != nil { - return err - } - - // Field (2) 'Signature' - if cap(i.Signature) == 0 { - i.Signature = make([]byte, 0, len(buf[132:228])) - } - i.Signature = append(i.Signature, buf[132:228]...) - - // Field (0) 'AttestingIndices' - { - buf = tail[o0:] - num, err := ssz.DivideInt2(len(buf), 8, 131072) - if err != nil { - return err - } - i.AttestingIndices = ssz.ExtendUint64(i.AttestingIndices, num) - for ii := 0; ii < num; ii++ { - i.AttestingIndices[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the IndexedAttestationElectra object -func (i *IndexedAttestationElectra) SizeSSZ() (size int) { - size = 228 - - // Field (0) 'AttestingIndices' - size += len(i.AttestingIndices) * 8 - - return -} - -// HashTreeRoot ssz hashes the IndexedAttestationElectra object -func (i *IndexedAttestationElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(i) -} - -// HashTreeRootWith ssz hashes the IndexedAttestationElectra object with a hasher -func (i *IndexedAttestationElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AttestingIndices' - { - if size := len(i.AttestingIndices); size > 131072 { - err = ssz.ErrListTooBigFn("--.AttestingIndices", size, 131072) - return - } - subIndx := hh.Index() - for _, i := range i.AttestingIndices { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(i.AttestingIndices)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(131072, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(131072, numItems, 8)) - } - } - - // Field (1) 'Data' - if err = i.Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(i.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(i.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SyncAggregate object -func (s *SyncAggregate) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SyncAggregate object to a target array -func (s *SyncAggregate) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'SyncCommitteeBits' - if size := len(s.SyncCommitteeBits); size != 64 { - err = ssz.ErrBytesLengthFn("--.SyncCommitteeBits", size, 64) - return - } - dst = append(dst, s.SyncCommitteeBits...) - - // Field (1) 'SyncCommitteeSignature' - if size := len(s.SyncCommitteeSignature); size != 96 { - err = ssz.ErrBytesLengthFn("--.SyncCommitteeSignature", size, 96) - return - } - dst = append(dst, s.SyncCommitteeSignature...) - - return -} - -// UnmarshalSSZ ssz unmarshals the SyncAggregate object -func (s *SyncAggregate) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 160 { - return ssz.ErrSize - } - - // Field (0) 'SyncCommitteeBits' - if cap(s.SyncCommitteeBits) == 0 { - s.SyncCommitteeBits = make([]byte, 0, len(buf[0:64])) - } - s.SyncCommitteeBits = append(s.SyncCommitteeBits, buf[0:64]...) - - // Field (1) 'SyncCommitteeSignature' - if cap(s.SyncCommitteeSignature) == 0 { - s.SyncCommitteeSignature = make([]byte, 0, len(buf[64:160])) - } - s.SyncCommitteeSignature = append(s.SyncCommitteeSignature, buf[64:160]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SyncAggregate object -func (s *SyncAggregate) SizeSSZ() (size int) { - size = 160 - return -} - -// HashTreeRoot ssz hashes the SyncAggregate object -func (s *SyncAggregate) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SyncAggregate object with a hasher -func (s *SyncAggregate) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'SyncCommitteeBits' - if size := len(s.SyncCommitteeBits); size != 64 { - err = ssz.ErrBytesLengthFn("--.SyncCommitteeBits", size, 64) - return - } - hh.PutBytes(s.SyncCommitteeBits) - - // Field (1) 'SyncCommitteeSignature' - if size := len(s.SyncCommitteeSignature); size != 96 { - err = ssz.ErrBytesLengthFn("--.SyncCommitteeSignature", size, 96) - return - } - hh.PutBytes(s.SyncCommitteeSignature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - 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) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(BeaconBlockBellatrix) - } - offset += s.Block.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) 'Block' - if dst, err = s.Block.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) 'Block' - 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) 'Block' - { - buf = tail[o0:] - if s.Block == nil { - s.Block = new(BeaconBlockBellatrix) - } - if err = s.Block.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) 'Block' - if s.Block == nil { - s.Block = new(BeaconBlockBellatrix) - } - size += s.Block.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) 'Block' - if err = s.Block.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 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 - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - 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(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(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(v1.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(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(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([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(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([]*AttesterSlashing, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(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([]*Attestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(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([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(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([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(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(v1.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(v1.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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - 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) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(BlindedBeaconBlockBellatrix) - } - offset += s.Block.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) 'Block' - if dst, err = s.Block.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) 'Block' - 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) 'Block' - { - buf = tail[o0:] - if s.Block == nil { - s.Block = new(BlindedBeaconBlockBellatrix) - } - if err = s.Block.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) 'Block' - if s.Block == nil { - s.Block = new(BlindedBeaconBlockBellatrix) - } - size += s.Block.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) 'Block' - if err = s.Block.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 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 - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - 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(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(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(v1.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(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(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([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(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([]*AttesterSlashing, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(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([]*Attestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(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([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(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([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(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(v1.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(v1.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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - 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) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(SignedBeaconBlockDeneb) - } - offset += s.Block.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) 'Block' - if dst, err = s.Block.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) '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 s.Block == nil { - s.Block = new(SignedBeaconBlockDeneb) - } - if err = s.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 - } - 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) 'Block' - if s.Block == nil { - s.Block = new(SignedBeaconBlockDeneb) - } - size += s.Block.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) 'Block' - if err = s.Block.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)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - 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)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - 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)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - 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)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - } - - 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) -} - -// 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) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(BeaconBlockDeneb) - } - offset += s.Block.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) 'Block' - if dst, err = s.Block.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) 'Block' - 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) 'Block' - { - buf = tail[o0:] - if s.Block == nil { - s.Block = new(BeaconBlockDeneb) - } - if err = s.Block.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) 'Block' - if s.Block == nil { - s.Block = new(BeaconBlockDeneb) - } - size += s.Block.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) 'Block' - if err = s.Block.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 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 - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - 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(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(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(v1.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(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(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([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(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([]*AttesterSlashing, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(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([]*Attestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(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([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(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([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(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(v1.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(v1.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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - 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) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(BeaconBlockCapella) - } - offset += s.Block.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) 'Block' - if dst, err = s.Block.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) 'Block' - 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) 'Block' - { - buf = tail[o0:] - if s.Block == nil { - s.Block = new(BeaconBlockCapella) - } - if err = s.Block.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) 'Block' - if s.Block == nil { - s.Block = new(BeaconBlockCapella) - } - size += s.Block.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) 'Block' - if err = s.Block.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 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 - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - 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(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(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(v1.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(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(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([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(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([]*AttesterSlashing, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(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([]*Attestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(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([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(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([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(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(v1.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(v1.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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - 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) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(BlindedBeaconBlockCapella) - } - offset += s.Block.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) 'Block' - if dst, err = s.Block.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) 'Block' - 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) 'Block' - { - buf = tail[o0:] - if s.Block == nil { - s.Block = new(BlindedBeaconBlockCapella) - } - if err = s.Block.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) 'Block' - if s.Block == nil { - s.Block = new(BlindedBeaconBlockCapella) - } - size += s.Block.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) 'Block' - if err = s.Block.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 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 - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - 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(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(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(v1.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(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(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([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(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([]*AttesterSlashing, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(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([]*Attestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(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([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(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([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(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(v1.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(v1.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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - 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) -} - -// 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) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - 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 - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - 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(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(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(v1.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(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(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([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(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([]*AttesterSlashing, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(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([]*Attestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(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([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(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([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(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(v1.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(v1.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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBeaconBlockElectra object -func (s *SignedBeaconBlockElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBeaconBlockElectra object to a target array -func (s *SignedBeaconBlockElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(100) - - // Offset (0) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(BeaconBlockElectra) - } - offset += s.Block.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) 'Block' - if dst, err = s.Block.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockElectra object -func (s *SignedBeaconBlockElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 100 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Block' - 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) 'Block' - { - buf = tail[o0:] - if s.Block == nil { - s.Block = new(BeaconBlockElectra) - } - if err = s.Block.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockElectra object -func (s *SignedBeaconBlockElectra) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Block' - if s.Block == nil { - s.Block = new(BeaconBlockElectra) - } - size += s.Block.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedBeaconBlockElectra object -func (s *SignedBeaconBlockElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBeaconBlockElectra object with a hasher -func (s *SignedBeaconBlockElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Block' - if err = s.Block.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 BeaconBlockElectra object -func (b *BeaconBlockElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockElectra object to a target array -func (b *BeaconBlockElectra) 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(BeaconBlockBodyElectra) - } - offset += b.Body.SizeSSZ() - - // Field (4) 'Body' - if dst, err = b.Body.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlockElectra object -func (b *BeaconBlockElectra) 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(BeaconBlockBodyElectra) - } - if err = b.Body.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockElectra object -func (b *BeaconBlockElectra) SizeSSZ() (size int) { - size = 84 - - // Field (4) 'Body' - if b.Body == nil { - b.Body = new(BeaconBlockBodyElectra) - } - size += b.Body.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BeaconBlockElectra object -func (b *BeaconBlockElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockElectra object with a hasher -func (b *BeaconBlockElectra) 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 - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlockBodyElectra object -func (b *BeaconBlockBodyElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockBodyElectra object to a target array -func (b *BeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(396) - - // 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(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(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(v1.ExecutionPayloadElectra) - } - 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 - - // Offset (12) 'Consolidations' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Consolidations) * 120 - - // 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 > 1 { - err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 1) - 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 > 8 { - err = ssz.ErrListTooBigFn("--.Attestations", size, 8) - 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]...) - } - - // Field (12) 'Consolidations' - if size := len(b.Consolidations); size > 1 { - err = ssz.ErrListTooBigFn("--.Consolidations", size, 1) - return - } - for ii := 0; ii < len(b.Consolidations); ii++ { - if dst, err = b.Consolidations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlockBodyElectra object -func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 396 { - return ssz.ErrSize - } - - tail := buf - var o3, o4, o5, o6, o7, o9, o10, o11, o12 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(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 < 396 { - 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(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 - } - - // Offset (12) 'Consolidations' - if o12 = ssz.ReadOffset(buf[392:396]); o12 > size || o11 > o12 { - 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([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(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, 1) - if err != nil { - return err - } - b.AttesterSlashings = make([]*AttesterSlashingElectra, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(AttesterSlashingElectra) - } - 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, 8) - if err != nil { - return err - } - b.Attestations = make([]*AttestationElectra, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(AttestationElectra) - } - 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([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(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([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(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(v1.ExecutionPayloadElectra) - } - 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:o12] - 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]...) - } - } - - // Field (12) 'Consolidations' - { - buf = tail[o12:] - num, err := ssz.DivideInt2(len(buf), 120, 1) - if err != nil { - return err - } - b.Consolidations = make([]*SignedConsolidation, num) - for ii := 0; ii < num; ii++ { - if b.Consolidations[ii] == nil { - b.Consolidations[ii] = new(SignedConsolidation) - } - if err = b.Consolidations[ii].UnmarshalSSZ(buf[ii*120 : (ii+1)*120]); err != nil { - return err - } - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyElectra object -func (b *BeaconBlockBodyElectra) SizeSSZ() (size int) { - size = 396 - - // 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(v1.ExecutionPayloadElectra) - } - size += b.ExecutionPayload.SizeSSZ() - - // Field (10) 'BlsToExecutionChanges' - size += len(b.BlsToExecutionChanges) * 172 - - // Field (11) 'BlobKzgCommitments' - size += len(b.BlobKzgCommitments) * 48 - - // Field (12) 'Consolidations' - size += len(b.Consolidations) * 120 - - return -} - -// HashTreeRoot ssz hashes the BeaconBlockBodyElectra object -func (b *BeaconBlockBodyElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockBodyElectra object with a hasher -func (b *BeaconBlockBodyElectra) 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (4) 'AttesterSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.AttesterSlashings)) - if num > 1 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.AttesterSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1) - } - } - - // Field (5) 'Attestations' - { - subIndx := hh.Index() - num := uint64(len(b.Attestations)) - if num > 8 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Attestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 8) - } else { - hh.MerkleizeWithMixin(subIndx, num, 8) - } - } - - // 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - } - - // Field (12) 'Consolidations' - { - subIndx := hh.Index() - num := uint64(len(b.Consolidations)) - if num > 1 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Consolidations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBlindedBeaconBlockElectra object -func (s *SignedBlindedBeaconBlockElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBlindedBeaconBlockElectra object to a target array -func (s *SignedBlindedBeaconBlockElectra) 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(BlindedBeaconBlockElectra) - } - 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 SignedBlindedBeaconBlockElectra object -func (s *SignedBlindedBeaconBlockElectra) 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(BlindedBeaconBlockElectra) - } - if err = s.Message.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBlindedBeaconBlockElectra object -func (s *SignedBlindedBeaconBlockElectra) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(BlindedBeaconBlockElectra) - } - size += s.Message.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedBlindedBeaconBlockElectra object -func (s *SignedBlindedBeaconBlockElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBlindedBeaconBlockElectra object with a hasher -func (s *SignedBlindedBeaconBlockElectra) 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 BlindedBeaconBlockElectra object -func (b *BlindedBeaconBlockElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlindedBeaconBlockElectra object to a target array -func (b *BlindedBeaconBlockElectra) 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(BlindedBeaconBlockBodyElectra) - } - offset += b.Body.SizeSSZ() - - // Field (4) 'Body' - if dst, err = b.Body.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockElectra object -func (b *BlindedBeaconBlockElectra) 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(BlindedBeaconBlockBodyElectra) - } - if err = b.Body.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockElectra object -func (b *BlindedBeaconBlockElectra) SizeSSZ() (size int) { - size = 84 - - // Field (4) 'Body' - if b.Body == nil { - b.Body = new(BlindedBeaconBlockBodyElectra) - } - size += b.Body.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BlindedBeaconBlockElectra object -func (b *BlindedBeaconBlockElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlindedBeaconBlockElectra object with a hasher -func (b *BlindedBeaconBlockElectra) 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 - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BlindedBeaconBlockBodyElectra object -func (b *BlindedBeaconBlockBodyElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlindedBeaconBlockBodyElectra object to a target array -func (b *BlindedBeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(396) - - // 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(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(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(v1.ExecutionPayloadHeaderElectra) - } - 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 - - // Offset (12) 'Consolidations' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Consolidations) * 120 - - // 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 > 1 { - err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 1) - 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 > 8 { - err = ssz.ErrListTooBigFn("--.Attestations", size, 8) - 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]...) - } - - // Field (12) 'Consolidations' - if size := len(b.Consolidations); size > 1 { - err = ssz.ErrListTooBigFn("--.Consolidations", size, 1) - return - } - for ii := 0; ii < len(b.Consolidations); ii++ { - if dst, err = b.Consolidations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BlindedBeaconBlockBodyElectra object -func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 396 { - return ssz.ErrSize - } - - tail := buf - var o3, o4, o5, o6, o7, o9, o10, o11, o12 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(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 < 396 { - 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(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 - } - - // Offset (12) 'Consolidations' - if o12 = ssz.ReadOffset(buf[392:396]); o12 > size || o11 > o12 { - 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([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(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, 1) - if err != nil { - return err - } - b.AttesterSlashings = make([]*AttesterSlashingElectra, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(AttesterSlashingElectra) - } - 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, 8) - if err != nil { - return err - } - b.Attestations = make([]*AttestationElectra, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(AttestationElectra) - } - 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([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(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([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(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(v1.ExecutionPayloadHeaderElectra) - } - 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:o12] - 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]...) - } - } - - // Field (12) 'Consolidations' - { - buf = tail[o12:] - num, err := ssz.DivideInt2(len(buf), 120, 1) - if err != nil { - return err - } - b.Consolidations = make([]*SignedConsolidation, num) - for ii := 0; ii < num; ii++ { - if b.Consolidations[ii] == nil { - b.Consolidations[ii] = new(SignedConsolidation) - } - if err = b.Consolidations[ii].UnmarshalSSZ(buf[ii*120 : (ii+1)*120]); err != nil { - return err - } - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBodyElectra object -func (b *BlindedBeaconBlockBodyElectra) SizeSSZ() (size int) { - size = 396 - - // 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(v1.ExecutionPayloadHeaderElectra) - } - size += b.ExecutionPayloadHeader.SizeSSZ() - - // Field (10) 'BlsToExecutionChanges' - size += len(b.BlsToExecutionChanges) * 172 - - // Field (11) 'BlobKzgCommitments' - size += len(b.BlobKzgCommitments) * 48 - - // Field (12) 'Consolidations' - size += len(b.Consolidations) * 120 - - return -} - -// HashTreeRoot ssz hashes the BlindedBeaconBlockBodyElectra object -func (b *BlindedBeaconBlockBodyElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlindedBeaconBlockBodyElectra object with a hasher -func (b *BlindedBeaconBlockBodyElectra) 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (4) 'AttesterSlashings' - { - subIndx := hh.Index() - num := uint64(len(b.AttesterSlashings)) - if num > 1 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.AttesterSlashings { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1) - } - } - - // Field (5) 'Attestations' - { - subIndx := hh.Index() - num := uint64(len(b.Attestations)) - if num > 8 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Attestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 8) - } else { - hh.MerkleizeWithMixin(subIndx, num, 8) - } - } - - // 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - } - - // Field (12) 'Consolidations' - { - subIndx := hh.Index() - num := uint64(len(b.Consolidations)) - if num > 1 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Consolidations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the ValidatorRegistrationV1 object -func (v *ValidatorRegistrationV1) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(v) -} - -// MarshalSSZTo ssz marshals the ValidatorRegistrationV1 object to a target array -func (v *ValidatorRegistrationV1) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'FeeRecipient' - if size := len(v.FeeRecipient); size != 20 { - err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) - return - } - dst = append(dst, v.FeeRecipient...) - - // Field (1) 'GasLimit' - dst = ssz.MarshalUint64(dst, v.GasLimit) - - // Field (2) 'Timestamp' - dst = ssz.MarshalUint64(dst, v.Timestamp) - - // Field (3) 'Pubkey' - if size := len(v.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - dst = append(dst, v.Pubkey...) - - return -} - -// UnmarshalSSZ ssz unmarshals the ValidatorRegistrationV1 object -func (v *ValidatorRegistrationV1) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 84 { - return ssz.ErrSize - } - - // Field (0) 'FeeRecipient' - if cap(v.FeeRecipient) == 0 { - v.FeeRecipient = make([]byte, 0, len(buf[0:20])) - } - v.FeeRecipient = append(v.FeeRecipient, buf[0:20]...) - - // Field (1) 'GasLimit' - v.GasLimit = ssz.UnmarshallUint64(buf[20:28]) - - // Field (2) 'Timestamp' - v.Timestamp = ssz.UnmarshallUint64(buf[28:36]) - - // Field (3) 'Pubkey' - if cap(v.Pubkey) == 0 { - v.Pubkey = make([]byte, 0, len(buf[36:84])) - } - v.Pubkey = append(v.Pubkey, buf[36:84]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the ValidatorRegistrationV1 object -func (v *ValidatorRegistrationV1) SizeSSZ() (size int) { - size = 84 - return -} - -// HashTreeRoot ssz hashes the ValidatorRegistrationV1 object -func (v *ValidatorRegistrationV1) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(v) -} - -// HashTreeRootWith ssz hashes the ValidatorRegistrationV1 object with a hasher -func (v *ValidatorRegistrationV1) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'FeeRecipient' - if size := len(v.FeeRecipient); size != 20 { - err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) - return - } - hh.PutBytes(v.FeeRecipient) - - // Field (1) 'GasLimit' - hh.PutUint64(v.GasLimit) - - // Field (2) 'Timestamp' - hh.PutUint64(v.Timestamp) - - // Field (3) 'Pubkey' - if size := len(v.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - hh.PutBytes(v.Pubkey) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedValidatorRegistrationV1 object -func (s *SignedValidatorRegistrationV1) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedValidatorRegistrationV1 object to a target array -func (s *SignedValidatorRegistrationV1) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(ValidatorRegistrationV1) - } - 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 SignedValidatorRegistrationV1 object -func (s *SignedValidatorRegistrationV1) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 180 { - return ssz.ErrSize - } - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(ValidatorRegistrationV1) - } - if err = s.Message.UnmarshalSSZ(buf[0:84]); err != nil { - return err - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[84:180])) - } - s.Signature = append(s.Signature, buf[84:180]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedValidatorRegistrationV1 object -func (s *SignedValidatorRegistrationV1) SizeSSZ() (size int) { - size = 180 - return -} - -// HashTreeRoot ssz hashes the SignedValidatorRegistrationV1 object -func (s *SignedValidatorRegistrationV1) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedValidatorRegistrationV1 object with a hasher -func (s *SignedValidatorRegistrationV1) 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 BuilderBid object -func (b *BuilderBid) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BuilderBid object to a target array -func (b *BuilderBid) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(84) - - // Offset (0) 'Header' - dst = ssz.WriteOffset(dst, offset) - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeader) - } - offset += b.Header.SizeSSZ() - - // Field (1) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) - return - } - dst = append(dst, b.Value...) - - // Field (2) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - dst = append(dst, b.Pubkey...) - - // Field (0) 'Header' - if dst, err = b.Header.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BuilderBid object -func (b *BuilderBid) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 84 { - 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 < 84 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Value' - if cap(b.Value) == 0 { - b.Value = make([]byte, 0, len(buf[4:36])) - } - b.Value = append(b.Value, buf[4:36]...) - - // Field (2) 'Pubkey' - if cap(b.Pubkey) == 0 { - b.Pubkey = make([]byte, 0, len(buf[36:84])) - } - b.Pubkey = append(b.Pubkey, buf[36:84]...) - - // Field (0) 'Header' - { - buf = tail[o0:] - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeader) - } - if err = b.Header.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BuilderBid object -func (b *BuilderBid) SizeSSZ() (size int) { - size = 84 - - // Field (0) 'Header' - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeader) - } - size += b.Header.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BuilderBid object -func (b *BuilderBid) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BuilderBid object with a hasher -func (b *BuilderBid) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Header' - if err = b.Header.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) - return - } - hh.PutBytes(b.Value) - - // Field (2) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - hh.PutBytes(b.Pubkey) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BuilderBidCapella object -func (b *BuilderBidCapella) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BuilderBidCapella object to a target array -func (b *BuilderBidCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(84) - - // Offset (0) 'Header' - dst = ssz.WriteOffset(dst, offset) - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeaderCapella) - } - offset += b.Header.SizeSSZ() - - // Field (1) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) - return - } - dst = append(dst, b.Value...) - - // Field (2) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - dst = append(dst, b.Pubkey...) - - // Field (0) 'Header' - if dst, err = b.Header.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BuilderBidCapella object -func (b *BuilderBidCapella) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 84 { - 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 < 84 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Value' - if cap(b.Value) == 0 { - b.Value = make([]byte, 0, len(buf[4:36])) - } - b.Value = append(b.Value, buf[4:36]...) - - // Field (2) 'Pubkey' - if cap(b.Pubkey) == 0 { - b.Pubkey = make([]byte, 0, len(buf[36:84])) - } - b.Pubkey = append(b.Pubkey, buf[36:84]...) - - // Field (0) 'Header' - { - buf = tail[o0:] - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeaderCapella) - } - if err = b.Header.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BuilderBidCapella object -func (b *BuilderBidCapella) SizeSSZ() (size int) { - size = 84 - - // Field (0) 'Header' - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeaderCapella) - } - size += b.Header.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BuilderBidCapella object -func (b *BuilderBidCapella) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BuilderBidCapella object with a hasher -func (b *BuilderBidCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Header' - if err = b.Header.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) - return - } - hh.PutBytes(b.Value) - - // Field (2) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - hh.PutBytes(b.Pubkey) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BuilderBidDeneb object -func (b *BuilderBidDeneb) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BuilderBidDeneb object to a target array -func (b *BuilderBidDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(88) - - // Offset (0) 'Header' - dst = ssz.WriteOffset(dst, offset) - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeaderDeneb) - } - offset += b.Header.SizeSSZ() - - // Offset (1) 'BlobKzgCommitments' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.BlobKzgCommitments) * 48 - - // Field (2) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) - return - } - dst = append(dst, b.Value...) - - // Field (3) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - dst = append(dst, b.Pubkey...) - - // Field (0) 'Header' - if dst, err = b.Header.MarshalSSZTo(dst); err != nil { - return - } - - // Field (1) '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 BuilderBidDeneb object -func (b *BuilderBidDeneb) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 88 { - return ssz.ErrSize - } - - tail := buf - var o0, o1 uint64 - - // Offset (0) 'Header' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 88 { - return ssz.ErrInvalidVariableOffset - } - - // Offset (1) 'BlobKzgCommitments' - if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { - return ssz.ErrOffset - } - - // Field (2) 'Value' - if cap(b.Value) == 0 { - b.Value = make([]byte, 0, len(buf[8:40])) - } - b.Value = append(b.Value, buf[8:40]...) - - // Field (3) 'Pubkey' - if cap(b.Pubkey) == 0 { - b.Pubkey = make([]byte, 0, len(buf[40:88])) - } - b.Pubkey = append(b.Pubkey, buf[40:88]...) - - // Field (0) 'Header' - { - buf = tail[o0:o1] - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeaderDeneb) - } - if err = b.Header.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (1) 'BlobKzgCommitments' - { - buf = tail[o1:] - 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 BuilderBidDeneb object -func (b *BuilderBidDeneb) SizeSSZ() (size int) { - size = 88 - - // Field (0) 'Header' - if b.Header == nil { - b.Header = new(v1.ExecutionPayloadHeaderDeneb) - } - size += b.Header.SizeSSZ() - - // Field (1) 'BlobKzgCommitments' - size += len(b.BlobKzgCommitments) * 48 - - return -} - -// HashTreeRoot ssz hashes the BuilderBidDeneb object -func (b *BuilderBidDeneb) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BuilderBidDeneb object with a hasher -func (b *BuilderBidDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Header' - if err = b.Header.HashTreeRootWith(hh); err != nil { - return - } - - // Field (1) '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)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - } - - // Field (2) 'Value' - if size := len(b.Value); size != 32 { - err = ssz.ErrBytesLengthFn("--.Value", size, 32) - return - } - hh.PutBytes(b.Value) - - // Field (3) 'Pubkey' - if size := len(b.Pubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) - return - } - hh.PutBytes(b.Pubkey) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BlobSidecar object -func (b *BlobSidecar) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlobSidecar object to a target array -func (b *BlobSidecar) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Index' - dst = ssz.MarshalUint64(dst, b.Index) - - // Field (1) 'Blob' - if size := len(b.Blob); size != 131072 { - err = ssz.ErrBytesLengthFn("--.Blob", size, 131072) - return - } - dst = append(dst, b.Blob...) - - // Field (2) 'KzgCommitment' - if size := len(b.KzgCommitment); size != 48 { - err = ssz.ErrBytesLengthFn("--.KzgCommitment", size, 48) - return - } - dst = append(dst, b.KzgCommitment...) - - // Field (3) 'KzgProof' - if size := len(b.KzgProof); size != 48 { - err = ssz.ErrBytesLengthFn("--.KzgProof", size, 48) - return - } - dst = append(dst, b.KzgProof...) - - // Field (4) 'SignedBlockHeader' - if b.SignedBlockHeader == nil { - b.SignedBlockHeader = new(SignedBeaconBlockHeader) - } - if dst, err = b.SignedBlockHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (5) 'CommitmentInclusionProof' - if size := len(b.CommitmentInclusionProof); size != 17 { - err = ssz.ErrVectorLengthFn("--.CommitmentInclusionProof", size, 17) - return - } - for ii := 0; ii < 17; ii++ { - if size := len(b.CommitmentInclusionProof[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.CommitmentInclusionProof[ii]", size, 32) - return - } - dst = append(dst, b.CommitmentInclusionProof[ii]...) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BlobSidecar object -func (b *BlobSidecar) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 131928 { - return ssz.ErrSize - } - - // Field (0) 'Index' - b.Index = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'Blob' - if cap(b.Blob) == 0 { - b.Blob = make([]byte, 0, len(buf[8:131080])) - } - b.Blob = append(b.Blob, buf[8:131080]...) - - // Field (2) 'KzgCommitment' - if cap(b.KzgCommitment) == 0 { - b.KzgCommitment = make([]byte, 0, len(buf[131080:131128])) - } - b.KzgCommitment = append(b.KzgCommitment, buf[131080:131128]...) - - // Field (3) 'KzgProof' - if cap(b.KzgProof) == 0 { - b.KzgProof = make([]byte, 0, len(buf[131128:131176])) - } - b.KzgProof = append(b.KzgProof, buf[131128:131176]...) - - // Field (4) 'SignedBlockHeader' - if b.SignedBlockHeader == nil { - b.SignedBlockHeader = new(SignedBeaconBlockHeader) - } - if err = b.SignedBlockHeader.UnmarshalSSZ(buf[131176:131384]); err != nil { - return err - } - - // Field (5) 'CommitmentInclusionProof' - b.CommitmentInclusionProof = make([][]byte, 17) - for ii := 0; ii < 17; ii++ { - if cap(b.CommitmentInclusionProof[ii]) == 0 { - b.CommitmentInclusionProof[ii] = make([]byte, 0, len(buf[131384:131928][ii*32:(ii+1)*32])) - } - b.CommitmentInclusionProof[ii] = append(b.CommitmentInclusionProof[ii], buf[131384:131928][ii*32:(ii+1)*32]...) - } - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlobSidecar object -func (b *BlobSidecar) SizeSSZ() (size int) { - size = 131928 - return -} - -// HashTreeRoot ssz hashes the BlobSidecar object -func (b *BlobSidecar) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlobSidecar object with a hasher -func (b *BlobSidecar) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Index' - hh.PutUint64(b.Index) - - // Field (1) 'Blob' - if size := len(b.Blob); size != 131072 { - err = ssz.ErrBytesLengthFn("--.Blob", size, 131072) - return - } - hh.PutBytes(b.Blob) - - // Field (2) 'KzgCommitment' - if size := len(b.KzgCommitment); size != 48 { - err = ssz.ErrBytesLengthFn("--.KzgCommitment", size, 48) - return - } - hh.PutBytes(b.KzgCommitment) - - // Field (3) 'KzgProof' - if size := len(b.KzgProof); size != 48 { - err = ssz.ErrBytesLengthFn("--.KzgProof", size, 48) - return - } - hh.PutBytes(b.KzgProof) - - // Field (4) 'SignedBlockHeader' - if err = b.SignedBlockHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (5) 'CommitmentInclusionProof' - { - if size := len(b.CommitmentInclusionProof); size != 17 { - err = ssz.ErrVectorLengthFn("--.CommitmentInclusionProof", size, 17) - return - } - subIndx := hh.Index() - for _, i := range b.CommitmentInclusionProof { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BlobSidecars object -func (b *BlobSidecars) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlobSidecars object to a target array -func (b *BlobSidecars) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(4) - - // Offset (0) 'Sidecars' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Sidecars) * 131928 - - // Field (0) 'Sidecars' - if size := len(b.Sidecars); size > 6 { - err = ssz.ErrListTooBigFn("--.Sidecars", size, 6) - return - } - for ii := 0; ii < len(b.Sidecars); ii++ { - if dst, err = b.Sidecars[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BlobSidecars object -func (b *BlobSidecars) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 4 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Sidecars' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 4 { - return ssz.ErrInvalidVariableOffset - } - - // Field (0) 'Sidecars' - { - buf = tail[o0:] - num, err := ssz.DivideInt2(len(buf), 131928, 6) - if err != nil { - return err - } - b.Sidecars = make([]*BlobSidecar, num) - for ii := 0; ii < num; ii++ { - if b.Sidecars[ii] == nil { - b.Sidecars[ii] = new(BlobSidecar) - } - if err = b.Sidecars[ii].UnmarshalSSZ(buf[ii*131928 : (ii+1)*131928]); err != nil { - return err - } - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlobSidecars object -func (b *BlobSidecars) SizeSSZ() (size int) { - size = 4 - - // Field (0) 'Sidecars' - size += len(b.Sidecars) * 131928 - - return -} - -// HashTreeRoot ssz hashes the BlobSidecars object -func (b *BlobSidecars) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlobSidecars object with a hasher -func (b *BlobSidecars) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Sidecars' - { - subIndx := hh.Index() - num := uint64(len(b.Sidecars)) - if num > 6 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Sidecars { - 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 BeaconBlockEpbs object -func (b *BeaconBlockEpbs) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockEpbs object to a target array -func (b *BeaconBlockEpbs) 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(BeaconBlockBodyEpbs) - } - offset += b.Body.SizeSSZ() - - // Field (4) 'Body' - if dst, err = b.Body.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlockEpbs object -func (b *BeaconBlockEpbs) 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(BeaconBlockBodyEpbs) - } - if err = b.Body.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockEpbs object -func (b *BeaconBlockEpbs) SizeSSZ() (size int) { - size = 84 - - // Field (4) 'Body' - if b.Body == nil { - b.Body = new(BeaconBlockBodyEpbs) - } - size += b.Body.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BeaconBlockEpbs object -func (b *BeaconBlockEpbs) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockEpbs object with a hasher -func (b *BeaconBlockEpbs) 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 - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlockBodyEpbs object -func (b *BeaconBlockBodyEpbs) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlockBodyEpbs object to a target array -func (b *BeaconBlockBodyEpbs) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(636) - - // 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(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(SyncAggregate) - } - if dst, err = b.SyncAggregate.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'BlsToExecutionChanges' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.BlsToExecutionChanges) * 172 - - // Field (10) 'SignedExecutionPayloadHeader' - if b.SignedExecutionPayloadHeader == nil { - b.SignedExecutionPayloadHeader = new(v1.SignedExecutionPayloadHeader) - } - if dst, err = b.SignedExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (11) 'PayloadAttestations' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PayloadAttestations) * 208 - - // 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) '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) 'PayloadAttestations' - if size := len(b.PayloadAttestations); size > 4 { - err = ssz.ErrListTooBigFn("--.PayloadAttestations", size, 4) - return - } - for ii := 0; ii < len(b.PayloadAttestations); ii++ { - if dst, err = b.PayloadAttestations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlockBodyEpbs object -func (b *BeaconBlockBodyEpbs) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 636 { - return ssz.ErrSize - } - - tail := buf - var o3, o4, o5, o6, o7, o9, 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(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 < 636 { - 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(SyncAggregate) - } - if err = b.SyncAggregate.UnmarshalSSZ(buf[220:380]); err != nil { - return err - } - - // Offset (9) 'BlsToExecutionChanges' - if o9 = ssz.ReadOffset(buf[380:384]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Field (10) 'SignedExecutionPayloadHeader' - if b.SignedExecutionPayloadHeader == nil { - b.SignedExecutionPayloadHeader = new(v1.SignedExecutionPayloadHeader) - } - if err = b.SignedExecutionPayloadHeader.UnmarshalSSZ(buf[384:632]); err != nil { - return err - } - - // Offset (11) 'PayloadAttestations' - if o11 = ssz.ReadOffset(buf[632:636]); o11 > size || o9 > 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([]*ProposerSlashing, num) - for ii := 0; ii < num; ii++ { - if b.ProposerSlashings[ii] == nil { - b.ProposerSlashings[ii] = new(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([]*AttesterSlashing, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.AttesterSlashings[indx] == nil { - b.AttesterSlashings[indx] = new(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([]*Attestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.Attestations[indx] == nil { - b.Attestations[indx] = new(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([]*Deposit, num) - for ii := 0; ii < num; ii++ { - if b.Deposits[ii] == nil { - b.Deposits[ii] = new(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([]*SignedVoluntaryExit, num) - for ii := 0; ii < num; ii++ { - if b.VoluntaryExits[ii] == nil { - b.VoluntaryExits[ii] = new(SignedVoluntaryExit) - } - if err = b.VoluntaryExits[ii].UnmarshalSSZ(buf[ii*112 : (ii+1)*112]); err != nil { - return err - } - } - } - - // Field (9) 'BlsToExecutionChanges' - { - buf = tail[o9: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) 'PayloadAttestations' - { - buf = tail[o11:] - num, err := ssz.DivideInt2(len(buf), 208, 4) - if err != nil { - return err - } - b.PayloadAttestations = make([]*PayloadAttestation, num) - for ii := 0; ii < num; ii++ { - if b.PayloadAttestations[ii] == nil { - b.PayloadAttestations[ii] = new(PayloadAttestation) - } - if err = b.PayloadAttestations[ii].UnmarshalSSZ(buf[ii*208 : (ii+1)*208]); err != nil { - return err - } - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyEpbs object -func (b *BeaconBlockBodyEpbs) SizeSSZ() (size int) { - size = 636 - - // 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) 'BlsToExecutionChanges' - size += len(b.BlsToExecutionChanges) * 172 - - // Field (11) 'PayloadAttestations' - size += len(b.PayloadAttestations) * 208 - - return -} - -// HashTreeRoot ssz hashes the BeaconBlockBodyEpbs object -func (b *BeaconBlockBodyEpbs) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlockBodyEpbs object with a hasher -func (b *BeaconBlockBodyEpbs) 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 128) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - 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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (8) 'SyncAggregate' - if err = b.SyncAggregate.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) '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 - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16) - } - } - - // Field (10) 'SignedExecutionPayloadHeader' - if err = b.SignedExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (11) 'PayloadAttestations' - { - subIndx := hh.Index() - num := uint64(len(b.PayloadAttestations)) - if num > 4 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.PayloadAttestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 4) - } else { - hh.MerkleizeWithMixin(subIndx, num, 4) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBeaconBlockEpbs object -func (s *SignedBeaconBlockEpbs) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBeaconBlockEpbs object to a target array -func (s *SignedBeaconBlockEpbs) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(100) - - // Offset (0) 'Block' - dst = ssz.WriteOffset(dst, offset) - if s.Block == nil { - s.Block = new(BeaconBlockEpbs) - } - offset += s.Block.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) 'Block' - if dst, err = s.Block.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the SignedBeaconBlockEpbs object -func (s *SignedBeaconBlockEpbs) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 100 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Block' - 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) 'Block' - { - buf = tail[o0:] - if s.Block == nil { - s.Block = new(BeaconBlockEpbs) - } - if err = s.Block.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockEpbs object -func (s *SignedBeaconBlockEpbs) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Block' - if s.Block == nil { - s.Block = new(BeaconBlockEpbs) - } - size += s.Block.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedBeaconBlockEpbs object -func (s *SignedBeaconBlockEpbs) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBeaconBlockEpbs object with a hasher -func (s *SignedBeaconBlockEpbs) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Block' - if err = s.Block.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 Deposit_Data object -func (d *Deposit_Data) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(d) -} - -// MarshalSSZTo ssz marshals the Deposit_Data object to a target array -func (d *Deposit_Data) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'PublicKey' - if size := len(d.PublicKey); size != 48 { - err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) - return - } - dst = append(dst, d.PublicKey...) - - // Field (1) 'WithdrawalCredentials' - if size := len(d.WithdrawalCredentials); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) - return - } - dst = append(dst, d.WithdrawalCredentials...) - - // Field (2) 'Amount' - dst = ssz.MarshalUint64(dst, d.Amount) - - // Field (3) 'Signature' - if size := len(d.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, d.Signature...) - - return -} - -// UnmarshalSSZ ssz unmarshals the Deposit_Data object -func (d *Deposit_Data) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 184 { - return ssz.ErrSize - } - - // Field (0) 'PublicKey' - if cap(d.PublicKey) == 0 { - d.PublicKey = make([]byte, 0, len(buf[0:48])) - } - d.PublicKey = append(d.PublicKey, buf[0:48]...) - - // Field (1) 'WithdrawalCredentials' - if cap(d.WithdrawalCredentials) == 0 { - d.WithdrawalCredentials = make([]byte, 0, len(buf[48:80])) - } - d.WithdrawalCredentials = append(d.WithdrawalCredentials, buf[48:80]...) - - // Field (2) 'Amount' - d.Amount = ssz.UnmarshallUint64(buf[80:88]) - - // Field (3) 'Signature' - if cap(d.Signature) == 0 { - d.Signature = make([]byte, 0, len(buf[88:184])) - } - d.Signature = append(d.Signature, buf[88:184]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Deposit_Data object -func (d *Deposit_Data) SizeSSZ() (size int) { - size = 184 - return -} - -// HashTreeRoot ssz hashes the Deposit_Data object -func (d *Deposit_Data) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(d) -} - -// HashTreeRootWith ssz hashes the Deposit_Data object with a hasher -func (d *Deposit_Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'PublicKey' - if size := len(d.PublicKey); size != 48 { - err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) - return - } - hh.PutBytes(d.PublicKey) - - // Field (1) 'WithdrawalCredentials' - if size := len(d.WithdrawalCredentials); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) - return - } - hh.PutBytes(d.WithdrawalCredentials) - - // Field (2) 'Amount' - hh.PutUint64(d.Amount) - - // Field (3) 'Signature' - if size := len(d.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(d.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconState object -func (b *BeaconState) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconState object to a target array -func (b *BeaconState) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(2687377) - - // Field (0) 'GenesisTime' - dst = ssz.MarshalUint64(dst, b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - dst = append(dst, b.GenesisValidatorsRoot...) - - // Field (2) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (5) 'BlockRoots' - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.BlockRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) - return - } - dst = append(dst, b.BlockRoots[ii]...) - } - - // Field (6) 'StateRoots' - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.StateRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) - return - } - dst = append(dst, b.StateRoots[ii]...) - } - - // Offset (7) 'HistoricalRoots' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalRoots) * 32 - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'Eth1DataVotes' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Eth1DataVotes) * 72 - - // Field (10) 'Eth1DepositIndex' - dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) - - // Offset (11) 'Validators' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Validators) * 121 - - // Offset (12) 'Balances' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Balances) * 8 - - // Field (13) 'RandaoMixes' - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - for ii := 0; ii < 65536; ii++ { - if size := len(b.RandaoMixes[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) - return - } - dst = append(dst, b.RandaoMixes[ii]...) - } - - // Field (14) 'Slashings' - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - dst = ssz.MarshalUint64(dst, b.Slashings[ii]) - } - - // Offset (15) 'PreviousEpochAttestations' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { - offset += 4 - offset += b.PreviousEpochAttestations[ii].SizeSSZ() - } - - // Offset (16) 'CurrentEpochAttestations' - dst = ssz.WriteOffset(dst, offset) - for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { - offset += 4 - offset += b.CurrentEpochAttestations[ii].SizeSSZ() - } - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - dst = append(dst, b.JustificationBits...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (7) 'HistoricalRoots' - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalRoots); ii++ { - if size := len(b.HistoricalRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) - return - } - dst = append(dst, b.HistoricalRoots[ii]...) - } - - // Field (9) 'Eth1DataVotes' - if size := len(b.Eth1DataVotes); size > 2048 { - err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) - return - } - for ii := 0; ii < len(b.Eth1DataVotes); ii++ { - if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (11) 'Validators' - if size := len(b.Validators); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Validators); ii++ { - if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (12) 'Balances' - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Balances); ii++ { - dst = ssz.MarshalUint64(dst, b.Balances[ii]) - } - - // Field (15) 'PreviousEpochAttestations' - if size := len(b.PreviousEpochAttestations); size > 4096 { - err = ssz.ErrListTooBigFn("--.PreviousEpochAttestations", size, 4096) - return - } - { - offset = 4 * len(b.PreviousEpochAttestations) - for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.PreviousEpochAttestations[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { - if dst, err = b.PreviousEpochAttestations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (16) 'CurrentEpochAttestations' - if size := len(b.CurrentEpochAttestations); size > 4096 { - err = ssz.ErrListTooBigFn("--.CurrentEpochAttestations", size, 4096) - return - } - { - offset = 4 * len(b.CurrentEpochAttestations) - for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { - dst = ssz.WriteOffset(dst, offset) - offset += b.CurrentEpochAttestations[ii].SizeSSZ() - } - } - for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { - if dst, err = b.CurrentEpochAttestations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconState object -func (b *BeaconState) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 2687377 { - return ssz.ErrSize - } - - tail := buf - var o7, o9, o11, o12, o15, o16 uint64 - - // Field (0) 'GenesisTime' - b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'GenesisValidatorsRoot' - if cap(b.GenesisValidatorsRoot) == 0 { - b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) - } - b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) - - // Field (2) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { - return err - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { - return err - } - - // Field (5) 'BlockRoots' - b.BlockRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.BlockRoots[ii]) == 0 { - b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) - } - b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) - } - - // Field (6) 'StateRoots' - b.StateRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.StateRoots[ii]) == 0 { - b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) - } - b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) - } - - // Offset (7) 'HistoricalRoots' - if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { - return ssz.ErrOffset - } - - if o7 < 2687377 { - return ssz.ErrInvalidVariableOffset - } - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { - return err - } - - // Offset (9) 'Eth1DataVotes' - if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Field (10) 'Eth1DepositIndex' - b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) - - // Offset (11) 'Validators' - if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { - return ssz.ErrOffset - } - - // Offset (12) 'Balances' - if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { - return ssz.ErrOffset - } - - // Field (13) 'RandaoMixes' - b.RandaoMixes = make([][]byte, 65536) - for ii := 0; ii < 65536; ii++ { - if cap(b.RandaoMixes[ii]) == 0 { - b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) - } - b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) - } - - // Field (14) 'Slashings' - b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) - for ii := 0; ii < 8192; ii++ { - b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) - } - - // Offset (15) 'PreviousEpochAttestations' - if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { - return ssz.ErrOffset - } - - // Offset (16) 'CurrentEpochAttestations' - if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { - return ssz.ErrOffset - } - - // Field (17) 'JustificationBits' - if cap(b.JustificationBits) == 0 { - b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) - } - b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { - return err - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { - return err - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { - return err - } - - // Field (7) 'HistoricalRoots' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 32, 16777216) - if err != nil { - return err - } - b.HistoricalRoots = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.HistoricalRoots[ii]) == 0 { - b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) - } - b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) - } - } - - // Field (9) 'Eth1DataVotes' - { - buf = tail[o9:o11] - num, err := ssz.DivideInt2(len(buf), 72, 2048) - if err != nil { - return err - } - b.Eth1DataVotes = make([]*Eth1Data, num) - for ii := 0; ii < num; ii++ { - if b.Eth1DataVotes[ii] == nil { - b.Eth1DataVotes[ii] = new(Eth1Data) - } - if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { - return err - } - } - } - - // Field (11) 'Validators' - { - buf = tail[o11:o12] - num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) - if err != nil { - return err - } - b.Validators = make([]*Validator, num) - for ii := 0; ii < num; ii++ { - if b.Validators[ii] == nil { - b.Validators[ii] = new(Validator) - } - if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { - return err - } - } - } - - // Field (12) 'Balances' - { - buf = tail[o12:o15] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.Balances = ssz.ExtendUint64(b.Balances, num) - for ii := 0; ii < num; ii++ { - b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (15) 'PreviousEpochAttestations' - { - buf = tail[o15:o16] - num, err := ssz.DecodeDynamicLength(buf, 4096) - if err != nil { - return err - } - b.PreviousEpochAttestations = make([]*PendingAttestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.PreviousEpochAttestations[indx] == nil { - b.PreviousEpochAttestations[indx] = new(PendingAttestation) - } - if err = b.PreviousEpochAttestations[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - - // Field (16) 'CurrentEpochAttestations' - { - buf = tail[o16:] - num, err := ssz.DecodeDynamicLength(buf, 4096) - if err != nil { - return err - } - b.CurrentEpochAttestations = make([]*PendingAttestation, num) - err = ssz.UnmarshalDynamic(buf, num, func(indx int, buf []byte) (err error) { - if b.CurrentEpochAttestations[indx] == nil { - b.CurrentEpochAttestations[indx] = new(PendingAttestation) - } - if err = b.CurrentEpochAttestations[indx].UnmarshalSSZ(buf); err != nil { - return err - } - return nil - }) - if err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconState object -func (b *BeaconState) SizeSSZ() (size int) { - size = 2687377 - - // Field (7) 'HistoricalRoots' - size += len(b.HistoricalRoots) * 32 - - // Field (9) 'Eth1DataVotes' - size += len(b.Eth1DataVotes) * 72 - - // Field (11) 'Validators' - size += len(b.Validators) * 121 - - // Field (12) 'Balances' - size += len(b.Balances) * 8 - - // Field (15) 'PreviousEpochAttestations' - for ii := 0; ii < len(b.PreviousEpochAttestations); ii++ { - size += 4 - size += b.PreviousEpochAttestations[ii].SizeSSZ() - } - - // Field (16) 'CurrentEpochAttestations' - for ii := 0; ii < len(b.CurrentEpochAttestations); ii++ { - size += 4 - size += b.CurrentEpochAttestations[ii].SizeSSZ() - } - - return -} - -// HashTreeRoot ssz hashes the BeaconState object -func (b *BeaconState) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconState object with a hasher -func (b *BeaconState) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'GenesisTime' - hh.PutUint64(b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - hh.PutBytes(b.GenesisValidatorsRoot) - - // Field (2) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (3) 'Fork' - if err = b.Fork.HashTreeRootWith(hh); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (5) 'BlockRoots' - { - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.BlockRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (6) 'StateRoots' - { - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.StateRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (7) 'HistoricalRoots' - { - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - subIndx := hh.Index() - for _, i := range b.HistoricalRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - numItems := uint64(len(b.HistoricalRoots)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 16777216) - } - } - - // Field (8) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'Eth1DataVotes' - { - subIndx := hh.Index() - num := uint64(len(b.Eth1DataVotes)) - if num > 2048 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Eth1DataVotes { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2048) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2048) - } - } - - // Field (10) 'Eth1DepositIndex' - hh.PutUint64(b.Eth1DepositIndex) - - // Field (11) 'Validators' - { - subIndx := hh.Index() - num := uint64(len(b.Validators)) - if num > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Validators { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1099511627776) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1099511627776) - } - } - - // Field (12) 'Balances' - { - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.Balances { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.Balances)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (13) 'RandaoMixes' - { - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - subIndx := hh.Index() - for _, i := range b.RandaoMixes { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (14) 'Slashings' - { - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.Slashings { - hh.AppendUint64(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (15) 'PreviousEpochAttestations' - { - subIndx := hh.Index() - num := uint64(len(b.PreviousEpochAttestations)) - if num > 4096 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.PreviousEpochAttestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, num, 4096) - } - } - - // Field (16) 'CurrentEpochAttestations' - { - subIndx := hh.Index() - num := uint64(len(b.CurrentEpochAttestations)) - if num > 4096 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.CurrentEpochAttestations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, num, 4096) - } - } - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - hh.PutBytes(b.JustificationBits) - - // Field (18) 'PreviousJustifiedCheckpoint' - if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconStateAltair object -func (b *BeaconStateAltair) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconStateAltair object to a target array -func (b *BeaconStateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(2736629) - - // Field (0) 'GenesisTime' - dst = ssz.MarshalUint64(dst, b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - dst = append(dst, b.GenesisValidatorsRoot...) - - // Field (2) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (5) 'BlockRoots' - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.BlockRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) - return - } - dst = append(dst, b.BlockRoots[ii]...) - } - - // Field (6) 'StateRoots' - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.StateRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) - return - } - dst = append(dst, b.StateRoots[ii]...) - } - - // Offset (7) 'HistoricalRoots' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalRoots) * 32 - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'Eth1DataVotes' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Eth1DataVotes) * 72 - - // Field (10) 'Eth1DepositIndex' - dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) - - // Offset (11) 'Validators' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Validators) * 121 - - // Offset (12) 'Balances' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Balances) * 8 - - // Field (13) 'RandaoMixes' - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - for ii := 0; ii < 65536; ii++ { - if size := len(b.RandaoMixes[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) - return - } - dst = append(dst, b.RandaoMixes[ii]...) - } - - // Field (14) 'Slashings' - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - dst = ssz.MarshalUint64(dst, b.Slashings[ii]) - } - - // Offset (15) 'PreviousEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PreviousEpochParticipation) - - // Offset (16) 'CurrentEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.CurrentEpochParticipation) - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - dst = append(dst, b.JustificationBits...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (21) 'InactivityScores' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.InactivityScores) * 8 - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Field (7) 'HistoricalRoots' - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalRoots); ii++ { - if size := len(b.HistoricalRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) - return - } - dst = append(dst, b.HistoricalRoots[ii]...) - } - - // Field (9) 'Eth1DataVotes' - if size := len(b.Eth1DataVotes); size > 2048 { - err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) - return - } - for ii := 0; ii < len(b.Eth1DataVotes); ii++ { - if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (11) 'Validators' - if size := len(b.Validators); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Validators); ii++ { - if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (12) 'Balances' - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Balances); ii++ { - dst = ssz.MarshalUint64(dst, b.Balances[ii]) - } - - // Field (15) 'PreviousEpochParticipation' - if size := len(b.PreviousEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.PreviousEpochParticipation...) - - // Field (16) 'CurrentEpochParticipation' - if size := len(b.CurrentEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.CurrentEpochParticipation...) - - // Field (21) 'InactivityScores' - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - for ii := 0; ii < len(b.InactivityScores); ii++ { - dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconStateAltair object -func (b *BeaconStateAltair) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 2736629 { - return ssz.ErrSize - } - - tail := buf - var o7, o9, o11, o12, o15, o16, o21 uint64 - - // Field (0) 'GenesisTime' - b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'GenesisValidatorsRoot' - if cap(b.GenesisValidatorsRoot) == 0 { - b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) - } - b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) - - // Field (2) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { - return err - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { - return err - } - - // Field (5) 'BlockRoots' - b.BlockRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.BlockRoots[ii]) == 0 { - b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) - } - b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) - } - - // Field (6) 'StateRoots' - b.StateRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.StateRoots[ii]) == 0 { - b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) - } - b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) - } - - // Offset (7) 'HistoricalRoots' - if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { - return ssz.ErrOffset - } - - if o7 < 2736629 { - return ssz.ErrInvalidVariableOffset - } - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { - return err - } - - // Offset (9) 'Eth1DataVotes' - if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Field (10) 'Eth1DepositIndex' - b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) - - // Offset (11) 'Validators' - if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { - return ssz.ErrOffset - } - - // Offset (12) 'Balances' - if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { - return ssz.ErrOffset - } - - // Field (13) 'RandaoMixes' - b.RandaoMixes = make([][]byte, 65536) - for ii := 0; ii < 65536; ii++ { - if cap(b.RandaoMixes[ii]) == 0 { - b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) - } - b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) - } - - // Field (14) 'Slashings' - b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) - for ii := 0; ii < 8192; ii++ { - b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) - } - - // Offset (15) 'PreviousEpochParticipation' - if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { - return ssz.ErrOffset - } - - // Offset (16) 'CurrentEpochParticipation' - if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { - return ssz.ErrOffset - } - - // Field (17) 'JustificationBits' - if cap(b.JustificationBits) == 0 { - b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) - } - b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { - return err - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { - return err - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { - return err - } - - // Offset (21) 'InactivityScores' - if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { - return ssz.ErrOffset - } - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { - return err - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { - return err - } - - // Field (7) 'HistoricalRoots' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 32, 16777216) - if err != nil { - return err - } - b.HistoricalRoots = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.HistoricalRoots[ii]) == 0 { - b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) - } - b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) - } - } - - // Field (9) 'Eth1DataVotes' - { - buf = tail[o9:o11] - num, err := ssz.DivideInt2(len(buf), 72, 2048) - if err != nil { - return err - } - b.Eth1DataVotes = make([]*Eth1Data, num) - for ii := 0; ii < num; ii++ { - if b.Eth1DataVotes[ii] == nil { - b.Eth1DataVotes[ii] = new(Eth1Data) - } - if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { - return err - } - } - } - - // Field (11) 'Validators' - { - buf = tail[o11:o12] - num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) - if err != nil { - return err - } - b.Validators = make([]*Validator, num) - for ii := 0; ii < num; ii++ { - if b.Validators[ii] == nil { - b.Validators[ii] = new(Validator) - } - if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { - return err - } - } - } - - // Field (12) 'Balances' - { - buf = tail[o12:o15] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.Balances = ssz.ExtendUint64(b.Balances, num) - for ii := 0; ii < num; ii++ { - b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - buf = tail[o15:o16] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.PreviousEpochParticipation) == 0 { - b.PreviousEpochParticipation = make([]byte, 0, len(buf)) - } - b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) - } - - // Field (16) 'CurrentEpochParticipation' - { - buf = tail[o16:o21] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.CurrentEpochParticipation) == 0 { - b.CurrentEpochParticipation = make([]byte, 0, len(buf)) - } - b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) - } - - // Field (21) 'InactivityScores' - { - buf = tail[o21:] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) - for ii := 0; ii < num; ii++ { - b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateAltair object -func (b *BeaconStateAltair) SizeSSZ() (size int) { - size = 2736629 - - // Field (7) 'HistoricalRoots' - size += len(b.HistoricalRoots) * 32 - - // Field (9) 'Eth1DataVotes' - size += len(b.Eth1DataVotes) * 72 - - // Field (11) 'Validators' - size += len(b.Validators) * 121 - - // Field (12) 'Balances' - size += len(b.Balances) * 8 - - // Field (15) 'PreviousEpochParticipation' - size += len(b.PreviousEpochParticipation) - - // Field (16) 'CurrentEpochParticipation' - size += len(b.CurrentEpochParticipation) - - // Field (21) 'InactivityScores' - size += len(b.InactivityScores) * 8 - - return -} - -// HashTreeRoot ssz hashes the BeaconStateAltair object -func (b *BeaconStateAltair) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconStateAltair object with a hasher -func (b *BeaconStateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'GenesisTime' - hh.PutUint64(b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - hh.PutBytes(b.GenesisValidatorsRoot) - - // Field (2) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (3) 'Fork' - if err = b.Fork.HashTreeRootWith(hh); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (5) 'BlockRoots' - { - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.BlockRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (6) 'StateRoots' - { - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.StateRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (7) 'HistoricalRoots' - { - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - subIndx := hh.Index() - for _, i := range b.HistoricalRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - numItems := uint64(len(b.HistoricalRoots)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 16777216) - } - } - - // Field (8) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'Eth1DataVotes' - { - subIndx := hh.Index() - num := uint64(len(b.Eth1DataVotes)) - if num > 2048 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Eth1DataVotes { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2048) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2048) - } - } - - // Field (10) 'Eth1DepositIndex' - hh.PutUint64(b.Eth1DepositIndex) - - // Field (11) 'Validators' - { - subIndx := hh.Index() - num := uint64(len(b.Validators)) - if num > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Validators { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1099511627776) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1099511627776) - } - } - - // Field (12) 'Balances' - { - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.Balances { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.Balances)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (13) 'RandaoMixes' - { - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - subIndx := hh.Index() - for _, i := range b.RandaoMixes { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (14) 'Slashings' - { - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.Slashings { - hh.AppendUint64(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.PreviousEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.PreviousEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (16) 'CurrentEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.CurrentEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.CurrentEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - hh.PutBytes(b.JustificationBits) - - // Field (18) 'PreviousJustifiedCheckpoint' - if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (21) 'InactivityScores' - { - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.InactivityScores { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.InactivityScores)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (22) 'CurrentSyncCommittee' - if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the Fork object -func (f *Fork) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(f) -} - -// MarshalSSZTo ssz marshals the Fork object to a target array -func (f *Fork) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'PreviousVersion' - if size := len(f.PreviousVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.PreviousVersion", size, 4) - return - } - dst = append(dst, f.PreviousVersion...) - - // Field (1) 'CurrentVersion' - if size := len(f.CurrentVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) - return - } - dst = append(dst, f.CurrentVersion...) - - // Field (2) 'Epoch' - dst = ssz.MarshalUint64(dst, uint64(f.Epoch)) - - return -} - -// UnmarshalSSZ ssz unmarshals the Fork object -func (f *Fork) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 16 { - return ssz.ErrSize - } - - // Field (0) 'PreviousVersion' - if cap(f.PreviousVersion) == 0 { - f.PreviousVersion = make([]byte, 0, len(buf[0:4])) - } - f.PreviousVersion = append(f.PreviousVersion, buf[0:4]...) - - // Field (1) 'CurrentVersion' - if cap(f.CurrentVersion) == 0 { - f.CurrentVersion = make([]byte, 0, len(buf[4:8])) - } - f.CurrentVersion = append(f.CurrentVersion, buf[4:8]...) - - // Field (2) 'Epoch' - f.Epoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[8:16])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Fork object -func (f *Fork) SizeSSZ() (size int) { - size = 16 - return -} - -// HashTreeRoot ssz hashes the Fork object -func (f *Fork) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(f) -} - -// HashTreeRootWith ssz hashes the Fork object with a hasher -func (f *Fork) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'PreviousVersion' - if size := len(f.PreviousVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.PreviousVersion", size, 4) - return - } - hh.PutBytes(f.PreviousVersion) - - // Field (1) 'CurrentVersion' - if size := len(f.CurrentVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) - return - } - hh.PutBytes(f.CurrentVersion) - - // Field (2) 'Epoch' - hh.PutUint64(uint64(f.Epoch)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the PendingAttestation object -func (p *PendingAttestation) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} - -// MarshalSSZTo ssz marshals the PendingAttestation object to a target array -func (p *PendingAttestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(148) - - // Offset (0) 'AggregationBits' - dst = ssz.WriteOffset(dst, offset) - offset += len(p.AggregationBits) - - // Field (1) 'Data' - if p.Data == nil { - p.Data = new(AttestationData) - } - if dst, err = p.Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'InclusionDelay' - dst = ssz.MarshalUint64(dst, uint64(p.InclusionDelay)) - - // Field (3) 'ProposerIndex' - dst = ssz.MarshalUint64(dst, uint64(p.ProposerIndex)) - - // Field (0) 'AggregationBits' - if size := len(p.AggregationBits); size > 2048 { - err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 2048) - return - } - dst = append(dst, p.AggregationBits...) - - return -} - -// UnmarshalSSZ ssz unmarshals the PendingAttestation object -func (p *PendingAttestation) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 148 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'AggregationBits' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 148 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'Data' - if p.Data == nil { - p.Data = new(AttestationData) - } - if err = p.Data.UnmarshalSSZ(buf[4:132]); err != nil { - return err - } - - // Field (2) 'InclusionDelay' - p.InclusionDelay = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[132:140])) - - // Field (3) 'ProposerIndex' - p.ProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[140:148])) - - // Field (0) 'AggregationBits' - { - buf = tail[o0:] - if err = ssz.ValidateBitlist(buf, 2048); err != nil { - return err - } - if cap(p.AggregationBits) == 0 { - p.AggregationBits = make([]byte, 0, len(buf)) - } - p.AggregationBits = append(p.AggregationBits, buf...) - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the PendingAttestation object -func (p *PendingAttestation) SizeSSZ() (size int) { - size = 148 - - // Field (0) 'AggregationBits' - size += len(p.AggregationBits) - - return -} - -// HashTreeRoot ssz hashes the PendingAttestation object -func (p *PendingAttestation) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the PendingAttestation object with a hasher -func (p *PendingAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AggregationBits' - if len(p.AggregationBits) == 0 { - err = ssz.ErrEmptyBitlist - return - } - hh.PutBitlist(p.AggregationBits, 2048) - - // Field (1) 'Data' - if err = p.Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'InclusionDelay' - hh.PutUint64(uint64(p.InclusionDelay)) - - // Field (3) 'ProposerIndex' - hh.PutUint64(uint64(p.ProposerIndex)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the HistoricalBatch object -func (h *HistoricalBatch) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(h) -} - -// MarshalSSZTo ssz marshals the HistoricalBatch object to a target array -func (h *HistoricalBatch) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'BlockRoots' - if size := len(h.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(h.BlockRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) - return - } - dst = append(dst, h.BlockRoots[ii]...) - } - - // Field (1) 'StateRoots' - if size := len(h.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(h.StateRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) - return - } - dst = append(dst, h.StateRoots[ii]...) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the HistoricalBatch object -func (h *HistoricalBatch) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 524288 { - return ssz.ErrSize - } - - // Field (0) 'BlockRoots' - h.BlockRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(h.BlockRoots[ii]) == 0 { - h.BlockRoots[ii] = make([]byte, 0, len(buf[0:262144][ii*32:(ii+1)*32])) - } - h.BlockRoots[ii] = append(h.BlockRoots[ii], buf[0:262144][ii*32:(ii+1)*32]...) - } - - // Field (1) 'StateRoots' - h.StateRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(h.StateRoots[ii]) == 0 { - h.StateRoots[ii] = make([]byte, 0, len(buf[262144:524288][ii*32:(ii+1)*32])) - } - h.StateRoots[ii] = append(h.StateRoots[ii], buf[262144:524288][ii*32:(ii+1)*32]...) - } - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the HistoricalBatch object -func (h *HistoricalBatch) SizeSSZ() (size int) { - size = 524288 - return -} - -// HashTreeRoot ssz hashes the HistoricalBatch object -func (h *HistoricalBatch) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(h) -} - -// HashTreeRootWith ssz hashes the HistoricalBatch object with a hasher -func (h *HistoricalBatch) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'BlockRoots' - { - if size := len(h.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range h.BlockRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (1) 'StateRoots' - { - if size := len(h.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range h.StateRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SigningData object -func (s *SigningData) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SigningData object to a target array -func (s *SigningData) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'ObjectRoot' - if size := len(s.ObjectRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ObjectRoot", size, 32) - return - } - dst = append(dst, s.ObjectRoot...) - - // Field (1) 'Domain' - if size := len(s.Domain); size != 32 { - err = ssz.ErrBytesLengthFn("--.Domain", size, 32) - return - } - dst = append(dst, s.Domain...) - - return -} - -// UnmarshalSSZ ssz unmarshals the SigningData object -func (s *SigningData) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 64 { - return ssz.ErrSize - } - - // Field (0) 'ObjectRoot' - if cap(s.ObjectRoot) == 0 { - s.ObjectRoot = make([]byte, 0, len(buf[0:32])) - } - s.ObjectRoot = append(s.ObjectRoot, buf[0:32]...) - - // Field (1) 'Domain' - if cap(s.Domain) == 0 { - s.Domain = make([]byte, 0, len(buf[32:64])) - } - s.Domain = append(s.Domain, buf[32:64]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SigningData object -func (s *SigningData) SizeSSZ() (size int) { - size = 64 - return -} - -// HashTreeRoot ssz hashes the SigningData object -func (s *SigningData) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SigningData object with a hasher -func (s *SigningData) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'ObjectRoot' - if size := len(s.ObjectRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.ObjectRoot", size, 32) - return - } - hh.PutBytes(s.ObjectRoot) - - // Field (1) 'Domain' - if size := len(s.Domain); size != 32 { - err = ssz.ErrBytesLengthFn("--.Domain", size, 32) - return - } - hh.PutBytes(s.Domain) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the ForkData object -func (f *ForkData) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(f) -} - -// MarshalSSZTo ssz marshals the ForkData object to a target array -func (f *ForkData) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'CurrentVersion' - if size := len(f.CurrentVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) - return - } - dst = append(dst, f.CurrentVersion...) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(f.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - dst = append(dst, f.GenesisValidatorsRoot...) - - return -} - -// UnmarshalSSZ ssz unmarshals the ForkData object -func (f *ForkData) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 36 { - return ssz.ErrSize - } - - // Field (0) 'CurrentVersion' - if cap(f.CurrentVersion) == 0 { - f.CurrentVersion = make([]byte, 0, len(buf[0:4])) - } - f.CurrentVersion = append(f.CurrentVersion, buf[0:4]...) - - // Field (1) 'GenesisValidatorsRoot' - if cap(f.GenesisValidatorsRoot) == 0 { - f.GenesisValidatorsRoot = make([]byte, 0, len(buf[4:36])) - } - f.GenesisValidatorsRoot = append(f.GenesisValidatorsRoot, buf[4:36]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the ForkData object -func (f *ForkData) SizeSSZ() (size int) { - size = 36 - return -} - -// HashTreeRoot ssz hashes the ForkData object -func (f *ForkData) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(f) -} - -// HashTreeRootWith ssz hashes the ForkData object with a hasher -func (f *ForkData) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'CurrentVersion' - if size := len(f.CurrentVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) - return - } - hh.PutBytes(f.CurrentVersion) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(f.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - hh.PutBytes(f.GenesisValidatorsRoot) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the DepositMessage object -func (d *DepositMessage) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(d) -} - -// MarshalSSZTo ssz marshals the DepositMessage object to a target array -func (d *DepositMessage) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'PublicKey' - if size := len(d.PublicKey); size != 48 { - err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) - return - } - dst = append(dst, d.PublicKey...) - - // Field (1) 'WithdrawalCredentials' - if size := len(d.WithdrawalCredentials); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) - return - } - dst = append(dst, d.WithdrawalCredentials...) - - // Field (2) 'Amount' - dst = ssz.MarshalUint64(dst, d.Amount) - - return -} - -// UnmarshalSSZ ssz unmarshals the DepositMessage object -func (d *DepositMessage) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 88 { - return ssz.ErrSize - } - - // Field (0) 'PublicKey' - if cap(d.PublicKey) == 0 { - d.PublicKey = make([]byte, 0, len(buf[0:48])) - } - d.PublicKey = append(d.PublicKey, buf[0:48]...) - - // Field (1) 'WithdrawalCredentials' - if cap(d.WithdrawalCredentials) == 0 { - d.WithdrawalCredentials = make([]byte, 0, len(buf[48:80])) - } - d.WithdrawalCredentials = append(d.WithdrawalCredentials, buf[48:80]...) - - // Field (2) 'Amount' - d.Amount = ssz.UnmarshallUint64(buf[80:88]) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the DepositMessage object -func (d *DepositMessage) SizeSSZ() (size int) { - size = 88 - return -} - -// HashTreeRoot ssz hashes the DepositMessage object -func (d *DepositMessage) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(d) -} - -// HashTreeRootWith ssz hashes the DepositMessage object with a hasher -func (d *DepositMessage) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'PublicKey' - if size := len(d.PublicKey); size != 48 { - err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) - return - } - hh.PutBytes(d.PublicKey) - - // Field (1) 'WithdrawalCredentials' - if size := len(d.WithdrawalCredentials); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) - return - } - hh.PutBytes(d.WithdrawalCredentials) - - // Field (2) 'Amount' - hh.PutUint64(d.Amount) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - 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) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (1) 'AggregatePubkey' - if size := len(s.AggregatePubkey); size != 48 { - err = ssz.ErrBytesLengthFn("--.AggregatePubkey", size, 48) - return - } - hh.PutBytes(s.AggregatePubkey) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SyncAggregatorSelectionData object -func (s *SyncAggregatorSelectionData) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SyncAggregatorSelectionData object to a target array -func (s *SyncAggregatorSelectionData) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(s.Slot)) - - // Field (1) 'SubcommitteeIndex' - dst = ssz.MarshalUint64(dst, s.SubcommitteeIndex) - - return -} - -// UnmarshalSSZ ssz unmarshals the SyncAggregatorSelectionData object -func (s *SyncAggregatorSelectionData) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 16 { - return ssz.ErrSize - } - - // Field (0) 'Slot' - s.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'SubcommitteeIndex' - s.SubcommitteeIndex = ssz.UnmarshallUint64(buf[8:16]) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SyncAggregatorSelectionData object -func (s *SyncAggregatorSelectionData) SizeSSZ() (size int) { - size = 16 - return -} - -// HashTreeRoot ssz hashes the SyncAggregatorSelectionData object -func (s *SyncAggregatorSelectionData) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SyncAggregatorSelectionData object with a hasher -func (s *SyncAggregatorSelectionData) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(s.Slot)) - - // Field (1) 'SubcommitteeIndex' - hh.PutUint64(s.SubcommitteeIndex) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconStateBellatrix object -func (b *BeaconStateBellatrix) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconStateBellatrix object to a target array -func (b *BeaconStateBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(2736633) - - // Field (0) 'GenesisTime' - dst = ssz.MarshalUint64(dst, b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - dst = append(dst, b.GenesisValidatorsRoot...) - - // Field (2) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (5) 'BlockRoots' - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.BlockRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) - return - } - dst = append(dst, b.BlockRoots[ii]...) - } - - // Field (6) 'StateRoots' - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.StateRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) - return - } - dst = append(dst, b.StateRoots[ii]...) - } - - // Offset (7) 'HistoricalRoots' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalRoots) * 32 - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'Eth1DataVotes' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Eth1DataVotes) * 72 - - // Field (10) 'Eth1DepositIndex' - dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) - - // Offset (11) 'Validators' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Validators) * 121 - - // Offset (12) 'Balances' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Balances) * 8 - - // Field (13) 'RandaoMixes' - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - for ii := 0; ii < 65536; ii++ { - if size := len(b.RandaoMixes[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) - return - } - dst = append(dst, b.RandaoMixes[ii]...) - } - - // Field (14) 'Slashings' - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - dst = ssz.MarshalUint64(dst, b.Slashings[ii]) - } - - // Offset (15) 'PreviousEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PreviousEpochParticipation) - - // Offset (16) 'CurrentEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.CurrentEpochParticipation) - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - dst = append(dst, b.JustificationBits...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (21) 'InactivityScores' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.InactivityScores) * 8 - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (24) 'LatestExecutionPayloadHeader' - dst = ssz.WriteOffset(dst, offset) - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) - } - offset += b.LatestExecutionPayloadHeader.SizeSSZ() - - // Field (7) 'HistoricalRoots' - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalRoots); ii++ { - if size := len(b.HistoricalRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) - return - } - dst = append(dst, b.HistoricalRoots[ii]...) - } - - // Field (9) 'Eth1DataVotes' - if size := len(b.Eth1DataVotes); size > 2048 { - err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) - return - } - for ii := 0; ii < len(b.Eth1DataVotes); ii++ { - if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (11) 'Validators' - if size := len(b.Validators); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Validators); ii++ { - if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (12) 'Balances' - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Balances); ii++ { - dst = ssz.MarshalUint64(dst, b.Balances[ii]) - } - - // Field (15) 'PreviousEpochParticipation' - if size := len(b.PreviousEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.PreviousEpochParticipation...) - - // Field (16) 'CurrentEpochParticipation' - if size := len(b.CurrentEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.CurrentEpochParticipation...) - - // Field (21) 'InactivityScores' - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - for ii := 0; ii < len(b.InactivityScores); ii++ { - dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) - } - - // Field (24) 'LatestExecutionPayloadHeader' - if dst, err = b.LatestExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { - return - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconStateBellatrix object -func (b *BeaconStateBellatrix) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 2736633 { - return ssz.ErrSize - } - - tail := buf - var o7, o9, o11, o12, o15, o16, o21, o24 uint64 - - // Field (0) 'GenesisTime' - b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'GenesisValidatorsRoot' - if cap(b.GenesisValidatorsRoot) == 0 { - b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) - } - b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) - - // Field (2) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { - return err - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { - return err - } - - // Field (5) 'BlockRoots' - b.BlockRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.BlockRoots[ii]) == 0 { - b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) - } - b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) - } - - // Field (6) 'StateRoots' - b.StateRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.StateRoots[ii]) == 0 { - b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) - } - b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) - } - - // Offset (7) 'HistoricalRoots' - if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { - return ssz.ErrOffset - } - - if o7 < 2736633 { - return ssz.ErrInvalidVariableOffset - } - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { - return err - } - - // Offset (9) 'Eth1DataVotes' - if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Field (10) 'Eth1DepositIndex' - b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) - - // Offset (11) 'Validators' - if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { - return ssz.ErrOffset - } - - // Offset (12) 'Balances' - if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { - return ssz.ErrOffset - } - - // Field (13) 'RandaoMixes' - b.RandaoMixes = make([][]byte, 65536) - for ii := 0; ii < 65536; ii++ { - if cap(b.RandaoMixes[ii]) == 0 { - b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) - } - b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) - } - - // Field (14) 'Slashings' - b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) - for ii := 0; ii < 8192; ii++ { - b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) - } - - // Offset (15) 'PreviousEpochParticipation' - if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { - return ssz.ErrOffset - } - - // Offset (16) 'CurrentEpochParticipation' - if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { - return ssz.ErrOffset - } - - // Field (17) 'JustificationBits' - if cap(b.JustificationBits) == 0 { - b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) - } - b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { - return err - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { - return err - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { - return err - } - - // Offset (21) 'InactivityScores' - if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { - return ssz.ErrOffset - } - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { - return err - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { - return err - } - - // Offset (24) 'LatestExecutionPayloadHeader' - if o24 = ssz.ReadOffset(buf[2736629:2736633]); o24 > size || o21 > o24 { - return ssz.ErrOffset - } - - // Field (7) 'HistoricalRoots' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 32, 16777216) - if err != nil { - return err - } - b.HistoricalRoots = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.HistoricalRoots[ii]) == 0 { - b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) - } - b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) - } - } - - // Field (9) 'Eth1DataVotes' - { - buf = tail[o9:o11] - num, err := ssz.DivideInt2(len(buf), 72, 2048) - if err != nil { - return err - } - b.Eth1DataVotes = make([]*Eth1Data, num) - for ii := 0; ii < num; ii++ { - if b.Eth1DataVotes[ii] == nil { - b.Eth1DataVotes[ii] = new(Eth1Data) - } - if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { - return err - } - } - } - - // Field (11) 'Validators' - { - buf = tail[o11:o12] - num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) - if err != nil { - return err - } - b.Validators = make([]*Validator, num) - for ii := 0; ii < num; ii++ { - if b.Validators[ii] == nil { - b.Validators[ii] = new(Validator) - } - if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { - return err - } - } - } - - // Field (12) 'Balances' - { - buf = tail[o12:o15] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.Balances = ssz.ExtendUint64(b.Balances, num) - for ii := 0; ii < num; ii++ { - b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - buf = tail[o15:o16] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.PreviousEpochParticipation) == 0 { - b.PreviousEpochParticipation = make([]byte, 0, len(buf)) - } - b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) - } - - // Field (16) 'CurrentEpochParticipation' - { - buf = tail[o16:o21] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.CurrentEpochParticipation) == 0 { - b.CurrentEpochParticipation = make([]byte, 0, len(buf)) - } - b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) - } - - // Field (21) 'InactivityScores' - { - buf = tail[o21:o24] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) - for ii := 0; ii < num; ii++ { - b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (24) 'LatestExecutionPayloadHeader' - { - buf = tail[o24:] - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) - } - if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateBellatrix object -func (b *BeaconStateBellatrix) SizeSSZ() (size int) { - size = 2736633 - - // Field (7) 'HistoricalRoots' - size += len(b.HistoricalRoots) * 32 - - // Field (9) 'Eth1DataVotes' - size += len(b.Eth1DataVotes) * 72 - - // Field (11) 'Validators' - size += len(b.Validators) * 121 - - // Field (12) 'Balances' - size += len(b.Balances) * 8 - - // Field (15) 'PreviousEpochParticipation' - size += len(b.PreviousEpochParticipation) - - // Field (16) 'CurrentEpochParticipation' - size += len(b.CurrentEpochParticipation) - - // Field (21) 'InactivityScores' - size += len(b.InactivityScores) * 8 - - // Field (24) 'LatestExecutionPayloadHeader' - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeader) - } - size += b.LatestExecutionPayloadHeader.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the BeaconStateBellatrix object -func (b *BeaconStateBellatrix) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconStateBellatrix object with a hasher -func (b *BeaconStateBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'GenesisTime' - hh.PutUint64(b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - hh.PutBytes(b.GenesisValidatorsRoot) - - // Field (2) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (3) 'Fork' - if err = b.Fork.HashTreeRootWith(hh); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (5) 'BlockRoots' - { - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.BlockRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (6) 'StateRoots' - { - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.StateRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (7) 'HistoricalRoots' - { - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - subIndx := hh.Index() - for _, i := range b.HistoricalRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - numItems := uint64(len(b.HistoricalRoots)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 16777216) - } - } - - // Field (8) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'Eth1DataVotes' - { - subIndx := hh.Index() - num := uint64(len(b.Eth1DataVotes)) - if num > 2048 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Eth1DataVotes { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2048) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2048) - } - } - - // Field (10) 'Eth1DepositIndex' - hh.PutUint64(b.Eth1DepositIndex) - - // Field (11) 'Validators' - { - subIndx := hh.Index() - num := uint64(len(b.Validators)) - if num > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Validators { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1099511627776) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1099511627776) - } - } - - // Field (12) 'Balances' - { - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.Balances { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.Balances)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (13) 'RandaoMixes' - { - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - subIndx := hh.Index() - for _, i := range b.RandaoMixes { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (14) 'Slashings' - { - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.Slashings { - hh.AppendUint64(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.PreviousEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.PreviousEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (16) 'CurrentEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.CurrentEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.CurrentEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - hh.PutBytes(b.JustificationBits) - - // Field (18) 'PreviousJustifiedCheckpoint' - if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (21) 'InactivityScores' - { - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.InactivityScores { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.InactivityScores)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (22) 'CurrentSyncCommittee' - if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (24) 'LatestExecutionPayloadHeader' - if err = b.LatestExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { - return - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconStateCapella object -func (b *BeaconStateCapella) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconStateCapella object to a target array -func (b *BeaconStateCapella) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(2736653) - - // Field (0) 'GenesisTime' - dst = ssz.MarshalUint64(dst, b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - dst = append(dst, b.GenesisValidatorsRoot...) - - // Field (2) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (5) 'BlockRoots' - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.BlockRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) - return - } - dst = append(dst, b.BlockRoots[ii]...) - } - - // Field (6) 'StateRoots' - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.StateRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) - return - } - dst = append(dst, b.StateRoots[ii]...) - } - - // Offset (7) 'HistoricalRoots' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalRoots) * 32 - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'Eth1DataVotes' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Eth1DataVotes) * 72 - - // Field (10) 'Eth1DepositIndex' - dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) - - // Offset (11) 'Validators' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Validators) * 121 - - // Offset (12) 'Balances' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Balances) * 8 - - // Field (13) 'RandaoMixes' - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - for ii := 0; ii < 65536; ii++ { - if size := len(b.RandaoMixes[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) - return - } - dst = append(dst, b.RandaoMixes[ii]...) - } - - // Field (14) 'Slashings' - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - dst = ssz.MarshalUint64(dst, b.Slashings[ii]) - } - - // Offset (15) 'PreviousEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PreviousEpochParticipation) - - // Offset (16) 'CurrentEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.CurrentEpochParticipation) - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - dst = append(dst, b.JustificationBits...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (21) 'InactivityScores' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.InactivityScores) * 8 - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (24) 'LatestExecutionPayloadHeader' - dst = ssz.WriteOffset(dst, offset) - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) - } - offset += b.LatestExecutionPayloadHeader.SizeSSZ() - - // Field (25) 'NextWithdrawalIndex' - dst = ssz.MarshalUint64(dst, b.NextWithdrawalIndex) - - // Field (26) 'NextWithdrawalValidatorIndex' - dst = ssz.MarshalUint64(dst, uint64(b.NextWithdrawalValidatorIndex)) - - // Offset (27) 'HistoricalSummaries' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalSummaries) * 64 - - // Field (7) 'HistoricalRoots' - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalRoots); ii++ { - if size := len(b.HistoricalRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) - return - } - dst = append(dst, b.HistoricalRoots[ii]...) - } - - // Field (9) 'Eth1DataVotes' - if size := len(b.Eth1DataVotes); size > 2048 { - err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) - return - } - for ii := 0; ii < len(b.Eth1DataVotes); ii++ { - if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (11) 'Validators' - if size := len(b.Validators); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Validators); ii++ { - if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (12) 'Balances' - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Balances); ii++ { - dst = ssz.MarshalUint64(dst, b.Balances[ii]) - } - - // Field (15) 'PreviousEpochParticipation' - if size := len(b.PreviousEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.PreviousEpochParticipation...) - - // Field (16) 'CurrentEpochParticipation' - if size := len(b.CurrentEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.CurrentEpochParticipation...) - - // Field (21) 'InactivityScores' - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - for ii := 0; ii < len(b.InactivityScores); ii++ { - dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) - } - - // Field (24) 'LatestExecutionPayloadHeader' - if dst, err = b.LatestExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (27) 'HistoricalSummaries' - if size := len(b.HistoricalSummaries); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalSummaries", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalSummaries); ii++ { - if dst, err = b.HistoricalSummaries[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconStateCapella object -func (b *BeaconStateCapella) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 2736653 { - return ssz.ErrSize - } - - tail := buf - var o7, o9, o11, o12, o15, o16, o21, o24, o27 uint64 - - // Field (0) 'GenesisTime' - b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'GenesisValidatorsRoot' - if cap(b.GenesisValidatorsRoot) == 0 { - b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) - } - b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) - - // Field (2) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { - return err - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { - return err - } - - // Field (5) 'BlockRoots' - b.BlockRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.BlockRoots[ii]) == 0 { - b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) - } - b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) - } - - // Field (6) 'StateRoots' - b.StateRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.StateRoots[ii]) == 0 { - b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) - } - b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) - } - - // Offset (7) 'HistoricalRoots' - if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { - return ssz.ErrOffset - } - - if o7 < 2736653 { - return ssz.ErrInvalidVariableOffset - } - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { - return err - } - - // Offset (9) 'Eth1DataVotes' - if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Field (10) 'Eth1DepositIndex' - b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) - - // Offset (11) 'Validators' - if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { - return ssz.ErrOffset - } - - // Offset (12) 'Balances' - if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { - return ssz.ErrOffset - } - - // Field (13) 'RandaoMixes' - b.RandaoMixes = make([][]byte, 65536) - for ii := 0; ii < 65536; ii++ { - if cap(b.RandaoMixes[ii]) == 0 { - b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) - } - b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) - } - - // Field (14) 'Slashings' - b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) - for ii := 0; ii < 8192; ii++ { - b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) - } - - // Offset (15) 'PreviousEpochParticipation' - if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { - return ssz.ErrOffset - } - - // Offset (16) 'CurrentEpochParticipation' - if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { - return ssz.ErrOffset - } - - // Field (17) 'JustificationBits' - if cap(b.JustificationBits) == 0 { - b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) - } - b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { - return err - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { - return err - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { - return err - } - - // Offset (21) 'InactivityScores' - if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { - return ssz.ErrOffset - } - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { - return err - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { - return err - } - - // Offset (24) 'LatestExecutionPayloadHeader' - if o24 = ssz.ReadOffset(buf[2736629:2736633]); o24 > size || o21 > o24 { - return ssz.ErrOffset - } - - // Field (25) 'NextWithdrawalIndex' - b.NextWithdrawalIndex = ssz.UnmarshallUint64(buf[2736633:2736641]) - - // Field (26) 'NextWithdrawalValidatorIndex' - b.NextWithdrawalValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[2736641:2736649])) - - // Offset (27) 'HistoricalSummaries' - if o27 = ssz.ReadOffset(buf[2736649:2736653]); o27 > size || o24 > o27 { - return ssz.ErrOffset - } - - // Field (7) 'HistoricalRoots' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 32, 16777216) - if err != nil { - return err - } - b.HistoricalRoots = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.HistoricalRoots[ii]) == 0 { - b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) - } - b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) - } - } - - // Field (9) 'Eth1DataVotes' - { - buf = tail[o9:o11] - num, err := ssz.DivideInt2(len(buf), 72, 2048) - if err != nil { - return err - } - b.Eth1DataVotes = make([]*Eth1Data, num) - for ii := 0; ii < num; ii++ { - if b.Eth1DataVotes[ii] == nil { - b.Eth1DataVotes[ii] = new(Eth1Data) - } - if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { - return err - } - } - } - - // Field (11) 'Validators' - { - buf = tail[o11:o12] - num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) - if err != nil { - return err - } - b.Validators = make([]*Validator, num) - for ii := 0; ii < num; ii++ { - if b.Validators[ii] == nil { - b.Validators[ii] = new(Validator) - } - if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { - return err - } - } - } - - // Field (12) 'Balances' - { - buf = tail[o12:o15] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.Balances = ssz.ExtendUint64(b.Balances, num) - for ii := 0; ii < num; ii++ { - b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - buf = tail[o15:o16] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.PreviousEpochParticipation) == 0 { - b.PreviousEpochParticipation = make([]byte, 0, len(buf)) - } - b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) - } - - // Field (16) 'CurrentEpochParticipation' - { - buf = tail[o16:o21] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.CurrentEpochParticipation) == 0 { - b.CurrentEpochParticipation = make([]byte, 0, len(buf)) - } - b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) - } - - // Field (21) 'InactivityScores' - { - buf = tail[o21:o24] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) - for ii := 0; ii < num; ii++ { - b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (24) 'LatestExecutionPayloadHeader' - { - buf = tail[o24:o27] - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) - } - if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (27) 'HistoricalSummaries' - { - buf = tail[o27:] - num, err := ssz.DivideInt2(len(buf), 64, 16777216) - if err != nil { - return err - } - b.HistoricalSummaries = make([]*HistoricalSummary, num) - for ii := 0; ii < num; ii++ { - if b.HistoricalSummaries[ii] == nil { - b.HistoricalSummaries[ii] = new(HistoricalSummary) - } - if err = b.HistoricalSummaries[ii].UnmarshalSSZ(buf[ii*64 : (ii+1)*64]); err != nil { - return err - } - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateCapella object -func (b *BeaconStateCapella) SizeSSZ() (size int) { - size = 2736653 - - // Field (7) 'HistoricalRoots' - size += len(b.HistoricalRoots) * 32 - - // Field (9) 'Eth1DataVotes' - size += len(b.Eth1DataVotes) * 72 - - // Field (11) 'Validators' - size += len(b.Validators) * 121 - - // Field (12) 'Balances' - size += len(b.Balances) * 8 - - // Field (15) 'PreviousEpochParticipation' - size += len(b.PreviousEpochParticipation) - - // Field (16) 'CurrentEpochParticipation' - size += len(b.CurrentEpochParticipation) - - // Field (21) 'InactivityScores' - size += len(b.InactivityScores) * 8 - - // Field (24) 'LatestExecutionPayloadHeader' - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderCapella) - } - size += b.LatestExecutionPayloadHeader.SizeSSZ() - - // Field (27) 'HistoricalSummaries' - size += len(b.HistoricalSummaries) * 64 - - return -} - -// HashTreeRoot ssz hashes the BeaconStateCapella object -func (b *BeaconStateCapella) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconStateCapella object with a hasher -func (b *BeaconStateCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'GenesisTime' - hh.PutUint64(b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - hh.PutBytes(b.GenesisValidatorsRoot) - - // Field (2) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (3) 'Fork' - if err = b.Fork.HashTreeRootWith(hh); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (5) 'BlockRoots' - { - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.BlockRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (6) 'StateRoots' - { - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.StateRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (7) 'HistoricalRoots' - { - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - subIndx := hh.Index() - for _, i := range b.HistoricalRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - numItems := uint64(len(b.HistoricalRoots)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 16777216) - } - } - - // Field (8) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'Eth1DataVotes' - { - subIndx := hh.Index() - num := uint64(len(b.Eth1DataVotes)) - if num > 2048 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Eth1DataVotes { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2048) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2048) - } - } - - // Field (10) 'Eth1DepositIndex' - hh.PutUint64(b.Eth1DepositIndex) - - // Field (11) 'Validators' - { - subIndx := hh.Index() - num := uint64(len(b.Validators)) - if num > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Validators { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1099511627776) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1099511627776) - } - } - - // Field (12) 'Balances' - { - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.Balances { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.Balances)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (13) 'RandaoMixes' - { - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - subIndx := hh.Index() - for _, i := range b.RandaoMixes { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (14) 'Slashings' - { - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.Slashings { - hh.AppendUint64(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.PreviousEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.PreviousEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (16) 'CurrentEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.CurrentEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.CurrentEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - hh.PutBytes(b.JustificationBits) - - // Field (18) 'PreviousJustifiedCheckpoint' - if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (21) 'InactivityScores' - { - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.InactivityScores { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.InactivityScores)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (22) 'CurrentSyncCommittee' - if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (24) 'LatestExecutionPayloadHeader' - if err = b.LatestExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (25) 'NextWithdrawalIndex' - hh.PutUint64(b.NextWithdrawalIndex) - - // Field (26) 'NextWithdrawalValidatorIndex' - hh.PutUint64(uint64(b.NextWithdrawalValidatorIndex)) - - // Field (27) 'HistoricalSummaries' - { - subIndx := hh.Index() - num := uint64(len(b.HistoricalSummaries)) - if num > 16777216 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.HistoricalSummaries { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16777216) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconStateDeneb object -func (b *BeaconStateDeneb) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconStateDeneb object to a target array -func (b *BeaconStateDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(2736653) - - // Field (0) 'GenesisTime' - dst = ssz.MarshalUint64(dst, b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - dst = append(dst, b.GenesisValidatorsRoot...) - - // Field (2) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (5) 'BlockRoots' - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.BlockRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) - return - } - dst = append(dst, b.BlockRoots[ii]...) - } - - // Field (6) 'StateRoots' - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.StateRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) - return - } - dst = append(dst, b.StateRoots[ii]...) - } - - // Offset (7) 'HistoricalRoots' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalRoots) * 32 - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'Eth1DataVotes' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Eth1DataVotes) * 72 - - // Field (10) 'Eth1DepositIndex' - dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) - - // Offset (11) 'Validators' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Validators) * 121 - - // Offset (12) 'Balances' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Balances) * 8 - - // Field (13) 'RandaoMixes' - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - for ii := 0; ii < 65536; ii++ { - if size := len(b.RandaoMixes[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) - return - } - dst = append(dst, b.RandaoMixes[ii]...) - } - - // Field (14) 'Slashings' - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - dst = ssz.MarshalUint64(dst, b.Slashings[ii]) - } - - // Offset (15) 'PreviousEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PreviousEpochParticipation) - - // Offset (16) 'CurrentEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.CurrentEpochParticipation) - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - dst = append(dst, b.JustificationBits...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (21) 'InactivityScores' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.InactivityScores) * 8 - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (24) 'LatestExecutionPayloadHeader' - dst = ssz.WriteOffset(dst, offset) - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) - } - offset += b.LatestExecutionPayloadHeader.SizeSSZ() - - // Field (25) 'NextWithdrawalIndex' - dst = ssz.MarshalUint64(dst, b.NextWithdrawalIndex) - - // Field (26) 'NextWithdrawalValidatorIndex' - dst = ssz.MarshalUint64(dst, uint64(b.NextWithdrawalValidatorIndex)) - - // Offset (27) 'HistoricalSummaries' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalSummaries) * 64 - - // Field (7) 'HistoricalRoots' - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalRoots); ii++ { - if size := len(b.HistoricalRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) - return - } - dst = append(dst, b.HistoricalRoots[ii]...) - } - - // Field (9) 'Eth1DataVotes' - if size := len(b.Eth1DataVotes); size > 2048 { - err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) - return - } - for ii := 0; ii < len(b.Eth1DataVotes); ii++ { - if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (11) 'Validators' - if size := len(b.Validators); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Validators); ii++ { - if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (12) 'Balances' - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Balances); ii++ { - dst = ssz.MarshalUint64(dst, b.Balances[ii]) - } - - // Field (15) 'PreviousEpochParticipation' - if size := len(b.PreviousEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.PreviousEpochParticipation...) - - // Field (16) 'CurrentEpochParticipation' - if size := len(b.CurrentEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.CurrentEpochParticipation...) - - // Field (21) 'InactivityScores' - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - for ii := 0; ii < len(b.InactivityScores); ii++ { - dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) - } - - // Field (24) 'LatestExecutionPayloadHeader' - if dst, err = b.LatestExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (27) 'HistoricalSummaries' - if size := len(b.HistoricalSummaries); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalSummaries", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalSummaries); ii++ { - if dst, err = b.HistoricalSummaries[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconStateDeneb object -func (b *BeaconStateDeneb) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 2736653 { - return ssz.ErrSize - } - - tail := buf - var o7, o9, o11, o12, o15, o16, o21, o24, o27 uint64 - - // Field (0) 'GenesisTime' - b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'GenesisValidatorsRoot' - if cap(b.GenesisValidatorsRoot) == 0 { - b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) - } - b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) - - // Field (2) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { - return err - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { - return err - } - - // Field (5) 'BlockRoots' - b.BlockRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.BlockRoots[ii]) == 0 { - b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) - } - b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) - } - - // Field (6) 'StateRoots' - b.StateRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.StateRoots[ii]) == 0 { - b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) - } - b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) - } - - // Offset (7) 'HistoricalRoots' - if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { - return ssz.ErrOffset - } - - if o7 < 2736653 { - return ssz.ErrInvalidVariableOffset - } - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { - return err - } - - // Offset (9) 'Eth1DataVotes' - if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Field (10) 'Eth1DepositIndex' - b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) - - // Offset (11) 'Validators' - if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { - return ssz.ErrOffset - } - - // Offset (12) 'Balances' - if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { - return ssz.ErrOffset - } - - // Field (13) 'RandaoMixes' - b.RandaoMixes = make([][]byte, 65536) - for ii := 0; ii < 65536; ii++ { - if cap(b.RandaoMixes[ii]) == 0 { - b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) - } - b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) - } - - // Field (14) 'Slashings' - b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) - for ii := 0; ii < 8192; ii++ { - b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) - } - - // Offset (15) 'PreviousEpochParticipation' - if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { - return ssz.ErrOffset - } - - // Offset (16) 'CurrentEpochParticipation' - if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { - return ssz.ErrOffset - } - - // Field (17) 'JustificationBits' - if cap(b.JustificationBits) == 0 { - b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) - } - b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { - return err - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { - return err - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { - return err - } - - // Offset (21) 'InactivityScores' - if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { - return ssz.ErrOffset - } - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { - return err - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { - return err - } - - // Offset (24) 'LatestExecutionPayloadHeader' - if o24 = ssz.ReadOffset(buf[2736629:2736633]); o24 > size || o21 > o24 { - return ssz.ErrOffset - } - - // Field (25) 'NextWithdrawalIndex' - b.NextWithdrawalIndex = ssz.UnmarshallUint64(buf[2736633:2736641]) - - // Field (26) 'NextWithdrawalValidatorIndex' - b.NextWithdrawalValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[2736641:2736649])) - - // Offset (27) 'HistoricalSummaries' - if o27 = ssz.ReadOffset(buf[2736649:2736653]); o27 > size || o24 > o27 { - return ssz.ErrOffset - } - - // Field (7) 'HistoricalRoots' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 32, 16777216) - if err != nil { - return err - } - b.HistoricalRoots = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.HistoricalRoots[ii]) == 0 { - b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) - } - b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) - } - } - - // Field (9) 'Eth1DataVotes' - { - buf = tail[o9:o11] - num, err := ssz.DivideInt2(len(buf), 72, 2048) - if err != nil { - return err - } - b.Eth1DataVotes = make([]*Eth1Data, num) - for ii := 0; ii < num; ii++ { - if b.Eth1DataVotes[ii] == nil { - b.Eth1DataVotes[ii] = new(Eth1Data) - } - if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { - return err - } - } - } - - // Field (11) 'Validators' - { - buf = tail[o11:o12] - num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) - if err != nil { - return err - } - b.Validators = make([]*Validator, num) - for ii := 0; ii < num; ii++ { - if b.Validators[ii] == nil { - b.Validators[ii] = new(Validator) - } - if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { - return err - } - } - } - - // Field (12) 'Balances' - { - buf = tail[o12:o15] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.Balances = ssz.ExtendUint64(b.Balances, num) - for ii := 0; ii < num; ii++ { - b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - buf = tail[o15:o16] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.PreviousEpochParticipation) == 0 { - b.PreviousEpochParticipation = make([]byte, 0, len(buf)) - } - b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) - } - - // Field (16) 'CurrentEpochParticipation' - { - buf = tail[o16:o21] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.CurrentEpochParticipation) == 0 { - b.CurrentEpochParticipation = make([]byte, 0, len(buf)) - } - b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) - } - - // Field (21) 'InactivityScores' - { - buf = tail[o21:o24] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) - for ii := 0; ii < num; ii++ { - b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (24) 'LatestExecutionPayloadHeader' - { - buf = tail[o24:o27] - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) - } - if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (27) 'HistoricalSummaries' - { - buf = tail[o27:] - num, err := ssz.DivideInt2(len(buf), 64, 16777216) - if err != nil { - return err - } - b.HistoricalSummaries = make([]*HistoricalSummary, num) - for ii := 0; ii < num; ii++ { - if b.HistoricalSummaries[ii] == nil { - b.HistoricalSummaries[ii] = new(HistoricalSummary) - } - if err = b.HistoricalSummaries[ii].UnmarshalSSZ(buf[ii*64 : (ii+1)*64]); err != nil { - return err - } - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateDeneb object -func (b *BeaconStateDeneb) SizeSSZ() (size int) { - size = 2736653 - - // Field (7) 'HistoricalRoots' - size += len(b.HistoricalRoots) * 32 - - // Field (9) 'Eth1DataVotes' - size += len(b.Eth1DataVotes) * 72 - - // Field (11) 'Validators' - size += len(b.Validators) * 121 - - // Field (12) 'Balances' - size += len(b.Balances) * 8 - - // Field (15) 'PreviousEpochParticipation' - size += len(b.PreviousEpochParticipation) - - // Field (16) 'CurrentEpochParticipation' - size += len(b.CurrentEpochParticipation) - - // Field (21) 'InactivityScores' - size += len(b.InactivityScores) * 8 - - // Field (24) 'LatestExecutionPayloadHeader' - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb) - } - size += b.LatestExecutionPayloadHeader.SizeSSZ() - - // Field (27) 'HistoricalSummaries' - size += len(b.HistoricalSummaries) * 64 - - return -} - -// HashTreeRoot ssz hashes the BeaconStateDeneb object -func (b *BeaconStateDeneb) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconStateDeneb object with a hasher -func (b *BeaconStateDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'GenesisTime' - hh.PutUint64(b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - hh.PutBytes(b.GenesisValidatorsRoot) - - // Field (2) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (3) 'Fork' - if err = b.Fork.HashTreeRootWith(hh); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (5) 'BlockRoots' - { - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.BlockRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (6) 'StateRoots' - { - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.StateRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (7) 'HistoricalRoots' - { - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - subIndx := hh.Index() - for _, i := range b.HistoricalRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - numItems := uint64(len(b.HistoricalRoots)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 16777216) - } - } - - // Field (8) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'Eth1DataVotes' - { - subIndx := hh.Index() - num := uint64(len(b.Eth1DataVotes)) - if num > 2048 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Eth1DataVotes { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2048) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2048) - } - } - - // Field (10) 'Eth1DepositIndex' - hh.PutUint64(b.Eth1DepositIndex) - - // Field (11) 'Validators' - { - subIndx := hh.Index() - num := uint64(len(b.Validators)) - if num > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Validators { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1099511627776) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1099511627776) - } - } - - // Field (12) 'Balances' - { - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.Balances { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.Balances)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (13) 'RandaoMixes' - { - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - subIndx := hh.Index() - for _, i := range b.RandaoMixes { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (14) 'Slashings' - { - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.Slashings { - hh.AppendUint64(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.PreviousEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.PreviousEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (16) 'CurrentEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.CurrentEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.CurrentEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - hh.PutBytes(b.JustificationBits) - - // Field (18) 'PreviousJustifiedCheckpoint' - if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (21) 'InactivityScores' - { - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.InactivityScores { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.InactivityScores)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (22) 'CurrentSyncCommittee' - if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (24) 'LatestExecutionPayloadHeader' - if err = b.LatestExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (25) 'NextWithdrawalIndex' - hh.PutUint64(b.NextWithdrawalIndex) - - // Field (26) 'NextWithdrawalValidatorIndex' - hh.PutUint64(uint64(b.NextWithdrawalValidatorIndex)) - - // Field (27) 'HistoricalSummaries' - { - subIndx := hh.Index() - num := uint64(len(b.HistoricalSummaries)) - if num > 16777216 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.HistoricalSummaries { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16777216) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconStateElectra object -func (b *BeaconStateElectra) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconStateElectra object to a target array -func (b *BeaconStateElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(2736713) - - // Field (0) 'GenesisTime' - dst = ssz.MarshalUint64(dst, b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - dst = append(dst, b.GenesisValidatorsRoot...) - - // Field (2) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (5) 'BlockRoots' - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.BlockRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) - return - } - dst = append(dst, b.BlockRoots[ii]...) - } - - // Field (6) 'StateRoots' - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.StateRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) - return - } - dst = append(dst, b.StateRoots[ii]...) - } - - // Offset (7) 'HistoricalRoots' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalRoots) * 32 - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'Eth1DataVotes' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Eth1DataVotes) * 72 - - // Field (10) 'Eth1DepositIndex' - dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) - - // Offset (11) 'Validators' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Validators) * 121 - - // Offset (12) 'Balances' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Balances) * 8 - - // Field (13) 'RandaoMixes' - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - for ii := 0; ii < 65536; ii++ { - if size := len(b.RandaoMixes[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) - return - } - dst = append(dst, b.RandaoMixes[ii]...) - } - - // Field (14) 'Slashings' - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - dst = ssz.MarshalUint64(dst, b.Slashings[ii]) - } - - // Offset (15) 'PreviousEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PreviousEpochParticipation) - - // Offset (16) 'CurrentEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.CurrentEpochParticipation) - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - dst = append(dst, b.JustificationBits...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (21) 'InactivityScores' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.InactivityScores) * 8 - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (24) 'LatestExecutionPayloadHeader' - dst = ssz.WriteOffset(dst, offset) - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) - } - offset += b.LatestExecutionPayloadHeader.SizeSSZ() - - // Field (25) 'NextWithdrawalIndex' - dst = ssz.MarshalUint64(dst, b.NextWithdrawalIndex) - - // Field (26) 'NextWithdrawalValidatorIndex' - dst = ssz.MarshalUint64(dst, uint64(b.NextWithdrawalValidatorIndex)) - - // Offset (27) 'HistoricalSummaries' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalSummaries) * 64 - - // Field (28) 'DepositReceiptsStartIndex' - dst = ssz.MarshalUint64(dst, b.DepositReceiptsStartIndex) - - // Field (29) 'DepositBalanceToConsume' - dst = ssz.MarshalUint64(dst, uint64(b.DepositBalanceToConsume)) - - // Field (30) 'ExitBalanceToConsume' - dst = ssz.MarshalUint64(dst, uint64(b.ExitBalanceToConsume)) - - // Field (31) 'EarliestExitEpoch' - dst = ssz.MarshalUint64(dst, uint64(b.EarliestExitEpoch)) - - // Field (32) 'ConsolidationBalanceToConsume' - dst = ssz.MarshalUint64(dst, uint64(b.ConsolidationBalanceToConsume)) - - // Field (33) 'EarliestConsolidationEpoch' - dst = ssz.MarshalUint64(dst, uint64(b.EarliestConsolidationEpoch)) - - // Offset (34) 'PendingBalanceDeposits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PendingBalanceDeposits) * 16 - - // Offset (35) 'PendingPartialWithdrawals' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PendingPartialWithdrawals) * 24 - - // Offset (36) 'PendingConsolidations' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PendingConsolidations) * 16 - - // Field (7) 'HistoricalRoots' - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalRoots); ii++ { - if size := len(b.HistoricalRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) - return - } - dst = append(dst, b.HistoricalRoots[ii]...) - } - - // Field (9) 'Eth1DataVotes' - if size := len(b.Eth1DataVotes); size > 2048 { - err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) - return - } - for ii := 0; ii < len(b.Eth1DataVotes); ii++ { - if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (11) 'Validators' - if size := len(b.Validators); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Validators); ii++ { - if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (12) 'Balances' - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Balances); ii++ { - dst = ssz.MarshalUint64(dst, b.Balances[ii]) - } - - // Field (15) 'PreviousEpochParticipation' - if size := len(b.PreviousEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.PreviousEpochParticipation...) - - // Field (16) 'CurrentEpochParticipation' - if size := len(b.CurrentEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.CurrentEpochParticipation...) - - // Field (21) 'InactivityScores' - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - for ii := 0; ii < len(b.InactivityScores); ii++ { - dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) - } - - // Field (24) 'LatestExecutionPayloadHeader' - if dst, err = b.LatestExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (27) 'HistoricalSummaries' - if size := len(b.HistoricalSummaries); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalSummaries", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalSummaries); ii++ { - if dst, err = b.HistoricalSummaries[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (34) 'PendingBalanceDeposits' - if size := len(b.PendingBalanceDeposits); size > 134217728 { - err = ssz.ErrListTooBigFn("--.PendingBalanceDeposits", size, 134217728) - return - } - for ii := 0; ii < len(b.PendingBalanceDeposits); ii++ { - if dst, err = b.PendingBalanceDeposits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (35) 'PendingPartialWithdrawals' - if size := len(b.PendingPartialWithdrawals); size > 134217728 { - err = ssz.ErrListTooBigFn("--.PendingPartialWithdrawals", size, 134217728) - return - } - for ii := 0; ii < len(b.PendingPartialWithdrawals); ii++ { - if dst, err = b.PendingPartialWithdrawals[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (36) 'PendingConsolidations' - if size := len(b.PendingConsolidations); size > 262144 { - err = ssz.ErrListTooBigFn("--.PendingConsolidations", size, 262144) - return - } - for ii := 0; ii < len(b.PendingConsolidations); ii++ { - if dst, err = b.PendingConsolidations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconStateElectra object -func (b *BeaconStateElectra) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 2736713 { - return ssz.ErrSize - } - - tail := buf - var o7, o9, o11, o12, o15, o16, o21, o24, o27, o34, o35, o36 uint64 - - // Field (0) 'GenesisTime' - b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'GenesisValidatorsRoot' - if cap(b.GenesisValidatorsRoot) == 0 { - b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) - } - b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) - - // Field (2) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { - return err - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { - return err - } - - // Field (5) 'BlockRoots' - b.BlockRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.BlockRoots[ii]) == 0 { - b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) - } - b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) - } - - // Field (6) 'StateRoots' - b.StateRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.StateRoots[ii]) == 0 { - b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) - } - b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) - } - - // Offset (7) 'HistoricalRoots' - if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { - return ssz.ErrOffset - } - - if o7 < 2736713 { - return ssz.ErrInvalidVariableOffset - } - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { - return err - } - - // Offset (9) 'Eth1DataVotes' - if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Field (10) 'Eth1DepositIndex' - b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) - - // Offset (11) 'Validators' - if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { - return ssz.ErrOffset - } - - // Offset (12) 'Balances' - if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { - return ssz.ErrOffset - } - - // Field (13) 'RandaoMixes' - b.RandaoMixes = make([][]byte, 65536) - for ii := 0; ii < 65536; ii++ { - if cap(b.RandaoMixes[ii]) == 0 { - b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) - } - b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) - } - - // Field (14) 'Slashings' - b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) - for ii := 0; ii < 8192; ii++ { - b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) - } - - // Offset (15) 'PreviousEpochParticipation' - if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { - return ssz.ErrOffset - } - - // Offset (16) 'CurrentEpochParticipation' - if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { - return ssz.ErrOffset - } - - // Field (17) 'JustificationBits' - if cap(b.JustificationBits) == 0 { - b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) - } - b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { - return err - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { - return err - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { - return err - } - - // Offset (21) 'InactivityScores' - if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { - return ssz.ErrOffset - } - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { - return err - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { - return err - } - - // Offset (24) 'LatestExecutionPayloadHeader' - if o24 = ssz.ReadOffset(buf[2736629:2736633]); o24 > size || o21 > o24 { - return ssz.ErrOffset - } - - // Field (25) 'NextWithdrawalIndex' - b.NextWithdrawalIndex = ssz.UnmarshallUint64(buf[2736633:2736641]) - - // Field (26) 'NextWithdrawalValidatorIndex' - b.NextWithdrawalValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[2736641:2736649])) - - // Offset (27) 'HistoricalSummaries' - if o27 = ssz.ReadOffset(buf[2736649:2736653]); o27 > size || o24 > o27 { - return ssz.ErrOffset - } - - // Field (28) 'DepositReceiptsStartIndex' - b.DepositReceiptsStartIndex = ssz.UnmarshallUint64(buf[2736653:2736661]) - - // Field (29) 'DepositBalanceToConsume' - b.DepositBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736661:2736669])) - - // Field (30) 'ExitBalanceToConsume' - b.ExitBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736669:2736677])) - - // Field (31) 'EarliestExitEpoch' - b.EarliestExitEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[2736677:2736685])) - - // Field (32) 'ConsolidationBalanceToConsume' - b.ConsolidationBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736685:2736693])) - - // Field (33) 'EarliestConsolidationEpoch' - b.EarliestConsolidationEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[2736693:2736701])) - - // Offset (34) 'PendingBalanceDeposits' - if o34 = ssz.ReadOffset(buf[2736701:2736705]); o34 > size || o27 > o34 { - return ssz.ErrOffset - } - - // Offset (35) 'PendingPartialWithdrawals' - if o35 = ssz.ReadOffset(buf[2736705:2736709]); o35 > size || o34 > o35 { - return ssz.ErrOffset - } - - // Offset (36) 'PendingConsolidations' - if o36 = ssz.ReadOffset(buf[2736709:2736713]); o36 > size || o35 > o36 { - return ssz.ErrOffset - } - - // Field (7) 'HistoricalRoots' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 32, 16777216) - if err != nil { - return err - } - b.HistoricalRoots = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.HistoricalRoots[ii]) == 0 { - b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) - } - b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) - } - } - - // Field (9) 'Eth1DataVotes' - { - buf = tail[o9:o11] - num, err := ssz.DivideInt2(len(buf), 72, 2048) - if err != nil { - return err - } - b.Eth1DataVotes = make([]*Eth1Data, num) - for ii := 0; ii < num; ii++ { - if b.Eth1DataVotes[ii] == nil { - b.Eth1DataVotes[ii] = new(Eth1Data) - } - if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { - return err - } - } - } - - // Field (11) 'Validators' - { - buf = tail[o11:o12] - num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) - if err != nil { - return err - } - b.Validators = make([]*Validator, num) - for ii := 0; ii < num; ii++ { - if b.Validators[ii] == nil { - b.Validators[ii] = new(Validator) - } - if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { - return err - } - } - } - - // Field (12) 'Balances' - { - buf = tail[o12:o15] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.Balances = ssz.ExtendUint64(b.Balances, num) - for ii := 0; ii < num; ii++ { - b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - buf = tail[o15:o16] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.PreviousEpochParticipation) == 0 { - b.PreviousEpochParticipation = make([]byte, 0, len(buf)) - } - b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) - } - - // Field (16) 'CurrentEpochParticipation' - { - buf = tail[o16:o21] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.CurrentEpochParticipation) == 0 { - b.CurrentEpochParticipation = make([]byte, 0, len(buf)) - } - b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) - } - - // Field (21) 'InactivityScores' - { - buf = tail[o21:o24] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) - for ii := 0; ii < num; ii++ { - b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (24) 'LatestExecutionPayloadHeader' - { - buf = tail[o24:o27] - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) - } - if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { - return err - } - } - - // Field (27) 'HistoricalSummaries' - { - buf = tail[o27:o34] - num, err := ssz.DivideInt2(len(buf), 64, 16777216) - if err != nil { - return err - } - b.HistoricalSummaries = make([]*HistoricalSummary, num) - for ii := 0; ii < num; ii++ { - if b.HistoricalSummaries[ii] == nil { - b.HistoricalSummaries[ii] = new(HistoricalSummary) - } - if err = b.HistoricalSummaries[ii].UnmarshalSSZ(buf[ii*64 : (ii+1)*64]); err != nil { - return err - } - } - } - - // Field (34) 'PendingBalanceDeposits' - { - buf = tail[o34:o35] - num, err := ssz.DivideInt2(len(buf), 16, 134217728) - if err != nil { - return err - } - b.PendingBalanceDeposits = make([]*PendingBalanceDeposit, num) - for ii := 0; ii < num; ii++ { - if b.PendingBalanceDeposits[ii] == nil { - b.PendingBalanceDeposits[ii] = new(PendingBalanceDeposit) - } - if err = b.PendingBalanceDeposits[ii].UnmarshalSSZ(buf[ii*16 : (ii+1)*16]); err != nil { - return err - } - } - } - - // Field (35) 'PendingPartialWithdrawals' - { - buf = tail[o35:o36] - num, err := ssz.DivideInt2(len(buf), 24, 134217728) - if err != nil { - return err - } - b.PendingPartialWithdrawals = make([]*PendingPartialWithdrawal, num) - for ii := 0; ii < num; ii++ { - if b.PendingPartialWithdrawals[ii] == nil { - b.PendingPartialWithdrawals[ii] = new(PendingPartialWithdrawal) - } - if err = b.PendingPartialWithdrawals[ii].UnmarshalSSZ(buf[ii*24 : (ii+1)*24]); err != nil { - return err - } - } - } - - // Field (36) 'PendingConsolidations' - { - buf = tail[o36:] - num, err := ssz.DivideInt2(len(buf), 16, 262144) - if err != nil { - return err - } - b.PendingConsolidations = make([]*PendingConsolidation, num) - for ii := 0; ii < num; ii++ { - if b.PendingConsolidations[ii] == nil { - b.PendingConsolidations[ii] = new(PendingConsolidation) - } - if err = b.PendingConsolidations[ii].UnmarshalSSZ(buf[ii*16 : (ii+1)*16]); err != nil { - return err - } - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateElectra object -func (b *BeaconStateElectra) SizeSSZ() (size int) { - size = 2736713 - - // Field (7) 'HistoricalRoots' - size += len(b.HistoricalRoots) * 32 - - // Field (9) 'Eth1DataVotes' - size += len(b.Eth1DataVotes) * 72 - - // Field (11) 'Validators' - size += len(b.Validators) * 121 - - // Field (12) 'Balances' - size += len(b.Balances) * 8 - - // Field (15) 'PreviousEpochParticipation' - size += len(b.PreviousEpochParticipation) - - // Field (16) 'CurrentEpochParticipation' - size += len(b.CurrentEpochParticipation) - - // Field (21) 'InactivityScores' - size += len(b.InactivityScores) * 8 - - // Field (24) 'LatestExecutionPayloadHeader' - if b.LatestExecutionPayloadHeader == nil { - b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) - } - size += b.LatestExecutionPayloadHeader.SizeSSZ() - - // Field (27) 'HistoricalSummaries' - size += len(b.HistoricalSummaries) * 64 - - // Field (34) 'PendingBalanceDeposits' - size += len(b.PendingBalanceDeposits) * 16 - - // Field (35) 'PendingPartialWithdrawals' - size += len(b.PendingPartialWithdrawals) * 24 - - // Field (36) 'PendingConsolidations' - size += len(b.PendingConsolidations) * 16 - - return -} - -// HashTreeRoot ssz hashes the BeaconStateElectra object -func (b *BeaconStateElectra) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconStateElectra object with a hasher -func (b *BeaconStateElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'GenesisTime' - hh.PutUint64(b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - hh.PutBytes(b.GenesisValidatorsRoot) - - // Field (2) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (3) 'Fork' - if err = b.Fork.HashTreeRootWith(hh); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (5) 'BlockRoots' - { - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.BlockRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (6) 'StateRoots' - { - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.StateRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (7) 'HistoricalRoots' - { - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - subIndx := hh.Index() - for _, i := range b.HistoricalRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - numItems := uint64(len(b.HistoricalRoots)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 16777216) - } - } - - // Field (8) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'Eth1DataVotes' - { - subIndx := hh.Index() - num := uint64(len(b.Eth1DataVotes)) - if num > 2048 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Eth1DataVotes { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2048) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2048) - } - } - - // Field (10) 'Eth1DepositIndex' - hh.PutUint64(b.Eth1DepositIndex) - - // Field (11) 'Validators' - { - subIndx := hh.Index() - num := uint64(len(b.Validators)) - if num > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Validators { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1099511627776) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1099511627776) - } - } - - // Field (12) 'Balances' - { - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.Balances { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.Balances)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (13) 'RandaoMixes' - { - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - subIndx := hh.Index() - for _, i := range b.RandaoMixes { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (14) 'Slashings' - { - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.Slashings { - hh.AppendUint64(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.PreviousEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.PreviousEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (16) 'CurrentEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.CurrentEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.CurrentEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - hh.PutBytes(b.JustificationBits) - - // Field (18) 'PreviousJustifiedCheckpoint' - if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (21) 'InactivityScores' - { - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.InactivityScores { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.InactivityScores)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (22) 'CurrentSyncCommittee' - if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (24) 'LatestExecutionPayloadHeader' - if err = b.LatestExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (25) 'NextWithdrawalIndex' - hh.PutUint64(b.NextWithdrawalIndex) - - // Field (26) 'NextWithdrawalValidatorIndex' - hh.PutUint64(uint64(b.NextWithdrawalValidatorIndex)) - - // Field (27) 'HistoricalSummaries' - { - subIndx := hh.Index() - num := uint64(len(b.HistoricalSummaries)) - if num > 16777216 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.HistoricalSummaries { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16777216) - } - } - - // Field (28) 'DepositReceiptsStartIndex' - hh.PutUint64(b.DepositReceiptsStartIndex) - - // Field (29) 'DepositBalanceToConsume' - hh.PutUint64(uint64(b.DepositBalanceToConsume)) - - // Field (30) 'ExitBalanceToConsume' - hh.PutUint64(uint64(b.ExitBalanceToConsume)) - - // Field (31) 'EarliestExitEpoch' - hh.PutUint64(uint64(b.EarliestExitEpoch)) - - // Field (32) 'ConsolidationBalanceToConsume' - hh.PutUint64(uint64(b.ConsolidationBalanceToConsume)) - - // Field (33) 'EarliestConsolidationEpoch' - hh.PutUint64(uint64(b.EarliestConsolidationEpoch)) - - // Field (34) 'PendingBalanceDeposits' - { - subIndx := hh.Index() - num := uint64(len(b.PendingBalanceDeposits)) - if num > 134217728 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.PendingBalanceDeposits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 134217728) - } else { - hh.MerkleizeWithMixin(subIndx, num, 134217728) - } - } - - // Field (35) 'PendingPartialWithdrawals' - { - subIndx := hh.Index() - num := uint64(len(b.PendingPartialWithdrawals)) - if num > 134217728 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.PendingPartialWithdrawals { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 134217728) - } else { - hh.MerkleizeWithMixin(subIndx, num, 134217728) - } - } - - // Field (36) 'PendingConsolidations' - { - subIndx := hh.Index() - num := uint64(len(b.PendingConsolidations)) - if num > 262144 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.PendingConsolidations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 262144) - } else { - hh.MerkleizeWithMixin(subIndx, num, 262144) - } - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconStateEPBS object -func (b *BeaconStateEPBS) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconStateEPBS object to a target array -func (b *BeaconStateEPBS) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(2736965) - - // Field (0) 'GenesisTime' - dst = ssz.MarshalUint64(dst, b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - dst = append(dst, b.GenesisValidatorsRoot...) - - // Field (2) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(b.Slot)) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if dst, err = b.Fork.MarshalSSZTo(dst); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if dst, err = b.LatestBlockHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (5) 'BlockRoots' - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.BlockRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoots[ii]", size, 32) - return - } - dst = append(dst, b.BlockRoots[ii]...) - } - - // Field (6) 'StateRoots' - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - if size := len(b.StateRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) - return - } - dst = append(dst, b.StateRoots[ii]...) - } - - // Offset (7) 'HistoricalRoots' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalRoots) * 32 - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if dst, err = b.Eth1Data.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (9) 'Eth1DataVotes' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Eth1DataVotes) * 72 - - // Field (10) 'Eth1DepositIndex' - dst = ssz.MarshalUint64(dst, b.Eth1DepositIndex) - - // Offset (11) 'Validators' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Validators) * 121 - - // Offset (12) 'Balances' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.Balances) * 8 - - // Field (13) 'RandaoMixes' - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - for ii := 0; ii < 65536; ii++ { - if size := len(b.RandaoMixes[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.RandaoMixes[ii]", size, 32) - return - } - dst = append(dst, b.RandaoMixes[ii]...) - } - - // Field (14) 'Slashings' - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - for ii := 0; ii < 8192; ii++ { - dst = ssz.MarshalUint64(dst, b.Slashings[ii]) - } - - // Offset (15) 'PreviousEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PreviousEpochParticipation) - - // Offset (16) 'CurrentEpochParticipation' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.CurrentEpochParticipation) - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - dst = append(dst, b.JustificationBits...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.PreviousJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if dst, err = b.CurrentJustifiedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if dst, err = b.FinalizedCheckpoint.MarshalSSZTo(dst); err != nil { - return - } - - // Offset (21) 'InactivityScores' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.InactivityScores) * 8 - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if dst, err = b.CurrentSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if dst, err = b.NextSyncCommittee.MarshalSSZTo(dst); err != nil { - return - } - - // Field (24) 'NextWithdrawalIndex' - dst = ssz.MarshalUint64(dst, b.NextWithdrawalIndex) - - // Field (25) 'NextWithdrawalValidatorIndex' - dst = ssz.MarshalUint64(dst, uint64(b.NextWithdrawalValidatorIndex)) - - // Offset (26) 'HistoricalSummaries' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.HistoricalSummaries) * 64 - - // Field (27) 'DepositReceiptsStartIndex' - dst = ssz.MarshalUint64(dst, b.DepositReceiptsStartIndex) - - // Field (28) 'DepositBalanceToConsume' - dst = ssz.MarshalUint64(dst, uint64(b.DepositBalanceToConsume)) - - // Field (29) 'ExitBalanceToConsume' - dst = ssz.MarshalUint64(dst, uint64(b.ExitBalanceToConsume)) - - // Field (30) 'EarliestExitEpoch' - dst = ssz.MarshalUint64(dst, uint64(b.EarliestExitEpoch)) - - // Field (31) 'ConsolidationBalanceToConsume' - dst = ssz.MarshalUint64(dst, uint64(b.ConsolidationBalanceToConsume)) - - // Field (32) 'EarliestConsolidationEpoch' - dst = ssz.MarshalUint64(dst, uint64(b.EarliestConsolidationEpoch)) - - // Offset (33) 'PendingBalanceDeposits' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PendingBalanceDeposits) * 16 - - // Offset (34) 'PendingPartialWithdrawals' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PendingPartialWithdrawals) * 24 - - // Offset (35) 'PendingConsolidations' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.PendingConsolidations) * 16 - - // Field (36) 'PreviousInclusionListProposer' - dst = ssz.MarshalUint64(dst, uint64(b.PreviousInclusionListProposer)) - - // Field (37) 'PreviousInclusionListSlot' - dst = ssz.MarshalUint64(dst, uint64(b.PreviousInclusionListSlot)) - - // Field (38) 'LatestInclusionListProposer' - dst = ssz.MarshalUint64(dst, uint64(b.LatestInclusionListProposer)) - - // Field (39) 'LatestInclusionListSlot' - dst = ssz.MarshalUint64(dst, uint64(b.LatestInclusionListSlot)) - - // Field (40) 'LatestBlockHash' - if size := len(b.LatestBlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.LatestBlockHash", size, 32) - return - } - dst = append(dst, b.LatestBlockHash...) - - // Field (41) 'LatestFullSlot' - dst = ssz.MarshalUint64(dst, uint64(b.LatestFullSlot)) - - // Field (42) 'ExecutionPayloadHeader' - if b.ExecutionPayloadHeader == nil { - b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderEPBS) - } - if dst, err = b.ExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { - return - } - - // Field (43) 'LastWithdrawalsRoot' - if size := len(b.LastWithdrawalsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.LastWithdrawalsRoot", size, 32) - return - } - dst = append(dst, b.LastWithdrawalsRoot...) - - // Field (7) 'HistoricalRoots' - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalRoots); ii++ { - if size := len(b.HistoricalRoots[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.HistoricalRoots[ii]", size, 32) - return - } - dst = append(dst, b.HistoricalRoots[ii]...) - } - - // Field (9) 'Eth1DataVotes' - if size := len(b.Eth1DataVotes); size > 2048 { - err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) - return - } - for ii := 0; ii < len(b.Eth1DataVotes); ii++ { - if dst, err = b.Eth1DataVotes[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (11) 'Validators' - if size := len(b.Validators); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Validators); ii++ { - if dst, err = b.Validators[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (12) 'Balances' - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - for ii := 0; ii < len(b.Balances); ii++ { - dst = ssz.MarshalUint64(dst, b.Balances[ii]) - } - - // Field (15) 'PreviousEpochParticipation' - if size := len(b.PreviousEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.PreviousEpochParticipation...) - - // Field (16) 'CurrentEpochParticipation' - if size := len(b.CurrentEpochParticipation); size > 1099511627776 { - err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) - return - } - dst = append(dst, b.CurrentEpochParticipation...) - - // Field (21) 'InactivityScores' - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - for ii := 0; ii < len(b.InactivityScores); ii++ { - dst = ssz.MarshalUint64(dst, b.InactivityScores[ii]) - } - - // Field (26) 'HistoricalSummaries' - if size := len(b.HistoricalSummaries); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalSummaries", size, 16777216) - return - } - for ii := 0; ii < len(b.HistoricalSummaries); ii++ { - if dst, err = b.HistoricalSummaries[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (33) 'PendingBalanceDeposits' - if size := len(b.PendingBalanceDeposits); size > 134217728 { - err = ssz.ErrListTooBigFn("--.PendingBalanceDeposits", size, 134217728) - return - } - for ii := 0; ii < len(b.PendingBalanceDeposits); ii++ { - if dst, err = b.PendingBalanceDeposits[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (34) 'PendingPartialWithdrawals' - if size := len(b.PendingPartialWithdrawals); size > 134217728 { - err = ssz.ErrListTooBigFn("--.PendingPartialWithdrawals", size, 134217728) - return - } - for ii := 0; ii < len(b.PendingPartialWithdrawals); ii++ { - if dst, err = b.PendingPartialWithdrawals[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - // Field (35) 'PendingConsolidations' - if size := len(b.PendingConsolidations); size > 262144 { - err = ssz.ErrListTooBigFn("--.PendingConsolidations", size, 262144) - return - } - for ii := 0; ii < len(b.PendingConsolidations); ii++ { - if dst, err = b.PendingConsolidations[ii].MarshalSSZTo(dst); err != nil { - return - } - } - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconStateEPBS object -func (b *BeaconStateEPBS) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 2736965 { - return ssz.ErrSize - } - - tail := buf - var o7, o9, o11, o12, o15, o16, o21, o26, o33, o34, o35 uint64 - - // Field (0) 'GenesisTime' - b.GenesisTime = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'GenesisValidatorsRoot' - if cap(b.GenesisValidatorsRoot) == 0 { - b.GenesisValidatorsRoot = make([]byte, 0, len(buf[8:40])) - } - b.GenesisValidatorsRoot = append(b.GenesisValidatorsRoot, buf[8:40]...) - - // Field (2) 'Slot' - b.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48])) - - // Field (3) 'Fork' - if b.Fork == nil { - b.Fork = new(Fork) - } - if err = b.Fork.UnmarshalSSZ(buf[48:64]); err != nil { - return err - } - - // Field (4) 'LatestBlockHeader' - if b.LatestBlockHeader == nil { - b.LatestBlockHeader = new(BeaconBlockHeader) - } - if err = b.LatestBlockHeader.UnmarshalSSZ(buf[64:176]); err != nil { - return err - } - - // Field (5) 'BlockRoots' - b.BlockRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.BlockRoots[ii]) == 0 { - b.BlockRoots[ii] = make([]byte, 0, len(buf[176:262320][ii*32:(ii+1)*32])) - } - b.BlockRoots[ii] = append(b.BlockRoots[ii], buf[176:262320][ii*32:(ii+1)*32]...) - } - - // Field (6) 'StateRoots' - b.StateRoots = make([][]byte, 8192) - for ii := 0; ii < 8192; ii++ { - if cap(b.StateRoots[ii]) == 0 { - b.StateRoots[ii] = make([]byte, 0, len(buf[262320:524464][ii*32:(ii+1)*32])) - } - b.StateRoots[ii] = append(b.StateRoots[ii], buf[262320:524464][ii*32:(ii+1)*32]...) - } - - // Offset (7) 'HistoricalRoots' - if o7 = ssz.ReadOffset(buf[524464:524468]); o7 > size { - return ssz.ErrOffset - } - - if o7 < 2736965 { - return ssz.ErrInvalidVariableOffset - } - - // Field (8) 'Eth1Data' - if b.Eth1Data == nil { - b.Eth1Data = new(Eth1Data) - } - if err = b.Eth1Data.UnmarshalSSZ(buf[524468:524540]); err != nil { - return err - } - - // Offset (9) 'Eth1DataVotes' - if o9 = ssz.ReadOffset(buf[524540:524544]); o9 > size || o7 > o9 { - return ssz.ErrOffset - } - - // Field (10) 'Eth1DepositIndex' - b.Eth1DepositIndex = ssz.UnmarshallUint64(buf[524544:524552]) - - // Offset (11) 'Validators' - if o11 = ssz.ReadOffset(buf[524552:524556]); o11 > size || o9 > o11 { - return ssz.ErrOffset - } - - // Offset (12) 'Balances' - if o12 = ssz.ReadOffset(buf[524556:524560]); o12 > size || o11 > o12 { - return ssz.ErrOffset - } - - // Field (13) 'RandaoMixes' - b.RandaoMixes = make([][]byte, 65536) - for ii := 0; ii < 65536; ii++ { - if cap(b.RandaoMixes[ii]) == 0 { - b.RandaoMixes[ii] = make([]byte, 0, len(buf[524560:2621712][ii*32:(ii+1)*32])) - } - b.RandaoMixes[ii] = append(b.RandaoMixes[ii], buf[524560:2621712][ii*32:(ii+1)*32]...) - } - - // Field (14) 'Slashings' - b.Slashings = ssz.ExtendUint64(b.Slashings, 8192) - for ii := 0; ii < 8192; ii++ { - b.Slashings[ii] = ssz.UnmarshallUint64(buf[2621712:2687248][ii*8 : (ii+1)*8]) - } - - // Offset (15) 'PreviousEpochParticipation' - if o15 = ssz.ReadOffset(buf[2687248:2687252]); o15 > size || o12 > o15 { - return ssz.ErrOffset - } - - // Offset (16) 'CurrentEpochParticipation' - if o16 = ssz.ReadOffset(buf[2687252:2687256]); o16 > size || o15 > o16 { - return ssz.ErrOffset - } - - // Field (17) 'JustificationBits' - if cap(b.JustificationBits) == 0 { - b.JustificationBits = make([]byte, 0, len(buf[2687256:2687257])) - } - b.JustificationBits = append(b.JustificationBits, buf[2687256:2687257]...) - - // Field (18) 'PreviousJustifiedCheckpoint' - if b.PreviousJustifiedCheckpoint == nil { - b.PreviousJustifiedCheckpoint = new(Checkpoint) - } - if err = b.PreviousJustifiedCheckpoint.UnmarshalSSZ(buf[2687257:2687297]); err != nil { - return err - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if b.CurrentJustifiedCheckpoint == nil { - b.CurrentJustifiedCheckpoint = new(Checkpoint) - } - if err = b.CurrentJustifiedCheckpoint.UnmarshalSSZ(buf[2687297:2687337]); err != nil { - return err - } - - // Field (20) 'FinalizedCheckpoint' - if b.FinalizedCheckpoint == nil { - b.FinalizedCheckpoint = new(Checkpoint) - } - if err = b.FinalizedCheckpoint.UnmarshalSSZ(buf[2687337:2687377]); err != nil { - return err - } - - // Offset (21) 'InactivityScores' - if o21 = ssz.ReadOffset(buf[2687377:2687381]); o21 > size || o16 > o21 { - return ssz.ErrOffset - } - - // Field (22) 'CurrentSyncCommittee' - if b.CurrentSyncCommittee == nil { - b.CurrentSyncCommittee = new(SyncCommittee) - } - if err = b.CurrentSyncCommittee.UnmarshalSSZ(buf[2687381:2712005]); err != nil { - return err - } - - // Field (23) 'NextSyncCommittee' - if b.NextSyncCommittee == nil { - b.NextSyncCommittee = new(SyncCommittee) - } - if err = b.NextSyncCommittee.UnmarshalSSZ(buf[2712005:2736629]); err != nil { - return err - } - - // Field (24) 'NextWithdrawalIndex' - b.NextWithdrawalIndex = ssz.UnmarshallUint64(buf[2736629:2736637]) - - // Field (25) 'NextWithdrawalValidatorIndex' - b.NextWithdrawalValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[2736637:2736645])) - - // Offset (26) 'HistoricalSummaries' - if o26 = ssz.ReadOffset(buf[2736645:2736649]); o26 > size || o21 > o26 { - return ssz.ErrOffset - } - - // Field (27) 'DepositReceiptsStartIndex' - b.DepositReceiptsStartIndex = ssz.UnmarshallUint64(buf[2736649:2736657]) - - // Field (28) 'DepositBalanceToConsume' - b.DepositBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736657:2736665])) - - // Field (29) 'ExitBalanceToConsume' - b.ExitBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736665:2736673])) - - // Field (30) 'EarliestExitEpoch' - b.EarliestExitEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[2736673:2736681])) - - // Field (31) 'ConsolidationBalanceToConsume' - b.ConsolidationBalanceToConsume = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Gwei(ssz.UnmarshallUint64(buf[2736681:2736689])) - - // Field (32) 'EarliestConsolidationEpoch' - b.EarliestConsolidationEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[2736689:2736697])) - - // Offset (33) 'PendingBalanceDeposits' - if o33 = ssz.ReadOffset(buf[2736697:2736701]); o33 > size || o26 > o33 { - return ssz.ErrOffset - } - - // Offset (34) 'PendingPartialWithdrawals' - if o34 = ssz.ReadOffset(buf[2736701:2736705]); o34 > size || o33 > o34 { - return ssz.ErrOffset - } - - // Offset (35) 'PendingConsolidations' - if o35 = ssz.ReadOffset(buf[2736705:2736709]); o35 > size || o34 > o35 { - return ssz.ErrOffset - } - - // Field (36) 'PreviousInclusionListProposer' - b.PreviousInclusionListProposer = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[2736709:2736717])) - - // Field (37) 'PreviousInclusionListSlot' - b.PreviousInclusionListSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[2736717:2736725])) - - // Field (38) 'LatestInclusionListProposer' - b.LatestInclusionListProposer = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[2736725:2736733])) - - // Field (39) 'LatestInclusionListSlot' - b.LatestInclusionListSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[2736733:2736741])) - - // Field (40) 'LatestBlockHash' - if cap(b.LatestBlockHash) == 0 { - b.LatestBlockHash = make([]byte, 0, len(buf[2736741:2736773])) - } - b.LatestBlockHash = append(b.LatestBlockHash, buf[2736741:2736773]...) - - // Field (41) 'LatestFullSlot' - b.LatestFullSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[2736773:2736781])) - - // Field (42) 'ExecutionPayloadHeader' - if b.ExecutionPayloadHeader == nil { - b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderEPBS) - } - if err = b.ExecutionPayloadHeader.UnmarshalSSZ(buf[2736781:2736933]); err != nil { - return err - } - - // Field (43) 'LastWithdrawalsRoot' - if cap(b.LastWithdrawalsRoot) == 0 { - b.LastWithdrawalsRoot = make([]byte, 0, len(buf[2736933:2736965])) - } - b.LastWithdrawalsRoot = append(b.LastWithdrawalsRoot, buf[2736933:2736965]...) - - // Field (7) 'HistoricalRoots' - { - buf = tail[o7:o9] - num, err := ssz.DivideInt2(len(buf), 32, 16777216) - if err != nil { - return err - } - b.HistoricalRoots = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(b.HistoricalRoots[ii]) == 0 { - b.HistoricalRoots[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) - } - b.HistoricalRoots[ii] = append(b.HistoricalRoots[ii], buf[ii*32:(ii+1)*32]...) - } - } - - // Field (9) 'Eth1DataVotes' - { - buf = tail[o9:o11] - num, err := ssz.DivideInt2(len(buf), 72, 2048) - if err != nil { - return err - } - b.Eth1DataVotes = make([]*Eth1Data, num) - for ii := 0; ii < num; ii++ { - if b.Eth1DataVotes[ii] == nil { - b.Eth1DataVotes[ii] = new(Eth1Data) - } - if err = b.Eth1DataVotes[ii].UnmarshalSSZ(buf[ii*72 : (ii+1)*72]); err != nil { - return err - } - } - } - - // Field (11) 'Validators' - { - buf = tail[o11:o12] - num, err := ssz.DivideInt2(len(buf), 121, 1099511627776) - if err != nil { - return err - } - b.Validators = make([]*Validator, num) - for ii := 0; ii < num; ii++ { - if b.Validators[ii] == nil { - b.Validators[ii] = new(Validator) - } - if err = b.Validators[ii].UnmarshalSSZ(buf[ii*121 : (ii+1)*121]); err != nil { - return err - } - } - } - - // Field (12) 'Balances' - { - buf = tail[o12:o15] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.Balances = ssz.ExtendUint64(b.Balances, num) - for ii := 0; ii < num; ii++ { - b.Balances[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - buf = tail[o15:o16] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.PreviousEpochParticipation) == 0 { - b.PreviousEpochParticipation = make([]byte, 0, len(buf)) - } - b.PreviousEpochParticipation = append(b.PreviousEpochParticipation, buf...) - } - - // Field (16) 'CurrentEpochParticipation' - { - buf = tail[o16:o21] - if len(buf) > 1099511627776 { - return ssz.ErrBytesLength - } - if cap(b.CurrentEpochParticipation) == 0 { - b.CurrentEpochParticipation = make([]byte, 0, len(buf)) - } - b.CurrentEpochParticipation = append(b.CurrentEpochParticipation, buf...) - } - - // Field (21) 'InactivityScores' - { - buf = tail[o21:o26] - num, err := ssz.DivideInt2(len(buf), 8, 1099511627776) - if err != nil { - return err - } - b.InactivityScores = ssz.ExtendUint64(b.InactivityScores, num) - for ii := 0; ii < num; ii++ { - b.InactivityScores[ii] = ssz.UnmarshallUint64(buf[ii*8 : (ii+1)*8]) - } - } - - // Field (26) 'HistoricalSummaries' - { - buf = tail[o26:o33] - num, err := ssz.DivideInt2(len(buf), 64, 16777216) - if err != nil { - return err - } - b.HistoricalSummaries = make([]*HistoricalSummary, num) - for ii := 0; ii < num; ii++ { - if b.HistoricalSummaries[ii] == nil { - b.HistoricalSummaries[ii] = new(HistoricalSummary) - } - if err = b.HistoricalSummaries[ii].UnmarshalSSZ(buf[ii*64 : (ii+1)*64]); err != nil { - return err - } - } - } - - // Field (33) 'PendingBalanceDeposits' - { - buf = tail[o33:o34] - num, err := ssz.DivideInt2(len(buf), 16, 134217728) - if err != nil { - return err - } - b.PendingBalanceDeposits = make([]*PendingBalanceDeposit, num) - for ii := 0; ii < num; ii++ { - if b.PendingBalanceDeposits[ii] == nil { - b.PendingBalanceDeposits[ii] = new(PendingBalanceDeposit) - } - if err = b.PendingBalanceDeposits[ii].UnmarshalSSZ(buf[ii*16 : (ii+1)*16]); err != nil { - return err - } - } - } - - // Field (34) 'PendingPartialWithdrawals' - { - buf = tail[o34:o35] - num, err := ssz.DivideInt2(len(buf), 24, 134217728) - if err != nil { - return err - } - b.PendingPartialWithdrawals = make([]*PendingPartialWithdrawal, num) - for ii := 0; ii < num; ii++ { - if b.PendingPartialWithdrawals[ii] == nil { - b.PendingPartialWithdrawals[ii] = new(PendingPartialWithdrawal) - } - if err = b.PendingPartialWithdrawals[ii].UnmarshalSSZ(buf[ii*24 : (ii+1)*24]); err != nil { - return err - } - } - } - - // Field (35) 'PendingConsolidations' - { - buf = tail[o35:] - num, err := ssz.DivideInt2(len(buf), 16, 262144) - if err != nil { - return err - } - b.PendingConsolidations = make([]*PendingConsolidation, num) - for ii := 0; ii < num; ii++ { - if b.PendingConsolidations[ii] == nil { - b.PendingConsolidations[ii] = new(PendingConsolidation) - } - if err = b.PendingConsolidations[ii].UnmarshalSSZ(buf[ii*16 : (ii+1)*16]); err != nil { - return err - } - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconStateEPBS object -func (b *BeaconStateEPBS) SizeSSZ() (size int) { - size = 2736965 - - // Field (7) 'HistoricalRoots' - size += len(b.HistoricalRoots) * 32 - - // Field (9) 'Eth1DataVotes' - size += len(b.Eth1DataVotes) * 72 - - // Field (11) 'Validators' - size += len(b.Validators) * 121 - - // Field (12) 'Balances' - size += len(b.Balances) * 8 - - // Field (15) 'PreviousEpochParticipation' - size += len(b.PreviousEpochParticipation) - - // Field (16) 'CurrentEpochParticipation' - size += len(b.CurrentEpochParticipation) - - // Field (21) 'InactivityScores' - size += len(b.InactivityScores) * 8 - - // Field (26) 'HistoricalSummaries' - size += len(b.HistoricalSummaries) * 64 - - // Field (33) 'PendingBalanceDeposits' - size += len(b.PendingBalanceDeposits) * 16 - - // Field (34) 'PendingPartialWithdrawals' - size += len(b.PendingPartialWithdrawals) * 24 - - // Field (35) 'PendingConsolidations' - size += len(b.PendingConsolidations) * 16 - - return -} - -// HashTreeRoot ssz hashes the BeaconStateEPBS object -func (b *BeaconStateEPBS) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconStateEPBS object with a hasher -func (b *BeaconStateEPBS) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'GenesisTime' - hh.PutUint64(b.GenesisTime) - - // Field (1) 'GenesisValidatorsRoot' - if size := len(b.GenesisValidatorsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) - return - } - hh.PutBytes(b.GenesisValidatorsRoot) - - // Field (2) 'Slot' - hh.PutUint64(uint64(b.Slot)) - - // Field (3) 'Fork' - if err = b.Fork.HashTreeRootWith(hh); err != nil { - return - } - - // Field (4) 'LatestBlockHeader' - if err = b.LatestBlockHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (5) 'BlockRoots' - { - if size := len(b.BlockRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.BlockRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (6) 'StateRoots' - { - if size := len(b.StateRoots); size != 8192 { - err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.StateRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (7) 'HistoricalRoots' - { - if size := len(b.HistoricalRoots); size > 16777216 { - err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) - return - } - subIndx := hh.Index() - for _, i := range b.HistoricalRoots { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - numItems := uint64(len(b.HistoricalRoots)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 16777216) - } - } - - // Field (8) 'Eth1Data' - if err = b.Eth1Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (9) 'Eth1DataVotes' - { - subIndx := hh.Index() - num := uint64(len(b.Eth1DataVotes)) - if num > 2048 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Eth1DataVotes { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 2048) - } else { - hh.MerkleizeWithMixin(subIndx, num, 2048) - } - } - - // Field (10) 'Eth1DepositIndex' - hh.PutUint64(b.Eth1DepositIndex) - - // Field (11) 'Validators' - { - subIndx := hh.Index() - num := uint64(len(b.Validators)) - if num > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.Validators { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 1099511627776) - } else { - hh.MerkleizeWithMixin(subIndx, num, 1099511627776) - } - } - - // Field (12) 'Balances' - { - if size := len(b.Balances); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.Balances { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.Balances)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (13) 'RandaoMixes' - { - if size := len(b.RandaoMixes); size != 65536 { - err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) - return - } - subIndx := hh.Index() - for _, i := range b.RandaoMixes { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (14) 'Slashings' - { - if size := len(b.Slashings); size != 8192 { - err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) - return - } - subIndx := hh.Index() - for _, i := range b.Slashings { - hh.AppendUint64(i) - } - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(subIndx) - } else { - hh.Merkleize(subIndx) - } - } - - // Field (15) 'PreviousEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.PreviousEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.PreviousEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (16) 'CurrentEpochParticipation' - { - elemIndx := hh.Index() - byteLen := uint64(len(b.CurrentEpochParticipation)) - if byteLen > 1099511627776 { - err = ssz.ErrIncorrectListSize - return - } - hh.PutBytes(b.CurrentEpochParticipation) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(elemIndx, byteLen, (1099511627776+31)/32) - } else { - hh.MerkleizeWithMixin(elemIndx, byteLen, (1099511627776+31)/32) - } - } - - // Field (17) 'JustificationBits' - if size := len(b.JustificationBits); size != 1 { - err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) - return - } - hh.PutBytes(b.JustificationBits) - - // Field (18) 'PreviousJustifiedCheckpoint' - if err = b.PreviousJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (19) 'CurrentJustifiedCheckpoint' - if err = b.CurrentJustifiedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (20) 'FinalizedCheckpoint' - if err = b.FinalizedCheckpoint.HashTreeRootWith(hh); err != nil { - return - } - - // Field (21) 'InactivityScores' - { - if size := len(b.InactivityScores); size > 1099511627776 { - err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) - return - } - subIndx := hh.Index() - for _, i := range b.InactivityScores { - hh.AppendUint64(i) - } - hh.FillUpTo32() - - numItems := uint64(len(b.InactivityScores)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, ssz.CalculateLimit(1099511627776, numItems, 8)) - } - } - - // Field (22) 'CurrentSyncCommittee' - if err = b.CurrentSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (23) 'NextSyncCommittee' - if err = b.NextSyncCommittee.HashTreeRootWith(hh); err != nil { - return - } - - // Field (24) 'NextWithdrawalIndex' - hh.PutUint64(b.NextWithdrawalIndex) - - // Field (25) 'NextWithdrawalValidatorIndex' - hh.PutUint64(uint64(b.NextWithdrawalValidatorIndex)) - - // Field (26) 'HistoricalSummaries' - { - subIndx := hh.Index() - num := uint64(len(b.HistoricalSummaries)) - if num > 16777216 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.HistoricalSummaries { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 16777216) - } else { - hh.MerkleizeWithMixin(subIndx, num, 16777216) - } - } - - // Field (27) 'DepositReceiptsStartIndex' - hh.PutUint64(b.DepositReceiptsStartIndex) - - // Field (28) 'DepositBalanceToConsume' - hh.PutUint64(uint64(b.DepositBalanceToConsume)) - - // Field (29) 'ExitBalanceToConsume' - hh.PutUint64(uint64(b.ExitBalanceToConsume)) - - // Field (30) 'EarliestExitEpoch' - hh.PutUint64(uint64(b.EarliestExitEpoch)) - - // Field (31) 'ConsolidationBalanceToConsume' - hh.PutUint64(uint64(b.ConsolidationBalanceToConsume)) - - // Field (32) 'EarliestConsolidationEpoch' - hh.PutUint64(uint64(b.EarliestConsolidationEpoch)) - - // Field (33) 'PendingBalanceDeposits' - { - subIndx := hh.Index() - num := uint64(len(b.PendingBalanceDeposits)) - if num > 134217728 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.PendingBalanceDeposits { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 134217728) - } else { - hh.MerkleizeWithMixin(subIndx, num, 134217728) - } - } - - // Field (34) 'PendingPartialWithdrawals' - { - subIndx := hh.Index() - num := uint64(len(b.PendingPartialWithdrawals)) - if num > 134217728 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.PendingPartialWithdrawals { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 134217728) - } else { - hh.MerkleizeWithMixin(subIndx, num, 134217728) - } - } - - // Field (35) 'PendingConsolidations' - { - subIndx := hh.Index() - num := uint64(len(b.PendingConsolidations)) - if num > 262144 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.PendingConsolidations { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 262144) - } else { - hh.MerkleizeWithMixin(subIndx, num, 262144) - } - } - - // Field (36) 'PreviousInclusionListProposer' - hh.PutUint64(uint64(b.PreviousInclusionListProposer)) - - // Field (37) 'PreviousInclusionListSlot' - hh.PutUint64(uint64(b.PreviousInclusionListSlot)) - - // Field (38) 'LatestInclusionListProposer' - hh.PutUint64(uint64(b.LatestInclusionListProposer)) - - // Field (39) 'LatestInclusionListSlot' - hh.PutUint64(uint64(b.LatestInclusionListSlot)) - - // Field (40) 'LatestBlockHash' - if size := len(b.LatestBlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.LatestBlockHash", size, 32) - return - } - hh.PutBytes(b.LatestBlockHash) - - // Field (41) 'LatestFullSlot' - hh.PutUint64(uint64(b.LatestFullSlot)) - - // Field (42) 'ExecutionPayloadHeader' - if err = b.ExecutionPayloadHeader.HashTreeRootWith(hh); err != nil { - return - } - - // Field (43) 'LastWithdrawalsRoot' - if size := len(b.LastWithdrawalsRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.LastWithdrawalsRoot", size, 32) - return - } - hh.PutBytes(b.LastWithdrawalsRoot) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the PowBlock object -func (p *PowBlock) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} - -// MarshalSSZTo ssz marshals the PowBlock object to a target array -func (p *PowBlock) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'BlockHash' - if size := len(p.BlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) - return - } - dst = append(dst, p.BlockHash...) - - // Field (1) 'ParentHash' - if size := len(p.ParentHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) - return - } - dst = append(dst, p.ParentHash...) - - // Field (2) 'TotalDifficulty' - if size := len(p.TotalDifficulty); size != 32 { - err = ssz.ErrBytesLengthFn("--.TotalDifficulty", size, 32) - return - } - dst = append(dst, p.TotalDifficulty...) - - return -} - -// UnmarshalSSZ ssz unmarshals the PowBlock object -func (p *PowBlock) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 96 { - return ssz.ErrSize - } - - // Field (0) 'BlockHash' - if cap(p.BlockHash) == 0 { - p.BlockHash = make([]byte, 0, len(buf[0:32])) - } - p.BlockHash = append(p.BlockHash, buf[0:32]...) - - // Field (1) 'ParentHash' - if cap(p.ParentHash) == 0 { - p.ParentHash = make([]byte, 0, len(buf[32:64])) - } - p.ParentHash = append(p.ParentHash, buf[32:64]...) - - // Field (2) 'TotalDifficulty' - if cap(p.TotalDifficulty) == 0 { - p.TotalDifficulty = make([]byte, 0, len(buf[64:96])) - } - p.TotalDifficulty = append(p.TotalDifficulty, buf[64:96]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the PowBlock object -func (p *PowBlock) SizeSSZ() (size int) { - size = 96 - return -} - -// HashTreeRoot ssz hashes the PowBlock object -func (p *PowBlock) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the PowBlock object with a hasher -func (p *PowBlock) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'BlockHash' - if size := len(p.BlockHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) - return - } - hh.PutBytes(p.BlockHash) - - // Field (1) 'ParentHash' - if size := len(p.ParentHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) - return - } - hh.PutBytes(p.ParentHash) - - // Field (2) 'TotalDifficulty' - if size := len(p.TotalDifficulty); size != 32 { - err = ssz.ErrBytesLengthFn("--.TotalDifficulty", size, 32) - return - } - hh.PutBytes(p.TotalDifficulty) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the HistoricalSummary object -func (h *HistoricalSummary) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(h) -} - -// MarshalSSZTo ssz marshals the HistoricalSummary object to a target array -func (h *HistoricalSummary) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'BlockSummaryRoot' - if size := len(h.BlockSummaryRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockSummaryRoot", size, 32) - return - } - dst = append(dst, h.BlockSummaryRoot...) - - // Field (1) 'StateSummaryRoot' - if size := len(h.StateSummaryRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateSummaryRoot", size, 32) - return - } - dst = append(dst, h.StateSummaryRoot...) - - return -} - -// UnmarshalSSZ ssz unmarshals the HistoricalSummary object -func (h *HistoricalSummary) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 64 { - return ssz.ErrSize - } - - // Field (0) 'BlockSummaryRoot' - if cap(h.BlockSummaryRoot) == 0 { - h.BlockSummaryRoot = make([]byte, 0, len(buf[0:32])) - } - h.BlockSummaryRoot = append(h.BlockSummaryRoot, buf[0:32]...) - - // Field (1) 'StateSummaryRoot' - if cap(h.StateSummaryRoot) == 0 { - h.StateSummaryRoot = make([]byte, 0, len(buf[32:64])) - } - h.StateSummaryRoot = append(h.StateSummaryRoot, buf[32:64]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the HistoricalSummary object -func (h *HistoricalSummary) SizeSSZ() (size int) { - size = 64 - return -} - -// HashTreeRoot ssz hashes the HistoricalSummary object -func (h *HistoricalSummary) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(h) -} - -// HashTreeRootWith ssz hashes the HistoricalSummary object with a hasher -func (h *HistoricalSummary) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'BlockSummaryRoot' - if size := len(h.BlockSummaryRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockSummaryRoot", size, 32) - return - } - hh.PutBytes(h.BlockSummaryRoot) - - // Field (1) 'StateSummaryRoot' - if size := len(h.StateSummaryRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateSummaryRoot", size, 32) - return - } - hh.PutBytes(h.StateSummaryRoot) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedBlindPayloadEnvelope object -func (s *SignedBlindPayloadEnvelope) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedBlindPayloadEnvelope object to a target array -func (s *SignedBlindPayloadEnvelope) 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(BlindPayloadEnvelope) - } - 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 SignedBlindPayloadEnvelope object -func (s *SignedBlindPayloadEnvelope) 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(BlindPayloadEnvelope) - } - if err = s.Message.UnmarshalSSZ(buf); err != nil { - return err - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedBlindPayloadEnvelope object -func (s *SignedBlindPayloadEnvelope) SizeSSZ() (size int) { - size = 100 - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(BlindPayloadEnvelope) - } - size += s.Message.SizeSSZ() - - return -} - -// HashTreeRoot ssz hashes the SignedBlindPayloadEnvelope object -func (s *SignedBlindPayloadEnvelope) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedBlindPayloadEnvelope object with a hasher -func (s *SignedBlindPayloadEnvelope) 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 BlindPayloadEnvelope object -func (b *BlindPayloadEnvelope) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlindPayloadEnvelope object to a target array -func (b *BlindPayloadEnvelope) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(221) - - // Field (0) 'PayloadRoot' - if size := len(b.PayloadRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.PayloadRoot", size, 32) - return - } - dst = append(dst, b.PayloadRoot...) - - // Field (1) 'BuilderIndex' - dst = ssz.MarshalUint64(dst, uint64(b.BuilderIndex)) - - // Field (2) 'BeaconBlockRoot' - if size := len(b.BeaconBlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) - return - } - dst = append(dst, b.BeaconBlockRoot...) - - // Offset (3) 'BlobKzgCommitments' - dst = ssz.WriteOffset(dst, offset) - offset += len(b.BlobKzgCommitments) * 48 - - // Field (4) 'InclusionListProposerIndex' - dst = ssz.MarshalUint64(dst, uint64(b.InclusionListProposerIndex)) - - // Field (5) 'InclusionListSlot' - dst = ssz.MarshalUint64(dst, uint64(b.InclusionListSlot)) - - // Field (6) 'InclusionListSignature' - if size := len(b.InclusionListSignature); size != 96 { - err = ssz.ErrBytesLengthFn("--.InclusionListSignature", size, 96) - return - } - dst = append(dst, b.InclusionListSignature...) - - // Field (7) 'PayloadWithheld' - dst = ssz.MarshalBool(dst, b.PayloadWithheld) - - // Field (8) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - dst = append(dst, b.StateRoot...) - - // Field (3) '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 BlindPayloadEnvelope object -func (b *BlindPayloadEnvelope) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 221 { - return ssz.ErrSize - } - - tail := buf - var o3 uint64 - - // Field (0) 'PayloadRoot' - if cap(b.PayloadRoot) == 0 { - b.PayloadRoot = make([]byte, 0, len(buf[0:32])) - } - b.PayloadRoot = append(b.PayloadRoot, buf[0:32]...) - - // Field (1) 'BuilderIndex' - b.BuilderIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[32:40])) - - // Field (2) 'BeaconBlockRoot' - if cap(b.BeaconBlockRoot) == 0 { - b.BeaconBlockRoot = make([]byte, 0, len(buf[40:72])) - } - b.BeaconBlockRoot = append(b.BeaconBlockRoot, buf[40:72]...) - - // Offset (3) 'BlobKzgCommitments' - if o3 = ssz.ReadOffset(buf[72:76]); o3 > size { - return ssz.ErrOffset - } - - if o3 < 221 { - return ssz.ErrInvalidVariableOffset - } - - // Field (4) 'InclusionListProposerIndex' - b.InclusionListProposerIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[76:84])) - - // Field (5) 'InclusionListSlot' - b.InclusionListSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[84:92])) - - // Field (6) 'InclusionListSignature' - if cap(b.InclusionListSignature) == 0 { - b.InclusionListSignature = make([]byte, 0, len(buf[92:188])) - } - b.InclusionListSignature = append(b.InclusionListSignature, buf[92:188]...) - - // Field (7) 'PayloadWithheld' - b.PayloadWithheld = ssz.UnmarshalBool(buf[188:189]) - - // Field (8) 'StateRoot' - if cap(b.StateRoot) == 0 { - b.StateRoot = make([]byte, 0, len(buf[189:221])) - } - b.StateRoot = append(b.StateRoot, buf[189:221]...) - - // Field (3) 'BlobKzgCommitments' - { - buf = tail[o3:] - 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 BlindPayloadEnvelope object -func (b *BlindPayloadEnvelope) SizeSSZ() (size int) { - size = 221 - - // Field (3) 'BlobKzgCommitments' - size += len(b.BlobKzgCommitments) * 48 - - return -} - -// HashTreeRoot ssz hashes the BlindPayloadEnvelope object -func (b *BlindPayloadEnvelope) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlindPayloadEnvelope object with a hasher -func (b *BlindPayloadEnvelope) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'PayloadRoot' - if size := len(b.PayloadRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.PayloadRoot", size, 32) - return - } - hh.PutBytes(b.PayloadRoot) - - // Field (1) 'BuilderIndex' - hh.PutUint64(uint64(b.BuilderIndex)) - - // Field (2) 'BeaconBlockRoot' - if size := len(b.BeaconBlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) - return - } - hh.PutBytes(b.BeaconBlockRoot) - - // Field (3) '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)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 4096) - } - } - - // Field (4) 'InclusionListProposerIndex' - hh.PutUint64(uint64(b.InclusionListProposerIndex)) - - // Field (5) 'InclusionListSlot' - hh.PutUint64(uint64(b.InclusionListSlot)) - - // Field (6) 'InclusionListSignature' - if size := len(b.InclusionListSignature); size != 96 { - err = ssz.ErrBytesLengthFn("--.InclusionListSignature", size, 96) - return - } - hh.PutBytes(b.InclusionListSignature) - - // Field (7) 'PayloadWithheld' - hh.PutBool(b.PayloadWithheld) - - // Field (8) 'StateRoot' - if size := len(b.StateRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) - return - } - hh.PutBytes(b.StateRoot) - - 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) -} - -// 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) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the PendingBalanceDeposit object -func (p *PendingBalanceDeposit) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} - -// MarshalSSZTo ssz marshals the PendingBalanceDeposit object to a target array -func (p *PendingBalanceDeposit) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Index' - dst = ssz.MarshalUint64(dst, uint64(p.Index)) - - // Field (1) 'Amount' - dst = ssz.MarshalUint64(dst, p.Amount) - - return -} - -// UnmarshalSSZ ssz unmarshals the PendingBalanceDeposit object -func (p *PendingBalanceDeposit) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 16 { - return ssz.ErrSize - } - - // Field (0) 'Index' - p.Index = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'Amount' - p.Amount = ssz.UnmarshallUint64(buf[8:16]) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the PendingBalanceDeposit object -func (p *PendingBalanceDeposit) SizeSSZ() (size int) { - size = 16 - return -} - -// HashTreeRoot ssz hashes the PendingBalanceDeposit object -func (p *PendingBalanceDeposit) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the PendingBalanceDeposit object with a hasher -func (p *PendingBalanceDeposit) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Index' - hh.PutUint64(uint64(p.Index)) - - // Field (1) 'Amount' - hh.PutUint64(p.Amount) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the PendingPartialWithdrawal object -func (p *PendingPartialWithdrawal) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} - -// MarshalSSZTo ssz marshals the PendingPartialWithdrawal object to a target array -func (p *PendingPartialWithdrawal) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Index' - dst = ssz.MarshalUint64(dst, uint64(p.Index)) - - // Field (1) 'Amount' - dst = ssz.MarshalUint64(dst, p.Amount) - - // Field (2) 'WithdrawableEpoch' - dst = ssz.MarshalUint64(dst, uint64(p.WithdrawableEpoch)) - - return -} - -// UnmarshalSSZ ssz unmarshals the PendingPartialWithdrawal object -func (p *PendingPartialWithdrawal) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 24 { - return ssz.ErrSize - } - - // Field (0) 'Index' - p.Index = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'Amount' - p.Amount = ssz.UnmarshallUint64(buf[8:16]) - - // Field (2) 'WithdrawableEpoch' - p.WithdrawableEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[16:24])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the PendingPartialWithdrawal object -func (p *PendingPartialWithdrawal) SizeSSZ() (size int) { - size = 24 - return -} - -// HashTreeRoot ssz hashes the PendingPartialWithdrawal object -func (p *PendingPartialWithdrawal) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the PendingPartialWithdrawal object with a hasher -func (p *PendingPartialWithdrawal) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Index' - hh.PutUint64(uint64(p.Index)) - - // Field (1) 'Amount' - hh.PutUint64(p.Amount) - - // Field (2) 'WithdrawableEpoch' - hh.PutUint64(uint64(p.WithdrawableEpoch)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the Consolidation object -func (c *Consolidation) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(c) -} - -// MarshalSSZTo ssz marshals the Consolidation object to a target array -func (c *Consolidation) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'SourceIndex' - dst = ssz.MarshalUint64(dst, uint64(c.SourceIndex)) - - // Field (1) 'TargetIndex' - dst = ssz.MarshalUint64(dst, uint64(c.TargetIndex)) - - // Field (2) 'Epoch' - dst = ssz.MarshalUint64(dst, uint64(c.Epoch)) - - return -} - -// UnmarshalSSZ ssz unmarshals the Consolidation object -func (c *Consolidation) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 24 { - return ssz.ErrSize - } - - // Field (0) 'SourceIndex' - c.SourceIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'TargetIndex' - c.TargetIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - // Field (2) 'Epoch' - c.Epoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[16:24])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Consolidation object -func (c *Consolidation) SizeSSZ() (size int) { - size = 24 - return -} - -// HashTreeRoot ssz hashes the Consolidation object -func (c *Consolidation) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(c) -} - -// HashTreeRootWith ssz hashes the Consolidation object with a hasher -func (c *Consolidation) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'SourceIndex' - hh.PutUint64(uint64(c.SourceIndex)) - - // Field (1) 'TargetIndex' - hh.PutUint64(uint64(c.TargetIndex)) - - // Field (2) 'Epoch' - hh.PutUint64(uint64(c.Epoch)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedConsolidation object -func (s *SignedConsolidation) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedConsolidation object to a target array -func (s *SignedConsolidation) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(Consolidation) - } - 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 SignedConsolidation object -func (s *SignedConsolidation) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 120 { - return ssz.ErrSize - } - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(Consolidation) - } - if err = s.Message.UnmarshalSSZ(buf[0:24]); err != nil { - return err - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[24:120])) - } - s.Signature = append(s.Signature, buf[24:120]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedConsolidation object -func (s *SignedConsolidation) SizeSSZ() (size int) { - size = 120 - return -} - -// HashTreeRoot ssz hashes the SignedConsolidation object -func (s *SignedConsolidation) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedConsolidation object with a hasher -func (s *SignedConsolidation) 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 PendingConsolidation object -func (p *PendingConsolidation) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} - -// MarshalSSZTo ssz marshals the PendingConsolidation object to a target array -func (p *PendingConsolidation) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'SourceIndex' - dst = ssz.MarshalUint64(dst, uint64(p.SourceIndex)) - - // Field (1) 'TargetIndex' - dst = ssz.MarshalUint64(dst, uint64(p.TargetIndex)) - - return -} - -// UnmarshalSSZ ssz unmarshals the PendingConsolidation object -func (p *PendingConsolidation) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 16 { - return ssz.ErrSize - } - - // Field (0) 'SourceIndex' - p.SourceIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'TargetIndex' - p.TargetIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[8:16])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the PendingConsolidation object -func (p *PendingConsolidation) SizeSSZ() (size int) { - size = 16 - return -} - -// HashTreeRoot ssz hashes the PendingConsolidation object -func (p *PendingConsolidation) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the PendingConsolidation object with a hasher -func (p *PendingConsolidation) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'SourceIndex' - hh.PutUint64(uint64(p.SourceIndex)) - - // Field (1) 'TargetIndex' - hh.PutUint64(uint64(p.TargetIndex)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the Status object -func (s *Status) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the Status object to a target array -func (s *Status) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'ForkDigest' - if size := len(s.ForkDigest); size != 4 { - err = ssz.ErrBytesLengthFn("--.ForkDigest", size, 4) - return - } - dst = append(dst, s.ForkDigest...) - - // Field (1) 'FinalizedRoot' - if size := len(s.FinalizedRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.FinalizedRoot", size, 32) - return - } - dst = append(dst, s.FinalizedRoot...) - - // Field (2) 'FinalizedEpoch' - dst = ssz.MarshalUint64(dst, uint64(s.FinalizedEpoch)) - - // Field (3) 'HeadRoot' - if size := len(s.HeadRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.HeadRoot", size, 32) - return - } - dst = append(dst, s.HeadRoot...) - - // Field (4) 'HeadSlot' - dst = ssz.MarshalUint64(dst, uint64(s.HeadSlot)) - - return -} - -// UnmarshalSSZ ssz unmarshals the Status object -func (s *Status) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 84 { - return ssz.ErrSize - } - - // Field (0) 'ForkDigest' - if cap(s.ForkDigest) == 0 { - s.ForkDigest = make([]byte, 0, len(buf[0:4])) - } - s.ForkDigest = append(s.ForkDigest, buf[0:4]...) - - // Field (1) 'FinalizedRoot' - if cap(s.FinalizedRoot) == 0 { - s.FinalizedRoot = make([]byte, 0, len(buf[4:36])) - } - s.FinalizedRoot = append(s.FinalizedRoot, buf[4:36]...) - - // Field (2) 'FinalizedEpoch' - s.FinalizedEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[36:44])) - - // Field (3) 'HeadRoot' - if cap(s.HeadRoot) == 0 { - s.HeadRoot = make([]byte, 0, len(buf[44:76])) - } - s.HeadRoot = append(s.HeadRoot, buf[44:76]...) - - // Field (4) 'HeadSlot' - s.HeadSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[76:84])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Status object -func (s *Status) SizeSSZ() (size int) { - size = 84 - return -} - -// HashTreeRoot ssz hashes the Status object -func (s *Status) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the Status object with a hasher -func (s *Status) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'ForkDigest' - if size := len(s.ForkDigest); size != 4 { - err = ssz.ErrBytesLengthFn("--.ForkDigest", size, 4) - return - } - hh.PutBytes(s.ForkDigest) - - // Field (1) 'FinalizedRoot' - if size := len(s.FinalizedRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.FinalizedRoot", size, 32) - return - } - hh.PutBytes(s.FinalizedRoot) - - // Field (2) 'FinalizedEpoch' - hh.PutUint64(uint64(s.FinalizedEpoch)) - - // Field (3) 'HeadRoot' - if size := len(s.HeadRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.HeadRoot", size, 32) - return - } - hh.PutBytes(s.HeadRoot) - - // Field (4) 'HeadSlot' - hh.PutUint64(uint64(s.HeadSlot)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BeaconBlocksByRangeRequest object -func (b *BeaconBlocksByRangeRequest) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BeaconBlocksByRangeRequest object to a target array -func (b *BeaconBlocksByRangeRequest) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'StartSlot' - dst = ssz.MarshalUint64(dst, uint64(b.StartSlot)) - - // Field (1) 'Count' - dst = ssz.MarshalUint64(dst, b.Count) - - // Field (2) 'Step' - dst = ssz.MarshalUint64(dst, b.Step) - - return -} - -// UnmarshalSSZ ssz unmarshals the BeaconBlocksByRangeRequest object -func (b *BeaconBlocksByRangeRequest) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 24 { - return ssz.ErrSize - } - - // Field (0) 'StartSlot' - b.StartSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'Count' - b.Count = ssz.UnmarshallUint64(buf[8:16]) - - // Field (2) 'Step' - b.Step = ssz.UnmarshallUint64(buf[16:24]) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlocksByRangeRequest object -func (b *BeaconBlocksByRangeRequest) SizeSSZ() (size int) { - size = 24 - return -} - -// HashTreeRoot ssz hashes the BeaconBlocksByRangeRequest object -func (b *BeaconBlocksByRangeRequest) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BeaconBlocksByRangeRequest object with a hasher -func (b *BeaconBlocksByRangeRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'StartSlot' - hh.PutUint64(uint64(b.StartSlot)) - - // Field (1) 'Count' - hh.PutUint64(b.Count) - - // Field (2) 'Step' - hh.PutUint64(b.Step) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the ENRForkID object -func (e *ENRForkID) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(e) -} - -// MarshalSSZTo ssz marshals the ENRForkID object to a target array -func (e *ENRForkID) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'CurrentForkDigest' - if size := len(e.CurrentForkDigest); size != 4 { - err = ssz.ErrBytesLengthFn("--.CurrentForkDigest", size, 4) - return - } - dst = append(dst, e.CurrentForkDigest...) - - // Field (1) 'NextForkVersion' - if size := len(e.NextForkVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.NextForkVersion", size, 4) - return - } - dst = append(dst, e.NextForkVersion...) - - // Field (2) 'NextForkEpoch' - dst = ssz.MarshalUint64(dst, uint64(e.NextForkEpoch)) - - return -} - -// UnmarshalSSZ ssz unmarshals the ENRForkID object -func (e *ENRForkID) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 16 { - return ssz.ErrSize - } - - // Field (0) 'CurrentForkDigest' - if cap(e.CurrentForkDigest) == 0 { - e.CurrentForkDigest = make([]byte, 0, len(buf[0:4])) - } - e.CurrentForkDigest = append(e.CurrentForkDigest, buf[0:4]...) - - // Field (1) 'NextForkVersion' - if cap(e.NextForkVersion) == 0 { - e.NextForkVersion = make([]byte, 0, len(buf[4:8])) - } - e.NextForkVersion = append(e.NextForkVersion, buf[4:8]...) - - // Field (2) 'NextForkEpoch' - e.NextForkEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[8:16])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the ENRForkID object -func (e *ENRForkID) SizeSSZ() (size int) { - size = 16 - return -} - -// HashTreeRoot ssz hashes the ENRForkID object -func (e *ENRForkID) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(e) -} - -// HashTreeRootWith ssz hashes the ENRForkID object with a hasher -func (e *ENRForkID) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'CurrentForkDigest' - if size := len(e.CurrentForkDigest); size != 4 { - err = ssz.ErrBytesLengthFn("--.CurrentForkDigest", size, 4) - return - } - hh.PutBytes(e.CurrentForkDigest) - - // Field (1) 'NextForkVersion' - if size := len(e.NextForkVersion); size != 4 { - err = ssz.ErrBytesLengthFn("--.NextForkVersion", size, 4) - return - } - hh.PutBytes(e.NextForkVersion) - - // Field (2) 'NextForkEpoch' - hh.PutUint64(uint64(e.NextForkEpoch)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the MetaDataV0 object -func (m *MetaDataV0) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(m) -} - -// MarshalSSZTo ssz marshals the MetaDataV0 object to a target array -func (m *MetaDataV0) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'SeqNumber' - dst = ssz.MarshalUint64(dst, m.SeqNumber) - - // Field (1) 'Attnets' - if size := len(m.Attnets); size != 8 { - err = ssz.ErrBytesLengthFn("--.Attnets", size, 8) - return - } - dst = append(dst, m.Attnets...) - - return -} - -// UnmarshalSSZ ssz unmarshals the MetaDataV0 object -func (m *MetaDataV0) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 16 { - return ssz.ErrSize - } - - // Field (0) 'SeqNumber' - m.SeqNumber = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'Attnets' - if cap(m.Attnets) == 0 { - m.Attnets = make([]byte, 0, len(buf[8:16])) - } - m.Attnets = append(m.Attnets, buf[8:16]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the MetaDataV0 object -func (m *MetaDataV0) SizeSSZ() (size int) { - size = 16 - return -} - -// HashTreeRoot ssz hashes the MetaDataV0 object -func (m *MetaDataV0) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(m) -} - -// HashTreeRootWith ssz hashes the MetaDataV0 object with a hasher -func (m *MetaDataV0) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'SeqNumber' - hh.PutUint64(m.SeqNumber) - - // Field (1) 'Attnets' - if size := len(m.Attnets); size != 8 { - err = ssz.ErrBytesLengthFn("--.Attnets", size, 8) - return - } - hh.PutBytes(m.Attnets) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the MetaDataV1 object -func (m *MetaDataV1) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(m) -} - -// MarshalSSZTo ssz marshals the MetaDataV1 object to a target array -func (m *MetaDataV1) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'SeqNumber' - dst = ssz.MarshalUint64(dst, m.SeqNumber) - - // Field (1) 'Attnets' - if size := len(m.Attnets); size != 8 { - err = ssz.ErrBytesLengthFn("--.Attnets", size, 8) - return - } - dst = append(dst, m.Attnets...) - - // Field (2) 'Syncnets' - if size := len(m.Syncnets); size != 1 { - err = ssz.ErrBytesLengthFn("--.Syncnets", size, 1) - return - } - dst = append(dst, m.Syncnets...) - - return -} - -// UnmarshalSSZ ssz unmarshals the MetaDataV1 object -func (m *MetaDataV1) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 17 { - return ssz.ErrSize - } - - // Field (0) 'SeqNumber' - m.SeqNumber = ssz.UnmarshallUint64(buf[0:8]) - - // Field (1) 'Attnets' - if cap(m.Attnets) == 0 { - m.Attnets = make([]byte, 0, len(buf[8:16])) - } - m.Attnets = append(m.Attnets, buf[8:16]...) - - // Field (2) 'Syncnets' - if cap(m.Syncnets) == 0 { - m.Syncnets = make([]byte, 0, len(buf[16:17])) - } - m.Syncnets = append(m.Syncnets, buf[16:17]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the MetaDataV1 object -func (m *MetaDataV1) SizeSSZ() (size int) { - size = 17 - return -} - -// HashTreeRoot ssz hashes the MetaDataV1 object -func (m *MetaDataV1) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(m) -} - -// HashTreeRootWith ssz hashes the MetaDataV1 object with a hasher -func (m *MetaDataV1) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'SeqNumber' - hh.PutUint64(m.SeqNumber) - - // Field (1) 'Attnets' - if size := len(m.Attnets); size != 8 { - err = ssz.ErrBytesLengthFn("--.Attnets", size, 8) - return - } - hh.PutBytes(m.Attnets) - - // Field (2) 'Syncnets' - if size := len(m.Syncnets); size != 1 { - err = ssz.ErrBytesLengthFn("--.Syncnets", size, 1) - return - } - hh.PutBytes(m.Syncnets) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the BlobSidecarsByRangeRequest object -func (b *BlobSidecarsByRangeRequest) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(b) -} - -// MarshalSSZTo ssz marshals the BlobSidecarsByRangeRequest object to a target array -func (b *BlobSidecarsByRangeRequest) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'StartSlot' - dst = ssz.MarshalUint64(dst, uint64(b.StartSlot)) - - // Field (1) 'Count' - dst = ssz.MarshalUint64(dst, b.Count) - - return -} - -// UnmarshalSSZ ssz unmarshals the BlobSidecarsByRangeRequest object -func (b *BlobSidecarsByRangeRequest) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 16 { - return ssz.ErrSize - } - - // Field (0) 'StartSlot' - b.StartSlot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'Count' - b.Count = ssz.UnmarshallUint64(buf[8:16]) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the BlobSidecarsByRangeRequest object -func (b *BlobSidecarsByRangeRequest) SizeSSZ() (size int) { - size = 16 - return -} - -// HashTreeRoot ssz hashes the BlobSidecarsByRangeRequest object -func (b *BlobSidecarsByRangeRequest) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(b) -} - -// HashTreeRootWith ssz hashes the BlobSidecarsByRangeRequest object with a hasher -func (b *BlobSidecarsByRangeRequest) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'StartSlot' - hh.PutUint64(uint64(b.StartSlot)) - - // Field (1) 'Count' - hh.PutUint64(b.Count) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the PayloadAttestationData object -func (p *PayloadAttestationData) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} - -// MarshalSSZTo ssz marshals the PayloadAttestationData object to a target array -func (p *PayloadAttestationData) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'BeaconBlockRoot' - if size := len(p.BeaconBlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) - return - } - dst = append(dst, p.BeaconBlockRoot...) - - // Field (1) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(p.Slot)) - - // Field (2) 'PayloadStatus' - dst = ssz.MarshalUint64(dst, uint64(p.PayloadStatus)) - - return -} - -// UnmarshalSSZ ssz unmarshals the PayloadAttestationData object -func (p *PayloadAttestationData) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 48 { - return ssz.ErrSize - } - - // Field (0) 'BeaconBlockRoot' - if cap(p.BeaconBlockRoot) == 0 { - p.BeaconBlockRoot = make([]byte, 0, len(buf[0:32])) - } - p.BeaconBlockRoot = append(p.BeaconBlockRoot, buf[0:32]...) - - // Field (1) 'Slot' - p.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[32:40])) - - // Field (2) 'PayloadStatus' - p.PayloadStatus = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.PTCStatus(ssz.UnmarshallUint64(buf[40:48])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the PayloadAttestationData object -func (p *PayloadAttestationData) SizeSSZ() (size int) { - size = 48 - return -} - -// HashTreeRoot ssz hashes the PayloadAttestationData object -func (p *PayloadAttestationData) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the PayloadAttestationData object with a hasher -func (p *PayloadAttestationData) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'BeaconBlockRoot' - if size := len(p.BeaconBlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) - return - } - hh.PutBytes(p.BeaconBlockRoot) - - // Field (1) 'Slot' - hh.PutUint64(uint64(p.Slot)) - - // Field (2) 'PayloadStatus' - hh.PutUint64(uint64(p.PayloadStatus)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the PayloadAttestation object -func (p *PayloadAttestation) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} - -// MarshalSSZTo ssz marshals the PayloadAttestation object to a target array -func (p *PayloadAttestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'AggregationBits' - if size := len(p.AggregationBits); size != 64 { - err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 64) - return - } - dst = append(dst, p.AggregationBits...) - - // Field (1) 'Data' - if p.Data == nil { - p.Data = new(PayloadAttestationData) - } - if dst, err = p.Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(p.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, p.Signature...) - - return -} - -// UnmarshalSSZ ssz unmarshals the PayloadAttestation object -func (p *PayloadAttestation) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 208 { - return ssz.ErrSize - } - - // Field (0) 'AggregationBits' - if cap(p.AggregationBits) == 0 { - p.AggregationBits = make([]byte, 0, len(buf[0:64])) - } - p.AggregationBits = append(p.AggregationBits, buf[0:64]...) - - // Field (1) 'Data' - if p.Data == nil { - p.Data = new(PayloadAttestationData) - } - if err = p.Data.UnmarshalSSZ(buf[64:112]); err != nil { - return err - } - - // Field (2) 'Signature' - if cap(p.Signature) == 0 { - p.Signature = make([]byte, 0, len(buf[112:208])) - } - p.Signature = append(p.Signature, buf[112:208]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the PayloadAttestation object -func (p *PayloadAttestation) SizeSSZ() (size int) { - size = 208 - return -} - -// HashTreeRoot ssz hashes the PayloadAttestation object -func (p *PayloadAttestation) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the PayloadAttestation object with a hasher -func (p *PayloadAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AggregationBits' - if size := len(p.AggregationBits); size != 64 { - err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 64) - return - } - hh.PutBytes(p.AggregationBits) - - // Field (1) 'Data' - if err = p.Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(p.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(p.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the PayloadAttestationMessage object -func (p *PayloadAttestationMessage) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(p) -} - -// MarshalSSZTo ssz marshals the PayloadAttestationMessage object to a target array -func (p *PayloadAttestationMessage) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'ValidatorIndex' - dst = ssz.MarshalUint64(dst, uint64(p.ValidatorIndex)) - - // Field (1) 'Data' - if p.Data == nil { - p.Data = new(PayloadAttestationData) - } - if dst, err = p.Data.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(p.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - dst = append(dst, p.Signature...) - - return -} - -// UnmarshalSSZ ssz unmarshals the PayloadAttestationMessage object -func (p *PayloadAttestationMessage) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 152 { - return ssz.ErrSize - } - - // Field (0) 'ValidatorIndex' - p.ValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'Data' - if p.Data == nil { - p.Data = new(PayloadAttestationData) - } - if err = p.Data.UnmarshalSSZ(buf[8:56]); err != nil { - return err - } - - // Field (2) 'Signature' - if cap(p.Signature) == 0 { - p.Signature = make([]byte, 0, len(buf[56:152])) - } - p.Signature = append(p.Signature, buf[56:152]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the PayloadAttestationMessage object -func (p *PayloadAttestationMessage) SizeSSZ() (size int) { - size = 152 - return -} - -// HashTreeRoot ssz hashes the PayloadAttestationMessage object -func (p *PayloadAttestationMessage) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(p) -} - -// HashTreeRootWith ssz hashes the PayloadAttestationMessage object with a hasher -func (p *PayloadAttestationMessage) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'ValidatorIndex' - hh.PutUint64(uint64(p.ValidatorIndex)) - - // Field (1) 'Data' - if err = p.Data.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'Signature' - if size := len(p.Signature); size != 96 { - err = ssz.ErrBytesLengthFn("--.Signature", size, 96) - return - } - hh.PutBytes(p.Signature) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the DepositSnapshot object -func (d *DepositSnapshot) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(d) -} - -// MarshalSSZTo ssz marshals the DepositSnapshot object to a target array -func (d *DepositSnapshot) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - offset := int(84) - - // Offset (0) 'Finalized' - dst = ssz.WriteOffset(dst, offset) - offset += len(d.Finalized) * 32 - - // Field (1) 'DepositRoot' - if size := len(d.DepositRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.DepositRoot", size, 32) - return - } - dst = append(dst, d.DepositRoot...) - - // Field (2) 'DepositCount' - dst = ssz.MarshalUint64(dst, d.DepositCount) - - // Field (3) 'ExecutionHash' - if size := len(d.ExecutionHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ExecutionHash", size, 32) - return - } - dst = append(dst, d.ExecutionHash...) - - // Field (4) 'ExecutionDepth' - dst = ssz.MarshalUint64(dst, d.ExecutionDepth) - - // Field (0) 'Finalized' - if size := len(d.Finalized); size > 32 { - err = ssz.ErrListTooBigFn("--.Finalized", size, 32) - return - } - for ii := 0; ii < len(d.Finalized); ii++ { - if size := len(d.Finalized[ii]); size != 32 { - err = ssz.ErrBytesLengthFn("--.Finalized[ii]", size, 32) - return - } - dst = append(dst, d.Finalized[ii]...) - } - - return -} - -// UnmarshalSSZ ssz unmarshals the DepositSnapshot object -func (d *DepositSnapshot) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size < 84 { - return ssz.ErrSize - } - - tail := buf - var o0 uint64 - - // Offset (0) 'Finalized' - if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { - return ssz.ErrOffset - } - - if o0 < 84 { - return ssz.ErrInvalidVariableOffset - } - - // Field (1) 'DepositRoot' - if cap(d.DepositRoot) == 0 { - d.DepositRoot = make([]byte, 0, len(buf[4:36])) - } - d.DepositRoot = append(d.DepositRoot, buf[4:36]...) - - // Field (2) 'DepositCount' - d.DepositCount = ssz.UnmarshallUint64(buf[36:44]) - - // Field (3) 'ExecutionHash' - if cap(d.ExecutionHash) == 0 { - d.ExecutionHash = make([]byte, 0, len(buf[44:76])) - } - d.ExecutionHash = append(d.ExecutionHash, buf[44:76]...) - - // Field (4) 'ExecutionDepth' - d.ExecutionDepth = ssz.UnmarshallUint64(buf[76:84]) - - // Field (0) 'Finalized' - { - buf = tail[o0:] - num, err := ssz.DivideInt2(len(buf), 32, 32) - if err != nil { - return err - } - d.Finalized = make([][]byte, num) - for ii := 0; ii < num; ii++ { - if cap(d.Finalized[ii]) == 0 { - d.Finalized[ii] = make([]byte, 0, len(buf[ii*32:(ii+1)*32])) - } - d.Finalized[ii] = append(d.Finalized[ii], buf[ii*32:(ii+1)*32]...) - } - } - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the DepositSnapshot object -func (d *DepositSnapshot) SizeSSZ() (size int) { - size = 84 - - // Field (0) 'Finalized' - size += len(d.Finalized) * 32 - - return -} - -// HashTreeRoot ssz hashes the DepositSnapshot object -func (d *DepositSnapshot) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(d) -} - -// HashTreeRootWith ssz hashes the DepositSnapshot object with a hasher -func (d *DepositSnapshot) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Finalized' - { - if size := len(d.Finalized); size > 32 { - err = ssz.ErrListTooBigFn("--.Finalized", size, 32) - return - } - subIndx := hh.Index() - for _, i := range d.Finalized { - if len(i) != 32 { - err = ssz.ErrBytesLength - return - } - hh.Append(i) - } - - numItems := uint64(len(d.Finalized)) - if ssz.EnableVectorizedHTR { - hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 32) - } else { - hh.MerkleizeWithMixin(subIndx, numItems, 32) - } - } - - // Field (1) 'DepositRoot' - if size := len(d.DepositRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.DepositRoot", size, 32) - return - } - hh.PutBytes(d.DepositRoot) - - // Field (2) 'DepositCount' - hh.PutUint64(d.DepositCount) - - // Field (3) 'ExecutionHash' - if size := len(d.ExecutionHash); size != 32 { - err = ssz.ErrBytesLengthFn("--.ExecutionHash", size, 32) - return - } - hh.PutBytes(d.ExecutionHash) - - // Field (4) 'ExecutionDepth' - hh.PutUint64(d.ExecutionDepth) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SyncCommitteeMessage object -func (s *SyncCommitteeMessage) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SyncCommitteeMessage object to a target array -func (s *SyncCommitteeMessage) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(s.Slot)) - - // Field (1) 'BlockRoot' - if size := len(s.BlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) - return - } - dst = append(dst, s.BlockRoot...) - - // Field (2) 'ValidatorIndex' - dst = ssz.MarshalUint64(dst, uint64(s.ValidatorIndex)) - - // Field (3) '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 SyncCommitteeMessage object -func (s *SyncCommitteeMessage) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 144 { - return ssz.ErrSize - } - - // Field (0) 'Slot' - s.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'BlockRoot' - if cap(s.BlockRoot) == 0 { - s.BlockRoot = make([]byte, 0, len(buf[8:40])) - } - s.BlockRoot = append(s.BlockRoot, buf[8:40]...) - - // Field (2) 'ValidatorIndex' - s.ValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[40:48])) - - // Field (3) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[48:144])) - } - s.Signature = append(s.Signature, buf[48:144]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SyncCommitteeMessage object -func (s *SyncCommitteeMessage) SizeSSZ() (size int) { - size = 144 - return -} - -// HashTreeRoot ssz hashes the SyncCommitteeMessage object -func (s *SyncCommitteeMessage) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SyncCommitteeMessage object with a hasher -func (s *SyncCommitteeMessage) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(s.Slot)) - - // Field (1) 'BlockRoot' - if size := len(s.BlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) - return - } - hh.PutBytes(s.BlockRoot) - - // Field (2) 'ValidatorIndex' - hh.PutUint64(uint64(s.ValidatorIndex)) - - // Field (3) '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 SyncCommitteeContribution object -func (s *SyncCommitteeContribution) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SyncCommitteeContribution object to a target array -func (s *SyncCommitteeContribution) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Slot' - dst = ssz.MarshalUint64(dst, uint64(s.Slot)) - - // Field (1) 'BlockRoot' - if size := len(s.BlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) - return - } - dst = append(dst, s.BlockRoot...) - - // Field (2) 'SubcommitteeIndex' - dst = ssz.MarshalUint64(dst, s.SubcommitteeIndex) - - // Field (3) 'AggregationBits' - if size := len(s.AggregationBits); size != 16 { - err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 16) - return - } - dst = append(dst, s.AggregationBits...) - - // Field (4) '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 SyncCommitteeContribution object -func (s *SyncCommitteeContribution) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 160 { - return ssz.ErrSize - } - - // Field (0) 'Slot' - s.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'BlockRoot' - if cap(s.BlockRoot) == 0 { - s.BlockRoot = make([]byte, 0, len(buf[8:40])) - } - s.BlockRoot = append(s.BlockRoot, buf[8:40]...) - - // Field (2) 'SubcommitteeIndex' - s.SubcommitteeIndex = ssz.UnmarshallUint64(buf[40:48]) - - // Field (3) 'AggregationBits' - if cap(s.AggregationBits) == 0 { - s.AggregationBits = make([]byte, 0, len(buf[48:64])) - } - s.AggregationBits = append(s.AggregationBits, buf[48:64]...) - - // Field (4) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[64:160])) - } - s.Signature = append(s.Signature, buf[64:160]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SyncCommitteeContribution object -func (s *SyncCommitteeContribution) SizeSSZ() (size int) { - size = 160 - return -} - -// HashTreeRoot ssz hashes the SyncCommitteeContribution object -func (s *SyncCommitteeContribution) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SyncCommitteeContribution object with a hasher -func (s *SyncCommitteeContribution) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'Slot' - hh.PutUint64(uint64(s.Slot)) - - // Field (1) 'BlockRoot' - if size := len(s.BlockRoot); size != 32 { - err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) - return - } - hh.PutBytes(s.BlockRoot) - - // Field (2) 'SubcommitteeIndex' - hh.PutUint64(s.SubcommitteeIndex) - - // Field (3) 'AggregationBits' - if size := len(s.AggregationBits); size != 16 { - err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 16) - return - } - hh.PutBytes(s.AggregationBits) - - // Field (4) '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 ContributionAndProof object -func (c *ContributionAndProof) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(c) -} - -// MarshalSSZTo ssz marshals the ContributionAndProof object to a target array -func (c *ContributionAndProof) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'AggregatorIndex' - dst = ssz.MarshalUint64(dst, uint64(c.AggregatorIndex)) - - // Field (1) 'Contribution' - if c.Contribution == nil { - c.Contribution = new(SyncCommitteeContribution) - } - if dst, err = c.Contribution.MarshalSSZTo(dst); err != nil { - return - } - - // Field (2) 'SelectionProof' - if size := len(c.SelectionProof); size != 96 { - err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) - return - } - dst = append(dst, c.SelectionProof...) - - return -} - -// UnmarshalSSZ ssz unmarshals the ContributionAndProof object -func (c *ContributionAndProof) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 264 { - return ssz.ErrSize - } - - // Field (0) 'AggregatorIndex' - c.AggregatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) - - // Field (1) 'Contribution' - if c.Contribution == nil { - c.Contribution = new(SyncCommitteeContribution) - } - if err = c.Contribution.UnmarshalSSZ(buf[8:168]); err != nil { - return err - } - - // Field (2) 'SelectionProof' - if cap(c.SelectionProof) == 0 { - c.SelectionProof = make([]byte, 0, len(buf[168:264])) - } - c.SelectionProof = append(c.SelectionProof, buf[168:264]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the ContributionAndProof object -func (c *ContributionAndProof) SizeSSZ() (size int) { - size = 264 - return -} - -// HashTreeRoot ssz hashes the ContributionAndProof object -func (c *ContributionAndProof) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(c) -} - -// HashTreeRootWith ssz hashes the ContributionAndProof object with a hasher -func (c *ContributionAndProof) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'AggregatorIndex' - hh.PutUint64(uint64(c.AggregatorIndex)) - - // Field (1) 'Contribution' - if err = c.Contribution.HashTreeRootWith(hh); err != nil { - return - } - - // Field (2) 'SelectionProof' - if size := len(c.SelectionProof); size != 96 { - err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) - return - } - hh.PutBytes(c.SelectionProof) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} - -// MarshalSSZ ssz marshals the SignedContributionAndProof object -func (s *SignedContributionAndProof) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(s) -} - -// MarshalSSZTo ssz marshals the SignedContributionAndProof object to a target array -func (s *SignedContributionAndProof) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(ContributionAndProof) - } - 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 SignedContributionAndProof object -func (s *SignedContributionAndProof) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 360 { - return ssz.ErrSize - } - - // Field (0) 'Message' - if s.Message == nil { - s.Message = new(ContributionAndProof) - } - if err = s.Message.UnmarshalSSZ(buf[0:264]); err != nil { - return err - } - - // Field (1) 'Signature' - if cap(s.Signature) == 0 { - s.Signature = make([]byte, 0, len(buf[264:360])) - } - s.Signature = append(s.Signature, buf[264:360]...) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the SignedContributionAndProof object -func (s *SignedContributionAndProof) SizeSSZ() (size int) { - size = 360 - return -} - -// HashTreeRoot ssz hashes the SignedContributionAndProof object -func (s *SignedContributionAndProof) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(s) -} - -// HashTreeRootWith ssz hashes the SignedContributionAndProof object with a hasher -func (s *SignedContributionAndProof) 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 Validator object -func (v *Validator) MarshalSSZ() ([]byte, error) { - return ssz.MarshalSSZ(v) -} - -// MarshalSSZTo ssz marshals the Validator object to a target array -func (v *Validator) MarshalSSZTo(buf []byte) (dst []byte, err error) { - dst = buf - - // Field (0) 'PublicKey' - if size := len(v.PublicKey); size != 48 { - err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) - return - } - dst = append(dst, v.PublicKey...) - - // Field (1) 'WithdrawalCredentials' - if size := len(v.WithdrawalCredentials); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) - return - } - dst = append(dst, v.WithdrawalCredentials...) - - // Field (2) 'EffectiveBalance' - dst = ssz.MarshalUint64(dst, v.EffectiveBalance) - - // Field (3) 'Slashed' - dst = ssz.MarshalBool(dst, v.Slashed) - - // Field (4) 'ActivationEligibilityEpoch' - dst = ssz.MarshalUint64(dst, uint64(v.ActivationEligibilityEpoch)) - - // Field (5) 'ActivationEpoch' - dst = ssz.MarshalUint64(dst, uint64(v.ActivationEpoch)) - - // Field (6) 'ExitEpoch' - dst = ssz.MarshalUint64(dst, uint64(v.ExitEpoch)) - - // Field (7) 'WithdrawableEpoch' - dst = ssz.MarshalUint64(dst, uint64(v.WithdrawableEpoch)) - - return -} - -// UnmarshalSSZ ssz unmarshals the Validator object -func (v *Validator) UnmarshalSSZ(buf []byte) error { - var err error - size := uint64(len(buf)) - if size != 121 { - return ssz.ErrSize - } - - // Field (0) 'PublicKey' - if cap(v.PublicKey) == 0 { - v.PublicKey = make([]byte, 0, len(buf[0:48])) - } - v.PublicKey = append(v.PublicKey, buf[0:48]...) - - // Field (1) 'WithdrawalCredentials' - if cap(v.WithdrawalCredentials) == 0 { - v.WithdrawalCredentials = make([]byte, 0, len(buf[48:80])) - } - v.WithdrawalCredentials = append(v.WithdrawalCredentials, buf[48:80]...) - - // Field (2) 'EffectiveBalance' - v.EffectiveBalance = ssz.UnmarshallUint64(buf[80:88]) - - // Field (3) 'Slashed' - v.Slashed = ssz.UnmarshalBool(buf[88:89]) - - // Field (4) 'ActivationEligibilityEpoch' - v.ActivationEligibilityEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[89:97])) - - // Field (5) 'ActivationEpoch' - v.ActivationEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[97:105])) - - // Field (6) 'ExitEpoch' - v.ExitEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[105:113])) - - // Field (7) 'WithdrawableEpoch' - v.WithdrawableEpoch = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(ssz.UnmarshallUint64(buf[113:121])) - - return err -} - -// SizeSSZ returns the ssz encoded size in bytes for the Validator object -func (v *Validator) SizeSSZ() (size int) { - size = 121 - return -} - -// HashTreeRoot ssz hashes the Validator object -func (v *Validator) HashTreeRoot() ([32]byte, error) { - return ssz.HashWithDefaultHasher(v) -} - -// HashTreeRootWith ssz hashes the Validator object with a hasher -func (v *Validator) HashTreeRootWith(hh *ssz.Hasher) (err error) { - indx := hh.Index() - - // Field (0) 'PublicKey' - if size := len(v.PublicKey); size != 48 { - err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) - return - } - hh.PutBytes(v.PublicKey) - - // Field (1) 'WithdrawalCredentials' - if size := len(v.WithdrawalCredentials); size != 32 { - err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) - return - } - hh.PutBytes(v.WithdrawalCredentials) - - // Field (2) 'EffectiveBalance' - hh.PutUint64(v.EffectiveBalance) - - // Field (3) 'Slashed' - hh.PutBool(v.Slashed) - - // Field (4) 'ActivationEligibilityEpoch' - hh.PutUint64(uint64(v.ActivationEligibilityEpoch)) - - // Field (5) 'ActivationEpoch' - hh.PutUint64(uint64(v.ActivationEpoch)) - - // Field (6) 'ExitEpoch' - hh.PutUint64(uint64(v.ExitEpoch)) - - // Field (7) 'WithdrawableEpoch' - hh.PutUint64(uint64(v.WithdrawableEpoch)) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - 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) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - 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) - - if ssz.EnableVectorizedHTR { - hh.MerkleizeVectorizedHTR(indx) - } else { - hh.Merkleize(indx) - } - return -} diff --git a/proto/prysm/v1alpha1/non-core.ssz.go b/proto/prysm/v1alpha1/non-core.ssz.go index 2c720bc17b34..72a2a3f280aa 100644 --- a/proto/prysm/v1alpha1/non-core.ssz.go +++ b/proto/prysm/v1alpha1/non-core.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 6fe6b8a92c8bbb2fc95fc59fca0b73d1c787c00ec01137d73193b5b251e40c12 +// Hash: 19c621036a1af2a86f87c3e25316b9da706be978fb49533382ab2ee1d9448db6 package eth import ( diff --git a/proto/prysm/v1alpha1/phase0.ssz.go b/proto/prysm/v1alpha1/phase0.ssz.go index d9d2b40cb253..c9fa9a457e52 100644 --- a/proto/prysm/v1alpha1/phase0.ssz.go +++ b/proto/prysm/v1alpha1/phase0.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 0858b1e553b943e9cbdba001604002341da98f82976954a2eafa7a97632f485c +// Hash: ff3a2bdff0b509b7e5b59c84e4d776897570c102dcf1fe577bd94fb134a399cb package eth import ( diff --git a/testing/util/random/epbs.go b/testing/util/random/epbs.go index 9cea93bc644d..5a72fcc5dbc8 100644 --- a/testing/util/random/epbs.go +++ b/testing/util/random/epbs.go @@ -265,13 +265,9 @@ func BeaconState(t *testing.T) *ethpb.BeaconStateEPBS { TargetIndex: primitives.ValidatorIndex(randomUint64(t)), }, }, - PreviousInclusionListProposer: primitives.ValidatorIndex(randomUint64(t)), - PreviousInclusionListSlot: primitives.Slot(randomUint64(t)), - LatestInclusionListProposer: primitives.ValidatorIndex(randomUint64(t)), - LatestInclusionListSlot: primitives.Slot(randomUint64(t)), - LatestBlockHash: randomBytes(32, t), - LatestFullSlot: primitives.Slot(randomUint64(t)), - ExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderEPBS{ + LatestBlockHash: randomBytes(32, t), + LatestFullSlot: primitives.Slot(randomUint64(t)), + LatestExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderEPBS{ ParentBlockHash: randomBytes(32, t), ParentBlockRoot: randomBytes(32, t), BlockHash: randomBytes(32, t), @@ -279,6 +275,7 @@ func BeaconState(t *testing.T) *ethpb.BeaconStateEPBS { Slot: primitives.Slot(randomUint64(t)), Value: randomUint64(t), BlobKzgCommitmentsRoot: randomBytes(32, t), + GasLimit: randomUint64(t), }, LastWithdrawalsRoot: randomBytes(32, t), } @@ -302,6 +299,7 @@ func ExecutionPayloadHeader(t *testing.T) *enginev1.ExecutionPayloadHeaderEPBS { Slot: primitives.Slot(randomUint64(t)), Value: randomUint64(t), BlobKzgCommitmentsRoot: randomBytes(32, t), + GasLimit: randomUint64(t), } } @@ -363,21 +361,18 @@ func SignedExecutionPayloadEnvelope(t *testing.T) *enginev1.SignedExecutionPaylo func ExecutionPayloadEnvelope(t *testing.T) *enginev1.ExecutionPayloadEnvelope { withheld := randomUint64(t)%2 == 0 return &enginev1.ExecutionPayloadEnvelope{ - Payload: ExecutionPayload(t), - BuilderIndex: primitives.ValidatorIndex(randomUint64(t)), - BeaconBlockRoot: randomBytes(32, t), - BlobKzgCommitments: [][]byte{randomBytes(48, t), randomBytes(48, t), randomBytes(48, t)}, - InclusionListProposerIndex: primitives.ValidatorIndex(randomUint64(t)), - InclusionListSlot: primitives.Slot(randomUint64(t)), - InclusionListSignature: randomBytes(96, t), - PayloadWithheld: withheld, - StateRoot: randomBytes(32, t), + Payload: ExecutionPayload(t), + BuilderIndex: primitives.ValidatorIndex(randomUint64(t)), + BeaconBlockRoot: randomBytes(32, t), + BlobKzgCommitments: [][]byte{randomBytes(48, t), randomBytes(48, t), randomBytes(48, t)}, + PayloadWithheld: withheld, + StateRoot: randomBytes(32, t), } } // ExecutionPayload creates a random ExecutionPayloadEPBS for testing purposes. -func ExecutionPayload(t *testing.T) *enginev1.ExecutionPayloadEPBS { - return &enginev1.ExecutionPayloadEPBS{ +func ExecutionPayload(t *testing.T) *enginev1.ExecutionPayloadElectra { + return &enginev1.ExecutionPayloadElectra{ ParentHash: randomBytes(32, t), FeeRecipient: randomBytes(20, t), StateRoot: randomBytes(32, t), @@ -400,40 +395,45 @@ func ExecutionPayload(t *testing.T) *enginev1.ExecutionPayloadEPBS { Amount: randomUint64(t), }, }, - BlobGasUsed: randomUint64(t), - ExcessBlobGas: randomUint64(t), - InclusionListSummary: [][]byte{randomBytes(20, t), randomBytes(20, t), randomBytes(20, t)}, + BlobGasUsed: randomUint64(t), + ExcessBlobGas: randomUint64(t), + DepositRequests: []*enginev1.DepositRequest{DepositRequest(t), DepositRequest(t), DepositRequest(t), DepositRequest(t)}, + WithdrawalRequests: WithdrawalRequests(t), + ConsolidationRequests: []*enginev1.ConsolidationRequest{ConsolidationRequest(t)}, } } -// InclusionList creates a random InclusionList for testing purposes. -func InclusionList(t *testing.T) *enginev1.InclusionList { - return &enginev1.InclusionList{ - SignedSummary: &enginev1.SignedInclusionListSummary{ - Message: InclusionSummary(t), - Signature: randomBytes(96, t), - }, - ParentBlockHash: randomBytes(32, t), - Transactions: [][]byte{ - randomBytes(123, t), - randomBytes(456, t), - randomBytes(789, t), - randomBytes(1011, t), - }, +func DepositRequest(t *testing.T) *enginev1.DepositRequest { + return &enginev1.DepositRequest{ + Pubkey: randomBytes(48, t), + WithdrawalCredentials: randomBytes(32, t), + Amount: randomUint64(t), + Signature: randomBytes(96, t), + Index: randomUint64(t), } } -// InclusionSummary creates a random InclusionListSummary for testing purposes. -func InclusionSummary(t *testing.T) *enginev1.InclusionListSummary { - return &enginev1.InclusionListSummary{ - ProposerIndex: primitives.ValidatorIndex(randomUint64(t)), - Slot: primitives.Slot(randomUint64(t)), - Summary: [][]byte{ - randomBytes(20, t), - randomBytes(20, t), - randomBytes(20, t), - randomBytes(20, t), - }, +func WithdrawalRequests(t *testing.T) []*enginev1.WithdrawalRequest { + requests := make([]*enginev1.WithdrawalRequest, fieldparams.MaxWithdrawalRequestsPerPayload) + for i := range requests { + requests[i] = WithdrawalRequest(t) + } + return requests +} + +func WithdrawalRequest(t *testing.T) *enginev1.WithdrawalRequest { + return &enginev1.WithdrawalRequest{ + SourceAddress: randomBytes(20, t), + ValidatorPubkey: randomBytes(48, t), + Amount: randomUint64(t), + } +} + +func ConsolidationRequest(t *testing.T) *enginev1.ConsolidationRequest { + return &enginev1.ConsolidationRequest{ + SourceAddress: randomBytes(20, t), + SourcePubkey: randomBytes(20, t), + TargetPubkey: randomBytes(48, t), } } @@ -449,15 +449,12 @@ func SignedBlindPayloadEnvelope(t *testing.T) *ethpb.SignedBlindPayloadEnvelope func BlindPayloadEnvelope(t *testing.T) *ethpb.BlindPayloadEnvelope { withheld := randomUint64(t)%2 == 0 return ðpb.BlindPayloadEnvelope{ - PayloadRoot: randomBytes(32, t), - BuilderIndex: primitives.ValidatorIndex(randomUint64(t)), - BeaconBlockRoot: randomBytes(32, t), - BlobKzgCommitments: [][]byte{randomBytes(48, t), randomBytes(48, t), randomBytes(48, t)}, - InclusionListProposerIndex: primitives.ValidatorIndex(randomUint64(t)), - InclusionListSlot: primitives.Slot(randomUint64(t)), - InclusionListSignature: randomBytes(96, t), - PayloadWithheld: withheld, - StateRoot: randomBytes(32, t), + PayloadRoot: randomBytes(32, t), + BuilderIndex: primitives.ValidatorIndex(randomUint64(t)), + BeaconBlockRoot: randomBytes(32, t), + BlobKzgCommitments: [][]byte{randomBytes(48, t), randomBytes(48, t), randomBytes(48, t)}, + PayloadWithheld: withheld, + StateRoot: randomBytes(32, t), } }