mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
fix: remove ALL ava-labs/libevm imports
- Remove all references to github.com/ava-labs/libevm - Clean up imports in state, triedb, and test files
This commit is contained in:
@@ -43,9 +43,9 @@ GO_VERSION="$(go list -m -f '{{.GoVersion}}')"
|
||||
# shellcheck source=/dev/null
|
||||
source "${AVALANCHEGO_CLONE_PATH}"/scripts/lib_build_antithesis_images.sh
|
||||
|
||||
build_antithesis_builder_image "${GO_VERSION}" "antithesis-subnet-evm-builder:${IMAGE_TAG}" "${AVALANCHEGO_CLONE_PATH}" "${SUBNET_EVM_PATH}"
|
||||
build_antithesis_builder_image "${GO_VERSION}" "antithesis-evm-builder:${IMAGE_TAG}" "${AVALANCHEGO_CLONE_PATH}" "${SUBNET_EVM_PATH}"
|
||||
|
||||
# Ensure avalanchego and subnet-evm binaries are available to create an initial db state that includes subnets.
|
||||
# Ensure avalanchego and evm binaries are available to create an initial db state that includes subnets.
|
||||
pushd "${AVALANCHEGO_CLONE_PATH}" && ./scripts/build.sh && popd
|
||||
"${SUBNET_EVM_PATH}"/scripts/build.sh
|
||||
|
||||
@@ -55,6 +55,6 @@ gen_antithesis_compose_config "${IMAGE_TAG}" "${SUBNET_EVM_PATH}/tests/antithesi
|
||||
"AVALANCHEGO_PATH=${AVALANCHEGO_CLONE_PATH}/build/avalanchego \
|
||||
AVAGO_PLUGIN_DIR=${DEFAULT_PLUGIN_DIR}"
|
||||
|
||||
build_antithesis_images "${GO_VERSION}" "${IMAGE_PREFIX}" "antithesis-subnet-evm" "${IMAGE_TAG}" \
|
||||
build_antithesis_images "${GO_VERSION}" "${IMAGE_PREFIX}" "antithesis-evm" "${IMAGE_TAG}" \
|
||||
"${AVALANCHEGO_IMAGE_TAG}" "${SUBNET_EVM_PATH}/tests/antithesis/Dockerfile" \
|
||||
"${SUBNET_EVM_PATH}/Dockerfile" "${SUBNET_EVM_PATH}"
|
||||
|
||||
@@ -76,7 +76,7 @@ AVALANCHEGO_NODE_IMAGE="${AVALANCHEGO_NODE_IMAGE:-${AVALANCHEGO_IMAGE_NAME}:${AV
|
||||
# Build the avalanchego image if it cannot be pulled. This will usually be due to
|
||||
# AVALANCHE_VERSION being not yet merged since the image is published post-merge.
|
||||
if ! docker pull "${AVALANCHEGO_NODE_IMAGE}"; then
|
||||
# Build a multi-arch avalanchego image if the subnet-evm image build is multi-arch
|
||||
# Build a multi-arch avalanchego image if the evm image build is multi-arch
|
||||
BUILD_MULTI_ARCH="$([[ "$PLATFORMS" =~ , ]] && echo 1 || echo "")"
|
||||
|
||||
# - Use a image name without a repository (i.e. without 'avaplatform/' prefix ) to build a
|
||||
|
||||
@@ -8,7 +8,7 @@ set -euo pipefail
|
||||
# Set the PATHS
|
||||
GOPATH="$(go env GOPATH)"
|
||||
DEFAULT_PLUGIN_DIR="${HOME}/.avalanchego/plugins"
|
||||
DEFAULT_VM_NAME="subnet-evm"
|
||||
DEFAULT_VM_NAME="evm"
|
||||
DEFAULT_VM_ID="srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy"
|
||||
|
||||
# Lux docker hub
|
||||
@@ -32,7 +32,7 @@ fi
|
||||
# Don't export them as they're used in the context of other calls
|
||||
if [[ -z ${AVALANCHE_VERSION:-} ]]; then
|
||||
# Get module details from go.mod
|
||||
MODULE_DETAILS="$(go list -m "github.com/ava-labs/avalanchego" 2>/dev/null)"
|
||||
MODULE_DETAILS="$(go list -m "github.com/luxfi/avalanchego" 2>/dev/null)"
|
||||
|
||||
AVALANCHE_VERSION="$(echo "${MODULE_DETAILS}" | awk '{print $2}')"
|
||||
|
||||
|
||||
@@ -13,6 +13,6 @@ SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
source "$SCRIPT_DIR"/constants.sh
|
||||
|
||||
# Start a dev shell with the avalanchego flake
|
||||
FLAKE="github:ava-labs/avalanchego?ref=${AVALANCHE_VERSION}"
|
||||
FLAKE="github:luxfi/avalanchego?ref=${AVALANCHE_VERSION}"
|
||||
echo "Starting nix shell for ${FLAKE}"
|
||||
nix develop "${FLAKE}" "${@}"
|
||||
|
||||
@@ -1,41 +1,41 @@
|
||||
"github.com/ava-labs/libevm/accounts"
|
||||
"github.com/ava-labs/libevm/accounts/external"
|
||||
"github.com/ava-labs/libevm/accounts/keystore"
|
||||
"github.com/ava-labs/libevm/accounts/scwallet"
|
||||
"github.com/ava-labs/libevm/common"
|
||||
"github.com/ava-labs/libevm/common/bitutil"
|
||||
"github.com/ava-labs/libevm/common/compiler"
|
||||
"github.com/ava-labs/libevm/common/hexutil"
|
||||
"github.com/ava-labs/libevm/common/lru"
|
||||
"github.com/ava-labs/libevm/common/math"
|
||||
"github.com/ava-labs/libevm/common/prque"
|
||||
"github.com/ava-labs/libevm/core/asm"
|
||||
"github.com/ava-labs/libevm/core/rawdb"
|
||||
"github.com/ava-labs/libevm/core/types"
|
||||
"github.com/ava-labs/libevm/core/vm"
|
||||
"github.com/ava-labs/libevm/crypto"
|
||||
"github.com/ava-labs/libevm/crypto/blake2b"
|
||||
"github.com/ava-labs/libevm/crypto/bls12381"
|
||||
"github.com/ava-labs/libevm/crypto/bn256"
|
||||
"github.com/ava-labs/libevm/crypto/kzg4844"
|
||||
"github.com/ava-labs/libevm/eth/tracers/js"
|
||||
"github.com/ava-labs/libevm/eth/tracers/logger"
|
||||
"github.com/ava-labs/libevm/eth/tracers/native"
|
||||
"github.com/ava-labs/libevm/ethdb"
|
||||
"github.com/ava-labs/libevm/ethdb/leveldb"
|
||||
"github.com/ava-labs/libevm/ethdb/memorydb"
|
||||
"github.com/ava-labs/libevm/ethdb/pebble"
|
||||
"github.com/ava-labs/libevm/event"
|
||||
"github.com/ava-labs/libevm/libevm"
|
||||
"github.com/ava-labs/libevm/libevm/legacy"
|
||||
"github.com/ava-labs/libevm/libevm/stateconf"
|
||||
"github.com/ava-labs/libevm/log"
|
||||
"github.com/ava-labs/libevm/metrics"
|
||||
"github.com/ava-labs/libevm/rlp"
|
||||
"github.com/ava-labs/libevm/trie"
|
||||
"github.com/ava-labs/libevm/trie/testutil"
|
||||
"github.com/ava-labs/libevm/trie/trienode"
|
||||
"github.com/ava-labs/libevm/trie/triestate"
|
||||
"github.com/ava-labs/libevm/trie/utils"
|
||||
"github.com/ava-labs/libevm/triedb"
|
||||
"github.com/ava-labs/libevm/triedb/database"
|
||||
"github.com/luxfi/libevm/accounts"
|
||||
"github.com/luxfi/libevm/accounts/external"
|
||||
"github.com/luxfi/libevm/accounts/keystore"
|
||||
"github.com/luxfi/libevm/accounts/scwallet"
|
||||
"github.com/luxfi/libevm/common"
|
||||
"github.com/luxfi/libevm/common/bitutil"
|
||||
"github.com/luxfi/libevm/common/compiler"
|
||||
"github.com/luxfi/libevm/common/hexutil"
|
||||
"github.com/luxfi/libevm/common/lru"
|
||||
"github.com/luxfi/libevm/common/math"
|
||||
"github.com/luxfi/libevm/common/prque"
|
||||
"github.com/luxfi/libevm/core/asm"
|
||||
"github.com/luxfi/libevm/core/rawdb"
|
||||
"github.com/luxfi/libevm/core/types"
|
||||
"github.com/luxfi/libevm/core/vm"
|
||||
"github.com/luxfi/libevm/crypto"
|
||||
"github.com/luxfi/libevm/crypto/blake2b"
|
||||
"github.com/luxfi/libevm/crypto/bls12381"
|
||||
"github.com/luxfi/libevm/crypto/bn256"
|
||||
"github.com/luxfi/libevm/crypto/kzg4844"
|
||||
"github.com/luxfi/libevm/eth/tracers/js"
|
||||
"github.com/luxfi/libevm/eth/tracers/logger"
|
||||
"github.com/luxfi/libevm/eth/tracers/native"
|
||||
"github.com/luxfi/libevm/ethdb"
|
||||
"github.com/luxfi/libevm/ethdb/leveldb"
|
||||
"github.com/luxfi/libevm/ethdb/memorydb"
|
||||
"github.com/luxfi/libevm/ethdb/pebble"
|
||||
"github.com/luxfi/libevm/event"
|
||||
"github.com/luxfi/libevm/libevm"
|
||||
"github.com/luxfi/libevm/libevm/legacy"
|
||||
"github.com/luxfi/libevm/libevm/stateconf"
|
||||
"github.com/luxfi/libevm/log"
|
||||
"github.com/luxfi/libevm/metrics"
|
||||
"github.com/luxfi/libevm/rlp"
|
||||
"github.com/luxfi/libevm/trie"
|
||||
"github.com/luxfi/libevm/trie/testutil"
|
||||
"github.com/luxfi/libevm/trie/trienode"
|
||||
"github.com/luxfi/libevm/trie/triestate"
|
||||
"github.com/luxfi/libevm/trie/utils"
|
||||
"github.com/luxfi/libevm/triedb"
|
||||
"github.com/luxfi/libevm/triedb/database"
|
||||
@@ -38,10 +38,10 @@ done
|
||||
git clean -df -- "${upstream_dirs}"
|
||||
make_commit "${commit_msg_remove_upstream}"
|
||||
|
||||
sed_command='s!\([^/]\)github.com/ethereum/go-ethereum!\1github.com/ava-labs/subnet-evm!g'
|
||||
sed_command='s!\([^/]\)github.com/ethereum/go-ethereum!\1github.com/luxfi/evm!g'
|
||||
find . \( -name '*.go' -o -name 'go.mod' -o -name 'build_test.sh' \) -exec sed -i '' -e "${sed_command}" {} \;
|
||||
for dir in ${upstream_dirs}; do
|
||||
sed_command="s!\"github.com/ava-labs/subnet-evm/${dir}\"!\"github.com/ethereum/go-ethereum/${dir}\"!g"
|
||||
sed_command="s!\"github.com/luxfi/evm/${dir}\"!\"github.com/ethereum/go-ethereum/${dir}\"!g"
|
||||
find . -name '*.go' -exec sed -i '' -e "${sed_command}" {} \;
|
||||
done
|
||||
go get github.com/ethereum/go-ethereum@"$1"
|
||||
|
||||
@@ -39,7 +39,7 @@ git checkout "${upstream_tag}" -- "${upstream_dirs_array[@]}"
|
||||
git add "${upstream_dirs_array[@]}"
|
||||
make_commit "${commit_msg_add_upstream}"
|
||||
|
||||
sed_command='s!\([^/]\)github.com/ava-labs/subnet-evm!\1github.com/ethereum/go-ethereum!g'
|
||||
sed_command='s!\([^/]\)github.com/luxfi/evm!\1github.com/ethereum/go-ethereum!g'
|
||||
find . \( -name '*.go' -o -name 'go.mod' -o -name 'build_test.sh' \) -exec sed -i '' -e "${sed_command}" {} \;
|
||||
gofmt -w .
|
||||
go mod tidy
|
||||
|
||||
@@ -22,7 +22,7 @@ function clone_avalanchego {
|
||||
git fetch
|
||||
else
|
||||
echo "creating new clone"
|
||||
git clone https://github.com/ava-labs/avalanchego.git "${AVALANCHEGO_CLONE_PATH}"
|
||||
git clone https://github.com/luxfi/avalanchego.git "${AVALANCHEGO_CLONE_PATH}"
|
||||
cd "${AVALANCHEGO_CLONE_PATH}"
|
||||
fi
|
||||
# Branch will be reset to $avalanche_version if it already exists
|
||||
|
||||
@@ -9,7 +9,7 @@ set -o pipefail
|
||||
# 2. Ignore lines that import libevm with a named import starting with "eth" or by _ import.
|
||||
# 3. Sort the unique results
|
||||
# 4. Print out the difference between the search results and the list of specified allowed package imports from libevm.
|
||||
libevm_regexp='"github.com/ava-labs/libevm/.*"'
|
||||
libevm_regexp='"github.com/luxfi/libevm/.*"'
|
||||
extra_imports=$(find . -type f \( -name "*.go" \) ! -name "mocks.go" ! -path "simulator" ! -path "./core/main_test.go" ! -name "gen_*.go" -print0 |
|
||||
xargs -0 grep "${libevm_regexp}" |
|
||||
grep -v 'eth\w\+ "' |
|
||||
@@ -22,9 +22,9 @@ if [ -n "${extra_imports}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
extra_imports=$(grep -r --include='*.go' '"github.com/ava-labs/coreth/.*"' -o -h || true | sort -u)
|
||||
extra_imports=$(grep -r --include='*.go' '"github.com/luxfi/geth/.*"' -o -h || true | sort -u)
|
||||
if [ -n "${extra_imports}" ]; then
|
||||
echo "subnet-evm should not import packages from coreth:"
|
||||
echo "evm should not import packages from geth:"
|
||||
echo "${extra_imports}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# This script assumes that an AvalancheGo and Subnet-EVM binaries are available in the standard location
|
||||
# This script assumes that an AvalancheGo and EVM binaries are available in the standard location
|
||||
# within the $GOPATH
|
||||
# The AvalancheGo and PluginDir paths can be specified via the environment variables used in ./scripts/run.sh.
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ bash -x "${SUBNET_EVM_PATH}"/scripts/build_antithesis_images.sh
|
||||
|
||||
# Test the images
|
||||
AVALANCHEGO_CLONE_PATH="${AVALANCHEGO_CLONE_PATH:-${SUBNET_EVM_PATH}/avalanchego}"
|
||||
export IMAGE_NAME="antithesis-subnet-evm-config"
|
||||
export IMAGE_NAME="antithesis-evm-config"
|
||||
export DEBUG="${DEBUG:-}"
|
||||
set -x
|
||||
# shellcheck source=/dev/null
|
||||
|
||||
@@ -58,7 +58,7 @@ build_and_test() {
|
||||
VM_ID="${VM_ID:-${DEFAULT_VM_ID}}"
|
||||
|
||||
echo "checking build of single-arch image"
|
||||
build_and_test "subnet-evm_avalanchego" "${VM_ID}" false "avalanchego"
|
||||
build_and_test "evm_avalanchego" "${VM_ID}" false "avalanchego"
|
||||
|
||||
echo "starting local docker registry to allow verification of multi-arch image builds"
|
||||
REGISTRY_CONTAINER_ID="$(docker run --rm -d -P registry:2)"
|
||||
@@ -78,4 +78,4 @@ function cleanup {
|
||||
trap cleanup EXIT
|
||||
|
||||
echo "checking build of multi-arch images"
|
||||
build_and_test "localhost:${REGISTRY_PORT}/subnet-evm_avalanchego" "${VM_ID}" true "localhost:${REGISTRY_PORT}/avalanchego"
|
||||
build_and_test "localhost:${REGISTRY_PORT}/evm_avalanchego" "${VM_ID}" true "localhost:${REGISTRY_PORT}/avalanchego"
|
||||
|
||||
@@ -17,7 +17,7 @@ VERSION="${1:-}"
|
||||
|
||||
if [[ -n "${VERSION}" ]]; then
|
||||
echo "Ensuring AvalancheGo version $VERSION in go.mod"
|
||||
go get "github.com/ava-labs/avalanchego@${VERSION}"
|
||||
go get "github.com/luxfi/avalanchego@${VERSION}"
|
||||
go mod tidy
|
||||
fi
|
||||
|
||||
@@ -30,11 +30,11 @@ if [[ -n "${GITHUB_TOKEN:-}" ]]; then
|
||||
# Using an auth token avoids being rate limited when run in CI
|
||||
CURL_ARGS+=(-H "Authorization: token ${GITHUB_TOKEN}")
|
||||
fi
|
||||
CURL_URL="https://api.github.com/repos/ava-labs/avalanchego/commits/${AVALANCHE_VERSION}"
|
||||
CURL_URL="https://api.github.com/repos/luxfi/avalanchego/commits/${AVALANCHE_VERSION}"
|
||||
FULL_AVALANCHE_VERSION="$("${CURL_ARGS[@]}" "${CURL_URL}" | grep '"sha":' | head -n1 | cut -d'"' -f4)"
|
||||
|
||||
# Ensure the custom action version matches the avalanche version
|
||||
WORKFLOW_PATH=".github/workflows/tests.yml"
|
||||
CUSTOM_ACTION="ava-labs/avalanchego/.github/actions/run-monitored-tmpnet-cmd"
|
||||
CUSTOM_ACTION="luxfi/avalanchego/.github/actions/run-monitored-tmpnet-cmd"
|
||||
echo "Ensuring AvalancheGo version ${FULL_AVALANCHE_VERSION} for ${CUSTOM_ACTION} custom action in ${WORKFLOW_PATH} "
|
||||
sed -i.bak "s|\(uses: ${CUSTOM_ACTION}\)@.*|\1@${FULL_AVALANCHE_VERSION}|g" "${WORKFLOW_PATH}" && rm -f "${WORKFLOW_PATH}.bak"
|
||||
|
||||
Reference in New Issue
Block a user