diff --git a/api/v1/deneb/blindedbeaconblockbody.go b/api/v1/deneb/blindedbeaconblockbody.go index e7930e4b..b1c771c3 100644 --- a/api/v1/deneb/blindedbeaconblockbody.go +++ b/api/v1/deneb/blindedbeaconblockbody.go @@ -36,7 +36,7 @@ type BlindedBeaconBlockBody struct { SyncAggregate *altair.SyncAggregate ExecutionPayloadHeader *deneb.ExecutionPayloadHeader BLSToExecutionChanges []*capella.SignedBLSToExecutionChange `ssz-max:"16"` - BlobKzgCommitments []deneb.KzgCommitment `ssz-max:"4096" ssz-size:"?,48"` + BlobKzgCommitments []deneb.KzgCommitment `ssz-max:"6" ssz-size:"?,48"` } // String returns a string version of the structure. diff --git a/api/v1/deneb/blindedbeaconblockbody_ssz.go b/api/v1/deneb/blindedbeaconblockbody_ssz.go index 7a83f62a..dff56fd6 100644 --- a/api/v1/deneb/blindedbeaconblockbody_ssz.go +++ b/api/v1/deneb/blindedbeaconblockbody_ssz.go @@ -1,5 +1,5 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: b220122abc31e740f712313ac4aededbb7ac8d3d276d300844612f7b6835f4a0 +// Hash: 53f7a78b79c00bbf864316c122774dbb8e8aae2e6c5245947a816bca4690d094 // Version: 0.1.3 package deneb @@ -170,8 +170,8 @@ func (b *BlindedBeaconBlockBody) MarshalSSZTo(buf []byte) (dst []byte, err error } // Field (11) 'BlobKzgCommitments' - if size := len(b.BlobKzgCommitments); size > 4096 { - err = ssz.ErrListTooBigFn("BlindedBeaconBlockBody.BlobKzgCommitments", size, 4096) + if size := len(b.BlobKzgCommitments); size > 4 { + err = ssz.ErrListTooBigFn("BlindedBeaconBlockBody.BlobKzgCommitments", size, 4) return } for ii := 0; ii < len(b.BlobKzgCommitments); ii++ { @@ -388,7 +388,7 @@ func (b *BlindedBeaconBlockBody) UnmarshalSSZ(buf []byte) error { // Field (11) 'BlobKzgCommitments' { buf = tail[o11:] - num, err := ssz.DivideInt2(len(buf), 48, 4096) + num, err := ssz.DivideInt2(len(buf), 48, 4) if err != nil { return err } @@ -574,8 +574,8 @@ func (b *BlindedBeaconBlockBody) HashTreeRootWith(hh ssz.HashWalker) (err error) // Field (11) 'BlobKzgCommitments' { - if size := len(b.BlobKzgCommitments); size > 4096 { - err = ssz.ErrListTooBigFn("BlindedBeaconBlockBody.BlobKzgCommitments", size, 4096) + if size := len(b.BlobKzgCommitments); size > 4 { + err = ssz.ErrListTooBigFn("BlindedBeaconBlockBody.BlobKzgCommitments", size, 4) return } subIndx := hh.Index() @@ -583,7 +583,7 @@ func (b *BlindedBeaconBlockBody) HashTreeRootWith(hh ssz.HashWalker) (err error) hh.PutBytes(i[:]) } numItems := uint64(len(b.BlobKzgCommitments)) - hh.MerkleizeWithMixin(subIndx, numItems, 4096) + hh.MerkleizeWithMixin(subIndx, numItems, 4) } hh.Merkleize(indx) diff --git a/api/v1/deneb/blindedblobsidecar_ssz.go b/api/v1/deneb/blindedblobsidecar_ssz.go new file mode 100644 index 00000000..be7445e1 --- /dev/null +++ b/api/v1/deneb/blindedblobsidecar_ssz.go @@ -0,0 +1,129 @@ +// Code generated by fastssz. DO NOT EDIT. +// Hash: 53f7a78b79c00bbf864316c122774dbb8e8aae2e6c5245947a816bca4690d094 +// Version: 0.1.3 +package deneb + +import ( + "github.com/attestantio/go-eth2-client/spec/deneb" + "github.com/attestantio/go-eth2-client/spec/phase0" + ssz "github.com/ferranbt/fastssz" +) + +// MarshalSSZ ssz marshals the BlindedBlobSidecar object +func (b *BlindedBlobSidecar) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BlindedBlobSidecar object to a target array +func (b *BlindedBlobSidecar) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'BlockRoot' + dst = append(dst, b.BlockRoot[:]...) + + // Field (1) 'Index' + dst = ssz.MarshalUint64(dst, uint64(b.Index)) + + // Field (2) 'Slot' + dst = ssz.MarshalUint64(dst, uint64(b.Slot)) + + // Field (3) 'BlockParentRoot' + dst = append(dst, b.BlockParentRoot[:]...) + + // Field (4) 'ProposerIndex' + dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex)) + + // Field (5) 'BlobRoot' + dst = append(dst, b.BlobRoot[:]...) + + // Field (6) 'KzgCommitment' + dst = append(dst, b.KzgCommitment[:]...) + + // Field (7) 'KzgProof' + dst = append(dst, b.KzgProof[:]...) + + return +} + +// UnmarshalSSZ ssz unmarshals the BlindedBlobSidecar object +func (b *BlindedBlobSidecar) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 216 { + return ssz.ErrSize + } + + // Field (0) 'BlockRoot' + copy(b.BlockRoot[:], buf[0:32]) + + // Field (1) 'Index' + b.Index = deneb.BlobIndex(ssz.UnmarshallUint64(buf[32:40])) + + // Field (2) 'Slot' + b.Slot = phase0.Slot(ssz.UnmarshallUint64(buf[40:48])) + + // Field (3) 'BlockParentRoot' + copy(b.BlockParentRoot[:], buf[48:80]) + + // Field (4) 'ProposerIndex' + b.ProposerIndex = phase0.ValidatorIndex(ssz.UnmarshallUint64(buf[80:88])) + + // Field (5) 'BlobRoot' + copy(b.BlobRoot[:], buf[88:120]) + + // Field (6) 'KzgCommitment' + copy(b.KzgCommitment[:], buf[120:168]) + + // Field (7) 'KzgProof' + copy(b.KzgProof[:], buf[168:216]) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BlindedBlobSidecar object +func (b *BlindedBlobSidecar) SizeSSZ() (size int) { + size = 216 + return +} + +// HashTreeRoot ssz hashes the BlindedBlobSidecar object +func (b *BlindedBlobSidecar) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlindedBlobSidecar object with a hasher +func (b *BlindedBlobSidecar) HashTreeRootWith(hh ssz.HashWalker) (err error) { + indx := hh.Index() + + // Field (0) 'BlockRoot' + hh.PutBytes(b.BlockRoot[:]) + + // Field (1) 'Index' + hh.PutUint64(uint64(b.Index)) + + // Field (2) 'Slot' + hh.PutUint64(uint64(b.Slot)) + + // Field (3) 'BlockParentRoot' + hh.PutBytes(b.BlockParentRoot[:]) + + // Field (4) 'ProposerIndex' + hh.PutUint64(uint64(b.ProposerIndex)) + + // Field (5) 'BlobRoot' + hh.PutBytes(b.BlobRoot[:]) + + // Field (6) 'KzgCommitment' + hh.PutBytes(b.KzgCommitment[:]) + + // Field (7) 'KzgProof' + hh.PutBytes(b.KzgProof[:]) + + hh.Merkleize(indx) + return +} + +// GetTree ssz hashes the BlindedBlobSidecar object +func (b *BlindedBlobSidecar) GetTree() (*ssz.Node, error) { + return ssz.ProofTree(b) +} diff --git a/api/v1/deneb/blindedblobsidecar_yaml.go b/api/v1/deneb/blindedblobsidecar_yaml.go new file mode 100644 index 00000000..31640f23 --- /dev/null +++ b/api/v1/deneb/blindedblobsidecar_yaml.go @@ -0,0 +1,68 @@ +// Copyright © 2023 Attestant Limited. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package deneb + +import ( + "bytes" + "encoding/json" + + "github.com/attestantio/go-eth2-client/spec/deneb" + "github.com/attestantio/go-eth2-client/spec/phase0" + "github.com/goccy/go-yaml" + "github.com/pkg/errors" +) + +// blindedBlobSidecarYAML is the spec representation of the struct. +type blindedBlobSidecarYAML struct { + BlockRoot phase0.Root `json:"block_root"` + Index uint64 `json:"index"` + Slot uint64 `json:"slot"` + BlockParentRoot phase0.Root `json:"block_parent_root"` + ProposerIndex uint64 `json:"proposer_index"` + BlobRoot phase0.Root `json:"blob_root"` + KzgCommitment deneb.KzgCommitment `json:"kzg_commitment"` + KzgProof deneb.KzgProof `json:"kzg_proof"` +} + +// MarshalYAML implements json.Marshaler. +func (b *BlindedBlobSidecar) MarshalYAML() ([]byte, error) { + yamlBytes, err := yaml.MarshalWithOptions(&blindedBlobSidecarYAML{ + BlockRoot: b.BlockRoot, + Index: uint64(b.Index), + Slot: uint64(b.Slot), + BlockParentRoot: b.BlockParentRoot, + ProposerIndex: uint64(b.ProposerIndex), + BlobRoot: b.BlobRoot, + KzgCommitment: b.KzgCommitment, + KzgProof: b.KzgProof, + }, yaml.Flow(true)) + if err != nil { + return nil, err + } + return bytes.ReplaceAll(yamlBytes, []byte(`"`), []byte(`'`)), nil +} + +// UnmarshalYAML implements json.Unmarshaler. +func (b *BlindedBlobSidecar) UnmarshalYAML(input []byte) error { + var data blindedBlobSidecarJSON + if err := yaml.Unmarshal(input, &data); err != nil { + return errors.Wrap(err, "failed to unmarshal YAML") + } + bytes, err := json.Marshal(data) + if err != nil { + return errors.Wrap(err, "failed to marshal JSON") + } + + return b.UnmarshalJSON(bytes) +} diff --git a/api/v1/deneb/blindedblockcontents.go b/api/v1/deneb/blindedblockcontents.go new file mode 100644 index 00000000..b106a471 --- /dev/null +++ b/api/v1/deneb/blindedblockcontents.go @@ -0,0 +1,35 @@ +// Copyright © 2023 Attestant Limited. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package deneb + +import ( + "fmt" + + "github.com/goccy/go-yaml" +) + +// BlindedBlockContents represents the contents of a block, both blinded block and blob. +type BlindedBlockContents struct { + BlindedBlock *BlindedBeaconBlock + BlindedBlobSidecars []*BlindedBlobSidecar `ssz-max:"6"` +} + +// String returns a string version of the structure. +func (b *BlindedBlockContents) String() string { + data, err := yaml.Marshal(b) + if err != nil { + return fmt.Sprintf("ERR: %v", err) + } + return string(data) +} diff --git a/api/v1/deneb/blindedblockcontents_json.go b/api/v1/deneb/blindedblockcontents_json.go new file mode 100644 index 00000000..e456cbb2 --- /dev/null +++ b/api/v1/deneb/blindedblockcontents_json.go @@ -0,0 +1,57 @@ +// Copyright © 2023 Attestant Limited. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package deneb + +import ( + "encoding/json" + + "github.com/pkg/errors" +) + +// blindedBlockContentsJSON is the spec representation of the struct. +type blindedBlockContentsJSON struct { + BlindedBlock *BlindedBeaconBlock `json:"blinded_block"` + BlindedBlobSidecars []*BlindedBlobSidecar `json:"blinded_blob_sidecars"` +} + +// MarshalJSON implements json.Marshaler. +func (b *BlindedBlockContents) MarshalJSON() ([]byte, error) { + return json.Marshal(&blindedBlockContentsJSON{ + BlindedBlock: b.BlindedBlock, + BlindedBlobSidecars: b.BlindedBlobSidecars, + }) +} + +// UnmarshalJSON implements json.Unmarshaler. +func (b *BlindedBlockContents) UnmarshalJSON(input []byte) error { + var data blindedBlockContentsJSON + if err := json.Unmarshal(input, &data); err != nil { + return errors.Wrap(err, "invalid JSON") + } + return b.unpack(&data) +} + +func (b *BlindedBlockContents) unpack(data *blindedBlockContentsJSON) error { + if data.BlindedBlock == nil { + return errors.New("blinded block missing") + } + b.BlindedBlock = data.BlindedBlock + + if data.BlindedBlobSidecars == nil { + return errors.New("blinded blob sidecars missing") + } + b.BlindedBlobSidecars = data.BlindedBlobSidecars + + return nil +} diff --git a/api/v1/deneb/blindedblockcontents_ssz.go b/api/v1/deneb/blindedblockcontents_ssz.go new file mode 100644 index 00000000..226ee0d2 --- /dev/null +++ b/api/v1/deneb/blindedblockcontents_ssz.go @@ -0,0 +1,159 @@ +// Code generated by fastssz. DO NOT EDIT. +// Hash: 53f7a78b79c00bbf864316c122774dbb8e8aae2e6c5245947a816bca4690d094 +// Version: 0.1.3 +package deneb + +import ( + ssz "github.com/ferranbt/fastssz" +) + +// MarshalSSZ ssz marshals the BlindedBlockContents object +func (b *BlindedBlockContents) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BlindedBlockContents object to a target array +func (b *BlindedBlockContents) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(8) + + // Offset (0) 'BlindedBlock' + dst = ssz.WriteOffset(dst, offset) + if b.BlindedBlock == nil { + b.BlindedBlock = new(BlindedBeaconBlock) + } + offset += b.BlindedBlock.SizeSSZ() + + // Offset (1) 'BlindedBlobSidecars' + dst = ssz.WriteOffset(dst, offset) + offset += len(b.BlindedBlobSidecars) * 216 + + // Field (0) 'BlindedBlock' + if dst, err = b.BlindedBlock.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'BlindedBlobSidecars' + if size := len(b.BlindedBlobSidecars); size > 4 { + err = ssz.ErrListTooBigFn("BlindedBlockContents.BlindedBlobSidecars", size, 4) + return + } + for ii := 0; ii < len(b.BlindedBlobSidecars); ii++ { + if dst, err = b.BlindedBlobSidecars[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BlindedBlockContents object +func (b *BlindedBlockContents) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 8 { + return ssz.ErrSize + } + + tail := buf + var o0, o1 uint64 + + // Offset (0) 'BlindedBlock' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 < 8 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (1) 'BlindedBlobSidecars' + if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { + return ssz.ErrOffset + } + + // Field (0) 'BlindedBlock' + { + buf = tail[o0:o1] + if b.BlindedBlock == nil { + b.BlindedBlock = new(BlindedBeaconBlock) + } + if err = b.BlindedBlock.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (1) 'BlindedBlobSidecars' + { + buf = tail[o1:] + num, err := ssz.DivideInt2(len(buf), 216, 4) + if err != nil { + return err + } + b.BlindedBlobSidecars = make([]*BlindedBlobSidecar, num) + for ii := 0; ii < num; ii++ { + if b.BlindedBlobSidecars[ii] == nil { + b.BlindedBlobSidecars[ii] = new(BlindedBlobSidecar) + } + if err = b.BlindedBlobSidecars[ii].UnmarshalSSZ(buf[ii*216 : (ii+1)*216]); err != nil { + return err + } + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BlindedBlockContents object +func (b *BlindedBlockContents) SizeSSZ() (size int) { + size = 8 + + // Field (0) 'BlindedBlock' + if b.BlindedBlock == nil { + b.BlindedBlock = new(BlindedBeaconBlock) + } + size += b.BlindedBlock.SizeSSZ() + + // Field (1) 'BlindedBlobSidecars' + size += len(b.BlindedBlobSidecars) * 216 + + return +} + +// HashTreeRoot ssz hashes the BlindedBlockContents object +func (b *BlindedBlockContents) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BlindedBlockContents object with a hasher +func (b *BlindedBlockContents) HashTreeRootWith(hh ssz.HashWalker) (err error) { + indx := hh.Index() + + // Field (0) 'BlindedBlock' + if err = b.BlindedBlock.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'BlindedBlobSidecars' + { + subIndx := hh.Index() + num := uint64(len(b.BlindedBlobSidecars)) + if num > 4 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range b.BlindedBlobSidecars { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 4) + } + + hh.Merkleize(indx) + return +} + +// GetTree ssz hashes the BlindedBlockContents object +func (b *BlindedBlockContents) GetTree() (*ssz.Node, error) { + return ssz.ProofTree(b) +} diff --git a/api/v1/deneb/blindedblockcontents_test.go b/api/v1/deneb/blindedblockcontents_test.go new file mode 100644 index 00000000..a19bc455 --- /dev/null +++ b/api/v1/deneb/blindedblockcontents_test.go @@ -0,0 +1,128 @@ +// Copyright © 2023 Attestant Limited. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package deneb_test + +import ( + "bytes" + "encoding/json" + "testing" + + "github.com/attestantio/go-eth2-client/api/v1/deneb" + "github.com/goccy/go-yaml" + "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" +) + +func TestBlindedBlockContentsJSON(t *testing.T) { + tests := []struct { + name string + input []byte + err string + }{ + { + name: "Empty", + err: "unexpected end of JSON input", + }, + { + name: "JSONBad", + input: []byte("[]"), + err: "invalid JSON: json: cannot unmarshal array into Go value of type deneb.blindedBlockContentsJSON", + }, + { + name: "BlindedBlockMissing", + input: []byte(`{"blinded_blob_sidecars":[{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"},{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"}]}`), + err: "blinded block missing", + }, + { + name: "BlindedBlockWrongType", + input: []byte(`{"blinded_block":true,"blinded_blob_sidecars":[{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"},{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"}]}`), + err: "invalid JSON: invalid JSON: json: cannot unmarshal bool into Go value of type deneb.blindedBeaconBlockJSON", + }, + { + name: "BlindedBlockInvalid", + input: []byte(`{"blinded_block":{},"blinded_blob_sidecars":[{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"},{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"}]}`), + err: "invalid JSON: slot missing", + }, + { + name: "BlindedBlobSideCarsMissing", + input: []byte(`{"blinded_block":{"slot":"348241","proposer_index":"35822","parent_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","state_root":"0x4f6e0857501da4ab1d72f0c122869e1c084e16daa96613b64914aada28d0dc28","body":{"randao_reveal":"0xb2b7d2e89bb4a4aa6a377972651bb9041cb59af8eedd19568d699fc0866189d3fd78cc93c0e63877b7e2bd6d34d1597c0afd4508aa99b6e882c2cb1ac6f424adba29afd46d1737124300ad72177715fcce8584dd25a06c45bfe9a8ccabd6175d","eth1_data":{"deposit_root":"0x704964a5ad034a440f4f29ff1875986db66adbca45dc0014e439349c7e10194f","deposit_count":"4933","block_hash":"0x9c69de2814a7c3e3751654511372937627dacc3187bf457892789f3f5533c794"},"graffiti":"0x74656b752d626573750000000000000000000000000000000000000000000000","proposer_slashings":[],"attester_slashings":[],"attestations":[{"aggregation_bits":"0xffffffffffffffffffffffffffffff5fff","data":{"slot":"348240","index":"7","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x92da7bf78eb364219f85af2388d7ac7ddbea1934786d75875486ec9fceb310eee131dcfea131bdf4593d3c431b31b2900bb48ebb7ab02e17524d86a4e132883246df8ce427e935dd9e20c422cdf8eb135b3cc45b86fe4c2f592fb4899eb22f7c"},{"aggregation_bits":"0xffdffffffffffff5fffffffffffffffffd","data":{"slot":"348240","index":"3","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x88cce1f9fbf651e52a6ab71dea2f4025702021744aac90fb2997f82bac6c192e295ae39b2a430546cb102bf8b68f687e0f40a5179bc293e1424e37d694ef1ad6b3b8de72a0e7fbbe97aeafe6f47e949d415381fbbb090e3135224d5b324eefcb"},{"aggregation_bits":"0xffffffffffefffffffffbfffff7fffdfff","data":{"slot":"348240","index":"11","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x82186d946dfde2ab3b5fcf5bd858fadeec7fa9729f28527e209d16a1d9b4d635558cad6f8de8cee12caa2a4fc5459fb911ca17cbbecfd22e83c82e244ad7a8c8c849a1e03ee88bf0d338c633c2acfefd142574897cd78f9076b69f6e370e3751"},{"aggregation_bits":"0xfffdffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"4","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9c5ee50f800fe2619d1d0fe46a2fb00a64bcf2613e46a40b579ce6a39c4f6cd71a46790757ccc3df8f5f82e34c77c8d084f525ea8a4bd5bd10190496644be0740ace3d217e43af15229a8023d58e583cfec849fab10169225444f4f4ecc66a8"},{"aggregation_bits":"0xffffffffeffffffffffffdffffffffffff","data":{"slot":"348240","index":"12","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91e4ee5c0d6bb54d6856cee653c6859f635cebf9c51bef524d6f439cf6d1c69bea5fcb3e4c067c178cfa4518a76baba909b18189a864f38020f44b2cd5223a11e42d58aaedfa2f004710a72a704357874850842a1493017eca6e473d01395932"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"13","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8c376c5bb5ada745ba8cb8ce2aae103f4e3f85549ceaacaf312b1fa8e6d2ee5232149a926dcfd58ffa1f50f710eb4edc10943bbd40a601f2fb4d53104a59c0663a397744b59f1fa0744bba49f22afc3bab47045ebb42e61dac41ad44c6bf28f4"},{"aggregation_bits":"0xfffffffffffffffffffffffffffeffffff","data":{"slot":"348240","index":"1","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xaf11c64ce957f2a1686d12b07d0fbc170d89e48490e326cd73ef761ba042bddc01e48e5fc39953c6113df0a989d75e750d5b9d75155259508c2bbdd53903967f893e24f2f7f751f4a05b0fb1cb2b9084ce8543690a8a623599308d6c190fca4a"},{"aggregation_bits":"0xfffffff5fffffffffdfffbbffffff7ffff","data":{"slot":"348240","index":"6","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91075da401796a4341ab9a850ff330c9b0d996ca12b9970ec15a4b40fee652edd043e0c9f9d81529621b3a7970e676f619d7a39af67bf193af4441b5447f199f02d75a26c32181569cddc0a237b7064971539f80811fe40e9362d4d9242404ed"},{"aggregation_bits":"0xfffffffdfffffffffffffdfffffeffffff","data":{"slot":"348240","index":"0","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xad9aa5aa9b9c022036fbb81a0aca626b19a2ccd7c7ee6efa5b2a454f5ffb5d75d00e5563b31319b3a0ad1e0ef6f512be00fb8c39243004a1133610344473953dfcf06c3bd53f00255de6983927acd8624b0131fe9d8a085062747d70972b4713"},{"aggregation_bits":"0xffffffffffff7fdfffffffffffffffffff","data":{"slot":"348240","index":"2","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x89dde857bc31a4cc5e71d6cc440c00b2b1ee85b758722aadc5c4da0a939523de7532aabcfef4e80f84094924bb69d80d0a3d702b85859c5fce0433b6d0f7bc302af866ef7a9234a75be7bbd91b32256126808ffdf65ac0ce07a33afbaa16c575"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"8","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x891fbba500eee2cf2f5734d3bf8445e8684376e47469692d44e87fc8a295616d9f29410afc2d6ff2bc649618b33b417e13de4e152099aac054f4d35df4cd79234b6df1edcf2393b7ebc0f2ecf61f4604232b96830e0dbff9311408dad4479667"},{"aggregation_bits":"0xfffffffffffbffffffffefffffffff5fff","data":{"slot":"348240","index":"14","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9ab0354d0d61eb6b5f2184dc3bd0c8416cca74f2c913c6aaca653a87dd2c4b8ba2471aa450e0fa170573637c49dc8920eb84970fea4230d7b3c3c8c8152c782e912b29bc19a6de05dc36c1b44db2f649f31673b4751e1b22f17021833ca9cc8"},{"aggregation_bits":"0xfffffebffffbf7ffeffffbffffffffffff","data":{"slot":"348240","index":"5","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8e17aa835e6343f708e73e432b7268741f60565f5bb6ef62b5fba892438ca5474a14c0382609e14624058f3fab120e8902ad3f667cf14418836ce120f3bbf50ea3c15923c881e599227cc3a2758ef9a2cd08bd3b862bd711a875e27477ac347c"},{"aggregation_bits":"0xfffffffffffefffffffffffeffffffffff","data":{"slot":"348240","index":"10","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xa0909f67a7745300cee6278605e3cb79e5a9564cd6e81ac379b285e0eb6e1849537326b546079d7bf676c8e33a166cad00ab74a396f12c9f4851fb64612f6aeb911db550e0aeae88e1b90831a5a858ae64f9262f67403327d85fcb345df9fca4"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"9","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x886d038ddd7598cfda720dfe1caf83e030e24b207bbc0c97d012fbf5accbaa2f63366f32fe643aa1fdf6c8282480cd51165710bb786d77ecfb72ef7cc9d55e342c94fb57f5a75d50a0d486ecdf014bb08e0195f24202911c86efb5b46b2167ab"}],"deposits":[],"voluntary_exits":[],"sync_aggregate":{"sync_committee_bits":"0xffffffffffffffffffff7edfffffffff7ffffffffffffffffffffffffffff7ffdf7ffffffff7fffffefffffffffffffbfffffffffdffffffffffffffffffffff","sync_committee_signature":"0x877de19f5fff89de5af36954d4c7f7f5c2ccf6f8dc39fe7e3eb87c3357fca26f0af747dffd0f992c8844a20763e9f8a51858d0be70ce610055c6421d340160adec0ddcb706a7d7a5c45edff7b5f9b9a039fce093cea41c7a5699834f9de48b94"},"execution_payload_header":{"parent_hash":"0xa330251430b91a6fb5342f30a1f527dc76499c03a411464235951dbd51b94d9f","fee_recipient":"0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134","state_root":"0x079f2cc22a29388fd4fc20f451cbaa3ff39845d68b2c368ff7be314617418e38","receipts_root":"0xed980a4cf6df8ba330c14ed9fe0597ec20515f44e5a9adfd2f7b72aa14890996","logs_bloom":"0x0000000400000008000008000040000000000000000000001000104880000200000004000000400000000204000020002000000000000000000000000022000800000004000000000002000c000000000000000000000100000000000000000000000000000000000000000000000040000000000040000001000014000000010002104000000000000000000000000000000000000000000000000000000080020000000000000000002400000000000001000000000002000200102000000040100002000000000000000000000000000000000000000800000000000000000010000000000000000000000000000000000400002000000000000000200000","prev_randao":"0x86cc02ef030b0c147321a7f94158c1b33cb730f8baac3c59955b983fda3ae39b","block_number":"330714","gas_limit":"30000000","gas_used":"369098","timestamp":"1679442492","extra_data":"0x","base_fee_per_gas":"7","block_hash":"0x4ab1ced57222819bf6a6b6c1456715011585599a1cef18b060eb364811bbb14e","transactions_root":"0x6d47bae3b4963cbde00ec39bbd6442540afe26f8005e73722489904836008bfc","withdrawals_root":"0x5dc5f3ff8bade8e1dd04e5cf56292b2a194a2829e1c8e8b4a627d95e08296ba3","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"bls_to_execution_changes":[],"blob_kzg_commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"]}}}`), + err: "blinded blob sidecars missing", + }, + { + name: "BlindedBlobSidecarsWrongType", + input: []byte(`{"blinded_block":{"slot":"348241","proposer_index":"35822","parent_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","state_root":"0x4f6e0857501da4ab1d72f0c122869e1c084e16daa96613b64914aada28d0dc28","body":{"randao_reveal":"0xb2b7d2e89bb4a4aa6a377972651bb9041cb59af8eedd19568d699fc0866189d3fd78cc93c0e63877b7e2bd6d34d1597c0afd4508aa99b6e882c2cb1ac6f424adba29afd46d1737124300ad72177715fcce8584dd25a06c45bfe9a8ccabd6175d","eth1_data":{"deposit_root":"0x704964a5ad034a440f4f29ff1875986db66adbca45dc0014e439349c7e10194f","deposit_count":"4933","block_hash":"0x9c69de2814a7c3e3751654511372937627dacc3187bf457892789f3f5533c794"},"graffiti":"0x74656b752d626573750000000000000000000000000000000000000000000000","proposer_slashings":[],"attester_slashings":[],"attestations":[{"aggregation_bits":"0xffffffffffffffffffffffffffffff5fff","data":{"slot":"348240","index":"7","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x92da7bf78eb364219f85af2388d7ac7ddbea1934786d75875486ec9fceb310eee131dcfea131bdf4593d3c431b31b2900bb48ebb7ab02e17524d86a4e132883246df8ce427e935dd9e20c422cdf8eb135b3cc45b86fe4c2f592fb4899eb22f7c"},{"aggregation_bits":"0xffdffffffffffff5fffffffffffffffffd","data":{"slot":"348240","index":"3","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x88cce1f9fbf651e52a6ab71dea2f4025702021744aac90fb2997f82bac6c192e295ae39b2a430546cb102bf8b68f687e0f40a5179bc293e1424e37d694ef1ad6b3b8de72a0e7fbbe97aeafe6f47e949d415381fbbb090e3135224d5b324eefcb"},{"aggregation_bits":"0xffffffffffefffffffffbfffff7fffdfff","data":{"slot":"348240","index":"11","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x82186d946dfde2ab3b5fcf5bd858fadeec7fa9729f28527e209d16a1d9b4d635558cad6f8de8cee12caa2a4fc5459fb911ca17cbbecfd22e83c82e244ad7a8c8c849a1e03ee88bf0d338c633c2acfefd142574897cd78f9076b69f6e370e3751"},{"aggregation_bits":"0xfffdffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"4","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9c5ee50f800fe2619d1d0fe46a2fb00a64bcf2613e46a40b579ce6a39c4f6cd71a46790757ccc3df8f5f82e34c77c8d084f525ea8a4bd5bd10190496644be0740ace3d217e43af15229a8023d58e583cfec849fab10169225444f4f4ecc66a8"},{"aggregation_bits":"0xffffffffeffffffffffffdffffffffffff","data":{"slot":"348240","index":"12","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91e4ee5c0d6bb54d6856cee653c6859f635cebf9c51bef524d6f439cf6d1c69bea5fcb3e4c067c178cfa4518a76baba909b18189a864f38020f44b2cd5223a11e42d58aaedfa2f004710a72a704357874850842a1493017eca6e473d01395932"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"13","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8c376c5bb5ada745ba8cb8ce2aae103f4e3f85549ceaacaf312b1fa8e6d2ee5232149a926dcfd58ffa1f50f710eb4edc10943bbd40a601f2fb4d53104a59c0663a397744b59f1fa0744bba49f22afc3bab47045ebb42e61dac41ad44c6bf28f4"},{"aggregation_bits":"0xfffffffffffffffffffffffffffeffffff","data":{"slot":"348240","index":"1","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xaf11c64ce957f2a1686d12b07d0fbc170d89e48490e326cd73ef761ba042bddc01e48e5fc39953c6113df0a989d75e750d5b9d75155259508c2bbdd53903967f893e24f2f7f751f4a05b0fb1cb2b9084ce8543690a8a623599308d6c190fca4a"},{"aggregation_bits":"0xfffffff5fffffffffdfffbbffffff7ffff","data":{"slot":"348240","index":"6","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91075da401796a4341ab9a850ff330c9b0d996ca12b9970ec15a4b40fee652edd043e0c9f9d81529621b3a7970e676f619d7a39af67bf193af4441b5447f199f02d75a26c32181569cddc0a237b7064971539f80811fe40e9362d4d9242404ed"},{"aggregation_bits":"0xfffffffdfffffffffffffdfffffeffffff","data":{"slot":"348240","index":"0","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xad9aa5aa9b9c022036fbb81a0aca626b19a2ccd7c7ee6efa5b2a454f5ffb5d75d00e5563b31319b3a0ad1e0ef6f512be00fb8c39243004a1133610344473953dfcf06c3bd53f00255de6983927acd8624b0131fe9d8a085062747d70972b4713"},{"aggregation_bits":"0xffffffffffff7fdfffffffffffffffffff","data":{"slot":"348240","index":"2","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x89dde857bc31a4cc5e71d6cc440c00b2b1ee85b758722aadc5c4da0a939523de7532aabcfef4e80f84094924bb69d80d0a3d702b85859c5fce0433b6d0f7bc302af866ef7a9234a75be7bbd91b32256126808ffdf65ac0ce07a33afbaa16c575"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"8","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x891fbba500eee2cf2f5734d3bf8445e8684376e47469692d44e87fc8a295616d9f29410afc2d6ff2bc649618b33b417e13de4e152099aac054f4d35df4cd79234b6df1edcf2393b7ebc0f2ecf61f4604232b96830e0dbff9311408dad4479667"},{"aggregation_bits":"0xfffffffffffbffffffffefffffffff5fff","data":{"slot":"348240","index":"14","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9ab0354d0d61eb6b5f2184dc3bd0c8416cca74f2c913c6aaca653a87dd2c4b8ba2471aa450e0fa170573637c49dc8920eb84970fea4230d7b3c3c8c8152c782e912b29bc19a6de05dc36c1b44db2f649f31673b4751e1b22f17021833ca9cc8"},{"aggregation_bits":"0xfffffebffffbf7ffeffffbffffffffffff","data":{"slot":"348240","index":"5","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8e17aa835e6343f708e73e432b7268741f60565f5bb6ef62b5fba892438ca5474a14c0382609e14624058f3fab120e8902ad3f667cf14418836ce120f3bbf50ea3c15923c881e599227cc3a2758ef9a2cd08bd3b862bd711a875e27477ac347c"},{"aggregation_bits":"0xfffffffffffefffffffffffeffffffffff","data":{"slot":"348240","index":"10","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xa0909f67a7745300cee6278605e3cb79e5a9564cd6e81ac379b285e0eb6e1849537326b546079d7bf676c8e33a166cad00ab74a396f12c9f4851fb64612f6aeb911db550e0aeae88e1b90831a5a858ae64f9262f67403327d85fcb345df9fca4"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"9","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x886d038ddd7598cfda720dfe1caf83e030e24b207bbc0c97d012fbf5accbaa2f63366f32fe643aa1fdf6c8282480cd51165710bb786d77ecfb72ef7cc9d55e342c94fb57f5a75d50a0d486ecdf014bb08e0195f24202911c86efb5b46b2167ab"}],"deposits":[],"voluntary_exits":[],"sync_aggregate":{"sync_committee_bits":"0xffffffffffffffffffff7edfffffffff7ffffffffffffffffffffffffffff7ffdf7ffffffff7fffffefffffffffffffbfffffffffdffffffffffffffffffffff","sync_committee_signature":"0x877de19f5fff89de5af36954d4c7f7f5c2ccf6f8dc39fe7e3eb87c3357fca26f0af747dffd0f992c8844a20763e9f8a51858d0be70ce610055c6421d340160adec0ddcb706a7d7a5c45edff7b5f9b9a039fce093cea41c7a5699834f9de48b94"},"execution_payload_header":{"parent_hash":"0xa330251430b91a6fb5342f30a1f527dc76499c03a411464235951dbd51b94d9f","fee_recipient":"0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134","state_root":"0x079f2cc22a29388fd4fc20f451cbaa3ff39845d68b2c368ff7be314617418e38","receipts_root":"0xed980a4cf6df8ba330c14ed9fe0597ec20515f44e5a9adfd2f7b72aa14890996","logs_bloom":"0x0000000400000008000008000040000000000000000000001000104880000200000004000000400000000204000020002000000000000000000000000022000800000004000000000002000c000000000000000000000100000000000000000000000000000000000000000000000040000000000040000001000014000000010002104000000000000000000000000000000000000000000000000000000080020000000000000000002400000000000001000000000002000200102000000040100002000000000000000000000000000000000000000800000000000000000010000000000000000000000000000000000400002000000000000000200000","prev_randao":"0x86cc02ef030b0c147321a7f94158c1b33cb730f8baac3c59955b983fda3ae39b","block_number":"330714","gas_limit":"30000000","gas_used":"369098","timestamp":"1679442492","extra_data":"0x","base_fee_per_gas":"7","block_hash":"0x4ab1ced57222819bf6a6b6c1456715011585599a1cef18b060eb364811bbb14e","transactions_root":"0x6d47bae3b4963cbde00ec39bbd6442540afe26f8005e73722489904836008bfc","withdrawals_root":"0x5dc5f3ff8bade8e1dd04e5cf56292b2a194a2829e1c8e8b4a627d95e08296ba3","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"bls_to_execution_changes":[],"blob_kzg_commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"]}},"blinded_blob_sidecars":true}`), + err: "invalid JSON: json: cannot unmarshal bool into Go struct field blindedBlockContentsJSON.blinded_blob_sidecars of type []*deneb.BlindedBlobSidecar", + }, + { + name: "BlindedBlobSidecarWrongType", + input: []byte(`{"blinded_block":{"slot":"348241","proposer_index":"35822","parent_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","state_root":"0x4f6e0857501da4ab1d72f0c122869e1c084e16daa96613b64914aada28d0dc28","body":{"randao_reveal":"0xb2b7d2e89bb4a4aa6a377972651bb9041cb59af8eedd19568d699fc0866189d3fd78cc93c0e63877b7e2bd6d34d1597c0afd4508aa99b6e882c2cb1ac6f424adba29afd46d1737124300ad72177715fcce8584dd25a06c45bfe9a8ccabd6175d","eth1_data":{"deposit_root":"0x704964a5ad034a440f4f29ff1875986db66adbca45dc0014e439349c7e10194f","deposit_count":"4933","block_hash":"0x9c69de2814a7c3e3751654511372937627dacc3187bf457892789f3f5533c794"},"graffiti":"0x74656b752d626573750000000000000000000000000000000000000000000000","proposer_slashings":[],"attester_slashings":[],"attestations":[{"aggregation_bits":"0xffffffffffffffffffffffffffffff5fff","data":{"slot":"348240","index":"7","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x92da7bf78eb364219f85af2388d7ac7ddbea1934786d75875486ec9fceb310eee131dcfea131bdf4593d3c431b31b2900bb48ebb7ab02e17524d86a4e132883246df8ce427e935dd9e20c422cdf8eb135b3cc45b86fe4c2f592fb4899eb22f7c"},{"aggregation_bits":"0xffdffffffffffff5fffffffffffffffffd","data":{"slot":"348240","index":"3","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x88cce1f9fbf651e52a6ab71dea2f4025702021744aac90fb2997f82bac6c192e295ae39b2a430546cb102bf8b68f687e0f40a5179bc293e1424e37d694ef1ad6b3b8de72a0e7fbbe97aeafe6f47e949d415381fbbb090e3135224d5b324eefcb"},{"aggregation_bits":"0xffffffffffefffffffffbfffff7fffdfff","data":{"slot":"348240","index":"11","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x82186d946dfde2ab3b5fcf5bd858fadeec7fa9729f28527e209d16a1d9b4d635558cad6f8de8cee12caa2a4fc5459fb911ca17cbbecfd22e83c82e244ad7a8c8c849a1e03ee88bf0d338c633c2acfefd142574897cd78f9076b69f6e370e3751"},{"aggregation_bits":"0xfffdffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"4","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9c5ee50f800fe2619d1d0fe46a2fb00a64bcf2613e46a40b579ce6a39c4f6cd71a46790757ccc3df8f5f82e34c77c8d084f525ea8a4bd5bd10190496644be0740ace3d217e43af15229a8023d58e583cfec849fab10169225444f4f4ecc66a8"},{"aggregation_bits":"0xffffffffeffffffffffffdffffffffffff","data":{"slot":"348240","index":"12","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91e4ee5c0d6bb54d6856cee653c6859f635cebf9c51bef524d6f439cf6d1c69bea5fcb3e4c067c178cfa4518a76baba909b18189a864f38020f44b2cd5223a11e42d58aaedfa2f004710a72a704357874850842a1493017eca6e473d01395932"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"13","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8c376c5bb5ada745ba8cb8ce2aae103f4e3f85549ceaacaf312b1fa8e6d2ee5232149a926dcfd58ffa1f50f710eb4edc10943bbd40a601f2fb4d53104a59c0663a397744b59f1fa0744bba49f22afc3bab47045ebb42e61dac41ad44c6bf28f4"},{"aggregation_bits":"0xfffffffffffffffffffffffffffeffffff","data":{"slot":"348240","index":"1","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xaf11c64ce957f2a1686d12b07d0fbc170d89e48490e326cd73ef761ba042bddc01e48e5fc39953c6113df0a989d75e750d5b9d75155259508c2bbdd53903967f893e24f2f7f751f4a05b0fb1cb2b9084ce8543690a8a623599308d6c190fca4a"},{"aggregation_bits":"0xfffffff5fffffffffdfffbbffffff7ffff","data":{"slot":"348240","index":"6","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91075da401796a4341ab9a850ff330c9b0d996ca12b9970ec15a4b40fee652edd043e0c9f9d81529621b3a7970e676f619d7a39af67bf193af4441b5447f199f02d75a26c32181569cddc0a237b7064971539f80811fe40e9362d4d9242404ed"},{"aggregation_bits":"0xfffffffdfffffffffffffdfffffeffffff","data":{"slot":"348240","index":"0","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xad9aa5aa9b9c022036fbb81a0aca626b19a2ccd7c7ee6efa5b2a454f5ffb5d75d00e5563b31319b3a0ad1e0ef6f512be00fb8c39243004a1133610344473953dfcf06c3bd53f00255de6983927acd8624b0131fe9d8a085062747d70972b4713"},{"aggregation_bits":"0xffffffffffff7fdfffffffffffffffffff","data":{"slot":"348240","index":"2","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x89dde857bc31a4cc5e71d6cc440c00b2b1ee85b758722aadc5c4da0a939523de7532aabcfef4e80f84094924bb69d80d0a3d702b85859c5fce0433b6d0f7bc302af866ef7a9234a75be7bbd91b32256126808ffdf65ac0ce07a33afbaa16c575"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"8","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x891fbba500eee2cf2f5734d3bf8445e8684376e47469692d44e87fc8a295616d9f29410afc2d6ff2bc649618b33b417e13de4e152099aac054f4d35df4cd79234b6df1edcf2393b7ebc0f2ecf61f4604232b96830e0dbff9311408dad4479667"},{"aggregation_bits":"0xfffffffffffbffffffffefffffffff5fff","data":{"slot":"348240","index":"14","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9ab0354d0d61eb6b5f2184dc3bd0c8416cca74f2c913c6aaca653a87dd2c4b8ba2471aa450e0fa170573637c49dc8920eb84970fea4230d7b3c3c8c8152c782e912b29bc19a6de05dc36c1b44db2f649f31673b4751e1b22f17021833ca9cc8"},{"aggregation_bits":"0xfffffebffffbf7ffeffffbffffffffffff","data":{"slot":"348240","index":"5","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8e17aa835e6343f708e73e432b7268741f60565f5bb6ef62b5fba892438ca5474a14c0382609e14624058f3fab120e8902ad3f667cf14418836ce120f3bbf50ea3c15923c881e599227cc3a2758ef9a2cd08bd3b862bd711a875e27477ac347c"},{"aggregation_bits":"0xfffffffffffefffffffffffeffffffffff","data":{"slot":"348240","index":"10","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xa0909f67a7745300cee6278605e3cb79e5a9564cd6e81ac379b285e0eb6e1849537326b546079d7bf676c8e33a166cad00ab74a396f12c9f4851fb64612f6aeb911db550e0aeae88e1b90831a5a858ae64f9262f67403327d85fcb345df9fca4"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"9","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x886d038ddd7598cfda720dfe1caf83e030e24b207bbc0c97d012fbf5accbaa2f63366f32fe643aa1fdf6c8282480cd51165710bb786d77ecfb72ef7cc9d55e342c94fb57f5a75d50a0d486ecdf014bb08e0195f24202911c86efb5b46b2167ab"}],"deposits":[],"voluntary_exits":[],"sync_aggregate":{"sync_committee_bits":"0xffffffffffffffffffff7edfffffffff7ffffffffffffffffffffffffffff7ffdf7ffffffff7fffffefffffffffffffbfffffffffdffffffffffffffffffffff","sync_committee_signature":"0x877de19f5fff89de5af36954d4c7f7f5c2ccf6f8dc39fe7e3eb87c3357fca26f0af747dffd0f992c8844a20763e9f8a51858d0be70ce610055c6421d340160adec0ddcb706a7d7a5c45edff7b5f9b9a039fce093cea41c7a5699834f9de48b94"},"execution_payload_header":{"parent_hash":"0xa330251430b91a6fb5342f30a1f527dc76499c03a411464235951dbd51b94d9f","fee_recipient":"0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134","state_root":"0x079f2cc22a29388fd4fc20f451cbaa3ff39845d68b2c368ff7be314617418e38","receipts_root":"0xed980a4cf6df8ba330c14ed9fe0597ec20515f44e5a9adfd2f7b72aa14890996","logs_bloom":"0x0000000400000008000008000040000000000000000000001000104880000200000004000000400000000204000020002000000000000000000000000022000800000004000000000002000c000000000000000000000100000000000000000000000000000000000000000000000040000000000040000001000014000000010002104000000000000000000000000000000000000000000000000000000080020000000000000000002400000000000001000000000002000200102000000040100002000000000000000000000000000000000000000800000000000000000010000000000000000000000000000000000400002000000000000000200000","prev_randao":"0x86cc02ef030b0c147321a7f94158c1b33cb730f8baac3c59955b983fda3ae39b","block_number":"330714","gas_limit":"30000000","gas_used":"369098","timestamp":"1679442492","extra_data":"0x","base_fee_per_gas":"7","block_hash":"0x4ab1ced57222819bf6a6b6c1456715011585599a1cef18b060eb364811bbb14e","transactions_root":"0x6d47bae3b4963cbde00ec39bbd6442540afe26f8005e73722489904836008bfc","withdrawals_root":"0x5dc5f3ff8bade8e1dd04e5cf56292b2a194a2829e1c8e8b4a627d95e08296ba3","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"bls_to_execution_changes":[],"blob_kzg_commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"]}},"blinded_blob_sidecars":[true]}`), + err: "invalid JSON: invalid JSON: json: cannot unmarshal bool into Go value of type map[string]json.RawMessage", + }, + { + name: "BlindedBlobSidecarInvalid", + input: []byte(`{"blinded_block":{"slot":"348241","proposer_index":"35822","parent_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","state_root":"0x4f6e0857501da4ab1d72f0c122869e1c084e16daa96613b64914aada28d0dc28","body":{"randao_reveal":"0xb2b7d2e89bb4a4aa6a377972651bb9041cb59af8eedd19568d699fc0866189d3fd78cc93c0e63877b7e2bd6d34d1597c0afd4508aa99b6e882c2cb1ac6f424adba29afd46d1737124300ad72177715fcce8584dd25a06c45bfe9a8ccabd6175d","eth1_data":{"deposit_root":"0x704964a5ad034a440f4f29ff1875986db66adbca45dc0014e439349c7e10194f","deposit_count":"4933","block_hash":"0x9c69de2814a7c3e3751654511372937627dacc3187bf457892789f3f5533c794"},"graffiti":"0x74656b752d626573750000000000000000000000000000000000000000000000","proposer_slashings":[],"attester_slashings":[],"attestations":[{"aggregation_bits":"0xffffffffffffffffffffffffffffff5fff","data":{"slot":"348240","index":"7","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x92da7bf78eb364219f85af2388d7ac7ddbea1934786d75875486ec9fceb310eee131dcfea131bdf4593d3c431b31b2900bb48ebb7ab02e17524d86a4e132883246df8ce427e935dd9e20c422cdf8eb135b3cc45b86fe4c2f592fb4899eb22f7c"},{"aggregation_bits":"0xffdffffffffffff5fffffffffffffffffd","data":{"slot":"348240","index":"3","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x88cce1f9fbf651e52a6ab71dea2f4025702021744aac90fb2997f82bac6c192e295ae39b2a430546cb102bf8b68f687e0f40a5179bc293e1424e37d694ef1ad6b3b8de72a0e7fbbe97aeafe6f47e949d415381fbbb090e3135224d5b324eefcb"},{"aggregation_bits":"0xffffffffffefffffffffbfffff7fffdfff","data":{"slot":"348240","index":"11","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x82186d946dfde2ab3b5fcf5bd858fadeec7fa9729f28527e209d16a1d9b4d635558cad6f8de8cee12caa2a4fc5459fb911ca17cbbecfd22e83c82e244ad7a8c8c849a1e03ee88bf0d338c633c2acfefd142574897cd78f9076b69f6e370e3751"},{"aggregation_bits":"0xfffdffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"4","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9c5ee50f800fe2619d1d0fe46a2fb00a64bcf2613e46a40b579ce6a39c4f6cd71a46790757ccc3df8f5f82e34c77c8d084f525ea8a4bd5bd10190496644be0740ace3d217e43af15229a8023d58e583cfec849fab10169225444f4f4ecc66a8"},{"aggregation_bits":"0xffffffffeffffffffffffdffffffffffff","data":{"slot":"348240","index":"12","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91e4ee5c0d6bb54d6856cee653c6859f635cebf9c51bef524d6f439cf6d1c69bea5fcb3e4c067c178cfa4518a76baba909b18189a864f38020f44b2cd5223a11e42d58aaedfa2f004710a72a704357874850842a1493017eca6e473d01395932"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"13","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8c376c5bb5ada745ba8cb8ce2aae103f4e3f85549ceaacaf312b1fa8e6d2ee5232149a926dcfd58ffa1f50f710eb4edc10943bbd40a601f2fb4d53104a59c0663a397744b59f1fa0744bba49f22afc3bab47045ebb42e61dac41ad44c6bf28f4"},{"aggregation_bits":"0xfffffffffffffffffffffffffffeffffff","data":{"slot":"348240","index":"1","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xaf11c64ce957f2a1686d12b07d0fbc170d89e48490e326cd73ef761ba042bddc01e48e5fc39953c6113df0a989d75e750d5b9d75155259508c2bbdd53903967f893e24f2f7f751f4a05b0fb1cb2b9084ce8543690a8a623599308d6c190fca4a"},{"aggregation_bits":"0xfffffff5fffffffffdfffbbffffff7ffff","data":{"slot":"348240","index":"6","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91075da401796a4341ab9a850ff330c9b0d996ca12b9970ec15a4b40fee652edd043e0c9f9d81529621b3a7970e676f619d7a39af67bf193af4441b5447f199f02d75a26c32181569cddc0a237b7064971539f80811fe40e9362d4d9242404ed"},{"aggregation_bits":"0xfffffffdfffffffffffffdfffffeffffff","data":{"slot":"348240","index":"0","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xad9aa5aa9b9c022036fbb81a0aca626b19a2ccd7c7ee6efa5b2a454f5ffb5d75d00e5563b31319b3a0ad1e0ef6f512be00fb8c39243004a1133610344473953dfcf06c3bd53f00255de6983927acd8624b0131fe9d8a085062747d70972b4713"},{"aggregation_bits":"0xffffffffffff7fdfffffffffffffffffff","data":{"slot":"348240","index":"2","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x89dde857bc31a4cc5e71d6cc440c00b2b1ee85b758722aadc5c4da0a939523de7532aabcfef4e80f84094924bb69d80d0a3d702b85859c5fce0433b6d0f7bc302af866ef7a9234a75be7bbd91b32256126808ffdf65ac0ce07a33afbaa16c575"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"8","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x891fbba500eee2cf2f5734d3bf8445e8684376e47469692d44e87fc8a295616d9f29410afc2d6ff2bc649618b33b417e13de4e152099aac054f4d35df4cd79234b6df1edcf2393b7ebc0f2ecf61f4604232b96830e0dbff9311408dad4479667"},{"aggregation_bits":"0xfffffffffffbffffffffefffffffff5fff","data":{"slot":"348240","index":"14","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9ab0354d0d61eb6b5f2184dc3bd0c8416cca74f2c913c6aaca653a87dd2c4b8ba2471aa450e0fa170573637c49dc8920eb84970fea4230d7b3c3c8c8152c782e912b29bc19a6de05dc36c1b44db2f649f31673b4751e1b22f17021833ca9cc8"},{"aggregation_bits":"0xfffffebffffbf7ffeffffbffffffffffff","data":{"slot":"348240","index":"5","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8e17aa835e6343f708e73e432b7268741f60565f5bb6ef62b5fba892438ca5474a14c0382609e14624058f3fab120e8902ad3f667cf14418836ce120f3bbf50ea3c15923c881e599227cc3a2758ef9a2cd08bd3b862bd711a875e27477ac347c"},{"aggregation_bits":"0xfffffffffffefffffffffffeffffffffff","data":{"slot":"348240","index":"10","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xa0909f67a7745300cee6278605e3cb79e5a9564cd6e81ac379b285e0eb6e1849537326b546079d7bf676c8e33a166cad00ab74a396f12c9f4851fb64612f6aeb911db550e0aeae88e1b90831a5a858ae64f9262f67403327d85fcb345df9fca4"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"9","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x886d038ddd7598cfda720dfe1caf83e030e24b207bbc0c97d012fbf5accbaa2f63366f32fe643aa1fdf6c8282480cd51165710bb786d77ecfb72ef7cc9d55e342c94fb57f5a75d50a0d486ecdf014bb08e0195f24202911c86efb5b46b2167ab"}],"deposits":[],"voluntary_exits":[],"sync_aggregate":{"sync_committee_bits":"0xffffffffffffffffffff7edfffffffff7ffffffffffffffffffffffffffff7ffdf7ffffffff7fffffefffffffffffffbfffffffffdffffffffffffffffffffff","sync_committee_signature":"0x877de19f5fff89de5af36954d4c7f7f5c2ccf6f8dc39fe7e3eb87c3357fca26f0af747dffd0f992c8844a20763e9f8a51858d0be70ce610055c6421d340160adec0ddcb706a7d7a5c45edff7b5f9b9a039fce093cea41c7a5699834f9de48b94"},"execution_payload_header":{"parent_hash":"0xa330251430b91a6fb5342f30a1f527dc76499c03a411464235951dbd51b94d9f","fee_recipient":"0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134","state_root":"0x079f2cc22a29388fd4fc20f451cbaa3ff39845d68b2c368ff7be314617418e38","receipts_root":"0xed980a4cf6df8ba330c14ed9fe0597ec20515f44e5a9adfd2f7b72aa14890996","logs_bloom":"0x0000000400000008000008000040000000000000000000001000104880000200000004000000400000000204000020002000000000000000000000000022000800000004000000000002000c000000000000000000000100000000000000000000000000000000000000000000000040000000000040000001000014000000010002104000000000000000000000000000000000000000000000000000000080020000000000000000002400000000000001000000000002000200102000000040100002000000000000000000000000000000000000000800000000000000000010000000000000000000000000000000000400002000000000000000200000","prev_randao":"0x86cc02ef030b0c147321a7f94158c1b33cb730f8baac3c59955b983fda3ae39b","block_number":"330714","gas_limit":"30000000","gas_used":"369098","timestamp":"1679442492","extra_data":"0x","base_fee_per_gas":"7","block_hash":"0x4ab1ced57222819bf6a6b6c1456715011585599a1cef18b060eb364811bbb14e","transactions_root":"0x6d47bae3b4963cbde00ec39bbd6442540afe26f8005e73722489904836008bfc","withdrawals_root":"0x5dc5f3ff8bade8e1dd04e5cf56292b2a194a2829e1c8e8b4a627d95e08296ba3","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"bls_to_execution_changes":[],"blob_kzg_commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"]}},"blinded_blob_sidecars":[{}]}`), + err: "invalid JSON: block_root: missing", + }, + { + name: "Good", + input: []byte(`{"blinded_block":{"slot":"348241","proposer_index":"35822","parent_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","state_root":"0x4f6e0857501da4ab1d72f0c122869e1c084e16daa96613b64914aada28d0dc28","body":{"randao_reveal":"0xb2b7d2e89bb4a4aa6a377972651bb9041cb59af8eedd19568d699fc0866189d3fd78cc93c0e63877b7e2bd6d34d1597c0afd4508aa99b6e882c2cb1ac6f424adba29afd46d1737124300ad72177715fcce8584dd25a06c45bfe9a8ccabd6175d","eth1_data":{"deposit_root":"0x704964a5ad034a440f4f29ff1875986db66adbca45dc0014e439349c7e10194f","deposit_count":"4933","block_hash":"0x9c69de2814a7c3e3751654511372937627dacc3187bf457892789f3f5533c794"},"graffiti":"0x74656b752d626573750000000000000000000000000000000000000000000000","proposer_slashings":[],"attester_slashings":[],"attestations":[{"aggregation_bits":"0xffffffffffffffffffffffffffffff5fff","data":{"slot":"348240","index":"7","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x92da7bf78eb364219f85af2388d7ac7ddbea1934786d75875486ec9fceb310eee131dcfea131bdf4593d3c431b31b2900bb48ebb7ab02e17524d86a4e132883246df8ce427e935dd9e20c422cdf8eb135b3cc45b86fe4c2f592fb4899eb22f7c"},{"aggregation_bits":"0xffdffffffffffff5fffffffffffffffffd","data":{"slot":"348240","index":"3","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x88cce1f9fbf651e52a6ab71dea2f4025702021744aac90fb2997f82bac6c192e295ae39b2a430546cb102bf8b68f687e0f40a5179bc293e1424e37d694ef1ad6b3b8de72a0e7fbbe97aeafe6f47e949d415381fbbb090e3135224d5b324eefcb"},{"aggregation_bits":"0xffffffffffefffffffffbfffff7fffdfff","data":{"slot":"348240","index":"11","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x82186d946dfde2ab3b5fcf5bd858fadeec7fa9729f28527e209d16a1d9b4d635558cad6f8de8cee12caa2a4fc5459fb911ca17cbbecfd22e83c82e244ad7a8c8c849a1e03ee88bf0d338c633c2acfefd142574897cd78f9076b69f6e370e3751"},{"aggregation_bits":"0xfffdffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"4","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9c5ee50f800fe2619d1d0fe46a2fb00a64bcf2613e46a40b579ce6a39c4f6cd71a46790757ccc3df8f5f82e34c77c8d084f525ea8a4bd5bd10190496644be0740ace3d217e43af15229a8023d58e583cfec849fab10169225444f4f4ecc66a8"},{"aggregation_bits":"0xffffffffeffffffffffffdffffffffffff","data":{"slot":"348240","index":"12","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91e4ee5c0d6bb54d6856cee653c6859f635cebf9c51bef524d6f439cf6d1c69bea5fcb3e4c067c178cfa4518a76baba909b18189a864f38020f44b2cd5223a11e42d58aaedfa2f004710a72a704357874850842a1493017eca6e473d01395932"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"13","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8c376c5bb5ada745ba8cb8ce2aae103f4e3f85549ceaacaf312b1fa8e6d2ee5232149a926dcfd58ffa1f50f710eb4edc10943bbd40a601f2fb4d53104a59c0663a397744b59f1fa0744bba49f22afc3bab47045ebb42e61dac41ad44c6bf28f4"},{"aggregation_bits":"0xfffffffffffffffffffffffffffeffffff","data":{"slot":"348240","index":"1","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xaf11c64ce957f2a1686d12b07d0fbc170d89e48490e326cd73ef761ba042bddc01e48e5fc39953c6113df0a989d75e750d5b9d75155259508c2bbdd53903967f893e24f2f7f751f4a05b0fb1cb2b9084ce8543690a8a623599308d6c190fca4a"},{"aggregation_bits":"0xfffffff5fffffffffdfffbbffffff7ffff","data":{"slot":"348240","index":"6","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91075da401796a4341ab9a850ff330c9b0d996ca12b9970ec15a4b40fee652edd043e0c9f9d81529621b3a7970e676f619d7a39af67bf193af4441b5447f199f02d75a26c32181569cddc0a237b7064971539f80811fe40e9362d4d9242404ed"},{"aggregation_bits":"0xfffffffdfffffffffffffdfffffeffffff","data":{"slot":"348240","index":"0","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xad9aa5aa9b9c022036fbb81a0aca626b19a2ccd7c7ee6efa5b2a454f5ffb5d75d00e5563b31319b3a0ad1e0ef6f512be00fb8c39243004a1133610344473953dfcf06c3bd53f00255de6983927acd8624b0131fe9d8a085062747d70972b4713"},{"aggregation_bits":"0xffffffffffff7fdfffffffffffffffffff","data":{"slot":"348240","index":"2","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x89dde857bc31a4cc5e71d6cc440c00b2b1ee85b758722aadc5c4da0a939523de7532aabcfef4e80f84094924bb69d80d0a3d702b85859c5fce0433b6d0f7bc302af866ef7a9234a75be7bbd91b32256126808ffdf65ac0ce07a33afbaa16c575"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"8","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x891fbba500eee2cf2f5734d3bf8445e8684376e47469692d44e87fc8a295616d9f29410afc2d6ff2bc649618b33b417e13de4e152099aac054f4d35df4cd79234b6df1edcf2393b7ebc0f2ecf61f4604232b96830e0dbff9311408dad4479667"},{"aggregation_bits":"0xfffffffffffbffffffffefffffffff5fff","data":{"slot":"348240","index":"14","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9ab0354d0d61eb6b5f2184dc3bd0c8416cca74f2c913c6aaca653a87dd2c4b8ba2471aa450e0fa170573637c49dc8920eb84970fea4230d7b3c3c8c8152c782e912b29bc19a6de05dc36c1b44db2f649f31673b4751e1b22f17021833ca9cc8"},{"aggregation_bits":"0xfffffebffffbf7ffeffffbffffffffffff","data":{"slot":"348240","index":"5","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8e17aa835e6343f708e73e432b7268741f60565f5bb6ef62b5fba892438ca5474a14c0382609e14624058f3fab120e8902ad3f667cf14418836ce120f3bbf50ea3c15923c881e599227cc3a2758ef9a2cd08bd3b862bd711a875e27477ac347c"},{"aggregation_bits":"0xfffffffffffefffffffffffeffffffffff","data":{"slot":"348240","index":"10","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xa0909f67a7745300cee6278605e3cb79e5a9564cd6e81ac379b285e0eb6e1849537326b546079d7bf676c8e33a166cad00ab74a396f12c9f4851fb64612f6aeb911db550e0aeae88e1b90831a5a858ae64f9262f67403327d85fcb345df9fca4"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"9","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x886d038ddd7598cfda720dfe1caf83e030e24b207bbc0c97d012fbf5accbaa2f63366f32fe643aa1fdf6c8282480cd51165710bb786d77ecfb72ef7cc9d55e342c94fb57f5a75d50a0d486ecdf014bb08e0195f24202911c86efb5b46b2167ab"}],"deposits":[],"voluntary_exits":[],"sync_aggregate":{"sync_committee_bits":"0xffffffffffffffffffff7edfffffffff7ffffffffffffffffffffffffffff7ffdf7ffffffff7fffffefffffffffffffbfffffffffdffffffffffffffffffffff","sync_committee_signature":"0x877de19f5fff89de5af36954d4c7f7f5c2ccf6f8dc39fe7e3eb87c3357fca26f0af747dffd0f992c8844a20763e9f8a51858d0be70ce610055c6421d340160adec0ddcb706a7d7a5c45edff7b5f9b9a039fce093cea41c7a5699834f9de48b94"},"execution_payload_header":{"parent_hash":"0xa330251430b91a6fb5342f30a1f527dc76499c03a411464235951dbd51b94d9f","fee_recipient":"0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134","state_root":"0x079f2cc22a29388fd4fc20f451cbaa3ff39845d68b2c368ff7be314617418e38","receipts_root":"0xed980a4cf6df8ba330c14ed9fe0597ec20515f44e5a9adfd2f7b72aa14890996","logs_bloom":"0x0000000400000008000008000040000000000000000000001000104880000200000004000000400000000204000020002000000000000000000000000022000800000004000000000002000c000000000000000000000100000000000000000000000000000000000000000000000040000000000040000001000014000000010002104000000000000000000000000000000000000000000000000000000080020000000000000000002400000000000001000000000002000200102000000040100002000000000000000000000000000000000000000800000000000000000010000000000000000000000000000000000400002000000000000000200000","prev_randao":"0x86cc02ef030b0c147321a7f94158c1b33cb730f8baac3c59955b983fda3ae39b","block_number":"330714","gas_limit":"30000000","gas_used":"369098","timestamp":"1679442492","extra_data":"0x","base_fee_per_gas":"7","block_hash":"0x4ab1ced57222819bf6a6b6c1456715011585599a1cef18b060eb364811bbb14e","transactions_root":"0x6d47bae3b4963cbde00ec39bbd6442540afe26f8005e73722489904836008bfc","withdrawals_root":"0x5dc5f3ff8bade8e1dd04e5cf56292b2a194a2829e1c8e8b4a627d95e08296ba3","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"bls_to_execution_changes":[],"blob_kzg_commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"]}},"blinded_blob_sidecars":[{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"},{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"}]}`), + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + var res deneb.BlindedBlockContents + err := json.Unmarshal(test.input, &res) + if test.err != "" { + require.EqualError(t, err, test.err) + } else { + require.NoError(t, err) + rt, err := json.Marshal(&res) + require.NoError(t, err) + assert.Equal(t, string(test.input), string(rt)) + } + }) + } +} + +func TestBlindedBlockContentsYAML(t *testing.T) { + tests := []struct { + name string + input []byte + root []byte + err string + }{ + { + name: "Good", + input: []byte(`{blinded_block: {slot: 348241, proposer_index: 35822, parent_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', state_root: '0x4f6e0857501da4ab1d72f0c122869e1c084e16daa96613b64914aada28d0dc28', body: {randao_reveal: '0xb2b7d2e89bb4a4aa6a377972651bb9041cb59af8eedd19568d699fc0866189d3fd78cc93c0e63877b7e2bd6d34d1597c0afd4508aa99b6e882c2cb1ac6f424adba29afd46d1737124300ad72177715fcce8584dd25a06c45bfe9a8ccabd6175d', eth1_data: {deposit_root: '0x704964a5ad034a440f4f29ff1875986db66adbca45dc0014e439349c7e10194f', deposit_count: 4933, block_hash: '0x9c69de2814a7c3e3751654511372937627dacc3187bf457892789f3f5533c794'}, graffiti: '0x74656b752d626573750000000000000000000000000000000000000000000000', proposer_slashings: [], attester_slashings: [], attestations: [{aggregation_bits: '0xffffffffffffffffffffffffffffff5fff', data: {slot: 348240, index: 7, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x92da7bf78eb364219f85af2388d7ac7ddbea1934786d75875486ec9fceb310eee131dcfea131bdf4593d3c431b31b2900bb48ebb7ab02e17524d86a4e132883246df8ce427e935dd9e20c422cdf8eb135b3cc45b86fe4c2f592fb4899eb22f7c'}, {aggregation_bits: '0xffdffffffffffff5fffffffffffffffffd', data: {slot: 348240, index: 3, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x88cce1f9fbf651e52a6ab71dea2f4025702021744aac90fb2997f82bac6c192e295ae39b2a430546cb102bf8b68f687e0f40a5179bc293e1424e37d694ef1ad6b3b8de72a0e7fbbe97aeafe6f47e949d415381fbbb090e3135224d5b324eefcb'}, {aggregation_bits: '0xffffffffffefffffffffbfffff7fffdfff', data: {slot: 348240, index: 11, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x82186d946dfde2ab3b5fcf5bd858fadeec7fa9729f28527e209d16a1d9b4d635558cad6f8de8cee12caa2a4fc5459fb911ca17cbbecfd22e83c82e244ad7a8c8c849a1e03ee88bf0d338c633c2acfefd142574897cd78f9076b69f6e370e3751'}, {aggregation_bits: '0xfffdffffffffffffffffffffffffffffff', data: {slot: 348240, index: 4, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0xb9c5ee50f800fe2619d1d0fe46a2fb00a64bcf2613e46a40b579ce6a39c4f6cd71a46790757ccc3df8f5f82e34c77c8d084f525ea8a4bd5bd10190496644be0740ace3d217e43af15229a8023d58e583cfec849fab10169225444f4f4ecc66a8'}, {aggregation_bits: '0xffffffffeffffffffffffdffffffffffff', data: {slot: 348240, index: 12, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x91e4ee5c0d6bb54d6856cee653c6859f635cebf9c51bef524d6f439cf6d1c69bea5fcb3e4c067c178cfa4518a76baba909b18189a864f38020f44b2cd5223a11e42d58aaedfa2f004710a72a704357874850842a1493017eca6e473d01395932'}, {aggregation_bits: '0xffffffffffffffffffffffffffffffffff', data: {slot: 348240, index: 13, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x8c376c5bb5ada745ba8cb8ce2aae103f4e3f85549ceaacaf312b1fa8e6d2ee5232149a926dcfd58ffa1f50f710eb4edc10943bbd40a601f2fb4d53104a59c0663a397744b59f1fa0744bba49f22afc3bab47045ebb42e61dac41ad44c6bf28f4'}, {aggregation_bits: '0xfffffffffffffffffffffffffffeffffff', data: {slot: 348240, index: 1, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0xaf11c64ce957f2a1686d12b07d0fbc170d89e48490e326cd73ef761ba042bddc01e48e5fc39953c6113df0a989d75e750d5b9d75155259508c2bbdd53903967f893e24f2f7f751f4a05b0fb1cb2b9084ce8543690a8a623599308d6c190fca4a'}, {aggregation_bits: '0xfffffff5fffffffffdfffbbffffff7ffff', data: {slot: 348240, index: 6, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x91075da401796a4341ab9a850ff330c9b0d996ca12b9970ec15a4b40fee652edd043e0c9f9d81529621b3a7970e676f619d7a39af67bf193af4441b5447f199f02d75a26c32181569cddc0a237b7064971539f80811fe40e9362d4d9242404ed'}, {aggregation_bits: '0xfffffffdfffffffffffffdfffffeffffff', data: {slot: 348240, index: 0, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0xad9aa5aa9b9c022036fbb81a0aca626b19a2ccd7c7ee6efa5b2a454f5ffb5d75d00e5563b31319b3a0ad1e0ef6f512be00fb8c39243004a1133610344473953dfcf06c3bd53f00255de6983927acd8624b0131fe9d8a085062747d70972b4713'}, {aggregation_bits: '0xffffffffffff7fdfffffffffffffffffff', data: {slot: 348240, index: 2, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x89dde857bc31a4cc5e71d6cc440c00b2b1ee85b758722aadc5c4da0a939523de7532aabcfef4e80f84094924bb69d80d0a3d702b85859c5fce0433b6d0f7bc302af866ef7a9234a75be7bbd91b32256126808ffdf65ac0ce07a33afbaa16c575'}, {aggregation_bits: '0xffffffffffffffffffffffffffffffffff', data: {slot: 348240, index: 8, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x891fbba500eee2cf2f5734d3bf8445e8684376e47469692d44e87fc8a295616d9f29410afc2d6ff2bc649618b33b417e13de4e152099aac054f4d35df4cd79234b6df1edcf2393b7ebc0f2ecf61f4604232b96830e0dbff9311408dad4479667'}, {aggregation_bits: '0xfffffffffffbffffffffefffffffff5fff', data: {slot: 348240, index: 14, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0xb9ab0354d0d61eb6b5f2184dc3bd0c8416cca74f2c913c6aaca653a87dd2c4b8ba2471aa450e0fa170573637c49dc8920eb84970fea4230d7b3c3c8c8152c782e912b29bc19a6de05dc36c1b44db2f649f31673b4751e1b22f17021833ca9cc8'}, {aggregation_bits: '0xfffffebffffbf7ffeffffbffffffffffff', data: {slot: 348240, index: 5, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x8e17aa835e6343f708e73e432b7268741f60565f5bb6ef62b5fba892438ca5474a14c0382609e14624058f3fab120e8902ad3f667cf14418836ce120f3bbf50ea3c15923c881e599227cc3a2758ef9a2cd08bd3b862bd711a875e27477ac347c'}, {aggregation_bits: '0xfffffffffffefffffffffffeffffffffff', data: {slot: 348240, index: 10, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0xa0909f67a7745300cee6278605e3cb79e5a9564cd6e81ac379b285e0eb6e1849537326b546079d7bf676c8e33a166cad00ab74a396f12c9f4851fb64612f6aeb911db550e0aeae88e1b90831a5a858ae64f9262f67403327d85fcb345df9fca4'}, {aggregation_bits: '0xffffffffffffffffffffffffffffffffff', data: {slot: 348240, index: 9, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x886d038ddd7598cfda720dfe1caf83e030e24b207bbc0c97d012fbf5accbaa2f63366f32fe643aa1fdf6c8282480cd51165710bb786d77ecfb72ef7cc9d55e342c94fb57f5a75d50a0d486ecdf014bb08e0195f24202911c86efb5b46b2167ab'}], deposits: [], voluntary_exits: [], sync_aggregate: {sync_committee_bits: '0xffffffffffffffffffff7edfffffffff7ffffffffffffffffffffffffffff7ffdf7ffffffff7fffffefffffffffffffbfffffffffdffffffffffffffffffffff', sync_committee_signature: '0x877de19f5fff89de5af36954d4c7f7f5c2ccf6f8dc39fe7e3eb87c3357fca26f0af747dffd0f992c8844a20763e9f8a51858d0be70ce610055c6421d340160adec0ddcb706a7d7a5c45edff7b5f9b9a039fce093cea41c7a5699834f9de48b94'}, execution_payload_header: {parent_hash: '0xa330251430b91a6fb5342f30a1f527dc76499c03a411464235951dbd51b94d9f', fee_recipient: '0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134', state_root: '0x079f2cc22a29388fd4fc20f451cbaa3ff39845d68b2c368ff7be314617418e38', receipts_root: '0xed980a4cf6df8ba330c14ed9fe0597ec20515f44e5a9adfd2f7b72aa14890996', logs_bloom: '0x0000000400000008000008000040000000000000000000001000104880000200000004000000400000000204000020002000000000000000000000000022000800000004000000000002000c000000000000000000000100000000000000000000000000000000000000000000000040000000000040000001000014000000010002104000000000000000000000000000000000000000000000000000000080020000000000000000002400000000000001000000000002000200102000000040100002000000000000000000000000000000000000000800000000000000000010000000000000000000000000000000000400002000000000000000200000', prev_randao: '0x86cc02ef030b0c147321a7f94158c1b33cb730f8baac3c59955b983fda3ae39b', block_number: 330714, gas_limit: 30000000, gas_used: 369098, timestamp: 1679442492, extra_data: '0x', base_fee_per_gas: '7', block_hash: '0x4ab1ced57222819bf6a6b6c1456715011585599a1cef18b060eb364811bbb14e', transactions_root: '0x6d47bae3b4963cbde00ec39bbd6442540afe26f8005e73722489904836008bfc', withdrawals_root: '0x5dc5f3ff8bade8e1dd04e5cf56292b2a194a2829e1c8e8b4a627d95e08296ba3', data_gas_used: 4438756708366371443, excess_data_gas: 12504111653614393862}, bls_to_execution_changes: [], blob_kzg_commitments: ['0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f', '0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929']}}, blinded_blob_sidecars: [{block_root: '0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29', index: 17762875709721895328, slot: 12231583639632491026, block_parent_root: '0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4', proposer_index: 16148839969926959295, blob_root: '0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29', kzg_commitment: '0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6', kzg_proof: '0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff'}, {block_root: '0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29', index: 17762875709721895328, slot: 12231583639632491026, block_parent_root: '0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4', proposer_index: 16148839969926959295, blob_root: '0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29', kzg_commitment: '0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6', kzg_proof: '0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff'}]}`), + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + var res deneb.BlindedBlockContents + err := yaml.Unmarshal(test.input, &res) + if test.err != "" { + require.EqualError(t, err, test.err) + } else { + require.NoError(t, err) + rt, err := yaml.Marshal(&res) + require.NoError(t, err) + assert.Equal(t, res.String(), string(rt)) + rt = bytes.TrimSuffix(rt, []byte("\n")) + assert.Equal(t, string(test.input), string(rt)) + } + }) + } +} diff --git a/api/v1/deneb/blindedblockcontents_yaml.go b/api/v1/deneb/blindedblockcontents_yaml.go new file mode 100644 index 00000000..5a2611a6 --- /dev/null +++ b/api/v1/deneb/blindedblockcontents_yaml.go @@ -0,0 +1,54 @@ +// Copyright © 2023 Attestant Limited. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package deneb + +import ( + "bytes" + "encoding/json" + + "github.com/goccy/go-yaml" + "github.com/pkg/errors" +) + +// blindedBlockContentsYAML is the spec representation of the struct. +type blindedBlockContentsYAML struct { + BlindedBlock *BlindedBeaconBlock `json:"blinded_block"` + BlindedBlobSidecars []*BlindedBlobSidecar `json:"blinded_blob_sidecars"` +} + +// MarshalJSON implements json.Marshaler. +func (b *BlindedBlockContents) MarshalYAML() ([]byte, error) { + yamlBytes, err := yaml.MarshalWithOptions(&blindedBlockContentsYAML{ + BlindedBlock: b.BlindedBlock, + BlindedBlobSidecars: b.BlindedBlobSidecars, + }, yaml.Flow(true)) + if err != nil { + return nil, err + } + return bytes.ReplaceAll(yamlBytes, []byte(`"`), []byte(`'`)), nil +} + +// UnmarshalJSON implements json.Unmarshaler. +func (b *BlindedBlockContents) UnmarshalYAML(input []byte) error { + var data blindedBlockContentsYAML + if err := yaml.Unmarshal(input, &data); err != nil { + return errors.Wrap(err, "failed to unmarshal YAML") + } + bytes, err := json.Marshal(data) + if err != nil { + return errors.Wrap(err, "failed to marshal JSON") + } + + return b.UnmarshalJSON(bytes) +} diff --git a/api/v1/deneb/signedblindedblobsidecar.go b/api/v1/deneb/signedblindedblobsidecar.go new file mode 100644 index 00000000..bb77e45e --- /dev/null +++ b/api/v1/deneb/signedblindedblobsidecar.go @@ -0,0 +1,36 @@ +// Copyright © 2023 Attestant Limited. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package deneb + +import ( + "fmt" + + "github.com/attestantio/go-eth2-client/spec/phase0" + "github.com/goccy/go-yaml" +) + +// SignedBlindedBlobSidecar represents a data blob sidecar. +type SignedBlindedBlobSidecar struct { + Message *BlindedBlobSidecar + Signature phase0.BLSSignature `ssz-size:"96"` +} + +// String returns a string version of the structure. +func (s *SignedBlindedBlobSidecar) String() string { + data, err := yaml.Marshal(s) + if err != nil { + return fmt.Sprintf("ERR: %v", err) + } + return string(data) +} diff --git a/api/v1/deneb/signedblindedblobsidecar_json.go b/api/v1/deneb/signedblindedblobsidecar_json.go new file mode 100644 index 00000000..8b56fc8a --- /dev/null +++ b/api/v1/deneb/signedblindedblobsidecar_json.go @@ -0,0 +1,53 @@ +// Copyright © 2023 Attestant Limited. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package deneb + +import ( + "encoding/json" + + "github.com/attestantio/go-eth2-client/codecs" + "github.com/pkg/errors" +) + +// signedBlindedBlobSidecarJSON is the spec representation of the struct. +type signedBlindedBlobSidecarJSON struct { + Message *BlindedBlobSidecar `json:"message"` + Signature string `json:"signature"` +} + +// MarshalJSON implements json.Marshaler. +func (s *SignedBlindedBlobSidecar) MarshalJSON() ([]byte, error) { + return json.Marshal(&signedBlindedBlobSidecarJSON{ + Message: s.Message, + Signature: s.Signature.String(), + }) +} + +// UnmarshalJSON implements json.Unmarshaler. +func (s *SignedBlindedBlobSidecar) UnmarshalJSON(input []byte) error { + raw, err := codecs.RawJSON(&signedBlindedBlobSidecarJSON{}, input) + if err != nil { + return err + } + + if err := json.Unmarshal(raw["message"], &s.Message); err != nil { + return errors.Wrap(err, "message") + } + + if err := json.Unmarshal(raw["signature"], &s.Signature); err != nil { + return errors.Wrap(err, "signature") + } + + return nil +} diff --git a/api/v1/deneb/signedblindedblobsidecar_ssz.go b/api/v1/deneb/signedblindedblobsidecar_ssz.go new file mode 100644 index 00000000..aa5b9220 --- /dev/null +++ b/api/v1/deneb/signedblindedblobsidecar_ssz.go @@ -0,0 +1,88 @@ +// Code generated by fastssz. DO NOT EDIT. +// Hash: 53f7a78b79c00bbf864316c122774dbb8e8aae2e6c5245947a816bca4690d094 +// Version: 0.1.3 +package deneb + +import ( + ssz "github.com/ferranbt/fastssz" +) + +// MarshalSSZ ssz marshals the SignedBlindedBlobSidecar object +func (s *SignedBlindedBlobSidecar) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBlindedBlobSidecar object to a target array +func (s *SignedBlindedBlobSidecar) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(BlindedBlobSidecar) + } + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'Signature' + dst = append(dst, s.Signature[:]...) + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBlindedBlobSidecar object +func (s *SignedBlindedBlobSidecar) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size != 312 { + return ssz.ErrSize + } + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(BlindedBlobSidecar) + } + if err = s.Message.UnmarshalSSZ(buf[0:216]); err != nil { + return err + } + + // Field (1) 'Signature' + copy(s.Signature[:], buf[216:312]) + + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBlindedBlobSidecar object +func (s *SignedBlindedBlobSidecar) SizeSSZ() (size int) { + size = 312 + return +} + +// HashTreeRoot ssz hashes the SignedBlindedBlobSidecar object +func (s *SignedBlindedBlobSidecar) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBlindedBlobSidecar object with a hasher +func (s *SignedBlindedBlobSidecar) HashTreeRootWith(hh ssz.HashWalker) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(BlindedBlobSidecar) + } + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + hh.PutBytes(s.Signature[:]) + + hh.Merkleize(indx) + return +} + +// GetTree ssz hashes the SignedBlindedBlobSidecar object +func (s *SignedBlindedBlobSidecar) GetTree() (*ssz.Node, error) { + return ssz.ProofTree(s) +} diff --git a/api/v1/deneb/signedblindedblobsidecar_test.go b/api/v1/deneb/signedblindedblobsidecar_test.go new file mode 100644 index 00000000..8c2815a3 --- /dev/null +++ b/api/v1/deneb/signedblindedblobsidecar_test.go @@ -0,0 +1,128 @@ +// Copyright © 2023 Attestant Limited. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package deneb_test + +import ( + "bytes" + "encoding/json" + "testing" + + "github.com/attestantio/go-eth2-client/api/v1/deneb" + "github.com/goccy/go-yaml" + "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" +) + +func TestSignedBlindedBlobSidecarJSON(t *testing.T) { + tests := []struct { + name string + input []byte + err string + }{ + { + name: "Empty", + err: "unexpected end of JSON input", + }, + { + name: "JSONBad", + input: []byte("[]"), + err: "invalid JSON: json: cannot unmarshal array into Go value of type map[string]json.RawMessage", + }, + { + name: "MessageMissing", + input: []byte(`{"signature":"0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50"}`), + err: "message: missing", + }, + { + name: "MessageWrongType", + input: []byte(`{"message":true,"signature":"0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50"}`), + err: "message: invalid JSON: json: cannot unmarshal bool into Go value of type map[string]json.RawMessage", + }, + { + name: "MessageInvalid", + input: []byte(`{"message":{},"signature":"0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50"}`), + err: "message: block_root: missing", + }, + { + name: "SignatureMissing", + input: []byte(`{"message":{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"}}`), + err: "signature: missing", + }, + { + name: "SignatureWrongType", + input: []byte(`{"message":{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"},"signature":true}`), + err: "signature: invalid prefix", + }, + { + name: "SignatureInvalid", + input: []byte(`{"message":{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"},"signature":"0xic3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50"}`), + err: "signature: invalid value ic3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50: encoding/hex: invalid byte: U+0069 'i'", + }, + { + name: "SignatureIncorrectLength", + input: []byte(`{"message":{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"},"signature":"0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe5"}`), + err: "signature: incorrect length", + }, + { + name: "Good", + input: []byte(`{"message":{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"},"signature":"0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50"}`), + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + var res deneb.SignedBlindedBlobSidecar + err := json.Unmarshal(test.input, &res) + if test.err != "" { + require.EqualError(t, err, test.err) + } else { + require.NoError(t, err) + rt, err := json.Marshal(&res) + require.NoError(t, err) + assert.Equal(t, string(test.input), string(rt)) + } + }) + } +} + +func TestSignedBlindedBlobSidecarYAML(t *testing.T) { + tests := []struct { + name string + input []byte + root []byte + err string + }{ + { + name: "Good", + input: []byte(`{message: {block_root: '0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29', index: 17762875709721895328, slot: 12231583639632491026, block_parent_root: '0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4', proposer_index: 16148839969926959295, blob_root: '0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29', kzg_commitment: '0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6', kzg_proof: '0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff'}, signature: '0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50'}`), + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + var res deneb.SignedBlindedBlobSidecar + err := yaml.Unmarshal(test.input, &res) + if test.err != "" { + require.EqualError(t, err, test.err) + } else { + require.NoError(t, err) + rt, err := yaml.Marshal(&res) + require.NoError(t, err) + assert.Equal(t, res.String(), string(rt)) + rt = bytes.TrimSuffix(rt, []byte("\n")) + assert.Equal(t, string(test.input), string(rt)) + } + }) + } +} diff --git a/api/v1/deneb/signedblindedblobsidecar_yaml.go b/api/v1/deneb/signedblindedblobsidecar_yaml.go new file mode 100644 index 00000000..95d263c0 --- /dev/null +++ b/api/v1/deneb/signedblindedblobsidecar_yaml.go @@ -0,0 +1,54 @@ +// Copyright © 2023 Attestant Limited. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package deneb + +import ( + "bytes" + "encoding/json" + + "github.com/goccy/go-yaml" + "github.com/pkg/errors" +) + +// signedBlindedBlobSidecarYAML is the spec representation of the struct. +type signedBlindedBlobSidecarYAML struct { + Message *BlindedBlobSidecar `json:"message"` + Signature string `json:"signature"` +} + +// MarshalJSON implements json.Marshaler. +func (s *SignedBlindedBlobSidecar) MarshalYAML() ([]byte, error) { + yamlBytes, err := yaml.MarshalWithOptions(&signedBlindedBlobSidecarYAML{ + Message: s.Message, + Signature: s.Signature.String(), + }, yaml.Flow(true)) + if err != nil { + return nil, err + } + return bytes.ReplaceAll(yamlBytes, []byte(`"`), []byte(`'`)), nil +} + +// UnmarshalJSON implements json.Unmarshaler. +func (s *SignedBlindedBlobSidecar) UnmarshalYAML(input []byte) error { + var data signedBlindedBlobSidecarYAML + if err := yaml.Unmarshal(input, &data); err != nil { + return errors.Wrap(err, "failed to unmarshal YAML") + } + bytes, err := json.Marshal(data) + if err != nil { + return errors.Wrap(err, "failed to marshal JSON") + } + + return s.UnmarshalJSON(bytes) +} diff --git a/api/v1/deneb/signedblindedblockcontents.go b/api/v1/deneb/signedblindedblockcontents.go new file mode 100644 index 00000000..896d74b8 --- /dev/null +++ b/api/v1/deneb/signedblindedblockcontents.go @@ -0,0 +1,35 @@ +// Copyright © 2023 Attestant Limited. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package deneb + +import ( + "fmt" + + "github.com/goccy/go-yaml" +) + +// SignedBlindedBlockContents represents the contents of a block, both block and blob. +type SignedBlindedBlockContents struct { + SignedBlindedBlock *SignedBlindedBeaconBlock + SignedBlindedBlobSidecars []*SignedBlindedBlobSidecar `ssz-max:"6"` +} + +// String returns a string version of the structure. +func (s *SignedBlindedBlockContents) String() string { + data, err := yaml.Marshal(s) + if err != nil { + return fmt.Sprintf("ERR: %v", err) + } + return string(data) +} diff --git a/api/v1/deneb/signedblindedblockcontents_json.go b/api/v1/deneb/signedblindedblockcontents_json.go new file mode 100644 index 00000000..e2c9cb9d --- /dev/null +++ b/api/v1/deneb/signedblindedblockcontents_json.go @@ -0,0 +1,53 @@ +// Copyright © 2023 Attestant Limited. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package deneb + +import ( + "encoding/json" + + "github.com/attestantio/go-eth2-client/codecs" + "github.com/pkg/errors" +) + +// signedBlindedBlockContentsJSON is the spec representation of the struct. +type signedBlindedBlockContentsJSON struct { + SignedBlindedBlock *SignedBlindedBeaconBlock `json:"signed_blinded_block"` + SignedBlindedBlobSidecars []*SignedBlindedBlobSidecar `json:"signed_blinded_blob_sidecars"` +} + +// MarshalJSON implements json.Marshaler. +func (s *SignedBlindedBlockContents) MarshalJSON() ([]byte, error) { + return json.Marshal(&signedBlindedBlockContentsJSON{ + SignedBlindedBlock: s.SignedBlindedBlock, + SignedBlindedBlobSidecars: s.SignedBlindedBlobSidecars, + }) +} + +// UnmarshalJSON implements json.Unmarshaler. +func (s *SignedBlindedBlockContents) UnmarshalJSON(input []byte) error { + raw, err := codecs.RawJSON(&signedBlindedBlockContentsJSON{}, input) + if err != nil { + return err + } + + if err := json.Unmarshal(raw["signed_blinded_block"], &s.SignedBlindedBlock); err != nil { + return errors.Wrap(err, "signed_blinded_block") + } + + if err := json.Unmarshal(raw["signed_blinded_blob_sidecars"], &s.SignedBlindedBlobSidecars); err != nil { + return errors.Wrap(err, "signed_blinded_blob_sidecars") + } + + return nil +} diff --git a/api/v1/deneb/signedblindedblockcontents_ssz.go b/api/v1/deneb/signedblindedblockcontents_ssz.go new file mode 100644 index 00000000..5f11b173 --- /dev/null +++ b/api/v1/deneb/signedblindedblockcontents_ssz.go @@ -0,0 +1,159 @@ +// Code generated by fastssz. DO NOT EDIT. +// Hash: 53f7a78b79c00bbf864316c122774dbb8e8aae2e6c5245947a816bca4690d094 +// Version: 0.1.3 +package deneb + +import ( + ssz "github.com/ferranbt/fastssz" +) + +// MarshalSSZ ssz marshals the SignedBlindedBlockContents object +func (s *SignedBlindedBlockContents) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBlindedBlockContents object to a target array +func (s *SignedBlindedBlockContents) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(8) + + // Offset (0) 'SignedBlindedBlock' + dst = ssz.WriteOffset(dst, offset) + if s.SignedBlindedBlock == nil { + s.SignedBlindedBlock = new(SignedBlindedBeaconBlock) + } + offset += s.SignedBlindedBlock.SizeSSZ() + + // Offset (1) 'SignedBlindedBlobSidecars' + dst = ssz.WriteOffset(dst, offset) + offset += len(s.SignedBlindedBlobSidecars) * 312 + + // Field (0) 'SignedBlindedBlock' + if dst, err = s.SignedBlindedBlock.MarshalSSZTo(dst); err != nil { + return + } + + // Field (1) 'SignedBlindedBlobSidecars' + if size := len(s.SignedBlindedBlobSidecars); size > 4 { + err = ssz.ErrListTooBigFn("SignedBlindedBlockContents.SignedBlindedBlobSidecars", size, 4) + return + } + for ii := 0; ii < len(s.SignedBlindedBlobSidecars); ii++ { + if dst, err = s.SignedBlindedBlobSidecars[ii].MarshalSSZTo(dst); err != nil { + return + } + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBlindedBlockContents object +func (s *SignedBlindedBlockContents) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 8 { + return ssz.ErrSize + } + + tail := buf + var o0, o1 uint64 + + // Offset (0) 'SignedBlindedBlock' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 < 8 { + return ssz.ErrInvalidVariableOffset + } + + // Offset (1) 'SignedBlindedBlobSidecars' + if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 { + return ssz.ErrOffset + } + + // Field (0) 'SignedBlindedBlock' + { + buf = tail[o0:o1] + if s.SignedBlindedBlock == nil { + s.SignedBlindedBlock = new(SignedBlindedBeaconBlock) + } + if err = s.SignedBlindedBlock.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (1) 'SignedBlindedBlobSidecars' + { + buf = tail[o1:] + num, err := ssz.DivideInt2(len(buf), 312, 4) + if err != nil { + return err + } + s.SignedBlindedBlobSidecars = make([]*SignedBlindedBlobSidecar, num) + for ii := 0; ii < num; ii++ { + if s.SignedBlindedBlobSidecars[ii] == nil { + s.SignedBlindedBlobSidecars[ii] = new(SignedBlindedBlobSidecar) + } + if err = s.SignedBlindedBlobSidecars[ii].UnmarshalSSZ(buf[ii*312 : (ii+1)*312]); err != nil { + return err + } + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBlindedBlockContents object +func (s *SignedBlindedBlockContents) SizeSSZ() (size int) { + size = 8 + + // Field (0) 'SignedBlindedBlock' + if s.SignedBlindedBlock == nil { + s.SignedBlindedBlock = new(SignedBlindedBeaconBlock) + } + size += s.SignedBlindedBlock.SizeSSZ() + + // Field (1) 'SignedBlindedBlobSidecars' + size += len(s.SignedBlindedBlobSidecars) * 312 + + return +} + +// HashTreeRoot ssz hashes the SignedBlindedBlockContents object +func (s *SignedBlindedBlockContents) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBlindedBlockContents object with a hasher +func (s *SignedBlindedBlockContents) HashTreeRootWith(hh ssz.HashWalker) (err error) { + indx := hh.Index() + + // Field (0) 'SignedBlindedBlock' + if err = s.SignedBlindedBlock.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'SignedBlindedBlobSidecars' + { + subIndx := hh.Index() + num := uint64(len(s.SignedBlindedBlobSidecars)) + if num > 4 { + err = ssz.ErrIncorrectListSize + return + } + for _, elem := range s.SignedBlindedBlobSidecars { + if err = elem.HashTreeRootWith(hh); err != nil { + return + } + } + hh.MerkleizeWithMixin(subIndx, num, 4) + } + + hh.Merkleize(indx) + return +} + +// GetTree ssz hashes the SignedBlindedBlockContents object +func (s *SignedBlindedBlockContents) GetTree() (*ssz.Node, error) { + return ssz.ProofTree(s) +} diff --git a/api/v1/deneb/signedblindedblockcontents_test.go b/api/v1/deneb/signedblindedblockcontents_test.go new file mode 100644 index 00000000..72d07b21 --- /dev/null +++ b/api/v1/deneb/signedblindedblockcontents_test.go @@ -0,0 +1,128 @@ +// Copyright © 2023 Attestant Limited. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package deneb_test + +import ( + "bytes" + "encoding/json" + "testing" + + "github.com/attestantio/go-eth2-client/api/v1/deneb" + "github.com/goccy/go-yaml" + "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" +) + +func TestSignedBlindedBlockContentsJSON(t *testing.T) { + tests := []struct { + name string + input []byte + err string + }{ + { + name: "Empty", + err: "unexpected end of JSON input", + }, + { + name: "JSONBad", + input: []byte("[]"), + err: "invalid JSON: json: cannot unmarshal array into Go value of type map[string]json.RawMessage", + }, + { + name: "SignedBlindedBlockMissing", + input: []byte(`{"signed_blinded_blob_sidecars":[{"message":{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"},"signature":"0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50"},{"message":{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"},"signature":"0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50"}]}`), + err: "signed_blinded_block: missing", + }, + { + name: "SignedBlindedBlockWrongType", + input: []byte(`{"signed_blinded_block":true,"signed_blinded_blob_sidecars":[{"message":{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"},"signature":"0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50"},{"message":{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"},"signature":"0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50"}]}`), + err: "signed_blinded_block: invalid JSON: json: cannot unmarshal bool into Go value of type deneb.signedBlindedBeaconBlockJSON", + }, + { + name: "SignedBlindedBlockInvalid", + input: []byte(`{"signed_blinded_block":{},"signed_blinded_blob_sidecars":[{"message":{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"},"signature":"0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50"},{"message":{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"},"signature":"0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50"}]}`), + err: "signed_blinded_block: message missing", + }, + { + name: "SignedBlindedBlobSidecarsMissing", + input: []byte(`{"signed_blinded_block":{"message":{"slot":"348241","proposer_index":"35822","parent_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","state_root":"0x4f6e0857501da4ab1d72f0c122869e1c084e16daa96613b64914aada28d0dc28","body":{"randao_reveal":"0xb2b7d2e89bb4a4aa6a377972651bb9041cb59af8eedd19568d699fc0866189d3fd78cc93c0e63877b7e2bd6d34d1597c0afd4508aa99b6e882c2cb1ac6f424adba29afd46d1737124300ad72177715fcce8584dd25a06c45bfe9a8ccabd6175d","eth1_data":{"deposit_root":"0x704964a5ad034a440f4f29ff1875986db66adbca45dc0014e439349c7e10194f","deposit_count":"4933","block_hash":"0x9c69de2814a7c3e3751654511372937627dacc3187bf457892789f3f5533c794"},"graffiti":"0x74656b752d626573750000000000000000000000000000000000000000000000","proposer_slashings":[],"attester_slashings":[],"attestations":[{"aggregation_bits":"0xffffffffffffffffffffffffffffff5fff","data":{"slot":"348240","index":"7","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x92da7bf78eb364219f85af2388d7ac7ddbea1934786d75875486ec9fceb310eee131dcfea131bdf4593d3c431b31b2900bb48ebb7ab02e17524d86a4e132883246df8ce427e935dd9e20c422cdf8eb135b3cc45b86fe4c2f592fb4899eb22f7c"},{"aggregation_bits":"0xffdffffffffffff5fffffffffffffffffd","data":{"slot":"348240","index":"3","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x88cce1f9fbf651e52a6ab71dea2f4025702021744aac90fb2997f82bac6c192e295ae39b2a430546cb102bf8b68f687e0f40a5179bc293e1424e37d694ef1ad6b3b8de72a0e7fbbe97aeafe6f47e949d415381fbbb090e3135224d5b324eefcb"},{"aggregation_bits":"0xffffffffffefffffffffbfffff7fffdfff","data":{"slot":"348240","index":"11","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x82186d946dfde2ab3b5fcf5bd858fadeec7fa9729f28527e209d16a1d9b4d635558cad6f8de8cee12caa2a4fc5459fb911ca17cbbecfd22e83c82e244ad7a8c8c849a1e03ee88bf0d338c633c2acfefd142574897cd78f9076b69f6e370e3751"},{"aggregation_bits":"0xfffdffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"4","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9c5ee50f800fe2619d1d0fe46a2fb00a64bcf2613e46a40b579ce6a39c4f6cd71a46790757ccc3df8f5f82e34c77c8d084f525ea8a4bd5bd10190496644be0740ace3d217e43af15229a8023d58e583cfec849fab10169225444f4f4ecc66a8"},{"aggregation_bits":"0xffffffffeffffffffffffdffffffffffff","data":{"slot":"348240","index":"12","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91e4ee5c0d6bb54d6856cee653c6859f635cebf9c51bef524d6f439cf6d1c69bea5fcb3e4c067c178cfa4518a76baba909b18189a864f38020f44b2cd5223a11e42d58aaedfa2f004710a72a704357874850842a1493017eca6e473d01395932"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"13","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8c376c5bb5ada745ba8cb8ce2aae103f4e3f85549ceaacaf312b1fa8e6d2ee5232149a926dcfd58ffa1f50f710eb4edc10943bbd40a601f2fb4d53104a59c0663a397744b59f1fa0744bba49f22afc3bab47045ebb42e61dac41ad44c6bf28f4"},{"aggregation_bits":"0xfffffffffffffffffffffffffffeffffff","data":{"slot":"348240","index":"1","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xaf11c64ce957f2a1686d12b07d0fbc170d89e48490e326cd73ef761ba042bddc01e48e5fc39953c6113df0a989d75e750d5b9d75155259508c2bbdd53903967f893e24f2f7f751f4a05b0fb1cb2b9084ce8543690a8a623599308d6c190fca4a"},{"aggregation_bits":"0xfffffff5fffffffffdfffbbffffff7ffff","data":{"slot":"348240","index":"6","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91075da401796a4341ab9a850ff330c9b0d996ca12b9970ec15a4b40fee652edd043e0c9f9d81529621b3a7970e676f619d7a39af67bf193af4441b5447f199f02d75a26c32181569cddc0a237b7064971539f80811fe40e9362d4d9242404ed"},{"aggregation_bits":"0xfffffffdfffffffffffffdfffffeffffff","data":{"slot":"348240","index":"0","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xad9aa5aa9b9c022036fbb81a0aca626b19a2ccd7c7ee6efa5b2a454f5ffb5d75d00e5563b31319b3a0ad1e0ef6f512be00fb8c39243004a1133610344473953dfcf06c3bd53f00255de6983927acd8624b0131fe9d8a085062747d70972b4713"},{"aggregation_bits":"0xffffffffffff7fdfffffffffffffffffff","data":{"slot":"348240","index":"2","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x89dde857bc31a4cc5e71d6cc440c00b2b1ee85b758722aadc5c4da0a939523de7532aabcfef4e80f84094924bb69d80d0a3d702b85859c5fce0433b6d0f7bc302af866ef7a9234a75be7bbd91b32256126808ffdf65ac0ce07a33afbaa16c575"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"8","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x891fbba500eee2cf2f5734d3bf8445e8684376e47469692d44e87fc8a295616d9f29410afc2d6ff2bc649618b33b417e13de4e152099aac054f4d35df4cd79234b6df1edcf2393b7ebc0f2ecf61f4604232b96830e0dbff9311408dad4479667"},{"aggregation_bits":"0xfffffffffffbffffffffefffffffff5fff","data":{"slot":"348240","index":"14","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9ab0354d0d61eb6b5f2184dc3bd0c8416cca74f2c913c6aaca653a87dd2c4b8ba2471aa450e0fa170573637c49dc8920eb84970fea4230d7b3c3c8c8152c782e912b29bc19a6de05dc36c1b44db2f649f31673b4751e1b22f17021833ca9cc8"},{"aggregation_bits":"0xfffffebffffbf7ffeffffbffffffffffff","data":{"slot":"348240","index":"5","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8e17aa835e6343f708e73e432b7268741f60565f5bb6ef62b5fba892438ca5474a14c0382609e14624058f3fab120e8902ad3f667cf14418836ce120f3bbf50ea3c15923c881e599227cc3a2758ef9a2cd08bd3b862bd711a875e27477ac347c"},{"aggregation_bits":"0xfffffffffffefffffffffffeffffffffff","data":{"slot":"348240","index":"10","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xa0909f67a7745300cee6278605e3cb79e5a9564cd6e81ac379b285e0eb6e1849537326b546079d7bf676c8e33a166cad00ab74a396f12c9f4851fb64612f6aeb911db550e0aeae88e1b90831a5a858ae64f9262f67403327d85fcb345df9fca4"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"9","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x886d038ddd7598cfda720dfe1caf83e030e24b207bbc0c97d012fbf5accbaa2f63366f32fe643aa1fdf6c8282480cd51165710bb786d77ecfb72ef7cc9d55e342c94fb57f5a75d50a0d486ecdf014bb08e0195f24202911c86efb5b46b2167ab"}],"deposits":[],"voluntary_exits":[],"sync_aggregate":{"sync_committee_bits":"0xffffffffffffffffffff7edfffffffff7ffffffffffffffffffffffffffff7ffdf7ffffffff7fffffefffffffffffffbfffffffffdffffffffffffffffffffff","sync_committee_signature":"0x877de19f5fff89de5af36954d4c7f7f5c2ccf6f8dc39fe7e3eb87c3357fca26f0af747dffd0f992c8844a20763e9f8a51858d0be70ce610055c6421d340160adec0ddcb706a7d7a5c45edff7b5f9b9a039fce093cea41c7a5699834f9de48b94"},"execution_payload_header":{"parent_hash":"0xa330251430b91a6fb5342f30a1f527dc76499c03a411464235951dbd51b94d9f","fee_recipient":"0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134","state_root":"0x079f2cc22a29388fd4fc20f451cbaa3ff39845d68b2c368ff7be314617418e38","receipts_root":"0xed980a4cf6df8ba330c14ed9fe0597ec20515f44e5a9adfd2f7b72aa14890996","logs_bloom":"0x0000000400000008000008000040000000000000000000001000104880000200000004000000400000000204000020002000000000000000000000000022000800000004000000000002000c000000000000000000000100000000000000000000000000000000000000000000000040000000000040000001000014000000010002104000000000000000000000000000000000000000000000000000000080020000000000000000002400000000000001000000000002000200102000000040100002000000000000000000000000000000000000000800000000000000000010000000000000000000000000000000000400002000000000000000200000","prev_randao":"0x86cc02ef030b0c147321a7f94158c1b33cb730f8baac3c59955b983fda3ae39b","block_number":"330714","gas_limit":"30000000","gas_used":"369098","timestamp":"1679442492","extra_data":"0x","base_fee_per_gas":"7","block_hash":"0x4ab1ced57222819bf6a6b6c1456715011585599a1cef18b060eb364811bbb14e","transactions_root":"0x6d47bae3b4963cbde00ec39bbd6442540afe26f8005e73722489904836008bfc","withdrawals_root":"0x5dc5f3ff8bade8e1dd04e5cf56292b2a194a2829e1c8e8b4a627d95e08296ba3","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"bls_to_execution_changes":[],"blob_kzg_commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"]}},"signature":"0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50"}}`), + err: "signed_blinded_blob_sidecars: missing", + }, + { + name: "SignedBlindedBlobSidecarsWrongType", + input: []byte(`{"signed_blinded_block":{"message":{"slot":"348241","proposer_index":"35822","parent_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","state_root":"0x4f6e0857501da4ab1d72f0c122869e1c084e16daa96613b64914aada28d0dc28","body":{"randao_reveal":"0xb2b7d2e89bb4a4aa6a377972651bb9041cb59af8eedd19568d699fc0866189d3fd78cc93c0e63877b7e2bd6d34d1597c0afd4508aa99b6e882c2cb1ac6f424adba29afd46d1737124300ad72177715fcce8584dd25a06c45bfe9a8ccabd6175d","eth1_data":{"deposit_root":"0x704964a5ad034a440f4f29ff1875986db66adbca45dc0014e439349c7e10194f","deposit_count":"4933","block_hash":"0x9c69de2814a7c3e3751654511372937627dacc3187bf457892789f3f5533c794"},"graffiti":"0x74656b752d626573750000000000000000000000000000000000000000000000","proposer_slashings":[],"attester_slashings":[],"attestations":[{"aggregation_bits":"0xffffffffffffffffffffffffffffff5fff","data":{"slot":"348240","index":"7","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x92da7bf78eb364219f85af2388d7ac7ddbea1934786d75875486ec9fceb310eee131dcfea131bdf4593d3c431b31b2900bb48ebb7ab02e17524d86a4e132883246df8ce427e935dd9e20c422cdf8eb135b3cc45b86fe4c2f592fb4899eb22f7c"},{"aggregation_bits":"0xffdffffffffffff5fffffffffffffffffd","data":{"slot":"348240","index":"3","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x88cce1f9fbf651e52a6ab71dea2f4025702021744aac90fb2997f82bac6c192e295ae39b2a430546cb102bf8b68f687e0f40a5179bc293e1424e37d694ef1ad6b3b8de72a0e7fbbe97aeafe6f47e949d415381fbbb090e3135224d5b324eefcb"},{"aggregation_bits":"0xffffffffffefffffffffbfffff7fffdfff","data":{"slot":"348240","index":"11","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x82186d946dfde2ab3b5fcf5bd858fadeec7fa9729f28527e209d16a1d9b4d635558cad6f8de8cee12caa2a4fc5459fb911ca17cbbecfd22e83c82e244ad7a8c8c849a1e03ee88bf0d338c633c2acfefd142574897cd78f9076b69f6e370e3751"},{"aggregation_bits":"0xfffdffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"4","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9c5ee50f800fe2619d1d0fe46a2fb00a64bcf2613e46a40b579ce6a39c4f6cd71a46790757ccc3df8f5f82e34c77c8d084f525ea8a4bd5bd10190496644be0740ace3d217e43af15229a8023d58e583cfec849fab10169225444f4f4ecc66a8"},{"aggregation_bits":"0xffffffffeffffffffffffdffffffffffff","data":{"slot":"348240","index":"12","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91e4ee5c0d6bb54d6856cee653c6859f635cebf9c51bef524d6f439cf6d1c69bea5fcb3e4c067c178cfa4518a76baba909b18189a864f38020f44b2cd5223a11e42d58aaedfa2f004710a72a704357874850842a1493017eca6e473d01395932"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"13","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8c376c5bb5ada745ba8cb8ce2aae103f4e3f85549ceaacaf312b1fa8e6d2ee5232149a926dcfd58ffa1f50f710eb4edc10943bbd40a601f2fb4d53104a59c0663a397744b59f1fa0744bba49f22afc3bab47045ebb42e61dac41ad44c6bf28f4"},{"aggregation_bits":"0xfffffffffffffffffffffffffffeffffff","data":{"slot":"348240","index":"1","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xaf11c64ce957f2a1686d12b07d0fbc170d89e48490e326cd73ef761ba042bddc01e48e5fc39953c6113df0a989d75e750d5b9d75155259508c2bbdd53903967f893e24f2f7f751f4a05b0fb1cb2b9084ce8543690a8a623599308d6c190fca4a"},{"aggregation_bits":"0xfffffff5fffffffffdfffbbffffff7ffff","data":{"slot":"348240","index":"6","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91075da401796a4341ab9a850ff330c9b0d996ca12b9970ec15a4b40fee652edd043e0c9f9d81529621b3a7970e676f619d7a39af67bf193af4441b5447f199f02d75a26c32181569cddc0a237b7064971539f80811fe40e9362d4d9242404ed"},{"aggregation_bits":"0xfffffffdfffffffffffffdfffffeffffff","data":{"slot":"348240","index":"0","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xad9aa5aa9b9c022036fbb81a0aca626b19a2ccd7c7ee6efa5b2a454f5ffb5d75d00e5563b31319b3a0ad1e0ef6f512be00fb8c39243004a1133610344473953dfcf06c3bd53f00255de6983927acd8624b0131fe9d8a085062747d70972b4713"},{"aggregation_bits":"0xffffffffffff7fdfffffffffffffffffff","data":{"slot":"348240","index":"2","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x89dde857bc31a4cc5e71d6cc440c00b2b1ee85b758722aadc5c4da0a939523de7532aabcfef4e80f84094924bb69d80d0a3d702b85859c5fce0433b6d0f7bc302af866ef7a9234a75be7bbd91b32256126808ffdf65ac0ce07a33afbaa16c575"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"8","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x891fbba500eee2cf2f5734d3bf8445e8684376e47469692d44e87fc8a295616d9f29410afc2d6ff2bc649618b33b417e13de4e152099aac054f4d35df4cd79234b6df1edcf2393b7ebc0f2ecf61f4604232b96830e0dbff9311408dad4479667"},{"aggregation_bits":"0xfffffffffffbffffffffefffffffff5fff","data":{"slot":"348240","index":"14","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9ab0354d0d61eb6b5f2184dc3bd0c8416cca74f2c913c6aaca653a87dd2c4b8ba2471aa450e0fa170573637c49dc8920eb84970fea4230d7b3c3c8c8152c782e912b29bc19a6de05dc36c1b44db2f649f31673b4751e1b22f17021833ca9cc8"},{"aggregation_bits":"0xfffffebffffbf7ffeffffbffffffffffff","data":{"slot":"348240","index":"5","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8e17aa835e6343f708e73e432b7268741f60565f5bb6ef62b5fba892438ca5474a14c0382609e14624058f3fab120e8902ad3f667cf14418836ce120f3bbf50ea3c15923c881e599227cc3a2758ef9a2cd08bd3b862bd711a875e27477ac347c"},{"aggregation_bits":"0xfffffffffffefffffffffffeffffffffff","data":{"slot":"348240","index":"10","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xa0909f67a7745300cee6278605e3cb79e5a9564cd6e81ac379b285e0eb6e1849537326b546079d7bf676c8e33a166cad00ab74a396f12c9f4851fb64612f6aeb911db550e0aeae88e1b90831a5a858ae64f9262f67403327d85fcb345df9fca4"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"9","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x886d038ddd7598cfda720dfe1caf83e030e24b207bbc0c97d012fbf5accbaa2f63366f32fe643aa1fdf6c8282480cd51165710bb786d77ecfb72ef7cc9d55e342c94fb57f5a75d50a0d486ecdf014bb08e0195f24202911c86efb5b46b2167ab"}],"deposits":[],"voluntary_exits":[],"sync_aggregate":{"sync_committee_bits":"0xffffffffffffffffffff7edfffffffff7ffffffffffffffffffffffffffff7ffdf7ffffffff7fffffefffffffffffffbfffffffffdffffffffffffffffffffff","sync_committee_signature":"0x877de19f5fff89de5af36954d4c7f7f5c2ccf6f8dc39fe7e3eb87c3357fca26f0af747dffd0f992c8844a20763e9f8a51858d0be70ce610055c6421d340160adec0ddcb706a7d7a5c45edff7b5f9b9a039fce093cea41c7a5699834f9de48b94"},"execution_payload_header":{"parent_hash":"0xa330251430b91a6fb5342f30a1f527dc76499c03a411464235951dbd51b94d9f","fee_recipient":"0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134","state_root":"0x079f2cc22a29388fd4fc20f451cbaa3ff39845d68b2c368ff7be314617418e38","receipts_root":"0xed980a4cf6df8ba330c14ed9fe0597ec20515f44e5a9adfd2f7b72aa14890996","logs_bloom":"0x0000000400000008000008000040000000000000000000001000104880000200000004000000400000000204000020002000000000000000000000000022000800000004000000000002000c000000000000000000000100000000000000000000000000000000000000000000000040000000000040000001000014000000010002104000000000000000000000000000000000000000000000000000000080020000000000000000002400000000000001000000000002000200102000000040100002000000000000000000000000000000000000000800000000000000000010000000000000000000000000000000000400002000000000000000200000","prev_randao":"0x86cc02ef030b0c147321a7f94158c1b33cb730f8baac3c59955b983fda3ae39b","block_number":"330714","gas_limit":"30000000","gas_used":"369098","timestamp":"1679442492","extra_data":"0x","base_fee_per_gas":"7","block_hash":"0x4ab1ced57222819bf6a6b6c1456715011585599a1cef18b060eb364811bbb14e","transactions_root":"0x6d47bae3b4963cbde00ec39bbd6442540afe26f8005e73722489904836008bfc","withdrawals_root":"0x5dc5f3ff8bade8e1dd04e5cf56292b2a194a2829e1c8e8b4a627d95e08296ba3","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"bls_to_execution_changes":[],"blob_kzg_commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"]}},"signature":"0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50"},"signed_blinded_blob_sidecars":true}`), + err: "signed_blinded_blob_sidecars: json: cannot unmarshal bool into Go value of type []*deneb.SignedBlindedBlobSidecar", + }, + { + name: "SignedBlindedBlobSidecarWrongType", + input: []byte(`{"signed_blinded_block":{"message":{"slot":"348241","proposer_index":"35822","parent_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","state_root":"0x4f6e0857501da4ab1d72f0c122869e1c084e16daa96613b64914aada28d0dc28","body":{"randao_reveal":"0xb2b7d2e89bb4a4aa6a377972651bb9041cb59af8eedd19568d699fc0866189d3fd78cc93c0e63877b7e2bd6d34d1597c0afd4508aa99b6e882c2cb1ac6f424adba29afd46d1737124300ad72177715fcce8584dd25a06c45bfe9a8ccabd6175d","eth1_data":{"deposit_root":"0x704964a5ad034a440f4f29ff1875986db66adbca45dc0014e439349c7e10194f","deposit_count":"4933","block_hash":"0x9c69de2814a7c3e3751654511372937627dacc3187bf457892789f3f5533c794"},"graffiti":"0x74656b752d626573750000000000000000000000000000000000000000000000","proposer_slashings":[],"attester_slashings":[],"attestations":[{"aggregation_bits":"0xffffffffffffffffffffffffffffff5fff","data":{"slot":"348240","index":"7","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x92da7bf78eb364219f85af2388d7ac7ddbea1934786d75875486ec9fceb310eee131dcfea131bdf4593d3c431b31b2900bb48ebb7ab02e17524d86a4e132883246df8ce427e935dd9e20c422cdf8eb135b3cc45b86fe4c2f592fb4899eb22f7c"},{"aggregation_bits":"0xffdffffffffffff5fffffffffffffffffd","data":{"slot":"348240","index":"3","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x88cce1f9fbf651e52a6ab71dea2f4025702021744aac90fb2997f82bac6c192e295ae39b2a430546cb102bf8b68f687e0f40a5179bc293e1424e37d694ef1ad6b3b8de72a0e7fbbe97aeafe6f47e949d415381fbbb090e3135224d5b324eefcb"},{"aggregation_bits":"0xffffffffffefffffffffbfffff7fffdfff","data":{"slot":"348240","index":"11","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x82186d946dfde2ab3b5fcf5bd858fadeec7fa9729f28527e209d16a1d9b4d635558cad6f8de8cee12caa2a4fc5459fb911ca17cbbecfd22e83c82e244ad7a8c8c849a1e03ee88bf0d338c633c2acfefd142574897cd78f9076b69f6e370e3751"},{"aggregation_bits":"0xfffdffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"4","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9c5ee50f800fe2619d1d0fe46a2fb00a64bcf2613e46a40b579ce6a39c4f6cd71a46790757ccc3df8f5f82e34c77c8d084f525ea8a4bd5bd10190496644be0740ace3d217e43af15229a8023d58e583cfec849fab10169225444f4f4ecc66a8"},{"aggregation_bits":"0xffffffffeffffffffffffdffffffffffff","data":{"slot":"348240","index":"12","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91e4ee5c0d6bb54d6856cee653c6859f635cebf9c51bef524d6f439cf6d1c69bea5fcb3e4c067c178cfa4518a76baba909b18189a864f38020f44b2cd5223a11e42d58aaedfa2f004710a72a704357874850842a1493017eca6e473d01395932"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"13","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8c376c5bb5ada745ba8cb8ce2aae103f4e3f85549ceaacaf312b1fa8e6d2ee5232149a926dcfd58ffa1f50f710eb4edc10943bbd40a601f2fb4d53104a59c0663a397744b59f1fa0744bba49f22afc3bab47045ebb42e61dac41ad44c6bf28f4"},{"aggregation_bits":"0xfffffffffffffffffffffffffffeffffff","data":{"slot":"348240","index":"1","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xaf11c64ce957f2a1686d12b07d0fbc170d89e48490e326cd73ef761ba042bddc01e48e5fc39953c6113df0a989d75e750d5b9d75155259508c2bbdd53903967f893e24f2f7f751f4a05b0fb1cb2b9084ce8543690a8a623599308d6c190fca4a"},{"aggregation_bits":"0xfffffff5fffffffffdfffbbffffff7ffff","data":{"slot":"348240","index":"6","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91075da401796a4341ab9a850ff330c9b0d996ca12b9970ec15a4b40fee652edd043e0c9f9d81529621b3a7970e676f619d7a39af67bf193af4441b5447f199f02d75a26c32181569cddc0a237b7064971539f80811fe40e9362d4d9242404ed"},{"aggregation_bits":"0xfffffffdfffffffffffffdfffffeffffff","data":{"slot":"348240","index":"0","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xad9aa5aa9b9c022036fbb81a0aca626b19a2ccd7c7ee6efa5b2a454f5ffb5d75d00e5563b31319b3a0ad1e0ef6f512be00fb8c39243004a1133610344473953dfcf06c3bd53f00255de6983927acd8624b0131fe9d8a085062747d70972b4713"},{"aggregation_bits":"0xffffffffffff7fdfffffffffffffffffff","data":{"slot":"348240","index":"2","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x89dde857bc31a4cc5e71d6cc440c00b2b1ee85b758722aadc5c4da0a939523de7532aabcfef4e80f84094924bb69d80d0a3d702b85859c5fce0433b6d0f7bc302af866ef7a9234a75be7bbd91b32256126808ffdf65ac0ce07a33afbaa16c575"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"8","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x891fbba500eee2cf2f5734d3bf8445e8684376e47469692d44e87fc8a295616d9f29410afc2d6ff2bc649618b33b417e13de4e152099aac054f4d35df4cd79234b6df1edcf2393b7ebc0f2ecf61f4604232b96830e0dbff9311408dad4479667"},{"aggregation_bits":"0xfffffffffffbffffffffefffffffff5fff","data":{"slot":"348240","index":"14","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9ab0354d0d61eb6b5f2184dc3bd0c8416cca74f2c913c6aaca653a87dd2c4b8ba2471aa450e0fa170573637c49dc8920eb84970fea4230d7b3c3c8c8152c782e912b29bc19a6de05dc36c1b44db2f649f31673b4751e1b22f17021833ca9cc8"},{"aggregation_bits":"0xfffffebffffbf7ffeffffbffffffffffff","data":{"slot":"348240","index":"5","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8e17aa835e6343f708e73e432b7268741f60565f5bb6ef62b5fba892438ca5474a14c0382609e14624058f3fab120e8902ad3f667cf14418836ce120f3bbf50ea3c15923c881e599227cc3a2758ef9a2cd08bd3b862bd711a875e27477ac347c"},{"aggregation_bits":"0xfffffffffffefffffffffffeffffffffff","data":{"slot":"348240","index":"10","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xa0909f67a7745300cee6278605e3cb79e5a9564cd6e81ac379b285e0eb6e1849537326b546079d7bf676c8e33a166cad00ab74a396f12c9f4851fb64612f6aeb911db550e0aeae88e1b90831a5a858ae64f9262f67403327d85fcb345df9fca4"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"9","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x886d038ddd7598cfda720dfe1caf83e030e24b207bbc0c97d012fbf5accbaa2f63366f32fe643aa1fdf6c8282480cd51165710bb786d77ecfb72ef7cc9d55e342c94fb57f5a75d50a0d486ecdf014bb08e0195f24202911c86efb5b46b2167ab"}],"deposits":[],"voluntary_exits":[],"sync_aggregate":{"sync_committee_bits":"0xffffffffffffffffffff7edfffffffff7ffffffffffffffffffffffffffff7ffdf7ffffffff7fffffefffffffffffffbfffffffffdffffffffffffffffffffff","sync_committee_signature":"0x877de19f5fff89de5af36954d4c7f7f5c2ccf6f8dc39fe7e3eb87c3357fca26f0af747dffd0f992c8844a20763e9f8a51858d0be70ce610055c6421d340160adec0ddcb706a7d7a5c45edff7b5f9b9a039fce093cea41c7a5699834f9de48b94"},"execution_payload_header":{"parent_hash":"0xa330251430b91a6fb5342f30a1f527dc76499c03a411464235951dbd51b94d9f","fee_recipient":"0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134","state_root":"0x079f2cc22a29388fd4fc20f451cbaa3ff39845d68b2c368ff7be314617418e38","receipts_root":"0xed980a4cf6df8ba330c14ed9fe0597ec20515f44e5a9adfd2f7b72aa14890996","logs_bloom":"0x0000000400000008000008000040000000000000000000001000104880000200000004000000400000000204000020002000000000000000000000000022000800000004000000000002000c000000000000000000000100000000000000000000000000000000000000000000000040000000000040000001000014000000010002104000000000000000000000000000000000000000000000000000000080020000000000000000002400000000000001000000000002000200102000000040100002000000000000000000000000000000000000000800000000000000000010000000000000000000000000000000000400002000000000000000200000","prev_randao":"0x86cc02ef030b0c147321a7f94158c1b33cb730f8baac3c59955b983fda3ae39b","block_number":"330714","gas_limit":"30000000","gas_used":"369098","timestamp":"1679442492","extra_data":"0x","base_fee_per_gas":"7","block_hash":"0x4ab1ced57222819bf6a6b6c1456715011585599a1cef18b060eb364811bbb14e","transactions_root":"0x6d47bae3b4963cbde00ec39bbd6442540afe26f8005e73722489904836008bfc","withdrawals_root":"0x5dc5f3ff8bade8e1dd04e5cf56292b2a194a2829e1c8e8b4a627d95e08296ba3","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"bls_to_execution_changes":[],"blob_kzg_commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"]}},"signature":"0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50"},"signed_blinded_blob_sidecars":[true]}`), + err: "signed_blinded_blob_sidecars: invalid JSON: json: cannot unmarshal bool into Go value of type map[string]json.RawMessage", + }, + { + name: "SignedBlindedBlobSidecarInvalid", + input: []byte(`{"signed_blinded_block":{"message":{"slot":"348241","proposer_index":"35822","parent_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","state_root":"0x4f6e0857501da4ab1d72f0c122869e1c084e16daa96613b64914aada28d0dc28","body":{"randao_reveal":"0xb2b7d2e89bb4a4aa6a377972651bb9041cb59af8eedd19568d699fc0866189d3fd78cc93c0e63877b7e2bd6d34d1597c0afd4508aa99b6e882c2cb1ac6f424adba29afd46d1737124300ad72177715fcce8584dd25a06c45bfe9a8ccabd6175d","eth1_data":{"deposit_root":"0x704964a5ad034a440f4f29ff1875986db66adbca45dc0014e439349c7e10194f","deposit_count":"4933","block_hash":"0x9c69de2814a7c3e3751654511372937627dacc3187bf457892789f3f5533c794"},"graffiti":"0x74656b752d626573750000000000000000000000000000000000000000000000","proposer_slashings":[],"attester_slashings":[],"attestations":[{"aggregation_bits":"0xffffffffffffffffffffffffffffff5fff","data":{"slot":"348240","index":"7","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x92da7bf78eb364219f85af2388d7ac7ddbea1934786d75875486ec9fceb310eee131dcfea131bdf4593d3c431b31b2900bb48ebb7ab02e17524d86a4e132883246df8ce427e935dd9e20c422cdf8eb135b3cc45b86fe4c2f592fb4899eb22f7c"},{"aggregation_bits":"0xffdffffffffffff5fffffffffffffffffd","data":{"slot":"348240","index":"3","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x88cce1f9fbf651e52a6ab71dea2f4025702021744aac90fb2997f82bac6c192e295ae39b2a430546cb102bf8b68f687e0f40a5179bc293e1424e37d694ef1ad6b3b8de72a0e7fbbe97aeafe6f47e949d415381fbbb090e3135224d5b324eefcb"},{"aggregation_bits":"0xffffffffffefffffffffbfffff7fffdfff","data":{"slot":"348240","index":"11","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x82186d946dfde2ab3b5fcf5bd858fadeec7fa9729f28527e209d16a1d9b4d635558cad6f8de8cee12caa2a4fc5459fb911ca17cbbecfd22e83c82e244ad7a8c8c849a1e03ee88bf0d338c633c2acfefd142574897cd78f9076b69f6e370e3751"},{"aggregation_bits":"0xfffdffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"4","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9c5ee50f800fe2619d1d0fe46a2fb00a64bcf2613e46a40b579ce6a39c4f6cd71a46790757ccc3df8f5f82e34c77c8d084f525ea8a4bd5bd10190496644be0740ace3d217e43af15229a8023d58e583cfec849fab10169225444f4f4ecc66a8"},{"aggregation_bits":"0xffffffffeffffffffffffdffffffffffff","data":{"slot":"348240","index":"12","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91e4ee5c0d6bb54d6856cee653c6859f635cebf9c51bef524d6f439cf6d1c69bea5fcb3e4c067c178cfa4518a76baba909b18189a864f38020f44b2cd5223a11e42d58aaedfa2f004710a72a704357874850842a1493017eca6e473d01395932"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"13","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8c376c5bb5ada745ba8cb8ce2aae103f4e3f85549ceaacaf312b1fa8e6d2ee5232149a926dcfd58ffa1f50f710eb4edc10943bbd40a601f2fb4d53104a59c0663a397744b59f1fa0744bba49f22afc3bab47045ebb42e61dac41ad44c6bf28f4"},{"aggregation_bits":"0xfffffffffffffffffffffffffffeffffff","data":{"slot":"348240","index":"1","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xaf11c64ce957f2a1686d12b07d0fbc170d89e48490e326cd73ef761ba042bddc01e48e5fc39953c6113df0a989d75e750d5b9d75155259508c2bbdd53903967f893e24f2f7f751f4a05b0fb1cb2b9084ce8543690a8a623599308d6c190fca4a"},{"aggregation_bits":"0xfffffff5fffffffffdfffbbffffff7ffff","data":{"slot":"348240","index":"6","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91075da401796a4341ab9a850ff330c9b0d996ca12b9970ec15a4b40fee652edd043e0c9f9d81529621b3a7970e676f619d7a39af67bf193af4441b5447f199f02d75a26c32181569cddc0a237b7064971539f80811fe40e9362d4d9242404ed"},{"aggregation_bits":"0xfffffffdfffffffffffffdfffffeffffff","data":{"slot":"348240","index":"0","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xad9aa5aa9b9c022036fbb81a0aca626b19a2ccd7c7ee6efa5b2a454f5ffb5d75d00e5563b31319b3a0ad1e0ef6f512be00fb8c39243004a1133610344473953dfcf06c3bd53f00255de6983927acd8624b0131fe9d8a085062747d70972b4713"},{"aggregation_bits":"0xffffffffffff7fdfffffffffffffffffff","data":{"slot":"348240","index":"2","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x89dde857bc31a4cc5e71d6cc440c00b2b1ee85b758722aadc5c4da0a939523de7532aabcfef4e80f84094924bb69d80d0a3d702b85859c5fce0433b6d0f7bc302af866ef7a9234a75be7bbd91b32256126808ffdf65ac0ce07a33afbaa16c575"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"8","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x891fbba500eee2cf2f5734d3bf8445e8684376e47469692d44e87fc8a295616d9f29410afc2d6ff2bc649618b33b417e13de4e152099aac054f4d35df4cd79234b6df1edcf2393b7ebc0f2ecf61f4604232b96830e0dbff9311408dad4479667"},{"aggregation_bits":"0xfffffffffffbffffffffefffffffff5fff","data":{"slot":"348240","index":"14","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9ab0354d0d61eb6b5f2184dc3bd0c8416cca74f2c913c6aaca653a87dd2c4b8ba2471aa450e0fa170573637c49dc8920eb84970fea4230d7b3c3c8c8152c782e912b29bc19a6de05dc36c1b44db2f649f31673b4751e1b22f17021833ca9cc8"},{"aggregation_bits":"0xfffffebffffbf7ffeffffbffffffffffff","data":{"slot":"348240","index":"5","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8e17aa835e6343f708e73e432b7268741f60565f5bb6ef62b5fba892438ca5474a14c0382609e14624058f3fab120e8902ad3f667cf14418836ce120f3bbf50ea3c15923c881e599227cc3a2758ef9a2cd08bd3b862bd711a875e27477ac347c"},{"aggregation_bits":"0xfffffffffffefffffffffffeffffffffff","data":{"slot":"348240","index":"10","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xa0909f67a7745300cee6278605e3cb79e5a9564cd6e81ac379b285e0eb6e1849537326b546079d7bf676c8e33a166cad00ab74a396f12c9f4851fb64612f6aeb911db550e0aeae88e1b90831a5a858ae64f9262f67403327d85fcb345df9fca4"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"9","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x886d038ddd7598cfda720dfe1caf83e030e24b207bbc0c97d012fbf5accbaa2f63366f32fe643aa1fdf6c8282480cd51165710bb786d77ecfb72ef7cc9d55e342c94fb57f5a75d50a0d486ecdf014bb08e0195f24202911c86efb5b46b2167ab"}],"deposits":[],"voluntary_exits":[],"sync_aggregate":{"sync_committee_bits":"0xffffffffffffffffffff7edfffffffff7ffffffffffffffffffffffffffff7ffdf7ffffffff7fffffefffffffffffffbfffffffffdffffffffffffffffffffff","sync_committee_signature":"0x877de19f5fff89de5af36954d4c7f7f5c2ccf6f8dc39fe7e3eb87c3357fca26f0af747dffd0f992c8844a20763e9f8a51858d0be70ce610055c6421d340160adec0ddcb706a7d7a5c45edff7b5f9b9a039fce093cea41c7a5699834f9de48b94"},"execution_payload_header":{"parent_hash":"0xa330251430b91a6fb5342f30a1f527dc76499c03a411464235951dbd51b94d9f","fee_recipient":"0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134","state_root":"0x079f2cc22a29388fd4fc20f451cbaa3ff39845d68b2c368ff7be314617418e38","receipts_root":"0xed980a4cf6df8ba330c14ed9fe0597ec20515f44e5a9adfd2f7b72aa14890996","logs_bloom":"0x0000000400000008000008000040000000000000000000001000104880000200000004000000400000000204000020002000000000000000000000000022000800000004000000000002000c000000000000000000000100000000000000000000000000000000000000000000000040000000000040000001000014000000010002104000000000000000000000000000000000000000000000000000000080020000000000000000002400000000000001000000000002000200102000000040100002000000000000000000000000000000000000000800000000000000000010000000000000000000000000000000000400002000000000000000200000","prev_randao":"0x86cc02ef030b0c147321a7f94158c1b33cb730f8baac3c59955b983fda3ae39b","block_number":"330714","gas_limit":"30000000","gas_used":"369098","timestamp":"1679442492","extra_data":"0x","base_fee_per_gas":"7","block_hash":"0x4ab1ced57222819bf6a6b6c1456715011585599a1cef18b060eb364811bbb14e","transactions_root":"0x6d47bae3b4963cbde00ec39bbd6442540afe26f8005e73722489904836008bfc","withdrawals_root":"0x5dc5f3ff8bade8e1dd04e5cf56292b2a194a2829e1c8e8b4a627d95e08296ba3","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"bls_to_execution_changes":[],"blob_kzg_commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"]}},"signature":"0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50"},"signed_blinded_blob_sidecars":[{}]}`), + err: "signed_blinded_blob_sidecars: message: missing", + }, + { + name: "Good", + input: []byte(`{"signed_blinded_block":{"message":{"slot":"348241","proposer_index":"35822","parent_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","state_root":"0x4f6e0857501da4ab1d72f0c122869e1c084e16daa96613b64914aada28d0dc28","body":{"randao_reveal":"0xb2b7d2e89bb4a4aa6a377972651bb9041cb59af8eedd19568d699fc0866189d3fd78cc93c0e63877b7e2bd6d34d1597c0afd4508aa99b6e882c2cb1ac6f424adba29afd46d1737124300ad72177715fcce8584dd25a06c45bfe9a8ccabd6175d","eth1_data":{"deposit_root":"0x704964a5ad034a440f4f29ff1875986db66adbca45dc0014e439349c7e10194f","deposit_count":"4933","block_hash":"0x9c69de2814a7c3e3751654511372937627dacc3187bf457892789f3f5533c794"},"graffiti":"0x74656b752d626573750000000000000000000000000000000000000000000000","proposer_slashings":[],"attester_slashings":[],"attestations":[{"aggregation_bits":"0xffffffffffffffffffffffffffffff5fff","data":{"slot":"348240","index":"7","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x92da7bf78eb364219f85af2388d7ac7ddbea1934786d75875486ec9fceb310eee131dcfea131bdf4593d3c431b31b2900bb48ebb7ab02e17524d86a4e132883246df8ce427e935dd9e20c422cdf8eb135b3cc45b86fe4c2f592fb4899eb22f7c"},{"aggregation_bits":"0xffdffffffffffff5fffffffffffffffffd","data":{"slot":"348240","index":"3","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x88cce1f9fbf651e52a6ab71dea2f4025702021744aac90fb2997f82bac6c192e295ae39b2a430546cb102bf8b68f687e0f40a5179bc293e1424e37d694ef1ad6b3b8de72a0e7fbbe97aeafe6f47e949d415381fbbb090e3135224d5b324eefcb"},{"aggregation_bits":"0xffffffffffefffffffffbfffff7fffdfff","data":{"slot":"348240","index":"11","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x82186d946dfde2ab3b5fcf5bd858fadeec7fa9729f28527e209d16a1d9b4d635558cad6f8de8cee12caa2a4fc5459fb911ca17cbbecfd22e83c82e244ad7a8c8c849a1e03ee88bf0d338c633c2acfefd142574897cd78f9076b69f6e370e3751"},{"aggregation_bits":"0xfffdffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"4","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9c5ee50f800fe2619d1d0fe46a2fb00a64bcf2613e46a40b579ce6a39c4f6cd71a46790757ccc3df8f5f82e34c77c8d084f525ea8a4bd5bd10190496644be0740ace3d217e43af15229a8023d58e583cfec849fab10169225444f4f4ecc66a8"},{"aggregation_bits":"0xffffffffeffffffffffffdffffffffffff","data":{"slot":"348240","index":"12","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91e4ee5c0d6bb54d6856cee653c6859f635cebf9c51bef524d6f439cf6d1c69bea5fcb3e4c067c178cfa4518a76baba909b18189a864f38020f44b2cd5223a11e42d58aaedfa2f004710a72a704357874850842a1493017eca6e473d01395932"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"13","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8c376c5bb5ada745ba8cb8ce2aae103f4e3f85549ceaacaf312b1fa8e6d2ee5232149a926dcfd58ffa1f50f710eb4edc10943bbd40a601f2fb4d53104a59c0663a397744b59f1fa0744bba49f22afc3bab47045ebb42e61dac41ad44c6bf28f4"},{"aggregation_bits":"0xfffffffffffffffffffffffffffeffffff","data":{"slot":"348240","index":"1","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xaf11c64ce957f2a1686d12b07d0fbc170d89e48490e326cd73ef761ba042bddc01e48e5fc39953c6113df0a989d75e750d5b9d75155259508c2bbdd53903967f893e24f2f7f751f4a05b0fb1cb2b9084ce8543690a8a623599308d6c190fca4a"},{"aggregation_bits":"0xfffffff5fffffffffdfffbbffffff7ffff","data":{"slot":"348240","index":"6","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x91075da401796a4341ab9a850ff330c9b0d996ca12b9970ec15a4b40fee652edd043e0c9f9d81529621b3a7970e676f619d7a39af67bf193af4441b5447f199f02d75a26c32181569cddc0a237b7064971539f80811fe40e9362d4d9242404ed"},{"aggregation_bits":"0xfffffffdfffffffffffffdfffffeffffff","data":{"slot":"348240","index":"0","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xad9aa5aa9b9c022036fbb81a0aca626b19a2ccd7c7ee6efa5b2a454f5ffb5d75d00e5563b31319b3a0ad1e0ef6f512be00fb8c39243004a1133610344473953dfcf06c3bd53f00255de6983927acd8624b0131fe9d8a085062747d70972b4713"},{"aggregation_bits":"0xffffffffffff7fdfffffffffffffffffff","data":{"slot":"348240","index":"2","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x89dde857bc31a4cc5e71d6cc440c00b2b1ee85b758722aadc5c4da0a939523de7532aabcfef4e80f84094924bb69d80d0a3d702b85859c5fce0433b6d0f7bc302af866ef7a9234a75be7bbd91b32256126808ffdf65ac0ce07a33afbaa16c575"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"8","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x891fbba500eee2cf2f5734d3bf8445e8684376e47469692d44e87fc8a295616d9f29410afc2d6ff2bc649618b33b417e13de4e152099aac054f4d35df4cd79234b6df1edcf2393b7ebc0f2ecf61f4604232b96830e0dbff9311408dad4479667"},{"aggregation_bits":"0xfffffffffffbffffffffefffffffff5fff","data":{"slot":"348240","index":"14","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xb9ab0354d0d61eb6b5f2184dc3bd0c8416cca74f2c913c6aaca653a87dd2c4b8ba2471aa450e0fa170573637c49dc8920eb84970fea4230d7b3c3c8c8152c782e912b29bc19a6de05dc36c1b44db2f649f31673b4751e1b22f17021833ca9cc8"},{"aggregation_bits":"0xfffffebffffbf7ffeffffbffffffffffff","data":{"slot":"348240","index":"5","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x8e17aa835e6343f708e73e432b7268741f60565f5bb6ef62b5fba892438ca5474a14c0382609e14624058f3fab120e8902ad3f667cf14418836ce120f3bbf50ea3c15923c881e599227cc3a2758ef9a2cd08bd3b862bd711a875e27477ac347c"},{"aggregation_bits":"0xfffffffffffefffffffffffeffffffffff","data":{"slot":"348240","index":"10","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0xa0909f67a7745300cee6278605e3cb79e5a9564cd6e81ac379b285e0eb6e1849537326b546079d7bf676c8e33a166cad00ab74a396f12c9f4851fb64612f6aeb911db550e0aeae88e1b90831a5a858ae64f9262f67403327d85fcb345df9fca4"},{"aggregation_bits":"0xffffffffffffffffffffffffffffffffff","data":{"slot":"348240","index":"9","beacon_block_root":"0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d","source":{"epoch":"10881","root":"0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf"},"target":{"epoch":"10882","root":"0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708"}},"signature":"0x886d038ddd7598cfda720dfe1caf83e030e24b207bbc0c97d012fbf5accbaa2f63366f32fe643aa1fdf6c8282480cd51165710bb786d77ecfb72ef7cc9d55e342c94fb57f5a75d50a0d486ecdf014bb08e0195f24202911c86efb5b46b2167ab"}],"deposits":[],"voluntary_exits":[],"sync_aggregate":{"sync_committee_bits":"0xffffffffffffffffffff7edfffffffff7ffffffffffffffffffffffffffff7ffdf7ffffffff7fffffefffffffffffffbfffffffffdffffffffffffffffffffff","sync_committee_signature":"0x877de19f5fff89de5af36954d4c7f7f5c2ccf6f8dc39fe7e3eb87c3357fca26f0af747dffd0f992c8844a20763e9f8a51858d0be70ce610055c6421d340160adec0ddcb706a7d7a5c45edff7b5f9b9a039fce093cea41c7a5699834f9de48b94"},"execution_payload_header":{"parent_hash":"0xa330251430b91a6fb5342f30a1f527dc76499c03a411464235951dbd51b94d9f","fee_recipient":"0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134","state_root":"0x079f2cc22a29388fd4fc20f451cbaa3ff39845d68b2c368ff7be314617418e38","receipts_root":"0xed980a4cf6df8ba330c14ed9fe0597ec20515f44e5a9adfd2f7b72aa14890996","logs_bloom":"0x0000000400000008000008000040000000000000000000001000104880000200000004000000400000000204000020002000000000000000000000000022000800000004000000000002000c000000000000000000000100000000000000000000000000000000000000000000000040000000000040000001000014000000010002104000000000000000000000000000000000000000000000000000000080020000000000000000002400000000000001000000000002000200102000000040100002000000000000000000000000000000000000000800000000000000000010000000000000000000000000000000000400002000000000000000200000","prev_randao":"0x86cc02ef030b0c147321a7f94158c1b33cb730f8baac3c59955b983fda3ae39b","block_number":"330714","gas_limit":"30000000","gas_used":"369098","timestamp":"1679442492","extra_data":"0x","base_fee_per_gas":"7","block_hash":"0x4ab1ced57222819bf6a6b6c1456715011585599a1cef18b060eb364811bbb14e","transactions_root":"0x6d47bae3b4963cbde00ec39bbd6442540afe26f8005e73722489904836008bfc","withdrawals_root":"0x5dc5f3ff8bade8e1dd04e5cf56292b2a194a2829e1c8e8b4a627d95e08296ba3","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"bls_to_execution_changes":[],"blob_kzg_commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"]}},"signature":"0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50"},"signed_blinded_blob_sidecars":[{"message":{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"},"signature":"0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50"},{"message":{"block_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","index":"17762875709721895328","slot":"12231583639632491026","block_parent_root":"0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4","proposer_index":"16148839969926959295","blob_root":"0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","kzg_commitment":"0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6","kzg_proof":"0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"},"signature":"0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50"}]}`), + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + var res deneb.SignedBlindedBlockContents + err := json.Unmarshal(test.input, &res) + if test.err != "" { + require.EqualError(t, err, test.err) + } else { + require.NoError(t, err) + rt, err := json.Marshal(&res) + require.NoError(t, err) + assert.Equal(t, string(test.input), string(rt)) + } + }) + } +} + +func TestSignedBlindedBlockContentsYAML(t *testing.T) { + tests := []struct { + name string + input []byte + root []byte + err string + }{ + { + name: "Good", + input: []byte(`{signed_blinded_block: {message: {slot: 348241, proposer_index: 35822, parent_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', state_root: '0x4f6e0857501da4ab1d72f0c122869e1c084e16daa96613b64914aada28d0dc28', body: {randao_reveal: '0xb2b7d2e89bb4a4aa6a377972651bb9041cb59af8eedd19568d699fc0866189d3fd78cc93c0e63877b7e2bd6d34d1597c0afd4508aa99b6e882c2cb1ac6f424adba29afd46d1737124300ad72177715fcce8584dd25a06c45bfe9a8ccabd6175d', eth1_data: {deposit_root: '0x704964a5ad034a440f4f29ff1875986db66adbca45dc0014e439349c7e10194f', deposit_count: 4933, block_hash: '0x9c69de2814a7c3e3751654511372937627dacc3187bf457892789f3f5533c794'}, graffiti: '0x74656b752d626573750000000000000000000000000000000000000000000000', proposer_slashings: [], attester_slashings: [], attestations: [{aggregation_bits: '0xffffffffffffffffffffffffffffff5fff', data: {slot: 348240, index: 7, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x92da7bf78eb364219f85af2388d7ac7ddbea1934786d75875486ec9fceb310eee131dcfea131bdf4593d3c431b31b2900bb48ebb7ab02e17524d86a4e132883246df8ce427e935dd9e20c422cdf8eb135b3cc45b86fe4c2f592fb4899eb22f7c'}, {aggregation_bits: '0xffdffffffffffff5fffffffffffffffffd', data: {slot: 348240, index: 3, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x88cce1f9fbf651e52a6ab71dea2f4025702021744aac90fb2997f82bac6c192e295ae39b2a430546cb102bf8b68f687e0f40a5179bc293e1424e37d694ef1ad6b3b8de72a0e7fbbe97aeafe6f47e949d415381fbbb090e3135224d5b324eefcb'}, {aggregation_bits: '0xffffffffffefffffffffbfffff7fffdfff', data: {slot: 348240, index: 11, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x82186d946dfde2ab3b5fcf5bd858fadeec7fa9729f28527e209d16a1d9b4d635558cad6f8de8cee12caa2a4fc5459fb911ca17cbbecfd22e83c82e244ad7a8c8c849a1e03ee88bf0d338c633c2acfefd142574897cd78f9076b69f6e370e3751'}, {aggregation_bits: '0xfffdffffffffffffffffffffffffffffff', data: {slot: 348240, index: 4, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0xb9c5ee50f800fe2619d1d0fe46a2fb00a64bcf2613e46a40b579ce6a39c4f6cd71a46790757ccc3df8f5f82e34c77c8d084f525ea8a4bd5bd10190496644be0740ace3d217e43af15229a8023d58e583cfec849fab10169225444f4f4ecc66a8'}, {aggregation_bits: '0xffffffffeffffffffffffdffffffffffff', data: {slot: 348240, index: 12, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x91e4ee5c0d6bb54d6856cee653c6859f635cebf9c51bef524d6f439cf6d1c69bea5fcb3e4c067c178cfa4518a76baba909b18189a864f38020f44b2cd5223a11e42d58aaedfa2f004710a72a704357874850842a1493017eca6e473d01395932'}, {aggregation_bits: '0xffffffffffffffffffffffffffffffffff', data: {slot: 348240, index: 13, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x8c376c5bb5ada745ba8cb8ce2aae103f4e3f85549ceaacaf312b1fa8e6d2ee5232149a926dcfd58ffa1f50f710eb4edc10943bbd40a601f2fb4d53104a59c0663a397744b59f1fa0744bba49f22afc3bab47045ebb42e61dac41ad44c6bf28f4'}, {aggregation_bits: '0xfffffffffffffffffffffffffffeffffff', data: {slot: 348240, index: 1, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0xaf11c64ce957f2a1686d12b07d0fbc170d89e48490e326cd73ef761ba042bddc01e48e5fc39953c6113df0a989d75e750d5b9d75155259508c2bbdd53903967f893e24f2f7f751f4a05b0fb1cb2b9084ce8543690a8a623599308d6c190fca4a'}, {aggregation_bits: '0xfffffff5fffffffffdfffbbffffff7ffff', data: {slot: 348240, index: 6, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x91075da401796a4341ab9a850ff330c9b0d996ca12b9970ec15a4b40fee652edd043e0c9f9d81529621b3a7970e676f619d7a39af67bf193af4441b5447f199f02d75a26c32181569cddc0a237b7064971539f80811fe40e9362d4d9242404ed'}, {aggregation_bits: '0xfffffffdfffffffffffffdfffffeffffff', data: {slot: 348240, index: 0, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0xad9aa5aa9b9c022036fbb81a0aca626b19a2ccd7c7ee6efa5b2a454f5ffb5d75d00e5563b31319b3a0ad1e0ef6f512be00fb8c39243004a1133610344473953dfcf06c3bd53f00255de6983927acd8624b0131fe9d8a085062747d70972b4713'}, {aggregation_bits: '0xffffffffffff7fdfffffffffffffffffff', data: {slot: 348240, index: 2, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x89dde857bc31a4cc5e71d6cc440c00b2b1ee85b758722aadc5c4da0a939523de7532aabcfef4e80f84094924bb69d80d0a3d702b85859c5fce0433b6d0f7bc302af866ef7a9234a75be7bbd91b32256126808ffdf65ac0ce07a33afbaa16c575'}, {aggregation_bits: '0xffffffffffffffffffffffffffffffffff', data: {slot: 348240, index: 8, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x891fbba500eee2cf2f5734d3bf8445e8684376e47469692d44e87fc8a295616d9f29410afc2d6ff2bc649618b33b417e13de4e152099aac054f4d35df4cd79234b6df1edcf2393b7ebc0f2ecf61f4604232b96830e0dbff9311408dad4479667'}, {aggregation_bits: '0xfffffffffffbffffffffefffffffff5fff', data: {slot: 348240, index: 14, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0xb9ab0354d0d61eb6b5f2184dc3bd0c8416cca74f2c913c6aaca653a87dd2c4b8ba2471aa450e0fa170573637c49dc8920eb84970fea4230d7b3c3c8c8152c782e912b29bc19a6de05dc36c1b44db2f649f31673b4751e1b22f17021833ca9cc8'}, {aggregation_bits: '0xfffffebffffbf7ffeffffbffffffffffff', data: {slot: 348240, index: 5, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x8e17aa835e6343f708e73e432b7268741f60565f5bb6ef62b5fba892438ca5474a14c0382609e14624058f3fab120e8902ad3f667cf14418836ce120f3bbf50ea3c15923c881e599227cc3a2758ef9a2cd08bd3b862bd711a875e27477ac347c'}, {aggregation_bits: '0xfffffffffffefffffffffffeffffffffff', data: {slot: 348240, index: 10, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0xa0909f67a7745300cee6278605e3cb79e5a9564cd6e81ac379b285e0eb6e1849537326b546079d7bf676c8e33a166cad00ab74a396f12c9f4851fb64612f6aeb911db550e0aeae88e1b90831a5a858ae64f9262f67403327d85fcb345df9fca4'}, {aggregation_bits: '0xffffffffffffffffffffffffffffffffff', data: {slot: 348240, index: 9, beacon_block_root: '0x15bd2273ad32344e34f842fc77ad8acb2a2eaedafa6e5328ef799babfe81113d', source: {epoch: 10881, root: '0x12a21e7bb91e09dac76d5d3f170db6358785032f10b9130a1e92e6f4409f2ecf'}, target: {epoch: 10882, root: '0x1c8a9a3a0d4c9d72a93b9ff2ea442a986f4d6dfde52953e48a146206393e7708'}}, signature: '0x886d038ddd7598cfda720dfe1caf83e030e24b207bbc0c97d012fbf5accbaa2f63366f32fe643aa1fdf6c8282480cd51165710bb786d77ecfb72ef7cc9d55e342c94fb57f5a75d50a0d486ecdf014bb08e0195f24202911c86efb5b46b2167ab'}], deposits: [], voluntary_exits: [], sync_aggregate: {sync_committee_bits: '0xffffffffffffffffffff7edfffffffff7ffffffffffffffffffffffffffff7ffdf7ffffffff7fffffefffffffffffffbfffffffffdffffffffffffffffffffff', sync_committee_signature: '0x877de19f5fff89de5af36954d4c7f7f5c2ccf6f8dc39fe7e3eb87c3357fca26f0af747dffd0f992c8844a20763e9f8a51858d0be70ce610055c6421d340160adec0ddcb706a7d7a5c45edff7b5f9b9a039fce093cea41c7a5699834f9de48b94'}, execution_payload_header: {parent_hash: '0xa330251430b91a6fb5342f30a1f527dc76499c03a411464235951dbd51b94d9f', fee_recipient: '0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134', state_root: '0x079f2cc22a29388fd4fc20f451cbaa3ff39845d68b2c368ff7be314617418e38', receipts_root: '0xed980a4cf6df8ba330c14ed9fe0597ec20515f44e5a9adfd2f7b72aa14890996', logs_bloom: '0x0000000400000008000008000040000000000000000000001000104880000200000004000000400000000204000020002000000000000000000000000022000800000004000000000002000c000000000000000000000100000000000000000000000000000000000000000000000040000000000040000001000014000000010002104000000000000000000000000000000000000000000000000000000080020000000000000000002400000000000001000000000002000200102000000040100002000000000000000000000000000000000000000800000000000000000010000000000000000000000000000000000400002000000000000000200000', prev_randao: '0x86cc02ef030b0c147321a7f94158c1b33cb730f8baac3c59955b983fda3ae39b', block_number: 330714, gas_limit: 30000000, gas_used: 369098, timestamp: 1679442492, extra_data: '0x', base_fee_per_gas: '7', block_hash: '0x4ab1ced57222819bf6a6b6c1456715011585599a1cef18b060eb364811bbb14e', transactions_root: '0x6d47bae3b4963cbde00ec39bbd6442540afe26f8005e73722489904836008bfc', withdrawals_root: '0x5dc5f3ff8bade8e1dd04e5cf56292b2a194a2829e1c8e8b4a627d95e08296ba3', data_gas_used: 4438756708366371443, excess_data_gas: 12504111653614393862}, bls_to_execution_changes: [], blob_kzg_commitments: ['0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f', '0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929']}}, signature: '0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50'}, signed_blinded_blob_sidecars: [{message: {block_root: '0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29', index: 17762875709721895328, slot: 12231583639632491026, block_parent_root: '0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4', proposer_index: 16148839969926959295, blob_root: '0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29', kzg_commitment: '0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6', kzg_proof: '0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff'}, signature: '0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50'}, {message: {block_root: '0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29', index: 17762875709721895328, slot: 12231583639632491026, block_parent_root: '0x22de86edc38dc56c4255cba641c83251a2a2dcc7535e773c9a2fb2e8b73758a4', proposer_index: 16148839969926959295, blob_root: '0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29', kzg_commitment: '0x0748ac5c58e66b1fae24289f9014948876fbd78da88931bb6cbcd2e44a01bd07ab4f33e54ec9b9a2ada2e83c840dceb6', kzg_proof: '0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff'}, signature: '0x8c3095fd9d3a18e43ceeb7648281e16bb03044839dffea796432c4e5a1372bef22c11a98a31e0c1c5389b98cc6d45917170a0f1634bcf152d896f360dc599fabba2ec4de77898b5dff080fa1628482bdbad5b37d2e64fea3d8721095186cfe50'}]}`), + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + var res deneb.SignedBlindedBlockContents + err := yaml.Unmarshal(test.input, &res) + if test.err != "" { + require.EqualError(t, err, test.err) + } else { + require.NoError(t, err) + rt, err := yaml.Marshal(&res) + require.NoError(t, err) + assert.Equal(t, res.String(), string(rt)) + rt = bytes.TrimSuffix(rt, []byte("\n")) + assert.Equal(t, string(test.input), string(rt)) + } + }) + } +} diff --git a/api/v1/deneb/signedblindedblockcontents_yaml.go b/api/v1/deneb/signedblindedblockcontents_yaml.go new file mode 100644 index 00000000..08e78fde --- /dev/null +++ b/api/v1/deneb/signedblindedblockcontents_yaml.go @@ -0,0 +1,54 @@ +// Copyright © 2023 Attestant Limited. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package deneb + +import ( + "bytes" + "encoding/json" + + "github.com/goccy/go-yaml" + "github.com/pkg/errors" +) + +// signedBlindedBlockContentsYAML is the spec representation of the struct. +type signedBlindedBlockContentsYAML struct { + SignedBlindedBlock *SignedBlindedBeaconBlock `json:"signed_blinded_block"` + SignedBlindedBlobSidecars []*SignedBlindedBlobSidecar `json:"signed_blinded_blob_sidecars"` +} + +// MarshalJSON implements json.Marshaler. +func (s *SignedBlindedBlockContents) MarshalYAML() ([]byte, error) { + yamlBytes, err := yaml.MarshalWithOptions(&signedBlindedBlockContentsYAML{ + SignedBlindedBlock: s.SignedBlindedBlock, + SignedBlindedBlobSidecars: s.SignedBlindedBlobSidecars, + }, yaml.Flow(true)) + if err != nil { + return nil, err + } + return bytes.ReplaceAll(yamlBytes, []byte(`"`), []byte(`'`)), nil +} + +// UnmarshalJSON implements json.Unmarshaler. +func (s *SignedBlindedBlockContents) UnmarshalYAML(input []byte) error { + var data signedBlindedBlockContentsYAML + if err := yaml.Unmarshal(input, &data); err != nil { + return errors.Wrap(err, "failed to unmarshal YAML") + } + bytes, err := json.Marshal(data) + if err != nil { + return errors.Wrap(err, "failed to marshal JSON") + } + + return s.UnmarshalJSON(bytes) +}