From b4d60884d2a1259de0c3239d8cdaf33845937d93 Mon Sep 17 00:00:00 2001 From: maskpp <32827930+mask-pp@users.noreply.github.com> Date: Thu, 13 Jan 2022 11:45:06 +0800 Subject: [PATCH] Fix import fmt and run tests for given architecture (#18) * fix gofmt * Run tests for given architecture * Speed up CI execution. --- Makefile | 2 +- accounts/keystore/key.go | 2 +- accounts/keystore/passphrase.go | 2 +- accounts/keystore/presale.go | 2 +- accounts/keystore/watch.go | 2 +- accounts/scwallet/hub.go | 2 +- accounts/scwallet/securechannel.go | 2 +- accounts/scwallet/wallet.go | 2 +- accounts/usbwallet/hub.go | 2 +- accounts/usbwallet/trezor.go | 2 +- accounts/usbwallet/wallet.go | 2 +- build/ci.go | 4 ++-- build/update-license.go | 1 + cmd/clef/main.go | 4 ++-- cmd/ethkey/generate.go | 2 +- cmd/faucet/faucet.go | 2 +- cmd/geth/config.go | 2 +- cmd/geth/version_check.go | 2 +- cmd/puppeth/wizard.go | 2 +- cmd/puppeth/wizard_netstats.go | 2 +- cmd/utils/flags.go | 2 +- consensus/clique/clique.go | 6 +----- consensus/clique/snapshot.go | 2 +- consensus/ethash/difficulty.go | 2 +- consensus/ethash/ethash.go | 2 +- console/console.go | 4 ++-- core/blockchain.go | 2 +- core/headerchain.go | 2 +- core/rawdb/database.go | 2 +- core/rawdb/freezer.go | 2 +- core/rawdb/freezer_batch.go | 2 +- core/rawdb/freezer_table.go | 2 +- core/state/database.go | 2 +- core/state/pruner/bloom.go | 2 +- core/state/snapshot/difflayer.go | 2 +- core/vm/common.go | 2 +- core/vm/contract.go | 2 +- core/vm/eips.go | 2 +- core/vm/evm.go | 2 +- core/vm/gen_structlog.go | 2 +- core/vm/instructions.go | 2 +- core/vm/instructions_test.go | 2 +- core/vm/logger.go | 2 +- core/vm/logger_test.go | 2 +- crypto/secp256k1/libsecp256k1/contrib/dummy.go | 1 + crypto/secp256k1/libsecp256k1/dummy.go | 1 + crypto/secp256k1/libsecp256k1/include/dummy.go | 1 + crypto/secp256k1/libsecp256k1/src/dummy.go | 1 + crypto/secp256k1/libsecp256k1/src/modules/dummy.go | 1 + crypto/secp256k1/libsecp256k1/src/modules/ecdh/dummy.go | 1 + crypto/secp256k1/libsecp256k1/src/modules/recovery/dummy.go | 1 + eth/gasprice/gasprice.go | 2 +- eth/protocols/snap/range.go | 2 +- ethstats/ethstats.go | 2 +- graphql/service.go | 2 +- internal/debug/api.go | 2 +- internal/debug/flags.go | 6 +++--- les/api_test.go | 2 +- les/vflux/server/clientdb.go | 2 +- light/lightchain.go | 2 +- metrics/influxdb/influxdb.go | 2 +- metrics/influxdb/influxdbv2.go | 4 ++-- miner/worker.go | 6 +++--- node/node.go | 2 +- node/rpcstack.go | 2 +- node/rpcstack_test.go | 2 +- p2p/discover/v5wire/session.go | 2 +- p2p/dnsdisc/client.go | 2 +- p2p/nat/nat.go | 2 +- p2p/rlpx/rlpx.go | 2 +- p2p/simulations/adapters/exec.go | 2 +- p2p/simulations/adapters/inproc.go | 2 +- p2p/simulations/adapters/types.go | 2 +- p2p/simulations/http.go | 4 ++-- p2p/simulations/http_test.go | 2 +- rpc/websocket.go | 2 +- signer/storage/aes_gcm_storage_test.go | 2 +- tests/fuzzers/abi/abifuzzer.go | 2 +- tests/fuzzers/bn256/bn256_fuzz.go | 1 + tests/fuzzers/secp256k1/secp_fuzzer.go | 2 +- trie/sync_bloom.go | 2 +- 81 files changed, 90 insertions(+), 85 deletions(-) diff --git a/Makefile b/Makefile index 944961473993..32aa088ce046 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ ios: @echo "Import \"$(GOBIN)/Geth.framework\" to use the library." test: all - $(GORUN) build/ci.go test + $(GORUN) build/ci.go test ./consensus ./core ./eth ./miner ./node ./trie lint: ## Run linters. $(GORUN) build/ci.go lint diff --git a/accounts/keystore/key.go b/accounts/keystore/key.go index ad287c3ff626..e495b88aceb5 100644 --- a/accounts/keystore/key.go +++ b/accounts/keystore/key.go @@ -29,10 +29,10 @@ import ( "strings" "time" + "github.com/google/uuid" "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/crypto" - "github.com/google/uuid" ) const ( diff --git a/accounts/keystore/passphrase.go b/accounts/keystore/passphrase.go index 17064a64751d..f58e8f4ef16a 100644 --- a/accounts/keystore/passphrase.go +++ b/accounts/keystore/passphrase.go @@ -38,11 +38,11 @@ import ( "os" "path/filepath" + "github.com/google/uuid" "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/math" "github.com/scroll-tech/go-ethereum/crypto" - "github.com/google/uuid" "golang.org/x/crypto/pbkdf2" "golang.org/x/crypto/scrypt" ) diff --git a/accounts/keystore/presale.go b/accounts/keystore/presale.go index f823231c2c7b..ed5e930d8ff9 100644 --- a/accounts/keystore/presale.go +++ b/accounts/keystore/presale.go @@ -25,9 +25,9 @@ import ( "errors" "fmt" + "github.com/google/uuid" "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/crypto" - "github.com/google/uuid" "golang.org/x/crypto/pbkdf2" ) diff --git a/accounts/keystore/watch.go b/accounts/keystore/watch.go index 510d06f103bb..66e2ab82331f 100644 --- a/accounts/keystore/watch.go +++ b/accounts/keystore/watch.go @@ -22,8 +22,8 @@ package keystore import ( "time" - "github.com/scroll-tech/go-ethereum/log" "github.com/rjeczalik/notify" + "github.com/scroll-tech/go-ethereum/log" ) type watcher struct { diff --git a/accounts/scwallet/hub.go b/accounts/scwallet/hub.go index f554ffeecf3e..bcae67f469a3 100644 --- a/accounts/scwallet/hub.go +++ b/accounts/scwallet/hub.go @@ -41,11 +41,11 @@ import ( "sync" "time" + pcsc "github.com/gballet/go-libpcsclite" "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/event" "github.com/scroll-tech/go-ethereum/log" - pcsc "github.com/gballet/go-libpcsclite" ) // Scheme is the URI prefix for smartcard wallets. diff --git a/accounts/scwallet/securechannel.go b/accounts/scwallet/securechannel.go index cd3295429b01..eeb06b190008 100644 --- a/accounts/scwallet/securechannel.go +++ b/accounts/scwallet/securechannel.go @@ -26,8 +26,8 @@ import ( "crypto/sha512" "fmt" - "github.com/scroll-tech/go-ethereum/crypto" pcsc "github.com/gballet/go-libpcsclite" + "github.com/scroll-tech/go-ethereum/crypto" "golang.org/x/crypto/pbkdf2" "golang.org/x/text/unicode/norm" ) diff --git a/accounts/scwallet/wallet.go b/accounts/scwallet/wallet.go index b78d7075995d..ad0c47f41c91 100644 --- a/accounts/scwallet/wallet.go +++ b/accounts/scwallet/wallet.go @@ -33,13 +33,13 @@ import ( "sync" "time" + pcsc "github.com/gballet/go-libpcsclite" "github.com/scroll-tech/go-ethereum" "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/types" "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/log" - pcsc "github.com/gballet/go-libpcsclite" "github.com/status-im/keycard-go/derivationpath" ) diff --git a/accounts/usbwallet/hub.go b/accounts/usbwallet/hub.go index 77e34e652f4b..eb61c91eaf03 100644 --- a/accounts/usbwallet/hub.go +++ b/accounts/usbwallet/hub.go @@ -23,10 +23,10 @@ import ( "sync/atomic" "time" + "github.com/karalabe/usb" "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/event" "github.com/scroll-tech/go-ethereum/log" - "github.com/karalabe/usb" ) // LedgerScheme is the protocol scheme prefixing account and wallet URLs. diff --git a/accounts/usbwallet/trezor.go b/accounts/usbwallet/trezor.go index ff5ca10ec715..62352d2304f8 100644 --- a/accounts/usbwallet/trezor.go +++ b/accounts/usbwallet/trezor.go @@ -27,13 +27,13 @@ import ( "io" "math/big" + "github.com/golang/protobuf/proto" "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/accounts/usbwallet/trezor" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/hexutil" "github.com/scroll-tech/go-ethereum/core/types" "github.com/scroll-tech/go-ethereum/log" - "github.com/golang/protobuf/proto" ) // ErrTrezorPINNeeded is returned if opening the trezor requires a PIN code. In diff --git a/accounts/usbwallet/wallet.go b/accounts/usbwallet/wallet.go index f69d3d18be4f..d17bb293c065 100644 --- a/accounts/usbwallet/wallet.go +++ b/accounts/usbwallet/wallet.go @@ -25,13 +25,13 @@ import ( "sync" "time" + "github.com/karalabe/usb" "github.com/scroll-tech/go-ethereum" "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/types" "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/log" - "github.com/karalabe/usb" ) // Maximum time between wallet health checks to detect USB unplugs. diff --git a/build/ci.go b/build/ci.go index cedfc50b4094..fd6dc48fbd80 100644 --- a/build/ci.go +++ b/build/ci.go @@ -219,7 +219,7 @@ func doInstall(cmdline []string) { // better disable it. This check isn't the best, it should probably // check for something in env instead. if env.CI && runtime.GOARCH == "arm64" { - gobuild.Args = append(gobuild.Args, "-p", "1") + gobuild.Args = append(gobuild.Args, "-p", strconv.Itoa(runtime.NumCPU())) } // We use -trimpath to avoid leaking local paths into the built executables. @@ -293,7 +293,7 @@ func doTest(cmdline []string) { // Test a single package at a time. CI builders are slow // and some tests run into timeouts under load. - gotest.Args = append(gotest.Args, "-p", "1") + gotest.Args = append(gotest.Args, "-p", strconv.Itoa(runtime.NumCPU())) if *coverage { gotest.Args = append(gotest.Args, "-covermode=atomic", "-cover") } diff --git a/build/update-license.go b/build/update-license.go index 49e40fd0bbac..8fd3e8760dd9 100644 --- a/build/update-license.go +++ b/build/update-license.go @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Lesser General Public License // along with the go-ethereum library. If not, see . +//go:build none // +build none /* diff --git a/cmd/clef/main.go b/cmd/clef/main.go index d1766ecca164..2582bd64acf4 100644 --- a/cmd/clef/main.go +++ b/cmd/clef/main.go @@ -35,6 +35,8 @@ import ( "strings" "time" + "github.com/mattn/go-colorable" + "github.com/mattn/go-isatty" "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/accounts/keystore" "github.com/scroll-tech/go-ethereum/cmd/utils" @@ -54,8 +56,6 @@ import ( "github.com/scroll-tech/go-ethereum/signer/fourbyte" "github.com/scroll-tech/go-ethereum/signer/rules" "github.com/scroll-tech/go-ethereum/signer/storage" - "github.com/mattn/go-colorable" - "github.com/mattn/go-isatty" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/ethkey/generate.go b/cmd/ethkey/generate.go index a5ad998b43ab..84883b9f7625 100644 --- a/cmd/ethkey/generate.go +++ b/cmd/ethkey/generate.go @@ -23,10 +23,10 @@ import ( "os" "path/filepath" + "github.com/google/uuid" "github.com/scroll-tech/go-ethereum/accounts/keystore" "github.com/scroll-tech/go-ethereum/cmd/utils" "github.com/scroll-tech/go-ethereum/crypto" - "github.com/google/uuid" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index 5b731a2cdc9b..beb1224349ad 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -41,6 +41,7 @@ import ( "sync" "time" + "github.com/gorilla/websocket" "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/accounts/keystore" "github.com/scroll-tech/go-ethereum/cmd/utils" @@ -58,7 +59,6 @@ import ( "github.com/scroll-tech/go-ethereum/p2p/enode" "github.com/scroll-tech/go-ethereum/p2p/nat" "github.com/scroll-tech/go-ethereum/params" - "github.com/gorilla/websocket" ) var ( diff --git a/cmd/geth/config.go b/cmd/geth/config.go index 9ef93fa9fa4f..90545f1fe17f 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -27,6 +27,7 @@ import ( "gopkg.in/urfave/cli.v1" + "github.com/naoina/toml" "github.com/scroll-tech/go-ethereum/accounts/external" "github.com/scroll-tech/go-ethereum/accounts/keystore" "github.com/scroll-tech/go-ethereum/accounts/scwallet" @@ -39,7 +40,6 @@ import ( "github.com/scroll-tech/go-ethereum/metrics" "github.com/scroll-tech/go-ethereum/node" "github.com/scroll-tech/go-ethereum/params" - "github.com/naoina/toml" ) var ( diff --git a/cmd/geth/version_check.go b/cmd/geth/version_check.go index 6783839e1d00..631b3066ecd1 100644 --- a/cmd/geth/version_check.go +++ b/cmd/geth/version_check.go @@ -25,8 +25,8 @@ import ( "regexp" "strings" - "github.com/scroll-tech/go-ethereum/log" "github.com/jedisct1/go-minisign" + "github.com/scroll-tech/go-ethereum/log" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/puppeth/wizard.go b/cmd/puppeth/wizard.go index dea42a737572..40f0ae248756 100644 --- a/cmd/puppeth/wizard.go +++ b/cmd/puppeth/wizard.go @@ -30,11 +30,11 @@ import ( "strings" "sync" + "github.com/peterh/liner" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/console/prompt" "github.com/scroll-tech/go-ethereum/core" "github.com/scroll-tech/go-ethereum/log" - "github.com/peterh/liner" "golang.org/x/crypto/ssh/terminal" ) diff --git a/cmd/puppeth/wizard_netstats.go b/cmd/puppeth/wizard_netstats.go index 0037c252abaa..3b5f47af1bec 100644 --- a/cmd/puppeth/wizard_netstats.go +++ b/cmd/puppeth/wizard_netstats.go @@ -23,9 +23,9 @@ import ( "strings" "sync" + "github.com/olekukonko/tablewriter" "github.com/scroll-tech/go-ethereum/core" "github.com/scroll-tech/go-ethereum/log" - "github.com/olekukonko/tablewriter" ) // networkStats verifies the status of network components and generates a protip diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 53bb05c3ed71..21209da376fb 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -33,6 +33,7 @@ import ( "text/template" "time" + pcsclite "github.com/gballet/go-libpcsclite" "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/accounts/keystore" "github.com/scroll-tech/go-ethereum/common" @@ -66,7 +67,6 @@ import ( "github.com/scroll-tech/go-ethereum/p2p/nat" "github.com/scroll-tech/go-ethereum/p2p/netutil" "github.com/scroll-tech/go-ethereum/params" - pcsclite "github.com/gballet/go-libpcsclite" gopsutil "github.com/shirou/gopsutil/mem" "gopkg.in/urfave/cli.v1" ) diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index 19928bd5ee85..8315ec2d4842 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -27,6 +27,7 @@ import ( "sync" "time" + lru "github.com/hashicorp/golang-lru" "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/hexutil" @@ -41,7 +42,6 @@ import ( "github.com/scroll-tech/go-ethereum/rlp" "github.com/scroll-tech/go-ethereum/rpc" "github.com/scroll-tech/go-ethereum/trie" - lru "github.com/hashicorp/golang-lru" "golang.org/x/crypto/sha3" ) @@ -123,10 +123,6 @@ var ( // turn of the signer. errWrongDifficulty = errors.New("wrong difficulty") - // errInvalidTimestamp is returned if the timestamp of a block is lower than - // the previous block's timestamp + the minimum block period. - errInvalidTimestamp = errors.New("invalid timestamp") - // errInvalidVotingChain is returned if an authorization list is attempted to // be modified via out-of-range or non-contiguous headers. errInvalidVotingChain = errors.New("invalid voting chain") diff --git a/consensus/clique/snapshot.go b/consensus/clique/snapshot.go index 8e83dd8a7387..03f8577f0cc1 100644 --- a/consensus/clique/snapshot.go +++ b/consensus/clique/snapshot.go @@ -22,12 +22,12 @@ import ( "sort" "time" + lru "github.com/hashicorp/golang-lru" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/types" "github.com/scroll-tech/go-ethereum/ethdb" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/params" - lru "github.com/hashicorp/golang-lru" ) // Vote represents a single vote that an authorized signer made to modify the diff --git a/consensus/ethash/difficulty.go b/consensus/ethash/difficulty.go index 4ea4bd5c0b98..92f2cdf65cf0 100644 --- a/consensus/ethash/difficulty.go +++ b/consensus/ethash/difficulty.go @@ -19,8 +19,8 @@ package ethash import ( "math/big" - "github.com/scroll-tech/go-ethereum/core/types" "github.com/holiman/uint256" + "github.com/scroll-tech/go-ethereum/core/types" ) const ( diff --git a/consensus/ethash/ethash.go b/consensus/ethash/ethash.go index eedfa02867b9..f92c190c2850 100644 --- a/consensus/ethash/ethash.go +++ b/consensus/ethash/ethash.go @@ -34,11 +34,11 @@ import ( "unsafe" "github.com/edsrzf/mmap-go" + "github.com/hashicorp/golang-lru/simplelru" "github.com/scroll-tech/go-ethereum/consensus" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/metrics" "github.com/scroll-tech/go-ethereum/rpc" - "github.com/hashicorp/golang-lru/simplelru" ) var ErrInvalidDumpMagic = errors.New("invalid dump magic") diff --git a/console/console.go b/console/console.go index 78f19a52ec48..471b23b9d864 100644 --- a/console/console.go +++ b/console/console.go @@ -29,13 +29,13 @@ import ( "syscall" "github.com/dop251/goja" + "github.com/mattn/go-colorable" + "github.com/peterh/liner" "github.com/scroll-tech/go-ethereum/console/prompt" "github.com/scroll-tech/go-ethereum/internal/jsre" "github.com/scroll-tech/go-ethereum/internal/jsre/deps" "github.com/scroll-tech/go-ethereum/internal/web3ext" "github.com/scroll-tech/go-ethereum/rpc" - "github.com/mattn/go-colorable" - "github.com/peterh/liner" ) var ( diff --git a/core/blockchain.go b/core/blockchain.go index ba4a26e2cc32..38c37a432525 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -28,6 +28,7 @@ import ( "sync/atomic" "time" + lru "github.com/hashicorp/golang-lru" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/mclock" "github.com/scroll-tech/go-ethereum/common/prque" @@ -44,7 +45,6 @@ import ( "github.com/scroll-tech/go-ethereum/metrics" "github.com/scroll-tech/go-ethereum/params" "github.com/scroll-tech/go-ethereum/trie" - lru "github.com/hashicorp/golang-lru" ) var ( diff --git a/core/headerchain.go b/core/headerchain.go index 50dc9f3abda3..4a806d31c271 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -26,6 +26,7 @@ import ( "sync/atomic" "time" + lru "github.com/hashicorp/golang-lru" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/consensus" "github.com/scroll-tech/go-ethereum/core/rawdb" @@ -33,7 +34,6 @@ import ( "github.com/scroll-tech/go-ethereum/ethdb" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/params" - lru "github.com/hashicorp/golang-lru" ) const ( diff --git a/core/rawdb/database.go b/core/rawdb/database.go index 4a359e6acb17..217b14c2b828 100644 --- a/core/rawdb/database.go +++ b/core/rawdb/database.go @@ -24,12 +24,12 @@ import ( "sync/atomic" "time" + "github.com/olekukonko/tablewriter" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/ethdb" "github.com/scroll-tech/go-ethereum/ethdb/leveldb" "github.com/scroll-tech/go-ethereum/ethdb/memorydb" "github.com/scroll-tech/go-ethereum/log" - "github.com/olekukonko/tablewriter" ) // freezerdb is a database wrapper that enabled freezer data retrievals. diff --git a/core/rawdb/freezer.go b/core/rawdb/freezer.go index 617f87ca0384..cd22f8b78496 100644 --- a/core/rawdb/freezer.go +++ b/core/rawdb/freezer.go @@ -26,12 +26,12 @@ import ( "sync/atomic" "time" + "github.com/prometheus/tsdb/fileutil" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/ethdb" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/metrics" "github.com/scroll-tech/go-ethereum/params" - "github.com/prometheus/tsdb/fileutil" ) var ( diff --git a/core/rawdb/freezer_batch.go b/core/rawdb/freezer_batch.go index 21279a027819..2ba0c5e5020e 100644 --- a/core/rawdb/freezer_batch.go +++ b/core/rawdb/freezer_batch.go @@ -20,9 +20,9 @@ import ( "fmt" "sync/atomic" + "github.com/golang/snappy" "github.com/scroll-tech/go-ethereum/common/math" "github.com/scroll-tech/go-ethereum/rlp" - "github.com/golang/snappy" ) // This is the maximum amount of data that will be buffered in memory diff --git a/core/rawdb/freezer_table.go b/core/rawdb/freezer_table.go index 3f0136b1ce02..072c5873c3c6 100644 --- a/core/rawdb/freezer_table.go +++ b/core/rawdb/freezer_table.go @@ -27,10 +27,10 @@ import ( "sync" "sync/atomic" + "github.com/golang/snappy" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/metrics" - "github.com/golang/snappy" ) var ( diff --git a/core/state/database.go b/core/state/database.go index 82cf45de8ff1..56e41afbfd64 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -21,12 +21,12 @@ import ( "fmt" "github.com/VictoriaMetrics/fastcache" + lru "github.com/hashicorp/golang-lru" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/rawdb" "github.com/scroll-tech/go-ethereum/core/types" "github.com/scroll-tech/go-ethereum/ethdb" "github.com/scroll-tech/go-ethereum/trie" - lru "github.com/hashicorp/golang-lru" ) const ( diff --git a/core/state/pruner/bloom.go b/core/state/pruner/bloom.go index d76458eaad58..3afcfedc12cd 100644 --- a/core/state/pruner/bloom.go +++ b/core/state/pruner/bloom.go @@ -21,10 +21,10 @@ import ( "errors" "os" + bloomfilter "github.com/holiman/bloomfilter/v2" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/rawdb" "github.com/scroll-tech/go-ethereum/log" - bloomfilter "github.com/holiman/bloomfilter/v2" ) // stateBloomHasher is a wrapper around a byte blob to satisfy the interface API diff --git a/core/state/snapshot/difflayer.go b/core/state/snapshot/difflayer.go index 7ce3cbd9c73f..8cf472db3226 100644 --- a/core/state/snapshot/difflayer.go +++ b/core/state/snapshot/difflayer.go @@ -26,9 +26,9 @@ import ( "sync/atomic" "time" + bloomfilter "github.com/holiman/bloomfilter/v2" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/rlp" - bloomfilter "github.com/holiman/bloomfilter/v2" ) var ( diff --git a/core/vm/common.go b/core/vm/common.go index be40fa17d9a3..91a1e1eaedc7 100644 --- a/core/vm/common.go +++ b/core/vm/common.go @@ -17,9 +17,9 @@ package vm import ( + "github.com/holiman/uint256" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/math" - "github.com/holiman/uint256" ) // calcMemSize64 calculates the required memory size, and returns diff --git a/core/vm/contract.go b/core/vm/contract.go index 42edd3a4d94c..d465569a5171 100644 --- a/core/vm/contract.go +++ b/core/vm/contract.go @@ -19,8 +19,8 @@ package vm import ( "math/big" - "github.com/scroll-tech/go-ethereum/common" "github.com/holiman/uint256" + "github.com/scroll-tech/go-ethereum/common" ) // ContractRef is a reference to the contract's backing object diff --git a/core/vm/eips.go b/core/vm/eips.go index c1f5c641e7d6..b16ceb632fb2 100644 --- a/core/vm/eips.go +++ b/core/vm/eips.go @@ -20,8 +20,8 @@ import ( "fmt" "sort" - "github.com/scroll-tech/go-ethereum/params" "github.com/holiman/uint256" + "github.com/scroll-tech/go-ethereum/params" ) var activators = map[int]func(*JumpTable){ diff --git a/core/vm/evm.go b/core/vm/evm.go index a61e7f7b6497..12e6847f56a8 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -21,10 +21,10 @@ import ( "sync/atomic" "time" + "github.com/holiman/uint256" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/params" - "github.com/holiman/uint256" ) // emptyCodeHash is used by create to ensure deployment is disallowed to already diff --git a/core/vm/gen_structlog.go b/core/vm/gen_structlog.go index f5178f1c5aac..befc4584fe14 100644 --- a/core/vm/gen_structlog.go +++ b/core/vm/gen_structlog.go @@ -5,10 +5,10 @@ package vm import ( "encoding/json" + "github.com/holiman/uint256" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/hexutil" "github.com/scroll-tech/go-ethereum/common/math" - "github.com/holiman/uint256" ) var _ = (*structLogMarshaling)(nil) diff --git a/core/vm/instructions.go b/core/vm/instructions.go index baa42dc50648..5923e21c45f3 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -17,10 +17,10 @@ package vm import ( + "github.com/holiman/uint256" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/types" "github.com/scroll-tech/go-ethereum/params" - "github.com/holiman/uint256" "golang.org/x/crypto/sha3" ) diff --git a/core/vm/instructions_test.go b/core/vm/instructions_test.go index 3d8c1fd5f2f0..d38fa29b758b 100644 --- a/core/vm/instructions_test.go +++ b/core/vm/instructions_test.go @@ -23,10 +23,10 @@ import ( "io/ioutil" "testing" + "github.com/holiman/uint256" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/params" - "github.com/holiman/uint256" ) type TwoOperandTestcase struct { diff --git a/core/vm/logger.go b/core/vm/logger.go index 7ddc22027679..9e547fd29474 100644 --- a/core/vm/logger.go +++ b/core/vm/logger.go @@ -24,12 +24,12 @@ import ( "strings" "time" + "github.com/holiman/uint256" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/hexutil" "github.com/scroll-tech/go-ethereum/common/math" "github.com/scroll-tech/go-ethereum/core/types" "github.com/scroll-tech/go-ethereum/params" - "github.com/holiman/uint256" ) // Storage represents a contract's storage. diff --git a/core/vm/logger_test.go b/core/vm/logger_test.go index af66424bcb19..f9981560d8d3 100644 --- a/core/vm/logger_test.go +++ b/core/vm/logger_test.go @@ -20,10 +20,10 @@ import ( "math/big" "testing" + "github.com/holiman/uint256" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/state" "github.com/scroll-tech/go-ethereum/params" - "github.com/holiman/uint256" ) type dummyContractRef struct { diff --git a/crypto/secp256k1/libsecp256k1/contrib/dummy.go b/crypto/secp256k1/libsecp256k1/contrib/dummy.go index fda594be9914..2c946210c54d 100644 --- a/crypto/secp256k1/libsecp256k1/contrib/dummy.go +++ b/crypto/secp256k1/libsecp256k1/contrib/dummy.go @@ -1,3 +1,4 @@ +//go:build dummy // +build dummy // Package c contains only a C file. diff --git a/crypto/secp256k1/libsecp256k1/dummy.go b/crypto/secp256k1/libsecp256k1/dummy.go index 379b16992f47..04bbe3d76ecc 100644 --- a/crypto/secp256k1/libsecp256k1/dummy.go +++ b/crypto/secp256k1/libsecp256k1/dummy.go @@ -1,3 +1,4 @@ +//go:build dummy // +build dummy // Package c contains only a C file. diff --git a/crypto/secp256k1/libsecp256k1/include/dummy.go b/crypto/secp256k1/libsecp256k1/include/dummy.go index 5af540c73c4a..64c71b8451d8 100644 --- a/crypto/secp256k1/libsecp256k1/include/dummy.go +++ b/crypto/secp256k1/libsecp256k1/include/dummy.go @@ -1,3 +1,4 @@ +//go:build dummy // +build dummy // Package c contains only a C file. diff --git a/crypto/secp256k1/libsecp256k1/src/dummy.go b/crypto/secp256k1/libsecp256k1/src/dummy.go index 65868f38a8ea..2df270adc35e 100644 --- a/crypto/secp256k1/libsecp256k1/src/dummy.go +++ b/crypto/secp256k1/libsecp256k1/src/dummy.go @@ -1,3 +1,4 @@ +//go:build dummy // +build dummy // Package c contains only a C file. diff --git a/crypto/secp256k1/libsecp256k1/src/modules/dummy.go b/crypto/secp256k1/libsecp256k1/src/modules/dummy.go index 3c7a696439f0..99c538db51b0 100644 --- a/crypto/secp256k1/libsecp256k1/src/modules/dummy.go +++ b/crypto/secp256k1/libsecp256k1/src/modules/dummy.go @@ -1,3 +1,4 @@ +//go:build dummy // +build dummy // Package c contains only a C file. diff --git a/crypto/secp256k1/libsecp256k1/src/modules/ecdh/dummy.go b/crypto/secp256k1/libsecp256k1/src/modules/ecdh/dummy.go index b6fc38327ec8..48c2e0aa5453 100644 --- a/crypto/secp256k1/libsecp256k1/src/modules/ecdh/dummy.go +++ b/crypto/secp256k1/libsecp256k1/src/modules/ecdh/dummy.go @@ -1,3 +1,4 @@ +//go:build dummy // +build dummy // Package c contains only a C file. diff --git a/crypto/secp256k1/libsecp256k1/src/modules/recovery/dummy.go b/crypto/secp256k1/libsecp256k1/src/modules/recovery/dummy.go index b9491f0cb9f4..8efbd7abe71b 100644 --- a/crypto/secp256k1/libsecp256k1/src/modules/recovery/dummy.go +++ b/crypto/secp256k1/libsecp256k1/src/modules/recovery/dummy.go @@ -1,3 +1,4 @@ +//go:build dummy // +build dummy // Package c contains only a C file. diff --git a/eth/gasprice/gasprice.go b/eth/gasprice/gasprice.go index 9fbfef0b5d04..48e2d5ef92ba 100644 --- a/eth/gasprice/gasprice.go +++ b/eth/gasprice/gasprice.go @@ -22,6 +22,7 @@ import ( "sort" "sync" + lru "github.com/hashicorp/golang-lru" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core" "github.com/scroll-tech/go-ethereum/core/types" @@ -29,7 +30,6 @@ import ( "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/params" "github.com/scroll-tech/go-ethereum/rpc" - lru "github.com/hashicorp/golang-lru" ) const sampleNumber = 3 // Number of transactions sampled in a block diff --git a/eth/protocols/snap/range.go b/eth/protocols/snap/range.go index 815c2081d36d..a08cb02f3d2e 100644 --- a/eth/protocols/snap/range.go +++ b/eth/protocols/snap/range.go @@ -19,8 +19,8 @@ package snap import ( "math/big" - "github.com/scroll-tech/go-ethereum/common" "github.com/holiman/uint256" + "github.com/scroll-tech/go-ethereum/common" ) // hashRange is a utility to handle ranges of hashes, Split up the diff --git a/ethstats/ethstats.go b/ethstats/ethstats.go index f8328f4aa47d..f5a26457d518 100644 --- a/ethstats/ethstats.go +++ b/ethstats/ethstats.go @@ -30,6 +30,7 @@ import ( "sync" "time" + "github.com/gorilla/websocket" "github.com/scroll-tech/go-ethereum" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/mclock" @@ -44,7 +45,6 @@ import ( "github.com/scroll-tech/go-ethereum/node" "github.com/scroll-tech/go-ethereum/p2p" "github.com/scroll-tech/go-ethereum/rpc" - "github.com/gorilla/websocket" ) const ( diff --git a/graphql/service.go b/graphql/service.go index 1a2dbcec4bd8..0387ec961532 100644 --- a/graphql/service.go +++ b/graphql/service.go @@ -20,9 +20,9 @@ import ( "encoding/json" "net/http" + "github.com/graph-gophers/graphql-go" "github.com/scroll-tech/go-ethereum/internal/ethapi" "github.com/scroll-tech/go-ethereum/node" - "github.com/graph-gophers/graphql-go" ) type handler struct { diff --git a/internal/debug/api.go b/internal/debug/api.go index b315159ba6eb..1f663d428a2d 100644 --- a/internal/debug/api.go +++ b/internal/debug/api.go @@ -35,8 +35,8 @@ import ( "sync" "time" - "github.com/scroll-tech/go-ethereum/log" "github.com/hashicorp/go-bexpr" + "github.com/scroll-tech/go-ethereum/log" ) // Handler is the global debugging handler. diff --git a/internal/debug/flags.go b/internal/debug/flags.go index 04cb4cf1189a..bdfbf97ee889 100644 --- a/internal/debug/flags.go +++ b/internal/debug/flags.go @@ -24,12 +24,12 @@ import ( "os" "runtime" - "github.com/scroll-tech/go-ethereum/log" - "github.com/scroll-tech/go-ethereum/metrics" - "github.com/scroll-tech/go-ethereum/metrics/exp" "github.com/fjl/memsize/memsizeui" "github.com/mattn/go-colorable" "github.com/mattn/go-isatty" + "github.com/scroll-tech/go-ethereum/log" + "github.com/scroll-tech/go-ethereum/metrics" + "github.com/scroll-tech/go-ethereum/metrics/exp" "gopkg.in/urfave/cli.v1" ) diff --git a/les/api_test.go b/les/api_test.go index daa288b3025a..88d023df3d33 100644 --- a/les/api_test.go +++ b/les/api_test.go @@ -28,6 +28,7 @@ import ( "testing" "time" + "github.com/mattn/go-colorable" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/hexutil" "github.com/scroll-tech/go-ethereum/consensus/ethash" @@ -42,7 +43,6 @@ import ( "github.com/scroll-tech/go-ethereum/p2p/simulations" "github.com/scroll-tech/go-ethereum/p2p/simulations/adapters" "github.com/scroll-tech/go-ethereum/rpc" - "github.com/mattn/go-colorable" ) // Additional command line flags for the test binary. diff --git a/les/vflux/server/clientdb.go b/les/vflux/server/clientdb.go index b6ee61352bf7..d9d5c4e00aea 100644 --- a/les/vflux/server/clientdb.go +++ b/les/vflux/server/clientdb.go @@ -21,6 +21,7 @@ import ( "encoding/binary" "time" + lru "github.com/hashicorp/golang-lru" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/mclock" "github.com/scroll-tech/go-ethereum/ethdb" @@ -28,7 +29,6 @@ import ( "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/p2p/enode" "github.com/scroll-tech/go-ethereum/rlp" - lru "github.com/hashicorp/golang-lru" ) const ( diff --git a/light/lightchain.go b/light/lightchain.go index 4041d5992338..0b8636f49945 100644 --- a/light/lightchain.go +++ b/light/lightchain.go @@ -26,6 +26,7 @@ import ( "sync/atomic" "time" + lru "github.com/hashicorp/golang-lru" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/consensus" "github.com/scroll-tech/go-ethereum/core" @@ -37,7 +38,6 @@ import ( "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/params" "github.com/scroll-tech/go-ethereum/rlp" - lru "github.com/hashicorp/golang-lru" ) var ( diff --git a/metrics/influxdb/influxdb.go b/metrics/influxdb/influxdb.go index 66802fdc92d1..2f67cd481616 100644 --- a/metrics/influxdb/influxdb.go +++ b/metrics/influxdb/influxdb.go @@ -5,9 +5,9 @@ import ( uurl "net/url" "time" + "github.com/influxdata/influxdb/client" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/metrics" - "github.com/influxdata/influxdb/client" ) type reporter struct { diff --git a/metrics/influxdb/influxdbv2.go b/metrics/influxdb/influxdbv2.go index 834ba7e8dff5..97c9f9523b3c 100644 --- a/metrics/influxdb/influxdbv2.go +++ b/metrics/influxdb/influxdbv2.go @@ -13,10 +13,10 @@ import ( "fmt" "time" - "github.com/scroll-tech/go-ethereum/log" - "github.com/scroll-tech/go-ethereum/metrics" influxdb2 "github.com/influxdata/influxdb-client-go/v2" "github.com/influxdata/influxdb-client-go/v2/api" + "github.com/scroll-tech/go-ethereum/log" + "github.com/scroll-tech/go-ethereum/metrics" ) type v2Reporter struct { diff --git a/miner/worker.go b/miner/worker.go index 611000e226b7..8a3cdc3905e5 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -394,9 +394,9 @@ func (w *worker) newWorkLoop(recommit time.Duration) { commit(false, commitInterruptNewHead) /*case head := <-w.chainHeadCh: - clearPending(head.Block.NumberU64()) - timestamp = time.Now().Unix() - commit(false, commitInterruptNewHead)*/ + clearPending(head.Block.NumberU64()) + timestamp = time.Now().Unix() + commit(false, commitInterruptNewHead)*/ case <-timer.C: // If mining is running resubmit a new work cycle periodically to pull in diff --git a/node/node.go b/node/node.go index 3cad98fd5396..ad4fdb863224 100644 --- a/node/node.go +++ b/node/node.go @@ -26,6 +26,7 @@ import ( "strings" "sync" + "github.com/prometheus/tsdb/fileutil" "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/core/rawdb" "github.com/scroll-tech/go-ethereum/ethdb" @@ -33,7 +34,6 @@ import ( "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/p2p" "github.com/scroll-tech/go-ethereum/rpc" - "github.com/prometheus/tsdb/fileutil" ) // Node is a container on which services can be registered. diff --git a/node/rpcstack.go b/node/rpcstack.go index 3a1bfe549e3f..6f5bc1e001cb 100644 --- a/node/rpcstack.go +++ b/node/rpcstack.go @@ -29,9 +29,9 @@ import ( "sync" "sync/atomic" + "github.com/rs/cors" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/rpc" - "github.com/rs/cors" ) // httpConfig is the JSON-RPC/HTTP configuration. diff --git a/node/rpcstack_test.go b/node/rpcstack_test.go index 8134b9bc179f..33023fcddaea 100644 --- a/node/rpcstack_test.go +++ b/node/rpcstack_test.go @@ -25,10 +25,10 @@ import ( "strings" "testing" + "github.com/gorilla/websocket" "github.com/scroll-tech/go-ethereum/internal/testlog" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/rpc" - "github.com/gorilla/websocket" "github.com/stretchr/testify/assert" ) diff --git a/p2p/discover/v5wire/session.go b/p2p/discover/v5wire/session.go index 37d666adde93..eb871a7247a9 100644 --- a/p2p/discover/v5wire/session.go +++ b/p2p/discover/v5wire/session.go @@ -22,10 +22,10 @@ import ( "encoding/binary" "time" + "github.com/hashicorp/golang-lru/simplelru" "github.com/scroll-tech/go-ethereum/common/mclock" "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/p2p/enode" - "github.com/hashicorp/golang-lru/simplelru" ) const handshakeTimeout = time.Second diff --git a/p2p/dnsdisc/client.go b/p2p/dnsdisc/client.go index a95a6f7385c2..f5a31d4a75fc 100644 --- a/p2p/dnsdisc/client.go +++ b/p2p/dnsdisc/client.go @@ -26,12 +26,12 @@ import ( "sync" "time" + lru "github.com/hashicorp/golang-lru" "github.com/scroll-tech/go-ethereum/common/mclock" "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/p2p/enode" "github.com/scroll-tech/go-ethereum/p2p/enr" - lru "github.com/hashicorp/golang-lru" "golang.org/x/sync/singleflight" "golang.org/x/time/rate" ) diff --git a/p2p/nat/nat.go b/p2p/nat/nat.go index dd4a01657eb9..a4bf8339ec72 100644 --- a/p2p/nat/nat.go +++ b/p2p/nat/nat.go @@ -25,8 +25,8 @@ import ( "sync" "time" - "github.com/scroll-tech/go-ethereum/log" natpmp "github.com/jackpal/go-nat-pmp" + "github.com/scroll-tech/go-ethereum/log" ) // An implementation of nat.Interface can map local ports to ports diff --git a/p2p/rlpx/rlpx.go b/p2p/rlpx/rlpx.go index e2651b968b00..8476db05b061 100644 --- a/p2p/rlpx/rlpx.go +++ b/p2p/rlpx/rlpx.go @@ -34,10 +34,10 @@ import ( "net" "time" + "github.com/golang/snappy" "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/crypto/ecies" "github.com/scroll-tech/go-ethereum/rlp" - "github.com/golang/snappy" "golang.org/x/crypto/sha3" ) diff --git a/p2p/simulations/adapters/exec.go b/p2p/simulations/adapters/exec.go index 2cdd99e4c763..cfbc11c79eb4 100644 --- a/p2p/simulations/adapters/exec.go +++ b/p2p/simulations/adapters/exec.go @@ -35,12 +35,12 @@ import ( "time" "github.com/docker/docker/pkg/reexec" + "github.com/gorilla/websocket" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/node" "github.com/scroll-tech/go-ethereum/p2p" "github.com/scroll-tech/go-ethereum/p2p/enode" "github.com/scroll-tech/go-ethereum/rpc" - "github.com/gorilla/websocket" ) func init() { diff --git a/p2p/simulations/adapters/inproc.go b/p2p/simulations/adapters/inproc.go index 6788c4ec067a..9172025c2184 100644 --- a/p2p/simulations/adapters/inproc.go +++ b/p2p/simulations/adapters/inproc.go @@ -24,6 +24,7 @@ import ( "net" "sync" + "github.com/gorilla/websocket" "github.com/scroll-tech/go-ethereum/event" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/node" @@ -31,7 +32,6 @@ import ( "github.com/scroll-tech/go-ethereum/p2p/enode" "github.com/scroll-tech/go-ethereum/p2p/simulations/pipes" "github.com/scroll-tech/go-ethereum/rpc" - "github.com/gorilla/websocket" ) // SimAdapter is a NodeAdapter which creates in-memory simulation nodes and diff --git a/p2p/simulations/adapters/types.go b/p2p/simulations/adapters/types.go index c0f4893316ac..c6f30f3365c9 100644 --- a/p2p/simulations/adapters/types.go +++ b/p2p/simulations/adapters/types.go @@ -26,6 +26,7 @@ import ( "strconv" "github.com/docker/docker/pkg/reexec" + "github.com/gorilla/websocket" "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/node" @@ -33,7 +34,6 @@ import ( "github.com/scroll-tech/go-ethereum/p2p/enode" "github.com/scroll-tech/go-ethereum/p2p/enr" "github.com/scroll-tech/go-ethereum/rpc" - "github.com/gorilla/websocket" ) // Node represents a node in a simulation network which is created by a diff --git a/p2p/simulations/http.go b/p2p/simulations/http.go index 10e4e61dda3b..135440b85e22 100644 --- a/p2p/simulations/http.go +++ b/p2p/simulations/http.go @@ -29,13 +29,13 @@ import ( "strings" "sync" + "github.com/gorilla/websocket" + "github.com/julienschmidt/httprouter" "github.com/scroll-tech/go-ethereum/event" "github.com/scroll-tech/go-ethereum/p2p" "github.com/scroll-tech/go-ethereum/p2p/enode" "github.com/scroll-tech/go-ethereum/p2p/simulations/adapters" "github.com/scroll-tech/go-ethereum/rpc" - "github.com/gorilla/websocket" - "github.com/julienschmidt/httprouter" ) // DefaultClient is the default simulation API client which expects the API diff --git a/p2p/simulations/http_test.go b/p2p/simulations/http_test.go index d9729be0955d..0c2edc49f8ed 100644 --- a/p2p/simulations/http_test.go +++ b/p2p/simulations/http_test.go @@ -29,6 +29,7 @@ import ( "testing" "time" + "github.com/mattn/go-colorable" "github.com/scroll-tech/go-ethereum/event" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/node" @@ -36,7 +37,6 @@ import ( "github.com/scroll-tech/go-ethereum/p2p/enode" "github.com/scroll-tech/go-ethereum/p2p/simulations/adapters" "github.com/scroll-tech/go-ethereum/rpc" - "github.com/mattn/go-colorable" ) func TestMain(m *testing.M) { diff --git a/rpc/websocket.go b/rpc/websocket.go index 249620ad6f47..ab9f29cb829f 100644 --- a/rpc/websocket.go +++ b/rpc/websocket.go @@ -28,8 +28,8 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/scroll-tech/go-ethereum/log" "github.com/gorilla/websocket" + "github.com/scroll-tech/go-ethereum/log" ) const ( diff --git a/signer/storage/aes_gcm_storage_test.go b/signer/storage/aes_gcm_storage_test.go index 24c1cba6bbaf..a72847abec98 100644 --- a/signer/storage/aes_gcm_storage_test.go +++ b/signer/storage/aes_gcm_storage_test.go @@ -23,9 +23,9 @@ import ( "io/ioutil" "testing" + "github.com/mattn/go-colorable" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/log" - "github.com/mattn/go-colorable" ) func TestEncryption(t *testing.T) { diff --git a/tests/fuzzers/abi/abifuzzer.go b/tests/fuzzers/abi/abifuzzer.go index 1288ada4ad67..306eb5147404 100644 --- a/tests/fuzzers/abi/abifuzzer.go +++ b/tests/fuzzers/abi/abifuzzer.go @@ -21,8 +21,8 @@ import ( "reflect" "strings" - "github.com/scroll-tech/go-ethereum/accounts/abi" fuzz "github.com/google/gofuzz" + "github.com/scroll-tech/go-ethereum/accounts/abi" ) var ( diff --git a/tests/fuzzers/bn256/bn256_fuzz.go b/tests/fuzzers/bn256/bn256_fuzz.go index 06c9fd5ff849..37ccdcf19a2b 100644 --- a/tests/fuzzers/bn256/bn256_fuzz.go +++ b/tests/fuzzers/bn256/bn256_fuzz.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file. +//go:build gofuzz // +build gofuzz package bn256 diff --git a/tests/fuzzers/secp256k1/secp_fuzzer.go b/tests/fuzzers/secp256k1/secp_fuzzer.go index a8f269936bd7..345406a8b01d 100644 --- a/tests/fuzzers/secp256k1/secp_fuzzer.go +++ b/tests/fuzzers/secp256k1/secp_fuzzer.go @@ -22,8 +22,8 @@ import ( "fmt" "github.com/btcsuite/btcd/btcec" - "github.com/scroll-tech/go-ethereum/crypto/secp256k1" fuzz "github.com/google/gofuzz" + "github.com/scroll-tech/go-ethereum/crypto/secp256k1" ) func Fuzz(input []byte) int { diff --git a/trie/sync_bloom.go b/trie/sync_bloom.go index 6d47f757dbcb..d56a428bc7fa 100644 --- a/trie/sync_bloom.go +++ b/trie/sync_bloom.go @@ -23,12 +23,12 @@ import ( "sync/atomic" "time" + bloomfilter "github.com/holiman/bloomfilter/v2" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/rawdb" "github.com/scroll-tech/go-ethereum/ethdb" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/metrics" - bloomfilter "github.com/holiman/bloomfilter/v2" ) var (