From 8e193467ce21dfe9752eb6ccaa8a45b0b0a69530 Mon Sep 17 00:00:00 2001 From: avalonche Date: Tue, 25 Jul 2023 12:59:47 +1000 Subject: [PATCH] Add builder bid structs for deneb --- api/deneb/builderbid.go | 40 ++++++ api/deneb/builderbid_json.go | 96 +++++++++++++++ api/deneb/builderbid_ssz.go | 175 +++++++++++++++++++++++++++ api/deneb/builderbid_test.go | 168 +++++++++++++++++++++++++ api/deneb/builderbid_yaml.go | 54 +++++++++ api/deneb/signedbuilderbid.go | 36 ++++++ api/deneb/signedbuilderbid_json.go | 67 ++++++++++ api/deneb/signedbuilderbid_ssz.go | 111 +++++++++++++++++ api/deneb/signedbuilderbid_test.go | 127 +++++++++++++++++++ api/deneb/signedbuilderbid_yaml.go | 49 ++++++++ api/deneb/submitblockrequest.go | 26 ++++ api/deneb/submitblockrequest_json.go | 63 ++++++++++ api/deneb/submitblockrequest_ssz.go | 137 +++++++++++++++++++++ api/deneb/submitblockrequest_test.go | 130 ++++++++++++++++++++ api/deneb/submitblockrequest_yaml.go | 40 ++++++ 15 files changed, 1319 insertions(+) create mode 100644 api/deneb/builderbid.go create mode 100644 api/deneb/builderbid_json.go create mode 100644 api/deneb/builderbid_ssz.go create mode 100644 api/deneb/builderbid_test.go create mode 100644 api/deneb/builderbid_yaml.go create mode 100644 api/deneb/signedbuilderbid.go create mode 100644 api/deneb/signedbuilderbid_json.go create mode 100644 api/deneb/signedbuilderbid_ssz.go create mode 100644 api/deneb/signedbuilderbid_test.go create mode 100644 api/deneb/signedbuilderbid_yaml.go create mode 100644 api/deneb/submitblockrequest.go create mode 100644 api/deneb/submitblockrequest_json.go create mode 100644 api/deneb/submitblockrequest_ssz.go create mode 100644 api/deneb/submitblockrequest_test.go create mode 100644 api/deneb/submitblockrequest_yaml.go diff --git a/api/deneb/builderbid.go b/api/deneb/builderbid.go new file mode 100644 index 0000000..b4541c4 --- /dev/null +++ b/api/deneb/builderbid.go @@ -0,0 +1,40 @@ +// Copyright © 2022 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" + "github.com/holiman/uint256" +) + +// BuilderBid represents a BuilderBid. +type BuilderBid struct { + Header *deneb.ExecutionPayloadHeader + Value *uint256.Int `ssz-size:"32"` + Pubkey phase0.BLSPubKey `ssz-size:"48"` + BlindedBlobsBundle *BlindedBlobsBundle +} + +// String returns a string version of the structure. +func (b *BuilderBid) String() string { + data, err := yaml.Marshal(b) + if err != nil { + return fmt.Sprintf("ERR: %v", err) + } + return string(data) +} diff --git a/api/deneb/builderbid_json.go b/api/deneb/builderbid_json.go new file mode 100644 index 0000000..ef3b925 --- /dev/null +++ b/api/deneb/builderbid_json.go @@ -0,0 +1,96 @@ +// Copyright © 2022 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/hex" + "encoding/json" + "fmt" + "math/big" + "strings" + + "github.com/attestantio/go-eth2-client/spec/deneb" + "github.com/attestantio/go-eth2-client/spec/phase0" + "github.com/holiman/uint256" + "github.com/pkg/errors" +) + +// builderBidJSON is the spec representation of the struct. +type builderBidJSON struct { + Header *deneb.ExecutionPayloadHeader `json:"header"` + Value string `json:"value"` + Pubkey string `json:"pubkey"` + BlindedBlobsBundle *BlindedBlobsBundle `json:"blinded_blobs_bundle"` +} + +// MarshalJSON implements json.Marshaler. +func (b *BuilderBid) MarshalJSON() ([]byte, error) { + return json.Marshal(&builderBidJSON{ + Header: b.Header, + Value: fmt.Sprintf("%d", b.Value), + Pubkey: b.Pubkey.String(), + BlindedBlobsBundle: b.BlindedBlobsBundle, + }) +} + +// UnmarshalJSON implements json.Unmarshaler. +func (b *BuilderBid) UnmarshalJSON(input []byte) error { + var data builderBidJSON + if err := json.Unmarshal(input, &data); err != nil { + return errors.Wrap(err, "invalid JSON") + } + return b.unpack(&data) +} + +func (b *BuilderBid) unpack(data *builderBidJSON) error { + if data.Header == nil { + return errors.New("header missing") + } + b.Header = data.Header + + if data.Value == "" { + return errors.New("value missing") + } + value, success := new(big.Int).SetString(data.Value, 10) + if !success { + return errors.New("invalid value for value") + } + if value.Sign() == -1 { + return errors.New("value cannot be negative") + } + var overflow bool + b.Value, overflow = uint256.FromBig(value) + if overflow { + return errors.New("value overflow") + } + + if data.Pubkey == "" { + return errors.New("public key missing") + } + pubKey, err := hex.DecodeString(strings.TrimPrefix(data.Pubkey, "0x")) + if err != nil { + return errors.Wrap(err, "invalid value for public key") + } + if len(pubKey) != phase0.PublicKeyLength { + return errors.New("incorrect length for public key") + } + copy(b.Pubkey[:], pubKey) + + if data.BlindedBlobsBundle == nil { + return errors.New("blinded blobs bundle missing") + } + b.BlindedBlobsBundle = data.BlindedBlobsBundle + + return nil +} diff --git a/api/deneb/builderbid_ssz.go b/api/deneb/builderbid_ssz.go new file mode 100644 index 0000000..b091d11 --- /dev/null +++ b/api/deneb/builderbid_ssz.go @@ -0,0 +1,175 @@ +// Code generated by fastssz. DO NOT EDIT. +// Hash: 57a8d430117520491e9ae29da04571755b703f6ccc69a489b4e2ce1004201883 +// Version: 0.1.3 +package deneb + +import ( + "github.com/attestantio/go-eth2-client/spec/deneb" + ssz "github.com/ferranbt/fastssz" + "github.com/holiman/uint256" +) + +// MarshalSSZ ssz marshals the BuilderBid object +func (b *BuilderBid) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(b) +} + +// MarshalSSZTo ssz marshals the BuilderBid object to a target array +func (b *BuilderBid) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(88) + + // Offset (0) 'Header' + dst = ssz.WriteOffset(dst, offset) + if b.Header == nil { + b.Header = new(deneb.ExecutionPayloadHeader) + } + offset += b.Header.SizeSSZ() + + // Field (1) 'Value' + value := b.Value.Bytes32() + for i := 0; i < 32; i++ { + dst = append(dst, value[31-i]) + } + + // Field (2) 'Pubkey' + dst = append(dst, b.Pubkey[:]...) + + // Offset (3) 'BlindedBlobsBundle' + dst = ssz.WriteOffset(dst, offset) + if b.BlindedBlobsBundle == nil { + b.BlindedBlobsBundle = new(BlindedBlobsBundle) + } + offset += b.BlindedBlobsBundle.SizeSSZ() + + // Field (0) 'Header' + if dst, err = b.Header.MarshalSSZTo(dst); err != nil { + return + } + + // Field (3) 'BlindedBlobsBundle' + if dst, err = b.BlindedBlobsBundle.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the BuilderBid object +func (b *BuilderBid) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 88 { + return ssz.ErrSize + } + + tail := buf + var o0, o3 uint64 + + // Offset (0) 'Header' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 < 88 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Value' + value := make([]byte, 32) + for i := 0; i < 32; i++ { + value[i] = buf[35-i] + } + if b.Value == nil { + b.Value = new(uint256.Int) + } + b.Value.SetBytes32(value) + + // Field (2) 'Pubkey' + copy(b.Pubkey[:], buf[36:84]) + + // Offset (3) 'BlindedBlobsBundle' + if o3 = ssz.ReadOffset(buf[84:88]); o3 > size || o0 > o3 { + return ssz.ErrOffset + } + + // Field (0) 'Header' + { + buf = tail[o0:o3] + if b.Header == nil { + b.Header = new(deneb.ExecutionPayloadHeader) + } + if err = b.Header.UnmarshalSSZ(buf); err != nil { + return err + } + } + + // Field (3) 'BlindedBlobsBundle' + { + buf = tail[o3:] + if b.BlindedBlobsBundle == nil { + b.BlindedBlobsBundle = new(BlindedBlobsBundle) + } + if err = b.BlindedBlobsBundle.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the BuilderBid object +func (b *BuilderBid) SizeSSZ() (size int) { + size = 88 + + // Field (0) 'Header' + if b.Header == nil { + b.Header = new(deneb.ExecutionPayloadHeader) + } + size += b.Header.SizeSSZ() + + // Field (3) 'BlindedBlobsBundle' + if b.BlindedBlobsBundle == nil { + b.BlindedBlobsBundle = new(BlindedBlobsBundle) + } + size += b.BlindedBlobsBundle.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the BuilderBid object +func (b *BuilderBid) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(b) +} + +// HashTreeRootWith ssz hashes the BuilderBid object with a hasher +func (b *BuilderBid) HashTreeRootWith(hh ssz.HashWalker) (err error) { + indx := hh.Index() + + // Field (0) 'Header' + if err = b.Header.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Value' + value := b.Value.Bytes32() + for i, j := 0, 31; i < j; i, j = i+1, j-1 { + value[i], value[j] = value[j], value[i] + } + hh.PutBytes(value[:]) + + // Field (2) 'Pubkey' + hh.PutBytes(b.Pubkey[:]) + + // Field (3) 'BlindedBlobsBundle' + if err = b.BlindedBlobsBundle.HashTreeRootWith(hh); err != nil { + return + } + + hh.Merkleize(indx) + return +} + +// GetTree ssz hashes the BuilderBid object +func (b *BuilderBid) GetTree() (*ssz.Node, error) { + return ssz.ProofTree(b) +} diff --git a/api/deneb/builderbid_test.go b/api/deneb/builderbid_test.go new file mode 100644 index 0000000..a27ebe5 --- /dev/null +++ b/api/deneb/builderbid_test.go @@ -0,0 +1,168 @@ +// Copyright © 2022 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-builder-client/api/deneb" + "github.com/goccy/go-yaml" + "github.com/stretchr/testify/require" + "gotest.tools/assert" +) + +func TestBuilderBidJSON(t *testing.T) { + tests := []struct { + name string + input []byte + err string + }{ + { + name: "Empty", + err: "unexpected end of JSON input", + }, + { + name: "JSONBad", + input: []byte("[]"), + err: "invalid JSON: json: cannot unmarshal array into Go value of type deneb.builderBidJSON", + }, + { + name: "HeaderMissing", + input: []byte(`{"value":"12345","pubkey":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"}`), + err: "header missing", + }, + { + name: "HeaderWrongType", + input: []byte(`{"header":true,"value":"12345","pubkey":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101","blinded_blobs_bundle":{"commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"],"proofs":["0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff","0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"],"blob_roots":["0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df"]}}`), + err: "invalid JSON: invalid JSON: json: cannot unmarshal bool into Go value of type map[string]json.RawMessage", + }, + { + name: "HeaderInvalid", + input: []byte(`{"header":{},"value":"12345","pubkey":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101","blinded_blobs_bundle":{"commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"],"proofs":["0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff","0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"],"blob_roots":["0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df"]}}`), + err: "invalid JSON: parent_hash: missing", + }, + { + name: "ValueMissing", + input: []byte(`{"header":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"88770397543877639215846057887940126737648744594802753726778414602657613619599","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions_root":"0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b","withdrawals_root":"0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"pubkey":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101","blinded_blobs_bundle":{"commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"],"proofs":["0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff","0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"],"blob_roots":["0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df"]}}`), + err: "value missing", + }, + { + name: "ValueWrongType", + input: []byte(`{"header":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"88770397543877639215846057887940126737648744594802753726778414602657613619599","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions_root":"0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b","withdrawals_root":"0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"value":true,"pubkey":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101","blinded_blobs_bundle":{"commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"],"proofs":["0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff","0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"],"blob_roots":["0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df"]}}`), + err: "invalid JSON: json: cannot unmarshal bool into Go struct field builderBidJSON.value of type string", + }, + { + name: "ValueInvalid", + input: []byte(`{"header":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"88770397543877639215846057887940126737648744594802753726778414602657613619599","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions_root":"0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b","withdrawals_root":"0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"value":"invalid","pubkey":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101","blinded_blobs_bundle":{"commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"],"proofs":["0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff","0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"],"blob_roots":["0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df"]}}`), + err: "invalid value for value", + }, + { + name: "ValueOverflow", + input: []byte(`{"header":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"88770397543877639215846057887940126737648744594802753726778414602657613619599","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions_root":"0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b","withdrawals_root":"0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"value":"115792089237316195423570985008687907853269984665640564039457584007913129639937","pubkey":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101","blinded_blobs_bundle":{"commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"],"proofs":["0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff","0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"],"blob_roots":["0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df"]}}`), + err: "value overflow", + }, + { + name: "ValueNegative", + input: []byte(`{"header":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"88770397543877639215846057887940126737648744594802753726778414602657613619599","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions_root":"0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b","withdrawals_root":"0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"value":"-12345","pubkey":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101","blinded_blobs_bundle":{"commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"],"proofs":["0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff","0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"],"blob_roots":["0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df"]}}`), + err: "value cannot be negative", + }, + { + name: "PubkeyMissing", + input: []byte(`{"header":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"88770397543877639215846057887940126737648744594802753726778414602657613619599","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions_root":"0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b","withdrawals_root":"0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"value":"12345","blinded_blobs_bundle":{"commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"],"proofs":["0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff","0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"],"blob_roots":["0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df"]}}`), + err: "public key missing", + }, + { + name: "PubkeyWrongType", + input: []byte(`{"header":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"88770397543877639215846057887940126737648744594802753726778414602657613619599","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions_root":"0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b","withdrawals_root":"0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"value":"12345","pubkey":true,"blinded_blobs_bundle":{"commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"],"proofs":["0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff","0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"],"blob_roots":["0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df"]}}`), + err: "invalid JSON: json: cannot unmarshal bool into Go struct field builderBidJSON.pubkey of type string", + }, + { + name: "PubkeyInvalid", + input: []byte(`{"header":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"88770397543877639215846057887940126737648744594802753726778414602657613619599","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions_root":"0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b","withdrawals_root":"0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"value":"12345","pubkey":"invalid","blinded_blobs_bundle":{"commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"],"proofs":["0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff","0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"],"blob_roots":["0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df"]}}`), + err: "invalid value for public key: encoding/hex: invalid byte: U+0069 'i'", + }, + { + name: "PubkeyIncorrectLength", + input: []byte(`{"header":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"88770397543877639215846057887940126737648744594802753726778414602657613619599","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions_root":"0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b","withdrawals_root":"0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"value":"12345","pubkey":"0x0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101","blinded_blobs_bundle":{"commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"],"proofs":["0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff","0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"],"blob_roots":["0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df"]}}`), + err: "incorrect length for public key", + }, + { + name: "BlindedBlobsBundleMissing", + input: []byte(`{"header":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"88770397543877639215846057887940126737648744594802753726778414602657613619599","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions_root":"0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b","withdrawals_root":"0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"value":"12345","pubkey":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"}`), + err: "blinded blobs bundle missing", + }, + { + name: "BlindedBlobsBundleWrongType", + input: []byte(`{"header":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"88770397543877639215846057887940126737648744594802753726778414602657613619599","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions_root":"0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b","withdrawals_root":"0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"value":"12345","pubkey":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101","blinded_blobs_bundle":true}`), + err: "invalid JSON: invalid JSON: json: cannot unmarshal bool into Go value of type map[string]json.RawMessage", + }, + { + name: "BlindedBlobsBundleInvalid", + input: []byte(`{"header":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"88770397543877639215846057887940126737648744594802753726778414602657613619599","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions_root":"0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b","withdrawals_root":"0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"value":"12345","pubkey":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101","blinded_blobs_bundle":{}}`), + err: "invalid JSON: commitments: missing", + }, + { + name: "Good", + input: []byte(`{"header":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"88770397543877639215846057887940126737648744594802753726778414602657613619599","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions_root":"0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b","withdrawals_root":"0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"value":"12345","pubkey":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101","blinded_blobs_bundle":{"commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"],"proofs":["0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff","0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"],"blob_roots":["0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df"]}}`), + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + var res deneb.BuilderBid + 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 TestBuilderBidYAML(t *testing.T) { + tests := []struct { + name string + input []byte + root []byte + err string + }{ + { + name: "Good", + input: []byte(`{header: {parent_hash: '0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef', fee_recipient: '0x58E809C71e4885cB7B3f1D5c793AB04eD239d779', state_root: '0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d', receipts_root: '0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36', logs_bloom: '0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44', prev_randao: '0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00', block_number: 2983837628677007840, gas_limit: 6738255228996962210, gas_used: 5573520557770513197, timestamp: 1744720080366521389, extra_data: '0xc648', base_fee_per_gas: '88770397543877639215846057887940126737648744594802753726778414602657613619599', block_hash: '0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f', transactions_root: '0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b', withdrawals_root: '0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a', data_gas_used: 4438756708366371443, excess_data_gas: 12504111653614393862}, value: 12345, pubkey: '0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101', blinded_blobs_bundle: {commitments: ['0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f', '0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929'], proofs: ['0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff', '0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff'], blob_roots: ['0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29', '0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df']}}`), + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + var res deneb.BuilderBid + 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, string(rt), res.String()) + rt = bytes.TrimSuffix(rt, []byte("\n")) + assert.Equal(t, string(test.input), string(rt)) + } + }) + } +} diff --git a/api/deneb/builderbid_yaml.go b/api/deneb/builderbid_yaml.go new file mode 100644 index 0000000..88c0371 --- /dev/null +++ b/api/deneb/builderbid_yaml.go @@ -0,0 +1,54 @@ +// Copyright © 2022 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" + "math/big" + + "github.com/attestantio/go-eth2-client/spec/deneb" + "github.com/goccy/go-yaml" +) + +// builderBidYAML is the spec representation of the struct. +type builderBidYAML struct { + Header *deneb.ExecutionPayloadHeader `yaml:"header"` + Value *big.Int `yaml:"value"` + Pubkey string `yaml:"pubkey"` + BlindedBlobsBundle *BlindedBlobsBundle `yaml:"blinded_blobs_bundle"` +} + +// MarshalYAML implements yaml.Marshaler. +func (b *BuilderBid) MarshalYAML() ([]byte, error) { + yamlBytes, err := yaml.MarshalWithOptions(&builderBidYAML{ + Header: b.Header, + Value: b.Value.ToBig(), + Pubkey: b.Pubkey.String(), + BlindedBlobsBundle: b.BlindedBlobsBundle, + }, yaml.Flow(true)) + if err != nil { + return nil, err + } + return bytes.ReplaceAll(yamlBytes, []byte(`"`), []byte(`'`)), nil +} + +// UnmarshalYAML implements yaml.Unmarshaler. +func (b *BuilderBid) UnmarshalYAML(input []byte) error { + // We unmarshal to the JSON struct to save on duplicate code. + var data builderBidJSON + if err := yaml.Unmarshal(input, &data); err != nil { + return err + } + return b.unpack(&data) +} diff --git a/api/deneb/signedbuilderbid.go b/api/deneb/signedbuilderbid.go new file mode 100644 index 0000000..9a9e0ed --- /dev/null +++ b/api/deneb/signedbuilderbid.go @@ -0,0 +1,36 @@ +// Copyright © 2022 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" +) + +// SignedBuilderBid represents a SignedBuilderBid. +type SignedBuilderBid struct { + Message *BuilderBid + Signature phase0.BLSSignature `ssz-size:"96"` +} + +// String returns a string version of the structure. +func (s *SignedBuilderBid) String() string { + data, err := yaml.Marshal(s) + if err != nil { + return fmt.Sprintf("ERR: %v", err) + } + return string(data) +} diff --git a/api/deneb/signedbuilderbid_json.go b/api/deneb/signedbuilderbid_json.go new file mode 100644 index 0000000..1c6d9de --- /dev/null +++ b/api/deneb/signedbuilderbid_json.go @@ -0,0 +1,67 @@ +// Copyright © 2022 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/hex" + "encoding/json" + "fmt" + "strings" + + "github.com/attestantio/go-eth2-client/spec/phase0" + "github.com/pkg/errors" +) + +// signedBuilderBidJSON is the spec representation of the struct. +type signedBuilderBidJSON struct { + Message *BuilderBid `json:"message"` + Signature string `json:"signature"` +} + +// MarshalJSON implements json.Marshaler. +func (s *SignedBuilderBid) MarshalJSON() ([]byte, error) { + return json.Marshal(&signedBuilderBidJSON{ + Message: s.Message, + Signature: fmt.Sprintf("%#x", s.Signature), + }) +} + +// UnmarshalJSON implements json.Unmarshaler. +func (s *SignedBuilderBid) UnmarshalJSON(input []byte) error { + var data signedBuilderBidJSON + if err := json.Unmarshal(input, &data); err != nil { + return errors.Wrap(err, "invalid JSON") + } + return s.unpack(&data) +} + +func (s *SignedBuilderBid) unpack(data *signedBuilderBidJSON) error { + if data.Message == nil { + return errors.New("message missing") + } + s.Message = data.Message + if data.Signature == "" { + return errors.New("signature missing") + } + signature, err := hex.DecodeString(strings.TrimPrefix(data.Signature, "0x")) + if err != nil { + return errors.Wrap(err, "invalid value for signature") + } + if len(signature) != phase0.SignatureLength { + return errors.New("incorrect length for signature") + } + copy(s.Signature[:], signature) + + return nil +} diff --git a/api/deneb/signedbuilderbid_ssz.go b/api/deneb/signedbuilderbid_ssz.go new file mode 100644 index 0000000..ac3aac1 --- /dev/null +++ b/api/deneb/signedbuilderbid_ssz.go @@ -0,0 +1,111 @@ +// Code generated by fastssz. DO NOT EDIT. +// Hash: 9eb249d7f5f08129f3d3a9bd85af740731ca3ae3150677f16209e6b728acd4f5 +// Version: 0.1.3 +package deneb + +import ( + ssz "github.com/ferranbt/fastssz" +) + +// MarshalSSZ ssz marshals the SignedBuilderBid object +func (s *SignedBuilderBid) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SignedBuilderBid object to a target array +func (s *SignedBuilderBid) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(100) + + // Offset (0) 'Message' + dst = ssz.WriteOffset(dst, offset) + if s.Message == nil { + s.Message = new(BuilderBid) + } + offset += s.Message.SizeSSZ() + + // Field (1) 'Signature' + dst = append(dst, s.Signature[:]...) + + // Field (0) 'Message' + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SignedBuilderBid object +func (s *SignedBuilderBid) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 100 { + return ssz.ErrSize + } + + tail := buf + var o0 uint64 + + // Offset (0) 'Message' + if o0 = ssz.ReadOffset(buf[0:4]); o0 > size { + return ssz.ErrOffset + } + + if o0 < 100 { + return ssz.ErrInvalidVariableOffset + } + + // Field (1) 'Signature' + copy(s.Signature[:], buf[4:100]) + + // Field (0) 'Message' + { + buf = tail[o0:] + if s.Message == nil { + s.Message = new(BuilderBid) + } + if err = s.Message.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SignedBuilderBid object +func (s *SignedBuilderBid) SizeSSZ() (size int) { + size = 100 + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(BuilderBid) + } + size += s.Message.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SignedBuilderBid object +func (s *SignedBuilderBid) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SignedBuilderBid object with a hasher +func (s *SignedBuilderBid) HashTreeRootWith(hh ssz.HashWalker) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'Signature' + hh.PutBytes(s.Signature[:]) + + hh.Merkleize(indx) + return +} + +// GetTree ssz hashes the SignedBuilderBid object +func (s *SignedBuilderBid) GetTree() (*ssz.Node, error) { + return ssz.ProofTree(s) +} diff --git a/api/deneb/signedbuilderbid_test.go b/api/deneb/signedbuilderbid_test.go new file mode 100644 index 0000000..a6741e4 --- /dev/null +++ b/api/deneb/signedbuilderbid_test.go @@ -0,0 +1,127 @@ +// Copyright © 2022 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-builder-client/api/deneb" + "github.com/goccy/go-yaml" + "github.com/stretchr/testify/require" + "gotest.tools/assert" +) + +func TestSignedBuilderBidJSON(t *testing.T) { + tests := []struct { + name string + input []byte + err string + }{ + { + name: "Empty", + err: "unexpected end of JSON input", + }, + { + name: "JSONBad", + input: []byte("[]"), + err: "invalid JSON: json: cannot unmarshal array into Go value of type deneb.signedBuilderBidJSON", + }, + { + name: "MessageMissing", + input: []byte(`{"signature":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"}`), + err: "message missing", + }, + { + name: "MessageWrongType", + input: []byte(`{"message":true,"signature":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"}`), + err: "invalid JSON: invalid JSON: json: cannot unmarshal bool into Go value of type deneb.builderBidJSON", + }, + { + name: "MessageInvalid", + input: []byte(`{"message":{},"signature":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"}`), + err: "invalid JSON: header missing", + }, + { + name: "SignatureMissing", + input: []byte(`{"message":{"header":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"88770397543877639215846057887940126737648744594802753726778414602657613619599","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions_root":"0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b","withdrawals_root":"0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"value":"12345","pubkey":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101","blinded_blobs_bundle":{"commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"],"proofs":["0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff","0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"],"blob_roots":["0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df"]}}}`), + err: "signature missing", + }, + { + name: "SignatureWrongType", + input: []byte(`{"message":{"header":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"88770397543877639215846057887940126737648744594802753726778414602657613619599","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions_root":"0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b","withdrawals_root":"0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"value":"12345","pubkey":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101","blinded_blobs_bundle":{"commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"],"proofs":["0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff","0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"],"blob_roots":["0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df"]}},"signature":true}`), + err: "invalid JSON: json: cannot unmarshal bool into Go struct field signedBuilderBidJSON.signature of type string", + }, + { + name: "SignatureInvalid", + input: []byte(`{"message":{"header":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"88770397543877639215846057887940126737648744594802753726778414602657613619599","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions_root":"0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b","withdrawals_root":"0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"value":"12345","pubkey":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101","blinded_blobs_bundle":{"commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"],"proofs":["0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff","0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"],"blob_roots":["0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df"]}},"signature":"invalid"}`), + err: "invalid value for signature: encoding/hex: invalid byte: U+0069 'i'", + }, + { + name: "SignatureIncorrectLength", + input: []byte(`{"message":{"header":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"88770397543877639215846057887940126737648744594802753726778414602657613619599","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions_root":"0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b","withdrawals_root":"0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"value":"12345","pubkey":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101","blinded_blobs_bundle":{"commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"],"proofs":["0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff","0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"],"blob_roots":["0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df"]}},"signature":"0x0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"}`), + err: "incorrect length for signature", + }, + { + name: "Good", + input: []byte(`{"message":{"header":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"88770397543877639215846057887940126737648744594802753726778414602657613619599","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions_root":"0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b","withdrawals_root":"0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a","data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"value":"12345","pubkey":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101","blinded_blobs_bundle":{"commitments":["0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f","0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929"],"proofs":["0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff","0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff"],"blob_roots":["0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29","0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df"]}},"signature":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"}`), + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + var res deneb.SignedBuilderBid + 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 TestSignedBuilderBidYAML(t *testing.T) { + tests := []struct { + name string + input []byte + err string + }{ + { + name: "Good", + input: []byte(`{message: {header: {parent_hash: '0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef', fee_recipient: '0x58E809C71e4885cB7B3f1D5c793AB04eD239d779', state_root: '0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d', receipts_root: '0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36', logs_bloom: '0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44', prev_randao: '0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00', block_number: 2983837628677007840, gas_limit: 6738255228996962210, gas_used: 5573520557770513197, timestamp: 1744720080366521389, extra_data: '0xc648', base_fee_per_gas: '88770397543877639215846057887940126737648744594802753726778414602657613619599', block_hash: '0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f', transactions_root: '0x8457d0eb7611a621e7a094059f087415ffcfc91714fc184a1f3c48db06b4d08b', withdrawals_root: '0x5c1a7e3e0eab917a7c0d677c6b692ed55ce05f07d572e09b1c06d558f474ea7a', data_gas_used: 4438756708366371443, excess_data_gas: 12504111653614393862}, value: 12345, pubkey: '0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101', blinded_blobs_bundle: {commitments: ['0x95cc5099bbd8420d8ebade383c00a2346dace60a7604f768cd71501757b4d72eeb7d5474a6b615af10379d69aa9f478f', '0xae9f2d2217013ef61f995f9074faead9ec24e8048440164ec3d6029b87d43686dd0c97c2df9554fc997d0d66c3a78929'], proofs: ['0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff', '0xc6e27a3ae80243ba7ea88eab107a0675020e0745d75ab6a1553691007a50f7f99f597693ac33ae3cea63bf0b90a734ff'], blob_roots: ['0x3c1820c62034fc45c10abc983dbce08de28f303192dea32371a902b3e6a1fc29', '0xba4d784293df28bab771a14df58cdbed9d8d64afd0ddf1c52dff3e25fcdd51df']}}, signature: '0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101'}`), + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + var res deneb.SignedBuilderBid + 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, string(rt), res.String()) + rt = bytes.TrimSuffix(rt, []byte("\n")) + assert.Equal(t, string(test.input), string(rt)) + } + }) + } +} diff --git a/api/deneb/signedbuilderbid_yaml.go b/api/deneb/signedbuilderbid_yaml.go new file mode 100644 index 0000000..6acb81e --- /dev/null +++ b/api/deneb/signedbuilderbid_yaml.go @@ -0,0 +1,49 @@ +// Copyright © 2022 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" + "fmt" + + "github.com/goccy/go-yaml" +) + +// signedBuilderBidYAML is the spec representation of the struct. +type signedBuilderBidYAML struct { + Message *BuilderBid `yaml:"message"` + Signature string `yaml:"signature"` +} + +// MarshalYAML implements yaml.Marshaler. +func (s *SignedBuilderBid) MarshalYAML() ([]byte, error) { + yamlBytes, err := yaml.MarshalWithOptions(&signedBuilderBidYAML{ + Message: s.Message, + Signature: fmt.Sprintf("%#x", s.Signature), + }, yaml.Flow(true)) + if err != nil { + return nil, err + } + return bytes.ReplaceAll(yamlBytes, []byte(`"`), []byte(`'`)), nil +} + +// UnmarshalYAML implements yaml.Unmarshaler. +func (s *SignedBuilderBid) UnmarshalYAML(input []byte) error { + // We unmarshal to the JSON struct to save on duplicate code. + var data signedBuilderBidJSON + if err := yaml.Unmarshal(input, &data); err != nil { + return err + } + return s.unpack(&data) +} diff --git a/api/deneb/submitblockrequest.go b/api/deneb/submitblockrequest.go new file mode 100644 index 0000000..8d2fe5d --- /dev/null +++ b/api/deneb/submitblockrequest.go @@ -0,0 +1,26 @@ +package deneb + +import ( + "fmt" + + v1 "github.com/attestantio/go-builder-client/api/v1" + "github.com/attestantio/go-eth2-client/spec/deneb" + "github.com/attestantio/go-eth2-client/spec/phase0" + "github.com/goccy/go-yaml" +) + +// SubmitBlockRequest is the request from the builder to submit a block. +type SubmitBlockRequest struct { + Message *v1.BidTrace + ExecutionPayload *deneb.ExecutionPayload + Signature phase0.BLSSignature `ssz-size:"96"` +} + +// String returns a string version of the structure. +func (s *SubmitBlockRequest) String() string { + data, err := yaml.Marshal(s) + if err != nil { + return fmt.Sprintf("ERR: %v", err) + } + return string(data) +} diff --git a/api/deneb/submitblockrequest_json.go b/api/deneb/submitblockrequest_json.go new file mode 100644 index 0000000..c08b886 --- /dev/null +++ b/api/deneb/submitblockrequest_json.go @@ -0,0 +1,63 @@ +package deneb + +import ( + "encoding/hex" + "encoding/json" + "fmt" + "strings" + + v1 "github.com/attestantio/go-builder-client/api/v1" + "github.com/attestantio/go-eth2-client/spec/deneb" + "github.com/attestantio/go-eth2-client/spec/phase0" + "github.com/pkg/errors" +) + +// submitBlockRequestJSON is the spec representation of the struct. +type submitBlockRequestJSON struct { + Message *v1.BidTrace `json:"message"` + ExecutionPayload *deneb.ExecutionPayload `json:"execution_payload"` + Signature string `json:"signature"` +} + +// MarshalJSON implements json.Marshaler. +func (s *SubmitBlockRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(&submitBlockRequestJSON{ + Signature: fmt.Sprintf("%#x", s.Signature), + Message: s.Message, + ExecutionPayload: s.ExecutionPayload, + }) +} + +// UnmarshalJSON implements json.Unmarshaler. +func (s *SubmitBlockRequest) UnmarshalJSON(input []byte) error { + var data submitBlockRequestJSON + if err := json.Unmarshal(input, &data); err != nil { + return errors.Wrap(err, "invalid JSON") + } + return s.unpack(&data) +} + +func (s *SubmitBlockRequest) unpack(data *submitBlockRequestJSON) error { + if data.Message == nil { + return errors.New("message missing") + } + s.Message = data.Message + + if data.Signature == "" { + return errors.New("signature missing") + } + signature, err := hex.DecodeString(strings.TrimPrefix(data.Signature, "0x")) + if err != nil { + return errors.Wrap(err, "invalid signature") + } + if len(signature) != phase0.SignatureLength { + return errors.New("incorrect length for signature") + } + copy(s.Signature[:], signature) + + if data.ExecutionPayload == nil { + return errors.New("execution payload missing") + } + s.ExecutionPayload = data.ExecutionPayload + return nil +} diff --git a/api/deneb/submitblockrequest_ssz.go b/api/deneb/submitblockrequest_ssz.go new file mode 100644 index 0000000..aac58e9 --- /dev/null +++ b/api/deneb/submitblockrequest_ssz.go @@ -0,0 +1,137 @@ +// Code generated by fastssz. DO NOT EDIT. +// Hash: 36e3e8dd9d5d6e07166f777975c61a28b0f3a97bfeb5b51137d5591ae2a289a2 +// Version: 0.1.3 +package deneb + +import ( + v1 "github.com/attestantio/go-builder-client/api/v1" + "github.com/attestantio/go-eth2-client/spec/deneb" + ssz "github.com/ferranbt/fastssz" +) + +// MarshalSSZ ssz marshals the SubmitBlockRequest object +func (s *SubmitBlockRequest) MarshalSSZ() ([]byte, error) { + return ssz.MarshalSSZ(s) +} + +// MarshalSSZTo ssz marshals the SubmitBlockRequest object to a target array +func (s *SubmitBlockRequest) MarshalSSZTo(buf []byte) (dst []byte, err error) { + dst = buf + offset := int(336) + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(v1.BidTrace) + } + if dst, err = s.Message.MarshalSSZTo(dst); err != nil { + return + } + + // Offset (1) 'ExecutionPayload' + dst = ssz.WriteOffset(dst, offset) + if s.ExecutionPayload == nil { + s.ExecutionPayload = new(deneb.ExecutionPayload) + } + offset += s.ExecutionPayload.SizeSSZ() + + // Field (2) 'Signature' + dst = append(dst, s.Signature[:]...) + + // Field (1) 'ExecutionPayload' + if dst, err = s.ExecutionPayload.MarshalSSZTo(dst); err != nil { + return + } + + return +} + +// UnmarshalSSZ ssz unmarshals the SubmitBlockRequest object +func (s *SubmitBlockRequest) UnmarshalSSZ(buf []byte) error { + var err error + size := uint64(len(buf)) + if size < 336 { + return ssz.ErrSize + } + + tail := buf + var o1 uint64 + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(v1.BidTrace) + } + if err = s.Message.UnmarshalSSZ(buf[0:236]); err != nil { + return err + } + + // Offset (1) 'ExecutionPayload' + if o1 = ssz.ReadOffset(buf[236:240]); o1 > size { + return ssz.ErrOffset + } + + if o1 < 336 { + return ssz.ErrInvalidVariableOffset + } + + // Field (2) 'Signature' + copy(s.Signature[:], buf[240:336]) + + // Field (1) 'ExecutionPayload' + { + buf = tail[o1:] + if s.ExecutionPayload == nil { + s.ExecutionPayload = new(deneb.ExecutionPayload) + } + if err = s.ExecutionPayload.UnmarshalSSZ(buf); err != nil { + return err + } + } + return err +} + +// SizeSSZ returns the ssz encoded size in bytes for the SubmitBlockRequest object +func (s *SubmitBlockRequest) SizeSSZ() (size int) { + size = 336 + + // Field (1) 'ExecutionPayload' + if s.ExecutionPayload == nil { + s.ExecutionPayload = new(deneb.ExecutionPayload) + } + size += s.ExecutionPayload.SizeSSZ() + + return +} + +// HashTreeRoot ssz hashes the SubmitBlockRequest object +func (s *SubmitBlockRequest) HashTreeRoot() ([32]byte, error) { + return ssz.HashWithDefaultHasher(s) +} + +// HashTreeRootWith ssz hashes the SubmitBlockRequest object with a hasher +func (s *SubmitBlockRequest) HashTreeRootWith(hh ssz.HashWalker) (err error) { + indx := hh.Index() + + // Field (0) 'Message' + if s.Message == nil { + s.Message = new(v1.BidTrace) + } + if err = s.Message.HashTreeRootWith(hh); err != nil { + return + } + + // Field (1) 'ExecutionPayload' + if err = s.ExecutionPayload.HashTreeRootWith(hh); err != nil { + return + } + + // Field (2) 'Signature' + hh.PutBytes(s.Signature[:]) + + hh.Merkleize(indx) + return +} + +// GetTree ssz hashes the SubmitBlockRequest object +func (s *SubmitBlockRequest) GetTree() (*ssz.Node, error) { + return ssz.ProofTree(s) +} diff --git a/api/deneb/submitblockrequest_test.go b/api/deneb/submitblockrequest_test.go new file mode 100644 index 0000000..21961c9 --- /dev/null +++ b/api/deneb/submitblockrequest_test.go @@ -0,0 +1,130 @@ +package deneb_test + +import ( + "bytes" + "encoding/json" + "testing" + + "github.com/attestantio/go-builder-client/api/deneb" + "github.com/goccy/go-yaml" + "github.com/stretchr/testify/require" + "gotest.tools/assert" +) + +func TestSubmitBlockRequestJSON(t *testing.T) { + tests := []struct { + name string + input []byte + err string + }{ + { + name: "Empty", + err: "unexpected end of JSON input", + }, + { + name: "JSONBad", + input: []byte("[]"), + err: "invalid JSON: json: cannot unmarshal array into Go value of type deneb.submitBlockRequestJSON", + }, + { + name: "SignatureMissing", + input: []byte(`{"message":{"slot":"1","parent_hash":"0xae694782c41219774f46891c6365243b97d63d66aeb7827023b8336161615652","block_hash":"0x6462e48cff39c6e4e02e5fe1aa97bf03b23a1aa588f07cfd6296d2b9bb909ce4","builder_pubkey":"0x8efc1675ffb449abc00a6ad8a2808cdf798d96fbb979cf00956012f3983577c9afe69495411a89385421f1cff47dfc98","proposer_pubkey":"0xb7da036d8aedf726e2b3439f95bdf0e68519bb55ab83d5d97a70a5b8510f612ad45a6ecc58b8b5b9b09c6b445491a02b","proposer_fee_recipient":"0x9427A30991170f917d7b83dEf6e44d26577871Ed","gas_limit":"30000000","gas_used":"7675443","value":"22135875749231725"},"execution_payload":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"1","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions":["0x101b883470f1cb7e0a74561be59e08a6eff6aedd3408c190fd359f0bfb628d2461354b7fe4fdad4b8e72b8775cd44e339ad6b5f22a8f53c418bda2b01200a07f1fe3d010bbb96f5ca0d4919192370c15bc46ed455c797b1b11154be359638f9e487121182fae03a7d26012ed7c85b64a63aa5d56a98ac589f9950a9f5bf1a42c1eea245a98f2f4e743c5f8eac1584893104853dc1b5576826156b371a50c59bcb238d0794a185dc0816dbd8c10a0b0e1b8fbe01c4e8dd719f1e4e9b2ded8613f87f1d01e3ea28e9311d135301b2d1260e4811789e1ecbc33e573346f4da94f4c272e21e23b1d414706429c7f0b40c3de243894349c4a59ece791e5fd086897aef81fc23e4d55bb52b28174c3fa9f2c44d370fbbac1dee561f120560c3dda34a731d4618fd22d595b725efa87bb62f8f93bd7d906c4782a647e2cb14ed293e58bc793852058ab5e6f3df76b30e99102b82c8e7d005e1b675fc74b95032616c590ff08da710dd085be570cc0b2c13891625b44b5b3e1846606c39ad39bb72b","0x4b5edff58cf95969ead0470ab897da6c9d69b517e07fd4ed8fa48c14284a5a060ecb745f66cf1be55fb4905d62d8d376865f7d2d1816844fc4719f5d79ab905474d00f62aed6692e5a93be1b32740a8083fc2a61b0e1fc13ad409410d37f3cb0a5275c966abab015047c15251cd301cd31a7b2a0502f7f953e672d61606616b16d5117163064fb33d97eb566f7fce5f01d3833343c1c97e6221f9f0798415f3a4b87fd472e53a24c1a101e1dd55c8f65c2c0f4ccc4b46a133fda49db5dba96631b4cfd1a05662e42a8e15a26d3148a70be305c85f87dae4217fb91498c4098b946a9042355968b765e2e62bb0cf26d59e534c3af8795fa0f4a44ed0d39d258acd934c3416e4d4a738eaa473526d99bee037765d5f6034c830eb766ef067a1468630fbb65b7c5a862017fe84d4d1961f90c37f18a4bd2509fe2e96cb1e26971900e20295c8a9e9ed77b348d4509a8425090318be5c9d2bcda36bdfabb71bfb36755794f78c877df2825bd736a358933af77eae6edf701ed7ef168f57f677df3445d89c5eefc783184eadd3886fcfd75f5f142bc10904a019acdf7861caa7e0fba3e7831b0a549a56c0f174e80cffb8992346ddf7ce4eeff9e335531df3dff57d5f539bc0d3eac57f70a8f973e0864c87b25c3e0bea72e05eda8a120178186dfbfaa9a00f904f23a","0x452af990975c3bcafee7bde4738fdf32b8479be0e9e30b11b0ccbf31a6f884f4098e47759b7a3eb7d7bd0cfa2510dd654b28d664696aca987f55c7bfe73be1cc70a768cdb2594a13a763dbb991186b8b8b2e913857aadc08f940239d03a0b181ae849d557da5b54bfc966231690bb4660e083cdae28caf8ed33e3f66672772ea827253421bade013af57a290a915dbc777f2afccd9cb29e260ecc5ea54cd3a1e25cf66f2937f8061b3ba6b1ebf3129568f16e3dd04d5c50992cc348f3e615af346dbf2c144aeb19932dcfbff0221fae0ed9706b53245176630d011b9cd2d8630848ab1196cf9a3cc0d94392df4295be246e0ac24545c2715a40dcbc57aabffd0a86acec362affaf1bafc5c75b7ca28698a1ac14ea2c8def8ac1a32d3bf65b98aac7d0cb6fd93e5ff16274ad6d0eedf773694f29fc7a234deebc893e4cea4a5483d876e4f35019d6a62f1c407739b68b7a9f5408b4fb854534344fbffe3239feb17c0e7ac269b447bc6246579e1208b6904751eeacb985cbd43bb7792de0b428f1476301c479a3922f61f650c8298fb0b7584b52c7bfcf4dfe51335ab68d571c5815fc78d772346b0b13dbbb8906f076a0452e7e7a414e005dc37cfee85810eccab5999e2d43e13709bf66e8a8936a4283885b158115050789d3b4d9c8dc8026ac720069d78d47dd5e183032f9c53d4c57640fcd6207118d9738f00cd5ddf587f3a7c401d923aa2fb08dba1768728001abc3436cc2b5cf978b558ae58a0578344e7464cd00e719135c70244e2faf1264571a8999789c26f401753e429a1135f18906ebef19e122489622738724a6424cad363bed43304c1285c8da4824fec75d7c51b0a34070d8b976e8e8c8fd50908a7e440092dddd970fd55793e2a4446342bd3daf5b96220977d8f0c","0x0877448694993717a89c57b63640612ac4b0258cb5fdda4a311650c631c35c7313b6d2a094fdb207857d94500c37ab20ea0aa54af951fb04584a37b857981c6d13922e95cfecb70b69ab9a57ee6c13ccf8aa38c52de008ec16d9090aa4bf15db2f4afcdbb1bf4920efe5a1aeeff2c949d43460d67837af87bcdffd9e972340cb40de6d87fa11d83bbfb29e97ef2509097e8dec69a1318132a5dd7d95c1c1e13cc85d37a33c9f7d52379b4a47bf889903c8f3ebd2800526d0916e1aad00e02b682e55bc2865c3ff4ce0cc6aad1bd7d8e2901ea53f3a5e2c025dbb9a00f0ce88583c1dbd3d491ed04ba8260dc06fdb8a9162e022c75e9f057da0abed537b34214df234e1f8b26e7374cfa5470272ef03f7b41f7ed067c4c6011c8a17b2e65340e36af81ecb86420755fe5a0413495e16fabee3f9e5524ab7b12a3cffe20b1df7be32434d7da3fb1f3e9b16f42a4f550501120036b193701ac9eb6f760c2da70e3175a66b10463e43c0442a56217ca7cd25fdb46f3eff28cf1bdfe1b7eb3bf9e85ad8ffde207529c9bb1094dbae4db04a4bff6571c985bd629cdc2b78f739eca6694f32fded6944202859277740267d5dc4c1f74ddd1401c6d514ce23b885723c4618789b5c2ddeffec2179be8dec1347ca4ebed5e8bb10d7d17d41c9709a978fc6189f0c3d49d1b7f41bf8f1dc112f2ece84b6c6a687f44b95e62d274f89fa07bd0d3fdd3ee2a97233e363329ef7096ae5a45b2982859e983f5d989a928e9b88579308ece2391dbde378b81a54d38b3f81225d59f8bb511ba7eb590154ceb8258b804b6da98b3af6f395f5b3f1d12f5fd3c29ef54f31ccea0a36ec2daec0a87030daba8d079093ddde17871c4aa1a7dc3dbd4d760be2152dc250ca2bba34a55daf257b9e3704c3ee244081524cb1ae7c22a0d22f1c65b88b1e534ea1cb8f75cea4a7c03d6786f85327876da72dff1d4d049b51ecc10124279a0cbc151e76ddd475cf3dfeede59a902f4c7145786b5993c8bf8016265ec36298b27d0c6a21c7484fc01a8f14c8c287d14ab86789e34699fdb57f6c43486f0fd9013f2f2c62c60b75b1dc3e4d38a6f7c06e7029f874a204b059d834ffb44c99f843ae33ed0950","0x259310d5134d22e0ef42c3686b2adadc6cd1ae7d7836ac71a69d8ba2d02d0152c320610c12c57cba182c5d1e21198e787b21d0c522106aa8243ec994c4ea0b7959a3269d13566f3d0a3eb5ed276d9e22b33fc12e26cafde04b24ec0fd90455dc26d30a9fc25588b762681ca69aecc19e7971dd4cd063d4e31ee99f3c82015ed9a70e58b9d7cd9a8de38eba90ceffc629e7d6c06e4f2fe9cd45bae557652fe58cc9be54de9a994bf14c3bce787a106778416fbe966e95e51a35ba78d3dc4e4f7551e2791af00d50362493697d55ea6718ba2f089eda330e26100fb5adbb939afaf74982795414422712e8560cec372eaf1a56b50ba4e00e42b145537e94e88eddd7d200d0153edb6dcc12eb298666b0aef9ea495fccfda06b7affe7227bceb41d9ac9dd150df8642cdb11df5ab92b69629b6a5ccdc7ba92b6cf12172217057d291b2fdc6f104e86617be1b7fffeb36af59a018f50c055e24ef9b6daff839083bc9dfeae9101f6aff49f808f603834802d160283cd71b275bf97eb49f5612215cc8fe93875","0xfa082adb51ff0dca75ff57ba7852d794284db5b8d498002a821e5fc2c57a27cc1fe591f12860895b0057bc75ecbff9824bb46e2af06a785b6adfa9e32f49d6235776c3bcace18b330cec1126ac2bb5f3679339037817eab536fed29fe5c62ef790cb74893f1524280b0111e24fc0172130d00a88361e63511eb56a96e552d02c4944544c193189a152844ca49cadae38b7424426a74d61763716a068ba5ca9f3bdc2e0e9b644f1f2e02596bd3f446bb9f13dfb18ad2c9a2ba97771bb994f801affe2e8dda8d638e366c5b8263cc891a8a35e52c79f0856bfeaf0719bd1bfb54acc467783b6c08e55491d39b20f218342991381c38d357a4659baf8d44ddf5045d7f116bcc55f78c28a0dc100d06dff44e639b8e7adf967816c03de54eccdf9f6402a2806889d2cd980f34e5197771f13f1fa6b8c7c732031664bb675ff12d642ae62459e92b1cc28c62349e1636850b8a3ff411e1f14b097f7fa3b23eaa173d17a13f0703eecd7358aa623057325eed381a2ba13c50a13a3d8adaad0295960d925709d6e7cb101e894d9ae8db3dcb82a45570b6e02ab68aa4ea94f8779a9c45a5599","0x71ea3e9ec7ac8a144753ec38e78401b14b489a79266dd0527a4505adca584fe7406d9f7f05ef46d262384fbf1c0607f745a40681d4855aa34c37375b2cf7c99d46b6ae4e3aa9ee209782dce9d167bbff79686e59426a0513b951818ee02a9ea5ed8bcd0f991f46eee44c6e82fc6d07823a9f44f2fd7bfa0e250d6699cf7ad2577eb9eaf0dd9b1595cf018383c3d45956e508fa982bbb7744522a03bac5cba22f58a41801f579434126f5b866dcc6ca0454e9be1c7f2f6649254f3cc09142068f412d5d454b4e4d5b54e459719550f2df1901a18467d9d5297ed4a9eedb9f402f2bfd4bd2e50ab697ea5bef5e7e8082650b823635a4f0f55c18712d0f4d365824c79827d454425aec0b4ea6561ce3f1c5411ab4dff26e2412791cdaa28bf6c8fa53af412828c599d7876508f78f2c82ee67e8357947c6848af143fc5d20409049925cd1b194244466711ce7c34a72a165392564b96e280406a95da927d14ebbb6b999ef446d5ad49881c219dac8ad02d994e059569e91b84f211a4c39a3fbd594a8c835aa5976e0c8899d81a5abaa14301662b9e14fb96ea89862ad898cd7d77bcd2547f0f40471f86d4a4f26e4274f2e95fd9b2b604de867be95630b1ea6ce45ba79acc81b986605e46acda208bd3302ffcc6e83f91bff8362b3f9641ca0227d8b31341e320003","0x2b2acf1e7e043b2c38ea1750a6c31f174b0a8b00137ec3eea24ed9fdf979bf04ed923a2cf5cc05a9acf697d27ccdb2a903a4846729cd9b2eead414da983d4f5bfd0ff4f2e7eb75988e58c3a635c271","0xce0c3b31143f1d68987deaac86a1e079deb07b3d2d497de5ebe8d94486e9a7b300c691621a68b3af4fee781c7c05a931123f910054d096c2e154950d32a26c38edb70dda50a242be4d15ce60c265767b141011cd84aa585c3af798fc1eb5ea63e93e0a426c3e1468f402f7e64f20281a4bd73cc1234174f1762a9a41989f570997036c885b1fdbf9c8153a1d19afb6526a123ca6a2fe6e98c6009f8439f6b6eea881453cc58ef344338ffd04783ce9c28c2e373812a65157643f679ed99ab35f4024e6ee31877e536b03c38616fccc993365143ddaffce39c805b391674070e993c6464156043a84266860c769de218bb5f5698f4c7a9b74142535cbcc08d5b3f747cbf6a7dfbb6c7b0ccc58af4886bc441558496e9c84d80660117777f01cdb84c0a2d3b0f2d8a6eacff5a0e55bd1be6387c3793ae8f5231c59697ae914894a49b3ae13a3a124cbf6cea33b7eb575cf6cd13e6073ddf4d033a3f87366c27089afc03707ef9a44c828388733d70f09bc08de574d07cf193f0a26a08ce8253bfdb26d5306632012c6dae194783deb31b72ac35bbd57f07f1667746d85f5d5b2132b885f8cb0206949780f9406307396dc7ece7938225fc5a55c65ed3608c27f668ba9b08875979e249655d15a4c3d77b1433ab26f56d80e2ca9178d88501ee682a14d07b17635e9968da2d98aa9eb4a5ae639e42eed0c7735313d3308fd079589d5cb2dd381a9298f67325976a6dcd3e38f836e4bc3106885f6348c57c90beadd7cbca17570b90130aaadc7eb0ed2bfb97c5c8a791d0b6b2736d43b0f444909449e6ea32ba706ddfe28c407a85e82e3f22064696d2fd7b37b33e01e0016ad91047f95f0cf5c5d6abc8fd7698c4155c290a1a1db842e77e656c69ad8bc06cea9e00dadbec886ca64af5fe3045ebc8c549bf23e71c634f02da8b250618c169a54e4af45d799f2de6747bde01395a13f1a605e9be5","0x9ced04a51e77ed0730f3420571164ea5247a670b962ebf6b453660748ca5"],"withdrawals":[{"index":"2","validator_index":"3","address":"0x000102030405060708090a0b0c0d0e0f10111213","amount":"1000000000000000000"}],"data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"}}`), + err: "signature missing", + }, + { + name: "SignatureWrongType", + input: []byte(`{"message":{"slot":"1","parent_hash":"0xae694782c41219774f46891c6365243b97d63d66aeb7827023b8336161615652","block_hash":"0x6462e48cff39c6e4e02e5fe1aa97bf03b23a1aa588f07cfd6296d2b9bb909ce4","builder_pubkey":"0x8efc1675ffb449abc00a6ad8a2808cdf798d96fbb979cf00956012f3983577c9afe69495411a89385421f1cff47dfc98","proposer_pubkey":"0xb7da036d8aedf726e2b3439f95bdf0e68519bb55ab83d5d97a70a5b8510f612ad45a6ecc58b8b5b9b09c6b445491a02b","proposer_fee_recipient":"0x9427A30991170f917d7b83dEf6e44d26577871Ed","gas_limit":"30000000","gas_used":"7675443","value":"22135875749231725"},"execution_payload":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"1","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions":["0x101b883470f1cb7e0a74561be59e08a6eff6aedd3408c190fd359f0bfb628d2461354b7fe4fdad4b8e72b8775cd44e339ad6b5f22a8f53c418bda2b01200a07f1fe3d010bbb96f5ca0d4919192370c15bc46ed455c797b1b11154be359638f9e487121182fae03a7d26012ed7c85b64a63aa5d56a98ac589f9950a9f5bf1a42c1eea245a98f2f4e743c5f8eac1584893104853dc1b5576826156b371a50c59bcb238d0794a185dc0816dbd8c10a0b0e1b8fbe01c4e8dd719f1e4e9b2ded8613f87f1d01e3ea28e9311d135301b2d1260e4811789e1ecbc33e573346f4da94f4c272e21e23b1d414706429c7f0b40c3de243894349c4a59ece791e5fd086897aef81fc23e4d55bb52b28174c3fa9f2c44d370fbbac1dee561f120560c3dda34a731d4618fd22d595b725efa87bb62f8f93bd7d906c4782a647e2cb14ed293e58bc793852058ab5e6f3df76b30e99102b82c8e7d005e1b675fc74b95032616c590ff08da710dd085be570cc0b2c13891625b44b5b3e1846606c39ad39bb72b","0x4b5edff58cf95969ead0470ab897da6c9d69b517e07fd4ed8fa48c14284a5a060ecb745f66cf1be55fb4905d62d8d376865f7d2d1816844fc4719f5d79ab905474d00f62aed6692e5a93be1b32740a8083fc2a61b0e1fc13ad409410d37f3cb0a5275c966abab015047c15251cd301cd31a7b2a0502f7f953e672d61606616b16d5117163064fb33d97eb566f7fce5f01d3833343c1c97e6221f9f0798415f3a4b87fd472e53a24c1a101e1dd55c8f65c2c0f4ccc4b46a133fda49db5dba96631b4cfd1a05662e42a8e15a26d3148a70be305c85f87dae4217fb91498c4098b946a9042355968b765e2e62bb0cf26d59e534c3af8795fa0f4a44ed0d39d258acd934c3416e4d4a738eaa473526d99bee037765d5f6034c830eb766ef067a1468630fbb65b7c5a862017fe84d4d1961f90c37f18a4bd2509fe2e96cb1e26971900e20295c8a9e9ed77b348d4509a8425090318be5c9d2bcda36bdfabb71bfb36755794f78c877df2825bd736a358933af77eae6edf701ed7ef168f57f677df3445d89c5eefc783184eadd3886fcfd75f5f142bc10904a019acdf7861caa7e0fba3e7831b0a549a56c0f174e80cffb8992346ddf7ce4eeff9e335531df3dff57d5f539bc0d3eac57f70a8f973e0864c87b25c3e0bea72e05eda8a120178186dfbfaa9a00f904f23a","0x452af990975c3bcafee7bde4738fdf32b8479be0e9e30b11b0ccbf31a6f884f4098e47759b7a3eb7d7bd0cfa2510dd654b28d664696aca987f55c7bfe73be1cc70a768cdb2594a13a763dbb991186b8b8b2e913857aadc08f940239d03a0b181ae849d557da5b54bfc966231690bb4660e083cdae28caf8ed33e3f66672772ea827253421bade013af57a290a915dbc777f2afccd9cb29e260ecc5ea54cd3a1e25cf66f2937f8061b3ba6b1ebf3129568f16e3dd04d5c50992cc348f3e615af346dbf2c144aeb19932dcfbff0221fae0ed9706b53245176630d011b9cd2d8630848ab1196cf9a3cc0d94392df4295be246e0ac24545c2715a40dcbc57aabffd0a86acec362affaf1bafc5c75b7ca28698a1ac14ea2c8def8ac1a32d3bf65b98aac7d0cb6fd93e5ff16274ad6d0eedf773694f29fc7a234deebc893e4cea4a5483d876e4f35019d6a62f1c407739b68b7a9f5408b4fb854534344fbffe3239feb17c0e7ac269b447bc6246579e1208b6904751eeacb985cbd43bb7792de0b428f1476301c479a3922f61f650c8298fb0b7584b52c7bfcf4dfe51335ab68d571c5815fc78d772346b0b13dbbb8906f076a0452e7e7a414e005dc37cfee85810eccab5999e2d43e13709bf66e8a8936a4283885b158115050789d3b4d9c8dc8026ac720069d78d47dd5e183032f9c53d4c57640fcd6207118d9738f00cd5ddf587f3a7c401d923aa2fb08dba1768728001abc3436cc2b5cf978b558ae58a0578344e7464cd00e719135c70244e2faf1264571a8999789c26f401753e429a1135f18906ebef19e122489622738724a6424cad363bed43304c1285c8da4824fec75d7c51b0a34070d8b976e8e8c8fd50908a7e440092dddd970fd55793e2a4446342bd3daf5b96220977d8f0c","0x0877448694993717a89c57b63640612ac4b0258cb5fdda4a311650c631c35c7313b6d2a094fdb207857d94500c37ab20ea0aa54af951fb04584a37b857981c6d13922e95cfecb70b69ab9a57ee6c13ccf8aa38c52de008ec16d9090aa4bf15db2f4afcdbb1bf4920efe5a1aeeff2c949d43460d67837af87bcdffd9e972340cb40de6d87fa11d83bbfb29e97ef2509097e8dec69a1318132a5dd7d95c1c1e13cc85d37a33c9f7d52379b4a47bf889903c8f3ebd2800526d0916e1aad00e02b682e55bc2865c3ff4ce0cc6aad1bd7d8e2901ea53f3a5e2c025dbb9a00f0ce88583c1dbd3d491ed04ba8260dc06fdb8a9162e022c75e9f057da0abed537b34214df234e1f8b26e7374cfa5470272ef03f7b41f7ed067c4c6011c8a17b2e65340e36af81ecb86420755fe5a0413495e16fabee3f9e5524ab7b12a3cffe20b1df7be32434d7da3fb1f3e9b16f42a4f550501120036b193701ac9eb6f760c2da70e3175a66b10463e43c0442a56217ca7cd25fdb46f3eff28cf1bdfe1b7eb3bf9e85ad8ffde207529c9bb1094dbae4db04a4bff6571c985bd629cdc2b78f739eca6694f32fded6944202859277740267d5dc4c1f74ddd1401c6d514ce23b885723c4618789b5c2ddeffec2179be8dec1347ca4ebed5e8bb10d7d17d41c9709a978fc6189f0c3d49d1b7f41bf8f1dc112f2ece84b6c6a687f44b95e62d274f89fa07bd0d3fdd3ee2a97233e363329ef7096ae5a45b2982859e983f5d989a928e9b88579308ece2391dbde378b81a54d38b3f81225d59f8bb511ba7eb590154ceb8258b804b6da98b3af6f395f5b3f1d12f5fd3c29ef54f31ccea0a36ec2daec0a87030daba8d079093ddde17871c4aa1a7dc3dbd4d760be2152dc250ca2bba34a55daf257b9e3704c3ee244081524cb1ae7c22a0d22f1c65b88b1e534ea1cb8f75cea4a7c03d6786f85327876da72dff1d4d049b51ecc10124279a0cbc151e76ddd475cf3dfeede59a902f4c7145786b5993c8bf8016265ec36298b27d0c6a21c7484fc01a8f14c8c287d14ab86789e34699fdb57f6c43486f0fd9013f2f2c62c60b75b1dc3e4d38a6f7c06e7029f874a204b059d834ffb44c99f843ae33ed0950","0x259310d5134d22e0ef42c3686b2adadc6cd1ae7d7836ac71a69d8ba2d02d0152c320610c12c57cba182c5d1e21198e787b21d0c522106aa8243ec994c4ea0b7959a3269d13566f3d0a3eb5ed276d9e22b33fc12e26cafde04b24ec0fd90455dc26d30a9fc25588b762681ca69aecc19e7971dd4cd063d4e31ee99f3c82015ed9a70e58b9d7cd9a8de38eba90ceffc629e7d6c06e4f2fe9cd45bae557652fe58cc9be54de9a994bf14c3bce787a106778416fbe966e95e51a35ba78d3dc4e4f7551e2791af00d50362493697d55ea6718ba2f089eda330e26100fb5adbb939afaf74982795414422712e8560cec372eaf1a56b50ba4e00e42b145537e94e88eddd7d200d0153edb6dcc12eb298666b0aef9ea495fccfda06b7affe7227bceb41d9ac9dd150df8642cdb11df5ab92b69629b6a5ccdc7ba92b6cf12172217057d291b2fdc6f104e86617be1b7fffeb36af59a018f50c055e24ef9b6daff839083bc9dfeae9101f6aff49f808f603834802d160283cd71b275bf97eb49f5612215cc8fe93875","0xfa082adb51ff0dca75ff57ba7852d794284db5b8d498002a821e5fc2c57a27cc1fe591f12860895b0057bc75ecbff9824bb46e2af06a785b6adfa9e32f49d6235776c3bcace18b330cec1126ac2bb5f3679339037817eab536fed29fe5c62ef790cb74893f1524280b0111e24fc0172130d00a88361e63511eb56a96e552d02c4944544c193189a152844ca49cadae38b7424426a74d61763716a068ba5ca9f3bdc2e0e9b644f1f2e02596bd3f446bb9f13dfb18ad2c9a2ba97771bb994f801affe2e8dda8d638e366c5b8263cc891a8a35e52c79f0856bfeaf0719bd1bfb54acc467783b6c08e55491d39b20f218342991381c38d357a4659baf8d44ddf5045d7f116bcc55f78c28a0dc100d06dff44e639b8e7adf967816c03de54eccdf9f6402a2806889d2cd980f34e5197771f13f1fa6b8c7c732031664bb675ff12d642ae62459e92b1cc28c62349e1636850b8a3ff411e1f14b097f7fa3b23eaa173d17a13f0703eecd7358aa623057325eed381a2ba13c50a13a3d8adaad0295960d925709d6e7cb101e894d9ae8db3dcb82a45570b6e02ab68aa4ea94f8779a9c45a5599","0x71ea3e9ec7ac8a144753ec38e78401b14b489a79266dd0527a4505adca584fe7406d9f7f05ef46d262384fbf1c0607f745a40681d4855aa34c37375b2cf7c99d46b6ae4e3aa9ee209782dce9d167bbff79686e59426a0513b951818ee02a9ea5ed8bcd0f991f46eee44c6e82fc6d07823a9f44f2fd7bfa0e250d6699cf7ad2577eb9eaf0dd9b1595cf018383c3d45956e508fa982bbb7744522a03bac5cba22f58a41801f579434126f5b866dcc6ca0454e9be1c7f2f6649254f3cc09142068f412d5d454b4e4d5b54e459719550f2df1901a18467d9d5297ed4a9eedb9f402f2bfd4bd2e50ab697ea5bef5e7e8082650b823635a4f0f55c18712d0f4d365824c79827d454425aec0b4ea6561ce3f1c5411ab4dff26e2412791cdaa28bf6c8fa53af412828c599d7876508f78f2c82ee67e8357947c6848af143fc5d20409049925cd1b194244466711ce7c34a72a165392564b96e280406a95da927d14ebbb6b999ef446d5ad49881c219dac8ad02d994e059569e91b84f211a4c39a3fbd594a8c835aa5976e0c8899d81a5abaa14301662b9e14fb96ea89862ad898cd7d77bcd2547f0f40471f86d4a4f26e4274f2e95fd9b2b604de867be95630b1ea6ce45ba79acc81b986605e46acda208bd3302ffcc6e83f91bff8362b3f9641ca0227d8b31341e320003","0x2b2acf1e7e043b2c38ea1750a6c31f174b0a8b00137ec3eea24ed9fdf979bf04ed923a2cf5cc05a9acf697d27ccdb2a903a4846729cd9b2eead414da983d4f5bfd0ff4f2e7eb75988e58c3a635c271","0xce0c3b31143f1d68987deaac86a1e079deb07b3d2d497de5ebe8d94486e9a7b300c691621a68b3af4fee781c7c05a931123f910054d096c2e154950d32a26c38edb70dda50a242be4d15ce60c265767b141011cd84aa585c3af798fc1eb5ea63e93e0a426c3e1468f402f7e64f20281a4bd73cc1234174f1762a9a41989f570997036c885b1fdbf9c8153a1d19afb6526a123ca6a2fe6e98c6009f8439f6b6eea881453cc58ef344338ffd04783ce9c28c2e373812a65157643f679ed99ab35f4024e6ee31877e536b03c38616fccc993365143ddaffce39c805b391674070e993c6464156043a84266860c769de218bb5f5698f4c7a9b74142535cbcc08d5b3f747cbf6a7dfbb6c7b0ccc58af4886bc441558496e9c84d80660117777f01cdb84c0a2d3b0f2d8a6eacff5a0e55bd1be6387c3793ae8f5231c59697ae914894a49b3ae13a3a124cbf6cea33b7eb575cf6cd13e6073ddf4d033a3f87366c27089afc03707ef9a44c828388733d70f09bc08de574d07cf193f0a26a08ce8253bfdb26d5306632012c6dae194783deb31b72ac35bbd57f07f1667746d85f5d5b2132b885f8cb0206949780f9406307396dc7ece7938225fc5a55c65ed3608c27f668ba9b08875979e249655d15a4c3d77b1433ab26f56d80e2ca9178d88501ee682a14d07b17635e9968da2d98aa9eb4a5ae639e42eed0c7735313d3308fd079589d5cb2dd381a9298f67325976a6dcd3e38f836e4bc3106885f6348c57c90beadd7cbca17570b90130aaadc7eb0ed2bfb97c5c8a791d0b6b2736d43b0f444909449e6ea32ba706ddfe28c407a85e82e3f22064696d2fd7b37b33e01e0016ad91047f95f0cf5c5d6abc8fd7698c4155c290a1a1db842e77e656c69ad8bc06cea9e00dadbec886ca64af5fe3045ebc8c549bf23e71c634f02da8b250618c169a54e4af45d799f2de6747bde01395a13f1a605e9be5","0x9ced04a51e77ed0730f3420571164ea5247a670b962ebf6b453660748ca5"],"withdrawals":[{"index":"2","validator_index":"3","address":"0x000102030405060708090a0b0c0d0e0f10111213","amount":"1000000000000000000"}],"data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"signature":true}`), + err: "invalid JSON: json: cannot unmarshal bool into Go struct field submitBlockRequestJSON.signature of type string", + }, + { + name: "SignatureInvalid", + input: []byte(`{"message":{"slot":"1","parent_hash":"0xae694782c41219774f46891c6365243b97d63d66aeb7827023b8336161615652","block_hash":"0x6462e48cff39c6e4e02e5fe1aa97bf03b23a1aa588f07cfd6296d2b9bb909ce4","builder_pubkey":"0x8efc1675ffb449abc00a6ad8a2808cdf798d96fbb979cf00956012f3983577c9afe69495411a89385421f1cff47dfc98","proposer_pubkey":"0xb7da036d8aedf726e2b3439f95bdf0e68519bb55ab83d5d97a70a5b8510f612ad45a6ecc58b8b5b9b09c6b445491a02b","proposer_fee_recipient":"0x9427A30991170f917d7b83dEf6e44d26577871Ed","gas_limit":"30000000","gas_used":"7675443","value":"22135875749231725"},"execution_payload":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"1","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions":["0x101b883470f1cb7e0a74561be59e08a6eff6aedd3408c190fd359f0bfb628d2461354b7fe4fdad4b8e72b8775cd44e339ad6b5f22a8f53c418bda2b01200a07f1fe3d010bbb96f5ca0d4919192370c15bc46ed455c797b1b11154be359638f9e487121182fae03a7d26012ed7c85b64a63aa5d56a98ac589f9950a9f5bf1a42c1eea245a98f2f4e743c5f8eac1584893104853dc1b5576826156b371a50c59bcb238d0794a185dc0816dbd8c10a0b0e1b8fbe01c4e8dd719f1e4e9b2ded8613f87f1d01e3ea28e9311d135301b2d1260e4811789e1ecbc33e573346f4da94f4c272e21e23b1d414706429c7f0b40c3de243894349c4a59ece791e5fd086897aef81fc23e4d55bb52b28174c3fa9f2c44d370fbbac1dee561f120560c3dda34a731d4618fd22d595b725efa87bb62f8f93bd7d906c4782a647e2cb14ed293e58bc793852058ab5e6f3df76b30e99102b82c8e7d005e1b675fc74b95032616c590ff08da710dd085be570cc0b2c13891625b44b5b3e1846606c39ad39bb72b","0x4b5edff58cf95969ead0470ab897da6c9d69b517e07fd4ed8fa48c14284a5a060ecb745f66cf1be55fb4905d62d8d376865f7d2d1816844fc4719f5d79ab905474d00f62aed6692e5a93be1b32740a8083fc2a61b0e1fc13ad409410d37f3cb0a5275c966abab015047c15251cd301cd31a7b2a0502f7f953e672d61606616b16d5117163064fb33d97eb566f7fce5f01d3833343c1c97e6221f9f0798415f3a4b87fd472e53a24c1a101e1dd55c8f65c2c0f4ccc4b46a133fda49db5dba96631b4cfd1a05662e42a8e15a26d3148a70be305c85f87dae4217fb91498c4098b946a9042355968b765e2e62bb0cf26d59e534c3af8795fa0f4a44ed0d39d258acd934c3416e4d4a738eaa473526d99bee037765d5f6034c830eb766ef067a1468630fbb65b7c5a862017fe84d4d1961f90c37f18a4bd2509fe2e96cb1e26971900e20295c8a9e9ed77b348d4509a8425090318be5c9d2bcda36bdfabb71bfb36755794f78c877df2825bd736a358933af77eae6edf701ed7ef168f57f677df3445d89c5eefc783184eadd3886fcfd75f5f142bc10904a019acdf7861caa7e0fba3e7831b0a549a56c0f174e80cffb8992346ddf7ce4eeff9e335531df3dff57d5f539bc0d3eac57f70a8f973e0864c87b25c3e0bea72e05eda8a120178186dfbfaa9a00f904f23a","0x452af990975c3bcafee7bde4738fdf32b8479be0e9e30b11b0ccbf31a6f884f4098e47759b7a3eb7d7bd0cfa2510dd654b28d664696aca987f55c7bfe73be1cc70a768cdb2594a13a763dbb991186b8b8b2e913857aadc08f940239d03a0b181ae849d557da5b54bfc966231690bb4660e083cdae28caf8ed33e3f66672772ea827253421bade013af57a290a915dbc777f2afccd9cb29e260ecc5ea54cd3a1e25cf66f2937f8061b3ba6b1ebf3129568f16e3dd04d5c50992cc348f3e615af346dbf2c144aeb19932dcfbff0221fae0ed9706b53245176630d011b9cd2d8630848ab1196cf9a3cc0d94392df4295be246e0ac24545c2715a40dcbc57aabffd0a86acec362affaf1bafc5c75b7ca28698a1ac14ea2c8def8ac1a32d3bf65b98aac7d0cb6fd93e5ff16274ad6d0eedf773694f29fc7a234deebc893e4cea4a5483d876e4f35019d6a62f1c407739b68b7a9f5408b4fb854534344fbffe3239feb17c0e7ac269b447bc6246579e1208b6904751eeacb985cbd43bb7792de0b428f1476301c479a3922f61f650c8298fb0b7584b52c7bfcf4dfe51335ab68d571c5815fc78d772346b0b13dbbb8906f076a0452e7e7a414e005dc37cfee85810eccab5999e2d43e13709bf66e8a8936a4283885b158115050789d3b4d9c8dc8026ac720069d78d47dd5e183032f9c53d4c57640fcd6207118d9738f00cd5ddf587f3a7c401d923aa2fb08dba1768728001abc3436cc2b5cf978b558ae58a0578344e7464cd00e719135c70244e2faf1264571a8999789c26f401753e429a1135f18906ebef19e122489622738724a6424cad363bed43304c1285c8da4824fec75d7c51b0a34070d8b976e8e8c8fd50908a7e440092dddd970fd55793e2a4446342bd3daf5b96220977d8f0c","0x0877448694993717a89c57b63640612ac4b0258cb5fdda4a311650c631c35c7313b6d2a094fdb207857d94500c37ab20ea0aa54af951fb04584a37b857981c6d13922e95cfecb70b69ab9a57ee6c13ccf8aa38c52de008ec16d9090aa4bf15db2f4afcdbb1bf4920efe5a1aeeff2c949d43460d67837af87bcdffd9e972340cb40de6d87fa11d83bbfb29e97ef2509097e8dec69a1318132a5dd7d95c1c1e13cc85d37a33c9f7d52379b4a47bf889903c8f3ebd2800526d0916e1aad00e02b682e55bc2865c3ff4ce0cc6aad1bd7d8e2901ea53f3a5e2c025dbb9a00f0ce88583c1dbd3d491ed04ba8260dc06fdb8a9162e022c75e9f057da0abed537b34214df234e1f8b26e7374cfa5470272ef03f7b41f7ed067c4c6011c8a17b2e65340e36af81ecb86420755fe5a0413495e16fabee3f9e5524ab7b12a3cffe20b1df7be32434d7da3fb1f3e9b16f42a4f550501120036b193701ac9eb6f760c2da70e3175a66b10463e43c0442a56217ca7cd25fdb46f3eff28cf1bdfe1b7eb3bf9e85ad8ffde207529c9bb1094dbae4db04a4bff6571c985bd629cdc2b78f739eca6694f32fded6944202859277740267d5dc4c1f74ddd1401c6d514ce23b885723c4618789b5c2ddeffec2179be8dec1347ca4ebed5e8bb10d7d17d41c9709a978fc6189f0c3d49d1b7f41bf8f1dc112f2ece84b6c6a687f44b95e62d274f89fa07bd0d3fdd3ee2a97233e363329ef7096ae5a45b2982859e983f5d989a928e9b88579308ece2391dbde378b81a54d38b3f81225d59f8bb511ba7eb590154ceb8258b804b6da98b3af6f395f5b3f1d12f5fd3c29ef54f31ccea0a36ec2daec0a87030daba8d079093ddde17871c4aa1a7dc3dbd4d760be2152dc250ca2bba34a55daf257b9e3704c3ee244081524cb1ae7c22a0d22f1c65b88b1e534ea1cb8f75cea4a7c03d6786f85327876da72dff1d4d049b51ecc10124279a0cbc151e76ddd475cf3dfeede59a902f4c7145786b5993c8bf8016265ec36298b27d0c6a21c7484fc01a8f14c8c287d14ab86789e34699fdb57f6c43486f0fd9013f2f2c62c60b75b1dc3e4d38a6f7c06e7029f874a204b059d834ffb44c99f843ae33ed0950","0x259310d5134d22e0ef42c3686b2adadc6cd1ae7d7836ac71a69d8ba2d02d0152c320610c12c57cba182c5d1e21198e787b21d0c522106aa8243ec994c4ea0b7959a3269d13566f3d0a3eb5ed276d9e22b33fc12e26cafde04b24ec0fd90455dc26d30a9fc25588b762681ca69aecc19e7971dd4cd063d4e31ee99f3c82015ed9a70e58b9d7cd9a8de38eba90ceffc629e7d6c06e4f2fe9cd45bae557652fe58cc9be54de9a994bf14c3bce787a106778416fbe966e95e51a35ba78d3dc4e4f7551e2791af00d50362493697d55ea6718ba2f089eda330e26100fb5adbb939afaf74982795414422712e8560cec372eaf1a56b50ba4e00e42b145537e94e88eddd7d200d0153edb6dcc12eb298666b0aef9ea495fccfda06b7affe7227bceb41d9ac9dd150df8642cdb11df5ab92b69629b6a5ccdc7ba92b6cf12172217057d291b2fdc6f104e86617be1b7fffeb36af59a018f50c055e24ef9b6daff839083bc9dfeae9101f6aff49f808f603834802d160283cd71b275bf97eb49f5612215cc8fe93875","0xfa082adb51ff0dca75ff57ba7852d794284db5b8d498002a821e5fc2c57a27cc1fe591f12860895b0057bc75ecbff9824bb46e2af06a785b6adfa9e32f49d6235776c3bcace18b330cec1126ac2bb5f3679339037817eab536fed29fe5c62ef790cb74893f1524280b0111e24fc0172130d00a88361e63511eb56a96e552d02c4944544c193189a152844ca49cadae38b7424426a74d61763716a068ba5ca9f3bdc2e0e9b644f1f2e02596bd3f446bb9f13dfb18ad2c9a2ba97771bb994f801affe2e8dda8d638e366c5b8263cc891a8a35e52c79f0856bfeaf0719bd1bfb54acc467783b6c08e55491d39b20f218342991381c38d357a4659baf8d44ddf5045d7f116bcc55f78c28a0dc100d06dff44e639b8e7adf967816c03de54eccdf9f6402a2806889d2cd980f34e5197771f13f1fa6b8c7c732031664bb675ff12d642ae62459e92b1cc28c62349e1636850b8a3ff411e1f14b097f7fa3b23eaa173d17a13f0703eecd7358aa623057325eed381a2ba13c50a13a3d8adaad0295960d925709d6e7cb101e894d9ae8db3dcb82a45570b6e02ab68aa4ea94f8779a9c45a5599","0x71ea3e9ec7ac8a144753ec38e78401b14b489a79266dd0527a4505adca584fe7406d9f7f05ef46d262384fbf1c0607f745a40681d4855aa34c37375b2cf7c99d46b6ae4e3aa9ee209782dce9d167bbff79686e59426a0513b951818ee02a9ea5ed8bcd0f991f46eee44c6e82fc6d07823a9f44f2fd7bfa0e250d6699cf7ad2577eb9eaf0dd9b1595cf018383c3d45956e508fa982bbb7744522a03bac5cba22f58a41801f579434126f5b866dcc6ca0454e9be1c7f2f6649254f3cc09142068f412d5d454b4e4d5b54e459719550f2df1901a18467d9d5297ed4a9eedb9f402f2bfd4bd2e50ab697ea5bef5e7e8082650b823635a4f0f55c18712d0f4d365824c79827d454425aec0b4ea6561ce3f1c5411ab4dff26e2412791cdaa28bf6c8fa53af412828c599d7876508f78f2c82ee67e8357947c6848af143fc5d20409049925cd1b194244466711ce7c34a72a165392564b96e280406a95da927d14ebbb6b999ef446d5ad49881c219dac8ad02d994e059569e91b84f211a4c39a3fbd594a8c835aa5976e0c8899d81a5abaa14301662b9e14fb96ea89862ad898cd7d77bcd2547f0f40471f86d4a4f26e4274f2e95fd9b2b604de867be95630b1ea6ce45ba79acc81b986605e46acda208bd3302ffcc6e83f91bff8362b3f9641ca0227d8b31341e320003","0x2b2acf1e7e043b2c38ea1750a6c31f174b0a8b00137ec3eea24ed9fdf979bf04ed923a2cf5cc05a9acf697d27ccdb2a903a4846729cd9b2eead414da983d4f5bfd0ff4f2e7eb75988e58c3a635c271","0xce0c3b31143f1d68987deaac86a1e079deb07b3d2d497de5ebe8d94486e9a7b300c691621a68b3af4fee781c7c05a931123f910054d096c2e154950d32a26c38edb70dda50a242be4d15ce60c265767b141011cd84aa585c3af798fc1eb5ea63e93e0a426c3e1468f402f7e64f20281a4bd73cc1234174f1762a9a41989f570997036c885b1fdbf9c8153a1d19afb6526a123ca6a2fe6e98c6009f8439f6b6eea881453cc58ef344338ffd04783ce9c28c2e373812a65157643f679ed99ab35f4024e6ee31877e536b03c38616fccc993365143ddaffce39c805b391674070e993c6464156043a84266860c769de218bb5f5698f4c7a9b74142535cbcc08d5b3f747cbf6a7dfbb6c7b0ccc58af4886bc441558496e9c84d80660117777f01cdb84c0a2d3b0f2d8a6eacff5a0e55bd1be6387c3793ae8f5231c59697ae914894a49b3ae13a3a124cbf6cea33b7eb575cf6cd13e6073ddf4d033a3f87366c27089afc03707ef9a44c828388733d70f09bc08de574d07cf193f0a26a08ce8253bfdb26d5306632012c6dae194783deb31b72ac35bbd57f07f1667746d85f5d5b2132b885f8cb0206949780f9406307396dc7ece7938225fc5a55c65ed3608c27f668ba9b08875979e249655d15a4c3d77b1433ab26f56d80e2ca9178d88501ee682a14d07b17635e9968da2d98aa9eb4a5ae639e42eed0c7735313d3308fd079589d5cb2dd381a9298f67325976a6dcd3e38f836e4bc3106885f6348c57c90beadd7cbca17570b90130aaadc7eb0ed2bfb97c5c8a791d0b6b2736d43b0f444909449e6ea32ba706ddfe28c407a85e82e3f22064696d2fd7b37b33e01e0016ad91047f95f0cf5c5d6abc8fd7698c4155c290a1a1db842e77e656c69ad8bc06cea9e00dadbec886ca64af5fe3045ebc8c549bf23e71c634f02da8b250618c169a54e4af45d799f2de6747bde01395a13f1a605e9be5","0x9ced04a51e77ed0730f3420571164ea5247a670b962ebf6b453660748ca5"],"withdrawals":[{"index":"2","validator_index":"3","address":"0x000102030405060708090a0b0c0d0e0f10111213","amount":"1000000000000000000"}],"data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"signature":"invalid"}`), + err: "invalid signature: encoding/hex: invalid byte: U+0069 'i'", + }, + { + name: "SignatureIncorrectLength", + input: []byte(`{"message":{"slot":"1","parent_hash":"0xae694782c41219774f46891c6365243b97d63d66aeb7827023b8336161615652","block_hash":"0x6462e48cff39c6e4e02e5fe1aa97bf03b23a1aa588f07cfd6296d2b9bb909ce4","builder_pubkey":"0x8efc1675ffb449abc00a6ad8a2808cdf798d96fbb979cf00956012f3983577c9afe69495411a89385421f1cff47dfc98","proposer_pubkey":"0xb7da036d8aedf726e2b3439f95bdf0e68519bb55ab83d5d97a70a5b8510f612ad45a6ecc58b8b5b9b09c6b445491a02b","proposer_fee_recipient":"0x9427A30991170f917d7b83dEf6e44d26577871Ed","gas_limit":"30000000","gas_used":"7675443","value":"22135875749231725"},"execution_payload":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"1","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions":["0x101b883470f1cb7e0a74561be59e08a6eff6aedd3408c190fd359f0bfb628d2461354b7fe4fdad4b8e72b8775cd44e339ad6b5f22a8f53c418bda2b01200a07f1fe3d010bbb96f5ca0d4919192370c15bc46ed455c797b1b11154be359638f9e487121182fae03a7d26012ed7c85b64a63aa5d56a98ac589f9950a9f5bf1a42c1eea245a98f2f4e743c5f8eac1584893104853dc1b5576826156b371a50c59bcb238d0794a185dc0816dbd8c10a0b0e1b8fbe01c4e8dd719f1e4e9b2ded8613f87f1d01e3ea28e9311d135301b2d1260e4811789e1ecbc33e573346f4da94f4c272e21e23b1d414706429c7f0b40c3de243894349c4a59ece791e5fd086897aef81fc23e4d55bb52b28174c3fa9f2c44d370fbbac1dee561f120560c3dda34a731d4618fd22d595b725efa87bb62f8f93bd7d906c4782a647e2cb14ed293e58bc793852058ab5e6f3df76b30e99102b82c8e7d005e1b675fc74b95032616c590ff08da710dd085be570cc0b2c13891625b44b5b3e1846606c39ad39bb72b","0x4b5edff58cf95969ead0470ab897da6c9d69b517e07fd4ed8fa48c14284a5a060ecb745f66cf1be55fb4905d62d8d376865f7d2d1816844fc4719f5d79ab905474d00f62aed6692e5a93be1b32740a8083fc2a61b0e1fc13ad409410d37f3cb0a5275c966abab015047c15251cd301cd31a7b2a0502f7f953e672d61606616b16d5117163064fb33d97eb566f7fce5f01d3833343c1c97e6221f9f0798415f3a4b87fd472e53a24c1a101e1dd55c8f65c2c0f4ccc4b46a133fda49db5dba96631b4cfd1a05662e42a8e15a26d3148a70be305c85f87dae4217fb91498c4098b946a9042355968b765e2e62bb0cf26d59e534c3af8795fa0f4a44ed0d39d258acd934c3416e4d4a738eaa473526d99bee037765d5f6034c830eb766ef067a1468630fbb65b7c5a862017fe84d4d1961f90c37f18a4bd2509fe2e96cb1e26971900e20295c8a9e9ed77b348d4509a8425090318be5c9d2bcda36bdfabb71bfb36755794f78c877df2825bd736a358933af77eae6edf701ed7ef168f57f677df3445d89c5eefc783184eadd3886fcfd75f5f142bc10904a019acdf7861caa7e0fba3e7831b0a549a56c0f174e80cffb8992346ddf7ce4eeff9e335531df3dff57d5f539bc0d3eac57f70a8f973e0864c87b25c3e0bea72e05eda8a120178186dfbfaa9a00f904f23a","0x452af990975c3bcafee7bde4738fdf32b8479be0e9e30b11b0ccbf31a6f884f4098e47759b7a3eb7d7bd0cfa2510dd654b28d664696aca987f55c7bfe73be1cc70a768cdb2594a13a763dbb991186b8b8b2e913857aadc08f940239d03a0b181ae849d557da5b54bfc966231690bb4660e083cdae28caf8ed33e3f66672772ea827253421bade013af57a290a915dbc777f2afccd9cb29e260ecc5ea54cd3a1e25cf66f2937f8061b3ba6b1ebf3129568f16e3dd04d5c50992cc348f3e615af346dbf2c144aeb19932dcfbff0221fae0ed9706b53245176630d011b9cd2d8630848ab1196cf9a3cc0d94392df4295be246e0ac24545c2715a40dcbc57aabffd0a86acec362affaf1bafc5c75b7ca28698a1ac14ea2c8def8ac1a32d3bf65b98aac7d0cb6fd93e5ff16274ad6d0eedf773694f29fc7a234deebc893e4cea4a5483d876e4f35019d6a62f1c407739b68b7a9f5408b4fb854534344fbffe3239feb17c0e7ac269b447bc6246579e1208b6904751eeacb985cbd43bb7792de0b428f1476301c479a3922f61f650c8298fb0b7584b52c7bfcf4dfe51335ab68d571c5815fc78d772346b0b13dbbb8906f076a0452e7e7a414e005dc37cfee85810eccab5999e2d43e13709bf66e8a8936a4283885b158115050789d3b4d9c8dc8026ac720069d78d47dd5e183032f9c53d4c57640fcd6207118d9738f00cd5ddf587f3a7c401d923aa2fb08dba1768728001abc3436cc2b5cf978b558ae58a0578344e7464cd00e719135c70244e2faf1264571a8999789c26f401753e429a1135f18906ebef19e122489622738724a6424cad363bed43304c1285c8da4824fec75d7c51b0a34070d8b976e8e8c8fd50908a7e440092dddd970fd55793e2a4446342bd3daf5b96220977d8f0c","0x0877448694993717a89c57b63640612ac4b0258cb5fdda4a311650c631c35c7313b6d2a094fdb207857d94500c37ab20ea0aa54af951fb04584a37b857981c6d13922e95cfecb70b69ab9a57ee6c13ccf8aa38c52de008ec16d9090aa4bf15db2f4afcdbb1bf4920efe5a1aeeff2c949d43460d67837af87bcdffd9e972340cb40de6d87fa11d83bbfb29e97ef2509097e8dec69a1318132a5dd7d95c1c1e13cc85d37a33c9f7d52379b4a47bf889903c8f3ebd2800526d0916e1aad00e02b682e55bc2865c3ff4ce0cc6aad1bd7d8e2901ea53f3a5e2c025dbb9a00f0ce88583c1dbd3d491ed04ba8260dc06fdb8a9162e022c75e9f057da0abed537b34214df234e1f8b26e7374cfa5470272ef03f7b41f7ed067c4c6011c8a17b2e65340e36af81ecb86420755fe5a0413495e16fabee3f9e5524ab7b12a3cffe20b1df7be32434d7da3fb1f3e9b16f42a4f550501120036b193701ac9eb6f760c2da70e3175a66b10463e43c0442a56217ca7cd25fdb46f3eff28cf1bdfe1b7eb3bf9e85ad8ffde207529c9bb1094dbae4db04a4bff6571c985bd629cdc2b78f739eca6694f32fded6944202859277740267d5dc4c1f74ddd1401c6d514ce23b885723c4618789b5c2ddeffec2179be8dec1347ca4ebed5e8bb10d7d17d41c9709a978fc6189f0c3d49d1b7f41bf8f1dc112f2ece84b6c6a687f44b95e62d274f89fa07bd0d3fdd3ee2a97233e363329ef7096ae5a45b2982859e983f5d989a928e9b88579308ece2391dbde378b81a54d38b3f81225d59f8bb511ba7eb590154ceb8258b804b6da98b3af6f395f5b3f1d12f5fd3c29ef54f31ccea0a36ec2daec0a87030daba8d079093ddde17871c4aa1a7dc3dbd4d760be2152dc250ca2bba34a55daf257b9e3704c3ee244081524cb1ae7c22a0d22f1c65b88b1e534ea1cb8f75cea4a7c03d6786f85327876da72dff1d4d049b51ecc10124279a0cbc151e76ddd475cf3dfeede59a902f4c7145786b5993c8bf8016265ec36298b27d0c6a21c7484fc01a8f14c8c287d14ab86789e34699fdb57f6c43486f0fd9013f2f2c62c60b75b1dc3e4d38a6f7c06e7029f874a204b059d834ffb44c99f843ae33ed0950","0x259310d5134d22e0ef42c3686b2adadc6cd1ae7d7836ac71a69d8ba2d02d0152c320610c12c57cba182c5d1e21198e787b21d0c522106aa8243ec994c4ea0b7959a3269d13566f3d0a3eb5ed276d9e22b33fc12e26cafde04b24ec0fd90455dc26d30a9fc25588b762681ca69aecc19e7971dd4cd063d4e31ee99f3c82015ed9a70e58b9d7cd9a8de38eba90ceffc629e7d6c06e4f2fe9cd45bae557652fe58cc9be54de9a994bf14c3bce787a106778416fbe966e95e51a35ba78d3dc4e4f7551e2791af00d50362493697d55ea6718ba2f089eda330e26100fb5adbb939afaf74982795414422712e8560cec372eaf1a56b50ba4e00e42b145537e94e88eddd7d200d0153edb6dcc12eb298666b0aef9ea495fccfda06b7affe7227bceb41d9ac9dd150df8642cdb11df5ab92b69629b6a5ccdc7ba92b6cf12172217057d291b2fdc6f104e86617be1b7fffeb36af59a018f50c055e24ef9b6daff839083bc9dfeae9101f6aff49f808f603834802d160283cd71b275bf97eb49f5612215cc8fe93875","0xfa082adb51ff0dca75ff57ba7852d794284db5b8d498002a821e5fc2c57a27cc1fe591f12860895b0057bc75ecbff9824bb46e2af06a785b6adfa9e32f49d6235776c3bcace18b330cec1126ac2bb5f3679339037817eab536fed29fe5c62ef790cb74893f1524280b0111e24fc0172130d00a88361e63511eb56a96e552d02c4944544c193189a152844ca49cadae38b7424426a74d61763716a068ba5ca9f3bdc2e0e9b644f1f2e02596bd3f446bb9f13dfb18ad2c9a2ba97771bb994f801affe2e8dda8d638e366c5b8263cc891a8a35e52c79f0856bfeaf0719bd1bfb54acc467783b6c08e55491d39b20f218342991381c38d357a4659baf8d44ddf5045d7f116bcc55f78c28a0dc100d06dff44e639b8e7adf967816c03de54eccdf9f6402a2806889d2cd980f34e5197771f13f1fa6b8c7c732031664bb675ff12d642ae62459e92b1cc28c62349e1636850b8a3ff411e1f14b097f7fa3b23eaa173d17a13f0703eecd7358aa623057325eed381a2ba13c50a13a3d8adaad0295960d925709d6e7cb101e894d9ae8db3dcb82a45570b6e02ab68aa4ea94f8779a9c45a5599","0x71ea3e9ec7ac8a144753ec38e78401b14b489a79266dd0527a4505adca584fe7406d9f7f05ef46d262384fbf1c0607f745a40681d4855aa34c37375b2cf7c99d46b6ae4e3aa9ee209782dce9d167bbff79686e59426a0513b951818ee02a9ea5ed8bcd0f991f46eee44c6e82fc6d07823a9f44f2fd7bfa0e250d6699cf7ad2577eb9eaf0dd9b1595cf018383c3d45956e508fa982bbb7744522a03bac5cba22f58a41801f579434126f5b866dcc6ca0454e9be1c7f2f6649254f3cc09142068f412d5d454b4e4d5b54e459719550f2df1901a18467d9d5297ed4a9eedb9f402f2bfd4bd2e50ab697ea5bef5e7e8082650b823635a4f0f55c18712d0f4d365824c79827d454425aec0b4ea6561ce3f1c5411ab4dff26e2412791cdaa28bf6c8fa53af412828c599d7876508f78f2c82ee67e8357947c6848af143fc5d20409049925cd1b194244466711ce7c34a72a165392564b96e280406a95da927d14ebbb6b999ef446d5ad49881c219dac8ad02d994e059569e91b84f211a4c39a3fbd594a8c835aa5976e0c8899d81a5abaa14301662b9e14fb96ea89862ad898cd7d77bcd2547f0f40471f86d4a4f26e4274f2e95fd9b2b604de867be95630b1ea6ce45ba79acc81b986605e46acda208bd3302ffcc6e83f91bff8362b3f9641ca0227d8b31341e320003","0x2b2acf1e7e043b2c38ea1750a6c31f174b0a8b00137ec3eea24ed9fdf979bf04ed923a2cf5cc05a9acf697d27ccdb2a903a4846729cd9b2eead414da983d4f5bfd0ff4f2e7eb75988e58c3a635c271","0xce0c3b31143f1d68987deaac86a1e079deb07b3d2d497de5ebe8d94486e9a7b300c691621a68b3af4fee781c7c05a931123f910054d096c2e154950d32a26c38edb70dda50a242be4d15ce60c265767b141011cd84aa585c3af798fc1eb5ea63e93e0a426c3e1468f402f7e64f20281a4bd73cc1234174f1762a9a41989f570997036c885b1fdbf9c8153a1d19afb6526a123ca6a2fe6e98c6009f8439f6b6eea881453cc58ef344338ffd04783ce9c28c2e373812a65157643f679ed99ab35f4024e6ee31877e536b03c38616fccc993365143ddaffce39c805b391674070e993c6464156043a84266860c769de218bb5f5698f4c7a9b74142535cbcc08d5b3f747cbf6a7dfbb6c7b0ccc58af4886bc441558496e9c84d80660117777f01cdb84c0a2d3b0f2d8a6eacff5a0e55bd1be6387c3793ae8f5231c59697ae914894a49b3ae13a3a124cbf6cea33b7eb575cf6cd13e6073ddf4d033a3f87366c27089afc03707ef9a44c828388733d70f09bc08de574d07cf193f0a26a08ce8253bfdb26d5306632012c6dae194783deb31b72ac35bbd57f07f1667746d85f5d5b2132b885f8cb0206949780f9406307396dc7ece7938225fc5a55c65ed3608c27f668ba9b08875979e249655d15a4c3d77b1433ab26f56d80e2ca9178d88501ee682a14d07b17635e9968da2d98aa9eb4a5ae639e42eed0c7735313d3308fd079589d5cb2dd381a9298f67325976a6dcd3e38f836e4bc3106885f6348c57c90beadd7cbca17570b90130aaadc7eb0ed2bfb97c5c8a791d0b6b2736d43b0f444909449e6ea32ba706ddfe28c407a85e82e3f22064696d2fd7b37b33e01e0016ad91047f95f0cf5c5d6abc8fd7698c4155c290a1a1db842e77e656c69ad8bc06cea9e00dadbec886ca64af5fe3045ebc8c549bf23e71c634f02da8b250618c169a54e4af45d799f2de6747bde01395a13f1a605e9be5","0x9ced04a51e77ed0730f3420571164ea5247a670b962ebf6b453660748ca5"],"withdrawals":[{"index":"2","validator_index":"3","address":"0x000102030405060708090a0b0c0d0e0f10111213","amount":"1000000000000000000"}],"data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"signature":"0x01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"}`), + err: "incorrect length for signature", + }, + { + name: "MessageMissing", + input: []byte(`{"execution_payload":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"1","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions":["0x101b883470f1cb7e0a74561be59e08a6eff6aedd3408c190fd359f0bfb628d2461354b7fe4fdad4b8e72b8775cd44e339ad6b5f22a8f53c418bda2b01200a07f1fe3d010bbb96f5ca0d4919192370c15bc46ed455c797b1b11154be359638f9e487121182fae03a7d26012ed7c85b64a63aa5d56a98ac589f9950a9f5bf1a42c1eea245a98f2f4e743c5f8eac1584893104853dc1b5576826156b371a50c59bcb238d0794a185dc0816dbd8c10a0b0e1b8fbe01c4e8dd719f1e4e9b2ded8613f87f1d01e3ea28e9311d135301b2d1260e4811789e1ecbc33e573346f4da94f4c272e21e23b1d414706429c7f0b40c3de243894349c4a59ece791e5fd086897aef81fc23e4d55bb52b28174c3fa9f2c44d370fbbac1dee561f120560c3dda34a731d4618fd22d595b725efa87bb62f8f93bd7d906c4782a647e2cb14ed293e58bc793852058ab5e6f3df76b30e99102b82c8e7d005e1b675fc74b95032616c590ff08da710dd085be570cc0b2c13891625b44b5b3e1846606c39ad39bb72b","0x4b5edff58cf95969ead0470ab897da6c9d69b517e07fd4ed8fa48c14284a5a060ecb745f66cf1be55fb4905d62d8d376865f7d2d1816844fc4719f5d79ab905474d00f62aed6692e5a93be1b32740a8083fc2a61b0e1fc13ad409410d37f3cb0a5275c966abab015047c15251cd301cd31a7b2a0502f7f953e672d61606616b16d5117163064fb33d97eb566f7fce5f01d3833343c1c97e6221f9f0798415f3a4b87fd472e53a24c1a101e1dd55c8f65c2c0f4ccc4b46a133fda49db5dba96631b4cfd1a05662e42a8e15a26d3148a70be305c85f87dae4217fb91498c4098b946a9042355968b765e2e62bb0cf26d59e534c3af8795fa0f4a44ed0d39d258acd934c3416e4d4a738eaa473526d99bee037765d5f6034c830eb766ef067a1468630fbb65b7c5a862017fe84d4d1961f90c37f18a4bd2509fe2e96cb1e26971900e20295c8a9e9ed77b348d4509a8425090318be5c9d2bcda36bdfabb71bfb36755794f78c877df2825bd736a358933af77eae6edf701ed7ef168f57f677df3445d89c5eefc783184eadd3886fcfd75f5f142bc10904a019acdf7861caa7e0fba3e7831b0a549a56c0f174e80cffb8992346ddf7ce4eeff9e335531df3dff57d5f539bc0d3eac57f70a8f973e0864c87b25c3e0bea72e05eda8a120178186dfbfaa9a00f904f23a","0x452af990975c3bcafee7bde4738fdf32b8479be0e9e30b11b0ccbf31a6f884f4098e47759b7a3eb7d7bd0cfa2510dd654b28d664696aca987f55c7bfe73be1cc70a768cdb2594a13a763dbb991186b8b8b2e913857aadc08f940239d03a0b181ae849d557da5b54bfc966231690bb4660e083cdae28caf8ed33e3f66672772ea827253421bade013af57a290a915dbc777f2afccd9cb29e260ecc5ea54cd3a1e25cf66f2937f8061b3ba6b1ebf3129568f16e3dd04d5c50992cc348f3e615af346dbf2c144aeb19932dcfbff0221fae0ed9706b53245176630d011b9cd2d8630848ab1196cf9a3cc0d94392df4295be246e0ac24545c2715a40dcbc57aabffd0a86acec362affaf1bafc5c75b7ca28698a1ac14ea2c8def8ac1a32d3bf65b98aac7d0cb6fd93e5ff16274ad6d0eedf773694f29fc7a234deebc893e4cea4a5483d876e4f35019d6a62f1c407739b68b7a9f5408b4fb854534344fbffe3239feb17c0e7ac269b447bc6246579e1208b6904751eeacb985cbd43bb7792de0b428f1476301c479a3922f61f650c8298fb0b7584b52c7bfcf4dfe51335ab68d571c5815fc78d772346b0b13dbbb8906f076a0452e7e7a414e005dc37cfee85810eccab5999e2d43e13709bf66e8a8936a4283885b158115050789d3b4d9c8dc8026ac720069d78d47dd5e183032f9c53d4c57640fcd6207118d9738f00cd5ddf587f3a7c401d923aa2fb08dba1768728001abc3436cc2b5cf978b558ae58a0578344e7464cd00e719135c70244e2faf1264571a8999789c26f401753e429a1135f18906ebef19e122489622738724a6424cad363bed43304c1285c8da4824fec75d7c51b0a34070d8b976e8e8c8fd50908a7e440092dddd970fd55793e2a4446342bd3daf5b96220977d8f0c","0x0877448694993717a89c57b63640612ac4b0258cb5fdda4a311650c631c35c7313b6d2a094fdb207857d94500c37ab20ea0aa54af951fb04584a37b857981c6d13922e95cfecb70b69ab9a57ee6c13ccf8aa38c52de008ec16d9090aa4bf15db2f4afcdbb1bf4920efe5a1aeeff2c949d43460d67837af87bcdffd9e972340cb40de6d87fa11d83bbfb29e97ef2509097e8dec69a1318132a5dd7d95c1c1e13cc85d37a33c9f7d52379b4a47bf889903c8f3ebd2800526d0916e1aad00e02b682e55bc2865c3ff4ce0cc6aad1bd7d8e2901ea53f3a5e2c025dbb9a00f0ce88583c1dbd3d491ed04ba8260dc06fdb8a9162e022c75e9f057da0abed537b34214df234e1f8b26e7374cfa5470272ef03f7b41f7ed067c4c6011c8a17b2e65340e36af81ecb86420755fe5a0413495e16fabee3f9e5524ab7b12a3cffe20b1df7be32434d7da3fb1f3e9b16f42a4f550501120036b193701ac9eb6f760c2da70e3175a66b10463e43c0442a56217ca7cd25fdb46f3eff28cf1bdfe1b7eb3bf9e85ad8ffde207529c9bb1094dbae4db04a4bff6571c985bd629cdc2b78f739eca6694f32fded6944202859277740267d5dc4c1f74ddd1401c6d514ce23b885723c4618789b5c2ddeffec2179be8dec1347ca4ebed5e8bb10d7d17d41c9709a978fc6189f0c3d49d1b7f41bf8f1dc112f2ece84b6c6a687f44b95e62d274f89fa07bd0d3fdd3ee2a97233e363329ef7096ae5a45b2982859e983f5d989a928e9b88579308ece2391dbde378b81a54d38b3f81225d59f8bb511ba7eb590154ceb8258b804b6da98b3af6f395f5b3f1d12f5fd3c29ef54f31ccea0a36ec2daec0a87030daba8d079093ddde17871c4aa1a7dc3dbd4d760be2152dc250ca2bba34a55daf257b9e3704c3ee244081524cb1ae7c22a0d22f1c65b88b1e534ea1cb8f75cea4a7c03d6786f85327876da72dff1d4d049b51ecc10124279a0cbc151e76ddd475cf3dfeede59a902f4c7145786b5993c8bf8016265ec36298b27d0c6a21c7484fc01a8f14c8c287d14ab86789e34699fdb57f6c43486f0fd9013f2f2c62c60b75b1dc3e4d38a6f7c06e7029f874a204b059d834ffb44c99f843ae33ed0950","0x259310d5134d22e0ef42c3686b2adadc6cd1ae7d7836ac71a69d8ba2d02d0152c320610c12c57cba182c5d1e21198e787b21d0c522106aa8243ec994c4ea0b7959a3269d13566f3d0a3eb5ed276d9e22b33fc12e26cafde04b24ec0fd90455dc26d30a9fc25588b762681ca69aecc19e7971dd4cd063d4e31ee99f3c82015ed9a70e58b9d7cd9a8de38eba90ceffc629e7d6c06e4f2fe9cd45bae557652fe58cc9be54de9a994bf14c3bce787a106778416fbe966e95e51a35ba78d3dc4e4f7551e2791af00d50362493697d55ea6718ba2f089eda330e26100fb5adbb939afaf74982795414422712e8560cec372eaf1a56b50ba4e00e42b145537e94e88eddd7d200d0153edb6dcc12eb298666b0aef9ea495fccfda06b7affe7227bceb41d9ac9dd150df8642cdb11df5ab92b69629b6a5ccdc7ba92b6cf12172217057d291b2fdc6f104e86617be1b7fffeb36af59a018f50c055e24ef9b6daff839083bc9dfeae9101f6aff49f808f603834802d160283cd71b275bf97eb49f5612215cc8fe93875","0xfa082adb51ff0dca75ff57ba7852d794284db5b8d498002a821e5fc2c57a27cc1fe591f12860895b0057bc75ecbff9824bb46e2af06a785b6adfa9e32f49d6235776c3bcace18b330cec1126ac2bb5f3679339037817eab536fed29fe5c62ef790cb74893f1524280b0111e24fc0172130d00a88361e63511eb56a96e552d02c4944544c193189a152844ca49cadae38b7424426a74d61763716a068ba5ca9f3bdc2e0e9b644f1f2e02596bd3f446bb9f13dfb18ad2c9a2ba97771bb994f801affe2e8dda8d638e366c5b8263cc891a8a35e52c79f0856bfeaf0719bd1bfb54acc467783b6c08e55491d39b20f218342991381c38d357a4659baf8d44ddf5045d7f116bcc55f78c28a0dc100d06dff44e639b8e7adf967816c03de54eccdf9f6402a2806889d2cd980f34e5197771f13f1fa6b8c7c732031664bb675ff12d642ae62459e92b1cc28c62349e1636850b8a3ff411e1f14b097f7fa3b23eaa173d17a13f0703eecd7358aa623057325eed381a2ba13c50a13a3d8adaad0295960d925709d6e7cb101e894d9ae8db3dcb82a45570b6e02ab68aa4ea94f8779a9c45a5599","0x71ea3e9ec7ac8a144753ec38e78401b14b489a79266dd0527a4505adca584fe7406d9f7f05ef46d262384fbf1c0607f745a40681d4855aa34c37375b2cf7c99d46b6ae4e3aa9ee209782dce9d167bbff79686e59426a0513b951818ee02a9ea5ed8bcd0f991f46eee44c6e82fc6d07823a9f44f2fd7bfa0e250d6699cf7ad2577eb9eaf0dd9b1595cf018383c3d45956e508fa982bbb7744522a03bac5cba22f58a41801f579434126f5b866dcc6ca0454e9be1c7f2f6649254f3cc09142068f412d5d454b4e4d5b54e459719550f2df1901a18467d9d5297ed4a9eedb9f402f2bfd4bd2e50ab697ea5bef5e7e8082650b823635a4f0f55c18712d0f4d365824c79827d454425aec0b4ea6561ce3f1c5411ab4dff26e2412791cdaa28bf6c8fa53af412828c599d7876508f78f2c82ee67e8357947c6848af143fc5d20409049925cd1b194244466711ce7c34a72a165392564b96e280406a95da927d14ebbb6b999ef446d5ad49881c219dac8ad02d994e059569e91b84f211a4c39a3fbd594a8c835aa5976e0c8899d81a5abaa14301662b9e14fb96ea89862ad898cd7d77bcd2547f0f40471f86d4a4f26e4274f2e95fd9b2b604de867be95630b1ea6ce45ba79acc81b986605e46acda208bd3302ffcc6e83f91bff8362b3f9641ca0227d8b31341e320003","0x2b2acf1e7e043b2c38ea1750a6c31f174b0a8b00137ec3eea24ed9fdf979bf04ed923a2cf5cc05a9acf697d27ccdb2a903a4846729cd9b2eead414da983d4f5bfd0ff4f2e7eb75988e58c3a635c271","0xce0c3b31143f1d68987deaac86a1e079deb07b3d2d497de5ebe8d94486e9a7b300c691621a68b3af4fee781c7c05a931123f910054d096c2e154950d32a26c38edb70dda50a242be4d15ce60c265767b141011cd84aa585c3af798fc1eb5ea63e93e0a426c3e1468f402f7e64f20281a4bd73cc1234174f1762a9a41989f570997036c885b1fdbf9c8153a1d19afb6526a123ca6a2fe6e98c6009f8439f6b6eea881453cc58ef344338ffd04783ce9c28c2e373812a65157643f679ed99ab35f4024e6ee31877e536b03c38616fccc993365143ddaffce39c805b391674070e993c6464156043a84266860c769de218bb5f5698f4c7a9b74142535cbcc08d5b3f747cbf6a7dfbb6c7b0ccc58af4886bc441558496e9c84d80660117777f01cdb84c0a2d3b0f2d8a6eacff5a0e55bd1be6387c3793ae8f5231c59697ae914894a49b3ae13a3a124cbf6cea33b7eb575cf6cd13e6073ddf4d033a3f87366c27089afc03707ef9a44c828388733d70f09bc08de574d07cf193f0a26a08ce8253bfdb26d5306632012c6dae194783deb31b72ac35bbd57f07f1667746d85f5d5b2132b885f8cb0206949780f9406307396dc7ece7938225fc5a55c65ed3608c27f668ba9b08875979e249655d15a4c3d77b1433ab26f56d80e2ca9178d88501ee682a14d07b17635e9968da2d98aa9eb4a5ae639e42eed0c7735313d3308fd079589d5cb2dd381a9298f67325976a6dcd3e38f836e4bc3106885f6348c57c90beadd7cbca17570b90130aaadc7eb0ed2bfb97c5c8a791d0b6b2736d43b0f444909449e6ea32ba706ddfe28c407a85e82e3f22064696d2fd7b37b33e01e0016ad91047f95f0cf5c5d6abc8fd7698c4155c290a1a1db842e77e656c69ad8bc06cea9e00dadbec886ca64af5fe3045ebc8c549bf23e71c634f02da8b250618c169a54e4af45d799f2de6747bde01395a13f1a605e9be5","0x9ced04a51e77ed0730f3420571164ea5247a670b962ebf6b453660748ca5"],"withdrawals":[{"index":"2","validator_index":"3","address":"0x000102030405060708090a0b0c0d0e0f10111213","amount":"1000000000000000000"}],"data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"signature":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"}`), + err: "message missing", + }, + { + name: "MessageWrongType", + input: []byte(`{"message":true,"execution_payload":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"1","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions":["0x101b883470f1cb7e0a74561be59e08a6eff6aedd3408c190fd359f0bfb628d2461354b7fe4fdad4b8e72b8775cd44e339ad6b5f22a8f53c418bda2b01200a07f1fe3d010bbb96f5ca0d4919192370c15bc46ed455c797b1b11154be359638f9e487121182fae03a7d26012ed7c85b64a63aa5d56a98ac589f9950a9f5bf1a42c1eea245a98f2f4e743c5f8eac1584893104853dc1b5576826156b371a50c59bcb238d0794a185dc0816dbd8c10a0b0e1b8fbe01c4e8dd719f1e4e9b2ded8613f87f1d01e3ea28e9311d135301b2d1260e4811789e1ecbc33e573346f4da94f4c272e21e23b1d414706429c7f0b40c3de243894349c4a59ece791e5fd086897aef81fc23e4d55bb52b28174c3fa9f2c44d370fbbac1dee561f120560c3dda34a731d4618fd22d595b725efa87bb62f8f93bd7d906c4782a647e2cb14ed293e58bc793852058ab5e6f3df76b30e99102b82c8e7d005e1b675fc74b95032616c590ff08da710dd085be570cc0b2c13891625b44b5b3e1846606c39ad39bb72b","0x4b5edff58cf95969ead0470ab897da6c9d69b517e07fd4ed8fa48c14284a5a060ecb745f66cf1be55fb4905d62d8d376865f7d2d1816844fc4719f5d79ab905474d00f62aed6692e5a93be1b32740a8083fc2a61b0e1fc13ad409410d37f3cb0a5275c966abab015047c15251cd301cd31a7b2a0502f7f953e672d61606616b16d5117163064fb33d97eb566f7fce5f01d3833343c1c97e6221f9f0798415f3a4b87fd472e53a24c1a101e1dd55c8f65c2c0f4ccc4b46a133fda49db5dba96631b4cfd1a05662e42a8e15a26d3148a70be305c85f87dae4217fb91498c4098b946a9042355968b765e2e62bb0cf26d59e534c3af8795fa0f4a44ed0d39d258acd934c3416e4d4a738eaa473526d99bee037765d5f6034c830eb766ef067a1468630fbb65b7c5a862017fe84d4d1961f90c37f18a4bd2509fe2e96cb1e26971900e20295c8a9e9ed77b348d4509a8425090318be5c9d2bcda36bdfabb71bfb36755794f78c877df2825bd736a358933af77eae6edf701ed7ef168f57f677df3445d89c5eefc783184eadd3886fcfd75f5f142bc10904a019acdf7861caa7e0fba3e7831b0a549a56c0f174e80cffb8992346ddf7ce4eeff9e335531df3dff57d5f539bc0d3eac57f70a8f973e0864c87b25c3e0bea72e05eda8a120178186dfbfaa9a00f904f23a","0x452af990975c3bcafee7bde4738fdf32b8479be0e9e30b11b0ccbf31a6f884f4098e47759b7a3eb7d7bd0cfa2510dd654b28d664696aca987f55c7bfe73be1cc70a768cdb2594a13a763dbb991186b8b8b2e913857aadc08f940239d03a0b181ae849d557da5b54bfc966231690bb4660e083cdae28caf8ed33e3f66672772ea827253421bade013af57a290a915dbc777f2afccd9cb29e260ecc5ea54cd3a1e25cf66f2937f8061b3ba6b1ebf3129568f16e3dd04d5c50992cc348f3e615af346dbf2c144aeb19932dcfbff0221fae0ed9706b53245176630d011b9cd2d8630848ab1196cf9a3cc0d94392df4295be246e0ac24545c2715a40dcbc57aabffd0a86acec362affaf1bafc5c75b7ca28698a1ac14ea2c8def8ac1a32d3bf65b98aac7d0cb6fd93e5ff16274ad6d0eedf773694f29fc7a234deebc893e4cea4a5483d876e4f35019d6a62f1c407739b68b7a9f5408b4fb854534344fbffe3239feb17c0e7ac269b447bc6246579e1208b6904751eeacb985cbd43bb7792de0b428f1476301c479a3922f61f650c8298fb0b7584b52c7bfcf4dfe51335ab68d571c5815fc78d772346b0b13dbbb8906f076a0452e7e7a414e005dc37cfee85810eccab5999e2d43e13709bf66e8a8936a4283885b158115050789d3b4d9c8dc8026ac720069d78d47dd5e183032f9c53d4c57640fcd6207118d9738f00cd5ddf587f3a7c401d923aa2fb08dba1768728001abc3436cc2b5cf978b558ae58a0578344e7464cd00e719135c70244e2faf1264571a8999789c26f401753e429a1135f18906ebef19e122489622738724a6424cad363bed43304c1285c8da4824fec75d7c51b0a34070d8b976e8e8c8fd50908a7e440092dddd970fd55793e2a4446342bd3daf5b96220977d8f0c","0x0877448694993717a89c57b63640612ac4b0258cb5fdda4a311650c631c35c7313b6d2a094fdb207857d94500c37ab20ea0aa54af951fb04584a37b857981c6d13922e95cfecb70b69ab9a57ee6c13ccf8aa38c52de008ec16d9090aa4bf15db2f4afcdbb1bf4920efe5a1aeeff2c949d43460d67837af87bcdffd9e972340cb40de6d87fa11d83bbfb29e97ef2509097e8dec69a1318132a5dd7d95c1c1e13cc85d37a33c9f7d52379b4a47bf889903c8f3ebd2800526d0916e1aad00e02b682e55bc2865c3ff4ce0cc6aad1bd7d8e2901ea53f3a5e2c025dbb9a00f0ce88583c1dbd3d491ed04ba8260dc06fdb8a9162e022c75e9f057da0abed537b34214df234e1f8b26e7374cfa5470272ef03f7b41f7ed067c4c6011c8a17b2e65340e36af81ecb86420755fe5a0413495e16fabee3f9e5524ab7b12a3cffe20b1df7be32434d7da3fb1f3e9b16f42a4f550501120036b193701ac9eb6f760c2da70e3175a66b10463e43c0442a56217ca7cd25fdb46f3eff28cf1bdfe1b7eb3bf9e85ad8ffde207529c9bb1094dbae4db04a4bff6571c985bd629cdc2b78f739eca6694f32fded6944202859277740267d5dc4c1f74ddd1401c6d514ce23b885723c4618789b5c2ddeffec2179be8dec1347ca4ebed5e8bb10d7d17d41c9709a978fc6189f0c3d49d1b7f41bf8f1dc112f2ece84b6c6a687f44b95e62d274f89fa07bd0d3fdd3ee2a97233e363329ef7096ae5a45b2982859e983f5d989a928e9b88579308ece2391dbde378b81a54d38b3f81225d59f8bb511ba7eb590154ceb8258b804b6da98b3af6f395f5b3f1d12f5fd3c29ef54f31ccea0a36ec2daec0a87030daba8d079093ddde17871c4aa1a7dc3dbd4d760be2152dc250ca2bba34a55daf257b9e3704c3ee244081524cb1ae7c22a0d22f1c65b88b1e534ea1cb8f75cea4a7c03d6786f85327876da72dff1d4d049b51ecc10124279a0cbc151e76ddd475cf3dfeede59a902f4c7145786b5993c8bf8016265ec36298b27d0c6a21c7484fc01a8f14c8c287d14ab86789e34699fdb57f6c43486f0fd9013f2f2c62c60b75b1dc3e4d38a6f7c06e7029f874a204b059d834ffb44c99f843ae33ed0950","0x259310d5134d22e0ef42c3686b2adadc6cd1ae7d7836ac71a69d8ba2d02d0152c320610c12c57cba182c5d1e21198e787b21d0c522106aa8243ec994c4ea0b7959a3269d13566f3d0a3eb5ed276d9e22b33fc12e26cafde04b24ec0fd90455dc26d30a9fc25588b762681ca69aecc19e7971dd4cd063d4e31ee99f3c82015ed9a70e58b9d7cd9a8de38eba90ceffc629e7d6c06e4f2fe9cd45bae557652fe58cc9be54de9a994bf14c3bce787a106778416fbe966e95e51a35ba78d3dc4e4f7551e2791af00d50362493697d55ea6718ba2f089eda330e26100fb5adbb939afaf74982795414422712e8560cec372eaf1a56b50ba4e00e42b145537e94e88eddd7d200d0153edb6dcc12eb298666b0aef9ea495fccfda06b7affe7227bceb41d9ac9dd150df8642cdb11df5ab92b69629b6a5ccdc7ba92b6cf12172217057d291b2fdc6f104e86617be1b7fffeb36af59a018f50c055e24ef9b6daff839083bc9dfeae9101f6aff49f808f603834802d160283cd71b275bf97eb49f5612215cc8fe93875","0xfa082adb51ff0dca75ff57ba7852d794284db5b8d498002a821e5fc2c57a27cc1fe591f12860895b0057bc75ecbff9824bb46e2af06a785b6adfa9e32f49d6235776c3bcace18b330cec1126ac2bb5f3679339037817eab536fed29fe5c62ef790cb74893f1524280b0111e24fc0172130d00a88361e63511eb56a96e552d02c4944544c193189a152844ca49cadae38b7424426a74d61763716a068ba5ca9f3bdc2e0e9b644f1f2e02596bd3f446bb9f13dfb18ad2c9a2ba97771bb994f801affe2e8dda8d638e366c5b8263cc891a8a35e52c79f0856bfeaf0719bd1bfb54acc467783b6c08e55491d39b20f218342991381c38d357a4659baf8d44ddf5045d7f116bcc55f78c28a0dc100d06dff44e639b8e7adf967816c03de54eccdf9f6402a2806889d2cd980f34e5197771f13f1fa6b8c7c732031664bb675ff12d642ae62459e92b1cc28c62349e1636850b8a3ff411e1f14b097f7fa3b23eaa173d17a13f0703eecd7358aa623057325eed381a2ba13c50a13a3d8adaad0295960d925709d6e7cb101e894d9ae8db3dcb82a45570b6e02ab68aa4ea94f8779a9c45a5599","0x71ea3e9ec7ac8a144753ec38e78401b14b489a79266dd0527a4505adca584fe7406d9f7f05ef46d262384fbf1c0607f745a40681d4855aa34c37375b2cf7c99d46b6ae4e3aa9ee209782dce9d167bbff79686e59426a0513b951818ee02a9ea5ed8bcd0f991f46eee44c6e82fc6d07823a9f44f2fd7bfa0e250d6699cf7ad2577eb9eaf0dd9b1595cf018383c3d45956e508fa982bbb7744522a03bac5cba22f58a41801f579434126f5b866dcc6ca0454e9be1c7f2f6649254f3cc09142068f412d5d454b4e4d5b54e459719550f2df1901a18467d9d5297ed4a9eedb9f402f2bfd4bd2e50ab697ea5bef5e7e8082650b823635a4f0f55c18712d0f4d365824c79827d454425aec0b4ea6561ce3f1c5411ab4dff26e2412791cdaa28bf6c8fa53af412828c599d7876508f78f2c82ee67e8357947c6848af143fc5d20409049925cd1b194244466711ce7c34a72a165392564b96e280406a95da927d14ebbb6b999ef446d5ad49881c219dac8ad02d994e059569e91b84f211a4c39a3fbd594a8c835aa5976e0c8899d81a5abaa14301662b9e14fb96ea89862ad898cd7d77bcd2547f0f40471f86d4a4f26e4274f2e95fd9b2b604de867be95630b1ea6ce45ba79acc81b986605e46acda208bd3302ffcc6e83f91bff8362b3f9641ca0227d8b31341e320003","0x2b2acf1e7e043b2c38ea1750a6c31f174b0a8b00137ec3eea24ed9fdf979bf04ed923a2cf5cc05a9acf697d27ccdb2a903a4846729cd9b2eead414da983d4f5bfd0ff4f2e7eb75988e58c3a635c271","0xce0c3b31143f1d68987deaac86a1e079deb07b3d2d497de5ebe8d94486e9a7b300c691621a68b3af4fee781c7c05a931123f910054d096c2e154950d32a26c38edb70dda50a242be4d15ce60c265767b141011cd84aa585c3af798fc1eb5ea63e93e0a426c3e1468f402f7e64f20281a4bd73cc1234174f1762a9a41989f570997036c885b1fdbf9c8153a1d19afb6526a123ca6a2fe6e98c6009f8439f6b6eea881453cc58ef344338ffd04783ce9c28c2e373812a65157643f679ed99ab35f4024e6ee31877e536b03c38616fccc993365143ddaffce39c805b391674070e993c6464156043a84266860c769de218bb5f5698f4c7a9b74142535cbcc08d5b3f747cbf6a7dfbb6c7b0ccc58af4886bc441558496e9c84d80660117777f01cdb84c0a2d3b0f2d8a6eacff5a0e55bd1be6387c3793ae8f5231c59697ae914894a49b3ae13a3a124cbf6cea33b7eb575cf6cd13e6073ddf4d033a3f87366c27089afc03707ef9a44c828388733d70f09bc08de574d07cf193f0a26a08ce8253bfdb26d5306632012c6dae194783deb31b72ac35bbd57f07f1667746d85f5d5b2132b885f8cb0206949780f9406307396dc7ece7938225fc5a55c65ed3608c27f668ba9b08875979e249655d15a4c3d77b1433ab26f56d80e2ca9178d88501ee682a14d07b17635e9968da2d98aa9eb4a5ae639e42eed0c7735313d3308fd079589d5cb2dd381a9298f67325976a6dcd3e38f836e4bc3106885f6348c57c90beadd7cbca17570b90130aaadc7eb0ed2bfb97c5c8a791d0b6b2736d43b0f444909449e6ea32ba706ddfe28c407a85e82e3f22064696d2fd7b37b33e01e0016ad91047f95f0cf5c5d6abc8fd7698c4155c290a1a1db842e77e656c69ad8bc06cea9e00dadbec886ca64af5fe3045ebc8c549bf23e71c634f02da8b250618c169a54e4af45d799f2de6747bde01395a13f1a605e9be5","0x9ced04a51e77ed0730f3420571164ea5247a670b962ebf6b453660748ca5"],"withdrawals":[{"index":"2","validator_index":"3","address":"0x000102030405060708090a0b0c0d0e0f10111213","amount":"1000000000000000000"}],"data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"signature":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"}`), + err: "invalid JSON: invalid JSON: json: cannot unmarshal bool into Go value of type v1.bidTraceJSON", + }, + { + name: "MessageInvalid", + input: []byte(`{"message":{},"execution_payload":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"1","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions":["0x101b883470f1cb7e0a74561be59e08a6eff6aedd3408c190fd359f0bfb628d2461354b7fe4fdad4b8e72b8775cd44e339ad6b5f22a8f53c418bda2b01200a07f1fe3d010bbb96f5ca0d4919192370c15bc46ed455c797b1b11154be359638f9e487121182fae03a7d26012ed7c85b64a63aa5d56a98ac589f9950a9f5bf1a42c1eea245a98f2f4e743c5f8eac1584893104853dc1b5576826156b371a50c59bcb238d0794a185dc0816dbd8c10a0b0e1b8fbe01c4e8dd719f1e4e9b2ded8613f87f1d01e3ea28e9311d135301b2d1260e4811789e1ecbc33e573346f4da94f4c272e21e23b1d414706429c7f0b40c3de243894349c4a59ece791e5fd086897aef81fc23e4d55bb52b28174c3fa9f2c44d370fbbac1dee561f120560c3dda34a731d4618fd22d595b725efa87bb62f8f93bd7d906c4782a647e2cb14ed293e58bc793852058ab5e6f3df76b30e99102b82c8e7d005e1b675fc74b95032616c590ff08da710dd085be570cc0b2c13891625b44b5b3e1846606c39ad39bb72b","0x4b5edff58cf95969ead0470ab897da6c9d69b517e07fd4ed8fa48c14284a5a060ecb745f66cf1be55fb4905d62d8d376865f7d2d1816844fc4719f5d79ab905474d00f62aed6692e5a93be1b32740a8083fc2a61b0e1fc13ad409410d37f3cb0a5275c966abab015047c15251cd301cd31a7b2a0502f7f953e672d61606616b16d5117163064fb33d97eb566f7fce5f01d3833343c1c97e6221f9f0798415f3a4b87fd472e53a24c1a101e1dd55c8f65c2c0f4ccc4b46a133fda49db5dba96631b4cfd1a05662e42a8e15a26d3148a70be305c85f87dae4217fb91498c4098b946a9042355968b765e2e62bb0cf26d59e534c3af8795fa0f4a44ed0d39d258acd934c3416e4d4a738eaa473526d99bee037765d5f6034c830eb766ef067a1468630fbb65b7c5a862017fe84d4d1961f90c37f18a4bd2509fe2e96cb1e26971900e20295c8a9e9ed77b348d4509a8425090318be5c9d2bcda36bdfabb71bfb36755794f78c877df2825bd736a358933af77eae6edf701ed7ef168f57f677df3445d89c5eefc783184eadd3886fcfd75f5f142bc10904a019acdf7861caa7e0fba3e7831b0a549a56c0f174e80cffb8992346ddf7ce4eeff9e335531df3dff57d5f539bc0d3eac57f70a8f973e0864c87b25c3e0bea72e05eda8a120178186dfbfaa9a00f904f23a","0x452af990975c3bcafee7bde4738fdf32b8479be0e9e30b11b0ccbf31a6f884f4098e47759b7a3eb7d7bd0cfa2510dd654b28d664696aca987f55c7bfe73be1cc70a768cdb2594a13a763dbb991186b8b8b2e913857aadc08f940239d03a0b181ae849d557da5b54bfc966231690bb4660e083cdae28caf8ed33e3f66672772ea827253421bade013af57a290a915dbc777f2afccd9cb29e260ecc5ea54cd3a1e25cf66f2937f8061b3ba6b1ebf3129568f16e3dd04d5c50992cc348f3e615af346dbf2c144aeb19932dcfbff0221fae0ed9706b53245176630d011b9cd2d8630848ab1196cf9a3cc0d94392df4295be246e0ac24545c2715a40dcbc57aabffd0a86acec362affaf1bafc5c75b7ca28698a1ac14ea2c8def8ac1a32d3bf65b98aac7d0cb6fd93e5ff16274ad6d0eedf773694f29fc7a234deebc893e4cea4a5483d876e4f35019d6a62f1c407739b68b7a9f5408b4fb854534344fbffe3239feb17c0e7ac269b447bc6246579e1208b6904751eeacb985cbd43bb7792de0b428f1476301c479a3922f61f650c8298fb0b7584b52c7bfcf4dfe51335ab68d571c5815fc78d772346b0b13dbbb8906f076a0452e7e7a414e005dc37cfee85810eccab5999e2d43e13709bf66e8a8936a4283885b158115050789d3b4d9c8dc8026ac720069d78d47dd5e183032f9c53d4c57640fcd6207118d9738f00cd5ddf587f3a7c401d923aa2fb08dba1768728001abc3436cc2b5cf978b558ae58a0578344e7464cd00e719135c70244e2faf1264571a8999789c26f401753e429a1135f18906ebef19e122489622738724a6424cad363bed43304c1285c8da4824fec75d7c51b0a34070d8b976e8e8c8fd50908a7e440092dddd970fd55793e2a4446342bd3daf5b96220977d8f0c","0x0877448694993717a89c57b63640612ac4b0258cb5fdda4a311650c631c35c7313b6d2a094fdb207857d94500c37ab20ea0aa54af951fb04584a37b857981c6d13922e95cfecb70b69ab9a57ee6c13ccf8aa38c52de008ec16d9090aa4bf15db2f4afcdbb1bf4920efe5a1aeeff2c949d43460d67837af87bcdffd9e972340cb40de6d87fa11d83bbfb29e97ef2509097e8dec69a1318132a5dd7d95c1c1e13cc85d37a33c9f7d52379b4a47bf889903c8f3ebd2800526d0916e1aad00e02b682e55bc2865c3ff4ce0cc6aad1bd7d8e2901ea53f3a5e2c025dbb9a00f0ce88583c1dbd3d491ed04ba8260dc06fdb8a9162e022c75e9f057da0abed537b34214df234e1f8b26e7374cfa5470272ef03f7b41f7ed067c4c6011c8a17b2e65340e36af81ecb86420755fe5a0413495e16fabee3f9e5524ab7b12a3cffe20b1df7be32434d7da3fb1f3e9b16f42a4f550501120036b193701ac9eb6f760c2da70e3175a66b10463e43c0442a56217ca7cd25fdb46f3eff28cf1bdfe1b7eb3bf9e85ad8ffde207529c9bb1094dbae4db04a4bff6571c985bd629cdc2b78f739eca6694f32fded6944202859277740267d5dc4c1f74ddd1401c6d514ce23b885723c4618789b5c2ddeffec2179be8dec1347ca4ebed5e8bb10d7d17d41c9709a978fc6189f0c3d49d1b7f41bf8f1dc112f2ece84b6c6a687f44b95e62d274f89fa07bd0d3fdd3ee2a97233e363329ef7096ae5a45b2982859e983f5d989a928e9b88579308ece2391dbde378b81a54d38b3f81225d59f8bb511ba7eb590154ceb8258b804b6da98b3af6f395f5b3f1d12f5fd3c29ef54f31ccea0a36ec2daec0a87030daba8d079093ddde17871c4aa1a7dc3dbd4d760be2152dc250ca2bba34a55daf257b9e3704c3ee244081524cb1ae7c22a0d22f1c65b88b1e534ea1cb8f75cea4a7c03d6786f85327876da72dff1d4d049b51ecc10124279a0cbc151e76ddd475cf3dfeede59a902f4c7145786b5993c8bf8016265ec36298b27d0c6a21c7484fc01a8f14c8c287d14ab86789e34699fdb57f6c43486f0fd9013f2f2c62c60b75b1dc3e4d38a6f7c06e7029f874a204b059d834ffb44c99f843ae33ed0950","0x259310d5134d22e0ef42c3686b2adadc6cd1ae7d7836ac71a69d8ba2d02d0152c320610c12c57cba182c5d1e21198e787b21d0c522106aa8243ec994c4ea0b7959a3269d13566f3d0a3eb5ed276d9e22b33fc12e26cafde04b24ec0fd90455dc26d30a9fc25588b762681ca69aecc19e7971dd4cd063d4e31ee99f3c82015ed9a70e58b9d7cd9a8de38eba90ceffc629e7d6c06e4f2fe9cd45bae557652fe58cc9be54de9a994bf14c3bce787a106778416fbe966e95e51a35ba78d3dc4e4f7551e2791af00d50362493697d55ea6718ba2f089eda330e26100fb5adbb939afaf74982795414422712e8560cec372eaf1a56b50ba4e00e42b145537e94e88eddd7d200d0153edb6dcc12eb298666b0aef9ea495fccfda06b7affe7227bceb41d9ac9dd150df8642cdb11df5ab92b69629b6a5ccdc7ba92b6cf12172217057d291b2fdc6f104e86617be1b7fffeb36af59a018f50c055e24ef9b6daff839083bc9dfeae9101f6aff49f808f603834802d160283cd71b275bf97eb49f5612215cc8fe93875","0xfa082adb51ff0dca75ff57ba7852d794284db5b8d498002a821e5fc2c57a27cc1fe591f12860895b0057bc75ecbff9824bb46e2af06a785b6adfa9e32f49d6235776c3bcace18b330cec1126ac2bb5f3679339037817eab536fed29fe5c62ef790cb74893f1524280b0111e24fc0172130d00a88361e63511eb56a96e552d02c4944544c193189a152844ca49cadae38b7424426a74d61763716a068ba5ca9f3bdc2e0e9b644f1f2e02596bd3f446bb9f13dfb18ad2c9a2ba97771bb994f801affe2e8dda8d638e366c5b8263cc891a8a35e52c79f0856bfeaf0719bd1bfb54acc467783b6c08e55491d39b20f218342991381c38d357a4659baf8d44ddf5045d7f116bcc55f78c28a0dc100d06dff44e639b8e7adf967816c03de54eccdf9f6402a2806889d2cd980f34e5197771f13f1fa6b8c7c732031664bb675ff12d642ae62459e92b1cc28c62349e1636850b8a3ff411e1f14b097f7fa3b23eaa173d17a13f0703eecd7358aa623057325eed381a2ba13c50a13a3d8adaad0295960d925709d6e7cb101e894d9ae8db3dcb82a45570b6e02ab68aa4ea94f8779a9c45a5599","0x71ea3e9ec7ac8a144753ec38e78401b14b489a79266dd0527a4505adca584fe7406d9f7f05ef46d262384fbf1c0607f745a40681d4855aa34c37375b2cf7c99d46b6ae4e3aa9ee209782dce9d167bbff79686e59426a0513b951818ee02a9ea5ed8bcd0f991f46eee44c6e82fc6d07823a9f44f2fd7bfa0e250d6699cf7ad2577eb9eaf0dd9b1595cf018383c3d45956e508fa982bbb7744522a03bac5cba22f58a41801f579434126f5b866dcc6ca0454e9be1c7f2f6649254f3cc09142068f412d5d454b4e4d5b54e459719550f2df1901a18467d9d5297ed4a9eedb9f402f2bfd4bd2e50ab697ea5bef5e7e8082650b823635a4f0f55c18712d0f4d365824c79827d454425aec0b4ea6561ce3f1c5411ab4dff26e2412791cdaa28bf6c8fa53af412828c599d7876508f78f2c82ee67e8357947c6848af143fc5d20409049925cd1b194244466711ce7c34a72a165392564b96e280406a95da927d14ebbb6b999ef446d5ad49881c219dac8ad02d994e059569e91b84f211a4c39a3fbd594a8c835aa5976e0c8899d81a5abaa14301662b9e14fb96ea89862ad898cd7d77bcd2547f0f40471f86d4a4f26e4274f2e95fd9b2b604de867be95630b1ea6ce45ba79acc81b986605e46acda208bd3302ffcc6e83f91bff8362b3f9641ca0227d8b31341e320003","0x2b2acf1e7e043b2c38ea1750a6c31f174b0a8b00137ec3eea24ed9fdf979bf04ed923a2cf5cc05a9acf697d27ccdb2a903a4846729cd9b2eead414da983d4f5bfd0ff4f2e7eb75988e58c3a635c271","0xce0c3b31143f1d68987deaac86a1e079deb07b3d2d497de5ebe8d94486e9a7b300c691621a68b3af4fee781c7c05a931123f910054d096c2e154950d32a26c38edb70dda50a242be4d15ce60c265767b141011cd84aa585c3af798fc1eb5ea63e93e0a426c3e1468f402f7e64f20281a4bd73cc1234174f1762a9a41989f570997036c885b1fdbf9c8153a1d19afb6526a123ca6a2fe6e98c6009f8439f6b6eea881453cc58ef344338ffd04783ce9c28c2e373812a65157643f679ed99ab35f4024e6ee31877e536b03c38616fccc993365143ddaffce39c805b391674070e993c6464156043a84266860c769de218bb5f5698f4c7a9b74142535cbcc08d5b3f747cbf6a7dfbb6c7b0ccc58af4886bc441558496e9c84d80660117777f01cdb84c0a2d3b0f2d8a6eacff5a0e55bd1be6387c3793ae8f5231c59697ae914894a49b3ae13a3a124cbf6cea33b7eb575cf6cd13e6073ddf4d033a3f87366c27089afc03707ef9a44c828388733d70f09bc08de574d07cf193f0a26a08ce8253bfdb26d5306632012c6dae194783deb31b72ac35bbd57f07f1667746d85f5d5b2132b885f8cb0206949780f9406307396dc7ece7938225fc5a55c65ed3608c27f668ba9b08875979e249655d15a4c3d77b1433ab26f56d80e2ca9178d88501ee682a14d07b17635e9968da2d98aa9eb4a5ae639e42eed0c7735313d3308fd079589d5cb2dd381a9298f67325976a6dcd3e38f836e4bc3106885f6348c57c90beadd7cbca17570b90130aaadc7eb0ed2bfb97c5c8a791d0b6b2736d43b0f444909449e6ea32ba706ddfe28c407a85e82e3f22064696d2fd7b37b33e01e0016ad91047f95f0cf5c5d6abc8fd7698c4155c290a1a1db842e77e656c69ad8bc06cea9e00dadbec886ca64af5fe3045ebc8c549bf23e71c634f02da8b250618c169a54e4af45d799f2de6747bde01395a13f1a605e9be5","0x9ced04a51e77ed0730f3420571164ea5247a670b962ebf6b453660748ca5"],"withdrawals":[{"index":"2","validator_index":"3","address":"0x000102030405060708090a0b0c0d0e0f10111213","amount":"1000000000000000000"}],"data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"signature":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"}`), + err: "invalid JSON: slot missing", + }, + { + name: "ExecutionPayloadMissing", + input: []byte(`{"message":{"slot":"1","parent_hash":"0xae694782c41219774f46891c6365243b97d63d66aeb7827023b8336161615652","block_hash":"0x6462e48cff39c6e4e02e5fe1aa97bf03b23a1aa588f07cfd6296d2b9bb909ce4","builder_pubkey":"0x8efc1675ffb449abc00a6ad8a2808cdf798d96fbb979cf00956012f3983577c9afe69495411a89385421f1cff47dfc98","proposer_pubkey":"0xb7da036d8aedf726e2b3439f95bdf0e68519bb55ab83d5d97a70a5b8510f612ad45a6ecc58b8b5b9b09c6b445491a02b","proposer_fee_recipient":"0x9427A30991170f917d7b83dEf6e44d26577871Ed","gas_limit":"30000000","gas_used":"7675443","value":"22135875749231725"},"signature":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"}`), + err: "execution payload missing", + }, + { + name: "ExecutionPayloadWrongType", + input: []byte(`{"message":{"slot":"1","parent_hash":"0xae694782c41219774f46891c6365243b97d63d66aeb7827023b8336161615652","block_hash":"0x6462e48cff39c6e4e02e5fe1aa97bf03b23a1aa588f07cfd6296d2b9bb909ce4","builder_pubkey":"0x8efc1675ffb449abc00a6ad8a2808cdf798d96fbb979cf00956012f3983577c9afe69495411a89385421f1cff47dfc98","proposer_pubkey":"0xb7da036d8aedf726e2b3439f95bdf0e68519bb55ab83d5d97a70a5b8510f612ad45a6ecc58b8b5b9b09c6b445491a02b","proposer_fee_recipient":"0x9427A30991170f917d7b83dEf6e44d26577871Ed","gas_limit":"30000000","gas_used":"7675443","value":"22135875749231725"},"execution_payload":true,"signature":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"}`), + err: "invalid JSON: invalid JSON: json: cannot unmarshal bool into Go value of type map[string]json.RawMessage", + }, + { + name: "ExecutionPayloadInvalid", + input: []byte(`{"message":{"slot":"1","parent_hash":"0xae694782c41219774f46891c6365243b97d63d66aeb7827023b8336161615652","block_hash":"0x6462e48cff39c6e4e02e5fe1aa97bf03b23a1aa588f07cfd6296d2b9bb909ce4","builder_pubkey":"0x8efc1675ffb449abc00a6ad8a2808cdf798d96fbb979cf00956012f3983577c9afe69495411a89385421f1cff47dfc98","proposer_pubkey":"0xb7da036d8aedf726e2b3439f95bdf0e68519bb55ab83d5d97a70a5b8510f612ad45a6ecc58b8b5b9b09c6b445491a02b","proposer_fee_recipient":"0x9427A30991170f917d7b83dEf6e44d26577871Ed","gas_limit":"30000000","gas_used":"7675443","value":"22135875749231725"},"execution_payload":{},"signature":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"}`), + err: "invalid JSON: parent_hash: missing", + }, + { + name: "Good", + input: []byte(`{"message":{"slot":"1","parent_hash":"0xae694782c41219774f46891c6365243b97d63d66aeb7827023b8336161615652","block_hash":"0x6462e48cff39c6e4e02e5fe1aa97bf03b23a1aa588f07cfd6296d2b9bb909ce4","builder_pubkey":"0x8efc1675ffb449abc00a6ad8a2808cdf798d96fbb979cf00956012f3983577c9afe69495411a89385421f1cff47dfc98","proposer_pubkey":"0xb7da036d8aedf726e2b3439f95bdf0e68519bb55ab83d5d97a70a5b8510f612ad45a6ecc58b8b5b9b09c6b445491a02b","proposer_fee_recipient":"0x9427A30991170f917d7b83dEf6e44d26577871Ed","gas_limit":"30000000","gas_used":"7675443","value":"22135875749231725"},"execution_payload":{"parent_hash":"0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef","fee_recipient":"0x58E809C71e4885cB7B3f1D5c793AB04eD239d779","state_root":"0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d","receipts_root":"0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36","logs_bloom":"0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44","prev_randao":"0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00","block_number":"2983837628677007840","gas_limit":"6738255228996962210","gas_used":"5573520557770513197","timestamp":"1744720080366521389","extra_data":"0xc648","base_fee_per_gas":"1","block_hash":"0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f","transactions":["0x101b883470f1cb7e0a74561be59e08a6eff6aedd3408c190fd359f0bfb628d2461354b7fe4fdad4b8e72b8775cd44e339ad6b5f22a8f53c418bda2b01200a07f1fe3d010bbb96f5ca0d4919192370c15bc46ed455c797b1b11154be359638f9e487121182fae03a7d26012ed7c85b64a63aa5d56a98ac589f9950a9f5bf1a42c1eea245a98f2f4e743c5f8eac1584893104853dc1b5576826156b371a50c59bcb238d0794a185dc0816dbd8c10a0b0e1b8fbe01c4e8dd719f1e4e9b2ded8613f87f1d01e3ea28e9311d135301b2d1260e4811789e1ecbc33e573346f4da94f4c272e21e23b1d414706429c7f0b40c3de243894349c4a59ece791e5fd086897aef81fc23e4d55bb52b28174c3fa9f2c44d370fbbac1dee561f120560c3dda34a731d4618fd22d595b725efa87bb62f8f93bd7d906c4782a647e2cb14ed293e58bc793852058ab5e6f3df76b30e99102b82c8e7d005e1b675fc74b95032616c590ff08da710dd085be570cc0b2c13891625b44b5b3e1846606c39ad39bb72b","0x4b5edff58cf95969ead0470ab897da6c9d69b517e07fd4ed8fa48c14284a5a060ecb745f66cf1be55fb4905d62d8d376865f7d2d1816844fc4719f5d79ab905474d00f62aed6692e5a93be1b32740a8083fc2a61b0e1fc13ad409410d37f3cb0a5275c966abab015047c15251cd301cd31a7b2a0502f7f953e672d61606616b16d5117163064fb33d97eb566f7fce5f01d3833343c1c97e6221f9f0798415f3a4b87fd472e53a24c1a101e1dd55c8f65c2c0f4ccc4b46a133fda49db5dba96631b4cfd1a05662e42a8e15a26d3148a70be305c85f87dae4217fb91498c4098b946a9042355968b765e2e62bb0cf26d59e534c3af8795fa0f4a44ed0d39d258acd934c3416e4d4a738eaa473526d99bee037765d5f6034c830eb766ef067a1468630fbb65b7c5a862017fe84d4d1961f90c37f18a4bd2509fe2e96cb1e26971900e20295c8a9e9ed77b348d4509a8425090318be5c9d2bcda36bdfabb71bfb36755794f78c877df2825bd736a358933af77eae6edf701ed7ef168f57f677df3445d89c5eefc783184eadd3886fcfd75f5f142bc10904a019acdf7861caa7e0fba3e7831b0a549a56c0f174e80cffb8992346ddf7ce4eeff9e335531df3dff57d5f539bc0d3eac57f70a8f973e0864c87b25c3e0bea72e05eda8a120178186dfbfaa9a00f904f23a","0x452af990975c3bcafee7bde4738fdf32b8479be0e9e30b11b0ccbf31a6f884f4098e47759b7a3eb7d7bd0cfa2510dd654b28d664696aca987f55c7bfe73be1cc70a768cdb2594a13a763dbb991186b8b8b2e913857aadc08f940239d03a0b181ae849d557da5b54bfc966231690bb4660e083cdae28caf8ed33e3f66672772ea827253421bade013af57a290a915dbc777f2afccd9cb29e260ecc5ea54cd3a1e25cf66f2937f8061b3ba6b1ebf3129568f16e3dd04d5c50992cc348f3e615af346dbf2c144aeb19932dcfbff0221fae0ed9706b53245176630d011b9cd2d8630848ab1196cf9a3cc0d94392df4295be246e0ac24545c2715a40dcbc57aabffd0a86acec362affaf1bafc5c75b7ca28698a1ac14ea2c8def8ac1a32d3bf65b98aac7d0cb6fd93e5ff16274ad6d0eedf773694f29fc7a234deebc893e4cea4a5483d876e4f35019d6a62f1c407739b68b7a9f5408b4fb854534344fbffe3239feb17c0e7ac269b447bc6246579e1208b6904751eeacb985cbd43bb7792de0b428f1476301c479a3922f61f650c8298fb0b7584b52c7bfcf4dfe51335ab68d571c5815fc78d772346b0b13dbbb8906f076a0452e7e7a414e005dc37cfee85810eccab5999e2d43e13709bf66e8a8936a4283885b158115050789d3b4d9c8dc8026ac720069d78d47dd5e183032f9c53d4c57640fcd6207118d9738f00cd5ddf587f3a7c401d923aa2fb08dba1768728001abc3436cc2b5cf978b558ae58a0578344e7464cd00e719135c70244e2faf1264571a8999789c26f401753e429a1135f18906ebef19e122489622738724a6424cad363bed43304c1285c8da4824fec75d7c51b0a34070d8b976e8e8c8fd50908a7e440092dddd970fd55793e2a4446342bd3daf5b96220977d8f0c","0x0877448694993717a89c57b63640612ac4b0258cb5fdda4a311650c631c35c7313b6d2a094fdb207857d94500c37ab20ea0aa54af951fb04584a37b857981c6d13922e95cfecb70b69ab9a57ee6c13ccf8aa38c52de008ec16d9090aa4bf15db2f4afcdbb1bf4920efe5a1aeeff2c949d43460d67837af87bcdffd9e972340cb40de6d87fa11d83bbfb29e97ef2509097e8dec69a1318132a5dd7d95c1c1e13cc85d37a33c9f7d52379b4a47bf889903c8f3ebd2800526d0916e1aad00e02b682e55bc2865c3ff4ce0cc6aad1bd7d8e2901ea53f3a5e2c025dbb9a00f0ce88583c1dbd3d491ed04ba8260dc06fdb8a9162e022c75e9f057da0abed537b34214df234e1f8b26e7374cfa5470272ef03f7b41f7ed067c4c6011c8a17b2e65340e36af81ecb86420755fe5a0413495e16fabee3f9e5524ab7b12a3cffe20b1df7be32434d7da3fb1f3e9b16f42a4f550501120036b193701ac9eb6f760c2da70e3175a66b10463e43c0442a56217ca7cd25fdb46f3eff28cf1bdfe1b7eb3bf9e85ad8ffde207529c9bb1094dbae4db04a4bff6571c985bd629cdc2b78f739eca6694f32fded6944202859277740267d5dc4c1f74ddd1401c6d514ce23b885723c4618789b5c2ddeffec2179be8dec1347ca4ebed5e8bb10d7d17d41c9709a978fc6189f0c3d49d1b7f41bf8f1dc112f2ece84b6c6a687f44b95e62d274f89fa07bd0d3fdd3ee2a97233e363329ef7096ae5a45b2982859e983f5d989a928e9b88579308ece2391dbde378b81a54d38b3f81225d59f8bb511ba7eb590154ceb8258b804b6da98b3af6f395f5b3f1d12f5fd3c29ef54f31ccea0a36ec2daec0a87030daba8d079093ddde17871c4aa1a7dc3dbd4d760be2152dc250ca2bba34a55daf257b9e3704c3ee244081524cb1ae7c22a0d22f1c65b88b1e534ea1cb8f75cea4a7c03d6786f85327876da72dff1d4d049b51ecc10124279a0cbc151e76ddd475cf3dfeede59a902f4c7145786b5993c8bf8016265ec36298b27d0c6a21c7484fc01a8f14c8c287d14ab86789e34699fdb57f6c43486f0fd9013f2f2c62c60b75b1dc3e4d38a6f7c06e7029f874a204b059d834ffb44c99f843ae33ed0950","0x259310d5134d22e0ef42c3686b2adadc6cd1ae7d7836ac71a69d8ba2d02d0152c320610c12c57cba182c5d1e21198e787b21d0c522106aa8243ec994c4ea0b7959a3269d13566f3d0a3eb5ed276d9e22b33fc12e26cafde04b24ec0fd90455dc26d30a9fc25588b762681ca69aecc19e7971dd4cd063d4e31ee99f3c82015ed9a70e58b9d7cd9a8de38eba90ceffc629e7d6c06e4f2fe9cd45bae557652fe58cc9be54de9a994bf14c3bce787a106778416fbe966e95e51a35ba78d3dc4e4f7551e2791af00d50362493697d55ea6718ba2f089eda330e26100fb5adbb939afaf74982795414422712e8560cec372eaf1a56b50ba4e00e42b145537e94e88eddd7d200d0153edb6dcc12eb298666b0aef9ea495fccfda06b7affe7227bceb41d9ac9dd150df8642cdb11df5ab92b69629b6a5ccdc7ba92b6cf12172217057d291b2fdc6f104e86617be1b7fffeb36af59a018f50c055e24ef9b6daff839083bc9dfeae9101f6aff49f808f603834802d160283cd71b275bf97eb49f5612215cc8fe93875","0xfa082adb51ff0dca75ff57ba7852d794284db5b8d498002a821e5fc2c57a27cc1fe591f12860895b0057bc75ecbff9824bb46e2af06a785b6adfa9e32f49d6235776c3bcace18b330cec1126ac2bb5f3679339037817eab536fed29fe5c62ef790cb74893f1524280b0111e24fc0172130d00a88361e63511eb56a96e552d02c4944544c193189a152844ca49cadae38b7424426a74d61763716a068ba5ca9f3bdc2e0e9b644f1f2e02596bd3f446bb9f13dfb18ad2c9a2ba97771bb994f801affe2e8dda8d638e366c5b8263cc891a8a35e52c79f0856bfeaf0719bd1bfb54acc467783b6c08e55491d39b20f218342991381c38d357a4659baf8d44ddf5045d7f116bcc55f78c28a0dc100d06dff44e639b8e7adf967816c03de54eccdf9f6402a2806889d2cd980f34e5197771f13f1fa6b8c7c732031664bb675ff12d642ae62459e92b1cc28c62349e1636850b8a3ff411e1f14b097f7fa3b23eaa173d17a13f0703eecd7358aa623057325eed381a2ba13c50a13a3d8adaad0295960d925709d6e7cb101e894d9ae8db3dcb82a45570b6e02ab68aa4ea94f8779a9c45a5599","0x71ea3e9ec7ac8a144753ec38e78401b14b489a79266dd0527a4505adca584fe7406d9f7f05ef46d262384fbf1c0607f745a40681d4855aa34c37375b2cf7c99d46b6ae4e3aa9ee209782dce9d167bbff79686e59426a0513b951818ee02a9ea5ed8bcd0f991f46eee44c6e82fc6d07823a9f44f2fd7bfa0e250d6699cf7ad2577eb9eaf0dd9b1595cf018383c3d45956e508fa982bbb7744522a03bac5cba22f58a41801f579434126f5b866dcc6ca0454e9be1c7f2f6649254f3cc09142068f412d5d454b4e4d5b54e459719550f2df1901a18467d9d5297ed4a9eedb9f402f2bfd4bd2e50ab697ea5bef5e7e8082650b823635a4f0f55c18712d0f4d365824c79827d454425aec0b4ea6561ce3f1c5411ab4dff26e2412791cdaa28bf6c8fa53af412828c599d7876508f78f2c82ee67e8357947c6848af143fc5d20409049925cd1b194244466711ce7c34a72a165392564b96e280406a95da927d14ebbb6b999ef446d5ad49881c219dac8ad02d994e059569e91b84f211a4c39a3fbd594a8c835aa5976e0c8899d81a5abaa14301662b9e14fb96ea89862ad898cd7d77bcd2547f0f40471f86d4a4f26e4274f2e95fd9b2b604de867be95630b1ea6ce45ba79acc81b986605e46acda208bd3302ffcc6e83f91bff8362b3f9641ca0227d8b31341e320003","0x2b2acf1e7e043b2c38ea1750a6c31f174b0a8b00137ec3eea24ed9fdf979bf04ed923a2cf5cc05a9acf697d27ccdb2a903a4846729cd9b2eead414da983d4f5bfd0ff4f2e7eb75988e58c3a635c271","0xce0c3b31143f1d68987deaac86a1e079deb07b3d2d497de5ebe8d94486e9a7b300c691621a68b3af4fee781c7c05a931123f910054d096c2e154950d32a26c38edb70dda50a242be4d15ce60c265767b141011cd84aa585c3af798fc1eb5ea63e93e0a426c3e1468f402f7e64f20281a4bd73cc1234174f1762a9a41989f570997036c885b1fdbf9c8153a1d19afb6526a123ca6a2fe6e98c6009f8439f6b6eea881453cc58ef344338ffd04783ce9c28c2e373812a65157643f679ed99ab35f4024e6ee31877e536b03c38616fccc993365143ddaffce39c805b391674070e993c6464156043a84266860c769de218bb5f5698f4c7a9b74142535cbcc08d5b3f747cbf6a7dfbb6c7b0ccc58af4886bc441558496e9c84d80660117777f01cdb84c0a2d3b0f2d8a6eacff5a0e55bd1be6387c3793ae8f5231c59697ae914894a49b3ae13a3a124cbf6cea33b7eb575cf6cd13e6073ddf4d033a3f87366c27089afc03707ef9a44c828388733d70f09bc08de574d07cf193f0a26a08ce8253bfdb26d5306632012c6dae194783deb31b72ac35bbd57f07f1667746d85f5d5b2132b885f8cb0206949780f9406307396dc7ece7938225fc5a55c65ed3608c27f668ba9b08875979e249655d15a4c3d77b1433ab26f56d80e2ca9178d88501ee682a14d07b17635e9968da2d98aa9eb4a5ae639e42eed0c7735313d3308fd079589d5cb2dd381a9298f67325976a6dcd3e38f836e4bc3106885f6348c57c90beadd7cbca17570b90130aaadc7eb0ed2bfb97c5c8a791d0b6b2736d43b0f444909449e6ea32ba706ddfe28c407a85e82e3f22064696d2fd7b37b33e01e0016ad91047f95f0cf5c5d6abc8fd7698c4155c290a1a1db842e77e656c69ad8bc06cea9e00dadbec886ca64af5fe3045ebc8c549bf23e71c634f02da8b250618c169a54e4af45d799f2de6747bde01395a13f1a605e9be5","0x9ced04a51e77ed0730f3420571164ea5247a670b962ebf6b453660748ca5"],"withdrawals":[{"index":"2","validator_index":"3","address":"0x000102030405060708090a0b0c0d0e0f10111213","amount":"1000000000000000000"}],"data_gas_used":"4438756708366371443","excess_data_gas":"12504111653614393862"},"signature":"0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"}`), + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + var res deneb.SubmitBlockRequest + 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 TestSubmitBlockRequestYAML(t *testing.T) { + tests := []struct { + name string + input []byte + root []byte + err string + }{ + { + name: "Good", + input: []byte(`{message: {slot: 1, parent_hash: '0xae694782c41219774f46891c6365243b97d63d66aeb7827023b8336161615652', block_hash: '0x6462e48cff39c6e4e02e5fe1aa97bf03b23a1aa588f07cfd6296d2b9bb909ce4', builder_pubkey: '0x8efc1675ffb449abc00a6ad8a2808cdf798d96fbb979cf00956012f3983577c9afe69495411a89385421f1cff47dfc98', proposer_pubkey: '0xb7da036d8aedf726e2b3439f95bdf0e68519bb55ab83d5d97a70a5b8510f612ad45a6ecc58b8b5b9b09c6b445491a02b', proposer_fee_recipient: '0x9427A30991170f917d7b83dEf6e44d26577871Ed', gas_limit: 30000000, gas_used: 7675443, value: 22135875749231725}, execution_payload: {parent_hash: '0x17f4eeae822cc81533016678413443b95e34517e67f12b4a3a92ff6b66f972ef', fee_recipient: '0x58E809C71e4885cB7B3f1D5c793AB04eD239d779', state_root: '0x3d6e230e6eceb8f3db582777b1500b8b31b9d268339e7b32bba8d6f1311b211d', receipts_root: '0xea760203509bdde017a506b12c825976d12b04db7bce9eca9e1ed007056a3f36', logs_bloom: '0x0c803a8d3c6642adee3185bd914c599317d96487831dabda82461f65700b2528781bdadf785664f9d8b11c4ee1139dfeb056125d2abd67e379cabc6d58f1c3ea304b97cf17fcd8a4c53f4dedeaa041acce062fc8fbc88ffc111577db4a936378749f2fd82b4bfcb880821dd5cbefee984bc1ad116096a64a44a2aac8a1791a7ad3a53d91c584ac69a8973daed6daee4432a198c9935fa0e5c2a4a6ca78b821a5b046e571a5c0961f469d40e429066755fec611afe25b560db07f989933556ce0cea4070ca47677b007b4b9857fc092625f82c84526737dc98e173e34fe6e4d0f1a400fd994298b7c2fa8187331c333c415f0499836ff0eed5c762bf570e67b44', prev_randao: '0x76ff751467270668df463600d26dba58297a986e649bac84ea856712d4779c00', block_number: 2983837628677007840, gas_limit: 6738255228996962210, gas_used: 5573520557770513197, timestamp: 1744720080366521389, extra_data: '0xc648', base_fee_per_gas: '88770397543877639215846057887940126737648744594802753726778414602657613619599', block_hash: '0x42c294e902bfc9884c1ce5fef156d4661bb8f0ff488bface37f18c3e7be64b0f', transactions: ['0x101b883470f1cb7e0a74561be59e08a6eff6aedd3408c190fd359f0bfb628d2461354b7fe4fdad4b8e72b8775cd44e339ad6b5f22a8f53c418bda2b01200a07f1fe3d010bbb96f5ca0d4919192370c15bc46ed455c797b1b11154be359638f9e487121182fae03a7d26012ed7c85b64a63aa5d56a98ac589f9950a9f5bf1a42c1eea245a98f2f4e743c5f8eac1584893104853dc1b5576826156b371a50c59bcb238d0794a185dc0816dbd8c10a0b0e1b8fbe01c4e8dd719f1e4e9b2ded8613f87f1d01e3ea28e9311d135301b2d1260e4811789e1ecbc33e573346f4da94f4c272e21e23b1d414706429c7f0b40c3de243894349c4a59ece791e5fd086897aef81fc23e4d55bb52b28174c3fa9f2c44d370fbbac1dee561f120560c3dda34a731d4618fd22d595b725efa87bb62f8f93bd7d906c4782a647e2cb14ed293e58bc793852058ab5e6f3df76b30e99102b82c8e7d005e1b675fc74b95032616c590ff08da710dd085be570cc0b2c13891625b44b5b3e1846606c39ad39bb72b', '0x4b5edff58cf95969ead0470ab897da6c9d69b517e07fd4ed8fa48c14284a5a060ecb745f66cf1be55fb4905d62d8d376865f7d2d1816844fc4719f5d79ab905474d00f62aed6692e5a93be1b32740a8083fc2a61b0e1fc13ad409410d37f3cb0a5275c966abab015047c15251cd301cd31a7b2a0502f7f953e672d61606616b16d5117163064fb33d97eb566f7fce5f01d3833343c1c97e6221f9f0798415f3a4b87fd472e53a24c1a101e1dd55c8f65c2c0f4ccc4b46a133fda49db5dba96631b4cfd1a05662e42a8e15a26d3148a70be305c85f87dae4217fb91498c4098b946a9042355968b765e2e62bb0cf26d59e534c3af8795fa0f4a44ed0d39d258acd934c3416e4d4a738eaa473526d99bee037765d5f6034c830eb766ef067a1468630fbb65b7c5a862017fe84d4d1961f90c37f18a4bd2509fe2e96cb1e26971900e20295c8a9e9ed77b348d4509a8425090318be5c9d2bcda36bdfabb71bfb36755794f78c877df2825bd736a358933af77eae6edf701ed7ef168f57f677df3445d89c5eefc783184eadd3886fcfd75f5f142bc10904a019acdf7861caa7e0fba3e7831b0a549a56c0f174e80cffb8992346ddf7ce4eeff9e335531df3dff57d5f539bc0d3eac57f70a8f973e0864c87b25c3e0bea72e05eda8a120178186dfbfaa9a00f904f23a', '0x452af990975c3bcafee7bde4738fdf32b8479be0e9e30b11b0ccbf31a6f884f4098e47759b7a3eb7d7bd0cfa2510dd654b28d664696aca987f55c7bfe73be1cc70a768cdb2594a13a763dbb991186b8b8b2e913857aadc08f940239d03a0b181ae849d557da5b54bfc966231690bb4660e083cdae28caf8ed33e3f66672772ea827253421bade013af57a290a915dbc777f2afccd9cb29e260ecc5ea54cd3a1e25cf66f2937f8061b3ba6b1ebf3129568f16e3dd04d5c50992cc348f3e615af346dbf2c144aeb19932dcfbff0221fae0ed9706b53245176630d011b9cd2d8630848ab1196cf9a3cc0d94392df4295be246e0ac24545c2715a40dcbc57aabffd0a86acec362affaf1bafc5c75b7ca28698a1ac14ea2c8def8ac1a32d3bf65b98aac7d0cb6fd93e5ff16274ad6d0eedf773694f29fc7a234deebc893e4cea4a5483d876e4f35019d6a62f1c407739b68b7a9f5408b4fb854534344fbffe3239feb17c0e7ac269b447bc6246579e1208b6904751eeacb985cbd43bb7792de0b428f1476301c479a3922f61f650c8298fb0b7584b52c7bfcf4dfe51335ab68d571c5815fc78d772346b0b13dbbb8906f076a0452e7e7a414e005dc37cfee85810eccab5999e2d43e13709bf66e8a8936a4283885b158115050789d3b4d9c8dc8026ac720069d78d47dd5e183032f9c53d4c57640fcd6207118d9738f00cd5ddf587f3a7c401d923aa2fb08dba1768728001abc3436cc2b5cf978b558ae58a0578344e7464cd00e719135c70244e2faf1264571a8999789c26f401753e429a1135f18906ebef19e122489622738724a6424cad363bed43304c1285c8da4824fec75d7c51b0a34070d8b976e8e8c8fd50908a7e440092dddd970fd55793e2a4446342bd3daf5b96220977d8f0c', '0x0877448694993717a89c57b63640612ac4b0258cb5fdda4a311650c631c35c7313b6d2a094fdb207857d94500c37ab20ea0aa54af951fb04584a37b857981c6d13922e95cfecb70b69ab9a57ee6c13ccf8aa38c52de008ec16d9090aa4bf15db2f4afcdbb1bf4920efe5a1aeeff2c949d43460d67837af87bcdffd9e972340cb40de6d87fa11d83bbfb29e97ef2509097e8dec69a1318132a5dd7d95c1c1e13cc85d37a33c9f7d52379b4a47bf889903c8f3ebd2800526d0916e1aad00e02b682e55bc2865c3ff4ce0cc6aad1bd7d8e2901ea53f3a5e2c025dbb9a00f0ce88583c1dbd3d491ed04ba8260dc06fdb8a9162e022c75e9f057da0abed537b34214df234e1f8b26e7374cfa5470272ef03f7b41f7ed067c4c6011c8a17b2e65340e36af81ecb86420755fe5a0413495e16fabee3f9e5524ab7b12a3cffe20b1df7be32434d7da3fb1f3e9b16f42a4f550501120036b193701ac9eb6f760c2da70e3175a66b10463e43c0442a56217ca7cd25fdb46f3eff28cf1bdfe1b7eb3bf9e85ad8ffde207529c9bb1094dbae4db04a4bff6571c985bd629cdc2b78f739eca6694f32fded6944202859277740267d5dc4c1f74ddd1401c6d514ce23b885723c4618789b5c2ddeffec2179be8dec1347ca4ebed5e8bb10d7d17d41c9709a978fc6189f0c3d49d1b7f41bf8f1dc112f2ece84b6c6a687f44b95e62d274f89fa07bd0d3fdd3ee2a97233e363329ef7096ae5a45b2982859e983f5d989a928e9b88579308ece2391dbde378b81a54d38b3f81225d59f8bb511ba7eb590154ceb8258b804b6da98b3af6f395f5b3f1d12f5fd3c29ef54f31ccea0a36ec2daec0a87030daba8d079093ddde17871c4aa1a7dc3dbd4d760be2152dc250ca2bba34a55daf257b9e3704c3ee244081524cb1ae7c22a0d22f1c65b88b1e534ea1cb8f75cea4a7c03d6786f85327876da72dff1d4d049b51ecc10124279a0cbc151e76ddd475cf3dfeede59a902f4c7145786b5993c8bf8016265ec36298b27d0c6a21c7484fc01a8f14c8c287d14ab86789e34699fdb57f6c43486f0fd9013f2f2c62c60b75b1dc3e4d38a6f7c06e7029f874a204b059d834ffb44c99f843ae33ed0950', '0x259310d5134d22e0ef42c3686b2adadc6cd1ae7d7836ac71a69d8ba2d02d0152c320610c12c57cba182c5d1e21198e787b21d0c522106aa8243ec994c4ea0b7959a3269d13566f3d0a3eb5ed276d9e22b33fc12e26cafde04b24ec0fd90455dc26d30a9fc25588b762681ca69aecc19e7971dd4cd063d4e31ee99f3c82015ed9a70e58b9d7cd9a8de38eba90ceffc629e7d6c06e4f2fe9cd45bae557652fe58cc9be54de9a994bf14c3bce787a106778416fbe966e95e51a35ba78d3dc4e4f7551e2791af00d50362493697d55ea6718ba2f089eda330e26100fb5adbb939afaf74982795414422712e8560cec372eaf1a56b50ba4e00e42b145537e94e88eddd7d200d0153edb6dcc12eb298666b0aef9ea495fccfda06b7affe7227bceb41d9ac9dd150df8642cdb11df5ab92b69629b6a5ccdc7ba92b6cf12172217057d291b2fdc6f104e86617be1b7fffeb36af59a018f50c055e24ef9b6daff839083bc9dfeae9101f6aff49f808f603834802d160283cd71b275bf97eb49f5612215cc8fe93875', '0xfa082adb51ff0dca75ff57ba7852d794284db5b8d498002a821e5fc2c57a27cc1fe591f12860895b0057bc75ecbff9824bb46e2af06a785b6adfa9e32f49d6235776c3bcace18b330cec1126ac2bb5f3679339037817eab536fed29fe5c62ef790cb74893f1524280b0111e24fc0172130d00a88361e63511eb56a96e552d02c4944544c193189a152844ca49cadae38b7424426a74d61763716a068ba5ca9f3bdc2e0e9b644f1f2e02596bd3f446bb9f13dfb18ad2c9a2ba97771bb994f801affe2e8dda8d638e366c5b8263cc891a8a35e52c79f0856bfeaf0719bd1bfb54acc467783b6c08e55491d39b20f218342991381c38d357a4659baf8d44ddf5045d7f116bcc55f78c28a0dc100d06dff44e639b8e7adf967816c03de54eccdf9f6402a2806889d2cd980f34e5197771f13f1fa6b8c7c732031664bb675ff12d642ae62459e92b1cc28c62349e1636850b8a3ff411e1f14b097f7fa3b23eaa173d17a13f0703eecd7358aa623057325eed381a2ba13c50a13a3d8adaad0295960d925709d6e7cb101e894d9ae8db3dcb82a45570b6e02ab68aa4ea94f8779a9c45a5599', '0x71ea3e9ec7ac8a144753ec38e78401b14b489a79266dd0527a4505adca584fe7406d9f7f05ef46d262384fbf1c0607f745a40681d4855aa34c37375b2cf7c99d46b6ae4e3aa9ee209782dce9d167bbff79686e59426a0513b951818ee02a9ea5ed8bcd0f991f46eee44c6e82fc6d07823a9f44f2fd7bfa0e250d6699cf7ad2577eb9eaf0dd9b1595cf018383c3d45956e508fa982bbb7744522a03bac5cba22f58a41801f579434126f5b866dcc6ca0454e9be1c7f2f6649254f3cc09142068f412d5d454b4e4d5b54e459719550f2df1901a18467d9d5297ed4a9eedb9f402f2bfd4bd2e50ab697ea5bef5e7e8082650b823635a4f0f55c18712d0f4d365824c79827d454425aec0b4ea6561ce3f1c5411ab4dff26e2412791cdaa28bf6c8fa53af412828c599d7876508f78f2c82ee67e8357947c6848af143fc5d20409049925cd1b194244466711ce7c34a72a165392564b96e280406a95da927d14ebbb6b999ef446d5ad49881c219dac8ad02d994e059569e91b84f211a4c39a3fbd594a8c835aa5976e0c8899d81a5abaa14301662b9e14fb96ea89862ad898cd7d77bcd2547f0f40471f86d4a4f26e4274f2e95fd9b2b604de867be95630b1ea6ce45ba79acc81b986605e46acda208bd3302ffcc6e83f91bff8362b3f9641ca0227d8b31341e320003', '0x2b2acf1e7e043b2c38ea1750a6c31f174b0a8b00137ec3eea24ed9fdf979bf04ed923a2cf5cc05a9acf697d27ccdb2a903a4846729cd9b2eead414da983d4f5bfd0ff4f2e7eb75988e58c3a635c271', '0xce0c3b31143f1d68987deaac86a1e079deb07b3d2d497de5ebe8d94486e9a7b300c691621a68b3af4fee781c7c05a931123f910054d096c2e154950d32a26c38edb70dda50a242be4d15ce60c265767b141011cd84aa585c3af798fc1eb5ea63e93e0a426c3e1468f402f7e64f20281a4bd73cc1234174f1762a9a41989f570997036c885b1fdbf9c8153a1d19afb6526a123ca6a2fe6e98c6009f8439f6b6eea881453cc58ef344338ffd04783ce9c28c2e373812a65157643f679ed99ab35f4024e6ee31877e536b03c38616fccc993365143ddaffce39c805b391674070e993c6464156043a84266860c769de218bb5f5698f4c7a9b74142535cbcc08d5b3f747cbf6a7dfbb6c7b0ccc58af4886bc441558496e9c84d80660117777f01cdb84c0a2d3b0f2d8a6eacff5a0e55bd1be6387c3793ae8f5231c59697ae914894a49b3ae13a3a124cbf6cea33b7eb575cf6cd13e6073ddf4d033a3f87366c27089afc03707ef9a44c828388733d70f09bc08de574d07cf193f0a26a08ce8253bfdb26d5306632012c6dae194783deb31b72ac35bbd57f07f1667746d85f5d5b2132b885f8cb0206949780f9406307396dc7ece7938225fc5a55c65ed3608c27f668ba9b08875979e249655d15a4c3d77b1433ab26f56d80e2ca9178d88501ee682a14d07b17635e9968da2d98aa9eb4a5ae639e42eed0c7735313d3308fd079589d5cb2dd381a9298f67325976a6dcd3e38f836e4bc3106885f6348c57c90beadd7cbca17570b90130aaadc7eb0ed2bfb97c5c8a791d0b6b2736d43b0f444909449e6ea32ba706ddfe28c407a85e82e3f22064696d2fd7b37b33e01e0016ad91047f95f0cf5c5d6abc8fd7698c4155c290a1a1db842e77e656c69ad8bc06cea9e00dadbec886ca64af5fe3045ebc8c549bf23e71c634f02da8b250618c169a54e4af45d799f2de6747bde01395a13f1a605e9be5', '0x9ced04a51e77ed0730f3420571164ea5247a670b962ebf6b453660748ca5'], withdrawals: [{index: 2, validator_index: 3, address: '0x000102030405060708090a0b0c0d0e0f10111213', amount: 1000000000000000000}], data_gas_used: 4438756708366371443, excess_data_gas: 12504111653614393862}, signature: '0x010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101'}`), + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + var res deneb.SubmitBlockRequest + 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, string(rt), res.String()) + rt = bytes.TrimSuffix(rt, []byte("\n")) + assert.Equal(t, string(test.input), string(rt)) + } + }) + } +} diff --git a/api/deneb/submitblockrequest_yaml.go b/api/deneb/submitblockrequest_yaml.go new file mode 100644 index 0000000..3847e01 --- /dev/null +++ b/api/deneb/submitblockrequest_yaml.go @@ -0,0 +1,40 @@ +package deneb + +import ( + "bytes" + "fmt" + + v1 "github.com/attestantio/go-builder-client/api/v1" + "github.com/attestantio/go-eth2-client/spec/deneb" + "github.com/goccy/go-yaml" +) + +// submitBlockRequestYAML is the spec representation of the struct. +type submitBlockRequestYAML struct { + Message *v1.BidTrace `yaml:"message"` + ExecutionPayload *deneb.ExecutionPayload `yaml:"execution_payload"` + Signature string `yaml:"signature"` +} + +// MarshalYAML implements yaml.Marshaler. +func (s *SubmitBlockRequest) MarshalYAML() ([]byte, error) { + yamlBytes, err := yaml.MarshalWithOptions(&submitBlockRequestYAML{ + Message: s.Message, + Signature: fmt.Sprintf("%#x", s.Signature), + ExecutionPayload: s.ExecutionPayload, + }, yaml.Flow(true)) + if err != nil { + return nil, err + } + return bytes.ReplaceAll(yamlBytes, []byte(`"`), []byte(`'`)), nil +} + +// UnmarshalYAML implements yaml.Unmarshaler. +func (s *SubmitBlockRequest) UnmarshalYAML(input []byte) error { + // We unmarshal to the JSON struct to save on duplicate code. + var data submitBlockRequestJSON + if err := yaml.Unmarshal(input, &data); err != nil { + return err + } + return s.unpack(&data) +}