Integrate better fastssz validation errors into Prysm (#10945)

* update dep

* regenerate SSZ, update test

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Radosław Kapka 2022-06-29 10:05:56 +02:00 committed by GitHub
parent 8510743406
commit f376f3fb9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 801 additions and 801 deletions

View File

@ -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)
})

View File

@ -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(

2
go.mod
View File

@ -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

4
go.sum
View File

@ -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=

View File

@ -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)

View File

@ -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)

View File

@ -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)

File diff suppressed because it is too large Load Diff