From b6cc89fabe893bc9fdbd68ad3764432ae1bcd09a Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 24 Mar 2022 16:53:59 +0800 Subject: [PATCH] Add `goimports` lint (#54) * Add `goimports` lint. * Fix `goimports` issue. * Fix group to `github.com/scroll-tech/go-thereum`. --- .github/workflows/l2geth_ci.yml | 23 ++++++++++++++++++++++- accounts/abi/bind/base_test.go | 3 ++- accounts/abi/event_test.go | 5 +++-- accounts/abi/type_test.go | 1 + accounts/abi/unpack_test.go | 3 ++- accounts/accounts.go | 3 ++- accounts/keystore/account_cache.go | 1 + accounts/keystore/account_cache_test.go | 1 + accounts/keystore/file_cache.go | 1 + accounts/keystore/key.go | 1 + accounts/keystore/passphrase.go | 5 +++-- accounts/keystore/presale.go | 3 ++- accounts/keystore/watch.go | 1 + accounts/scwallet/hub.go | 1 + accounts/scwallet/securechannel.go | 3 ++- accounts/scwallet/wallet.go | 3 ++- accounts/usbwallet/hub.go | 1 + accounts/usbwallet/trezor.go | 1 + accounts/usbwallet/wallet.go | 1 + build/ci.go | 1 + cmd/abigen/main.go | 3 ++- cmd/checkpoint-admin/common.go | 3 ++- cmd/checkpoint-admin/exec.go | 3 ++- cmd/checkpoint-admin/main.go | 3 ++- cmd/checkpoint-admin/status.go | 3 ++- cmd/clef/main.go | 3 ++- cmd/devp2p/discv4cmd.go | 3 ++- cmd/devp2p/discv5cmd.go | 3 ++- cmd/devp2p/dns_cloudflare.go | 3 ++- cmd/devp2p/dns_route53.go | 3 ++- cmd/devp2p/dnscmd.go | 3 ++- cmd/devp2p/enrcmd.go | 3 ++- cmd/devp2p/internal/ethtest/chain_test.go | 3 ++- cmd/devp2p/internal/ethtest/helpers.go | 1 + cmd/devp2p/keycmd.go | 3 ++- cmd/devp2p/main.go | 3 ++- cmd/devp2p/nodesetcmd.go | 3 ++- cmd/devp2p/rlpxcmd.go | 3 ++- cmd/devp2p/runtest.go | 3 ++- cmd/ethkey/changepassword.go | 3 ++- cmd/ethkey/generate.go | 3 ++- cmd/ethkey/inspect.go | 3 ++- cmd/ethkey/main.go | 3 ++- cmd/ethkey/message.go | 3 ++- cmd/ethkey/run_test.go | 1 + cmd/ethkey/utils.go | 3 ++- cmd/evm/disasm.go | 3 ++- cmd/evm/internal/t8ntool/block.go | 3 ++- cmd/evm/internal/t8ntool/execution.go | 3 ++- cmd/evm/internal/t8ntool/flags.go | 3 ++- cmd/evm/internal/t8ntool/transaction.go | 3 ++- cmd/evm/internal/t8ntool/transition.go | 3 ++- cmd/evm/main.go | 3 ++- cmd/evm/runner.go | 3 ++- cmd/evm/t8n_test.go | 1 + cmd/faucet/faucet.go | 1 + cmd/geth/accountcmd.go | 3 ++- cmd/geth/chaincmd.go | 3 ++- cmd/geth/config.go | 2 +- cmd/geth/consolecmd.go | 3 ++- cmd/geth/dbcmd.go | 3 ++- cmd/geth/misccmd.go | 3 ++- cmd/geth/run_test.go | 1 + cmd/geth/snapshot.go | 3 ++- cmd/geth/usage.go | 3 ++- cmd/geth/version_check.go | 3 ++- cmd/p2psim/main.go | 3 ++- cmd/puppeth/genesis_test.go | 1 + cmd/puppeth/puppeth.go | 3 ++- cmd/puppeth/ssh.go | 3 ++- cmd/puppeth/wizard.go | 3 ++- cmd/puppeth/wizard_netstats.go | 1 + cmd/utils/cmd.go | 3 ++- cmd/utils/customflags.go | 3 ++- cmd/utils/flags.go | 5 +++-- cmd/utils/flags_legacy.go | 3 ++- common/types.go | 3 ++- consensus/clique/clique.go | 3 ++- consensus/clique/snapshot.go | 1 + consensus/ethash/algorithm.go | 3 ++- consensus/ethash/consensus.go | 3 ++- consensus/ethash/difficulty.go | 1 + consensus/ethash/ethash.go | 1 + console/bridge.go | 1 + console/bridge_test.go | 1 + console/console.go | 1 + core/blockchain.go | 1 + core/genesis_test.go | 1 + core/headerchain.go | 1 + core/rawdb/accessors_chain_test.go | 3 ++- core/rawdb/accessors_indexes_test.go | 3 ++- core/rawdb/database.go | 1 + core/rawdb/freezer.go | 1 + core/rawdb/freezer_batch.go | 1 + core/rawdb/freezer_table.go | 1 + core/rawdb/freezer_table_test.go | 3 ++- core/rawdb/freezer_test.go | 3 ++- core/rlp_test.go | 3 ++- core/state/database.go | 1 + core/state/pruner/bloom.go | 1 + core/state/snapshot/difflayer.go | 1 + core/state/snapshot/difflayer_test.go | 1 + core/state/snapshot/disklayer.go | 1 + core/state/snapshot/disklayer_test.go | 1 + core/state/snapshot/generate.go | 1 + core/state/snapshot/generate_test.go | 3 ++- core/state/snapshot/iterator_test.go | 1 + core/state/snapshot/journal.go | 1 + core/state/snapshot/snapshot_test.go | 1 + core/state_processor_test.go | 3 ++- core/types/block_test.go | 3 ++- core/types/hashing.go | 3 ++- core/types/log_test.go | 1 + core/vm/common.go | 1 + core/vm/contract.go | 1 + core/vm/eips.go | 1 + core/vm/evm.go | 1 + core/vm/gen_structlog.go | 1 + core/vm/instructions.go | 3 ++- core/vm/instructions_test.go | 1 + core/vm/logger.go | 1 + crypto/crypto.go | 3 ++- crypto/signature_cgo.go | 4 ++-- eth/api_test.go | 1 + eth/downloader/statesync.go | 3 ++- eth/fetcher/tx_fetcher.go | 1 + eth/gasprice/gasprice.go | 1 + eth/protocols/eth/peer.go | 1 + eth/protocols/snap/range.go | 1 + eth/protocols/snap/sync.go | 3 ++- eth/protocols/snap/sync_test.go | 3 ++- eth/tracers/js/tracer.go | 3 ++- ethdb/leveldb/leveldb.go | 9 +++++---- ethdb/leveldb/leveldb_test.go | 5 +++-- ethstats/ethstats.go | 1 + graphql/service.go | 1 + internal/cmdtest/test_cmd.go | 1 + internal/debug/api.go | 1 + internal/debug/flags.go | 3 ++- internal/ethapi/api.go | 3 ++- internal/flags/helpers.go | 3 ++- internal/jsre/jsre.go | 1 + les/api_test.go | 1 + les/downloader/statesync.go | 3 ++- les/vflux/server/clientdb.go | 1 + light/lightchain.go | 1 + light/postprocess.go | 1 + light/trie_test.go | 1 + metrics/cpu_enabled.go | 3 ++- metrics/influxdb/influxdb.go | 1 + metrics/influxdb/influxdbv2.go | 1 + miner/worker.go | 1 + node/api_test.go | 3 ++- node/node.go | 1 + node/rpcstack.go | 1 + node/rpcstack_test.go | 3 ++- p2p/discover/v4wire/v4wire_test.go | 1 + p2p/discover/v5wire/crypto.go | 3 ++- p2p/discover/v5wire/encoding_test.go | 1 + p2p/discover/v5wire/session.go | 1 + p2p/dnsdisc/client.go | 5 +++-- p2p/dnsdisc/client_test.go | 1 + p2p/dnsdisc/tree.go | 3 ++- p2p/dnsdisc/tree_test.go | 1 + p2p/enode/idscheme.go | 3 ++- p2p/enode/idscheme_test.go | 5 +++-- p2p/enode/localnode_test.go | 3 ++- p2p/enode/node_test.go | 3 ++- p2p/enode/nodedb.go | 3 ++- p2p/enr/enr_test.go | 3 ++- p2p/nat/nat.go | 1 + p2p/rlpx/buffer_test.go | 3 ++- p2p/rlpx/rlpx.go | 3 ++- p2p/rlpx/rlpx_test.go | 3 ++- p2p/simulations/adapters/exec.go | 1 + p2p/simulations/adapters/inproc.go | 1 + p2p/simulations/adapters/types.go | 1 + p2p/simulations/http.go | 1 + p2p/simulations/http_test.go | 1 + p2p/transport_test.go | 1 + params/config.go | 3 ++- rpc/client_test.go | 1 + rpc/server.go | 1 + rpc/websocket.go | 1 + signer/rules/rules.go | 1 + signer/storage/aes_gcm_storage_test.go | 1 + tests/fuzzers/abi/abifuzzer.go | 1 + tests/fuzzers/bls12381/bls12381_fuzz.go | 1 + tests/fuzzers/bn256/bn256_fuzz.go | 1 + tests/fuzzers/stacktrie/trie_fuzzer.go | 3 ++- tests/state_test_util.go | 3 ++- trie/committer.go | 3 ++- trie/database.go | 1 + trie/hasher.go | 3 ++- trie/sync_bloom.go | 1 + trie/trie_test.go | 3 ++- 196 files changed, 329 insertions(+), 115 deletions(-) diff --git a/.github/workflows/l2geth_ci.yml b/.github/workflows/l2geth_ci.yml index d9771d04d6..31b1ee79e1 100644 --- a/.github/workflows/l2geth_ci.yml +++ b/.github/workflows/l2geth_ci.yml @@ -12,7 +12,7 @@ jobs: uses: actions/checkout@v2 - name: Lint run: | - rm -rf $HOME/.cache/golangci-lint + rm -rf $HOME/.cache/golangci-lint make lint - name: Test run: | @@ -20,3 +20,24 @@ jobs: make test - name: Upload coverage report run: bash <(curl -s https://codecov.io/bash) + goimports-lint: + runs-on: ubuntu-latest + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: 1.17.x + - name: Install goimports + run: go get golang.org/x/tools/cmd/goimports + - name: Checkout code + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.ref }} + - run: goimports -local github.com/scroll-tech/go-ethereum/ -w . + - run: go mod tidy + # If there are any diffs from goimports or go mod tidy, fail. + - name: Verify no changes from goimports and go mod tidy + run: | + if [ -n "$(git status --porcelain)" ]; then + exit 1 + fi diff --git a/accounts/abi/bind/base_test.go b/accounts/abi/bind/base_test.go index d3aaa516c7..af1afd5623 100644 --- a/accounts/abi/bind/base_test.go +++ b/accounts/abi/bind/base_test.go @@ -23,6 +23,8 @@ import ( "strings" "testing" + "github.com/stretchr/testify/assert" + "github.com/scroll-tech/go-ethereum" "github.com/scroll-tech/go-ethereum/accounts/abi" "github.com/scroll-tech/go-ethereum/accounts/abi/bind" @@ -31,7 +33,6 @@ import ( "github.com/scroll-tech/go-ethereum/core/types" "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/rlp" - "github.com/stretchr/testify/assert" ) func mockSign(addr common.Address, tx *types.Transaction) (*types.Transaction, error) { return tx, nil } diff --git a/accounts/abi/event_test.go b/accounts/abi/event_test.go index 81d25eb401..c3c0d83f49 100644 --- a/accounts/abi/event_test.go +++ b/accounts/abi/event_test.go @@ -25,10 +25,11 @@ import ( "strings" "testing" - "github.com/scroll-tech/go-ethereum/common" - "github.com/scroll-tech/go-ethereum/crypto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/scroll-tech/go-ethereum/common" + "github.com/scroll-tech/go-ethereum/crypto" ) var jsonEventTransfer = []byte(`{ diff --git a/accounts/abi/type_test.go b/accounts/abi/type_test.go index f20fd385f4..32f5122bae 100644 --- a/accounts/abi/type_test.go +++ b/accounts/abi/type_test.go @@ -22,6 +22,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/scroll-tech/go-ethereum/common" ) diff --git a/accounts/abi/unpack_test.go b/accounts/abi/unpack_test.go index 813af0f11e..3f4be23b22 100644 --- a/accounts/abi/unpack_test.go +++ b/accounts/abi/unpack_test.go @@ -26,8 +26,9 @@ import ( "strings" "testing" - "github.com/scroll-tech/go-ethereum/common" "github.com/stretchr/testify/require" + + "github.com/scroll-tech/go-ethereum/common" ) // TestUnpack tests the general pack/unpack tests in packing_test.go diff --git a/accounts/accounts.go b/accounts/accounts.go index 46855487c5..bfc9f9d2d9 100644 --- a/accounts/accounts.go +++ b/accounts/accounts.go @@ -21,11 +21,12 @@ import ( "fmt" "math/big" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/types" "github.com/scroll-tech/go-ethereum/event" - "golang.org/x/crypto/sha3" ) // Account represents an Ethereum account located at a specific location defined diff --git a/accounts/keystore/account_cache.go b/accounts/keystore/account_cache.go index cf0c1faca2..b686f966e4 100644 --- a/accounts/keystore/account_cache.go +++ b/accounts/keystore/account_cache.go @@ -28,6 +28,7 @@ import ( "time" mapset "github.com/deckarep/golang-set" + "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/log" diff --git a/accounts/keystore/account_cache_test.go b/accounts/keystore/account_cache_test.go index 49d25a7efe..f486ec2b5a 100644 --- a/accounts/keystore/account_cache_test.go +++ b/accounts/keystore/account_cache_test.go @@ -29,6 +29,7 @@ import ( "github.com/cespare/cp" "github.com/davecgh/go-spew/spew" + "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/common" ) diff --git a/accounts/keystore/file_cache.go b/accounts/keystore/file_cache.go index b4da358fd4..545868dbff 100644 --- a/accounts/keystore/file_cache.go +++ b/accounts/keystore/file_cache.go @@ -25,6 +25,7 @@ import ( "time" mapset "github.com/deckarep/golang-set" + "github.com/scroll-tech/go-ethereum/log" ) diff --git a/accounts/keystore/key.go b/accounts/keystore/key.go index e495b88ace..60a4b6a573 100644 --- a/accounts/keystore/key.go +++ b/accounts/keystore/key.go @@ -30,6 +30,7 @@ import ( "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" diff --git a/accounts/keystore/passphrase.go b/accounts/keystore/passphrase.go index f58e8f4ef1..1559e7ae1d 100644 --- a/accounts/keystore/passphrase.go +++ b/accounts/keystore/passphrase.go @@ -39,12 +39,13 @@ import ( "path/filepath" "github.com/google/uuid" + "golang.org/x/crypto/pbkdf2" + "golang.org/x/crypto/scrypt" + "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" - "golang.org/x/crypto/pbkdf2" - "golang.org/x/crypto/scrypt" ) const ( diff --git a/accounts/keystore/presale.go b/accounts/keystore/presale.go index ed5e930d8f..d8d7a86597 100644 --- a/accounts/keystore/presale.go +++ b/accounts/keystore/presale.go @@ -26,9 +26,10 @@ import ( "fmt" "github.com/google/uuid" + "golang.org/x/crypto/pbkdf2" + "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/crypto" - "golang.org/x/crypto/pbkdf2" ) // creates a Key and stores that in the given KeyStore by decrypting a presale key JSON diff --git a/accounts/keystore/watch.go b/accounts/keystore/watch.go index 66e2ab8233..2277cde09c 100644 --- a/accounts/keystore/watch.go +++ b/accounts/keystore/watch.go @@ -23,6 +23,7 @@ import ( "time" "github.com/rjeczalik/notify" + "github.com/scroll-tech/go-ethereum/log" ) diff --git a/accounts/scwallet/hub.go b/accounts/scwallet/hub.go index bcae67f469..e8f89e9a42 100644 --- a/accounts/scwallet/hub.go +++ b/accounts/scwallet/hub.go @@ -42,6 +42,7 @@ import ( "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" diff --git a/accounts/scwallet/securechannel.go b/accounts/scwallet/securechannel.go index eeb06b1900..fa99034552 100644 --- a/accounts/scwallet/securechannel.go +++ b/accounts/scwallet/securechannel.go @@ -27,9 +27,10 @@ import ( "fmt" pcsc "github.com/gballet/go-libpcsclite" - "github.com/scroll-tech/go-ethereum/crypto" "golang.org/x/crypto/pbkdf2" "golang.org/x/text/unicode/norm" + + "github.com/scroll-tech/go-ethereum/crypto" ) const ( diff --git a/accounts/scwallet/wallet.go b/accounts/scwallet/wallet.go index ad0c47f41c..01b8bb019f 100644 --- a/accounts/scwallet/wallet.go +++ b/accounts/scwallet/wallet.go @@ -34,13 +34,14 @@ import ( "time" pcsc "github.com/gballet/go-libpcsclite" + "github.com/status-im/keycard-go/derivationpath" + "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/status-im/keycard-go/derivationpath" ) // ErrPairingPasswordNeeded is returned if opening the smart card requires pairing with a pairing diff --git a/accounts/usbwallet/hub.go b/accounts/usbwallet/hub.go index eb61c91eaf..ed1e4f6ef5 100644 --- a/accounts/usbwallet/hub.go +++ b/accounts/usbwallet/hub.go @@ -24,6 +24,7 @@ import ( "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" diff --git a/accounts/usbwallet/trezor.go b/accounts/usbwallet/trezor.go index 62352d2304..28fc9f352c 100644 --- a/accounts/usbwallet/trezor.go +++ b/accounts/usbwallet/trezor.go @@ -28,6 +28,7 @@ import ( "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" diff --git a/accounts/usbwallet/wallet.go b/accounts/usbwallet/wallet.go index d17bb293c0..b406fcc3d9 100644 --- a/accounts/usbwallet/wallet.go +++ b/accounts/usbwallet/wallet.go @@ -26,6 +26,7 @@ import ( "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" diff --git a/build/ci.go b/build/ci.go index fd6dc48fbd..1d3d6aad10 100644 --- a/build/ci.go +++ b/build/ci.go @@ -59,6 +59,7 @@ import ( "time" "github.com/cespare/cp" + "github.com/scroll-tech/go-ethereum/crypto/signify" "github.com/scroll-tech/go-ethereum/internal/build" "github.com/scroll-tech/go-ethereum/params" diff --git a/cmd/abigen/main.go b/cmd/abigen/main.go index 890f1a6596..24b3f12bc9 100644 --- a/cmd/abigen/main.go +++ b/cmd/abigen/main.go @@ -25,6 +25,8 @@ import ( "regexp" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/accounts/abi" "github.com/scroll-tech/go-ethereum/accounts/abi/bind" "github.com/scroll-tech/go-ethereum/cmd/utils" @@ -32,7 +34,6 @@ import ( "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/internal/flags" "github.com/scroll-tech/go-ethereum/log" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/checkpoint-admin/common.go b/cmd/checkpoint-admin/common.go index 2ffe5ff963..c26755c83a 100644 --- a/cmd/checkpoint-admin/common.go +++ b/cmd/checkpoint-admin/common.go @@ -19,6 +19,8 @@ package main import ( "strconv" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/accounts/abi/bind" "github.com/scroll-tech/go-ethereum/accounts/external" @@ -28,7 +30,6 @@ import ( "github.com/scroll-tech/go-ethereum/ethclient" "github.com/scroll-tech/go-ethereum/params" "github.com/scroll-tech/go-ethereum/rpc" - "gopkg.in/urfave/cli.v1" ) // newClient creates a client with specified remote URL. diff --git a/cmd/checkpoint-admin/exec.go b/cmd/checkpoint-admin/exec.go index 01433eb360..8cc61a82c1 100644 --- a/cmd/checkpoint-admin/exec.go +++ b/cmd/checkpoint-admin/exec.go @@ -25,6 +25,8 @@ import ( "strings" "time" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/cmd/utils" "github.com/scroll-tech/go-ethereum/common" @@ -36,7 +38,6 @@ import ( "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/params" "github.com/scroll-tech/go-ethereum/rpc" - "gopkg.in/urfave/cli.v1" ) var commandDeploy = cli.Command{ diff --git a/cmd/checkpoint-admin/main.go b/cmd/checkpoint-admin/main.go index 0a034b8933..7b788a9788 100644 --- a/cmd/checkpoint-admin/main.go +++ b/cmd/checkpoint-admin/main.go @@ -22,10 +22,11 @@ import ( "fmt" "os" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/common/fdlimit" "github.com/scroll-tech/go-ethereum/internal/flags" "github.com/scroll-tech/go-ethereum/log" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/checkpoint-admin/status.go b/cmd/checkpoint-admin/status.go index eb199fbc40..0e5b339fd5 100644 --- a/cmd/checkpoint-admin/status.go +++ b/cmd/checkpoint-admin/status.go @@ -19,9 +19,10 @@ package main import ( "fmt" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/cmd/utils" "github.com/scroll-tech/go-ethereum/common" - "gopkg.in/urfave/cli.v1" ) var commandStatus = cli.Command{ diff --git a/cmd/clef/main.go b/cmd/clef/main.go index 2582bd64ac..501a66854c 100644 --- a/cmd/clef/main.go +++ b/cmd/clef/main.go @@ -37,6 +37,8 @@ import ( "github.com/mattn/go-colorable" "github.com/mattn/go-isatty" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/accounts/keystore" "github.com/scroll-tech/go-ethereum/cmd/utils" @@ -56,7 +58,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" - "gopkg.in/urfave/cli.v1" ) const legalWarning = ` diff --git a/cmd/devp2p/discv4cmd.go b/cmd/devp2p/discv4cmd.go index e4c922de7f..febbe6ac38 100644 --- a/cmd/devp2p/discv4cmd.go +++ b/cmd/devp2p/discv4cmd.go @@ -22,13 +22,14 @@ import ( "strings" "time" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/cmd/devp2p/internal/v4test" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/p2p/discover" "github.com/scroll-tech/go-ethereum/p2p/enode" "github.com/scroll-tech/go-ethereum/params" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/devp2p/discv5cmd.go b/cmd/devp2p/discv5cmd.go index 48526ec358..6e36c6b573 100644 --- a/cmd/devp2p/discv5cmd.go +++ b/cmd/devp2p/discv5cmd.go @@ -20,10 +20,11 @@ import ( "fmt" "time" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/cmd/devp2p/internal/v5test" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/p2p/discover" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/devp2p/dns_cloudflare.go b/cmd/devp2p/dns_cloudflare.go index 915f207743..c1a30ecc22 100644 --- a/cmd/devp2p/dns_cloudflare.go +++ b/cmd/devp2p/dns_cloudflare.go @@ -22,9 +22,10 @@ import ( "strings" "github.com/cloudflare/cloudflare-go" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/p2p/dnsdisc" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/devp2p/dns_route53.go b/cmd/devp2p/dns_route53.go index 26f5078952..6367fb69c2 100644 --- a/cmd/devp2p/dns_route53.go +++ b/cmd/devp2p/dns_route53.go @@ -30,9 +30,10 @@ import ( "github.com/aws/aws-sdk-go-v2/credentials" "github.com/aws/aws-sdk-go-v2/service/route53" "github.com/aws/aws-sdk-go-v2/service/route53/types" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/p2p/dnsdisc" - "gopkg.in/urfave/cli.v1" ) const ( diff --git a/cmd/devp2p/dnscmd.go b/cmd/devp2p/dnscmd.go index de7aa924ce..5f388fb420 100644 --- a/cmd/devp2p/dnscmd.go +++ b/cmd/devp2p/dnscmd.go @@ -25,12 +25,13 @@ import ( "path/filepath" "time" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/accounts/keystore" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/console/prompt" "github.com/scroll-tech/go-ethereum/p2p/dnsdisc" "github.com/scroll-tech/go-ethereum/p2p/enode" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/devp2p/enrcmd.go b/cmd/devp2p/enrcmd.go index 9f3bf2f3a8..fc07a529a8 100644 --- a/cmd/devp2p/enrcmd.go +++ b/cmd/devp2p/enrcmd.go @@ -28,10 +28,11 @@ import ( "strconv" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/p2p/enode" "github.com/scroll-tech/go-ethereum/p2p/enr" "github.com/scroll-tech/go-ethereum/rlp" - "gopkg.in/urfave/cli.v1" ) var enrdumpCommand = cli.Command{ diff --git a/cmd/devp2p/internal/ethtest/chain_test.go b/cmd/devp2p/internal/ethtest/chain_test.go index 582da14d08..8065459256 100644 --- a/cmd/devp2p/internal/ethtest/chain_test.go +++ b/cmd/devp2p/internal/ethtest/chain_test.go @@ -21,9 +21,10 @@ import ( "strconv" "testing" + "github.com/stretchr/testify/assert" + "github.com/scroll-tech/go-ethereum/eth/protocols/eth" "github.com/scroll-tech/go-ethereum/p2p" - "github.com/stretchr/testify/assert" ) // TestEthProtocolNegotiation tests whether the test suite diff --git a/cmd/devp2p/internal/ethtest/helpers.go b/cmd/devp2p/internal/ethtest/helpers.go index e1c447111e..70d773f721 100644 --- a/cmd/devp2p/internal/ethtest/helpers.go +++ b/cmd/devp2p/internal/ethtest/helpers.go @@ -24,6 +24,7 @@ import ( "time" "github.com/davecgh/go-spew/spew" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/types" "github.com/scroll-tech/go-ethereum/crypto" diff --git a/cmd/devp2p/keycmd.go b/cmd/devp2p/keycmd.go index fc36d5cd3b..6058248e5e 100644 --- a/cmd/devp2p/keycmd.go +++ b/cmd/devp2p/keycmd.go @@ -20,9 +20,10 @@ import ( "fmt" "net" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/p2p/enode" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/devp2p/main.go b/cmd/devp2p/main.go index ed9bcccea8..0d3c5ec56d 100644 --- a/cmd/devp2p/main.go +++ b/cmd/devp2p/main.go @@ -22,10 +22,11 @@ import ( "path/filepath" "sort" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/internal/debug" "github.com/scroll-tech/go-ethereum/p2p/enode" "github.com/scroll-tech/go-ethereum/params" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/devp2p/nodesetcmd.go b/cmd/devp2p/nodesetcmd.go index 7e12150682..03cedee3bf 100644 --- a/cmd/devp2p/nodesetcmd.go +++ b/cmd/devp2p/nodesetcmd.go @@ -25,11 +25,12 @@ import ( "strings" "time" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/core/forkid" "github.com/scroll-tech/go-ethereum/p2p/enr" "github.com/scroll-tech/go-ethereum/params" "github.com/scroll-tech/go-ethereum/rlp" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/devp2p/rlpxcmd.go b/cmd/devp2p/rlpxcmd.go index accdf7c547..210639c55e 100644 --- a/cmd/devp2p/rlpxcmd.go +++ b/cmd/devp2p/rlpxcmd.go @@ -20,13 +20,14 @@ import ( "fmt" "net" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/cmd/devp2p/internal/ethtest" "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/internal/utesting" "github.com/scroll-tech/go-ethereum/p2p" "github.com/scroll-tech/go-ethereum/p2p/rlpx" "github.com/scroll-tech/go-ethereum/rlp" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/devp2p/runtest.go b/cmd/devp2p/runtest.go index 2da30e4b26..eeda265f16 100644 --- a/cmd/devp2p/runtest.go +++ b/cmd/devp2p/runtest.go @@ -19,10 +19,11 @@ package main import ( "os" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/cmd/devp2p/internal/v4test" "github.com/scroll-tech/go-ethereum/internal/utesting" "github.com/scroll-tech/go-ethereum/log" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/ethkey/changepassword.go b/cmd/ethkey/changepassword.go index d9403333e0..908db1ba4b 100644 --- a/cmd/ethkey/changepassword.go +++ b/cmd/ethkey/changepassword.go @@ -21,9 +21,10 @@ import ( "io/ioutil" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/accounts/keystore" "github.com/scroll-tech/go-ethereum/cmd/utils" - "gopkg.in/urfave/cli.v1" ) var newPassphraseFlag = cli.StringFlag{ diff --git a/cmd/ethkey/generate.go b/cmd/ethkey/generate.go index 84883b9f76..b06a872297 100644 --- a/cmd/ethkey/generate.go +++ b/cmd/ethkey/generate.go @@ -24,10 +24,11 @@ import ( "path/filepath" "github.com/google/uuid" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/accounts/keystore" "github.com/scroll-tech/go-ethereum/cmd/utils" "github.com/scroll-tech/go-ethereum/crypto" - "gopkg.in/urfave/cli.v1" ) type outputGenerate struct { diff --git a/cmd/ethkey/inspect.go b/cmd/ethkey/inspect.go index 7c24d08f22..e364daae0c 100644 --- a/cmd/ethkey/inspect.go +++ b/cmd/ethkey/inspect.go @@ -21,10 +21,11 @@ import ( "fmt" "io/ioutil" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/accounts/keystore" "github.com/scroll-tech/go-ethereum/cmd/utils" "github.com/scroll-tech/go-ethereum/crypto" - "gopkg.in/urfave/cli.v1" ) type outputInspect struct { diff --git a/cmd/ethkey/main.go b/cmd/ethkey/main.go index b942971493..8056b432ba 100644 --- a/cmd/ethkey/main.go +++ b/cmd/ethkey/main.go @@ -20,8 +20,9 @@ import ( "fmt" "os" - "github.com/scroll-tech/go-ethereum/internal/flags" "gopkg.in/urfave/cli.v1" + + "github.com/scroll-tech/go-ethereum/internal/flags" ) const ( diff --git a/cmd/ethkey/message.go b/cmd/ethkey/message.go index 30ba99595f..b3ad691a92 100644 --- a/cmd/ethkey/message.go +++ b/cmd/ethkey/message.go @@ -21,11 +21,12 @@ import ( "fmt" "io/ioutil" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/accounts/keystore" "github.com/scroll-tech/go-ethereum/cmd/utils" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/crypto" - "gopkg.in/urfave/cli.v1" ) type outputSign struct { diff --git a/cmd/ethkey/run_test.go b/cmd/ethkey/run_test.go index e00be7caae..2c06fe3418 100644 --- a/cmd/ethkey/run_test.go +++ b/cmd/ethkey/run_test.go @@ -22,6 +22,7 @@ import ( "testing" "github.com/docker/docker/pkg/reexec" + "github.com/scroll-tech/go-ethereum/internal/cmdtest" ) diff --git a/cmd/ethkey/utils.go b/cmd/ethkey/utils.go index a7d1cf5561..689877f123 100644 --- a/cmd/ethkey/utils.go +++ b/cmd/ethkey/utils.go @@ -22,9 +22,10 @@ import ( "io/ioutil" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/cmd/utils" "github.com/scroll-tech/go-ethereum/crypto" - "gopkg.in/urfave/cli.v1" ) // getPassphrase obtains a passphrase given by the user. It first checks the diff --git a/cmd/evm/disasm.go b/cmd/evm/disasm.go index 076f55164e..ba2caa2188 100644 --- a/cmd/evm/disasm.go +++ b/cmd/evm/disasm.go @@ -22,8 +22,9 @@ import ( "io/ioutil" "strings" - "github.com/scroll-tech/go-ethereum/core/asm" "gopkg.in/urfave/cli.v1" + + "github.com/scroll-tech/go-ethereum/core/asm" ) var disasmCommand = cli.Command{ diff --git a/cmd/evm/internal/t8ntool/block.go b/cmd/evm/internal/t8ntool/block.go index 6bddd730e6..9ff0817c7f 100644 --- a/cmd/evm/internal/t8ntool/block.go +++ b/cmd/evm/internal/t8ntool/block.go @@ -24,6 +24,8 @@ import ( "math/big" "os" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/hexutil" "github.com/scroll-tech/go-ethereum/common/math" @@ -33,7 +35,6 @@ import ( "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/rlp" - "gopkg.in/urfave/cli.v1" ) //go:generate gencodec -type header -field-override headerMarshaling -out gen_header.go diff --git a/cmd/evm/internal/t8ntool/execution.go b/cmd/evm/internal/t8ntool/execution.go index 705481143d..23b3e13fd5 100644 --- a/cmd/evm/internal/t8ntool/execution.go +++ b/cmd/evm/internal/t8ntool/execution.go @@ -21,6 +21,8 @@ import ( "math/big" "os" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/math" "github.com/scroll-tech/go-ethereum/consensus/ethash" @@ -36,7 +38,6 @@ import ( "github.com/scroll-tech/go-ethereum/params" "github.com/scroll-tech/go-ethereum/rlp" "github.com/scroll-tech/go-ethereum/trie" - "golang.org/x/crypto/sha3" ) type Prestate struct { diff --git a/cmd/evm/internal/t8ntool/flags.go b/cmd/evm/internal/t8ntool/flags.go index 65ae86cb45..b06205f74e 100644 --- a/cmd/evm/internal/t8ntool/flags.go +++ b/cmd/evm/internal/t8ntool/flags.go @@ -20,9 +20,10 @@ import ( "fmt" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/core/vm" "github.com/scroll-tech/go-ethereum/tests" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/evm/internal/t8ntool/transaction.go b/cmd/evm/internal/t8ntool/transaction.go index 053614e33f..dec8003acb 100644 --- a/cmd/evm/internal/t8ntool/transaction.go +++ b/cmd/evm/internal/t8ntool/transaction.go @@ -24,6 +24,8 @@ import ( "os" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/hexutil" "github.com/scroll-tech/go-ethereum/core" @@ -32,7 +34,6 @@ import ( "github.com/scroll-tech/go-ethereum/params" "github.com/scroll-tech/go-ethereum/rlp" "github.com/scroll-tech/go-ethereum/tests" - "gopkg.in/urfave/cli.v1" ) type result struct { diff --git a/cmd/evm/internal/t8ntool/transition.go b/cmd/evm/internal/t8ntool/transition.go index 99e8ade398..a251617333 100644 --- a/cmd/evm/internal/t8ntool/transition.go +++ b/cmd/evm/internal/t8ntool/transition.go @@ -27,6 +27,8 @@ import ( "path" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/hexutil" "github.com/scroll-tech/go-ethereum/core" @@ -38,7 +40,6 @@ import ( "github.com/scroll-tech/go-ethereum/params" "github.com/scroll-tech/go-ethereum/rlp" "github.com/scroll-tech/go-ethereum/tests" - "gopkg.in/urfave/cli.v1" ) const ( diff --git a/cmd/evm/main.go b/cmd/evm/main.go index 7d615f8d44..95df3282cc 100644 --- a/cmd/evm/main.go +++ b/cmd/evm/main.go @@ -22,10 +22,11 @@ import ( "math/big" "os" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/cmd/evm/internal/t8ntool" "github.com/scroll-tech/go-ethereum/cmd/utils" "github.com/scroll-tech/go-ethereum/internal/flags" - "gopkg.in/urfave/cli.v1" ) var gitCommit = "" // Git SHA1 commit hash of the release (set via linker flags) diff --git a/cmd/evm/runner.go b/cmd/evm/runner.go index 043d86fde1..ecbf8ebdb6 100644 --- a/cmd/evm/runner.go +++ b/cmd/evm/runner.go @@ -28,6 +28,8 @@ import ( "testing" "time" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/cmd/evm/internal/compiler" "github.com/scroll-tech/go-ethereum/cmd/utils" "github.com/scroll-tech/go-ethereum/common" @@ -38,7 +40,6 @@ import ( "github.com/scroll-tech/go-ethereum/core/vm/runtime" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/params" - "gopkg.in/urfave/cli.v1" ) var runCommand = cli.Command{ diff --git a/cmd/evm/t8n_test.go b/cmd/evm/t8n_test.go index 39db083dff..e8d7774e20 100644 --- a/cmd/evm/t8n_test.go +++ b/cmd/evm/t8n_test.go @@ -9,6 +9,7 @@ import ( "testing" "github.com/docker/docker/pkg/reexec" + "github.com/scroll-tech/go-ethereum/cmd/evm/internal/t8ntool" "github.com/scroll-tech/go-ethereum/internal/cmdtest" ) diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index beb1224349..6290347b4e 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -42,6 +42,7 @@ import ( "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" diff --git a/cmd/geth/accountcmd.go b/cmd/geth/accountcmd.go index 9a2104655a..c7ba6a572a 100644 --- a/cmd/geth/accountcmd.go +++ b/cmd/geth/accountcmd.go @@ -20,12 +20,13 @@ import ( "fmt" "io/ioutil" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/accounts" "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/scroll-tech/go-ethereum/log" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 31201c319d..afb2ca0677 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -26,6 +26,8 @@ import ( "sync/atomic" "time" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/cmd/utils" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/hexutil" @@ -38,7 +40,6 @@ import ( "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/metrics" "github.com/scroll-tech/go-ethereum/node" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/config.go b/cmd/geth/config.go index 90545f1fe1..914cccb6d6 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -25,9 +25,9 @@ import ( "reflect" "unicode" + "github.com/naoina/toml" "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" diff --git a/cmd/geth/consolecmd.go b/cmd/geth/consolecmd.go index ad1e10496a..95cc0b69dd 100644 --- a/cmd/geth/consolecmd.go +++ b/cmd/geth/consolecmd.go @@ -22,11 +22,12 @@ import ( "path/filepath" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/cmd/utils" "github.com/scroll-tech/go-ethereum/console" "github.com/scroll-tech/go-ethereum/node" "github.com/scroll-tech/go-ethereum/rpc" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/dbcmd.go b/cmd/geth/dbcmd.go index 542d57cd37..c8e08e2856 100644 --- a/cmd/geth/dbcmd.go +++ b/cmd/geth/dbcmd.go @@ -29,6 +29,8 @@ import ( "syscall" "time" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/cmd/utils" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/hexutil" @@ -37,7 +39,6 @@ import ( "github.com/scroll-tech/go-ethereum/ethdb" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/trie" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/misccmd.go b/cmd/geth/misccmd.go index 2a8b65d081..ac2cc7542b 100644 --- a/cmd/geth/misccmd.go +++ b/cmd/geth/misccmd.go @@ -23,10 +23,11 @@ import ( "strconv" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/cmd/utils" "github.com/scroll-tech/go-ethereum/consensus/ethash" "github.com/scroll-tech/go-ethereum/params" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/run_test.go b/cmd/geth/run_test.go index 99ac2fee06..c1832dcaf8 100644 --- a/cmd/geth/run_test.go +++ b/cmd/geth/run_test.go @@ -25,6 +25,7 @@ import ( "time" "github.com/docker/docker/pkg/reexec" + "github.com/scroll-tech/go-ethereum/internal/cmdtest" "github.com/scroll-tech/go-ethereum/rpc" ) diff --git a/cmd/geth/snapshot.go b/cmd/geth/snapshot.go index 9b76661133..4a3f3077a2 100644 --- a/cmd/geth/snapshot.go +++ b/cmd/geth/snapshot.go @@ -23,6 +23,8 @@ import ( "os" "time" + cli "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/cmd/utils" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/rawdb" @@ -34,7 +36,6 @@ import ( "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/rlp" "github.com/scroll-tech/go-ethereum/trie" - cli "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index c8e69032d0..804eccd0cb 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -22,10 +22,11 @@ import ( "io" "sort" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/cmd/utils" "github.com/scroll-tech/go-ethereum/internal/debug" "github.com/scroll-tech/go-ethereum/internal/flags" - "gopkg.in/urfave/cli.v1" ) // AppHelpFlagGroups is the application flags, grouped by functionality. diff --git a/cmd/geth/version_check.go b/cmd/geth/version_check.go index 631b3066ec..515d6634b2 100644 --- a/cmd/geth/version_check.go +++ b/cmd/geth/version_check.go @@ -26,8 +26,9 @@ import ( "strings" "github.com/jedisct1/go-minisign" - "github.com/scroll-tech/go-ethereum/log" "gopkg.in/urfave/cli.v1" + + "github.com/scroll-tech/go-ethereum/log" ) var gethPubKeys []string = []string{ diff --git a/cmd/p2psim/main.go b/cmd/p2psim/main.go index 7643567008..2119d3d43d 100644 --- a/cmd/p2psim/main.go +++ b/cmd/p2psim/main.go @@ -45,13 +45,14 @@ import ( "strings" "text/tabwriter" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/p2p" "github.com/scroll-tech/go-ethereum/p2p/enode" "github.com/scroll-tech/go-ethereum/p2p/simulations" "github.com/scroll-tech/go-ethereum/p2p/simulations/adapters" "github.com/scroll-tech/go-ethereum/rpc" - "gopkg.in/urfave/cli.v1" ) var client *simulations.Client diff --git a/cmd/puppeth/genesis_test.go b/cmd/puppeth/genesis_test.go index 15c9c2e3eb..3e80b50717 100644 --- a/cmd/puppeth/genesis_test.go +++ b/cmd/puppeth/genesis_test.go @@ -25,6 +25,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/scroll-tech/go-ethereum/core" ) diff --git a/cmd/puppeth/puppeth.go b/cmd/puppeth/puppeth.go index 77bf060c13..2cef91ca2b 100644 --- a/cmd/puppeth/puppeth.go +++ b/cmd/puppeth/puppeth.go @@ -23,8 +23,9 @@ import ( "strings" "time" - "github.com/scroll-tech/go-ethereum/log" "gopkg.in/urfave/cli.v1" + + "github.com/scroll-tech/go-ethereum/log" ) // main is just a boring entry point to set up the CLI app. diff --git a/cmd/puppeth/ssh.go b/cmd/puppeth/ssh.go index fd66f6ddc1..cb602d0047 100644 --- a/cmd/puppeth/ssh.go +++ b/cmd/puppeth/ssh.go @@ -28,10 +28,11 @@ import ( "path/filepath" "strings" - "github.com/scroll-tech/go-ethereum/log" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" "golang.org/x/crypto/ssh/terminal" + + "github.com/scroll-tech/go-ethereum/log" ) // sshClient is a small wrapper around Go's SSH client with a few utility methods diff --git a/cmd/puppeth/wizard.go b/cmd/puppeth/wizard.go index 40f0ae2487..7e23c767fb 100644 --- a/cmd/puppeth/wizard.go +++ b/cmd/puppeth/wizard.go @@ -31,11 +31,12 @@ import ( "sync" "github.com/peterh/liner" + "golang.org/x/crypto/ssh/terminal" + "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" - "golang.org/x/crypto/ssh/terminal" ) // config contains all the configurations needed by puppeth that should be saved diff --git a/cmd/puppeth/wizard_netstats.go b/cmd/puppeth/wizard_netstats.go index 3b5f47af1b..44dc8271ec 100644 --- a/cmd/puppeth/wizard_netstats.go +++ b/cmd/puppeth/wizard_netstats.go @@ -24,6 +24,7 @@ import ( "sync" "github.com/olekukonko/tablewriter" + "github.com/scroll-tech/go-ethereum/core" "github.com/scroll-tech/go-ethereum/log" ) diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go index 8a3df2793a..3ce79e2f58 100644 --- a/cmd/utils/cmd.go +++ b/cmd/utils/cmd.go @@ -30,6 +30,8 @@ import ( "syscall" "time" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core" "github.com/scroll-tech/go-ethereum/core/rawdb" @@ -41,7 +43,6 @@ import ( "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/node" "github.com/scroll-tech/go-ethereum/rlp" - "gopkg.in/urfave/cli.v1" ) const ( diff --git a/cmd/utils/customflags.go b/cmd/utils/customflags.go index 8266fa5371..ce62bdd460 100644 --- a/cmd/utils/customflags.go +++ b/cmd/utils/customflags.go @@ -26,8 +26,9 @@ import ( "path" "strings" - "github.com/scroll-tech/go-ethereum/common/math" "gopkg.in/urfave/cli.v1" + + "github.com/scroll-tech/go-ethereum/common/math" ) // Custom type which is registered in the flags library which cli uses for diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 21209da376..8ebe731638 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -34,6 +34,9 @@ import ( "time" pcsclite "github.com/gballet/go-libpcsclite" + gopsutil "github.com/shirou/gopsutil/mem" + "gopkg.in/urfave/cli.v1" + "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/accounts/keystore" "github.com/scroll-tech/go-ethereum/common" @@ -67,8 +70,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" - gopsutil "github.com/shirou/gopsutil/mem" - "gopkg.in/urfave/cli.v1" ) func init() { diff --git a/cmd/utils/flags_legacy.go b/cmd/utils/flags_legacy.go index 170b3922fa..8bc084a54d 100644 --- a/cmd/utils/flags_legacy.go +++ b/cmd/utils/flags_legacy.go @@ -19,8 +19,9 @@ package utils import ( "fmt" - "github.com/scroll-tech/go-ethereum/eth/ethconfig" "gopkg.in/urfave/cli.v1" + + "github.com/scroll-tech/go-ethereum/eth/ethconfig" ) var ShowDeprecated = cli.Command{ diff --git a/common/types.go b/common/types.go index 5a784c1bc5..a7f6c3928d 100644 --- a/common/types.go +++ b/common/types.go @@ -28,8 +28,9 @@ import ( "reflect" "strings" - "github.com/scroll-tech/go-ethereum/common/hexutil" "golang.org/x/crypto/sha3" + + "github.com/scroll-tech/go-ethereum/common/hexutil" ) // Lengths of hashes and addresses in bytes. diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index 7152cf450a..702b029d52 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -28,6 +28,8 @@ import ( "time" lru "github.com/hashicorp/golang-lru" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/hexutil" @@ -42,7 +44,6 @@ import ( "github.com/scroll-tech/go-ethereum/rlp" "github.com/scroll-tech/go-ethereum/rpc" "github.com/scroll-tech/go-ethereum/trie" - "golang.org/x/crypto/sha3" ) const ( diff --git a/consensus/clique/snapshot.go b/consensus/clique/snapshot.go index 03f8577f0c..cab5a2d8fe 100644 --- a/consensus/clique/snapshot.go +++ b/consensus/clique/snapshot.go @@ -23,6 +23,7 @@ import ( "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" diff --git a/consensus/ethash/algorithm.go b/consensus/ethash/algorithm.go index 676d587f25..96e4bbb8cb 100644 --- a/consensus/ethash/algorithm.go +++ b/consensus/ethash/algorithm.go @@ -27,11 +27,12 @@ import ( "time" "unsafe" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/bitutil" "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/log" - "golang.org/x/crypto/sha3" ) const ( diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index 721ece6a39..c7478b8fb7 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -25,6 +25,8 @@ import ( "time" mapset "github.com/deckarep/golang-set" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/math" "github.com/scroll-tech/go-ethereum/consensus" @@ -34,7 +36,6 @@ import ( "github.com/scroll-tech/go-ethereum/params" "github.com/scroll-tech/go-ethereum/rlp" "github.com/scroll-tech/go-ethereum/trie" - "golang.org/x/crypto/sha3" ) // Ethash proof-of-work protocol constants. diff --git a/consensus/ethash/difficulty.go b/consensus/ethash/difficulty.go index 92f2cdf65c..8052363503 100644 --- a/consensus/ethash/difficulty.go +++ b/consensus/ethash/difficulty.go @@ -20,6 +20,7 @@ import ( "math/big" "github.com/holiman/uint256" + "github.com/scroll-tech/go-ethereum/core/types" ) diff --git a/consensus/ethash/ethash.go b/consensus/ethash/ethash.go index f92c190c28..541f9e386d 100644 --- a/consensus/ethash/ethash.go +++ b/consensus/ethash/ethash.go @@ -35,6 +35,7 @@ import ( "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" diff --git a/console/bridge.go b/console/bridge.go index 619634e835..4e392c8261 100644 --- a/console/bridge.go +++ b/console/bridge.go @@ -25,6 +25,7 @@ import ( "time" "github.com/dop251/goja" + "github.com/scroll-tech/go-ethereum/accounts/scwallet" "github.com/scroll-tech/go-ethereum/accounts/usbwallet" "github.com/scroll-tech/go-ethereum/common/hexutil" diff --git a/console/bridge_test.go b/console/bridge_test.go index c2d86ce955..dde05c392f 100644 --- a/console/bridge_test.go +++ b/console/bridge_test.go @@ -20,6 +20,7 @@ import ( "testing" "github.com/dop251/goja" + "github.com/scroll-tech/go-ethereum/internal/jsre" ) diff --git a/console/console.go b/console/console.go index 471b23b9d8..c3f662be7a 100644 --- a/console/console.go +++ b/console/console.go @@ -31,6 +31,7 @@ import ( "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" diff --git a/core/blockchain.go b/core/blockchain.go index f3c669a90e..cbf6fc446b 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -29,6 +29,7 @@ import ( "time" lru "github.com/hashicorp/golang-lru" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/hexutil" "github.com/scroll-tech/go-ethereum/common/mclock" diff --git a/core/genesis_test.go b/core/genesis_test.go index b95208a4f5..9264bb62ec 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -22,6 +22,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/consensus/ethash" "github.com/scroll-tech/go-ethereum/core/rawdb" diff --git a/core/headerchain.go b/core/headerchain.go index 4a806d31c2..f047d654d9 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -27,6 +27,7 @@ import ( "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" diff --git a/core/rawdb/accessors_chain_test.go b/core/rawdb/accessors_chain_test.go index 6fefd65e9a..9f5fffc5d8 100644 --- a/core/rawdb/accessors_chain_test.go +++ b/core/rawdb/accessors_chain_test.go @@ -27,12 +27,13 @@ import ( "reflect" "testing" + "golang.org/x/crypto/sha3" + "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/params" "github.com/scroll-tech/go-ethereum/rlp" - "golang.org/x/crypto/sha3" ) // Tests block header storage and retrieval operations. diff --git a/core/rawdb/accessors_indexes_test.go b/core/rawdb/accessors_indexes_test.go index 8f1fedd54d..c4f2a8909e 100644 --- a/core/rawdb/accessors_indexes_test.go +++ b/core/rawdb/accessors_indexes_test.go @@ -22,12 +22,13 @@ import ( "math/big" "testing" + "golang.org/x/crypto/sha3" + "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/params" "github.com/scroll-tech/go-ethereum/rlp" - "golang.org/x/crypto/sha3" ) // testHasher is the helper tool for transaction/receipt list hashing. diff --git a/core/rawdb/database.go b/core/rawdb/database.go index 217b14c2b8..0b43504f00 100644 --- a/core/rawdb/database.go +++ b/core/rawdb/database.go @@ -25,6 +25,7 @@ import ( "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" diff --git a/core/rawdb/freezer.go b/core/rawdb/freezer.go index cd22f8b784..ab0510a782 100644 --- a/core/rawdb/freezer.go +++ b/core/rawdb/freezer.go @@ -27,6 +27,7 @@ import ( "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" diff --git a/core/rawdb/freezer_batch.go b/core/rawdb/freezer_batch.go index 2ba0c5e502..ea8cd6e830 100644 --- a/core/rawdb/freezer_batch.go +++ b/core/rawdb/freezer_batch.go @@ -21,6 +21,7 @@ import ( "sync/atomic" "github.com/golang/snappy" + "github.com/scroll-tech/go-ethereum/common/math" "github.com/scroll-tech/go-ethereum/rlp" ) diff --git a/core/rawdb/freezer_table.go b/core/rawdb/freezer_table.go index 072c5873c3..4d6b96cd8e 100644 --- a/core/rawdb/freezer_table.go +++ b/core/rawdb/freezer_table.go @@ -28,6 +28,7 @@ import ( "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" diff --git a/core/rawdb/freezer_table_test.go b/core/rawdb/freezer_table_test.go index 8fbcf75549..40c90f3794 100644 --- a/core/rawdb/freezer_table_test.go +++ b/core/rawdb/freezer_table_test.go @@ -25,8 +25,9 @@ import ( "testing" "time" - "github.com/scroll-tech/go-ethereum/metrics" "github.com/stretchr/testify/require" + + "github.com/scroll-tech/go-ethereum/metrics" ) func init() { diff --git a/core/rawdb/freezer_test.go b/core/rawdb/freezer_test.go index 30fab07547..ca418248ea 100644 --- a/core/rawdb/freezer_test.go +++ b/core/rawdb/freezer_test.go @@ -27,9 +27,10 @@ import ( "sync" "testing" + "github.com/stretchr/testify/require" + "github.com/scroll-tech/go-ethereum/ethdb" "github.com/scroll-tech/go-ethereum/rlp" - "github.com/stretchr/testify/require" ) var freezerTestTableDef = map[string]bool{"test": true} diff --git a/core/rlp_test.go b/core/rlp_test.go index c89e773fe2..31387c3f43 100644 --- a/core/rlp_test.go +++ b/core/rlp_test.go @@ -21,6 +21,8 @@ import ( "math/big" "testing" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/consensus/ethash" "github.com/scroll-tech/go-ethereum/core/rawdb" @@ -28,7 +30,6 @@ import ( "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/params" "github.com/scroll-tech/go-ethereum/rlp" - "golang.org/x/crypto/sha3" ) func getBlock(transactions int, uncles int, dataSize int) *types.Block { diff --git a/core/state/database.go b/core/state/database.go index 56e41afbfd..b42c921215 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -22,6 +22,7 @@ import ( "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" diff --git a/core/state/pruner/bloom.go b/core/state/pruner/bloom.go index 3afcfedc12..48639bfd35 100644 --- a/core/state/pruner/bloom.go +++ b/core/state/pruner/bloom.go @@ -22,6 +22,7 @@ import ( "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" diff --git a/core/state/snapshot/difflayer.go b/core/state/snapshot/difflayer.go index 8cf472db32..bedee8a1fe 100644 --- a/core/state/snapshot/difflayer.go +++ b/core/state/snapshot/difflayer.go @@ -27,6 +27,7 @@ import ( "time" bloomfilter "github.com/holiman/bloomfilter/v2" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/rlp" ) diff --git a/core/state/snapshot/difflayer_test.go b/core/state/snapshot/difflayer_test.go index c0e1be6d96..1b9539fb03 100644 --- a/core/state/snapshot/difflayer_test.go +++ b/core/state/snapshot/difflayer_test.go @@ -22,6 +22,7 @@ import ( "testing" "github.com/VictoriaMetrics/fastcache" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/ethdb/memorydb" diff --git a/core/state/snapshot/disklayer.go b/core/state/snapshot/disklayer.go index 854b542cae..ab3f462eb0 100644 --- a/core/state/snapshot/disklayer.go +++ b/core/state/snapshot/disklayer.go @@ -21,6 +21,7 @@ import ( "sync" "github.com/VictoriaMetrics/fastcache" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/rawdb" "github.com/scroll-tech/go-ethereum/ethdb" diff --git a/core/state/snapshot/disklayer_test.go b/core/state/snapshot/disklayer_test.go index adce242933..df7ac35eb8 100644 --- a/core/state/snapshot/disklayer_test.go +++ b/core/state/snapshot/disklayer_test.go @@ -23,6 +23,7 @@ import ( "testing" "github.com/VictoriaMetrics/fastcache" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/rawdb" "github.com/scroll-tech/go-ethereum/ethdb" diff --git a/core/state/snapshot/generate.go b/core/state/snapshot/generate.go index 5bebfc8d46..3bc081278e 100644 --- a/core/state/snapshot/generate.go +++ b/core/state/snapshot/generate.go @@ -25,6 +25,7 @@ import ( "time" "github.com/VictoriaMetrics/fastcache" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/hexutil" "github.com/scroll-tech/go-ethereum/common/math" diff --git a/core/state/snapshot/generate_test.go b/core/state/snapshot/generate_test.go index ef239917c4..e108d06428 100644 --- a/core/state/snapshot/generate_test.go +++ b/core/state/snapshot/generate_test.go @@ -23,6 +23,8 @@ import ( "testing" "time" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/rawdb" "github.com/scroll-tech/go-ethereum/ethdb" @@ -30,7 +32,6 @@ import ( "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/rlp" "github.com/scroll-tech/go-ethereum/trie" - "golang.org/x/crypto/sha3" ) // Tests that snapshot generation from an empty database. diff --git a/core/state/snapshot/iterator_test.go b/core/state/snapshot/iterator_test.go index 8f3bd384e0..9421fee08d 100644 --- a/core/state/snapshot/iterator_test.go +++ b/core/state/snapshot/iterator_test.go @@ -24,6 +24,7 @@ import ( "testing" "github.com/VictoriaMetrics/fastcache" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/rawdb" ) diff --git a/core/state/snapshot/journal.go b/core/state/snapshot/journal.go index 779460ad21..821f161cc9 100644 --- a/core/state/snapshot/journal.go +++ b/core/state/snapshot/journal.go @@ -25,6 +25,7 @@ import ( "time" "github.com/VictoriaMetrics/fastcache" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/rawdb" "github.com/scroll-tech/go-ethereum/ethdb" diff --git a/core/state/snapshot/snapshot_test.go b/core/state/snapshot/snapshot_test.go index 13f1385ac4..a28231952b 100644 --- a/core/state/snapshot/snapshot_test.go +++ b/core/state/snapshot/snapshot_test.go @@ -25,6 +25,7 @@ import ( "time" "github.com/VictoriaMetrics/fastcache" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/rawdb" "github.com/scroll-tech/go-ethereum/rlp" diff --git a/core/state_processor_test.go b/core/state_processor_test.go index 8cae034d42..c1cde9cfcd 100644 --- a/core/state_processor_test.go +++ b/core/state_processor_test.go @@ -21,6 +21,8 @@ import ( "math/big" "testing" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/math" "github.com/scroll-tech/go-ethereum/consensus" @@ -32,7 +34,6 @@ import ( "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/params" "github.com/scroll-tech/go-ethereum/trie" - "golang.org/x/crypto/sha3" ) // TestStateProcessorErrors tests the output from the 'core' errors diff --git a/core/types/block_test.go b/core/types/block_test.go index 05dc1ad67c..52282c05f2 100644 --- a/core/types/block_test.go +++ b/core/types/block_test.go @@ -23,12 +23,13 @@ import ( "reflect" "testing" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/math" "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/params" "github.com/scroll-tech/go-ethereum/rlp" - "golang.org/x/crypto/sha3" ) // from bcValidBlockTest.json, "SimpleTx" diff --git a/core/types/hashing.go b/core/types/hashing.go index 42b5673ad4..3c2ce3b3fe 100644 --- a/core/types/hashing.go +++ b/core/types/hashing.go @@ -20,10 +20,11 @@ import ( "bytes" "sync" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/rlp" - "golang.org/x/crypto/sha3" ) // hasherPool holds LegacyKeccak256 hashers for rlpHash. diff --git a/core/types/log_test.go b/core/types/log_test.go index 997e907fa3..28f9dc4f8c 100644 --- a/core/types/log_test.go +++ b/core/types/log_test.go @@ -23,6 +23,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/hexutil" ) diff --git a/core/vm/common.go b/core/vm/common.go index 91a1e1eaed..5792071e00 100644 --- a/core/vm/common.go +++ b/core/vm/common.go @@ -18,6 +18,7 @@ package vm import ( "github.com/holiman/uint256" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/math" ) diff --git a/core/vm/contract.go b/core/vm/contract.go index d465569a51..f9a5afdb49 100644 --- a/core/vm/contract.go +++ b/core/vm/contract.go @@ -20,6 +20,7 @@ import ( "math/big" "github.com/holiman/uint256" + "github.com/scroll-tech/go-ethereum/common" ) diff --git a/core/vm/eips.go b/core/vm/eips.go index b16ceb632f..0af12970ca 100644 --- a/core/vm/eips.go +++ b/core/vm/eips.go @@ -21,6 +21,7 @@ import ( "sort" "github.com/holiman/uint256" + "github.com/scroll-tech/go-ethereum/params" ) diff --git a/core/vm/evm.go b/core/vm/evm.go index 6ae64cefd6..7200641560 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -22,6 +22,7 @@ import ( "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" diff --git a/core/vm/gen_structlog.go b/core/vm/gen_structlog.go index befc4584fe..261243288f 100644 --- a/core/vm/gen_structlog.go +++ b/core/vm/gen_structlog.go @@ -6,6 +6,7 @@ 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" diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 5923e21c45..00288eaac7 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -18,10 +18,11 @@ package vm import ( "github.com/holiman/uint256" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/types" "github.com/scroll-tech/go-ethereum/params" - "golang.org/x/crypto/sha3" ) func opAdd(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) { diff --git a/core/vm/instructions_test.go b/core/vm/instructions_test.go index d38fa29b75..fdafb321a8 100644 --- a/core/vm/instructions_test.go +++ b/core/vm/instructions_test.go @@ -24,6 +24,7 @@ import ( "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" diff --git a/core/vm/logger.go b/core/vm/logger.go index 20ad986f21..48e2fd5694 100644 --- a/core/vm/logger.go +++ b/core/vm/logger.go @@ -25,6 +25,7 @@ import ( "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" diff --git a/crypto/crypto.go b/crypto/crypto.go index 07bced2846..f1ccf37541 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -30,10 +30,11 @@ import ( "math/big" "os" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/math" "github.com/scroll-tech/go-ethereum/rlp" - "golang.org/x/crypto/sha3" ) //SignatureLength indicates the byte length required to carry a signature with recovery id. diff --git a/crypto/signature_cgo.go b/crypto/signature_cgo.go index 295f68a1b8..27845562db 100644 --- a/crypto/signature_cgo.go +++ b/crypto/signature_cgo.go @@ -24,13 +24,13 @@ import ( "crypto/elliptic" "fmt" - "github.com/scroll-tech/go-ethereum/common/math" - // We use the L1 version of secp256k1 here in order to avoid linker errors when // compiling the sequencer. In addition, this crypto library is used for L1 // keys, and we should never diverge from how L1 keys are handled as it is // necessary for compatibility with L1. "github.com/ethereum/go-ethereum/crypto/secp256k1" + + "github.com/scroll-tech/go-ethereum/common/math" ) // Ecrecover returns the uncompressed public key that created the given signature. diff --git a/eth/api_test.go b/eth/api_test.go index f65ad39ea8..317fb73c90 100644 --- a/eth/api_test.go +++ b/eth/api_test.go @@ -25,6 +25,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/rawdb" "github.com/scroll-tech/go-ethereum/core/state" diff --git a/eth/downloader/statesync.go b/eth/downloader/statesync.go index 5c8b85c5a8..e4db59a4e7 100644 --- a/eth/downloader/statesync.go +++ b/eth/downloader/statesync.go @@ -21,6 +21,8 @@ import ( "sync" "time" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/rawdb" "github.com/scroll-tech/go-ethereum/core/state" @@ -28,7 +30,6 @@ import ( "github.com/scroll-tech/go-ethereum/ethdb" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/trie" - "golang.org/x/crypto/sha3" ) // stateReq represents a batch of state fetch requests grouped together into diff --git a/eth/fetcher/tx_fetcher.go b/eth/fetcher/tx_fetcher.go index 5494ca6f31..c4845a34d7 100644 --- a/eth/fetcher/tx_fetcher.go +++ b/eth/fetcher/tx_fetcher.go @@ -25,6 +25,7 @@ import ( "time" mapset "github.com/deckarep/golang-set" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/mclock" "github.com/scroll-tech/go-ethereum/core" diff --git a/eth/gasprice/gasprice.go b/eth/gasprice/gasprice.go index 48e2d5ef92..7c27fb4247 100644 --- a/eth/gasprice/gasprice.go +++ b/eth/gasprice/gasprice.go @@ -23,6 +23,7 @@ import ( "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" diff --git a/eth/protocols/eth/peer.go b/eth/protocols/eth/peer.go index 390eb43992..20f959a8ed 100644 --- a/eth/protocols/eth/peer.go +++ b/eth/protocols/eth/peer.go @@ -22,6 +22,7 @@ import ( "sync" mapset "github.com/deckarep/golang-set" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/types" "github.com/scroll-tech/go-ethereum/p2p" diff --git a/eth/protocols/snap/range.go b/eth/protocols/snap/range.go index a08cb02f3d..2e0c4346ac 100644 --- a/eth/protocols/snap/range.go +++ b/eth/protocols/snap/range.go @@ -20,6 +20,7 @@ import ( "math/big" "github.com/holiman/uint256" + "github.com/scroll-tech/go-ethereum/common" ) diff --git a/eth/protocols/snap/sync.go b/eth/protocols/snap/sync.go index 43fbba0761..31b11893c9 100644 --- a/eth/protocols/snap/sync.go +++ b/eth/protocols/snap/sync.go @@ -27,6 +27,8 @@ import ( "sync" "time" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/math" "github.com/scroll-tech/go-ethereum/core/rawdb" @@ -41,7 +43,6 @@ import ( "github.com/scroll-tech/go-ethereum/p2p/msgrate" "github.com/scroll-tech/go-ethereum/rlp" "github.com/scroll-tech/go-ethereum/trie" - "golang.org/x/crypto/sha3" ) var ( diff --git a/eth/protocols/snap/sync_test.go b/eth/protocols/snap/sync_test.go index 7e252ae131..bca0340c2a 100644 --- a/eth/protocols/snap/sync_test.go +++ b/eth/protocols/snap/sync_test.go @@ -27,6 +27,8 @@ import ( "testing" "time" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/rawdb" "github.com/scroll-tech/go-ethereum/core/types" @@ -36,7 +38,6 @@ import ( "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/rlp" "github.com/scroll-tech/go-ethereum/trie" - "golang.org/x/crypto/sha3" ) func TestHashing(t *testing.T) { diff --git a/eth/tracers/js/tracer.go b/eth/tracers/js/tracer.go index c98e6b6600..ee2e044fa4 100644 --- a/eth/tracers/js/tracer.go +++ b/eth/tracers/js/tracer.go @@ -28,6 +28,8 @@ import ( "unicode" "unsafe" + "gopkg.in/olebedev/go-duktape.v3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/hexutil" "github.com/scroll-tech/go-ethereum/core" @@ -36,7 +38,6 @@ import ( tracers2 "github.com/scroll-tech/go-ethereum/eth/tracers" "github.com/scroll-tech/go-ethereum/eth/tracers/js/internal/tracers" "github.com/scroll-tech/go-ethereum/log" - "gopkg.in/olebedev/go-duktape.v3" ) // camel converts a snake cased input string into a camel cased output. diff --git a/ethdb/leveldb/leveldb.go b/ethdb/leveldb/leveldb.go index 427330e04f..33ff84b546 100644 --- a/ethdb/leveldb/leveldb.go +++ b/ethdb/leveldb/leveldb.go @@ -27,15 +27,16 @@ import ( "sync" "time" - "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/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/filter" "github.com/syndtr/goleveldb/leveldb/opt" "github.com/syndtr/goleveldb/leveldb/util" + + "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" ) const ( diff --git a/ethdb/leveldb/leveldb_test.go b/ethdb/leveldb/leveldb_test.go index acb351f706..08e099e92e 100644 --- a/ethdb/leveldb/leveldb_test.go +++ b/ethdb/leveldb/leveldb_test.go @@ -19,10 +19,11 @@ package leveldb import ( "testing" - "github.com/scroll-tech/go-ethereum/ethdb" - "github.com/scroll-tech/go-ethereum/ethdb/dbtest" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/storage" + + "github.com/scroll-tech/go-ethereum/ethdb" + "github.com/scroll-tech/go-ethereum/ethdb/dbtest" ) func TestLevelDB(t *testing.T) { diff --git a/ethstats/ethstats.go b/ethstats/ethstats.go index f5a26457d5..d0533be8f7 100644 --- a/ethstats/ethstats.go +++ b/ethstats/ethstats.go @@ -31,6 +31,7 @@ import ( "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" diff --git a/graphql/service.go b/graphql/service.go index 0387ec9615..4a696238e2 100644 --- a/graphql/service.go +++ b/graphql/service.go @@ -21,6 +21,7 @@ import ( "net/http" "github.com/graph-gophers/graphql-go" + "github.com/scroll-tech/go-ethereum/internal/ethapi" "github.com/scroll-tech/go-ethereum/node" ) diff --git a/internal/cmdtest/test_cmd.go b/internal/cmdtest/test_cmd.go index 3ed95fcb6e..6c7cb3a7c0 100644 --- a/internal/cmdtest/test_cmd.go +++ b/internal/cmdtest/test_cmd.go @@ -35,6 +35,7 @@ import ( "time" "github.com/docker/docker/pkg/reexec" + "github.com/scroll-tech/go-ethereum/common" ) diff --git a/internal/debug/api.go b/internal/debug/api.go index 1f663d428a..f5bd7e8d2c 100644 --- a/internal/debug/api.go +++ b/internal/debug/api.go @@ -36,6 +36,7 @@ import ( "time" "github.com/hashicorp/go-bexpr" + "github.com/scroll-tech/go-ethereum/log" ) diff --git a/internal/debug/flags.go b/internal/debug/flags.go index bdfbf97ee8..28a7eaeedf 100644 --- a/internal/debug/flags.go +++ b/internal/debug/flags.go @@ -27,10 +27,11 @@ import ( "github.com/fjl/memsize/memsizeui" "github.com/mattn/go-colorable" "github.com/mattn/go-isatty" + "gopkg.in/urfave/cli.v1" + "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" ) var Memsize memsizeui.Handler diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 5c957dc0af..8d28fe6457 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -25,6 +25,8 @@ import ( "time" "github.com/davecgh/go-spew/spew" + "github.com/tyler-smith/go-bip39" + "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/accounts/abi" "github.com/scroll-tech/go-ethereum/accounts/keystore" @@ -45,7 +47,6 @@ import ( "github.com/scroll-tech/go-ethereum/params" "github.com/scroll-tech/go-ethereum/rlp" "github.com/scroll-tech/go-ethereum/rpc" - "github.com/tyler-smith/go-bip39" ) // PublicEthereumAPI provides an API to access Ethereum related information. diff --git a/internal/flags/helpers.go b/internal/flags/helpers.go index 766401e2bc..d941f03b6b 100644 --- a/internal/flags/helpers.go +++ b/internal/flags/helpers.go @@ -20,8 +20,9 @@ import ( "os" "path/filepath" - "github.com/scroll-tech/go-ethereum/params" "gopkg.in/urfave/cli.v1" + + "github.com/scroll-tech/go-ethereum/params" ) var ( diff --git a/internal/jsre/jsre.go b/internal/jsre/jsre.go index f36d01e759..6c9c79cfe9 100644 --- a/internal/jsre/jsre.go +++ b/internal/jsre/jsre.go @@ -27,6 +27,7 @@ import ( "time" "github.com/dop251/goja" + "github.com/scroll-tech/go-ethereum/common" ) diff --git a/les/api_test.go b/les/api_test.go index 88d023df3d..1e9eeb626d 100644 --- a/les/api_test.go +++ b/les/api_test.go @@ -29,6 +29,7 @@ import ( "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" diff --git a/les/downloader/statesync.go b/les/downloader/statesync.go index 5c8b85c5a8..e4db59a4e7 100644 --- a/les/downloader/statesync.go +++ b/les/downloader/statesync.go @@ -21,6 +21,8 @@ import ( "sync" "time" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/rawdb" "github.com/scroll-tech/go-ethereum/core/state" @@ -28,7 +30,6 @@ import ( "github.com/scroll-tech/go-ethereum/ethdb" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/trie" - "golang.org/x/crypto/sha3" ) // stateReq represents a batch of state fetch requests grouped together into diff --git a/les/vflux/server/clientdb.go b/les/vflux/server/clientdb.go index d9d5c4e00a..80ebc0e2de 100644 --- a/les/vflux/server/clientdb.go +++ b/les/vflux/server/clientdb.go @@ -22,6 +22,7 @@ import ( "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" diff --git a/light/lightchain.go b/light/lightchain.go index 0b8636f499..f14b1679c8 100644 --- a/light/lightchain.go +++ b/light/lightchain.go @@ -27,6 +27,7 @@ import ( "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" diff --git a/light/postprocess.go b/light/postprocess.go index 787660717a..a6016ca128 100644 --- a/light/postprocess.go +++ b/light/postprocess.go @@ -26,6 +26,7 @@ import ( "time" mapset "github.com/deckarep/golang-set" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/bitutil" "github.com/scroll-tech/go-ethereum/core" diff --git a/light/trie_test.go b/light/trie_test.go index 39d86557e3..3dda9ebdb4 100644 --- a/light/trie_test.go +++ b/light/trie_test.go @@ -24,6 +24,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/scroll-tech/go-ethereum/consensus/ethash" "github.com/scroll-tech/go-ethereum/core" "github.com/scroll-tech/go-ethereum/core/rawdb" diff --git a/metrics/cpu_enabled.go b/metrics/cpu_enabled.go index e74125f530..856e07b6c6 100644 --- a/metrics/cpu_enabled.go +++ b/metrics/cpu_enabled.go @@ -20,8 +20,9 @@ package metrics import ( - "github.com/scroll-tech/go-ethereum/log" "github.com/shirou/gopsutil/cpu" + + "github.com/scroll-tech/go-ethereum/log" ) // ReadCPUStats retrieves the current CPU stats. diff --git a/metrics/influxdb/influxdb.go b/metrics/influxdb/influxdb.go index 2f67cd4816..c562a281b7 100644 --- a/metrics/influxdb/influxdb.go +++ b/metrics/influxdb/influxdb.go @@ -6,6 +6,7 @@ import ( "time" "github.com/influxdata/influxdb/client" + "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/metrics" ) diff --git a/metrics/influxdb/influxdbv2.go b/metrics/influxdb/influxdbv2.go index 97c9f9523b..24808791a9 100644 --- a/metrics/influxdb/influxdbv2.go +++ b/metrics/influxdb/influxdbv2.go @@ -15,6 +15,7 @@ import ( 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" ) diff --git a/miner/worker.go b/miner/worker.go index 35ce903670..ce8de2d085 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -26,6 +26,7 @@ import ( "time" mapset "github.com/deckarep/golang-set" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/consensus" "github.com/scroll-tech/go-ethereum/consensus/misc" diff --git a/node/api_test.go b/node/api_test.go index 9e14aa4114..b81ed205a3 100644 --- a/node/api_test.go +++ b/node/api_test.go @@ -25,8 +25,9 @@ import ( "strings" "testing" - "github.com/scroll-tech/go-ethereum/rpc" "github.com/stretchr/testify/assert" + + "github.com/scroll-tech/go-ethereum/rpc" ) // This test uses the admin_startRPC and admin_startWS APIs, diff --git a/node/node.go b/node/node.go index ad4fdb8632..7363480ee8 100644 --- a/node/node.go +++ b/node/node.go @@ -27,6 +27,7 @@ import ( "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" diff --git a/node/rpcstack.go b/node/rpcstack.go index 6f5bc1e001..cf7ff642a9 100644 --- a/node/rpcstack.go +++ b/node/rpcstack.go @@ -30,6 +30,7 @@ import ( "sync/atomic" "github.com/rs/cors" + "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/rpc" ) diff --git a/node/rpcstack_test.go b/node/rpcstack_test.go index 33023fcdda..11c00eb0f4 100644 --- a/node/rpcstack_test.go +++ b/node/rpcstack_test.go @@ -26,10 +26,11 @@ import ( "testing" "github.com/gorilla/websocket" + "github.com/stretchr/testify/assert" + "github.com/scroll-tech/go-ethereum/internal/testlog" "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/rpc" - "github.com/stretchr/testify/assert" ) // TestCorsHandler makes sure CORS are properly handled on the http server. diff --git a/p2p/discover/v4wire/v4wire_test.go b/p2p/discover/v4wire/v4wire_test.go index 097b934610..5ca5ebee79 100644 --- a/p2p/discover/v4wire/v4wire_test.go +++ b/p2p/discover/v4wire/v4wire_test.go @@ -23,6 +23,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/rlp" ) diff --git a/p2p/discover/v5wire/crypto.go b/p2p/discover/v5wire/crypto.go index 704875fd70..582f586702 100644 --- a/p2p/discover/v5wire/crypto.go +++ b/p2p/discover/v5wire/crypto.go @@ -25,10 +25,11 @@ import ( "fmt" "hash" + "golang.org/x/crypto/hkdf" + "github.com/scroll-tech/go-ethereum/common/math" "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/p2p/enode" - "golang.org/x/crypto/hkdf" ) const ( diff --git a/p2p/discover/v5wire/encoding_test.go b/p2p/discover/v5wire/encoding_test.go index 790a967596..b32e9a325d 100644 --- a/p2p/discover/v5wire/encoding_test.go +++ b/p2p/discover/v5wire/encoding_test.go @@ -31,6 +31,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/scroll-tech/go-ethereum/common/hexutil" "github.com/scroll-tech/go-ethereum/common/mclock" "github.com/scroll-tech/go-ethereum/crypto" diff --git a/p2p/discover/v5wire/session.go b/p2p/discover/v5wire/session.go index eb871a7247..376eaedbe7 100644 --- a/p2p/discover/v5wire/session.go +++ b/p2p/discover/v5wire/session.go @@ -23,6 +23,7 @@ import ( "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" diff --git a/p2p/dnsdisc/client.go b/p2p/dnsdisc/client.go index f5a31d4a75..a77ba4afae 100644 --- a/p2p/dnsdisc/client.go +++ b/p2p/dnsdisc/client.go @@ -27,13 +27,14 @@ import ( "time" lru "github.com/hashicorp/golang-lru" + "golang.org/x/sync/singleflight" + "golang.org/x/time/rate" + "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" - "golang.org/x/sync/singleflight" - "golang.org/x/time/rate" ) // Client discovers nodes by querying DNS servers. diff --git a/p2p/dnsdisc/client_test.go b/p2p/dnsdisc/client_test.go index d70827ef70..26783e16bc 100644 --- a/p2p/dnsdisc/client_test.go +++ b/p2p/dnsdisc/client_test.go @@ -26,6 +26,7 @@ import ( "time" "github.com/davecgh/go-spew/spew" + "github.com/scroll-tech/go-ethereum/common/mclock" "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/internal/testlog" diff --git a/p2p/dnsdisc/tree.go b/p2p/dnsdisc/tree.go index be86111afa..a802576108 100644 --- a/p2p/dnsdisc/tree.go +++ b/p2p/dnsdisc/tree.go @@ -26,11 +26,12 @@ import ( "sort" "strings" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/p2p/enode" "github.com/scroll-tech/go-ethereum/p2p/enr" "github.com/scroll-tech/go-ethereum/rlp" - "golang.org/x/crypto/sha3" ) // Tree is a merkle tree of node records. diff --git a/p2p/dnsdisc/tree_test.go b/p2p/dnsdisc/tree_test.go index 2849435824..6a01d92925 100644 --- a/p2p/dnsdisc/tree_test.go +++ b/p2p/dnsdisc/tree_test.go @@ -21,6 +21,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/scroll-tech/go-ethereum/common/hexutil" "github.com/scroll-tech/go-ethereum/p2p/enode" ) diff --git a/p2p/enode/idscheme.go b/p2p/enode/idscheme.go index 974b7094be..0343eec266 100644 --- a/p2p/enode/idscheme.go +++ b/p2p/enode/idscheme.go @@ -21,11 +21,12 @@ import ( "fmt" "io" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common/math" "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/p2p/enr" "github.com/scroll-tech/go-ethereum/rlp" - "golang.org/x/crypto/sha3" ) // List of known secure identity schemes. diff --git a/p2p/enode/idscheme_test.go b/p2p/enode/idscheme_test.go index 71b7565885..d89d32d265 100644 --- a/p2p/enode/idscheme_test.go +++ b/p2p/enode/idscheme_test.go @@ -23,11 +23,12 @@ import ( "math/big" "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/p2p/enr" "github.com/scroll-tech/go-ethereum/rlp" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) var ( diff --git a/p2p/enode/localnode_test.go b/p2p/enode/localnode_test.go index 221899ca81..89f7cc9004 100644 --- a/p2p/enode/localnode_test.go +++ b/p2p/enode/localnode_test.go @@ -21,9 +21,10 @@ import ( "net" "testing" + "github.com/stretchr/testify/assert" + "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/p2p/enr" - "github.com/stretchr/testify/assert" ) func newLocalNodeForTesting() (*LocalNode, *DB) { diff --git a/p2p/enode/node_test.go b/p2p/enode/node_test.go index eb8f67e93d..b6e53dd212 100644 --- a/p2p/enode/node_test.go +++ b/p2p/enode/node_test.go @@ -24,9 +24,10 @@ import ( "testing" "testing/quick" + "github.com/stretchr/testify/assert" + "github.com/scroll-tech/go-ethereum/p2p/enr" "github.com/scroll-tech/go-ethereum/rlp" - "github.com/stretchr/testify/assert" ) var pyRecord, _ = hex.DecodeString("f884b8407098ad865b00a582051940cb9cf36836572411a47278783077011599ed5cd16b76f2635f4e234738f30813a89eb9137e3e3df5266e3a1f11df72ecf1145ccb9c01826964827634826970847f00000189736563703235366b31a103ca634cae0d49acb401d8a4c6b6fe8c55b70d115bf400769cc1400f3258cd31388375647082765f") diff --git a/p2p/enode/nodedb.go b/p2p/enode/nodedb.go index 7062ec5a58..4439a75202 100644 --- a/p2p/enode/nodedb.go +++ b/p2p/enode/nodedb.go @@ -26,13 +26,14 @@ import ( "sync" "time" - "github.com/scroll-tech/go-ethereum/rlp" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/iterator" "github.com/syndtr/goleveldb/leveldb/opt" "github.com/syndtr/goleveldb/leveldb/storage" "github.com/syndtr/goleveldb/leveldb/util" + + "github.com/scroll-tech/go-ethereum/rlp" ) // Keys in the node database. diff --git a/p2p/enr/enr_test.go b/p2p/enr/enr_test.go index db96003305..dc8a53d278 100644 --- a/p2p/enr/enr_test.go +++ b/p2p/enr/enr_test.go @@ -24,9 +24,10 @@ import ( "testing" "time" - "github.com/scroll-tech/go-ethereum/rlp" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/scroll-tech/go-ethereum/rlp" ) var rnd = rand.New(rand.NewSource(time.Now().UnixNano())) diff --git a/p2p/nat/nat.go b/p2p/nat/nat.go index a4bf8339ec..a66e319de7 100644 --- a/p2p/nat/nat.go +++ b/p2p/nat/nat.go @@ -26,6 +26,7 @@ import ( "time" natpmp "github.com/jackpal/go-nat-pmp" + "github.com/scroll-tech/go-ethereum/log" ) diff --git a/p2p/rlpx/buffer_test.go b/p2p/rlpx/buffer_test.go index 15f73d09a1..649bd7d829 100644 --- a/p2p/rlpx/buffer_test.go +++ b/p2p/rlpx/buffer_test.go @@ -20,8 +20,9 @@ import ( "bytes" "testing" - "github.com/scroll-tech/go-ethereum/common/hexutil" "github.com/stretchr/testify/assert" + + "github.com/scroll-tech/go-ethereum/common/hexutil" ) func TestReadBufferReset(t *testing.T) { diff --git a/p2p/rlpx/rlpx.go b/p2p/rlpx/rlpx.go index 8476db05b0..e25061a96a 100644 --- a/p2p/rlpx/rlpx.go +++ b/p2p/rlpx/rlpx.go @@ -35,10 +35,11 @@ import ( "time" "github.com/golang/snappy" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/crypto/ecies" "github.com/scroll-tech/go-ethereum/rlp" - "golang.org/x/crypto/sha3" ) // Conn is an RLPx network connection. It wraps a low-level network connection. The diff --git a/p2p/rlpx/rlpx_test.go b/p2p/rlpx/rlpx_test.go index 3db2ae7999..a493cf24e6 100644 --- a/p2p/rlpx/rlpx_test.go +++ b/p2p/rlpx/rlpx_test.go @@ -29,11 +29,12 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/stretchr/testify/assert" + "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/crypto/ecies" "github.com/scroll-tech/go-ethereum/p2p/simulations/pipes" "github.com/scroll-tech/go-ethereum/rlp" - "github.com/stretchr/testify/assert" ) type message struct { diff --git a/p2p/simulations/adapters/exec.go b/p2p/simulations/adapters/exec.go index cfbc11c79e..e9f880f862 100644 --- a/p2p/simulations/adapters/exec.go +++ b/p2p/simulations/adapters/exec.go @@ -36,6 +36,7 @@ import ( "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" diff --git a/p2p/simulations/adapters/inproc.go b/p2p/simulations/adapters/inproc.go index 9172025c21..a35f98d22e 100644 --- a/p2p/simulations/adapters/inproc.go +++ b/p2p/simulations/adapters/inproc.go @@ -25,6 +25,7 @@ import ( "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" diff --git a/p2p/simulations/adapters/types.go b/p2p/simulations/adapters/types.go index c6f30f3365..40a937628e 100644 --- a/p2p/simulations/adapters/types.go +++ b/p2p/simulations/adapters/types.go @@ -27,6 +27,7 @@ import ( "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" diff --git a/p2p/simulations/http.go b/p2p/simulations/http.go index 135440b85e..ac92cbfbed 100644 --- a/p2p/simulations/http.go +++ b/p2p/simulations/http.go @@ -31,6 +31,7 @@ import ( "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" diff --git a/p2p/simulations/http_test.go b/p2p/simulations/http_test.go index 0c2edc49f8..122b79a0aa 100644 --- a/p2p/simulations/http_test.go +++ b/p2p/simulations/http_test.go @@ -30,6 +30,7 @@ import ( "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" diff --git a/p2p/transport_test.go b/p2p/transport_test.go index f861772eac..4ca6a53888 100644 --- a/p2p/transport_test.go +++ b/p2p/transport_test.go @@ -23,6 +23,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/p2p/simulations/pipes" ) diff --git a/params/config.go b/params/config.go index 5b57a64e2c..6388daa1e7 100644 --- a/params/config.go +++ b/params/config.go @@ -21,8 +21,9 @@ import ( "fmt" "math/big" - "github.com/scroll-tech/go-ethereum/common" "golang.org/x/crypto/sha3" + + "github.com/scroll-tech/go-ethereum/common" ) // Genesis hashes to enforce below configs on. diff --git a/rpc/client_test.go b/rpc/client_test.go index 8166312b3f..c049593271 100644 --- a/rpc/client_test.go +++ b/rpc/client_test.go @@ -33,6 +33,7 @@ import ( "time" "github.com/davecgh/go-spew/spew" + "github.com/scroll-tech/go-ethereum/log" ) diff --git a/rpc/server.go b/rpc/server.go index 2229712fd2..c2245af6b7 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -22,6 +22,7 @@ import ( "sync/atomic" mapset "github.com/deckarep/golang-set" + "github.com/scroll-tech/go-ethereum/log" ) diff --git a/rpc/websocket.go b/rpc/websocket.go index ab9f29cb82..1180bb964f 100644 --- a/rpc/websocket.go +++ b/rpc/websocket.go @@ -29,6 +29,7 @@ import ( mapset "github.com/deckarep/golang-set" "github.com/gorilla/websocket" + "github.com/scroll-tech/go-ethereum/log" ) diff --git a/signer/rules/rules.go b/signer/rules/rules.go index c69e9af901..bc797b8191 100644 --- a/signer/rules/rules.go +++ b/signer/rules/rules.go @@ -23,6 +23,7 @@ import ( "strings" "github.com/dop251/goja" + "github.com/scroll-tech/go-ethereum/internal/ethapi" "github.com/scroll-tech/go-ethereum/internal/jsre/deps" "github.com/scroll-tech/go-ethereum/log" diff --git a/signer/storage/aes_gcm_storage_test.go b/signer/storage/aes_gcm_storage_test.go index a72847abec..b2cd68283c 100644 --- a/signer/storage/aes_gcm_storage_test.go +++ b/signer/storage/aes_gcm_storage_test.go @@ -24,6 +24,7 @@ import ( "testing" "github.com/mattn/go-colorable" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/log" ) diff --git a/tests/fuzzers/abi/abifuzzer.go b/tests/fuzzers/abi/abifuzzer.go index 306eb51474..b1e8518957 100644 --- a/tests/fuzzers/abi/abifuzzer.go +++ b/tests/fuzzers/abi/abifuzzer.go @@ -22,6 +22,7 @@ import ( "strings" fuzz "github.com/google/gofuzz" + "github.com/scroll-tech/go-ethereum/accounts/abi" ) diff --git a/tests/fuzzers/bls12381/bls12381_fuzz.go b/tests/fuzzers/bls12381/bls12381_fuzz.go index 48f3d23648..de8b73b1b6 100644 --- a/tests/fuzzers/bls12381/bls12381_fuzz.go +++ b/tests/fuzzers/bls12381/bls12381_fuzz.go @@ -29,6 +29,7 @@ import ( gnark "github.com/consensys/gnark-crypto/ecc/bls12-381" "github.com/consensys/gnark-crypto/ecc/bls12-381/fp" "github.com/consensys/gnark-crypto/ecc/bls12-381/fr" + "github.com/scroll-tech/go-ethereum/crypto/bls12381" ) diff --git a/tests/fuzzers/bn256/bn256_fuzz.go b/tests/fuzzers/bn256/bn256_fuzz.go index 37ccdcf19a..68d660ade1 100644 --- a/tests/fuzzers/bn256/bn256_fuzz.go +++ b/tests/fuzzers/bn256/bn256_fuzz.go @@ -14,6 +14,7 @@ import ( "math/big" "github.com/consensys/gnark-crypto/ecc/bn254" + cloudflare "github.com/scroll-tech/go-ethereum/crypto/bn256/cloudflare" google "github.com/scroll-tech/go-ethereum/crypto/bn256/google" ) diff --git a/tests/fuzzers/stacktrie/trie_fuzzer.go b/tests/fuzzers/stacktrie/trie_fuzzer.go index e8f90d09f2..3fba704c73 100644 --- a/tests/fuzzers/stacktrie/trie_fuzzer.go +++ b/tests/fuzzers/stacktrie/trie_fuzzer.go @@ -25,10 +25,11 @@ import ( "io" "sort" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/ethdb" "github.com/scroll-tech/go-ethereum/trie" - "golang.org/x/crypto/sha3" ) type fuzzer struct { diff --git a/tests/state_test_util.go b/tests/state_test_util.go index b0ea4bbcbf..1c8ab2c997 100644 --- a/tests/state_test_util.go +++ b/tests/state_test_util.go @@ -24,6 +24,8 @@ import ( "strconv" "strings" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/hexutil" "github.com/scroll-tech/go-ethereum/common/math" @@ -37,7 +39,6 @@ import ( "github.com/scroll-tech/go-ethereum/ethdb" "github.com/scroll-tech/go-ethereum/params" "github.com/scroll-tech/go-ethereum/rlp" - "golang.org/x/crypto/sha3" ) // StateTest checks transaction processing without block context. diff --git a/trie/committer.go b/trie/committer.go index edc3685391..9cf53c069e 100644 --- a/trie/committer.go +++ b/trie/committer.go @@ -21,9 +21,10 @@ import ( "fmt" "sync" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/crypto" - "golang.org/x/crypto/sha3" ) // leafChanSize is the size of the leafCh. It's a pretty arbitrary number, to allow diff --git a/trie/database.go b/trie/database.go index 7b25d96e09..e6c175c3f8 100644 --- a/trie/database.go +++ b/trie/database.go @@ -26,6 +26,7 @@ import ( "time" "github.com/VictoriaMetrics/fastcache" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/rawdb" "github.com/scroll-tech/go-ethereum/ethdb" diff --git a/trie/hasher.go b/trie/hasher.go index 286d0d6d4a..6e495cb65b 100644 --- a/trie/hasher.go +++ b/trie/hasher.go @@ -19,9 +19,10 @@ package trie import ( "sync" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/crypto" "github.com/scroll-tech/go-ethereum/rlp" - "golang.org/x/crypto/sha3" ) type sliceBuffer []byte diff --git a/trie/sync_bloom.go b/trie/sync_bloom.go index d56a428bc7..eee37ad931 100644 --- a/trie/sync_bloom.go +++ b/trie/sync_bloom.go @@ -24,6 +24,7 @@ import ( "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" diff --git a/trie/trie_test.go b/trie/trie_test.go index 1f35d9e3d3..5a3ef03790 100644 --- a/trie/trie_test.go +++ b/trie/trie_test.go @@ -31,6 +31,8 @@ import ( "testing/quick" "github.com/davecgh/go-spew/spew" + "golang.org/x/crypto/sha3" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/types" "github.com/scroll-tech/go-ethereum/crypto" @@ -38,7 +40,6 @@ import ( "github.com/scroll-tech/go-ethereum/ethdb/leveldb" "github.com/scroll-tech/go-ethereum/ethdb/memorydb" "github.com/scroll-tech/go-ethereum/rlp" - "golang.org/x/crypto/sha3" ) func init() {