diff --git a/.golangci.yaml b/.golangci.yaml index dd0b6a92..7ef8310d 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -3,6 +3,7 @@ linters: enable-all: true disable: - cyclop + - depguard - forbidigo - funlen - gochecknoglobals @@ -88,6 +89,10 @@ linters-settings: # Because it's easier to read without the other fields. # - 'GetPayloadsFilters' + # + # Easier to read with only one of the versioned payloads. + # + - 'api.VersionedExecutionPayload' # # Structures outside our control that have a ton of settings. It doesn't diff --git a/common/types.go b/common/types.go index 09b8abc8..cf715677 100644 --- a/common/types.go +++ b/common/types.go @@ -140,8 +140,8 @@ type BuilderGetValidatorsResponseEntry struct { type BidTraceV2 struct { apiv1.BidTrace - BlockNumber uint64 `json:"block_number,string" db:"block_number"` - NumTx uint64 `json:"num_tx,string" db:"num_tx"` + BlockNumber uint64 `db:"block_number" json:"block_number,string"` + NumTx uint64 `db:"num_tx" json:"num_tx,string"` } type BidTraceV2JSON struct { diff --git a/datastore/memcached_test.go b/datastore/memcached_test.go index 74af4ffb..e51cee63 100644 --- a/datastore/memcached_test.go +++ b/datastore/memcached_test.go @@ -68,7 +68,7 @@ func testBuilderSubmitBlockRequest(pubkey phase0.BLSPubKey, signature phase0.BLS } case consensusspec.DataVersionDeneb: fallthrough - case consensusspec.DataVersionPhase0, consensusspec.DataVersionAltair, consensusspec.DataVersionBellatrix: + case consensusspec.DataVersionUnknown, consensusspec.DataVersionPhase0, consensusspec.DataVersionAltair, consensusspec.DataVersionBellatrix: fallthrough default: return common.BuilderSubmitBlockRequest{ diff --git a/go.sum b/go.sum index 718b3641..d23fd27c 100644 --- a/go.sum +++ b/go.sum @@ -22,8 +22,6 @@ github.com/alicebob/miniredis/v2 v2.30.4/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6u github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/attestantio/go-builder-client v0.3.0 h1:NY7pUNT070T3tx/N8hCaO5KpExvaVQhH//9zsgRh43M= -github.com/attestantio/go-builder-client v0.3.0/go.mod h1:DwesMTOqnCp4u+n3uZ+fWL8wwnSBZVD9VMIVPDR+AZE= github.com/attestantio/go-builder-client v0.3.2-0.20230701110827-d0ecfee1ab62 h1:jtNd8modhHUKfgLcQBv6ajgBNldwkIXT4U2iqWtbyA0= github.com/attestantio/go-builder-client v0.3.2-0.20230701110827-d0ecfee1ab62/go.mod h1:DwesMTOqnCp4u+n3uZ+fWL8wwnSBZVD9VMIVPDR+AZE= github.com/avalonche/go-eth2-client v0.0.0-20230720050755-dfcc05c7f873 h1:IIDWbWmoIW6WuZLYFNDuyeoGGYIAvZ5oH3XuZa47hQs= diff --git a/services/api/service.go b/services/api/service.go index 9072a536..969922fc 100644 --- a/services/api/service.go +++ b/services/api/service.go @@ -1410,8 +1410,12 @@ func (api *RelayAPI) handleGetPayload(w http.ResponseWriter, req *http.Request) if err != nil { log.WithError(err).Info("failed to get block number") } + txs, err := getPayloadResp.Transactions() + if err != nil { + log.WithError(err).Info("failed to get transactions") + } log = log.WithFields(logrus.Fields{ - "numTx": getPayloadResp.Transactions(), + "numTx": len(txs), "blockNumber": blockNumber, }) log.Info("execution payload delivered")