diff --git a/beacon-chain/operations/attestations/kv/aggregated_test.go b/beacon-chain/operations/attestations/kv/aggregated_test.go index fa35a8d21..b23cbdd69 100644 --- a/beacon-chain/operations/attestations/kv/aggregated_test.go +++ b/beacon-chain/operations/attestations/kv/aggregated_test.go @@ -125,7 +125,7 @@ func TestKV_Aggregated_SaveAggregatedAttestation(t *testing.T) { }), AggregationBits: bitfield.Bitlist{0b10111}, }, - wantErrString: "could not tree hash attestation: " + fssz.ErrBytesLength.Error(), + wantErrString: "could not tree hash attestation: --.BeaconBlockRoot (" + fssz.ErrBytesLength.Error() + ")", }, { name: "already seen", @@ -286,7 +286,7 @@ func TestKV_Aggregated_DeleteAggregatedAttestation(t *testing.T) { }, } err := cache.DeleteAggregatedAttestation(att) - wantErr := "could not tree hash attestation data: " + fssz.ErrBytesLength.Error() + wantErr := "could not tree hash attestation data: --.BeaconBlockRoot (" + fssz.ErrBytesLength.Error() + ")" assert.ErrorContains(t, wantErr, err) }) diff --git a/deps.bzl b/deps.bzl index ddbf695f8..d20fd37ec 100644 --- a/deps.bzl +++ b/deps.bzl @@ -3193,8 +3193,8 @@ def prysm_deps(): go_repository( name = "com_github_prysmaticlabs_fastssz", importpath = "github.com/prysmaticlabs/fastssz", - sum = "h1:fat9avCPKKYZKe9KJq/VlF43/Nrxmn+sg59Ibe/pGs8=", - version = "v0.0.0-20220624091035-af5440c5d1dc", + sum = "h1:Y3PcvUrnneMWLuypZpwPz8P70/DQsz6KgV9JveKpyZs=", + version = "v0.0.0-20220628121656-93dfe28febab", ) go_repository( diff --git a/go.mod b/go.mod index 3f85cf216..1d982c86d 100644 --- a/go.mod +++ b/go.mod @@ -61,7 +61,7 @@ require ( github.com/prometheus/client_golang v1.12.1 github.com/prometheus/client_model v0.2.0 github.com/prometheus/prom2json v1.3.0 - github.com/prysmaticlabs/fastssz v0.0.0-20220624091035-af5440c5d1dc + github.com/prysmaticlabs/fastssz v0.0.0-20220628121656-93dfe28febab github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 github.com/prysmaticlabs/prombbolt v0.0.0-20210126082820-9b7adba6db7c github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20211014160335-757fae4f38c6 diff --git a/go.sum b/go.sum index de1ae6649..566881a3a 100644 --- a/go.sum +++ b/go.sum @@ -1192,8 +1192,8 @@ github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0 github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prometheus/tsdb v0.10.0 h1:If5rVCMTp6W2SiRAQFlbpJNgVlgMEd+U2GZckwK38ic= github.com/prometheus/tsdb v0.10.0/go.mod h1:oi49uRhEe9dPUTlS3JRZOwJuVi6tmh10QSgwXEyGCt4= -github.com/prysmaticlabs/fastssz v0.0.0-20220624091035-af5440c5d1dc h1:fat9avCPKKYZKe9KJq/VlF43/Nrxmn+sg59Ibe/pGs8= -github.com/prysmaticlabs/fastssz v0.0.0-20220624091035-af5440c5d1dc/go.mod h1:MA5zShstUwCQaE9faGHgCGvEWUbG87p4SAXINhmCkvg= +github.com/prysmaticlabs/fastssz v0.0.0-20220628121656-93dfe28febab h1:Y3PcvUrnneMWLuypZpwPz8P70/DQsz6KgV9JveKpyZs= +github.com/prysmaticlabs/fastssz v0.0.0-20220628121656-93dfe28febab/go.mod h1:MA5zShstUwCQaE9faGHgCGvEWUbG87p4SAXINhmCkvg= github.com/prysmaticlabs/go-bitfield v0.0.0-20210108222456-8e92c3709aa0/go.mod h1:hCwmef+4qXWjv0jLDbQdWnL0Ol7cS7/lCSS26WR+u6s= github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 h1:0tVE4tdWQK9ZpYygoV7+vS6QkDvQVySboMVEIxBJmXw= github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7/go.mod h1:wmuf/mdK4VMD+jA9ThwcUKjg3a2XWM9cVfFYjDyY4j4= diff --git a/proto/engine/v1/generated.ssz.go b/proto/engine/v1/generated.ssz.go index b6051f897..93b1172a6 100644 --- a/proto/engine/v1/generated.ssz.go +++ b/proto/engine/v1/generated.ssz.go @@ -17,43 +17,43 @@ func (e *ExecutionPayload) MarshalSSZTo(buf []byte) (dst []byte, err error) { offset := int(508) // Field (0) 'ParentHash' - if len(e.ParentHash) != 32 { - err = ssz.ErrBytesLength + if size := len(e.ParentHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) return } dst = append(dst, e.ParentHash...) // Field (1) 'FeeRecipient' - if len(e.FeeRecipient) != 20 { - err = ssz.ErrBytesLength + if size := len(e.FeeRecipient); size != 20 { + err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) return } dst = append(dst, e.FeeRecipient...) // Field (2) 'StateRoot' - if len(e.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(e.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, e.StateRoot...) // Field (3) 'ReceiptsRoot' - if len(e.ReceiptsRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(e.ReceiptsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ReceiptsRoot", size, 32) return } dst = append(dst, e.ReceiptsRoot...) // Field (4) 'LogsBloom' - if len(e.LogsBloom) != 256 { - err = ssz.ErrBytesLength + if size := len(e.LogsBloom); size != 256 { + err = ssz.ErrBytesLengthFn("--.LogsBloom", size, 256) return } dst = append(dst, e.LogsBloom...) // Field (5) 'PrevRandao' - if len(e.PrevRandao) != 32 { - err = ssz.ErrBytesLength + if size := len(e.PrevRandao); size != 32 { + err = ssz.ErrBytesLengthFn("--.PrevRandao", size, 32) return } dst = append(dst, e.PrevRandao...) @@ -75,15 +75,15 @@ func (e *ExecutionPayload) MarshalSSZTo(buf []byte) (dst []byte, err error) { offset += len(e.ExtraData) // Field (11) 'BaseFeePerGas' - if len(e.BaseFeePerGas) != 32 { - err = ssz.ErrBytesLength + if size := len(e.BaseFeePerGas); size != 32 { + err = ssz.ErrBytesLengthFn("--.BaseFeePerGas", size, 32) return } dst = append(dst, e.BaseFeePerGas...) // Field (12) 'BlockHash' - if len(e.BlockHash) != 32 { - err = ssz.ErrBytesLength + if size := len(e.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) return } dst = append(dst, e.BlockHash...) @@ -96,15 +96,15 @@ func (e *ExecutionPayload) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (10) 'ExtraData' - if len(e.ExtraData) > 32 { - err = ssz.ErrBytesLength + if size := len(e.ExtraData); size > 32 { + err = ssz.ErrBytesLengthFn("--.ExtraData", size, 32) return } dst = append(dst, e.ExtraData...) // Field (13) 'Transactions' - if len(e.Transactions) > 1048576 { - err = ssz.ErrListTooBig + if size := len(e.Transactions); size > 1048576 { + err = ssz.ErrListTooBigFn("--.Transactions", size, 1048576) return } { @@ -115,8 +115,8 @@ func (e *ExecutionPayload) MarshalSSZTo(buf []byte) (dst []byte, err error) { } } for ii := 0; ii < len(e.Transactions); ii++ { - if len(e.Transactions[ii]) > 1073741824 { - err = ssz.ErrBytesLength + if size := len(e.Transactions[ii]); size > 1073741824 { + err = ssz.ErrBytesLengthFn("--.Transactions[ii]", size, 1073741824) return } dst = append(dst, e.Transactions[ii]...) @@ -273,43 +273,43 @@ func (e *ExecutionPayload) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'ParentHash' - if len(e.ParentHash) != 32 { - err = ssz.ErrBytesLength + if size := len(e.ParentHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) return } hh.PutBytes(e.ParentHash) // Field (1) 'FeeRecipient' - if len(e.FeeRecipient) != 20 { - err = ssz.ErrBytesLength + if size := len(e.FeeRecipient); size != 20 { + err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) return } hh.PutBytes(e.FeeRecipient) // Field (2) 'StateRoot' - if len(e.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(e.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(e.StateRoot) // Field (3) 'ReceiptsRoot' - if len(e.ReceiptsRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(e.ReceiptsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ReceiptsRoot", size, 32) return } hh.PutBytes(e.ReceiptsRoot) // Field (4) 'LogsBloom' - if len(e.LogsBloom) != 256 { - err = ssz.ErrBytesLength + if size := len(e.LogsBloom); size != 256 { + err = ssz.ErrBytesLengthFn("--.LogsBloom", size, 256) return } hh.PutBytes(e.LogsBloom) // Field (5) 'PrevRandao' - if len(e.PrevRandao) != 32 { - err = ssz.ErrBytesLength + if size := len(e.PrevRandao); size != 32 { + err = ssz.ErrBytesLengthFn("--.PrevRandao", size, 32) return } hh.PutBytes(e.PrevRandao) @@ -343,15 +343,15 @@ func (e *ExecutionPayload) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (11) 'BaseFeePerGas' - if len(e.BaseFeePerGas) != 32 { - err = ssz.ErrBytesLength + if size := len(e.BaseFeePerGas); size != 32 { + err = ssz.ErrBytesLengthFn("--.BaseFeePerGas", size, 32) return } hh.PutBytes(e.BaseFeePerGas) // Field (12) 'BlockHash' - if len(e.BlockHash) != 32 { - err = ssz.ErrBytesLength + if size := len(e.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) return } hh.PutBytes(e.BlockHash) @@ -406,43 +406,43 @@ func (e *ExecutionPayloadHeader) MarshalSSZTo(buf []byte) (dst []byte, err error offset := int(536) // Field (0) 'ParentHash' - if len(e.ParentHash) != 32 { - err = ssz.ErrBytesLength + if size := len(e.ParentHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) return } dst = append(dst, e.ParentHash...) // Field (1) 'FeeRecipient' - if len(e.FeeRecipient) != 20 { - err = ssz.ErrBytesLength + if size := len(e.FeeRecipient); size != 20 { + err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) return } dst = append(dst, e.FeeRecipient...) // Field (2) 'StateRoot' - if len(e.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(e.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, e.StateRoot...) // Field (3) 'ReceiptsRoot' - if len(e.ReceiptsRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(e.ReceiptsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ReceiptsRoot", size, 32) return } dst = append(dst, e.ReceiptsRoot...) // Field (4) 'LogsBloom' - if len(e.LogsBloom) != 256 { - err = ssz.ErrBytesLength + if size := len(e.LogsBloom); size != 256 { + err = ssz.ErrBytesLengthFn("--.LogsBloom", size, 256) return } dst = append(dst, e.LogsBloom...) // Field (5) 'PrevRandao' - if len(e.PrevRandao) != 32 { - err = ssz.ErrBytesLength + if size := len(e.PrevRandao); size != 32 { + err = ssz.ErrBytesLengthFn("--.PrevRandao", size, 32) return } dst = append(dst, e.PrevRandao...) @@ -464,29 +464,29 @@ func (e *ExecutionPayloadHeader) MarshalSSZTo(buf []byte) (dst []byte, err error offset += len(e.ExtraData) // Field (11) 'BaseFeePerGas' - if len(e.BaseFeePerGas) != 32 { - err = ssz.ErrBytesLength + if size := len(e.BaseFeePerGas); size != 32 { + err = ssz.ErrBytesLengthFn("--.BaseFeePerGas", size, 32) return } dst = append(dst, e.BaseFeePerGas...) // Field (12) 'BlockHash' - if len(e.BlockHash) != 32 { - err = ssz.ErrBytesLength + if size := len(e.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) return } dst = append(dst, e.BlockHash...) // Field (13) 'TransactionsRoot' - if len(e.TransactionsRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(e.TransactionsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.TransactionsRoot", size, 32) return } dst = append(dst, e.TransactionsRoot...) // Field (10) 'ExtraData' - if len(e.ExtraData) > 32 { - err = ssz.ErrBytesLength + if size := len(e.ExtraData); size > 32 { + err = ssz.ErrBytesLengthFn("--.ExtraData", size, 32) return } dst = append(dst, e.ExtraData...) @@ -614,43 +614,43 @@ func (e *ExecutionPayloadHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'ParentHash' - if len(e.ParentHash) != 32 { - err = ssz.ErrBytesLength + if size := len(e.ParentHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) return } hh.PutBytes(e.ParentHash) // Field (1) 'FeeRecipient' - if len(e.FeeRecipient) != 20 { - err = ssz.ErrBytesLength + if size := len(e.FeeRecipient); size != 20 { + err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) return } hh.PutBytes(e.FeeRecipient) // Field (2) 'StateRoot' - if len(e.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(e.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(e.StateRoot) // Field (3) 'ReceiptsRoot' - if len(e.ReceiptsRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(e.ReceiptsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ReceiptsRoot", size, 32) return } hh.PutBytes(e.ReceiptsRoot) // Field (4) 'LogsBloom' - if len(e.LogsBloom) != 256 { - err = ssz.ErrBytesLength + if size := len(e.LogsBloom); size != 256 { + err = ssz.ErrBytesLengthFn("--.LogsBloom", size, 256) return } hh.PutBytes(e.LogsBloom) // Field (5) 'PrevRandao' - if len(e.PrevRandao) != 32 { - err = ssz.ErrBytesLength + if size := len(e.PrevRandao); size != 32 { + err = ssz.ErrBytesLengthFn("--.PrevRandao", size, 32) return } hh.PutBytes(e.PrevRandao) @@ -684,22 +684,22 @@ func (e *ExecutionPayloadHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (11) 'BaseFeePerGas' - if len(e.BaseFeePerGas) != 32 { - err = ssz.ErrBytesLength + if size := len(e.BaseFeePerGas); size != 32 { + err = ssz.ErrBytesLengthFn("--.BaseFeePerGas", size, 32) return } hh.PutBytes(e.BaseFeePerGas) // Field (12) 'BlockHash' - if len(e.BlockHash) != 32 { - err = ssz.ErrBytesLength + if size := len(e.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) return } hh.PutBytes(e.BlockHash) // Field (13) 'TransactionsRoot' - if len(e.TransactionsRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(e.TransactionsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.TransactionsRoot", size, 32) return } hh.PutBytes(e.TransactionsRoot) diff --git a/proto/eth/v1/generated.ssz.go b/proto/eth/v1/generated.ssz.go index f7f9389c1..753e9c80a 100644 --- a/proto/eth/v1/generated.ssz.go +++ b/proto/eth/v1/generated.ssz.go @@ -30,15 +30,15 @@ func (a *Attestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (2) 'Signature' - if len(a.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(a.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, a.Signature...) // Field (0) 'AggregationBits' - if len(a.AggregationBits) > 2048 { - err = ssz.ErrBytesLength + if size := len(a.AggregationBits); size > 2048 { + err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 2048) return } dst = append(dst, a.AggregationBits...) @@ -126,8 +126,8 @@ func (a *Attestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (2) 'Signature' - if len(a.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(a.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(a.Signature) @@ -161,8 +161,8 @@ func (a *AggregateAttestationAndProof) MarshalSSZTo(buf []byte) (dst []byte, err offset += a.Aggregate.SizeSSZ() // Field (2) 'SelectionProof' - if len(a.SelectionProof) != 96 { - err = ssz.ErrBytesLength + if size := len(a.SelectionProof); size != 96 { + err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) return } dst = append(dst, a.SelectionProof...) @@ -248,8 +248,8 @@ func (a *AggregateAttestationAndProof) HashTreeRootWith(hh *ssz.Hasher) (err err } // Field (2) 'SelectionProof' - if len(a.SelectionProof) != 96 { - err = ssz.ErrBytesLength + if size := len(a.SelectionProof); size != 96 { + err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) return } hh.PutBytes(a.SelectionProof) @@ -280,8 +280,8 @@ func (s *SignedAggregateAttestationAndProof) MarshalSSZTo(buf []byte) (dst []byt offset += s.Message.SizeSSZ() // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) @@ -361,8 +361,8 @@ func (s *SignedAggregateAttestationAndProof) HashTreeRootWith(hh *ssz.Hasher) (e } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(s.Signature) @@ -391,8 +391,8 @@ func (a *AttestationData) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, uint64(a.Index)) // Field (2) 'BeaconBlockRoot' - if len(a.BeaconBlockRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(a.BeaconBlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) return } dst = append(dst, a.BeaconBlockRoot...) @@ -477,8 +477,8 @@ func (a *AttestationData) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(uint64(a.Index)) // Field (2) 'BeaconBlockRoot' - if len(a.BeaconBlockRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(a.BeaconBlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) return } hh.PutBytes(a.BeaconBlockRoot) @@ -514,8 +514,8 @@ func (c *Checkpoint) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, uint64(c.Epoch)) // Field (1) 'Root' - if len(c.Root) != 32 { - err = ssz.ErrBytesLength + if size := len(c.Root); size != 32 { + err = ssz.ErrBytesLengthFn("--.Root", size, 32) return } dst = append(dst, c.Root...) @@ -562,8 +562,8 @@ func (c *Checkpoint) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(uint64(c.Epoch)) // Field (1) 'Root' - if len(c.Root) != 32 { - err = ssz.ErrBytesLength + if size := len(c.Root); size != 32 { + err = ssz.ErrBytesLengthFn("--.Root", size, 32) return } hh.PutBytes(c.Root) @@ -593,15 +593,15 @@ func (b *BeaconBlock) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } dst = append(dst, b.ParentRoot...) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, b.StateRoot...) @@ -701,15 +701,15 @@ func (b *BeaconBlock) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } hh.PutBytes(b.ParentRoot) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(b.StateRoot) @@ -745,8 +745,8 @@ func (s *SignedBeaconBlock) MarshalSSZTo(buf []byte) (dst []byte, err error) { offset += s.Block.SizeSSZ() // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) @@ -826,8 +826,8 @@ func (s *SignedBeaconBlock) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(s.Signature) @@ -851,8 +851,8 @@ func (b *BeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error) { offset := int(220) // Field (0) 'RandaoReveal' - if len(b.RandaoReveal) != 96 { - err = ssz.ErrBytesLength + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } dst = append(dst, b.RandaoReveal...) @@ -866,8 +866,8 @@ func (b *BeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (2) 'Graffiti' - if len(b.Graffiti) != 32 { - err = ssz.ErrBytesLength + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } dst = append(dst, b.Graffiti...) @@ -899,8 +899,8 @@ func (b *BeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error) { offset += len(b.VoluntaryExits) * 112 // Field (3) 'ProposerSlashings' - if len(b.ProposerSlashings) > 16 { - err = ssz.ErrListTooBig + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) return } for ii := 0; ii < len(b.ProposerSlashings); ii++ { @@ -910,8 +910,8 @@ func (b *BeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (4) 'AttesterSlashings' - if len(b.AttesterSlashings) > 2 { - err = ssz.ErrListTooBig + if size := len(b.AttesterSlashings); size > 2 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) return } { @@ -928,8 +928,8 @@ func (b *BeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (5) 'Attestations' - if len(b.Attestations) > 128 { - err = ssz.ErrListTooBig + if size := len(b.Attestations); size > 128 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 128) return } { @@ -946,8 +946,8 @@ func (b *BeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (6) 'Deposits' - if len(b.Deposits) > 16 { - err = ssz.ErrListTooBig + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) return } for ii := 0; ii < len(b.Deposits); ii++ { @@ -957,8 +957,8 @@ func (b *BeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (7) 'VoluntaryExits' - if len(b.VoluntaryExits) > 16 { - err = ssz.ErrListTooBig + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) return } for ii := 0; ii < len(b.VoluntaryExits); ii++ { @@ -1168,8 +1168,8 @@ func (b *BeaconBlockBody) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'RandaoReveal' - if len(b.RandaoReveal) != 96 { - err = ssz.ErrBytesLength + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } hh.PutBytes(b.RandaoReveal) @@ -1180,8 +1180,8 @@ func (b *BeaconBlockBody) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (2) 'Graffiti' - if len(b.Graffiti) != 32 { - err = ssz.ErrBytesLength + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } hh.PutBytes(b.Graffiti) @@ -1524,13 +1524,13 @@ func (d *Deposit) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'Proof' - if len(d.Proof) != 33 { - err = ssz.ErrVectorLength + if size := len(d.Proof); size != 33 { + err = ssz.ErrVectorLengthFn("--.Proof", size, 33) return } for ii := 0; ii < 33; ii++ { - if len(d.Proof[ii]) != 32 { - err = ssz.ErrBytesLength + if size := len(d.Proof[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.Proof[ii]", size, 32) return } dst = append(dst, d.Proof[ii]...) @@ -1592,8 +1592,8 @@ func (d *Deposit) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (0) 'Proof' { - if len(d.Proof) != 33 { - err = ssz.ErrVectorLength + if size := len(d.Proof); size != 33 { + err = ssz.ErrVectorLengthFn("--.Proof", size, 33) return } subIndx := hh.Index() @@ -1707,8 +1707,8 @@ func (s *SignedVoluntaryExit) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) @@ -1762,8 +1762,8 @@ func (s *SignedVoluntaryExit) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(s.Signature) @@ -1786,8 +1786,8 @@ func (e *Eth1Data) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'DepositRoot' - if len(e.DepositRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(e.DepositRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.DepositRoot", size, 32) return } dst = append(dst, e.DepositRoot...) @@ -1796,8 +1796,8 @@ func (e *Eth1Data) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, e.DepositCount) // Field (2) 'BlockHash' - if len(e.BlockHash) != 32 { - err = ssz.ErrBytesLength + if size := len(e.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) return } dst = append(dst, e.BlockHash...) @@ -1847,8 +1847,8 @@ func (e *Eth1Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'DepositRoot' - if len(e.DepositRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(e.DepositRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.DepositRoot", size, 32) return } hh.PutBytes(e.DepositRoot) @@ -1857,8 +1857,8 @@ func (e *Eth1Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(e.DepositCount) // Field (2) 'BlockHash' - if len(e.BlockHash) != 32 { - err = ssz.ErrBytesLength + if size := len(e.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) return } hh.PutBytes(e.BlockHash) @@ -1887,22 +1887,22 @@ func (b *BeaconBlockHeader) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } dst = append(dst, b.ParentRoot...) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, b.StateRoot...) // Field (4) 'BodyRoot' - if len(b.BodyRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.BodyRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BodyRoot", size, 32) return } dst = append(dst, b.BodyRoot...) @@ -1967,22 +1967,22 @@ func (b *BeaconBlockHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } hh.PutBytes(b.ParentRoot) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(b.StateRoot) // Field (4) 'BodyRoot' - if len(b.BodyRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.BodyRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BodyRoot", size, 32) return } hh.PutBytes(b.BodyRoot) @@ -2013,8 +2013,8 @@ func (s *SignedBeaconBlockHeader) MarshalSSZTo(buf []byte) (dst []byte, err erro } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) @@ -2068,8 +2068,8 @@ func (s *SignedBeaconBlockHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(s.Signature) @@ -2105,15 +2105,15 @@ func (i *IndexedAttestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (2) 'Signature' - if len(i.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(i.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, i.Signature...) // Field (0) 'AttestingIndices' - if len(i.AttestingIndices) > 2048 { - err = ssz.ErrListTooBig + if size := len(i.AttestingIndices); size > 2048 { + err = ssz.ErrListTooBigFn("--.AttestingIndices", size, 2048) return } for ii := 0; ii < len(i.AttestingIndices); ii++ { @@ -2193,8 +2193,8 @@ func (i *IndexedAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (0) 'AttestingIndices' { - if len(i.AttestingIndices) > 2048 { - err = ssz.ErrListTooBig + if size := len(i.AttestingIndices); size > 2048 { + err = ssz.ErrListTooBigFn("--.AttestingIndices", size, 2048) return } subIndx := hh.Index() @@ -2217,8 +2217,8 @@ func (i *IndexedAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (2) 'Signature' - if len(i.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(i.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(i.Signature) @@ -2241,15 +2241,15 @@ func (s *SyncAggregate) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'SyncCommitteeBits' - if len(s.SyncCommitteeBits) != 64 { - err = ssz.ErrBytesLength + if size := len(s.SyncCommitteeBits); size != 64 { + err = ssz.ErrBytesLengthFn("--.SyncCommitteeBits", size, 64) return } dst = append(dst, s.SyncCommitteeBits...) // Field (1) 'SyncCommitteeSignature' - if len(s.SyncCommitteeSignature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.SyncCommitteeSignature); size != 96 { + err = ssz.ErrBytesLengthFn("--.SyncCommitteeSignature", size, 96) return } dst = append(dst, s.SyncCommitteeSignature...) @@ -2296,15 +2296,15 @@ func (s *SyncAggregate) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'SyncCommitteeBits' - if len(s.SyncCommitteeBits) != 64 { - err = ssz.ErrBytesLength + if size := len(s.SyncCommitteeBits); size != 64 { + err = ssz.ErrBytesLengthFn("--.SyncCommitteeBits", size, 64) return } hh.PutBytes(s.SyncCommitteeBits) // Field (1) 'SyncCommitteeSignature' - if len(s.SyncCommitteeSignature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.SyncCommitteeSignature); size != 96 { + err = ssz.ErrBytesLengthFn("--.SyncCommitteeSignature", size, 96) return } hh.PutBytes(s.SyncCommitteeSignature) @@ -2327,15 +2327,15 @@ func (d *Deposit_Data) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'Pubkey' - if len(d.Pubkey) != 48 { - err = ssz.ErrBytesLength + if size := len(d.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) return } dst = append(dst, d.Pubkey...) // Field (1) 'WithdrawalCredentials' - if len(d.WithdrawalCredentials) != 32 { - err = ssz.ErrBytesLength + if size := len(d.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) return } dst = append(dst, d.WithdrawalCredentials...) @@ -2344,8 +2344,8 @@ func (d *Deposit_Data) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, d.Amount) // Field (3) 'Signature' - if len(d.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(d.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, d.Signature...) @@ -2401,15 +2401,15 @@ func (d *Deposit_Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'Pubkey' - if len(d.Pubkey) != 48 { - err = ssz.ErrBytesLength + if size := len(d.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) return } hh.PutBytes(d.Pubkey) // Field (1) 'WithdrawalCredentials' - if len(d.WithdrawalCredentials) != 32 { - err = ssz.ErrBytesLength + if size := len(d.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) return } hh.PutBytes(d.WithdrawalCredentials) @@ -2418,8 +2418,8 @@ func (d *Deposit_Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(d.Amount) // Field (3) 'Signature' - if len(d.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(d.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(d.Signature) @@ -2442,15 +2442,15 @@ func (v *Validator) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'Pubkey' - if len(v.Pubkey) != 48 { - err = ssz.ErrBytesLength + if size := len(v.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) return } dst = append(dst, v.Pubkey...) // Field (1) 'WithdrawalCredentials' - if len(v.WithdrawalCredentials) != 32 { - err = ssz.ErrBytesLength + if size := len(v.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) return } dst = append(dst, v.WithdrawalCredentials...) @@ -2533,15 +2533,15 @@ func (v *Validator) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'Pubkey' - if len(v.Pubkey) != 48 { - err = ssz.ErrBytesLength + if size := len(v.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) return } hh.PutBytes(v.Pubkey) // Field (1) 'WithdrawalCredentials' - if len(v.WithdrawalCredentials) != 32 { - err = ssz.ErrBytesLength + if size := len(v.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) return } hh.PutBytes(v.WithdrawalCredentials) diff --git a/proto/eth/v2/generated.ssz.go b/proto/eth/v2/generated.ssz.go index 69137cd83..99da4c000 100644 --- a/proto/eth/v2/generated.ssz.go +++ b/proto/eth/v2/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 16637c49444f2c3a90bcc4587dfbc26b39f45c26129de7d43fea32a2bcf8441e +// Hash: 041d5d528e07bf99188c39100dc83a4e6ba1f1d4cd190c46fcf27af4ca367fda package eth import ( @@ -27,8 +27,8 @@ func (s *SignedBeaconBlockBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err e offset += s.Message.SizeSSZ() // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) @@ -108,8 +108,8 @@ func (s *SignedBeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(s.Signature) @@ -140,8 +140,8 @@ func (s *SignedBlindedBeaconBlockBellatrix) MarshalSSZTo(buf []byte) (dst []byte offset += s.Message.SizeSSZ() // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) @@ -221,8 +221,8 @@ func (s *SignedBlindedBeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (er } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(s.Signature) @@ -253,8 +253,8 @@ func (s *SignedBeaconBlockAltair) MarshalSSZTo(buf []byte) (dst []byte, err erro offset += s.Message.SizeSSZ() // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) @@ -334,8 +334,8 @@ func (s *SignedBeaconBlockAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(s.Signature) @@ -365,15 +365,15 @@ func (b *BeaconBlockBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } dst = append(dst, b.ParentRoot...) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, b.StateRoot...) @@ -473,15 +473,15 @@ func (b *BeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } hh.PutBytes(b.ParentRoot) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(b.StateRoot) @@ -516,15 +516,15 @@ func (b *BlindedBeaconBlockBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } dst = append(dst, b.ParentRoot...) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, b.StateRoot...) @@ -624,15 +624,15 @@ func (b *BlindedBeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err erro hh.PutUint64(uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } hh.PutBytes(b.ParentRoot) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(b.StateRoot) @@ -667,15 +667,15 @@ func (b *BeaconBlockAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } dst = append(dst, b.ParentRoot...) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, b.StateRoot...) @@ -775,15 +775,15 @@ func (b *BeaconBlockAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } hh.PutBytes(b.ParentRoot) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(b.StateRoot) @@ -812,8 +812,8 @@ func (b *BeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err err offset := int(384) // Field (0) 'RandaoReveal' - if len(b.RandaoReveal) != 96 { - err = ssz.ErrBytesLength + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } dst = append(dst, b.RandaoReveal...) @@ -827,8 +827,8 @@ func (b *BeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err err } // Field (2) 'Graffiti' - if len(b.Graffiti) != 32 { - err = ssz.ErrBytesLength + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } dst = append(dst, b.Graffiti...) @@ -875,8 +875,8 @@ func (b *BeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err err offset += b.ExecutionPayload.SizeSSZ() // Field (3) 'ProposerSlashings' - if len(b.ProposerSlashings) > 16 { - err = ssz.ErrListTooBig + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) return } for ii := 0; ii < len(b.ProposerSlashings); ii++ { @@ -886,8 +886,8 @@ func (b *BeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err err } // Field (4) 'AttesterSlashings' - if len(b.AttesterSlashings) > 2 { - err = ssz.ErrListTooBig + if size := len(b.AttesterSlashings); size > 2 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) return } { @@ -904,8 +904,8 @@ func (b *BeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err err } // Field (5) 'Attestations' - if len(b.Attestations) > 128 { - err = ssz.ErrListTooBig + if size := len(b.Attestations); size > 128 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 128) return } { @@ -922,8 +922,8 @@ func (b *BeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err err } // Field (6) 'Deposits' - if len(b.Deposits) > 16 { - err = ssz.ErrListTooBig + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) return } for ii := 0; ii < len(b.Deposits); ii++ { @@ -933,8 +933,8 @@ func (b *BeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err err } // Field (7) 'VoluntaryExits' - if len(b.VoluntaryExits) > 16 { - err = ssz.ErrListTooBig + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) return } for ii := 0; ii < len(b.VoluntaryExits); ii++ { @@ -1179,8 +1179,8 @@ func (b *BeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) indx := hh.Index() // Field (0) 'RandaoReveal' - if len(b.RandaoReveal) != 96 { - err = ssz.ErrBytesLength + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } hh.PutBytes(b.RandaoReveal) @@ -1191,8 +1191,8 @@ func (b *BeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) } // Field (2) 'Graffiti' - if len(b.Graffiti) != 32 { - err = ssz.ErrBytesLength + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } hh.PutBytes(b.Graffiti) @@ -1326,8 +1326,8 @@ func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, offset := int(384) // Field (0) 'RandaoReveal' - if len(b.RandaoReveal) != 96 { - err = ssz.ErrBytesLength + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } dst = append(dst, b.RandaoReveal...) @@ -1341,8 +1341,8 @@ func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, } // Field (2) 'Graffiti' - if len(b.Graffiti) != 32 { - err = ssz.ErrBytesLength + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } dst = append(dst, b.Graffiti...) @@ -1389,8 +1389,8 @@ func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, offset += b.ExecutionPayloadHeader.SizeSSZ() // Field (3) 'ProposerSlashings' - if len(b.ProposerSlashings) > 16 { - err = ssz.ErrListTooBig + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) return } for ii := 0; ii < len(b.ProposerSlashings); ii++ { @@ -1400,8 +1400,8 @@ func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, } // Field (4) 'AttesterSlashings' - if len(b.AttesterSlashings) > 2 { - err = ssz.ErrListTooBig + if size := len(b.AttesterSlashings); size > 2 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) return } { @@ -1418,8 +1418,8 @@ func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, } // Field (5) 'Attestations' - if len(b.Attestations) > 128 { - err = ssz.ErrListTooBig + if size := len(b.Attestations); size > 128 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 128) return } { @@ -1436,8 +1436,8 @@ func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, } // Field (6) 'Deposits' - if len(b.Deposits) > 16 { - err = ssz.ErrListTooBig + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) return } for ii := 0; ii < len(b.Deposits); ii++ { @@ -1447,8 +1447,8 @@ func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, } // Field (7) 'VoluntaryExits' - if len(b.VoluntaryExits) > 16 { - err = ssz.ErrListTooBig + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) return } for ii := 0; ii < len(b.VoluntaryExits); ii++ { @@ -1693,8 +1693,8 @@ func (b *BlindedBeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err indx := hh.Index() // Field (0) 'RandaoReveal' - if len(b.RandaoReveal) != 96 { - err = ssz.ErrBytesLength + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } hh.PutBytes(b.RandaoReveal) @@ -1705,8 +1705,8 @@ func (b *BlindedBeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err } // Field (2) 'Graffiti' - if len(b.Graffiti) != 32 { - err = ssz.ErrBytesLength + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } hh.PutBytes(b.Graffiti) @@ -1840,8 +1840,8 @@ func (b *BeaconBlockBodyAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) offset := int(380) // Field (0) 'RandaoReveal' - if len(b.RandaoReveal) != 96 { - err = ssz.ErrBytesLength + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } dst = append(dst, b.RandaoReveal...) @@ -1855,8 +1855,8 @@ func (b *BeaconBlockBodyAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) } // Field (2) 'Graffiti' - if len(b.Graffiti) != 32 { - err = ssz.ErrBytesLength + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } dst = append(dst, b.Graffiti...) @@ -1896,8 +1896,8 @@ func (b *BeaconBlockBodyAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) } // Field (3) 'ProposerSlashings' - if len(b.ProposerSlashings) > 16 { - err = ssz.ErrListTooBig + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) return } for ii := 0; ii < len(b.ProposerSlashings); ii++ { @@ -1907,8 +1907,8 @@ func (b *BeaconBlockBodyAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) } // Field (4) 'AttesterSlashings' - if len(b.AttesterSlashings) > 2 { - err = ssz.ErrListTooBig + if size := len(b.AttesterSlashings); size > 2 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) return } { @@ -1925,8 +1925,8 @@ func (b *BeaconBlockBodyAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) } // Field (5) 'Attestations' - if len(b.Attestations) > 128 { - err = ssz.ErrListTooBig + if size := len(b.Attestations); size > 128 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 128) return } { @@ -1943,8 +1943,8 @@ func (b *BeaconBlockBodyAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) } // Field (6) 'Deposits' - if len(b.Deposits) > 16 { - err = ssz.ErrListTooBig + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) return } for ii := 0; ii < len(b.Deposits); ii++ { @@ -1954,8 +1954,8 @@ func (b *BeaconBlockBodyAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) } // Field (7) 'VoluntaryExits' - if len(b.VoluntaryExits) > 16 { - err = ssz.ErrListTooBig + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) return } for ii := 0; ii < len(b.VoluntaryExits); ii++ { @@ -2173,8 +2173,8 @@ func (b *BeaconBlockBodyAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'RandaoReveal' - if len(b.RandaoReveal) != 96 { - err = ssz.ErrBytesLength + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } hh.PutBytes(b.RandaoReveal) @@ -2185,8 +2185,8 @@ func (b *BeaconBlockBodyAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (2) 'Graffiti' - if len(b.Graffiti) != 32 { - err = ssz.ErrBytesLength + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } hh.PutBytes(b.Graffiti) diff --git a/proto/prysm/v1alpha1/generated.ssz.go b/proto/prysm/v1alpha1/generated.ssz.go index eda9a258e..e31f28c1d 100644 --- a/proto/prysm/v1alpha1/generated.ssz.go +++ b/proto/prysm/v1alpha1/generated.ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 8fccd7d168be3f17ebbd22a59aa2b5e3e7c79ef423f62adf168798663f7f382e +// Hash: 6da179429d9bb3146b40fa8cc4b1d5d82ed937e745d956c5228c28083fc40ecc package eth import ( @@ -31,15 +31,15 @@ func (a *Attestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (2) 'Signature' - if len(a.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(a.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, a.Signature...) // Field (0) 'AggregationBits' - if len(a.AggregationBits) > 2048 { - err = ssz.ErrBytesLength + if size := len(a.AggregationBits); size > 2048 { + err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 2048) return } dst = append(dst, a.AggregationBits...) @@ -127,8 +127,8 @@ func (a *Attestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (2) 'Signature' - if len(a.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(a.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(a.Signature) @@ -162,8 +162,8 @@ func (a *AggregateAttestationAndProof) MarshalSSZTo(buf []byte) (dst []byte, err offset += a.Aggregate.SizeSSZ() // Field (2) 'SelectionProof' - if len(a.SelectionProof) != 96 { - err = ssz.ErrBytesLength + if size := len(a.SelectionProof); size != 96 { + err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) return } dst = append(dst, a.SelectionProof...) @@ -249,8 +249,8 @@ func (a *AggregateAttestationAndProof) HashTreeRootWith(hh *ssz.Hasher) (err err } // Field (2) 'SelectionProof' - if len(a.SelectionProof) != 96 { - err = ssz.ErrBytesLength + if size := len(a.SelectionProof); size != 96 { + err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) return } hh.PutBytes(a.SelectionProof) @@ -281,8 +281,8 @@ func (s *SignedAggregateAttestationAndProof) MarshalSSZTo(buf []byte) (dst []byt offset += s.Message.SizeSSZ() // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) @@ -362,8 +362,8 @@ func (s *SignedAggregateAttestationAndProof) HashTreeRootWith(hh *ssz.Hasher) (e } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(s.Signature) @@ -392,8 +392,8 @@ func (a *AttestationData) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, uint64(a.CommitteeIndex)) // Field (2) 'BeaconBlockRoot' - if len(a.BeaconBlockRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(a.BeaconBlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) return } dst = append(dst, a.BeaconBlockRoot...) @@ -478,8 +478,8 @@ func (a *AttestationData) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(uint64(a.CommitteeIndex)) // Field (2) 'BeaconBlockRoot' - if len(a.BeaconBlockRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(a.BeaconBlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32) return } hh.PutBytes(a.BeaconBlockRoot) @@ -515,8 +515,8 @@ func (c *Checkpoint) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, uint64(c.Epoch)) // Field (1) 'Root' - if len(c.Root) != 32 { - err = ssz.ErrBytesLength + if size := len(c.Root); size != 32 { + err = ssz.ErrBytesLengthFn("--.Root", size, 32) return } dst = append(dst, c.Root...) @@ -563,8 +563,8 @@ func (c *Checkpoint) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(uint64(c.Epoch)) // Field (1) 'Root' - if len(c.Root) != 32 { - err = ssz.ErrBytesLength + if size := len(c.Root); size != 32 { + err = ssz.ErrBytesLengthFn("--.Root", size, 32) return } hh.PutBytes(c.Root) @@ -594,15 +594,15 @@ func (b *BeaconBlock) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } dst = append(dst, b.ParentRoot...) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, b.StateRoot...) @@ -702,15 +702,15 @@ func (b *BeaconBlock) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } hh.PutBytes(b.ParentRoot) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(b.StateRoot) @@ -746,8 +746,8 @@ func (s *SignedBeaconBlock) MarshalSSZTo(buf []byte) (dst []byte, err error) { offset += s.Block.SizeSSZ() // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) @@ -827,8 +827,8 @@ func (s *SignedBeaconBlock) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(s.Signature) @@ -858,15 +858,15 @@ func (b *BeaconBlockAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } dst = append(dst, b.ParentRoot...) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, b.StateRoot...) @@ -966,15 +966,15 @@ func (b *BeaconBlockAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } hh.PutBytes(b.ParentRoot) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(b.StateRoot) @@ -1010,8 +1010,8 @@ func (s *SignedBeaconBlockAltair) MarshalSSZTo(buf []byte) (dst []byte, err erro offset += s.Block.SizeSSZ() // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) @@ -1091,8 +1091,8 @@ func (s *SignedBeaconBlockAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(s.Signature) @@ -1116,8 +1116,8 @@ func (b *BeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error) { offset := int(220) // Field (0) 'RandaoReveal' - if len(b.RandaoReveal) != 96 { - err = ssz.ErrBytesLength + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } dst = append(dst, b.RandaoReveal...) @@ -1131,8 +1131,8 @@ func (b *BeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (2) 'Graffiti' - if len(b.Graffiti) != 32 { - err = ssz.ErrBytesLength + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } dst = append(dst, b.Graffiti...) @@ -1164,8 +1164,8 @@ func (b *BeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error) { offset += len(b.VoluntaryExits) * 112 // Field (3) 'ProposerSlashings' - if len(b.ProposerSlashings) > 16 { - err = ssz.ErrListTooBig + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) return } for ii := 0; ii < len(b.ProposerSlashings); ii++ { @@ -1175,8 +1175,8 @@ func (b *BeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (4) 'AttesterSlashings' - if len(b.AttesterSlashings) > 2 { - err = ssz.ErrListTooBig + if size := len(b.AttesterSlashings); size > 2 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) return } { @@ -1193,8 +1193,8 @@ func (b *BeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (5) 'Attestations' - if len(b.Attestations) > 128 { - err = ssz.ErrListTooBig + if size := len(b.Attestations); size > 128 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 128) return } { @@ -1211,8 +1211,8 @@ func (b *BeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (6) 'Deposits' - if len(b.Deposits) > 16 { - err = ssz.ErrListTooBig + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) return } for ii := 0; ii < len(b.Deposits); ii++ { @@ -1222,8 +1222,8 @@ func (b *BeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (7) 'VoluntaryExits' - if len(b.VoluntaryExits) > 16 { - err = ssz.ErrListTooBig + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) return } for ii := 0; ii < len(b.VoluntaryExits); ii++ { @@ -1433,8 +1433,8 @@ func (b *BeaconBlockBody) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'RandaoReveal' - if len(b.RandaoReveal) != 96 { - err = ssz.ErrBytesLength + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } hh.PutBytes(b.RandaoReveal) @@ -1445,8 +1445,8 @@ func (b *BeaconBlockBody) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (2) 'Graffiti' - if len(b.Graffiti) != 32 { - err = ssz.ErrBytesLength + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } hh.PutBytes(b.Graffiti) @@ -1570,8 +1570,8 @@ func (b *BeaconBlockBodyAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) offset := int(380) // Field (0) 'RandaoReveal' - if len(b.RandaoReveal) != 96 { - err = ssz.ErrBytesLength + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } dst = append(dst, b.RandaoReveal...) @@ -1585,8 +1585,8 @@ func (b *BeaconBlockBodyAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) } // Field (2) 'Graffiti' - if len(b.Graffiti) != 32 { - err = ssz.ErrBytesLength + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } dst = append(dst, b.Graffiti...) @@ -1626,8 +1626,8 @@ func (b *BeaconBlockBodyAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) } // Field (3) 'ProposerSlashings' - if len(b.ProposerSlashings) > 16 { - err = ssz.ErrListTooBig + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) return } for ii := 0; ii < len(b.ProposerSlashings); ii++ { @@ -1637,8 +1637,8 @@ func (b *BeaconBlockBodyAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) } // Field (4) 'AttesterSlashings' - if len(b.AttesterSlashings) > 2 { - err = ssz.ErrListTooBig + if size := len(b.AttesterSlashings); size > 2 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) return } { @@ -1655,8 +1655,8 @@ func (b *BeaconBlockBodyAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) } // Field (5) 'Attestations' - if len(b.Attestations) > 128 { - err = ssz.ErrListTooBig + if size := len(b.Attestations); size > 128 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 128) return } { @@ -1673,8 +1673,8 @@ func (b *BeaconBlockBodyAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) } // Field (6) 'Deposits' - if len(b.Deposits) > 16 { - err = ssz.ErrListTooBig + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) return } for ii := 0; ii < len(b.Deposits); ii++ { @@ -1684,8 +1684,8 @@ func (b *BeaconBlockBodyAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) } // Field (7) 'VoluntaryExits' - if len(b.VoluntaryExits) > 16 { - err = ssz.ErrListTooBig + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) return } for ii := 0; ii < len(b.VoluntaryExits); ii++ { @@ -1903,8 +1903,8 @@ func (b *BeaconBlockBodyAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'RandaoReveal' - if len(b.RandaoReveal) != 96 { - err = ssz.ErrBytesLength + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } hh.PutBytes(b.RandaoReveal) @@ -1915,8 +1915,8 @@ func (b *BeaconBlockBodyAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (2) 'Graffiti' - if len(b.Graffiti) != 32 { - err = ssz.ErrBytesLength + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } hh.PutBytes(b.Graffiti) @@ -2264,13 +2264,13 @@ func (d *Deposit) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'Proof' - if len(d.Proof) != 33 { - err = ssz.ErrVectorLength + if size := len(d.Proof); size != 33 { + err = ssz.ErrVectorLengthFn("--.Proof", size, 33) return } for ii := 0; ii < 33; ii++ { - if len(d.Proof[ii]) != 32 { - err = ssz.ErrBytesLength + if size := len(d.Proof[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.Proof[ii]", size, 32) return } dst = append(dst, d.Proof[ii]...) @@ -2332,8 +2332,8 @@ func (d *Deposit) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (0) 'Proof' { - if len(d.Proof) != 33 { - err = ssz.ErrVectorLength + if size := len(d.Proof); size != 33 { + err = ssz.ErrVectorLengthFn("--.Proof", size, 33) return } subIndx := hh.Index() @@ -2447,8 +2447,8 @@ func (s *SignedVoluntaryExit) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) @@ -2502,8 +2502,8 @@ func (s *SignedVoluntaryExit) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(s.Signature) @@ -2526,8 +2526,8 @@ func (e *Eth1Data) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'DepositRoot' - if len(e.DepositRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(e.DepositRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.DepositRoot", size, 32) return } dst = append(dst, e.DepositRoot...) @@ -2536,8 +2536,8 @@ func (e *Eth1Data) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, e.DepositCount) // Field (2) 'BlockHash' - if len(e.BlockHash) != 32 { - err = ssz.ErrBytesLength + if size := len(e.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) return } dst = append(dst, e.BlockHash...) @@ -2587,8 +2587,8 @@ func (e *Eth1Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'DepositRoot' - if len(e.DepositRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(e.DepositRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.DepositRoot", size, 32) return } hh.PutBytes(e.DepositRoot) @@ -2597,8 +2597,8 @@ func (e *Eth1Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(e.DepositCount) // Field (2) 'BlockHash' - if len(e.BlockHash) != 32 { - err = ssz.ErrBytesLength + if size := len(e.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) return } hh.PutBytes(e.BlockHash) @@ -2627,22 +2627,22 @@ func (b *BeaconBlockHeader) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } dst = append(dst, b.ParentRoot...) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, b.StateRoot...) // Field (4) 'BodyRoot' - if len(b.BodyRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.BodyRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BodyRoot", size, 32) return } dst = append(dst, b.BodyRoot...) @@ -2707,22 +2707,22 @@ func (b *BeaconBlockHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } hh.PutBytes(b.ParentRoot) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(b.StateRoot) // Field (4) 'BodyRoot' - if len(b.BodyRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.BodyRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BodyRoot", size, 32) return } hh.PutBytes(b.BodyRoot) @@ -2753,8 +2753,8 @@ func (s *SignedBeaconBlockHeader) MarshalSSZTo(buf []byte) (dst []byte, err erro } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) @@ -2808,8 +2808,8 @@ func (s *SignedBeaconBlockHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(s.Signature) @@ -2845,15 +2845,15 @@ func (i *IndexedAttestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (2) 'Signature' - if len(i.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(i.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, i.Signature...) // Field (0) 'AttestingIndices' - if len(i.AttestingIndices) > 2048 { - err = ssz.ErrListTooBig + if size := len(i.AttestingIndices); size > 2048 { + err = ssz.ErrListTooBigFn("--.AttestingIndices", size, 2048) return } for ii := 0; ii < len(i.AttestingIndices); ii++ { @@ -2933,8 +2933,8 @@ func (i *IndexedAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (0) 'AttestingIndices' { - if len(i.AttestingIndices) > 2048 { - err = ssz.ErrListTooBig + if size := len(i.AttestingIndices); size > 2048 { + err = ssz.ErrListTooBigFn("--.AttestingIndices", size, 2048) return } subIndx := hh.Index() @@ -2957,8 +2957,8 @@ func (i *IndexedAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (2) 'Signature' - if len(i.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(i.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(i.Signature) @@ -2981,15 +2981,15 @@ func (s *SyncAggregate) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'SyncCommitteeBits' - if len(s.SyncCommitteeBits) != 64 { - err = ssz.ErrBytesLength + if size := len(s.SyncCommitteeBits); size != 64 { + err = ssz.ErrBytesLengthFn("--.SyncCommitteeBits", size, 64) return } dst = append(dst, s.SyncCommitteeBits...) // Field (1) 'SyncCommitteeSignature' - if len(s.SyncCommitteeSignature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.SyncCommitteeSignature); size != 96 { + err = ssz.ErrBytesLengthFn("--.SyncCommitteeSignature", size, 96) return } dst = append(dst, s.SyncCommitteeSignature...) @@ -3036,15 +3036,15 @@ func (s *SyncAggregate) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'SyncCommitteeBits' - if len(s.SyncCommitteeBits) != 64 { - err = ssz.ErrBytesLength + if size := len(s.SyncCommitteeBits); size != 64 { + err = ssz.ErrBytesLengthFn("--.SyncCommitteeBits", size, 64) return } hh.PutBytes(s.SyncCommitteeBits) // Field (1) 'SyncCommitteeSignature' - if len(s.SyncCommitteeSignature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.SyncCommitteeSignature); size != 96 { + err = ssz.ErrBytesLengthFn("--.SyncCommitteeSignature", size, 96) return } hh.PutBytes(s.SyncCommitteeSignature) @@ -3075,8 +3075,8 @@ func (s *SignedBeaconBlockBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err e offset += s.Block.SizeSSZ() // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) @@ -3156,8 +3156,8 @@ func (s *SignedBeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(s.Signature) @@ -3187,15 +3187,15 @@ func (b *BeaconBlockBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } dst = append(dst, b.ParentRoot...) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, b.StateRoot...) @@ -3295,15 +3295,15 @@ func (b *BeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } hh.PutBytes(b.ParentRoot) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(b.StateRoot) @@ -3332,8 +3332,8 @@ func (b *BeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err err offset := int(384) // Field (0) 'RandaoReveal' - if len(b.RandaoReveal) != 96 { - err = ssz.ErrBytesLength + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } dst = append(dst, b.RandaoReveal...) @@ -3347,8 +3347,8 @@ func (b *BeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err err } // Field (2) 'Graffiti' - if len(b.Graffiti) != 32 { - err = ssz.ErrBytesLength + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } dst = append(dst, b.Graffiti...) @@ -3395,8 +3395,8 @@ func (b *BeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err err offset += b.ExecutionPayload.SizeSSZ() // Field (3) 'ProposerSlashings' - if len(b.ProposerSlashings) > 16 { - err = ssz.ErrListTooBig + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) return } for ii := 0; ii < len(b.ProposerSlashings); ii++ { @@ -3406,8 +3406,8 @@ func (b *BeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err err } // Field (4) 'AttesterSlashings' - if len(b.AttesterSlashings) > 2 { - err = ssz.ErrListTooBig + if size := len(b.AttesterSlashings); size > 2 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) return } { @@ -3424,8 +3424,8 @@ func (b *BeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err err } // Field (5) 'Attestations' - if len(b.Attestations) > 128 { - err = ssz.ErrListTooBig + if size := len(b.Attestations); size > 128 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 128) return } { @@ -3442,8 +3442,8 @@ func (b *BeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err err } // Field (6) 'Deposits' - if len(b.Deposits) > 16 { - err = ssz.ErrListTooBig + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) return } for ii := 0; ii < len(b.Deposits); ii++ { @@ -3453,8 +3453,8 @@ func (b *BeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err err } // Field (7) 'VoluntaryExits' - if len(b.VoluntaryExits) > 16 { - err = ssz.ErrListTooBig + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) return } for ii := 0; ii < len(b.VoluntaryExits); ii++ { @@ -3699,8 +3699,8 @@ func (b *BeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) indx := hh.Index() // Field (0) 'RandaoReveal' - if len(b.RandaoReveal) != 96 { - err = ssz.ErrBytesLength + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } hh.PutBytes(b.RandaoReveal) @@ -3711,8 +3711,8 @@ func (b *BeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) } // Field (2) 'Graffiti' - if len(b.Graffiti) != 32 { - err = ssz.ErrBytesLength + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } hh.PutBytes(b.Graffiti) @@ -3853,8 +3853,8 @@ func (s *SignedBlindedBeaconBlockBellatrix) MarshalSSZTo(buf []byte) (dst []byte offset += s.Block.SizeSSZ() // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) @@ -3934,8 +3934,8 @@ func (s *SignedBlindedBeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (er } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(s.Signature) @@ -3965,15 +3965,15 @@ func (b *BlindedBeaconBlockBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } dst = append(dst, b.ParentRoot...) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } dst = append(dst, b.StateRoot...) @@ -4073,15 +4073,15 @@ func (b *BlindedBeaconBlockBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err erro hh.PutUint64(uint64(b.ProposerIndex)) // Field (2) 'ParentRoot' - if len(b.ParentRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.ParentRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentRoot", size, 32) return } hh.PutBytes(b.ParentRoot) // Field (3) 'StateRoot' - if len(b.StateRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32) return } hh.PutBytes(b.StateRoot) @@ -4110,8 +4110,8 @@ func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, offset := int(384) // Field (0) 'RandaoReveal' - if len(b.RandaoReveal) != 96 { - err = ssz.ErrBytesLength + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } dst = append(dst, b.RandaoReveal...) @@ -4125,8 +4125,8 @@ func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, } // Field (2) 'Graffiti' - if len(b.Graffiti) != 32 { - err = ssz.ErrBytesLength + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } dst = append(dst, b.Graffiti...) @@ -4173,8 +4173,8 @@ func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, offset += b.ExecutionPayloadHeader.SizeSSZ() // Field (3) 'ProposerSlashings' - if len(b.ProposerSlashings) > 16 { - err = ssz.ErrListTooBig + if size := len(b.ProposerSlashings); size > 16 { + err = ssz.ErrListTooBigFn("--.ProposerSlashings", size, 16) return } for ii := 0; ii < len(b.ProposerSlashings); ii++ { @@ -4184,8 +4184,8 @@ func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, } // Field (4) 'AttesterSlashings' - if len(b.AttesterSlashings) > 2 { - err = ssz.ErrListTooBig + if size := len(b.AttesterSlashings); size > 2 { + err = ssz.ErrListTooBigFn("--.AttesterSlashings", size, 2) return } { @@ -4202,8 +4202,8 @@ func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, } // Field (5) 'Attestations' - if len(b.Attestations) > 128 { - err = ssz.ErrListTooBig + if size := len(b.Attestations); size > 128 { + err = ssz.ErrListTooBigFn("--.Attestations", size, 128) return } { @@ -4220,8 +4220,8 @@ func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, } // Field (6) 'Deposits' - if len(b.Deposits) > 16 { - err = ssz.ErrListTooBig + if size := len(b.Deposits); size > 16 { + err = ssz.ErrListTooBigFn("--.Deposits", size, 16) return } for ii := 0; ii < len(b.Deposits); ii++ { @@ -4231,8 +4231,8 @@ func (b *BlindedBeaconBlockBodyBellatrix) MarshalSSZTo(buf []byte) (dst []byte, } // Field (7) 'VoluntaryExits' - if len(b.VoluntaryExits) > 16 { - err = ssz.ErrListTooBig + if size := len(b.VoluntaryExits); size > 16 { + err = ssz.ErrListTooBigFn("--.VoluntaryExits", size, 16) return } for ii := 0; ii < len(b.VoluntaryExits); ii++ { @@ -4477,8 +4477,8 @@ func (b *BlindedBeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err indx := hh.Index() // Field (0) 'RandaoReveal' - if len(b.RandaoReveal) != 96 { - err = ssz.ErrBytesLength + if size := len(b.RandaoReveal); size != 96 { + err = ssz.ErrBytesLengthFn("--.RandaoReveal", size, 96) return } hh.PutBytes(b.RandaoReveal) @@ -4489,8 +4489,8 @@ func (b *BlindedBeaconBlockBodyBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err } // Field (2) 'Graffiti' - if len(b.Graffiti) != 32 { - err = ssz.ErrBytesLength + if size := len(b.Graffiti); size != 32 { + err = ssz.ErrBytesLengthFn("--.Graffiti", size, 32) return } hh.PutBytes(b.Graffiti) @@ -4623,8 +4623,8 @@ func (v *ValidatorRegistrationV1) MarshalSSZTo(buf []byte) (dst []byte, err erro dst = buf // Field (0) 'FeeRecipient' - if len(v.FeeRecipient) != 20 { - err = ssz.ErrBytesLength + if size := len(v.FeeRecipient); size != 20 { + err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) return } dst = append(dst, v.FeeRecipient...) @@ -4636,8 +4636,8 @@ func (v *ValidatorRegistrationV1) MarshalSSZTo(buf []byte) (dst []byte, err erro dst = ssz.MarshalUint64(dst, v.Timestamp) // Field (3) 'Pubkey' - if len(v.Pubkey) != 48 { - err = ssz.ErrBytesLength + if size := len(v.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) return } dst = append(dst, v.Pubkey...) @@ -4690,8 +4690,8 @@ func (v *ValidatorRegistrationV1) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'FeeRecipient' - if len(v.FeeRecipient) != 20 { - err = ssz.ErrBytesLength + if size := len(v.FeeRecipient); size != 20 { + err = ssz.ErrBytesLengthFn("--.FeeRecipient", size, 20) return } hh.PutBytes(v.FeeRecipient) @@ -4703,8 +4703,8 @@ func (v *ValidatorRegistrationV1) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(v.Timestamp) // Field (3) 'Pubkey' - if len(v.Pubkey) != 48 { - err = ssz.ErrBytesLength + if size := len(v.Pubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.Pubkey", size, 48) return } hh.PutBytes(v.Pubkey) @@ -4735,8 +4735,8 @@ func (s *SignedValidatorRegistrationV1) MarshalSSZTo(buf []byte) (dst []byte, er } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) @@ -4790,8 +4790,8 @@ func (s *SignedValidatorRegistrationV1) HashTreeRootWith(hh *ssz.Hasher) (err er } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(s.Signature) @@ -4814,15 +4814,15 @@ func (d *Deposit_Data) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'PublicKey' - if len(d.PublicKey) != 48 { - err = ssz.ErrBytesLength + if size := len(d.PublicKey); size != 48 { + err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) return } dst = append(dst, d.PublicKey...) // Field (1) 'WithdrawalCredentials' - if len(d.WithdrawalCredentials) != 32 { - err = ssz.ErrBytesLength + if size := len(d.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) return } dst = append(dst, d.WithdrawalCredentials...) @@ -4831,8 +4831,8 @@ func (d *Deposit_Data) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, d.Amount) // Field (3) 'Signature' - if len(d.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(d.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, d.Signature...) @@ -4888,15 +4888,15 @@ func (d *Deposit_Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'PublicKey' - if len(d.PublicKey) != 48 { - err = ssz.ErrBytesLength + if size := len(d.PublicKey); size != 48 { + err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) return } hh.PutBytes(d.PublicKey) // Field (1) 'WithdrawalCredentials' - if len(d.WithdrawalCredentials) != 32 { - err = ssz.ErrBytesLength + if size := len(d.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) return } hh.PutBytes(d.WithdrawalCredentials) @@ -4905,8 +4905,8 @@ func (d *Deposit_Data) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(d.Amount) // Field (3) 'Signature' - if len(d.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(d.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(d.Signature) @@ -4933,8 +4933,8 @@ func (b *BeaconState) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, b.GenesisTime) // Field (1) 'GenesisValidatorsRoot' - if len(b.GenesisValidatorsRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) return } dst = append(dst, b.GenesisValidatorsRoot...) @@ -4959,26 +4959,26 @@ func (b *BeaconState) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (5) 'BlockRoots' - if len(b.BlockRoots) != 8192 { - err = ssz.ErrVectorLength + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) return } for ii := 0; ii < 8192; ii++ { - if len(b.BlockRoots[ii]) != 32 { - err = ssz.ErrBytesLength + 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 len(b.StateRoots) != 8192 { - err = ssz.ErrVectorLength + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) return } for ii := 0; ii < 8192; ii++ { - if len(b.StateRoots[ii]) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) return } dst = append(dst, b.StateRoots[ii]...) @@ -5012,21 +5012,21 @@ func (b *BeaconState) MarshalSSZTo(buf []byte) (dst []byte, err error) { offset += len(b.Balances) * 8 // Field (13) 'RandaoMixes' - if len(b.RandaoMixes) != 65536 { - err = ssz.ErrVectorLength + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) return } for ii := 0; ii < 65536; ii++ { - if len(b.RandaoMixes[ii]) != 32 { - err = ssz.ErrBytesLength + 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 len(b.Slashings) != 8192 { - err = ssz.ErrVectorLength + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) return } for ii := 0; ii < 8192; ii++ { @@ -5048,8 +5048,8 @@ func (b *BeaconState) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (17) 'JustificationBits' - if len(b.JustificationBits) != 1 { - err = ssz.ErrBytesLength + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) return } dst = append(dst, b.JustificationBits...) @@ -5079,21 +5079,21 @@ func (b *BeaconState) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (7) 'HistoricalRoots' - if len(b.HistoricalRoots) > 16777216 { - err = ssz.ErrListTooBig + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) return } for ii := 0; ii < len(b.HistoricalRoots); ii++ { - if len(b.HistoricalRoots[ii]) != 32 { - err = ssz.ErrBytesLength + 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 len(b.Eth1DataVotes) > 2048 { - err = ssz.ErrListTooBig + if size := len(b.Eth1DataVotes); size > 2048 { + err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) return } for ii := 0; ii < len(b.Eth1DataVotes); ii++ { @@ -5103,8 +5103,8 @@ func (b *BeaconState) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (11) 'Validators' - if len(b.Validators) > 1099511627776 { - err = ssz.ErrListTooBig + if size := len(b.Validators); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) return } for ii := 0; ii < len(b.Validators); ii++ { @@ -5114,8 +5114,8 @@ func (b *BeaconState) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (12) 'Balances' - if len(b.Balances) > 1099511627776 { - err = ssz.ErrListTooBig + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) return } for ii := 0; ii < len(b.Balances); ii++ { @@ -5123,8 +5123,8 @@ func (b *BeaconState) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (15) 'PreviousEpochAttestations' - if len(b.PreviousEpochAttestations) > 4096 { - err = ssz.ErrListTooBig + if size := len(b.PreviousEpochAttestations); size > 4096 { + err = ssz.ErrListTooBigFn("--.PreviousEpochAttestations", size, 4096) return } { @@ -5141,8 +5141,8 @@ func (b *BeaconState) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (16) 'CurrentEpochAttestations' - if len(b.CurrentEpochAttestations) > 4096 { - err = ssz.ErrListTooBig + if size := len(b.CurrentEpochAttestations); size > 4096 { + err = ssz.ErrListTooBigFn("--.CurrentEpochAttestations", size, 4096) return } { @@ -5463,8 +5463,8 @@ func (b *BeaconState) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(b.GenesisTime) // Field (1) 'GenesisValidatorsRoot' - if len(b.GenesisValidatorsRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) return } hh.PutBytes(b.GenesisValidatorsRoot) @@ -5484,8 +5484,8 @@ func (b *BeaconState) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (5) 'BlockRoots' { - if len(b.BlockRoots) != 8192 { - err = ssz.ErrVectorLength + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) return } subIndx := hh.Index() @@ -5506,8 +5506,8 @@ func (b *BeaconState) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (6) 'StateRoots' { - if len(b.StateRoots) != 8192 { - err = ssz.ErrVectorLength + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) return } subIndx := hh.Index() @@ -5528,8 +5528,8 @@ func (b *BeaconState) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (7) 'HistoricalRoots' { - if len(b.HistoricalRoots) > 16777216 { - err = ssz.ErrListTooBig + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) return } subIndx := hh.Index() @@ -5599,8 +5599,8 @@ func (b *BeaconState) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (12) 'Balances' { - if len(b.Balances) > 1099511627776 { - err = ssz.ErrListTooBig + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) return } subIndx := hh.Index() @@ -5619,8 +5619,8 @@ func (b *BeaconState) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (13) 'RandaoMixes' { - if len(b.RandaoMixes) != 65536 { - err = ssz.ErrVectorLength + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) return } subIndx := hh.Index() @@ -5641,8 +5641,8 @@ func (b *BeaconState) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (14) 'Slashings' { - if len(b.Slashings) != 8192 { - err = ssz.ErrVectorLength + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) return } subIndx := hh.Index() @@ -5698,8 +5698,8 @@ func (b *BeaconState) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (17) 'JustificationBits' - if len(b.JustificationBits) != 1 { - err = ssz.ErrBytesLength + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) return } hh.PutBytes(b.JustificationBits) @@ -5741,8 +5741,8 @@ func (b *BeaconStateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, b.GenesisTime) // Field (1) 'GenesisValidatorsRoot' - if len(b.GenesisValidatorsRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) return } dst = append(dst, b.GenesisValidatorsRoot...) @@ -5767,26 +5767,26 @@ func (b *BeaconStateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (5) 'BlockRoots' - if len(b.BlockRoots) != 8192 { - err = ssz.ErrVectorLength + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) return } for ii := 0; ii < 8192; ii++ { - if len(b.BlockRoots[ii]) != 32 { - err = ssz.ErrBytesLength + 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 len(b.StateRoots) != 8192 { - err = ssz.ErrVectorLength + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) return } for ii := 0; ii < 8192; ii++ { - if len(b.StateRoots[ii]) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) return } dst = append(dst, b.StateRoots[ii]...) @@ -5820,21 +5820,21 @@ func (b *BeaconStateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { offset += len(b.Balances) * 8 // Field (13) 'RandaoMixes' - if len(b.RandaoMixes) != 65536 { - err = ssz.ErrVectorLength + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) return } for ii := 0; ii < 65536; ii++ { - if len(b.RandaoMixes[ii]) != 32 { - err = ssz.ErrBytesLength + 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 len(b.Slashings) != 8192 { - err = ssz.ErrVectorLength + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) return } for ii := 0; ii < 8192; ii++ { @@ -5850,8 +5850,8 @@ func (b *BeaconStateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { offset += len(b.CurrentEpochParticipation) // Field (17) 'JustificationBits' - if len(b.JustificationBits) != 1 { - err = ssz.ErrBytesLength + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) return } dst = append(dst, b.JustificationBits...) @@ -5901,21 +5901,21 @@ func (b *BeaconStateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (7) 'HistoricalRoots' - if len(b.HistoricalRoots) > 16777216 { - err = ssz.ErrListTooBig + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) return } for ii := 0; ii < len(b.HistoricalRoots); ii++ { - if len(b.HistoricalRoots[ii]) != 32 { - err = ssz.ErrBytesLength + 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 len(b.Eth1DataVotes) > 2048 { - err = ssz.ErrListTooBig + if size := len(b.Eth1DataVotes); size > 2048 { + err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) return } for ii := 0; ii < len(b.Eth1DataVotes); ii++ { @@ -5925,8 +5925,8 @@ func (b *BeaconStateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (11) 'Validators' - if len(b.Validators) > 1099511627776 { - err = ssz.ErrListTooBig + if size := len(b.Validators); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) return } for ii := 0; ii < len(b.Validators); ii++ { @@ -5936,8 +5936,8 @@ func (b *BeaconStateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (12) 'Balances' - if len(b.Balances) > 1099511627776 { - err = ssz.ErrListTooBig + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) return } for ii := 0; ii < len(b.Balances); ii++ { @@ -5945,22 +5945,22 @@ func (b *BeaconStateAltair) MarshalSSZTo(buf []byte) (dst []byte, err error) { } // Field (15) 'PreviousEpochParticipation' - if len(b.PreviousEpochParticipation) > 1099511627776 { - err = ssz.ErrBytesLength + if size := len(b.PreviousEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) return } dst = append(dst, b.PreviousEpochParticipation...) // Field (16) 'CurrentEpochParticipation' - if len(b.CurrentEpochParticipation) > 1099511627776 { - err = ssz.ErrBytesLength + if size := len(b.CurrentEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) return } dst = append(dst, b.CurrentEpochParticipation...) // Field (21) 'InactivityScores' - if len(b.InactivityScores) > 1099511627776 { - err = ssz.ErrListTooBig + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) return } for ii := 0; ii < len(b.InactivityScores); ii++ { @@ -6283,8 +6283,8 @@ func (b *BeaconStateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(b.GenesisTime) // Field (1) 'GenesisValidatorsRoot' - if len(b.GenesisValidatorsRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) return } hh.PutBytes(b.GenesisValidatorsRoot) @@ -6304,8 +6304,8 @@ func (b *BeaconStateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (5) 'BlockRoots' { - if len(b.BlockRoots) != 8192 { - err = ssz.ErrVectorLength + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) return } subIndx := hh.Index() @@ -6326,8 +6326,8 @@ func (b *BeaconStateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (6) 'StateRoots' { - if len(b.StateRoots) != 8192 { - err = ssz.ErrVectorLength + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) return } subIndx := hh.Index() @@ -6348,8 +6348,8 @@ func (b *BeaconStateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (7) 'HistoricalRoots' { - if len(b.HistoricalRoots) > 16777216 { - err = ssz.ErrListTooBig + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) return } subIndx := hh.Index() @@ -6419,8 +6419,8 @@ func (b *BeaconStateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (12) 'Balances' { - if len(b.Balances) > 1099511627776 { - err = ssz.ErrListTooBig + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) return } subIndx := hh.Index() @@ -6439,8 +6439,8 @@ func (b *BeaconStateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (13) 'RandaoMixes' { - if len(b.RandaoMixes) != 65536 { - err = ssz.ErrVectorLength + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) return } subIndx := hh.Index() @@ -6461,8 +6461,8 @@ func (b *BeaconStateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (14) 'Slashings' { - if len(b.Slashings) != 8192 { - err = ssz.ErrVectorLength + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) return } subIndx := hh.Index() @@ -6510,8 +6510,8 @@ func (b *BeaconStateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (17) 'JustificationBits' - if len(b.JustificationBits) != 1 { - err = ssz.ErrBytesLength + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) return } hh.PutBytes(b.JustificationBits) @@ -6533,8 +6533,8 @@ func (b *BeaconStateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (21) 'InactivityScores' { - if len(b.InactivityScores) > 1099511627776 { - err = ssz.ErrListTooBig + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) return } subIndx := hh.Index() @@ -6579,15 +6579,15 @@ func (f *Fork) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'PreviousVersion' - if len(f.PreviousVersion) != 4 { - err = ssz.ErrBytesLength + if size := len(f.PreviousVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.PreviousVersion", size, 4) return } dst = append(dst, f.PreviousVersion...) // Field (1) 'CurrentVersion' - if len(f.CurrentVersion) != 4 { - err = ssz.ErrBytesLength + if size := len(f.CurrentVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) return } dst = append(dst, f.CurrentVersion...) @@ -6640,15 +6640,15 @@ func (f *Fork) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'PreviousVersion' - if len(f.PreviousVersion) != 4 { - err = ssz.ErrBytesLength + if size := len(f.PreviousVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.PreviousVersion", size, 4) return } hh.PutBytes(f.PreviousVersion) // Field (1) 'CurrentVersion' - if len(f.CurrentVersion) != 4 { - err = ssz.ErrBytesLength + if size := len(f.CurrentVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) return } hh.PutBytes(f.CurrentVersion) @@ -6693,8 +6693,8 @@ func (p *PendingAttestation) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, uint64(p.ProposerIndex)) // Field (0) 'AggregationBits' - if len(p.AggregationBits) > 2048 { - err = ssz.ErrBytesLength + if size := len(p.AggregationBits); size > 2048 { + err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 2048) return } dst = append(dst, p.AggregationBits...) @@ -6805,26 +6805,26 @@ func (h *HistoricalBatch) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'BlockRoots' - if len(h.BlockRoots) != 8192 { - err = ssz.ErrVectorLength + if size := len(h.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) return } for ii := 0; ii < 8192; ii++ { - if len(h.BlockRoots[ii]) != 32 { - err = ssz.ErrBytesLength + 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 len(h.StateRoots) != 8192 { - err = ssz.ErrVectorLength + if size := len(h.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) return } for ii := 0; ii < 8192; ii++ { - if len(h.StateRoots[ii]) != 32 { - err = ssz.ErrBytesLength + if size := len(h.StateRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) return } dst = append(dst, h.StateRoots[ii]...) @@ -6879,8 +6879,8 @@ func (h *HistoricalBatch) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (0) 'BlockRoots' { - if len(h.BlockRoots) != 8192 { - err = ssz.ErrVectorLength + if size := len(h.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) return } subIndx := hh.Index() @@ -6901,8 +6901,8 @@ func (h *HistoricalBatch) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (1) 'StateRoots' { - if len(h.StateRoots) != 8192 { - err = ssz.ErrVectorLength + if size := len(h.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) return } subIndx := hh.Index() @@ -6939,15 +6939,15 @@ func (s *SigningData) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'ObjectRoot' - if len(s.ObjectRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(s.ObjectRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ObjectRoot", size, 32) return } dst = append(dst, s.ObjectRoot...) // Field (1) 'Domain' - if len(s.Domain) != 32 { - err = ssz.ErrBytesLength + if size := len(s.Domain); size != 32 { + err = ssz.ErrBytesLengthFn("--.Domain", size, 32) return } dst = append(dst, s.Domain...) @@ -6994,15 +6994,15 @@ func (s *SigningData) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'ObjectRoot' - if len(s.ObjectRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(s.ObjectRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.ObjectRoot", size, 32) return } hh.PutBytes(s.ObjectRoot) // Field (1) 'Domain' - if len(s.Domain) != 32 { - err = ssz.ErrBytesLength + if size := len(s.Domain); size != 32 { + err = ssz.ErrBytesLengthFn("--.Domain", size, 32) return } hh.PutBytes(s.Domain) @@ -7025,15 +7025,15 @@ func (f *ForkData) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'CurrentVersion' - if len(f.CurrentVersion) != 4 { - err = ssz.ErrBytesLength + if size := len(f.CurrentVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) return } dst = append(dst, f.CurrentVersion...) // Field (1) 'GenesisValidatorsRoot' - if len(f.GenesisValidatorsRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(f.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) return } dst = append(dst, f.GenesisValidatorsRoot...) @@ -7080,15 +7080,15 @@ func (f *ForkData) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'CurrentVersion' - if len(f.CurrentVersion) != 4 { - err = ssz.ErrBytesLength + if size := len(f.CurrentVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.CurrentVersion", size, 4) return } hh.PutBytes(f.CurrentVersion) // Field (1) 'GenesisValidatorsRoot' - if len(f.GenesisValidatorsRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(f.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) return } hh.PutBytes(f.GenesisValidatorsRoot) @@ -7111,15 +7111,15 @@ func (d *DepositMessage) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'PublicKey' - if len(d.PublicKey) != 48 { - err = ssz.ErrBytesLength + if size := len(d.PublicKey); size != 48 { + err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) return } dst = append(dst, d.PublicKey...) // Field (1) 'WithdrawalCredentials' - if len(d.WithdrawalCredentials) != 32 { - err = ssz.ErrBytesLength + if size := len(d.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) return } dst = append(dst, d.WithdrawalCredentials...) @@ -7172,15 +7172,15 @@ func (d *DepositMessage) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'PublicKey' - if len(d.PublicKey) != 48 { - err = ssz.ErrBytesLength + if size := len(d.PublicKey); size != 48 { + err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) return } hh.PutBytes(d.PublicKey) // Field (1) 'WithdrawalCredentials' - if len(d.WithdrawalCredentials) != 32 { - err = ssz.ErrBytesLength + if size := len(d.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) return } hh.PutBytes(d.WithdrawalCredentials) @@ -7206,21 +7206,21 @@ func (s *SyncCommittee) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'Pubkeys' - if len(s.Pubkeys) != 512 { - err = ssz.ErrVectorLength + if size := len(s.Pubkeys); size != 512 { + err = ssz.ErrVectorLengthFn("--.Pubkeys", size, 512) return } for ii := 0; ii < 512; ii++ { - if len(s.Pubkeys[ii]) != 48 { - err = ssz.ErrBytesLength + 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 len(s.AggregatePubkey) != 48 { - err = ssz.ErrBytesLength + if size := len(s.AggregatePubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.AggregatePubkey", size, 48) return } dst = append(dst, s.AggregatePubkey...) @@ -7271,8 +7271,8 @@ func (s *SyncCommittee) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (0) 'Pubkeys' { - if len(s.Pubkeys) != 512 { - err = ssz.ErrVectorLength + if size := len(s.Pubkeys); size != 512 { + err = ssz.ErrVectorLengthFn("--.Pubkeys", size, 512) return } subIndx := hh.Index() @@ -7292,8 +7292,8 @@ func (s *SyncCommittee) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (1) 'AggregatePubkey' - if len(s.AggregatePubkey) != 48 { - err = ssz.ErrBytesLength + if size := len(s.AggregatePubkey); size != 48 { + err = ssz.ErrBytesLengthFn("--.AggregatePubkey", size, 48) return } hh.PutBytes(s.AggregatePubkey) @@ -7384,8 +7384,8 @@ func (b *BeaconStateBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) dst = ssz.MarshalUint64(dst, b.GenesisTime) // Field (1) 'GenesisValidatorsRoot' - if len(b.GenesisValidatorsRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) return } dst = append(dst, b.GenesisValidatorsRoot...) @@ -7410,26 +7410,26 @@ func (b *BeaconStateBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) } // Field (5) 'BlockRoots' - if len(b.BlockRoots) != 8192 { - err = ssz.ErrVectorLength + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) return } for ii := 0; ii < 8192; ii++ { - if len(b.BlockRoots[ii]) != 32 { - err = ssz.ErrBytesLength + 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 len(b.StateRoots) != 8192 { - err = ssz.ErrVectorLength + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) return } for ii := 0; ii < 8192; ii++ { - if len(b.StateRoots[ii]) != 32 { - err = ssz.ErrBytesLength + if size := len(b.StateRoots[ii]); size != 32 { + err = ssz.ErrBytesLengthFn("--.StateRoots[ii]", size, 32) return } dst = append(dst, b.StateRoots[ii]...) @@ -7463,21 +7463,21 @@ func (b *BeaconStateBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) offset += len(b.Balances) * 8 // Field (13) 'RandaoMixes' - if len(b.RandaoMixes) != 65536 { - err = ssz.ErrVectorLength + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) return } for ii := 0; ii < 65536; ii++ { - if len(b.RandaoMixes[ii]) != 32 { - err = ssz.ErrBytesLength + 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 len(b.Slashings) != 8192 { - err = ssz.ErrVectorLength + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) return } for ii := 0; ii < 8192; ii++ { @@ -7493,8 +7493,8 @@ func (b *BeaconStateBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) offset += len(b.CurrentEpochParticipation) // Field (17) 'JustificationBits' - if len(b.JustificationBits) != 1 { - err = ssz.ErrBytesLength + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) return } dst = append(dst, b.JustificationBits...) @@ -7551,21 +7551,21 @@ func (b *BeaconStateBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) offset += b.LatestExecutionPayloadHeader.SizeSSZ() // Field (7) 'HistoricalRoots' - if len(b.HistoricalRoots) > 16777216 { - err = ssz.ErrListTooBig + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) return } for ii := 0; ii < len(b.HistoricalRoots); ii++ { - if len(b.HistoricalRoots[ii]) != 32 { - err = ssz.ErrBytesLength + 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 len(b.Eth1DataVotes) > 2048 { - err = ssz.ErrListTooBig + if size := len(b.Eth1DataVotes); size > 2048 { + err = ssz.ErrListTooBigFn("--.Eth1DataVotes", size, 2048) return } for ii := 0; ii < len(b.Eth1DataVotes); ii++ { @@ -7575,8 +7575,8 @@ func (b *BeaconStateBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) } // Field (11) 'Validators' - if len(b.Validators) > 1099511627776 { - err = ssz.ErrListTooBig + if size := len(b.Validators); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Validators", size, 1099511627776) return } for ii := 0; ii < len(b.Validators); ii++ { @@ -7586,8 +7586,8 @@ func (b *BeaconStateBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) } // Field (12) 'Balances' - if len(b.Balances) > 1099511627776 { - err = ssz.ErrListTooBig + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) return } for ii := 0; ii < len(b.Balances); ii++ { @@ -7595,22 +7595,22 @@ func (b *BeaconStateBellatrix) MarshalSSZTo(buf []byte) (dst []byte, err error) } // Field (15) 'PreviousEpochParticipation' - if len(b.PreviousEpochParticipation) > 1099511627776 { - err = ssz.ErrBytesLength + if size := len(b.PreviousEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.PreviousEpochParticipation", size, 1099511627776) return } dst = append(dst, b.PreviousEpochParticipation...) // Field (16) 'CurrentEpochParticipation' - if len(b.CurrentEpochParticipation) > 1099511627776 { - err = ssz.ErrBytesLength + if size := len(b.CurrentEpochParticipation); size > 1099511627776 { + err = ssz.ErrBytesLengthFn("--.CurrentEpochParticipation", size, 1099511627776) return } dst = append(dst, b.CurrentEpochParticipation...) // Field (21) 'InactivityScores' - if len(b.InactivityScores) > 1099511627776 { - err = ssz.ErrListTooBig + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) return } for ii := 0; ii < len(b.InactivityScores); ii++ { @@ -7960,8 +7960,8 @@ func (b *BeaconStateBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(b.GenesisTime) // Field (1) 'GenesisValidatorsRoot' - if len(b.GenesisValidatorsRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(b.GenesisValidatorsRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.GenesisValidatorsRoot", size, 32) return } hh.PutBytes(b.GenesisValidatorsRoot) @@ -7981,8 +7981,8 @@ func (b *BeaconStateBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (5) 'BlockRoots' { - if len(b.BlockRoots) != 8192 { - err = ssz.ErrVectorLength + if size := len(b.BlockRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.BlockRoots", size, 8192) return } subIndx := hh.Index() @@ -8003,8 +8003,8 @@ func (b *BeaconStateBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (6) 'StateRoots' { - if len(b.StateRoots) != 8192 { - err = ssz.ErrVectorLength + if size := len(b.StateRoots); size != 8192 { + err = ssz.ErrVectorLengthFn("--.StateRoots", size, 8192) return } subIndx := hh.Index() @@ -8025,8 +8025,8 @@ func (b *BeaconStateBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (7) 'HistoricalRoots' { - if len(b.HistoricalRoots) > 16777216 { - err = ssz.ErrListTooBig + if size := len(b.HistoricalRoots); size > 16777216 { + err = ssz.ErrListTooBigFn("--.HistoricalRoots", size, 16777216) return } subIndx := hh.Index() @@ -8096,8 +8096,8 @@ func (b *BeaconStateBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (12) 'Balances' { - if len(b.Balances) > 1099511627776 { - err = ssz.ErrListTooBig + if size := len(b.Balances); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.Balances", size, 1099511627776) return } subIndx := hh.Index() @@ -8116,8 +8116,8 @@ func (b *BeaconStateBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (13) 'RandaoMixes' { - if len(b.RandaoMixes) != 65536 { - err = ssz.ErrVectorLength + if size := len(b.RandaoMixes); size != 65536 { + err = ssz.ErrVectorLengthFn("--.RandaoMixes", size, 65536) return } subIndx := hh.Index() @@ -8138,8 +8138,8 @@ func (b *BeaconStateBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (14) 'Slashings' { - if len(b.Slashings) != 8192 { - err = ssz.ErrVectorLength + if size := len(b.Slashings); size != 8192 { + err = ssz.ErrVectorLengthFn("--.Slashings", size, 8192) return } subIndx := hh.Index() @@ -8187,8 +8187,8 @@ func (b *BeaconStateBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (17) 'JustificationBits' - if len(b.JustificationBits) != 1 { - err = ssz.ErrBytesLength + if size := len(b.JustificationBits); size != 1 { + err = ssz.ErrBytesLengthFn("--.JustificationBits", size, 1) return } hh.PutBytes(b.JustificationBits) @@ -8210,8 +8210,8 @@ func (b *BeaconStateBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) { // Field (21) 'InactivityScores' { - if len(b.InactivityScores) > 1099511627776 { - err = ssz.ErrListTooBig + if size := len(b.InactivityScores); size > 1099511627776 { + err = ssz.ErrListTooBigFn("--.InactivityScores", size, 1099511627776) return } subIndx := hh.Index() @@ -8261,22 +8261,22 @@ func (p *PowBlock) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'BlockHash' - if len(p.BlockHash) != 32 { - err = ssz.ErrBytesLength + if size := len(p.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) return } dst = append(dst, p.BlockHash...) // Field (1) 'ParentHash' - if len(p.ParentHash) != 32 { - err = ssz.ErrBytesLength + if size := len(p.ParentHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) return } dst = append(dst, p.ParentHash...) // Field (2) 'TotalDifficulty' - if len(p.TotalDifficulty) != 32 { - err = ssz.ErrBytesLength + if size := len(p.TotalDifficulty); size != 32 { + err = ssz.ErrBytesLengthFn("--.TotalDifficulty", size, 32) return } dst = append(dst, p.TotalDifficulty...) @@ -8329,22 +8329,22 @@ func (p *PowBlock) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'BlockHash' - if len(p.BlockHash) != 32 { - err = ssz.ErrBytesLength + if size := len(p.BlockHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockHash", size, 32) return } hh.PutBytes(p.BlockHash) // Field (1) 'ParentHash' - if len(p.ParentHash) != 32 { - err = ssz.ErrBytesLength + if size := len(p.ParentHash); size != 32 { + err = ssz.ErrBytesLengthFn("--.ParentHash", size, 32) return } hh.PutBytes(p.ParentHash) // Field (2) 'TotalDifficulty' - if len(p.TotalDifficulty) != 32 { - err = ssz.ErrBytesLength + if size := len(p.TotalDifficulty); size != 32 { + err = ssz.ErrBytesLengthFn("--.TotalDifficulty", size, 32) return } hh.PutBytes(p.TotalDifficulty) @@ -8367,15 +8367,15 @@ func (s *Status) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'ForkDigest' - if len(s.ForkDigest) != 4 { - err = ssz.ErrBytesLength + if size := len(s.ForkDigest); size != 4 { + err = ssz.ErrBytesLengthFn("--.ForkDigest", size, 4) return } dst = append(dst, s.ForkDigest...) // Field (1) 'FinalizedRoot' - if len(s.FinalizedRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(s.FinalizedRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.FinalizedRoot", size, 32) return } dst = append(dst, s.FinalizedRoot...) @@ -8384,8 +8384,8 @@ func (s *Status) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, uint64(s.FinalizedEpoch)) // Field (3) 'HeadRoot' - if len(s.HeadRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(s.HeadRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.HeadRoot", size, 32) return } dst = append(dst, s.HeadRoot...) @@ -8447,15 +8447,15 @@ func (s *Status) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'ForkDigest' - if len(s.ForkDigest) != 4 { - err = ssz.ErrBytesLength + if size := len(s.ForkDigest); size != 4 { + err = ssz.ErrBytesLengthFn("--.ForkDigest", size, 4) return } hh.PutBytes(s.ForkDigest) // Field (1) 'FinalizedRoot' - if len(s.FinalizedRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(s.FinalizedRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.FinalizedRoot", size, 32) return } hh.PutBytes(s.FinalizedRoot) @@ -8464,8 +8464,8 @@ func (s *Status) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(uint64(s.FinalizedEpoch)) // Field (3) 'HeadRoot' - if len(s.HeadRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(s.HeadRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.HeadRoot", size, 32) return } hh.PutBytes(s.HeadRoot) @@ -8564,15 +8564,15 @@ func (e *ENRForkID) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'CurrentForkDigest' - if len(e.CurrentForkDigest) != 4 { - err = ssz.ErrBytesLength + if size := len(e.CurrentForkDigest); size != 4 { + err = ssz.ErrBytesLengthFn("--.CurrentForkDigest", size, 4) return } dst = append(dst, e.CurrentForkDigest...) // Field (1) 'NextForkVersion' - if len(e.NextForkVersion) != 4 { - err = ssz.ErrBytesLength + if size := len(e.NextForkVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.NextForkVersion", size, 4) return } dst = append(dst, e.NextForkVersion...) @@ -8625,15 +8625,15 @@ func (e *ENRForkID) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'CurrentForkDigest' - if len(e.CurrentForkDigest) != 4 { - err = ssz.ErrBytesLength + if size := len(e.CurrentForkDigest); size != 4 { + err = ssz.ErrBytesLengthFn("--.CurrentForkDigest", size, 4) return } hh.PutBytes(e.CurrentForkDigest) // Field (1) 'NextForkVersion' - if len(e.NextForkVersion) != 4 { - err = ssz.ErrBytesLength + if size := len(e.NextForkVersion); size != 4 { + err = ssz.ErrBytesLengthFn("--.NextForkVersion", size, 4) return } hh.PutBytes(e.NextForkVersion) @@ -8662,8 +8662,8 @@ func (m *MetaDataV0) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, m.SeqNumber) // Field (1) 'Attnets' - if len(m.Attnets) != 8 { - err = ssz.ErrBytesLength + if size := len(m.Attnets); size != 8 { + err = ssz.ErrBytesLengthFn("--.Attnets", size, 8) return } dst = append(dst, m.Attnets...) @@ -8710,8 +8710,8 @@ func (m *MetaDataV0) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(m.SeqNumber) // Field (1) 'Attnets' - if len(m.Attnets) != 8 { - err = ssz.ErrBytesLength + if size := len(m.Attnets); size != 8 { + err = ssz.ErrBytesLengthFn("--.Attnets", size, 8) return } hh.PutBytes(m.Attnets) @@ -8737,15 +8737,15 @@ func (m *MetaDataV1) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = ssz.MarshalUint64(dst, m.SeqNumber) // Field (1) 'Attnets' - if len(m.Attnets) != 8 { - err = ssz.ErrBytesLength + if size := len(m.Attnets); size != 8 { + err = ssz.ErrBytesLengthFn("--.Attnets", size, 8) return } dst = append(dst, m.Attnets...) // Field (2) 'Syncnets' - if len(m.Syncnets) != 1 { - err = ssz.ErrBytesLength + if size := len(m.Syncnets); size != 1 { + err = ssz.ErrBytesLengthFn("--.Syncnets", size, 1) return } dst = append(dst, m.Syncnets...) @@ -8798,15 +8798,15 @@ func (m *MetaDataV1) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(m.SeqNumber) // Field (1) 'Attnets' - if len(m.Attnets) != 8 { - err = ssz.ErrBytesLength + if size := len(m.Attnets); size != 8 { + err = ssz.ErrBytesLengthFn("--.Attnets", size, 8) return } hh.PutBytes(m.Attnets) // Field (2) 'Syncnets' - if len(m.Syncnets) != 1 { - err = ssz.ErrBytesLength + if size := len(m.Syncnets); size != 1 { + err = ssz.ErrBytesLengthFn("--.Syncnets", size, 1) return } hh.PutBytes(m.Syncnets) @@ -8832,8 +8832,8 @@ func (s *SyncCommitteeMessage) MarshalSSZTo(buf []byte) (dst []byte, err error) dst = ssz.MarshalUint64(dst, uint64(s.Slot)) // Field (1) 'BlockRoot' - if len(s.BlockRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(s.BlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) return } dst = append(dst, s.BlockRoot...) @@ -8842,8 +8842,8 @@ func (s *SyncCommitteeMessage) MarshalSSZTo(buf []byte) (dst []byte, err error) dst = ssz.MarshalUint64(dst, uint64(s.ValidatorIndex)) // Field (3) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) @@ -8899,8 +8899,8 @@ func (s *SyncCommitteeMessage) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(uint64(s.Slot)) // Field (1) 'BlockRoot' - if len(s.BlockRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(s.BlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) return } hh.PutBytes(s.BlockRoot) @@ -8909,8 +8909,8 @@ func (s *SyncCommitteeMessage) HashTreeRootWith(hh *ssz.Hasher) (err error) { hh.PutUint64(uint64(s.ValidatorIndex)) // Field (3) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(s.Signature) @@ -8936,8 +8936,8 @@ func (s *SyncCommitteeContribution) MarshalSSZTo(buf []byte) (dst []byte, err er dst = ssz.MarshalUint64(dst, uint64(s.Slot)) // Field (1) 'BlockRoot' - if len(s.BlockRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(s.BlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) return } dst = append(dst, s.BlockRoot...) @@ -8946,15 +8946,15 @@ func (s *SyncCommitteeContribution) MarshalSSZTo(buf []byte) (dst []byte, err er dst = ssz.MarshalUint64(dst, s.SubcommitteeIndex) // Field (3) 'AggregationBits' - if len(s.AggregationBits) != 16 { - err = ssz.ErrBytesLength + if size := len(s.AggregationBits); size != 16 { + err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 16) return } dst = append(dst, s.AggregationBits...) // Field (4) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) @@ -9016,8 +9016,8 @@ func (s *SyncCommitteeContribution) HashTreeRootWith(hh *ssz.Hasher) (err error) hh.PutUint64(uint64(s.Slot)) // Field (1) 'BlockRoot' - if len(s.BlockRoot) != 32 { - err = ssz.ErrBytesLength + if size := len(s.BlockRoot); size != 32 { + err = ssz.ErrBytesLengthFn("--.BlockRoot", size, 32) return } hh.PutBytes(s.BlockRoot) @@ -9026,15 +9026,15 @@ func (s *SyncCommitteeContribution) HashTreeRootWith(hh *ssz.Hasher) (err error) hh.PutUint64(s.SubcommitteeIndex) // Field (3) 'AggregationBits' - if len(s.AggregationBits) != 16 { - err = ssz.ErrBytesLength + if size := len(s.AggregationBits); size != 16 { + err = ssz.ErrBytesLengthFn("--.AggregationBits", size, 16) return } hh.PutBytes(s.AggregationBits) // Field (4) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(s.Signature) @@ -9068,8 +9068,8 @@ func (c *ContributionAndProof) MarshalSSZTo(buf []byte) (dst []byte, err error) } // Field (2) 'SelectionProof' - if len(c.SelectionProof) != 96 { - err = ssz.ErrBytesLength + if size := len(c.SelectionProof); size != 96 { + err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) return } dst = append(dst, c.SelectionProof...) @@ -9129,8 +9129,8 @@ func (c *ContributionAndProof) HashTreeRootWith(hh *ssz.Hasher) (err error) { } // Field (2) 'SelectionProof' - if len(c.SelectionProof) != 96 { - err = ssz.ErrBytesLength + if size := len(c.SelectionProof); size != 96 { + err = ssz.ErrBytesLengthFn("--.SelectionProof", size, 96) return } hh.PutBytes(c.SelectionProof) @@ -9161,8 +9161,8 @@ func (s *SignedContributionAndProof) MarshalSSZTo(buf []byte) (dst []byte, err e } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } dst = append(dst, s.Signature...) @@ -9216,8 +9216,8 @@ func (s *SignedContributionAndProof) HashTreeRootWith(hh *ssz.Hasher) (err error } // Field (1) 'Signature' - if len(s.Signature) != 96 { - err = ssz.ErrBytesLength + if size := len(s.Signature); size != 96 { + err = ssz.ErrBytesLengthFn("--.Signature", size, 96) return } hh.PutBytes(s.Signature) @@ -9240,15 +9240,15 @@ func (v *Validator) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf // Field (0) 'PublicKey' - if len(v.PublicKey) != 48 { - err = ssz.ErrBytesLength + if size := len(v.PublicKey); size != 48 { + err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) return } dst = append(dst, v.PublicKey...) // Field (1) 'WithdrawalCredentials' - if len(v.WithdrawalCredentials) != 32 { - err = ssz.ErrBytesLength + if size := len(v.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) return } dst = append(dst, v.WithdrawalCredentials...) @@ -9331,15 +9331,15 @@ func (v *Validator) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() // Field (0) 'PublicKey' - if len(v.PublicKey) != 48 { - err = ssz.ErrBytesLength + if size := len(v.PublicKey); size != 48 { + err = ssz.ErrBytesLengthFn("--.PublicKey", size, 48) return } hh.PutBytes(v.PublicKey) // Field (1) 'WithdrawalCredentials' - if len(v.WithdrawalCredentials) != 32 { - err = ssz.ErrBytesLength + if size := len(v.WithdrawalCredentials); size != 32 { + err = ssz.ErrBytesLengthFn("--.WithdrawalCredentials", size, 32) return } hh.PutBytes(v.WithdrawalCredentials)