diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 689caceb9dba..6f9fd1c6e2b8 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,13 +10,23 @@ updates: schedule: interval: "daily" open-pull-requests-limit: 0 # Disable non-security version updates - - package-ecosystem: "gomod" # See documentation for possible values - directory: "/graft/coreth" # Location of package manifests + - package-ecosystem: "gomod" + directory: "/graft/coreth" schedule: interval: "daily" - open-pull-requests-limit: 0 # Disable non-security version updates + open-pull-requests-limit: 0 + - package-ecosystem: "gomod" + directory: "/graft/subnet-evm" + schedule: + interval: "daily" + open-pull-requests-limit: 0 + - package-ecosystem: "gomod" + directory: "/graft/evm" + schedule: + interval: "daily" + open-pull-requests-limit: 0 - package-ecosystem: github-actions directory: "/" schedule: interval: weekly - open-pull-requests-limit: 0 # Disable non-security version updates + open-pull-requests-limit: 0 diff --git a/graft/Taskfile.yml b/graft/Taskfile.yml index 850a7f90365a..694fd73aaed2 100644 --- a/graft/Taskfile.yml +++ b/graft/Taskfile.yml @@ -4,25 +4,16 @@ version: '3' -vars: - CORETH_MODULE: github.com/ava-labs/coreth - SUBNET_EVM_MODULE: github.com/ava-labs/subnet-evm +# vars: + # REPO_MODULE: github.com/ava-labs/REPO_NAME tasks: default: ../scripts/run_task.sh --list - coreth-rewrite-imports: - desc: Rewrite imports of out-of-tree coreth to in-tree coreth - cmd: bash ./scripts/rewrite-imports.sh {{.CORETH_MODULE}} + # REPO_NAME-rewrite-imports: + # desc: Rewrite imports of out-of-tree REPO_NAME to in-tree REPO_NAME + # cmd: bash ./scripts/rewrite-imports.sh {{.REPO_MODULE}} - coreth-subtree-merge: - desc: Perform git subtree merge of coreth into graft/coreth (commits) - cmd: bash ./scripts/subtree-merge.sh {{.CORETH_MODULE}} master - - subnet-evm-rewrite-imports: - desc: Rewrite imports of out-of-tree subnet-evm to in-tree subnet-evm - cmd: bash ./scripts/rewrite-imports.sh {{.SUBNET_EVM_MODULE}} - - subnet-evm-subtree-merge: - desc: Perform git subtree merge of subnet-evm into graft/subnet-evm (commits) - cmd: bash ./scripts/subtree-merge.sh {{.SUBNET_EVM_MODULE}} master + # REPO_NAME-subtree-merge: + # desc: Perform git subtree merge of REPO_NAME into graft/REPO_NAME (commits) + # cmd: bash ./scripts/subtree-merge.sh {{.REPO_MODULE}} master diff --git a/graft/coreth/Taskfile.yml b/graft/coreth/Taskfile.yml index 990317049fd8..85750d74d078 100644 --- a/graft/coreth/Taskfile.yml +++ b/graft/coreth/Taskfile.yml @@ -12,7 +12,7 @@ tasks: build-test: desc: Run all Go tests with retry logic for flaky tests, race detection, and coverage reporting - cmd: ./scripts/build_test.sh # ci.yml + cmd: ./scripts/build_test.sh check-clean-branch: desc: Checks that the git working tree is clean @@ -54,7 +54,7 @@ tasks: coverage: desc: Display test coverage statistics from coverage.out file - cmd: ./scripts/coverage.sh # ci.yml + cmd: ./scripts/coverage.sh generate-codec: desc: Generates fjl/gencodec files diff --git a/graft/coreth/scripts/run_ginkgo.sh b/graft/coreth/scripts/run_ginkgo.sh deleted file mode 100755 index 4b27a2906ed9..000000000000 --- a/graft/coreth/scripts/run_ginkgo.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -REPO_ROOT=$( - cd "$(dirname "${BASH_SOURCE[0]}")" - cd .. && pwd -) -cd "${REPO_ROOT}" - -go tool ginkgo "${@}" diff --git a/graft/coreth/scripts/run_ginkgo_warp.sh b/graft/coreth/scripts/run_ginkgo_warp.sh deleted file mode 100755 index 7da29f506861..000000000000 --- a/graft/coreth/scripts/run_ginkgo_warp.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -CORETH_PATH=$( - cd "$(dirname "${BASH_SOURCE[0]}")" - cd .. && pwd -) - -# shellcheck disable=SC1091 -source "$CORETH_PATH"/../../scripts/constants.sh - -EXTRA_ARGS=() -AVALANCHEGO_BUILD_PATH="${AVALANCHEGO_BUILD_PATH:-}" -if [[ -n "${AVALANCHEGO_BUILD_PATH}" ]]; then - EXTRA_ARGS=("--avalanchego-path=${AVALANCHEGO_BUILD_PATH}/avalanchego") - echo "Running with extra args:" "${EXTRA_ARGS[@]}" -fi - -"${CORETH_PATH}"/bin/ginkgo -vv --label-filter="${GINKGO_LABEL_FILTER:-}" "${CORETH_PATH}"/tests/warp -- "${EXTRA_ARGS[@]}" diff --git a/graft/evm/Taskfile.yml b/graft/evm/Taskfile.yml index ccb2526b00f8..5bd08123a8d3 100644 --- a/graft/evm/Taskfile.yml +++ b/graft/evm/Taskfile.yml @@ -12,7 +12,7 @@ tasks: build-test: desc: Run all Go tests with retry logic for flaky tests, race detection, and coverage reporting - cmd: ./scripts/build_test.sh # ci.yml + cmd: ./scripts/build_test.sh check-clean-branch: desc: Checks that the git working tree is clean @@ -30,7 +30,7 @@ tasks: coverage: desc: Display test coverage statistics from coverage.out file - cmd: ./scripts/coverage.sh # ci.yml + cmd: ./scripts/coverage.sh lint: desc: Run golangci-lint and check for allowed Ethereum imports in Go code diff --git a/graft/subnet-evm/.github/CODEOWNERS b/graft/subnet-evm/.github/CODEOWNERS deleted file mode 100644 index fa1f6ca249ba..000000000000 --- a/graft/subnet-evm/.github/CODEOWNERS +++ /dev/null @@ -1,12 +0,0 @@ -# Each line is a file pattern followed by one or more owners. - -# These owners will be the default code owners for everything in the repo. - -# Unless a later match takes precedence, these owners will be requested for - -# review whenever someone opens a pull request. - -* @ava-labs/platform-evm -/.github/ @maru-ava @ava-labs/platform-evm -/triedb/firewood/ @alarso16 @ava-labs/platform-evm - diff --git a/graft/subnet-evm/.github/CONTRIBUTING.md b/graft/subnet-evm/.github/CONTRIBUTING.md deleted file mode 100644 index 35c3b5eacb3e..000000000000 --- a/graft/subnet-evm/.github/CONTRIBUTING.md +++ /dev/null @@ -1,85 +0,0 @@ -# Contributing - -Thank you for considering to help out with the source code! We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes! - -If you'd like to contribute to subnet-evm, please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base. If you wish to submit more complex changes though, please check up with the core devs first on [Discord](https://chat.avalabs.org) to ensure those changes are in line with the general philosophy of the project and/or get some early feedback which can make both your efforts much lighter as well as our review and merge procedures quick and simple. - -## Coding guidelines - -Please make sure your contributions adhere to our coding guidelines: - -- Code must adhere to the official Go - [formatting](https://go.dev/doc/effective_go#formatting) guidelines - (i.e. uses [gofmt](https://pkg.go.dev/cmd/gofmt)). -- Code must be documented adhering to the official Go - [commentary](https://go.dev/doc/effective_go#commentary) guidelines. -- Pull requests need to be based on and opened against the `master` branch. -- Pull reuqests should include a detailed description -- Commits are required to be signed. See the [commit signature verification documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) - for information on signing commits. -- Commit messages should be prefixed with the package(s) they modify. - - E.g. "eth, rpc: make trace configs optional" - -## Can I have feature X - -Before you submit a feature request, please check and make sure that it isn't possible through some other means. - -## Mocks - -Mocks are auto-generated using [mockgen](https://pkg.go.dev/go.uber.org/mock/mockgen) and `//go:generate` commands in the code. - -- To **re-generate all mocks**, use the task below from the root of the project: - - ```sh - task generate-mocks - ``` - -- To **add** an interface that needs a corresponding mock generated: - - if the file `mocks_generate_test.go` exists in the package where the interface is located, either: - - modify its `//go:generate go tool -modfile=tools/go.mod mockgen` to generate a mock for your interface (preferred); or - - add another `//go:generate go tool -modfile=tools/go.mod mockgen` to generate a mock for your interface according to specific mock generation settings - - if the file `mocks_generate_test.go` does not exist in the package where the interface is located, create it with content (adapt as needed): - - ```go - // Copyright (C) 2019, Ava Labs, Inc. All rights reserved. - // See the file LICENSE for licensing terms. - - package mypackage - - //go:generate go tool -modfile=tools/go.mod mockgen -package=${GOPACKAGE} -destination=mocks_test.go . YourInterface - ``` - - Notes: - 1. Ideally generate all mocks to `mocks_test.go` for the package you need to use the mocks for and do not export mocks to other packages. This reduces package dependencies, reduces production code pollution and forces to have locally defined narrow interfaces. - 1. Prefer using reflect mode to generate mocks than source mode, unless you need a mock for an unexported interface, which should be rare. -- To **remove** an interface from having a corresponding mock generated: - 1. Edit the `mocks_generate_test.go` file in the directory where the interface is defined - 1. If the `//go:generate` mockgen command line: - - generates a mock file for multiple interfaces, remove your interface from the line - - generates a mock file only for the interface, remove the entire line. If the file is empty, remove `mocks_generate_test.go` as well. - -## Tool Dependencies - -This project uses `go tool` to manage development tool dependencies in `tools/go.mod`. This isolates tool dependencies from the main application dependencies and provides consistent, version-locked tools across the team. - -### Managing Tools - -- To **add a new tool**: - - ```sh - go get -tool -modfile=tools/go.mod example.com/tool/cmd/toolname@version - ``` - -- To **upgrade a tool**: - - ```sh - go get -tool -modfile=tools/go.mod example.com/tool/cmd/toolname@newversion - ``` - -- To **run a tool manually**: - - ```sh - go tool -modfile=tools/go.mod toolname [args...] - ``` - -Note: `ginkgo` remains in the main `go.mod` as it is used directly in e2e test code. diff --git a/graft/subnet-evm/.github/ISSUE_TEMPLATE/bug_report.md b/graft/subnet-evm/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 66282cc3f0ea..000000000000 --- a/graft/subnet-evm/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: bug -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior. - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Logs** -If applicable, please include the relevant logs that indicate a problem and/or the log directory of your node. By default, this can be found at `~/.avalanchego/logs/`. - -**Metrics** -If applicable, please include any metrics gathered from your node to assist us in diagnosing the problem. - -**Operating System** -Which OS you used to reveal the bug. - -**Additional context** -Add any other context about the problem here. - -You can submit a bug on the [Avalanche Bug Bounty program page](https://immunefi.com/bug-bounty/avalanche/information/). diff --git a/graft/subnet-evm/.github/ISSUE_TEMPLATE/feature_spec.md b/graft/subnet-evm/.github/ISSUE_TEMPLATE/feature_spec.md deleted file mode 100644 index 660752cf6ff6..000000000000 --- a/graft/subnet-evm/.github/ISSUE_TEMPLATE/feature_spec.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: Feature specification -about: Discussion on design and implementation of new features for subnet-evm. -title: '' -labels: enhancement -assignees: '' - ---- - -**Context and scope** -Include a short description of the context and scope of the suggested feature. -Include goals the change will accomplish if relevant. - -**Discussion and alternatives** -Include a description of the changes to be made to the code along with alternatives -that were considered, including pro/con analysis where relevant. - -**Open questions** -Questions that are still being discussed diff --git a/graft/subnet-evm/.github/bug_report.md b/graft/subnet-evm/.github/bug_report.md deleted file mode 100644 index dfd45bd27b8e..000000000000 --- a/graft/subnet-evm/.github/bug_report.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: bug -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior. - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Logs** -If applicable, please include the relevant logs that indicate a problem and/or the log directory of your node. By default, this can be found at `~/.avalanchego/logs/`. - -**Metrics** -If applicable, please include any metrics gathered from your node to assist us in diagnosing the problem. - -**Operating System** -Which OS you used to reveal the bug. - -**Additional context** -Add any other context about the problem here. diff --git a/graft/subnet-evm/.github/dependabot.yml b/graft/subnet-evm/.github/dependabot.yml deleted file mode 100644 index f20b74ad2dde..000000000000 --- a/graft/subnet-evm/.github/dependabot.yml +++ /dev/null @@ -1,22 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates - -version: 2 -updates: - - package-ecosystem: "gomod" # See documentation for possible values - directory: "/" # Location of package manifests - schedule: - interval: "daily" - open-pull-requests-limit: 0 # Disable non-security version updates - - package-ecosystem: github-actions - directory: "/" - schedule: - interval: "weekly" - open-pull-requests-limit: 0 # Disable non-security version updates - - package-ecosystem: "npm" - directory: "/contracts" - schedule: - interval: "daily" - open-pull-requests-limit: 0 # Disable non-security version updates diff --git a/graft/subnet-evm/.github/pull_request_template.md b/graft/subnet-evm/.github/pull_request_template.md deleted file mode 100644 index d1b4cd3a7bf3..000000000000 --- a/graft/subnet-evm/.github/pull_request_template.md +++ /dev/null @@ -1,10 +0,0 @@ - -## Why this should be merged - -## How this works - -## How this was tested - -## Need to be documented? - -## Need to update RELEASES.md? diff --git a/graft/subnet-evm/.gitignore b/graft/subnet-evm/.gitignore deleted file mode 100644 index 573f81989089..000000000000 --- a/graft/subnet-evm/.gitignore +++ /dev/null @@ -1,69 +0,0 @@ -./main - -*.log -*~ -.DS_Store - -awscpu - -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib -*.profile - -# Test binary, build with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# ignore GoLand metafiles directory -.idea/ - -*logs/ -!*customlogs/ - -.vscode* -workspace.code-workspace - -*.pb* - -*cpu[0-9]* -*mem[0-9]* -*lock[0-9]* -*.profile -*.swp -*.aux -*.fdb* -*.fls -*.gz -*.pdf - -.coverage - -bin/ -build/ - -cmd/evm/evm -cmd/simulator/.simulator/* -cmd/simulator/simulator - -# goreleaser -dist/ - -# Outputs of `scripts/diff_against.sh` -diffs/ - -# clone used for antithesis image builds -avalanchego/ - -.direnv - -# Contract compilation artifacts (binary files are not committed) -contracts/artifacts/ - -# solc downloads from setup-solc GitHub Action -setup-solc_downloads/ diff --git a/graft/subnet-evm/SECURITY.md b/graft/subnet-evm/SECURITY.md index 61603a456e2b..77eb95ad0e48 100644 --- a/graft/subnet-evm/SECURITY.md +++ b/graft/subnet-evm/SECURITY.md @@ -16,4 +16,4 @@ Please refer to the [Bug Bounty Page](https://immunefi.com/bug-bounty/avalanche/ ## Supported Versions -Please use the [most recently released version](https://github.com/ava-labs/subnet-evm/releases/latest) to perform testing and to validate security issues. +Please use the [most recently released version](https://github.com/ava-labs/avalanchego/releases/latest) to perform testing and to validate security issues. diff --git a/graft/subnet-evm/Taskfile.yml b/graft/subnet-evm/Taskfile.yml index 758b73a580ad..5894074b68ad 100644 --- a/graft/subnet-evm/Taskfile.yml +++ b/graft/subnet-evm/Taskfile.yml @@ -12,7 +12,7 @@ tasks: build: desc: Compile Subnet EVM binary with git commit and static linking flags - cmd: ./scripts/build.sh {{.CLI_ARGS}} # ci.yml + cmd: ./scripts/build.sh {{.CLI_ARGS}} build-antithesis-images: desc: Build Docker images for antithesis testing including avalanchego node and subnet-evm builder images @@ -28,7 +28,7 @@ tasks: build-test: desc: Run all Go tests with retry logic for flaky tests, race detection, and coverage reporting - cmd: ./scripts/build_test.sh # ci.yml + cmd: ./scripts/build_test.sh check-clean-branch: desc: Checks that the git working tree is clean @@ -70,7 +70,7 @@ tasks: coverage: desc: Display test coverage statistics from coverage.out file - cmd: ./scripts/coverage.sh # ci.yml + cmd: ./scripts/coverage.sh generate-codec: desc: Generates fjl/gencodec files @@ -127,7 +127,7 @@ tasks: shellcheck: desc: Run shellcheck static analysis on all shell scripts with version management - cmd: ./scripts/shellcheck.sh # ci.yml + cmd: ./scripts/shellcheck.sh test-build-antithesis-images: desc: Test antithesis images build @@ -143,11 +143,11 @@ tasks: test-build-image: desc: Test docker image build - cmd: bash -x scripts/tests.build_docker_image.sh # ci.yml + cmd: bash -x scripts/tests.build_docker_image.sh test-e2e-load: desc: Run end-to-end load tests using Ginkgo test framework - cmd: ./scripts/run_ginkgo_load.sh # ci.yml + cmd: ./scripts/run_ginkgo_load.sh test-e2e-load-ci: # consolidated test-e2e-load desc: Run E2E load tests with CI setup diff --git a/graft/subnet-evm/cmd/simulator/README.md b/graft/subnet-evm/cmd/simulator/README.md index b64e28677001..578b65dab987 100644 --- a/graft/subnet-evm/cmd/simulator/README.md +++ b/graft/subnet-evm/cmd/simulator/README.md @@ -7,7 +7,7 @@ When building developing your own blockchain using `subnet-evm`, you may want to To build the load simulator, navigate to the base of the simulator directory: ```bash -cd $GOPATH/src/github.com/ava-labs/subnet-evm/cmd/simulator +cd $GOPATH/src/github.com/ava-labs/avalanchego/graft/subnet-evm/cmd/simulator ``` Build the simulator: diff --git a/graft/subnet-evm/scripts/build_antithesis_workload.sh b/graft/subnet-evm/scripts/build_antithesis_workload.sh deleted file mode 100755 index 942e91c0acc1..000000000000 --- a/graft/subnet-evm/scripts/build_antithesis_workload.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -# Directory above this script -SUBNET_EVM_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd ) -# Load the constants -source "$SUBNET_EVM_PATH"/scripts/constants.sh - -echo "Building Workload..." -go build -o "$SUBNET_EVM_PATH/build/workload" "$SUBNET_EVM_PATH/tests/antithesis/"*.go diff --git a/graft/subnet-evm/scripts/diff_against.sh b/graft/subnet-evm/scripts/diff_against.sh deleted file mode 100755 index f165dfa279f0..000000000000 --- a/graft/subnet-evm/scripts/diff_against.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -# -# Usage: scripts/diff_against.sh {geth_commit} -# -# Per-file diffs will be written to `diffs/{geth_commit}`. -# -# Example: `scripts/diff_against.sh b20b4a71598481443d60b261d3e5dcb37f8a0d82` to compare with v1.13.8. -# -# *NOTE* Before running this script: -# 1. Run `scripts/format_as_upstream.sh` to reformat this repo as `ethereum/go-ethereum`. -# 2. Add geth as a remote: `git remote add -f geth git@github.com:ethereum/go-ethereum.git`. -# 3. Find the geth commit for the latest version merged into this repo. -# - -set -e; -set -u; - -ROOT=$(git rev-parse --show-toplevel); -cd "${ROOT}"; - -BASE="${1}"; - -# The diffs/ directory is in .gitignore to avoid recursive diffiffiffs. -mkdir -p "diffs/${BASE}"; - -git diff "${BASE}" --name-only | while read -r f -do - echo "${f}"; - DIR=$(dirname "${f}"); - mkdir -p "diffs/${BASE}/${DIR}"; - git diff "${BASE}" -- "${f}" > "diffs/${BASE}/${f}.diff"; -done diff --git a/graft/subnet-evm/scripts/format_as_fork.sh b/graft/subnet-evm/scripts/format_as_fork.sh deleted file mode 100755 index 1be9ce6248ca..000000000000 --- a/graft/subnet-evm/scripts/format_as_fork.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail -set -x - -script_dir=$(dirname "$0") - -commit_msg_remove_header="format: remove avalanche header" -commit_msg_remove_upstream="format: remove upstream go-ethereum" -commit_msg_rename_packages_as_fork="format: rename packages as fork" - -make_commit() { - if git diff-index --cached --quiet HEAD --; then - echo "No changes to commit." - else - git commit -m "$1" - fi -} - -revert_by_message() { - hash=$(git log --grep="$1" --format="%H" -n 1) - git revert --no-edit "$hash" -} - -if git status --porcelain | grep -q '^ M'; then - echo "There are edited files in the repository. Please commit or stash them before running this script." - exit 1 -fi - -upstream_dirs=$(sed -e 's/"github.com\/ethereum\/go-ethereum\/\(.*\)"/\1/' "${script_dir}"/geth-allowed-packages.txt | xargs) -for dir in ${upstream_dirs}; do - if [ -d "${dir}" ]; then - git rm -r "${dir}" - fi -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' -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" - find . -name '*.go' -exec sed -i '' -e "${sed_command}" {} \; -done -go get github.com/ethereum/go-ethereum@"$1" -gofmt -w . -go mod tidy -git add -u . -make_commit "${commit_msg_rename_packages_as_fork}" - -revert_by_message "${commit_msg_remove_header}" \ No newline at end of file diff --git a/graft/subnet-evm/scripts/format_as_upstream.sh b/graft/subnet-evm/scripts/format_as_upstream.sh deleted file mode 100755 index c4ba234609e6..000000000000 --- a/graft/subnet-evm/scripts/format_as_upstream.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail -set -x - -script_dir=$(dirname "$0") - -commit_msg_remove_header="format: remove avalanche header" -commit_msg_add_upstream="format: add upstream go-ethereum" -commit_msg_rename_packages_to_upstream="format: rename packages to upstream" - -make_commit() { - if git diff-index --cached --quiet HEAD --; then - echo "No changes to commit." - else - git commit -m "$1" - fi -} - -if git status --porcelain | grep -q '^ M'; then - echo "There are edited files in the repository. Please commit or stash them before running this script." - exit 1 -fi - -sed_command='/\/\/ (c) [0-9]*\(-[0-9]*\)\{0,1\}, Ava Labs, Inc.$/,+9d' -find . -name '*.go' -exec sed -i '' -e "${sed_command}" {} \; -git add -u . -make_commit "${commit_msg_remove_header}" - -upstream_tag=$(grep -o 'github.com/ethereum/go-ethereum v.*' go.mod | cut -f2 -d' ') -upstream_dirs=$(sed -e 's/"github.com\/ethereum\/go-ethereum\/\(.*\)"/\1/' "${script_dir}"/geth-allowed-packages.txt | xargs) -upstream_dirs_array=() -IFS=" " read -r -a upstream_dirs_array <<< "$upstream_dirs" - -git clean -f "${upstream_dirs_array[@]}" -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' -find . \( -name '*.go' -o -name 'go.mod' -o -name 'build_test.sh' \) -exec sed -i '' -e "${sed_command}" {} \; -gofmt -w . -go mod tidy -git add -u . -make_commit "${commit_msg_rename_packages_to_upstream}" \ No newline at end of file diff --git a/graft/subnet-evm/scripts/generate_precompile.sh b/graft/subnet-evm/scripts/generate_precompile.sh deleted file mode 100755 index e8a325452286..000000000000 --- a/graft/subnet-evm/scripts/generate_precompile.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -set -e - -# This script generates a Stateful Precompile stub based off of a Solidity ABI file. -# It first sets the necessary CGO_FLAGs for the BLST library used in AvalancheGo and -# then runs PrecompileGen. -if ! [[ "$0" =~ scripts/generate_precompile.sh ]]; then - echo "must be run from repository root, but got $0" - exit 255 -fi - -SUBNET_EVM_PATH=$( - cd "$(dirname "${BASH_SOURCE[0]}")" - cd .. && pwd -) - -# Load the constants -source "$SUBNET_EVM_PATH"/scripts/constants.sh - -go run ./cmd/precompilegen/main.go "$@"