From f10ae180cc6a3a434a6124600764ada4c3c827f0 Mon Sep 17 00:00:00 2001 From: shana Date: Wed, 14 Feb 2024 06:52:25 +1100 Subject: [PATCH] update lint --- .github/workflows/checks.yml | 10 +++---- .golangci.yaml | 9 +++++- beaconclient/beacon_client_test.go | 8 +++--- common/types.go | 43 +++++++++++++++-------------- common/types_test.go | 28 +++++++++---------- common/utils_test.go | 4 +-- database/database_test.go | 9 +++--- database/types.go | 6 ++-- database/typesconv_test.go | 2 +- datastore/datastore.go | 4 +-- datastore/datastore_test.go | 2 +- datastore/redis.go | 5 ++-- datastore/redis_test.go | 8 +++--- go.mod | 2 +- go.sum | 32 +++++++++++++++++++++ services/api/optimistic_test.go | 20 +++++++------- services/api/service.go | 2 +- services/api/service_test.go | 14 +++++----- services/housekeeper/housekeeper.go | 4 +-- 19 files changed, 127 insertions(+), 85 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index c11a4ba3..60111802 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: ^1.20 + go-version: ^1.21 id: go - name: Check out code into the Go module directory @@ -40,20 +40,20 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: ^1.20 + go-version: ^1.21 id: go - name: Check out code into the Go module directory - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install gofumpt run: go install mvdan.cc/gofumpt@v0.4.0 - name: Install staticcheck - run: go install honnef.co/go/tools/cmd/staticcheck@v0.4.2 + run: go install honnef.co/go/tools/cmd/staticcheck@v0.4.6 - name: Install golangci-lint - run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2 + run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.0 - name: Lint run: make lint diff --git a/.golangci.yaml b/.golangci.yaml index 3b8561d8..3229c00f 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -30,6 +30,7 @@ linters: - deadcode - varcheck - interfacebloat + - exhaustruct # # Disabled because of generics: @@ -121,4 +122,10 @@ issues: exclude-rules: - path: (.+)_test.go linters: - - exhaustruct \ No newline at end of file + - exhaustruct + - path: database/.*.go + linters: + - goconst + - path: cmd/tool/.*.go + linters: + - goconst \ No newline at end of file diff --git a/beaconclient/beacon_client_test.go b/beaconclient/beacon_client_test.go index 1a3530eb..0f13d922 100644 --- a/beaconclient/beacon_client_test.go +++ b/beaconclient/beacon_client_test.go @@ -77,7 +77,7 @@ func TestBeaconInstance(t *testing.T) { vals, err := bc.GetStateValidators("1") require.NoError(t, err) - require.Equal(t, 1, len(vals.Data)) + require.Len(t, vals.Data, 1) require.Contains(t, validatorResponseEntryToMap(vals.Data), "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a") } @@ -188,7 +188,7 @@ func TestFetchValidators(t *testing.T) { validators, err := backend.beaconClient.GetStateValidators("1") require.NoError(t, err) - require.Equal(t, 1, len(validators.Data)) + require.Len(t, validators.Data, 1) require.Contains(t, validatorResponseEntryToMap(validators.Data), testPubKey) // only beacon 2 should have a validator, and should be used by default @@ -199,7 +199,7 @@ func TestFetchValidators(t *testing.T) { validators, err = backend.beaconClient.GetStateValidators("1") require.NoError(t, err) - require.Equal(t, 1, len(validators.Data)) + require.Len(t, validators.Data, 1) }) } @@ -239,5 +239,5 @@ func TestGetForkSchedule(t *testing.T) { forkSchedule, err := bc.GetForkSchedule() require.NoError(t, err) - require.Equal(t, 4, len(forkSchedule.Data)) + require.Len(t, forkSchedule.Data, 4) } diff --git a/common/types.go b/common/types.go index ee359495..0cb139be 100644 --- a/common/types.go +++ b/common/types.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "os" + "strconv" "strings" builderApiV1 "github.com/attestantio/go-builder-client/api/v1" @@ -194,8 +195,8 @@ type BuilderGetValidatorsResponseEntry struct { type BidTraceV2 struct { builderApiV1.BidTrace - BlockNumber uint64 `db:"block_number" json:"block_number,string"` - NumTx uint64 `db:"num_tx" json:"num_tx,string"` + BlockNumber uint64 `db:"block_number" json:"block_number,string"` + NumTx uint64 `db:"num_tx" json:"num_tx,string"` } type BidTraceV2JSON struct { @@ -267,17 +268,17 @@ func (b *BidTraceV2JSON) CSVHeader() []string { func (b *BidTraceV2JSON) ToCSVRecord() []string { return []string{ - fmt.Sprint(b.Slot), + strconv.FormatUint(b.Slot, 10), b.ParentHash, b.BlockHash, b.BuilderPubkey, b.ProposerPubkey, b.ProposerFeeRecipient, - fmt.Sprint(b.GasLimit), - fmt.Sprint(b.GasUsed), + strconv.FormatUint(b.GasLimit, 10), + strconv.FormatUint(b.GasUsed, 10), b.Value, - fmt.Sprint(b.NumTx), - fmt.Sprint(b.BlockNumber), + strconv.FormatUint(b.NumTx, 10), + strconv.FormatUint(b.BlockNumber, 10), } } @@ -309,20 +310,20 @@ func (b *BidTraceV2WithTimestampJSON) CSVHeader() []string { func (b *BidTraceV2WithTimestampJSON) ToCSVRecord() []string { return []string{ - fmt.Sprint(b.Slot), + strconv.FormatUint(b.Slot, 10), b.ParentHash, b.BlockHash, b.BuilderPubkey, b.ProposerPubkey, b.ProposerFeeRecipient, - fmt.Sprint(b.GasLimit), - fmt.Sprint(b.GasUsed), + strconv.FormatUint(b.GasLimit, 10), + strconv.FormatUint(b.GasUsed, 10), b.Value, - fmt.Sprint(b.NumTx), - fmt.Sprint(b.BlockNumber), - fmt.Sprint(b.Timestamp), - fmt.Sprint(b.TimestampMs), - fmt.Sprint(b.OptimisticSubmission), + strconv.FormatUint(b.NumTx, 10), + strconv.FormatUint(b.BlockNumber, 10), + strconv.FormatInt(b.Timestamp, 10), + strconv.FormatInt(b.TimestampMs, 10), + strconv.FormatBool(b.OptimisticSubmission), } } @@ -599,7 +600,7 @@ func (s *SubmitBlockRequestV2Optimistic) MarshalSSZTo(buf []byte) (dst []byte, e s.Message = new(builderApiV1.BidTrace) } if dst, err = s.Message.MarshalSSZTo(dst); err != nil { - return + return nil, err } // Offset (1) 'ExecutionPayloadHeader' @@ -624,13 +625,13 @@ func (s *SubmitBlockRequestV2Optimistic) MarshalSSZTo(buf []byte) (dst []byte, e // Field (1) 'ExecutionPayloadHeader' if dst, err = s.ExecutionPayloadHeader.MarshalSSZTo(dst); err != nil { - return + return nil, err } // Field (3) 'Transactions' if size := len(s.Transactions); size > 1073741824 { err = ssz.ErrListTooBigFn("SubmitBlockRequestV2Optimistic.Transactions", size, 1073741824) - return + return nil, err } { offset = 4 * len(s.Transactions) @@ -642,7 +643,7 @@ func (s *SubmitBlockRequestV2Optimistic) MarshalSSZTo(buf []byte) (dst []byte, e for ii := 0; ii < len(s.Transactions); ii++ { if size := len(s.Transactions[ii]); size > 1073741824 { err = ssz.ErrBytesLengthFn("SubmitBlockRequestV2Optimistic.Transactions[ii]", size, 1073741824) - return + return nil, err } dst = append(dst, s.Transactions[ii]...) } @@ -650,11 +651,11 @@ func (s *SubmitBlockRequestV2Optimistic) MarshalSSZTo(buf []byte) (dst []byte, e // Field (4) 'Withdrawals' if size := len(s.Withdrawals); size > 16 { err = ssz.ErrListTooBigFn("SubmitBlockRequestV2Optimistic.Withdrawals", size, 16) - return + return nil, err } for ii := 0; ii < len(s.Withdrawals); ii++ { if dst, err = s.Withdrawals[ii].MarshalSSZTo(dst); err != nil { - return + return nil, err } } return dst, nil diff --git a/common/types_test.go b/common/types_test.go index f75d870e..a0def3ea 100644 --- a/common/types_test.go +++ b/common/types_test.go @@ -16,24 +16,24 @@ import ( func makeTestSubmitBlockRequestV2Optimistic(t *testing.T) *SubmitBlockRequestV2Optimistic { t.Helper() testParentHash, err := utils.HexToHash("0xec51bd499a3fa0270f1446fbf05ff0b61157cfe4ec719bb4c3e834e339ee9c5c") - require.Nil(t, err) + require.NoError(t, err) testBlockHash, err := utils.HexToHash("0x3f5b5aaa800a3d25c3f75e72dc45da89fdd58168f1358a9f94aac8b029361a0a") - require.Nil(t, err) + require.NoError(t, err) testRandao, err := utils.HexToHash("0x8cf6b7fbfbaf80da001fe769fd02e9b8dbfa0a646d9cf51b5d7137dd4f8103cc") - require.Nil(t, err) + require.NoError(t, err) testRoot, err := utils.HexToHash("0x7554727cee6d976a1dfdad80b392b37c87f0651ff5b01f6a0b3402bcfce92077") - require.Nil(t, err) + require.NoError(t, err) testBuilderPubkey, err := utils.HexToPubkey("0xae7bde4839fa905b7d8125fd84cfdcd0c32cd74e1be3fa24263d71b520fc78113326ce0a90b95d73f19e6d8150a2f73b") - require.Nil(t, err) + require.NoError(t, err) testProposerPubkey, err := utils.HexToPubkey("0xbb8e223239fa905b7d8125fd84cfdcd0c32cd74e1be3fa24263d71b520fc78113326ce0a90b95d73f19e6d8150a2f73b") - require.Nil(t, err) + require.NoError(t, err) testAddress, err := utils.HexToAddress("0x95222290DD7278Aa3Ddd389Cc1E1d165CC4BAfe5") - require.Nil(t, err) + require.NoError(t, err) testSignature, err := utils.HexToSignature("0xb06311be19c92307c06070578af9ad147c9c6ea902439eac19f785f3dca478c354b79a0af9b09839c3d06c1ccf2185b0162f4d4fbf981220f77586b52ed9ae8a8acfc953baaa30dee15e1b112913c6cbe02c780d7b5363a4af16563fe55c2e88") - require.Nil(t, err) + require.NoError(t, err) testValue := new(uint256.Int) err = testValue.SetFromDecimal("100") - require.Nil(t, err) + require.NoError(t, err) return &SubmitBlockRequestV2Optimistic{ Message: &builderApiV1.BidTrace{ @@ -108,13 +108,13 @@ func TestSubmitBlockRequestV2Optimistic(t *testing.T) { // Encode the object. sszObj, err := obj.MarshalSSZ() - require.Nil(t, err) - require.Equal(t, obj.SizeSSZ(), len(sszObj)) + require.NoError(t, err) + require.Len(t, sszObj, obj.SizeSSZ()) // Unmarshal the full object. unmarshal := new(SubmitBlockRequestV2Optimistic) err = unmarshal.UnmarshalSSZ(sszObj) - require.Nil(t, err) + require.NoError(t, err) compareV2RequestEquality(t, obj, unmarshal) @@ -125,10 +125,10 @@ func TestSubmitBlockRequestV2Optimistic(t *testing.T) { // Unmarshal just the header. unmarshalHeader := new(SubmitBlockRequestV2Optimistic) err = unmarshalHeader.UnmarshalSSZHeaderOnly(sszObj) - require.Nil(t, err) + require.NoError(t, err) compareV2RequestEquality(t, obj, unmarshalHeader) // Make sure size is correct (must have 32 bytes of ExtraData). - require.Equal(t, unmarshalHeader.SizeSSZ(), 944) + require.Equal(t, 944, unmarshalHeader.SizeSSZ()) } diff --git a/common/utils_test.go b/common/utils_test.go index cb938e15..9565a1da 100644 --- a/common/utils_test.go +++ b/common/utils_test.go @@ -91,7 +91,7 @@ func TestGetEnvStrSlice(t *testing.T) { testEnvVar := "TESTENV_TestGetEnvStrSlice" os.Unsetenv(testEnvVar) r := GetEnvStrSlice(testEnvVar, nil) - require.Len(t, r, 0) + require.Empty(t, r) t.Setenv(testEnvVar, "") r = GetEnvStrSlice(testEnvVar, nil) @@ -185,7 +185,7 @@ func TestGetBlockSubmissionInfo(t *testing.T) { submission, err := GetBlockSubmissionInfo(tc.payload) require.Equal(t, tc.expected, submission) if tc.err == "" { - require.Nil(t, err) + require.NoError(t, err) } else { require.Equal(t, tc.err, err.Error()) } diff --git a/database/database_test.go b/database/database_test.go index 274f4d18..e8c5fb00 100644 --- a/database/database_test.go +++ b/database/database_test.go @@ -4,6 +4,7 @@ import ( "database/sql" "fmt" "os" + "strconv" "testing" "time" @@ -205,7 +206,7 @@ func TestMigrations(t *testing.T) { rowCount := 0 err := db.DB.QueryRow(query).Scan(&rowCount) require.NoError(t, err) - require.Equal(t, len(migrations.Migrations.Migrations), rowCount) + require.Len(t, migrations.Migrations.Migrations, rowCount) } func TestSetBlockBuilderStatus(t *testing.T) { @@ -448,7 +449,7 @@ func TestGetBuilderSubmissions(t *testing.T) { require.Equal(t, optimisticSubmission, e.OptimisticSubmission) require.Equal(t, pubkey, e.BuilderPubkey) require.Equal(t, feeRecipient.String(), e.ProposerFeeRecipient) - require.Equal(t, fmt.Sprint(collateral), e.Value) + require.Equal(t, strconv.Itoa(collateral), e.Value) } func TestUpsertTooLateGetPayload(t *testing.T) { @@ -462,7 +463,7 @@ func TestUpsertTooLateGetPayload(t *testing.T) { entries, err := db.GetTooLateGetPayload(slot) require.NoError(t, err) - require.Equal(t, 1, len(entries)) + require.Len(t, entries, 1) entry := entries[0] require.Equal(t, pk, entry.ProposerPubkey) require.Equal(t, hash, entry.BlockHash) @@ -484,7 +485,7 @@ func TestUpsertTooLateGetPayload(t *testing.T) { entries, err = db.GetTooLateGetPayload(slot) require.NoError(t, err) - require.Equal(t, 2, len(entries)) + require.Len(t, entries, 2) entry = entries[1] require.Equal(t, hash2, entry.BlockHash) } diff --git a/database/types.go b/database/types.go index 313cf171..8435c1c1 100644 --- a/database/types.go +++ b/database/types.go @@ -2,7 +2,7 @@ package database import ( "database/sql" - "fmt" + "strconv" "time" builderApiV1 "github.com/attestantio/go-builder-client/api/v1" @@ -114,9 +114,9 @@ var ExecutionPayloadEntryCSVHeader = []string{"id", "inserted_at", "slot", "prop func (e *ExecutionPayloadEntry) ToCSVRecord() []string { return []string{ - fmt.Sprint(e.ID), + strconv.FormatInt(e.ID, 10), e.InsertedAt.UTC().String(), - fmt.Sprint(e.Slot), + strconv.FormatUint(e.Slot, 10), e.ProposerPubkey, e.BlockHash, e.Version, diff --git a/database/typesconv_test.go b/database/typesconv_test.go index 43e185c6..8155c08e 100644 --- a/database/typesconv_test.go +++ b/database/typesconv_test.go @@ -44,5 +44,5 @@ func TestExecutionPayloadEntryToExecutionPayloadDeneb(t *testing.T) { payload, err := ExecutionPayloadEntryToExecutionPayload(entry) require.NoError(t, err) require.Equal(t, "0xbd1ae4f7edb2315d2df70a8d9881fab8d6763fb1c00533ae729050928c38d05a", payload.Deneb.ExecutionPayload.BlockHash.String()) - require.Equal(t, 1, len(payload.Deneb.BlobsBundle.Blobs)) + require.Len(t, payload.Deneb.BlobsBundle.Blobs, 1) } diff --git a/datastore/datastore.go b/datastore/datastore.go index 4e5e9e0b..76e0c390 100644 --- a/datastore/datastore.go +++ b/datastore/datastore.go @@ -3,7 +3,7 @@ package datastore import ( "database/sql" - "fmt" + "strconv" "strings" "sync" "time" @@ -122,7 +122,7 @@ func (ds *Datastore) RefreshKnownValidators(log *logrus.Entry, beaconClient beac }) log.Infof("received known validators from beacon-node") - err = ds.redis.SetStats(RedisStatsFieldValidatorsTotal, fmt.Sprint(numValidators)) + err = ds.redis.SetStats(RedisStatsFieldValidatorsTotal, strconv.Itoa(numValidators)) if err != nil { log.WithError(err).Error("failed to set stats for RedisStatsFieldValidatorsTotal") } diff --git a/datastore/datastore_test.go b/datastore/datastore_test.go index 2336494b..97361510 100644 --- a/datastore/datastore_test.go +++ b/datastore/datastore_test.go @@ -27,7 +27,7 @@ func setupTestDatastore(t *testing.T, mockDB *database.MockDB) *Datastore { func TestGetPayloadFailure(t *testing.T) { ds := setupTestDatastore(t, &database.MockDB{}) _, err := ds.GetGetPayloadResponse(common.TestLog, 1, "a", "b") - require.Error(t, ErrExecutionPayloadNotFound, err) + require.ErrorIs(t, ErrExecutionPayloadNotFound, err) } func TestGetPayloadDatabaseFallback(t *testing.T) { diff --git a/datastore/redis.go b/datastore/redis.go index f1f0e9b9..02b307f8 100644 --- a/datastore/redis.go +++ b/datastore/redis.go @@ -21,6 +21,7 @@ import ( ) var ( + redisScheme = "redis://" redisPrefix = "boost-relay" expiryBidCache = 45 * time.Second @@ -43,8 +44,8 @@ var ( func connectRedis(redisURI string) (*redis.Client, error) { // Handle both URIs and full URLs, assume unencrypted connections - if !strings.HasPrefix(redisURI, "redis://") && !strings.HasPrefix(redisURI, "rediss://") { - redisURI = "redis://" + redisURI + if !strings.HasPrefix(redisURI, redisScheme) && !strings.HasPrefix(redisURI, "rediss://") { + redisURI = redisScheme + redisURI } redisOpts, err := redis.ParseURL(redisURI) diff --git a/datastore/redis_test.go b/datastore/redis_test.go index 2cf98f1b..fdada757 100644 --- a/datastore/redis_test.go +++ b/datastore/redis_test.go @@ -109,7 +109,7 @@ func TestRedisProposerDuties(t *testing.T) { duties2, err := cache.GetProposerDuties() require.NoError(t, err) - require.Equal(t, 1, len(duties2)) + require.Len(t, duties2, 1) require.Equal(t, duties[0].Entry.Message.FeeRecipient, duties2[0].Entry.Message.FeeRecipient) } @@ -264,14 +264,14 @@ func TestRedisURIs(t *testing.T) { // test connection with and without protocol _, err = NewRedisCache("", redisTestServer.Addr(), "") require.NoError(t, err) - _, err = NewRedisCache("", "redis://"+redisTestServer.Addr(), "") + _, err = NewRedisCache("", redisScheme+redisTestServer.Addr(), "") require.NoError(t, err) // test connection w/ credentials username := "user" password := "pass" redisTestServer.RequireUserAuth(username, password) - fullURL := "redis://" + username + ":" + password + "@" + redisTestServer.Addr() + fullURL := redisScheme + username + ":" + password + "@" + redisTestServer.Addr() _, err = NewRedisCache("", fullURL, "") require.NoError(t, err) @@ -440,7 +440,7 @@ func TestGetBuilderLatestValue(t *testing.T) { func TestPipelineNilCheck(t *testing.T) { cache := setupTestRedis(t) f, err := cache.GetFloorBidValue(context.Background(), cache.NewPipeline(), 0, "1", "2") - require.NoError(t, err, err) + require.NoError(t, err) require.Equal(t, big.NewInt(0), f) } diff --git a/go.mod b/go.mod index f958a3b4..e929d30c 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/flashbots/mev-boost-relay -go 1.20 +go 1.21 require ( github.com/NYTimes/gziphandler v1.1.1 diff --git a/go.sum b/go.sum index 050b4519..5f93eefd 100644 --- a/go.sum +++ b/go.sum @@ -29,6 +29,7 @@ github.com/attestantio/go-eth2-client v0.19.9 h1:g5LLX3X7cLC0KS0oai/MtxBOZz3U3QP github.com/attestantio/go-eth2-client v0.19.9/go.mod h1:TTz7YF6w4z6ahvxKiHuGPn6DbQn7gH6HPuWm/DEQeGE= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= +github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsyepwsSr88= @@ -71,6 +72,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= @@ -103,6 +105,7 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= @@ -135,6 +138,7 @@ github.com/flashbots/go-utils v0.5.0/go.mod h1:LauDwifaRdSK0mS5X34GR59pJtUu1T/lO github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 h1:BAIP2GihuqhwdILrV+7GJel5lyPV3u1+PgzrWLc0TkE= github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46/go.mod h1:QNpY22eby74jVhqH4WhDLDwxc/vqsern6pW+u2kbkpc= @@ -146,21 +150,28 @@ github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/ github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gorp/gorp/v3 v3.1.0 h1:ItKF/Vbuj31dmV4jxA1qblpSwkl9g1typ24xoe70IGs= github.com/go-gorp/gorp/v3 v3.1.0/go.mod h1:dLEjIyyRNiXvNZ8PSmzpt1GsWAUK8kjVhEpjH8TixEw= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-redis/redis/v9 v9.0.0-rc.1 h1:/+bS+yeUnanqAbuD3QwlejzQZ+4eqgfUtFTG4b+QnXs= github.com/go-redis/redis/v9 v9.0.0-rc.1/go.mod h1:8et+z03j0l8N+DvsVnclzjf3Dl/pFHgRk+2Ct1qw66A= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/gobuffalo/logger v1.0.6 h1:nnZNpxYo0zx+Aj9RfMPBm+x9zAU2OayFh/xrAWi34HU= +github.com/gobuffalo/logger v1.0.6/go.mod h1:J31TBEHR1QLV2683OXTAItYIg8pv2JMHnF/quuAbMjs= github.com/gobuffalo/packd v1.0.1 h1:U2wXfRr4E9DH8IdsDLlRFwTZTK7hLfq9qT/QHXGVe/0= +github.com/gobuffalo/packd v1.0.1/go.mod h1:PP2POP3p3RXGz7Jh6eYEf93S7vA2za6xM7QT85L4+VY= github.com/gobuffalo/packr/v2 v2.8.3 h1:xE1yzvnO56cUC0sTpKR3DIbxZgB54AftTFMhB2XEWlY= +github.com/gobuffalo/packr/v2 v2.8.3/go.mod h1:0SahksCVcx4IMnigTjiFuyldmTrdTctXsOdiU5KwbKc= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= @@ -204,6 +215,7 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= @@ -220,7 +232,9 @@ github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/go-clone v1.6.0 h1:HMo5uvg4wgfiy5FoGOqlFLQED/VGRm2D9Pi8g1FXPGc= +github.com/huandu/go-clone v1.6.0/go.mod h1:ReGivhG6op3GYr+UY3lS6mxjKp7MIGTknuU5TbTVaXE= github.com/huandu/go-clone/generic v1.6.0 h1:Wgmt/fUZ28r16F2Y3APotFD59sHk1p78K0XLdbUYN5U= +github.com/huandu/go-clone/generic v1.6.0/go.mod h1:xgd9ZebcMsBWWcBx5mVMCoqMX24gLWr5lQicr+nVXNs= github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -241,6 +255,7 @@ github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/karrick/godirwalk v1.16.1 h1:DynhcF+bztK8gooS0+NDJFrdNZjJ3gzVzC545UNA9iw= +github.com/karrick/godirwalk v1.16.1/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= @@ -265,17 +280,23 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= +github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.8 h1:3fdt97i/cwSU83+E0hZTC/Xpc9mTZxc6UWSCRcSbxiE= github.com/lib/pq v1.10.8/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/markbates/errx v1.1.0 h1:QDFeR+UP95dO12JgW+tgi2UVfo0V8YBHiUIOaeBPiEI= +github.com/markbates/errx v1.1.0/go.mod h1:PLa46Oex9KNbVDZhKel8v1OT7hD5JZ2eI7AHhA0wswc= github.com/markbates/oncer v1.0.0 h1:E83IaVAHygyndzPimgUYJjbshhDTALZyXxvk9FOlQRY= +github.com/markbates/oncer v1.0.0/go.mod h1:Z59JA581E9GP6w96jai+TGqafHPW+cPfRxz2aSZ0mcI= github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= @@ -294,6 +315,7 @@ github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4 github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.15 h1:vfoHhTN1af61xCRSWzFIWzx2YskyMTwHLrExkBOjvxI= +github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= @@ -319,6 +341,7 @@ github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -327,11 +350,13 @@ github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.21.1 h1:OB/euWYIExnPBohllTicTHmGTrMaqJ67nIu80j0/uEM= +github.com/onsi/gomega v1.21.1/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= @@ -342,6 +367,7 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/poy/onpar v1.1.2 h1:QaNrNiZx0+Nar5dLgTVp5mXkyoVFIbepjyEoGSnhbAY= +github.com/poy/onpar v1.1.2/go.mod h1:6X8FLNoxyr9kkmnlqpK6LSoiOtrO6MICtWwEuWkLjzg= github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -409,11 +435,13 @@ github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0h github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/trailofbits/go-fuzz-utils v0.0.0-20210901195358-9657fcfd256c h1:4WU+p200eLYtBsx3M5CKXvkjVdf5SC3W9nMg37y0TFI= +github.com/trailofbits/go-fuzz-utils v0.0.0-20210901195358-9657fcfd256c/go.mod h1:f3jBhpWvuZmue0HZK52GzRHJOYHYSILs/c8+K2S/J+o= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/umbracle/gohashtree v0.0.2-alpha.0.20230207094856-5b775a815c10 h1:CQh33pStIp/E30b7TxDlXfM0145bn2e8boI30IxAhTg= +github.com/umbracle/gohashtree v0.0.2-alpha.0.20230207094856-5b775a815c10/go.mod h1:x/Pa0FF5Te9kdrlZKJK82YmAkvL8+f989USgz6Jiw7M= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= @@ -436,6 +464,7 @@ github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7 go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= @@ -535,6 +564,7 @@ golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -595,6 +625,7 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= @@ -615,6 +646,7 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= diff --git a/services/api/optimistic_test.go b/services/api/optimistic_test.go index b7a35b80..bb3a5eda 100644 --- a/services/api/optimistic_test.go +++ b/services/api/optimistic_test.go @@ -294,7 +294,7 @@ func TestProcessOptimisticBlock(t *testing.T) { simResult := <-simResultC require.True(t, simResult.optimisticSubmission) require.Equal(t, tc.simulationError, simResult.validationErr) - require.Nil(t, simResult.requestErr) + require.NoError(t, simResult.requestErr) require.True(t, simResult.wasSimulated) // Check demotion but no refund. @@ -361,9 +361,9 @@ func TestPrepareBuildersForSlot(t *testing.T) { backend.relay.prepareBuildersForSlot(slot + 1) entry, ok := backend.relay.blockBuildersCache[pkStr] require.True(t, ok) - require.Equal(t, true, entry.status.IsHighPrio) - require.Equal(t, true, entry.status.IsOptimistic) - require.Equal(t, false, entry.status.IsBlacklisted) + require.True(t, entry.status.IsHighPrio) + require.True(t, entry.status.IsOptimistic) + require.False(t, entry.status.IsBlacklisted) require.Zero(t, entry.collateral.Cmp(big.NewInt(int64(collateral)))) } @@ -515,10 +515,10 @@ func TestInternalBuilderStatus(t *testing.T) { setAndGetStatus := func(arg string, expected common.BuilderStatus) { // Set & Get. rr := backend.request(http.MethodPost, path+arg, nil) - require.Equal(t, rr.Code, http.StatusOK) + require.Equal(t, http.StatusOK, rr.Code) rr = backend.request(http.MethodGet, path, nil) - require.Equal(t, rr.Code, http.StatusOK) + require.Equal(t, http.StatusOK, rr.Code) resp := &database.BlockBuilderEntry{} err := json.Unmarshal(rr.Body.Bytes(), &resp) require.NoError(t, err) @@ -538,13 +538,13 @@ func TestInternalBuilderCollateral(t *testing.T) { // Set & Get. rr := backend.request(http.MethodPost, path+"?collateral=builder0x69&value=10000", nil) - require.Equal(t, rr.Code, http.StatusOK) + require.Equal(t, http.StatusOK, rr.Code) rr = backend.request(http.MethodGet, "/internal/v1/builder/"+pubkey.String(), nil) - require.Equal(t, rr.Code, http.StatusOK) + require.Equal(t, http.StatusOK, rr.Code) resp := &database.BlockBuilderEntry{} err := json.Unmarshal(rr.Body.Bytes(), &resp) require.NoError(t, err) - require.Equal(t, resp.BuilderID, "builder0x69") - require.Equal(t, resp.Collateral, "10000") + require.Equal(t, "builder0x69", resp.BuilderID) + require.Equal(t, "10000", resp.Collateral) } diff --git a/services/api/service.go b/services/api/service.go index 9dea594f..12c894ac 100644 --- a/services/api/service.go +++ b/services/api/service.go @@ -819,7 +819,7 @@ func (api *RelayAPI) updateProposerDuties(headSlot uint64) { // pretty-print _duties := make([]string, len(duties)) for i, duty := range duties { - _duties[i] = fmt.Sprint(duty.Slot) + _duties[i] = strconv.FormatUint(duty.Slot, 10) } sort.Strings(_duties) api.log.Infof("proposer duties updated: %s", strings.Join(_duties, ", ")) diff --git a/services/api/service_test.go b/services/api/service_test.go index 6e490075..d267c8ee 100644 --- a/services/api/service_test.go +++ b/services/api/service_test.go @@ -297,7 +297,7 @@ func TestBuilderApiGetValidators(t *testing.T) { resp := []common.BuilderGetValidatorsResponseEntry{} err = json.Unmarshal(rr.Body.Bytes(), &resp) require.NoError(t, err) - require.Equal(t, 1, len(resp)) + require.Len(t, resp, 1) require.Equal(t, uint64(1), resp[0].Slot) require.Equal(t, common.ValidPayloadRegisterValidator, *resp[0].Entry) } @@ -363,7 +363,7 @@ func TestBuilderSubmitBlockSSZ(t *testing.T) { reqSSZ, err := req.MarshalSSZ() require.NoError(t, err) - require.Equal(t, testCase.sszLength, len(reqSSZ)) + require.Len(t, reqSSZ, testCase.sszLength) test := new(common.VersionedSubmitBlockRequest) err = test.UnmarshalSSZ(reqSSZ) @@ -487,7 +487,7 @@ func TestBuilderSubmitBlock(t *testing.T) { // Send JSON encoded request reqJSONBytes, err := json.Marshal(req) require.NoError(t, err) - require.Equal(t, testCase.data.jsonReqSize, len(reqJSONBytes)) + require.Len(t, reqJSONBytes, testCase.data.jsonReqSize) reqJSONBytes2, err := json.Marshal(req) require.NoError(t, err) require.Equal(t, reqJSONBytes, reqJSONBytes2) @@ -498,7 +498,7 @@ func TestBuilderSubmitBlock(t *testing.T) { // Send SSZ encoded request reqSSZBytes, err := req.MarshalSSZ() require.NoError(t, err) - require.Equal(t, testCase.data.sszReqSize, len(reqSSZBytes)) + require.Len(t, reqSSZBytes, testCase.data.sszReqSize) rr = backend.requestBytes(http.MethodPost, path, reqSSZBytes, map[string]string{ "Content-Type": "application/octet-stream", }) @@ -510,7 +510,7 @@ func TestBuilderSubmitBlock(t *testing.T) { "Content-Encoding": "gzip", } jsonGzip := gzipBytes(t, reqJSONBytes) - require.Equal(t, testCase.data.jsonGzipReqSize, len(jsonGzip)) + require.Len(t, jsonGzip, testCase.data.jsonGzipReqSize) rr = backend.requestBytes(http.MethodPost, path, jsonGzip, headers) require.Contains(t, rr.Body.String(), "invalid signature") require.Equal(t, http.StatusBadRequest, rr.Code) @@ -522,7 +522,7 @@ func TestBuilderSubmitBlock(t *testing.T) { } sszGzip := gzipBytes(t, reqSSZBytes) - require.Equal(t, testCase.data.sszGzipReqSize, len(sszGzip)) + require.Len(t, sszGzip, testCase.data.sszGzipReqSize) rr = backend.requestBytes(http.MethodPost, path, sszGzip, headers) require.Contains(t, rr.Body.String(), "invalid signature") require.Equal(t, http.StatusBadRequest, rr.Code) @@ -1039,7 +1039,7 @@ func TestCheckFloorBidValue(t *testing.T) { submission, err := common.GetBlockSubmissionInfo(tc.payload) require.NoError(t, err) err = backend.redis.SetFloorBidValue(submission.BidTrace.Slot, submission.BidTrace.ParentHash.String(), submission.BidTrace.ProposerPubkey.String(), tc.floorValue) - require.Nil(t, err) + require.NoError(t, err) w := httptest.NewRecorder() logger := logrus.New() diff --git a/services/housekeeper/housekeeper.go b/services/housekeeper/housekeeper.go index 31944b5b..419c2e48 100644 --- a/services/housekeeper/housekeeper.go +++ b/services/housekeeper/housekeeper.go @@ -9,10 +9,10 @@ package housekeeper import ( "errors" - "fmt" "net/http" _ "net/http/pprof" "sort" + "strconv" "strings" "time" @@ -238,7 +238,7 @@ func (hk *Housekeeper) updateProposerDuties(headSlot uint64) { // Pretty-print _duties := make([]string, len(proposerDuties)) for i, duty := range proposerDuties { - _duties[i] = fmt.Sprint(duty.Slot) + _duties[i] = strconv.FormatUint(duty.Slot, 10) } sort.Strings(_duties) log.WithField("numDuties", len(_duties)).Infof("proposer duties updated: %s", strings.Join(_duties, ", "))