-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add import allow-list for geth (#988)
* core/rawdb: should not import go-ethereum's rawdb * Add import allow-list for geth * Update scripts/lint_imports.sh Co-authored-by: Ceyhun Onur <[email protected]> * remove trie import * remove trie, rawdb * rename to allowed-packages * Rename geth linting script * scripts: add comment to lint allowed geth imports script Co-authored-by: Ceyhun Onur <[email protected]> Co-authored-by: Aaron Buchwald <[email protected]>
- Loading branch information
1 parent
77798a9
commit 3e233a2
Showing
5 changed files
with
37 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
"github.com/ethereum/go-ethereum/cmd/utils" | ||
"github.com/ethereum/go-ethereum/common" | ||
"github.com/ethereum/go-ethereum/common/bitutil" | ||
"github.com/ethereum/go-ethereum/common/compiler" | ||
"github.com/ethereum/go-ethereum/common/hexutil" | ||
"github.com/ethereum/go-ethereum/common/math" | ||
"github.com/ethereum/go-ethereum/common/prque" | ||
"github.com/ethereum/go-ethereum/core/asm" | ||
"github.com/ethereum/go-ethereum/crypto" | ||
"github.com/ethereum/go-ethereum/crypto/blake2b" | ||
"github.com/ethereum/go-ethereum/crypto/bls12381" | ||
"github.com/ethereum/go-ethereum/crypto/bn256" | ||
"github.com/ethereum/go-ethereum/event" | ||
"github.com/ethereum/go-ethereum/log" | ||
"github.com/ethereum/go-ethereum/rlp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
# Ensure that there are no geth imports that are not marked as explicitly allowed via ./scripts/geth-allowed-packages.txt | ||
# 1. Recursively search through all go files for any lines that include a direct import from go-ethereum | ||
# 2. Sort the unique results | ||
# #. Print out the difference between the search results and the list of specified allowed package imports from geth. | ||
extra_imports=$(grep -r --include='*.go' '"github.com/ethereum/go-ethereum/.*"' -o -h | sort -u | comm -23 - ./scripts/geth-allowed-packages.txt) | ||
if [ ! -z "${extra_imports}" ]; then | ||
echo "new go-ethereum imports should be added to ./scripts/geth-allowed-packages.txt to prevent accidental imports:" | ||
echo "${extra_imports}" | ||
exit 1 | ||
fi |