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 d9771d04d678..31b1ee79e192 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 d3aaa516c70f..af1afd562317 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 81d25eb4018b..c3c0d83f4922 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 f20fd385f492..32f5122baeab 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 813af0f11eab..3f4be23b22fd 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 46855487c50c..bfc9f9d2d992 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 cf0c1faca23e..b686f966e460 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 49d25a7efe4e..f486ec2b5acb 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 b4da358fd498..545868dbff11 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 e495b88aceb5..60a4b6a573f2 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 f58e8f4ef16a..1559e7ae1d40 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 ed5e930d8ff9..d8d7a8659709 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 66e2ab82331f..2277cde09c28 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 bcae67f469a3..e8f89e9a42fc 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 eeb06b190008..fa9903455265 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 ad0c47f41c91..01b8bb019f81 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 eb61c91eaf03..ed1e4f6ef526 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 62352d2304f8..28fc9f352cda 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 d17bb293c065..b406fcc3d9ba 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 fd6dc48fbd80..1d3d6aad1044 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 890f1a65964e..24b3f12bc9d1 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 2ffe5ff963ef..c26755c83a1f 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 01433eb360eb..8cc61a82c111 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 0a034b89339b..7b788a97884b 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 eb199fbc403f..0e5b339fd564 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 2582bd64acf4..501a66854c8a 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 e4c922de7fac..febbe6ac3847 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 48526ec3586f..6e36c6b573fc 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 915f207743e8..c1a30ecc2249 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 26f507895241..6367fb69c2e6 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 de7aa924cebd..5f388fb4202f 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 9f3bf2f3a873..fc07a529a8a7 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 582da14d0848..806545925638 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 e1c447111ef4..70d773f72101 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 fc36d5cd3bae..6058248e5ef8 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 ed9bcccea8e9..0d3c5ec56d24 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 7e12150682c8..03cedee3bf3a 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 accdf7c54793..210639c55e9e 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 2da30e4b260d..eeda265f16e3 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 d9403333e0d4..908db1ba4bfe 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 84883b9f7625..b06a8722971e 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 7c24d08f223e..e364daae0c14 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 b942971493e6..8056b432ba25 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 30ba99595f1d..b3ad691a92d0 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 e00be7caae6f..2c06fe34181a 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 a7d1cf556150..689877f1235f 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 076f55164eac..ba2caa2188e5 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 6bddd730e6a7..9ff0817c7fd7 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 705481143d03..23b3e13fd596 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 65ae86cb45dd..b06205f74ef0 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 053614e33f56..dec8003acbde 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 99e8ade39816..a2516173331d 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 7d615f8d4486..95df3282cc07 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 043d86fde152..ecbf8ebdb678 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 39db083dff40..e8d7774e2072 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 beb1224349ad..6290347b4e3e 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 9a2104655a6a..c7ba6a572ab0 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 31201c319dc2..afb2ca067797 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 90545f1fe17f..914cccb6d6f4 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 ad1e10496a4e..95cc0b69dd56 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 542d57cd37d9..c8e08e285604 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 2a8b65d08166..ac2cc7542b3c 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 99ac2fee06b2..c1832dcaf8e6 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 9b7666113383..4a3f3077a290 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 c8e69032d078..804eccd0cbce 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 631b3066ecd1..515d6634b2b6 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 7643567008a8..2119d3d43d15 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 15c9c2e3eb1f..3e80b50717f8 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 77bf060c1370..2cef91ca2b0b 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 fd66f6ddc178..cb602d00477f 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 40f0ae248756..7e23c767fbea 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 3b5f47af1bec..44dc8271ec07 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 8a3df2793a52..3ce79e2f58f8 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 8266fa537192..ce62bdd460e8 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 21209da376fb..8ebe73163876 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 170b3922fa5d..8bc084a54d8b 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 5a784c1bc59a..a7f6c3928dbd 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 7152cf450a28..702b029d52e5 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 03f8577f0cc1..cab5a2d8fe8c 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 676d587f258e..96e4bbb8cbf7 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 721ece6a394d..c7478b8fb76f 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 92f2cdf65cf0..8052363503ea 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 f92c190c2850..541f9e386d27 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 619634e8352d..4e392c82615e 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 c2d86ce95546..dde05c392fbf 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 471b23b9d864..c3f662be7ab3 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 f3c669a90eb9..cbf6fc446b51 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 b95208a4f568..9264bb62ec1b 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 4a806d31c271..f047d654d9e2 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 6fefd65e9aba..9f5fffc5d8c3 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 8f1fedd54d6e..c4f2a8909e3f 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 217b14c2b828..0b43504f00cd 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 cd22f8b78496..ab0510a78241 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 2ba0c5e5020e..ea8cd6e830be 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 072c5873c3c6..4d6b96cd8e7c 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 8fbcf75549b8..40c90f379495 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 30fab0754785..ca418248eafe 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 c89e773fe2a4..31387c3f4367 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 56e41afbfd64..b42c92121569 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 3afcfedc12cd..48639bfd35ba 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 8cf472db3226..bedee8a1fe1f 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 c0e1be6d96b5..1b9539fb03bd 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 854b542cae98..ab3f462eb0e5 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 adce24293306..df7ac35eb822 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 5bebfc8d462f..3bc081278e76 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 ef239917c4cd..e108d064284e 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 8f3bd384e01c..9421fee08dee 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 779460ad2131..821f161cc919 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 13f1385ac4aa..a28231952baf 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 8cae034d4215..c1cde9cfcd0c 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 05dc1ad67ca4..52282c05f21a 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 42b5673ad435..3c2ce3b3fe00 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 997e907fa313..28f9dc4f8c5c 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 91a1e1eaedc7..5792071e00e5 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 d465569a5171..f9a5afdb49bb 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 b16ceb632fb2..0af12970caac 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 6ae64cefd656..7200641560ba 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 befc4584fe14..261243288f84 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 5923e21c45f3..00288eaac7f9 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 d38fa29b758b..fdafb321a81f 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 20ad986f2175..48e2fd56947e 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 07bced2846f9..f1ccf3754166 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 295f68a1b89e..27845562db77 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 f65ad39ea8d1..317fb73c900c 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 5c8b85c5a8bc..e4db59a4e767 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 5494ca6f31b3..c4845a34d713 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 48e2d5ef92ba..7c27fb424700 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 390eb43992d8..20f959a8edf9 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 a08cb02f3d2e..2e0c4346aca4 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 43fbba0761f5..31b11893c9b8 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 7e252ae131bd..bca0340c2aa9 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 c98e6b66008a..ee2e044fa4e9 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 427330e04f9c..33ff84b546e1 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 acb351f70634..08e099e92e80 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 f5a26457d518..d0533be8f79d 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 0387ec961532..4a696238e28a 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 3ed95fcb6e69..6c7cb3a7c099 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 1f663d428a2d..f5bd7e8d2cb8 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 bdfbf97ee889..28a7eaeedf23 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 5c957dc0afcf..8d28fe64571f 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 766401e2bc75..d941f03b6b7a 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 f36d01e759b1..6c9c79cfe93b 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 88d023df3d33..1e9eeb626db9 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 5c8b85c5a8bc..e4db59a4e767 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 d9d5c4e00aea..80ebc0e2de44 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 0b8636f49945..f14b1679c826 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 787660717a8b..a6016ca128d4 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 39d86557e3d2..3dda9ebdb409 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 e74125f53009..856e07b6c6cb 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 2f67cd481616..c562a281b794 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 97c9f9523b3c..24808791a98d 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 35ce903670db..ce8de2d0856c 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 9e14aa41143f..b81ed205a344 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 ad4fdb863224..7363480ee8b0 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 6f5bc1e001cb..cf7ff642a906 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 33023fcddaea..11c00eb0f40a 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 097b93461036..5ca5ebee7922 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 704875fd7025..582f58670255 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 790a9675966e..b32e9a325de5 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 eb871a7247a9..376eaedbe74f 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 f5a31d4a75fc..a77ba4afaee3 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 d70827ef707a..26783e16bc68 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 be86111afa20..a80257610887 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 28494358248e..6a01d9292534 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 974b7094becc..0343eec266d0 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 71b756588591..d89d32d26554 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 221899ca81e8..89f7cc9004d5 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 eb8f67e93d4f..b6e53dd212ec 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 7062ec5a5870..4439a7520244 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 db96003305ce..dc8a53d27829 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 a4bf8339ec72..a66e319de7a7 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 15f73d09a13f..649bd7d82916 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 8476db05b061..e25061a96aed 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 3db2ae7999b8..a493cf24e6f6 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 cfbc11c79eb4..e9f880f862a5 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 9172025c2184..a35f98d22ef0 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 c6f30f3365c9..40a937628eaf 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 135440b85e22..ac92cbfbed28 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 0c2edc49f8ed..122b79a0aa14 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 f861772eacb4..4ca6a5388804 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 5b57a64e2c55..6388daa1e705 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 8166312b3f75..c04959327103 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 2229712fd2a4..c2245af6b7ff 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 ab9f29cb829f..1180bb964f17 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 c69e9af90173..bc797b819198 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 a72847abec98..b2cd68283c7f 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 306eb5147404..b1e85189573e 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 48f3d23648bc..de8b73b1b6cc 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 37ccdcf19a2b..68d660ade1c5 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 e8f90d09f246..3fba704c73f4 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 b0ea4bbcbf29..1c8ab2c99757 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 edc36853912f..9cf53c069e05 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 7b25d96e0989..e6c175c3f85a 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 286d0d6d4a02..6e495cb65bd7 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 d56a428bc7fa..eee37ad93150 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 1f35d9e3d3d5..5a3ef03790a7 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() {