From 2f164148025f258472b858dc1424743d48cd7794 Mon Sep 17 00:00:00 2001 From: shana Date: Fri, 5 Jan 2024 06:09:00 +1100 Subject: [PATCH] fix lint and tests --- common/test_utils.go | 6 ++++-- common/types.go | 1 - common/types_spec.go | 11 ----------- services/api/service.go | 1 - 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/common/test_utils.go b/common/test_utils.go index d55e73c1..c5670d2f 100644 --- a/common/test_utils.go +++ b/common/test_utils.go @@ -185,8 +185,10 @@ func CreateTestBlockSubmission(t *testing.T, builderPubkey string, value *uint25 ExecutionPayload: &deneb.ExecutionPayload{ //nolint:exhaustruct BaseFeePerGas: uint256.NewInt(0), }, - BlobsBundle: &builderApiDeneb.BlobsBundle{}, //nolint:exhaustruct - Signature: phase0.BLSSignature{}, + BlobsBundle: &builderApiDeneb.BlobsBundle{ //nolint:exhaustruct + Commitments: make([]deneb.KZGCommitment, 0), + }, + Signature: phase0.BLSSignature{}, }, }, } diff --git a/common/types.go b/common/types.go index dc85f3e6..2b6a23d2 100644 --- a/common/types.go +++ b/common/types.go @@ -13,7 +13,6 @@ import ( "github.com/attestantio/go-eth2-client/spec/phase0" ssz "github.com/ferranbt/fastssz" boostSsz "github.com/flashbots/go-boost-utils/ssz" - boostTypes "github.com/flashbots/go-boost-utils/types" "github.com/holiman/uint256" ) diff --git a/common/types_spec.go b/common/types_spec.go index cd3018b2..ab8c8e47 100644 --- a/common/types_spec.go +++ b/common/types_spec.go @@ -15,7 +15,6 @@ import ( "github.com/attestantio/go-eth2-client/spec/capella" "github.com/attestantio/go-eth2-client/spec/deneb" "github.com/attestantio/go-eth2-client/spec/phase0" - eth2UtilDeneb "github.com/attestantio/go-eth2-client/util/deneb" "github.com/flashbots/go-boost-utils/bls" "github.com/flashbots/go-boost-utils/ssz" boostTypes "github.com/flashbots/go-boost-utils/types" @@ -133,16 +132,6 @@ func BuilderBlockRequestToSignedBuilderBid(payload *VersionedSubmitBlockRequest, }, }, nil case spec.DataVersionDeneb: - var blobRoots []phase0.Root - for i, blob := range payload.Deneb.BlobsBundle.Blobs { - blobRootHelper := eth2UtilDeneb.BeaconBlockBlob{Blob: blob} - root, err := blobRootHelper.HashTreeRoot() - if err != nil { - return nil, errors.Wrap(err, fmt.Sprintf("failed to calculate blob root at blob index %d", i)) - } - blobRoots = append(blobRoots, root) - } - builderBid := builderApiDeneb.BuilderBid{ Header: header.Deneb, BlobKZGCommitments: payload.Deneb.BlobsBundle.Commitments, diff --git a/services/api/service.go b/services/api/service.go index 1d220d39..a75c54d5 100644 --- a/services/api/service.go +++ b/services/api/service.go @@ -1222,7 +1222,6 @@ func (api *RelayAPI) checkProposerSignature(block *common.VersionedSignedBlinded default: return false, errors.New("unsupported consensus data version") } - return true, nil } func (api *RelayAPI) handleGetPayload(w http.ResponseWriter, req *http.Request) {