From 5988f5350693d35087b921f411d49785cfb68bc4 Mon Sep 17 00:00:00 2001 From: avalonche Date: Fri, 10 Nov 2023 19:24:08 +1100 Subject: [PATCH 1/2] Remove unused containers --- api/v1/deneb/blindedblobsidecar.go | 44 -- api/v1/deneb/blindedblobsidecar_json.go | 92 ---- api/v1/deneb/blindedblobsidecar_ssz.go | 129 ------ api/v1/deneb/blindedblobsidecar_yaml.go | 69 --- api/v1/deneb/blindedblockcontents.go | 36 -- api/v1/deneb/blindedblockcontents_json.go | 53 --- api/v1/deneb/blindedblockcontents_ssz.go | 159 ------- api/v1/deneb/blindedblockcontents_test.go | 128 ------ api/v1/deneb/blindedblockcontents_yaml.go | 56 --- api/v1/deneb/signedblindedblobsidecar.go | 37 -- api/v1/deneb/signedblindedblobsidecar_json.go | 53 --- api/v1/deneb/signedblindedblobsidecar_ssz.go | 88 ---- api/v1/deneb/signedblindedblobsidecar_test.go | 128 ------ api/v1/deneb/signedblindedblobsidecar_yaml.go | 55 --- api/v1/deneb/signedblindedblockcontents.go | 36 -- .../deneb/signedblindedblockcontents_json.go | 53 --- .../deneb/signedblindedblockcontents_ssz.go | 159 ------- .../deneb/signedblindedblockcontents_test.go | 128 ------ .../deneb/signedblindedblockcontents_yaml.go | 55 --- api/versionedblindedblockrequest.go | 375 ----------------- api/versionedsignedblindedproposal.go | 392 ------------------ http/submitblindedproposal.go | 2 +- service.go | 2 +- 23 files changed, 2 insertions(+), 2327 deletions(-) delete mode 100644 api/v1/deneb/blindedblobsidecar.go delete mode 100644 api/v1/deneb/blindedblobsidecar_json.go delete mode 100644 api/v1/deneb/blindedblobsidecar_ssz.go delete mode 100644 api/v1/deneb/blindedblobsidecar_yaml.go delete mode 100644 api/v1/deneb/blindedblockcontents.go delete mode 100644 api/v1/deneb/blindedblockcontents_json.go delete mode 100644 api/v1/deneb/blindedblockcontents_ssz.go delete mode 100644 api/v1/deneb/blindedblockcontents_test.go delete mode 100644 api/v1/deneb/blindedblockcontents_yaml.go delete mode 100644 api/v1/deneb/signedblindedblobsidecar.go delete mode 100644 api/v1/deneb/signedblindedblobsidecar_json.go delete mode 100644 api/v1/deneb/signedblindedblobsidecar_ssz.go delete mode 100644 api/v1/deneb/signedblindedblobsidecar_test.go delete mode 100644 api/v1/deneb/signedblindedblobsidecar_yaml.go delete mode 100644 api/v1/deneb/signedblindedblockcontents.go delete mode 100644 api/v1/deneb/signedblindedblockcontents_json.go delete mode 100644 api/v1/deneb/signedblindedblockcontents_ssz.go delete mode 100644 api/v1/deneb/signedblindedblockcontents_test.go delete mode 100644 api/v1/deneb/signedblindedblockcontents_yaml.go delete mode 100644 api/versionedblindedblockrequest.go delete mode 100644 api/versionedsignedblindedproposal.go diff --git a/api/v1/deneb/blindedblobsidecar.go b/api/v1/deneb/blindedblobsidecar.go deleted file mode 100644 index 0680b725..00000000 --- a/api/v1/deneb/blindedblobsidecar.go +++ /dev/null @@ -1,44 +0,0 @@ -// 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/deneb" - "github.com/attestantio/go-eth2-client/spec/phase0" - "github.com/goccy/go-yaml" -) - -// BlindedBlobSidecar represents a data blob sidecar. -type BlindedBlobSidecar struct { - BlockRoot phase0.Root `ssz-size:"32"` - Index deneb.BlobIndex - Slot phase0.Slot - BlockParentRoot phase0.Root `ssz-size:"32"` - ProposerIndex phase0.ValidatorIndex - BlobRoot phase0.Root `ssz-size:"32"` - KZGCommitment deneb.KZGCommitment `ssz-size:"48"` - KZGProof deneb.KZGProof `ssz-size:"48"` -} - -// String returns a string version of the structure. -func (b *BlindedBlobSidecar) 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/blindedblobsidecar_json.go b/api/v1/deneb/blindedblobsidecar_json.go deleted file mode 100644 index d4e5b9ae..00000000 --- a/api/v1/deneb/blindedblobsidecar_json.go +++ /dev/null @@ -1,92 +0,0 @@ -// 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" - "fmt" - - "github.com/attestantio/go-eth2-client/codecs" - "github.com/attestantio/go-eth2-client/spec/deneb" - "github.com/attestantio/go-eth2-client/spec/phase0" - "github.com/pkg/errors" -) - -// blindedBlobSidecarJSON is the spec representation of the struct. -type blindedBlobSidecarJSON struct { - BlockRoot phase0.Root `json:"block_root"` - Index string `json:"index"` - Slot string `json:"slot"` - BlockParentRoot phase0.Root `json:"block_parent_root"` - ProposerIndex string `json:"proposer_index"` - BlobRoot phase0.Root `json:"blob_root"` - KZGCommitment deneb.KZGCommitment `json:"kzg_commitment"` - KZGProof deneb.KZGProof `json:"kzg_proof"` -} - -// MarshalJSON implements json.Marshaler. -func (b *BlindedBlobSidecar) MarshalJSON() ([]byte, error) { - return json.Marshal(&blindedBlobSidecarJSON{ - BlockRoot: b.BlockRoot, - Index: fmt.Sprintf("%d", b.Index), - Slot: fmt.Sprintf("%d", b.Slot), - BlockParentRoot: b.BlockParentRoot, - ProposerIndex: fmt.Sprintf("%d", b.ProposerIndex), - BlobRoot: b.BlobRoot, - KZGCommitment: b.KZGCommitment, - KZGProof: b.KZGProof, - }) -} - -// UnmarshalJSON implements json.Unmarshaler. -func (b *BlindedBlobSidecar) UnmarshalJSON(input []byte) error { - raw, err := codecs.RawJSON(&blindedBlobSidecarJSON{}, input) - if err != nil { - return err - } - - if err := b.BlockRoot.UnmarshalJSON(raw["block_root"]); err != nil { - return errors.Wrap(err, "block_root") - } - - if err := b.Index.UnmarshalJSON(raw["index"]); err != nil { - return errors.Wrap(err, "index") - } - - if err := b.Slot.UnmarshalJSON(raw["slot"]); err != nil { - return errors.Wrap(err, "slot") - } - - if err := b.BlockParentRoot.UnmarshalJSON(raw["block_parent_root"]); err != nil { - return errors.Wrap(err, "block_parent_root") - } - - if err := b.ProposerIndex.UnmarshalJSON(raw["proposer_index"]); err != nil { - return errors.Wrap(err, "proposer_index") - } - - if err := b.BlobRoot.UnmarshalJSON(raw["blob_root"]); err != nil { - return errors.Wrap(err, "blob_root") - } - - if err := b.KZGCommitment.UnmarshalJSON(raw["kzg_commitment"]); err != nil { - return errors.Wrap(err, "kzg_commitment") - } - - if err := b.KZGProof.UnmarshalJSON(raw["kzg_proof"]); err != nil { - return errors.Wrap(err, "kzg_proof") - } - - return nil -} diff --git a/api/v1/deneb/blindedblobsidecar_ssz.go b/api/v1/deneb/blindedblobsidecar_ssz.go deleted file mode 100644 index bc47188e..00000000 --- a/api/v1/deneb/blindedblobsidecar_ssz.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by fastssz. DO NOT EDIT. -// Hash: cb2f1c63717d30324163608065e759ce532e3cf10373eb26de9e3dc4f0553100 -// 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 deleted file mode 100644 index 72988aeb..00000000 --- a/api/v1/deneb/blindedblobsidecar_yaml.go +++ /dev/null @@ -1,69 +0,0 @@ -// 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 `yaml:"block_root"` - Index uint64 `yaml:"index"` - Slot uint64 `yaml:"slot"` - BlockParentRoot phase0.Root `yaml:"block_parent_root"` - ProposerIndex uint64 `yaml:"proposer_index"` - BlobRoot phase0.Root `yaml:"blob_root"` - KZGCommitment deneb.KZGCommitment `yaml:"kzg_commitment"` - KZGProof deneb.KZGProof `yaml:"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 deleted file mode 100644 index af82916b..00000000 --- a/api/v1/deneb/blindedblockcontents.go +++ /dev/null @@ -1,36 +0,0 @@ -// 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 deleted file mode 100644 index fe9098cd..00000000 --- a/api/v1/deneb/blindedblockcontents_json.go +++ /dev/null @@ -1,53 +0,0 @@ -// 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" -) - -// 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 { - raw, err := codecs.RawJSON(&blindedBlockContentsJSON{}, input) - if err != nil { - return err - } - - if err := json.Unmarshal(raw["blinded_block"], &b.BlindedBlock); err != nil { - return errors.Wrap(err, "blinded_block") - } - - if err := json.Unmarshal(raw["blinded_blob_sidecars"], &b.BlindedBlobSidecars); err != nil { - return errors.Wrap(err, "blinded_blob_sidecars") - } - - return nil -} diff --git a/api/v1/deneb/blindedblockcontents_ssz.go b/api/v1/deneb/blindedblockcontents_ssz.go deleted file mode 100644 index 20e9901a..00000000 --- a/api/v1/deneb/blindedblockcontents_ssz.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by fastssz. DO NOT EDIT. -// Hash: cb2f1c63717d30324163608065e759ce532e3cf10373eb26de9e3dc4f0553100 -// 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 > 6 { - err = ssz.ErrListTooBigFn("BlindedBlockContents.BlindedBlobSidecars", size, 6) - 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, 6) - 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 > 6 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range b.BlindedBlobSidecars { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - hh.MerkleizeWithMixin(subIndx, num, 6) - } - - 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 deleted file mode 100644 index 474d973a..00000000 --- a/api/v1/deneb/blindedblockcontents_test.go +++ /dev/null @@ -1,128 +0,0 @@ -// 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 map[string]json.RawMessage", - }, - { - 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: "blinded_block: 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: "blinded_block: 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","blob_gas_used":"4438756708366371443","excess_blob_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","blob_gas_used":"4438756708366371443","excess_blob_gas":"12504111653614393862"},"bls_to_execution_changes":[],"blob_kzg_commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"]}},"blinded_blob_sidecars":true}`), - err: "blinded_blob_sidecars: json: cannot unmarshal bool into Go value 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","blob_gas_used":"4438756708366371443","excess_blob_gas":"12504111653614393862"},"bls_to_execution_changes":[],"blob_kzg_commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"]}},"blinded_blob_sidecars":[true]}`), - err: "blinded_blob_sidecars: 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","blob_gas_used":"4438756708366371443","excess_blob_gas":"12504111653614393862"},"bls_to_execution_changes":[],"blob_kzg_commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"]}},"blinded_blob_sidecars":[{}]}`), - err: "blinded_blob_sidecars: 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","blob_gas_used":"4438756708366371443","excess_blob_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', blob_gas_used: 4438756708366371443, excess_blob_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 deleted file mode 100644 index 86d66fb9..00000000 --- a/api/v1/deneb/blindedblockcontents_yaml.go +++ /dev/null @@ -1,56 +0,0 @@ -// 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 `yaml:"blinded_block"` - BlindedBlobSidecars []*BlindedBlobSidecar `yaml:"blinded_blob_sidecars"` -} - -// MarshalYAML implements yaml.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 -} - -// UnmarshalYAML implements yaml.Unmarshaler. -func (b *BlindedBlockContents) UnmarshalYAML(input []byte) error { - var data blindedBlockContentsJSON - 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 deleted file mode 100644 index c314e751..00000000 --- a/api/v1/deneb/signedblindedblobsidecar.go +++ /dev/null @@ -1,37 +0,0 @@ -// 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 deleted file mode 100644 index 8b56fc8a..00000000 --- a/api/v1/deneb/signedblindedblobsidecar_json.go +++ /dev/null @@ -1,53 +0,0 @@ -// 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 deleted file mode 100644 index 8e612c85..00000000 --- a/api/v1/deneb/signedblindedblobsidecar_ssz.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by fastssz. DO NOT EDIT. -// Hash: cb2f1c63717d30324163608065e759ce532e3cf10373eb26de9e3dc4f0553100 -// 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 deleted file mode 100644 index 8c2815a3..00000000 --- a/api/v1/deneb/signedblindedblobsidecar_test.go +++ /dev/null @@ -1,128 +0,0 @@ -// 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 deleted file mode 100644 index 814b3105..00000000 --- a/api/v1/deneb/signedblindedblobsidecar_yaml.go +++ /dev/null @@ -1,55 +0,0 @@ -// 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 `yaml:"message"` - Signature string `yaml:"signature"` -} - -// MarshalYAML implements yaml.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 -} - -// UnmarshalYAML implements yaml.Unmarshaler. -func (s *SignedBlindedBlobSidecar) UnmarshalYAML(input []byte) error { - var data signedBlindedBlobSidecarJSON - 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 deleted file mode 100644 index a35b9092..00000000 --- a/api/v1/deneb/signedblindedblockcontents.go +++ /dev/null @@ -1,36 +0,0 @@ -// 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 deleted file mode 100644 index e2c9cb9d..00000000 --- a/api/v1/deneb/signedblindedblockcontents_json.go +++ /dev/null @@ -1,53 +0,0 @@ -// 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 deleted file mode 100644 index df24aa1f..00000000 --- a/api/v1/deneb/signedblindedblockcontents_ssz.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by fastssz. DO NOT EDIT. -// Hash: cb2f1c63717d30324163608065e759ce532e3cf10373eb26de9e3dc4f0553100 -// 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 > 6 { - err = ssz.ErrListTooBigFn("SignedBlindedBlockContents.SignedBlindedBlobSidecars", size, 6) - 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, 6) - 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 > 6 { - err = ssz.ErrIncorrectListSize - return - } - for _, elem := range s.SignedBlindedBlobSidecars { - if err = elem.HashTreeRootWith(hh); err != nil { - return - } - } - hh.MerkleizeWithMixin(subIndx, num, 6) - } - - 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 deleted file mode 100644 index 75abc732..00000000 --- a/api/v1/deneb/signedblindedblockcontents_test.go +++ /dev/null @@ -1,128 +0,0 @@ -// 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","blob_gas_used":"4438756708366371443","excess_blob_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","blob_gas_used":"4438756708366371443","excess_blob_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","blob_gas_used":"4438756708366371443","excess_blob_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","blob_gas_used":"4438756708366371443","excess_blob_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","blob_gas_used":"4438756708366371443","excess_blob_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', blob_gas_used: 4438756708366371443, excess_blob_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 deleted file mode 100644 index 202c26a9..00000000 --- a/api/v1/deneb/signedblindedblockcontents_yaml.go +++ /dev/null @@ -1,55 +0,0 @@ -// 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 `yaml:"signed_blinded_block"` - SignedBlindedBlobSidecars []*SignedBlindedBlobSidecar `yaml:"signed_blinded_blob_sidecars"` -} - -// MarshalYAML implements yaml.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 -} - -// UnmarshalYAML implements yaml.Unmarshaler. -func (s *SignedBlindedBlockContents) UnmarshalYAML(input []byte) error { - var data signedBlindedBlockContentsJSON - 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/versionedblindedblockrequest.go b/api/versionedblindedblockrequest.go deleted file mode 100644 index 4668038e..00000000 --- a/api/versionedblindedblockrequest.go +++ /dev/null @@ -1,375 +0,0 @@ -// 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 api - -import ( - apiv1bellatrix "github.com/attestantio/go-eth2-client/api/v1/bellatrix" - apiv1capella "github.com/attestantio/go-eth2-client/api/v1/capella" - apiv1deneb "github.com/attestantio/go-eth2-client/api/v1/deneb" - "github.com/attestantio/go-eth2-client/spec" - "github.com/attestantio/go-eth2-client/spec/phase0" -) - -// VersionedBlindedBlockRequest contains a versioned signed blinded beacon block. -type VersionedBlindedBlockRequest struct { - Version spec.DataVersion - Bellatrix *apiv1bellatrix.SignedBlindedBeaconBlock - Capella *apiv1capella.SignedBlindedBeaconBlock - Deneb *apiv1deneb.SignedBlindedBlockContents -} - -// Slot returns the slot of the signed beacon block. -func (v *VersionedBlindedBlockRequest) Slot() (phase0.Slot, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil || - v.Bellatrix.Message == nil { - return 0, ErrDataMissing - } - - return v.Bellatrix.Message.Slot, nil - case spec.DataVersionCapella: - if v.Capella == nil || - v.Capella.Message == nil { - return 0, ErrDataMissing - } - - return v.Capella.Message.Slot, nil - case spec.DataVersionDeneb: - if v.Deneb == nil || - v.Deneb.SignedBlindedBlock == nil || - v.Deneb.SignedBlindedBlock.Message == nil { - return 0, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.Slot, nil - default: - return 0, ErrUnsupportedVersion - } -} - -// Attestations returns the attestations of the beacon block. -func (v *VersionedBlindedBlockRequest) Attestations() ([]*phase0.Attestation, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil || - v.Bellatrix.Message == nil || - v.Bellatrix.Message.Body == nil { - return nil, ErrDataMissing - } - - return v.Bellatrix.Message.Body.Attestations, nil - case spec.DataVersionCapella: - if v.Capella == nil || - v.Capella.Message == nil || - v.Capella.Message.Body == nil { - return nil, ErrDataMissing - } - - return v.Capella.Message.Body.Attestations, nil - case spec.DataVersionDeneb: - if v.Deneb == nil || - v.Deneb.SignedBlindedBlock == nil || - v.Deneb.SignedBlindedBlock.Message == nil || - v.Deneb.SignedBlindedBlock.Message.Body == nil { - return nil, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.Body.Attestations, nil - default: - return nil, ErrUnsupportedVersion - } -} - -// Root returns the root of the beacon block. -func (v *VersionedBlindedBlockRequest) Root() (phase0.Root, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Bellatrix.Message.HashTreeRoot() - case spec.DataVersionCapella: - if v.Capella == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Capella.Message.HashTreeRoot() - case spec.DataVersionDeneb: - if v.Deneb == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.HashTreeRoot() - default: - return phase0.Root{}, ErrUnsupportedVersion - } -} - -// BodyRoot returns the body root of the beacon block. -func (v *VersionedBlindedBlockRequest) BodyRoot() (phase0.Root, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Bellatrix.Message.Body.HashTreeRoot() - case spec.DataVersionCapella: - if v.Capella == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Capella.Message.Body.HashTreeRoot() - case spec.DataVersionDeneb: - if v.Deneb == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.Body.HashTreeRoot() - default: - return phase0.Root{}, ErrUnsupportedVersion - } -} - -// ParentRoot returns the parent root of the beacon block. -func (v *VersionedBlindedBlockRequest) ParentRoot() (phase0.Root, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Bellatrix.Message.ParentRoot, nil - case spec.DataVersionCapella: - if v.Capella == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Capella.Message.ParentRoot, nil - case spec.DataVersionDeneb: - if v.Deneb == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.ParentRoot, nil - default: - return phase0.Root{}, ErrUnsupportedVersion - } -} - -// StateRoot returns the state root of the beacon block. -func (v *VersionedBlindedBlockRequest) StateRoot() (phase0.Root, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Bellatrix.Message.StateRoot, nil - case spec.DataVersionCapella: - if v.Capella == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Capella.Message.StateRoot, nil - case spec.DataVersionDeneb: - if v.Deneb == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.StateRoot, nil - default: - return phase0.Root{}, ErrUnsupportedVersion - } -} - -// AttesterSlashings returns the attester slashings of the beacon block. -func (v *VersionedBlindedBlockRequest) AttesterSlashings() ([]*phase0.AttesterSlashing, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil { - return nil, ErrDataMissing - } - - return v.Bellatrix.Message.Body.AttesterSlashings, nil - case spec.DataVersionCapella: - if v.Capella == nil { - return nil, ErrDataMissing - } - - return v.Capella.Message.Body.AttesterSlashings, nil - case spec.DataVersionDeneb: - if v.Deneb == nil { - return nil, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.Body.AttesterSlashings, nil - default: - return nil, ErrUnsupportedVersion - } -} - -// ProposerSlashings returns the proposer slashings of the beacon block. -func (v *VersionedBlindedBlockRequest) ProposerSlashings() ([]*phase0.ProposerSlashing, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil { - return nil, ErrDataMissing - } - - return v.Bellatrix.Message.Body.ProposerSlashings, nil - case spec.DataVersionCapella: - if v.Capella == nil { - return nil, ErrDataMissing - } - - return v.Capella.Message.Body.ProposerSlashings, nil - case spec.DataVersionDeneb: - if v.Deneb == nil { - return nil, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.Body.ProposerSlashings, nil - default: - return nil, ErrUnsupportedVersion - } -} - -// ProposerIndex returns the proposer index of the beacon block. -func (v *VersionedBlindedBlockRequest) ProposerIndex() (phase0.ValidatorIndex, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil || - v.Bellatrix.Message == nil { - return 0, ErrDataMissing - } - - return v.Bellatrix.Message.ProposerIndex, nil - case spec.DataVersionCapella: - if v.Capella == nil || - v.Capella.Message == nil { - return 0, ErrDataMissing - } - - return v.Capella.Message.ProposerIndex, nil - case spec.DataVersionDeneb: - if v.Deneb == nil || - v.Deneb.SignedBlindedBlock.Message == nil { - return 0, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.ProposerIndex, nil - default: - return 0, ErrUnsupportedVersion - } -} - -// ExecutionBlockHash returns the hash of the beacon block. -func (v *VersionedBlindedBlockRequest) ExecutionBlockHash() (phase0.Hash32, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil || - v.Bellatrix.Message == nil || - v.Bellatrix.Message.Body == nil || - v.Bellatrix.Message.Body.ExecutionPayloadHeader == nil { - return phase0.Hash32{}, ErrDataMissing - } - - return v.Bellatrix.Message.Body.ExecutionPayloadHeader.BlockHash, nil - case spec.DataVersionCapella: - if v.Capella == nil || - v.Capella.Message == nil || - v.Capella.Message.Body == nil || - v.Capella.Message.Body.ExecutionPayloadHeader == nil { - return phase0.Hash32{}, ErrDataMissing - } - - return v.Capella.Message.Body.ExecutionPayloadHeader.BlockHash, nil - case spec.DataVersionDeneb: - if v.Deneb == nil || - v.Deneb.SignedBlindedBlock.Message == nil || - v.Deneb.SignedBlindedBlock.Message.Body == nil || - v.Deneb.SignedBlindedBlock.Message.Body.ExecutionPayloadHeader == nil { - return phase0.Hash32{}, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.Body.ExecutionPayloadHeader.BlockHash, nil - default: - return phase0.Hash32{}, ErrUnsupportedVersion - } -} - -// ExecutionBlockNumber returns the block number of the beacon block. -func (v *VersionedBlindedBlockRequest) ExecutionBlockNumber() (uint64, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil || - v.Bellatrix.Message == nil || - v.Bellatrix.Message.Body == nil || - v.Bellatrix.Message.Body.ExecutionPayloadHeader == nil { - return 0, ErrDataMissing - } - - return v.Bellatrix.Message.Body.ExecutionPayloadHeader.BlockNumber, nil - case spec.DataVersionCapella: - if v.Capella == nil || - v.Capella.Message == nil || - v.Capella.Message.Body == nil || - v.Capella.Message.Body.ExecutionPayloadHeader == nil { - return 0, ErrDataMissing - } - - return v.Capella.Message.Body.ExecutionPayloadHeader.BlockNumber, nil - case spec.DataVersionDeneb: - if v.Deneb == nil || - v.Deneb.SignedBlindedBlock.Message == nil || - v.Deneb.SignedBlindedBlock.Message.Body == nil || - v.Deneb.SignedBlindedBlock.Message.Body.ExecutionPayloadHeader == nil { - return 0, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.Body.ExecutionPayloadHeader.BlockNumber, nil - default: - return 0, ErrUnsupportedVersion - } -} - -// BeaconBlockSignature returns the signature of the beacon block. -func (v *VersionedBlindedBlockRequest) BeaconBlockSignature() (phase0.BLSSignature, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil { - return phase0.BLSSignature{}, ErrDataMissing - } - - return v.Bellatrix.Signature, nil - case spec.DataVersionCapella: - if v.Capella == nil { - return phase0.BLSSignature{}, ErrDataMissing - } - - return v.Capella.Signature, nil - case spec.DataVersionDeneb: - if v.Deneb == nil || - v.Deneb.SignedBlindedBlock == nil { - return phase0.BLSSignature{}, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Signature, nil - default: - return phase0.BLSSignature{}, ErrUnsupportedVersion - } -} diff --git a/api/versionedsignedblindedproposal.go b/api/versionedsignedblindedproposal.go deleted file mode 100644 index e12e0937..00000000 --- a/api/versionedsignedblindedproposal.go +++ /dev/null @@ -1,392 +0,0 @@ -// 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 api - -import ( - apiv1bellatrix "github.com/attestantio/go-eth2-client/api/v1/bellatrix" - apiv1capella "github.com/attestantio/go-eth2-client/api/v1/capella" - apiv1deneb "github.com/attestantio/go-eth2-client/api/v1/deneb" - "github.com/attestantio/go-eth2-client/spec" - "github.com/attestantio/go-eth2-client/spec/phase0" -) - -// VersionedSignedBlindedProposal contains a versioned signed blinded proposal. -type VersionedSignedBlindedProposal struct { - Version spec.DataVersion - Bellatrix *apiv1bellatrix.SignedBlindedBeaconBlock - Capella *apiv1capella.SignedBlindedBeaconBlock - Deneb *apiv1deneb.SignedBlindedBlockContents -} - -// Slot returns the slot of the signed blinded proposal. -func (v *VersionedSignedBlindedProposal) Slot() (phase0.Slot, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil || - v.Bellatrix.Message == nil { - return 0, ErrDataMissing - } - - return v.Bellatrix.Message.Slot, nil - case spec.DataVersionCapella: - if v.Capella == nil || - v.Capella.Message == nil { - return 0, ErrDataMissing - } - - return v.Capella.Message.Slot, nil - case spec.DataVersionDeneb: - if v.Deneb == nil || - v.Deneb.SignedBlindedBlock == nil || - v.Deneb.SignedBlindedBlock.Message == nil { - return 0, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.Slot, nil - default: - return 0, ErrUnsupportedVersion - } -} - -// Attestations returns the attestations of the blinded proposal. -func (v *VersionedSignedBlindedProposal) Attestations() ([]*phase0.Attestation, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil || - v.Bellatrix.Message == nil || - v.Bellatrix.Message.Body == nil { - return nil, ErrDataMissing - } - - return v.Bellatrix.Message.Body.Attestations, nil - case spec.DataVersionCapella: - if v.Capella == nil || - v.Capella.Message == nil || - v.Capella.Message.Body == nil { - return nil, ErrDataMissing - } - - return v.Capella.Message.Body.Attestations, nil - case spec.DataVersionDeneb: - if v.Deneb == nil || - v.Deneb.SignedBlindedBlock == nil || - v.Deneb.SignedBlindedBlock.Message == nil || - v.Deneb.SignedBlindedBlock.Message.Body == nil { - return nil, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.Body.Attestations, nil - default: - return nil, ErrUnsupportedVersion - } -} - -// Root returns the root of the blinded proposal. -func (v *VersionedSignedBlindedProposal) Root() (phase0.Root, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Bellatrix.Message.HashTreeRoot() - case spec.DataVersionCapella: - if v.Capella == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Capella.Message.HashTreeRoot() - case spec.DataVersionDeneb: - if v.Deneb == nil || - v.Deneb.SignedBlindedBlock == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.HashTreeRoot() - default: - return phase0.Root{}, ErrUnsupportedVersion - } -} - -// BodyRoot returns the body root of the blinded proposal. -func (v *VersionedSignedBlindedProposal) BodyRoot() (phase0.Root, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Bellatrix.Message.Body.HashTreeRoot() - case spec.DataVersionCapella: - if v.Capella == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Capella.Message.Body.HashTreeRoot() - case spec.DataVersionDeneb: - if v.Deneb == nil || - v.Deneb.SignedBlindedBlock == nil || - v.Deneb.SignedBlindedBlock.Message == nil || - v.Deneb.SignedBlindedBlock.Message.Body == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.Body.HashTreeRoot() - default: - return phase0.Root{}, ErrUnsupportedVersion - } -} - -// ParentRoot returns the parent root of the blinded proposal. -func (v *VersionedSignedBlindedProposal) ParentRoot() (phase0.Root, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Bellatrix.Message.ParentRoot, nil - case spec.DataVersionCapella: - if v.Capella == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Capella.Message.ParentRoot, nil - case spec.DataVersionDeneb: - if v.Deneb == nil || - v.Deneb.SignedBlindedBlock == nil || - v.Deneb.SignedBlindedBlock.Message == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.ParentRoot, nil - default: - return phase0.Root{}, ErrUnsupportedVersion - } -} - -// StateRoot returns the state root of the blinded proposal. -func (v *VersionedSignedBlindedProposal) StateRoot() (phase0.Root, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Bellatrix.Message.StateRoot, nil - case spec.DataVersionCapella: - if v.Capella == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Capella.Message.StateRoot, nil - case spec.DataVersionDeneb: - if v.Deneb == nil || - v.Deneb.SignedBlindedBlock == nil || - v.Deneb.SignedBlindedBlock.Message == nil { - return phase0.Root{}, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.StateRoot, nil - default: - return phase0.Root{}, ErrUnsupportedVersion - } -} - -// AttesterSlashings returns the attester slashings of the blinded proposal. -func (v *VersionedSignedBlindedProposal) AttesterSlashings() ([]*phase0.AttesterSlashing, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil { - return nil, ErrDataMissing - } - - return v.Bellatrix.Message.Body.AttesterSlashings, nil - case spec.DataVersionCapella: - if v.Capella == nil { - return nil, ErrDataMissing - } - - return v.Capella.Message.Body.AttesterSlashings, nil - case spec.DataVersionDeneb: - if v.Deneb == nil || - v.Deneb.SignedBlindedBlock == nil || - v.Deneb.SignedBlindedBlock.Message == nil || - v.Deneb.SignedBlindedBlock.Message.Body == nil { - return nil, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.Body.AttesterSlashings, nil - default: - return nil, ErrUnsupportedVersion - } -} - -// ProposerSlashings returns the proposer slashings of the blinded proposal. -func (v *VersionedSignedBlindedProposal) ProposerSlashings() ([]*phase0.ProposerSlashing, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil { - return nil, ErrDataMissing - } - - return v.Bellatrix.Message.Body.ProposerSlashings, nil - case spec.DataVersionCapella: - if v.Capella == nil { - return nil, ErrDataMissing - } - - return v.Capella.Message.Body.ProposerSlashings, nil - case spec.DataVersionDeneb: - if v.Deneb == nil || - v.Deneb.SignedBlindedBlock == nil || - v.Deneb.SignedBlindedBlock.Message == nil || - v.Deneb.SignedBlindedBlock.Message.Body == nil { - return nil, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.Body.ProposerSlashings, nil - default: - return nil, ErrUnsupportedVersion - } -} - -// ProposerIndex returns the proposer index of the blinded proposal. -func (v *VersionedSignedBlindedProposal) ProposerIndex() (phase0.ValidatorIndex, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil || - v.Bellatrix.Message == nil { - return 0, ErrDataMissing - } - - return v.Bellatrix.Message.ProposerIndex, nil - case spec.DataVersionCapella: - if v.Capella == nil || - v.Capella.Message == nil { - return 0, ErrDataMissing - } - - return v.Capella.Message.ProposerIndex, nil - case spec.DataVersionDeneb: - if v.Deneb == nil || - v.Deneb.SignedBlindedBlock == nil || - v.Deneb.SignedBlindedBlock.Message == nil { - return 0, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.ProposerIndex, nil - default: - return 0, ErrUnsupportedVersion - } -} - -// ExecutionBlockHash returns the hash of the blinded proposal. -func (v *VersionedSignedBlindedProposal) ExecutionBlockHash() (phase0.Hash32, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil || - v.Bellatrix.Message == nil || - v.Bellatrix.Message.Body == nil || - v.Bellatrix.Message.Body.ExecutionPayloadHeader == nil { - return phase0.Hash32{}, ErrDataMissing - } - - return v.Bellatrix.Message.Body.ExecutionPayloadHeader.BlockHash, nil - case spec.DataVersionCapella: - if v.Capella == nil || - v.Capella.Message == nil || - v.Capella.Message.Body == nil || - v.Capella.Message.Body.ExecutionPayloadHeader == nil { - return phase0.Hash32{}, ErrDataMissing - } - - return v.Capella.Message.Body.ExecutionPayloadHeader.BlockHash, nil - case spec.DataVersionDeneb: - if v.Deneb == nil || - v.Deneb.SignedBlindedBlock == nil || - v.Deneb.SignedBlindedBlock.Message == nil || - v.Deneb.SignedBlindedBlock.Message.Body == nil || - v.Deneb.SignedBlindedBlock.Message.Body.ExecutionPayloadHeader == nil { - return phase0.Hash32{}, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.Body.ExecutionPayloadHeader.BlockHash, nil - default: - return phase0.Hash32{}, ErrUnsupportedVersion - } -} - -// ExecutionBlockNumber returns the block number of the blinded proposal. -func (v *VersionedSignedBlindedProposal) ExecutionBlockNumber() (uint64, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil || - v.Bellatrix.Message == nil || - v.Bellatrix.Message.Body == nil || - v.Bellatrix.Message.Body.ExecutionPayloadHeader == nil { - return 0, ErrDataMissing - } - - return v.Bellatrix.Message.Body.ExecutionPayloadHeader.BlockNumber, nil - case spec.DataVersionCapella: - if v.Capella == nil || - v.Capella.Message == nil || - v.Capella.Message.Body == nil || - v.Capella.Message.Body.ExecutionPayloadHeader == nil { - return 0, ErrDataMissing - } - - return v.Capella.Message.Body.ExecutionPayloadHeader.BlockNumber, nil - case spec.DataVersionDeneb: - if v.Deneb == nil || - v.Deneb.SignedBlindedBlock == nil || - v.Deneb.SignedBlindedBlock.Message == nil || - v.Deneb.SignedBlindedBlock.Message.Body == nil || - v.Deneb.SignedBlindedBlock.Message.Body.ExecutionPayloadHeader == nil { - return 0, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Message.Body.ExecutionPayloadHeader.BlockNumber, nil - default: - return 0, ErrUnsupportedVersion - } -} - -// Signature returns the signature of the blinded proposal. -func (v *VersionedSignedBlindedProposal) Signature() (phase0.BLSSignature, error) { - switch v.Version { - case spec.DataVersionBellatrix: - if v.Bellatrix == nil { - return phase0.BLSSignature{}, ErrDataMissing - } - - return v.Bellatrix.Signature, nil - case spec.DataVersionCapella: - if v.Capella == nil { - return phase0.BLSSignature{}, ErrDataMissing - } - - return v.Capella.Signature, nil - case spec.DataVersionDeneb: - if v.Deneb == nil || - v.Deneb.SignedBlindedBlock == nil { - return phase0.BLSSignature{}, ErrDataMissing - } - - return v.Deneb.SignedBlindedBlock.Signature, nil - default: - return phase0.BLSSignature{}, ErrUnsupportedVersion - } -} diff --git a/http/submitblindedproposal.go b/http/submitblindedproposal.go index 8f46be98..704d1a9b 100644 --- a/http/submitblindedproposal.go +++ b/http/submitblindedproposal.go @@ -25,7 +25,7 @@ import ( ) // SubmitBlindedProposal submits a blinded proposal. -func (s *Service) SubmitBlindedProposal(ctx context.Context, proposal *api.VersionedSignedBlindedProposal) error { +func (s *Service) SubmitBlindedProposal(ctx context.Context, proposal *api.VersionedSignedBlindedBeaconBlock) error { var specJSON []byte var err error diff --git a/service.go b/service.go index 75cf3e8b..4d668af8 100644 --- a/service.go +++ b/service.go @@ -290,7 +290,7 @@ type BlindedBeaconBlockSubmitter interface { // BlindedProposalSubmitter is the interface for submitting blinded proposals. type BlindedProposalSubmitter interface { // SubmitBlindedProposal submits a beacon block. - SubmitBlindedProposal(ctx context.Context, block *api.VersionedSignedBlindedProposal) error + SubmitBlindedProposal(ctx context.Context, block *api.VersionedSignedBlindedBeaconBlock) error } // ValidatorRegistrationsSubmitter is the interface for submitting validator registrations. From 28ce41a4f9515585958c61bb7925e0419fc0779d Mon Sep 17 00:00:00 2001 From: avalonche Date: Sat, 11 Nov 2023 11:14:57 +1100 Subject: [PATCH 2/2] address comments --- api/versionedsignedblindedproposal.go | 380 ++++++++++++++++++++++++++ http/submitblindedproposal.go | 2 +- service.go | 2 +- 3 files changed, 382 insertions(+), 2 deletions(-) create mode 100644 api/versionedsignedblindedproposal.go diff --git a/api/versionedsignedblindedproposal.go b/api/versionedsignedblindedproposal.go new file mode 100644 index 00000000..32cfe2f1 --- /dev/null +++ b/api/versionedsignedblindedproposal.go @@ -0,0 +1,380 @@ +// 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 api + +import ( + apiv1bellatrix "github.com/attestantio/go-eth2-client/api/v1/bellatrix" + apiv1capella "github.com/attestantio/go-eth2-client/api/v1/capella" + apiv1deneb "github.com/attestantio/go-eth2-client/api/v1/deneb" + "github.com/attestantio/go-eth2-client/spec" + "github.com/attestantio/go-eth2-client/spec/phase0" +) + +// VersionedSignedBlindedProposal contains a versioned signed blinded proposal. +type VersionedSignedBlindedProposal struct { + Version spec.DataVersion + Bellatrix *apiv1bellatrix.SignedBlindedBeaconBlock + Capella *apiv1capella.SignedBlindedBeaconBlock + Deneb *apiv1deneb.SignedBlindedBeaconBlock +} + +// Slot returns the slot of the signed blinded proposal. +func (v *VersionedSignedBlindedProposal) Slot() (phase0.Slot, error) { + switch v.Version { + case spec.DataVersionBellatrix: + if v.Bellatrix == nil || + v.Bellatrix.Message == nil { + return 0, ErrDataMissing + } + + return v.Bellatrix.Message.Slot, nil + case spec.DataVersionCapella: + if v.Capella == nil || + v.Capella.Message == nil { + return 0, ErrDataMissing + } + + return v.Capella.Message.Slot, nil + case spec.DataVersionDeneb: + if v.Deneb == nil || + v.Deneb.Message == nil { + return 0, ErrDataMissing + } + + return v.Deneb.Message.Slot, nil + default: + return 0, ErrUnsupportedVersion + } +} + +// Attestations returns the attestations of the blinded proposal. +func (v *VersionedSignedBlindedProposal) Attestations() ([]*phase0.Attestation, error) { + switch v.Version { + case spec.DataVersionBellatrix: + if v.Bellatrix == nil || + v.Bellatrix.Message == nil || + v.Bellatrix.Message.Body == nil { + return nil, ErrDataMissing + } + + return v.Bellatrix.Message.Body.Attestations, nil + case spec.DataVersionCapella: + if v.Capella == nil || + v.Capella.Message == nil || + v.Capella.Message.Body == nil { + return nil, ErrDataMissing + } + + return v.Capella.Message.Body.Attestations, nil + case spec.DataVersionDeneb: + if v.Deneb == nil || + v.Deneb.Message == nil || + v.Deneb.Message.Body == nil { + return nil, ErrDataMissing + } + + return v.Deneb.Message.Body.Attestations, nil + default: + return nil, ErrUnsupportedVersion + } +} + +// Root returns the root of the blinded proposal. +func (v *VersionedSignedBlindedProposal) Root() (phase0.Root, error) { + switch v.Version { + case spec.DataVersionBellatrix: + if v.Bellatrix == nil { + return phase0.Root{}, ErrDataMissing + } + + return v.Bellatrix.Message.HashTreeRoot() + case spec.DataVersionCapella: + if v.Capella == nil { + return phase0.Root{}, ErrDataMissing + } + + return v.Capella.Message.HashTreeRoot() + case spec.DataVersionDeneb: + if v.Deneb == nil { + return phase0.Root{}, ErrDataMissing + } + + return v.Deneb.Message.HashTreeRoot() + default: + return phase0.Root{}, ErrUnsupportedVersion + } +} + +// BodyRoot returns the body root of the blinded proposal. +func (v *VersionedSignedBlindedProposal) BodyRoot() (phase0.Root, error) { + switch v.Version { + case spec.DataVersionBellatrix: + if v.Bellatrix == nil { + return phase0.Root{}, ErrDataMissing + } + + return v.Bellatrix.Message.Body.HashTreeRoot() + case spec.DataVersionCapella: + if v.Capella == nil { + return phase0.Root{}, ErrDataMissing + } + + return v.Capella.Message.Body.HashTreeRoot() + case spec.DataVersionDeneb: + if v.Deneb == nil || + v.Deneb.Message == nil || + v.Deneb.Message.Body == nil { + return phase0.Root{}, ErrDataMissing + } + + return v.Deneb.Message.Body.HashTreeRoot() + default: + return phase0.Root{}, ErrUnsupportedVersion + } +} + +// ParentRoot returns the parent root of the blinded proposal. +func (v *VersionedSignedBlindedProposal) ParentRoot() (phase0.Root, error) { + switch v.Version { + case spec.DataVersionBellatrix: + if v.Bellatrix == nil { + return phase0.Root{}, ErrDataMissing + } + + return v.Bellatrix.Message.ParentRoot, nil + case spec.DataVersionCapella: + if v.Capella == nil { + return phase0.Root{}, ErrDataMissing + } + + return v.Capella.Message.ParentRoot, nil + case spec.DataVersionDeneb: + if v.Deneb == nil || + v.Deneb.Message == nil { + return phase0.Root{}, ErrDataMissing + } + + return v.Deneb.Message.ParentRoot, nil + default: + return phase0.Root{}, ErrUnsupportedVersion + } +} + +// StateRoot returns the state root of the blinded proposal. +func (v *VersionedSignedBlindedProposal) StateRoot() (phase0.Root, error) { + switch v.Version { + case spec.DataVersionBellatrix: + if v.Bellatrix == nil { + return phase0.Root{}, ErrDataMissing + } + + return v.Bellatrix.Message.StateRoot, nil + case spec.DataVersionCapella: + if v.Capella == nil { + return phase0.Root{}, ErrDataMissing + } + + return v.Capella.Message.StateRoot, nil + case spec.DataVersionDeneb: + if v.Deneb == nil || + v.Deneb.Message == nil { + return phase0.Root{}, ErrDataMissing + } + + return v.Deneb.Message.StateRoot, nil + default: + return phase0.Root{}, ErrUnsupportedVersion + } +} + +// AttesterSlashings returns the attester slashings of the blinded proposal. +func (v *VersionedSignedBlindedProposal) AttesterSlashings() ([]*phase0.AttesterSlashing, error) { + switch v.Version { + case spec.DataVersionBellatrix: + if v.Bellatrix == nil { + return nil, ErrDataMissing + } + + return v.Bellatrix.Message.Body.AttesterSlashings, nil + case spec.DataVersionCapella: + if v.Capella == nil { + return nil, ErrDataMissing + } + + return v.Capella.Message.Body.AttesterSlashings, nil + case spec.DataVersionDeneb: + if v.Deneb == nil || + v.Deneb.Message == nil || + v.Deneb.Message.Body == nil { + return nil, ErrDataMissing + } + + return v.Deneb.Message.Body.AttesterSlashings, nil + default: + return nil, ErrUnsupportedVersion + } +} + +// ProposerSlashings returns the proposer slashings of the blinded proposal. +func (v *VersionedSignedBlindedProposal) ProposerSlashings() ([]*phase0.ProposerSlashing, error) { + switch v.Version { + case spec.DataVersionBellatrix: + if v.Bellatrix == nil { + return nil, ErrDataMissing + } + + return v.Bellatrix.Message.Body.ProposerSlashings, nil + case spec.DataVersionCapella: + if v.Capella == nil { + return nil, ErrDataMissing + } + + return v.Capella.Message.Body.ProposerSlashings, nil + case spec.DataVersionDeneb: + if v.Deneb == nil || + v.Deneb.Message == nil || + v.Deneb.Message.Body == nil { + return nil, ErrDataMissing + } + + return v.Deneb.Message.Body.ProposerSlashings, nil + default: + return nil, ErrUnsupportedVersion + } +} + +// ProposerIndex returns the proposer index of the blinded proposal. +func (v *VersionedSignedBlindedProposal) ProposerIndex() (phase0.ValidatorIndex, error) { + switch v.Version { + case spec.DataVersionBellatrix: + if v.Bellatrix == nil || + v.Bellatrix.Message == nil { + return 0, ErrDataMissing + } + + return v.Bellatrix.Message.ProposerIndex, nil + case spec.DataVersionCapella: + if v.Capella == nil || + v.Capella.Message == nil { + return 0, ErrDataMissing + } + + return v.Capella.Message.ProposerIndex, nil + case spec.DataVersionDeneb: + if v.Deneb == nil || + v.Deneb.Message == nil { + return 0, ErrDataMissing + } + + return v.Deneb.Message.ProposerIndex, nil + default: + return 0, ErrUnsupportedVersion + } +} + +// ExecutionBlockHash returns the hash of the blinded proposal. +func (v *VersionedSignedBlindedProposal) ExecutionBlockHash() (phase0.Hash32, error) { + switch v.Version { + case spec.DataVersionBellatrix: + if v.Bellatrix == nil || + v.Bellatrix.Message == nil || + v.Bellatrix.Message.Body == nil || + v.Bellatrix.Message.Body.ExecutionPayloadHeader == nil { + return phase0.Hash32{}, ErrDataMissing + } + + return v.Bellatrix.Message.Body.ExecutionPayloadHeader.BlockHash, nil + case spec.DataVersionCapella: + if v.Capella == nil || + v.Capella.Message == nil || + v.Capella.Message.Body == nil || + v.Capella.Message.Body.ExecutionPayloadHeader == nil { + return phase0.Hash32{}, ErrDataMissing + } + + return v.Capella.Message.Body.ExecutionPayloadHeader.BlockHash, nil + case spec.DataVersionDeneb: + if v.Deneb == nil || + v.Deneb.Message == nil || + v.Deneb.Message.Body == nil || + v.Deneb.Message.Body.ExecutionPayloadHeader == nil { + return phase0.Hash32{}, ErrDataMissing + } + + return v.Deneb.Message.Body.ExecutionPayloadHeader.BlockHash, nil + default: + return phase0.Hash32{}, ErrUnsupportedVersion + } +} + +// ExecutionBlockNumber returns the block number of the blinded proposal. +func (v *VersionedSignedBlindedProposal) ExecutionBlockNumber() (uint64, error) { + switch v.Version { + case spec.DataVersionBellatrix: + if v.Bellatrix == nil || + v.Bellatrix.Message == nil || + v.Bellatrix.Message.Body == nil || + v.Bellatrix.Message.Body.ExecutionPayloadHeader == nil { + return 0, ErrDataMissing + } + + return v.Bellatrix.Message.Body.ExecutionPayloadHeader.BlockNumber, nil + case spec.DataVersionCapella: + if v.Capella == nil || + v.Capella.Message == nil || + v.Capella.Message.Body == nil || + v.Capella.Message.Body.ExecutionPayloadHeader == nil { + return 0, ErrDataMissing + } + + return v.Capella.Message.Body.ExecutionPayloadHeader.BlockNumber, nil + case spec.DataVersionDeneb: + if v.Deneb == nil || + v.Deneb.Message == nil || + v.Deneb.Message.Body == nil || + v.Deneb.Message.Body.ExecutionPayloadHeader == nil { + return 0, ErrDataMissing + } + + return v.Deneb.Message.Body.ExecutionPayloadHeader.BlockNumber, nil + default: + return 0, ErrUnsupportedVersion + } +} + +// Signature returns the signature of the blinded proposal. +func (v *VersionedSignedBlindedProposal) Signature() (phase0.BLSSignature, error) { + switch v.Version { + case spec.DataVersionBellatrix: + if v.Bellatrix == nil { + return phase0.BLSSignature{}, ErrDataMissing + } + + return v.Bellatrix.Signature, nil + case spec.DataVersionCapella: + if v.Capella == nil { + return phase0.BLSSignature{}, ErrDataMissing + } + + return v.Capella.Signature, nil + case spec.DataVersionDeneb: + if v.Deneb == nil { + return phase0.BLSSignature{}, ErrDataMissing + } + + return v.Deneb.Signature, nil + default: + return phase0.BLSSignature{}, ErrUnsupportedVersion + } +} diff --git a/http/submitblindedproposal.go b/http/submitblindedproposal.go index 704d1a9b..8f46be98 100644 --- a/http/submitblindedproposal.go +++ b/http/submitblindedproposal.go @@ -25,7 +25,7 @@ import ( ) // SubmitBlindedProposal submits a blinded proposal. -func (s *Service) SubmitBlindedProposal(ctx context.Context, proposal *api.VersionedSignedBlindedBeaconBlock) error { +func (s *Service) SubmitBlindedProposal(ctx context.Context, proposal *api.VersionedSignedBlindedProposal) error { var specJSON []byte var err error diff --git a/service.go b/service.go index 4d668af8..75cf3e8b 100644 --- a/service.go +++ b/service.go @@ -290,7 +290,7 @@ type BlindedBeaconBlockSubmitter interface { // BlindedProposalSubmitter is the interface for submitting blinded proposals. type BlindedProposalSubmitter interface { // SubmitBlindedProposal submits a beacon block. - SubmitBlindedProposal(ctx context.Context, block *api.VersionedSignedBlindedBeaconBlock) error + SubmitBlindedProposal(ctx context.Context, block *api.VersionedSignedBlindedProposal) error } // ValidatorRegistrationsSubmitter is the interface for submitting validator registrations.