diff --git a/.github/workflows/build-linux-binaries.yml b/.github/workflows/build-linux-binaries.yml index 7a3d45bfc946..a5c82dd84069 100644 --- a/.github/workflows/build-linux-binaries.yml +++ b/.github/workflows/build-linux-binaries.yml @@ -27,6 +27,10 @@ jobs: - name: Build the avalanchego binaries run: ./scripts/run_task.sh build + - name: Build subnet-evm plugin + working-directory: ./graft/subnet-evm + run: ./scripts/run_task.sh build + - name: Install aws cli run: sudo snap install aws-cli --classic @@ -60,12 +64,18 @@ jobs: ARCH: "amd64" RELEASE: "jammy" - - name: Save as Github artifact + - name: Save avalanchego as Github artifact uses: actions/upload-artifact@v4 with: - name: amd64 + name: avalanchego-amd64 path: /tmp/avalanchego/avalanchego-linux-amd64-${{ env.TAG }}.tar.gz + - name: Save subnet-evm as Github artifact + uses: actions/upload-artifact@v4 + with: + name: subnet-evm-amd64 + path: /tmp/avalanchego/subnet-evm-linux-amd64-${{ env.TAG }}.tar.gz + - name: Cleanup run: | rm -rf ./build @@ -87,6 +97,10 @@ jobs: - name: Build the avalanchego binaries run: ./scripts/run_task.sh build + - name: Build subnet-evm plugin + working-directory: ./graft/subnet-evm + run: ./scripts/run_task.sh build + - name: Install aws cli run: sudo snap install aws-cli --classic @@ -120,12 +134,18 @@ jobs: ARCH: "arm64" RELEASE: "jammy" - - name: Save as Github artifact + - name: Save avalanchego as Github artifact uses: actions/upload-artifact@v4 with: - name: arm64 + name: avalanchego-arm64 path: /tmp/avalanchego/avalanchego-linux-arm64-${{ env.TAG }}.tar.gz + - name: Save subnet-evm as Github artifact + uses: actions/upload-artifact@v4 + with: + name: subnet-evm-arm64 + path: /tmp/avalanchego/subnet-evm-linux-arm64-${{ env.TAG }}.tar.gz + - name: Cleanup run: | rm -rf ./build diff --git a/.github/workflows/build-macos-release.yml b/.github/workflows/build-macos-release.yml index 83b02cab98ae..199d7da202aa 100644 --- a/.github/workflows/build-macos-release.yml +++ b/.github/workflows/build-macos-release.yml @@ -34,6 +34,10 @@ jobs: - name: Build the avalanchego binary run: ./scripts/run_task.sh build + - name: Build subnet-evm plugin + working-directory: ./graft/subnet-evm + run: ./scripts/run_task.sh build "${GITHUB_WORKSPACE}/build/subnet-evm" + - name: Try to get tag from git if: "${{ github.event.inputs.tag == '' }}" id: get_tag_from_git @@ -48,11 +52,16 @@ jobs: echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV" shell: bash - - name: Create zip file + - name: Create avalanchego zip file run: 7z a "avalanchego-macos-${TAG}.zip" build/avalanchego env: TAG: ${{ env.TAG }} + - name: Create subnet-evm zip file + run: 7z a "subnet-evm-macos-${TAG}.zip" build/subnet-evm + env: + TAG: ${{ env.TAG }} + - name: Install aws cli run: | curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg" @@ -65,17 +74,28 @@ jobs: role-session-name: githubrolesession aws-region: us-east-1 - - name: Upload file to S3 + - name: Upload avalanchego to S3 run: aws s3 cp avalanchego-macos-${{ env.TAG }}.zip "s3://${BUCKET}/macos/" env: BUCKET: ${{ secrets.BUCKET }} - - name: Save as Github artifact + - name: Upload subnet-evm to S3 + run: aws s3 cp subnet-evm-macos-${{ env.TAG }}.zip "s3://${BUCKET}/macos/" + env: + BUCKET: ${{ secrets.BUCKET }} + + - name: Save avalanchego as Github artifact uses: actions/upload-artifact@v4 with: - name: build + name: avalanchego-macos path: avalanchego-macos-${{ env.TAG }}.zip + - name: Save subnet-evm as Github artifact + uses: actions/upload-artifact@v4 + with: + name: subnet-evm-macos + path: subnet-evm-macos-${{ env.TAG }}.zip + - name: Cleanup run: | rm -rf ./build diff --git a/.github/workflows/build-tgz-pkg.sh b/.github/workflows/build-tgz-pkg.sh index 4d6e11bfbd42..39290e575305 100755 --- a/.github/workflows/build-tgz-pkg.sh +++ b/.github/workflows/build-tgz-pkg.sh @@ -12,8 +12,16 @@ if [[ $OK -ne 0 ]]; then fi -echo "Build tgz package..." +echo "Build avalanchego tgz package..." cd "$PKG_ROOT" echo "Tag: $TAG" tar -czvf "avalanchego-linux-$ARCH-$TAG.tar.gz" "avalanchego-$TAG" aws s3 cp "avalanchego-linux-$ARCH-$TAG.tar.gz" "s3://$BUCKET/linux/binaries/ubuntu/$RELEASE/$ARCH/" + +echo "Build subnet-evm tgz package..." +SUBNET_EVM_ROOT=$PKG_ROOT/subnet-evm-$TAG +mkdir -p "$SUBNET_EVM_ROOT" +cp "${GITHUB_WORKSPACE:-$PWD}/build/subnet-evm" "$SUBNET_EVM_ROOT/" +cd "$PKG_ROOT" +tar -czvf "subnet-evm-linux-$ARCH-$TAG.tar.gz" "subnet-evm-$TAG" +aws s3 cp "subnet-evm-linux-$ARCH-$TAG.tar.gz" "s3://$BUCKET/linux/binaries/ubuntu/$RELEASE/$ARCH/" diff --git a/.github/workflows/publish_antithesis_images.yml b/.github/workflows/publish_antithesis_images.yml index 9506126b698a..5b698db442fb 100644 --- a/.github/workflows/publish_antithesis_images.yml +++ b/.github/workflows/publish_antithesis_images.yml @@ -42,3 +42,9 @@ jobs: env: IMAGE_PREFIX: ${{ env.REGISTRY }}/${{ env.REPOSITORY }} IMAGE_TAG: ${{ github.event.inputs.image_tag || 'latest' }} + + - name: Build and push images for subnet-evm test setup + run: ./scripts/run_task.sh build-antithesis-images-subnet-evm + env: + IMAGE_PREFIX: ${{ env.REGISTRY }}/${{ env.REPOSITORY }} + IMAGE_TAG: ${{ github.event.inputs.image_tag || 'latest' }} diff --git a/.github/workflows/publish_docker_image.yml b/.github/workflows/publish_docker_image.yml index 4964f51d77e7..1e131e3001c5 100644 --- a/.github/workflows/publish_docker_image.yml +++ b/.github/workflows/publish_docker_image.yml @@ -35,3 +35,12 @@ jobs: DOCKER_IMAGE: avaplatform/bootstrap-monitor BUILD_MULTI_ARCH: 1 run: scripts/run_task.sh build-bootstrap-monitor-image + - name: Build and publish subnet-evm image to DockerHub + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASS: ${{ secrets.DOCKER_PASS }} + IMAGE_NAME: avaplatform/subnet-evm + PLATFORMS: "linux/amd64,linux/arm64" + PUBLISH: 1 + ALLOW_TAG_LATEST: ${{ github.event_name != 'workflow_dispatch' }} + run: scripts/run_task.sh build-subnet-evm-image diff --git a/.github/workflows/trigger-antithesis-avalanchego.yml b/.github/workflows/trigger-antithesis-avalanchego.yml index d0dd75793f8b..a632d931dab2 100644 --- a/.github/workflows/trigger-antithesis-avalanchego.yml +++ b/.github/workflows/trigger-antithesis-avalanchego.yml @@ -2,6 +2,10 @@ name: Trigger Antithesis Avalanchego Setup on: schedule: + # When adjusting the schedule and duration of execution, make sure + # to check the schedule of other antithesis jobs (trigger-antithesis-*). + # The schedules for different test setups should not overlap to avoid + # unintended resource contention. - cron: '0 22 * * *' # Every day at 10PM UTC workflow_dispatch: inputs: diff --git a/graft/subnet-evm/.github/workflows/trigger-antithesis.yml b/.github/workflows/trigger-antithesis-subnet-evm.yml similarity index 80% rename from graft/subnet-evm/.github/workflows/trigger-antithesis.yml rename to .github/workflows/trigger-antithesis-subnet-evm.yml index c01a76c8ca00..41e39cc4f218 100644 --- a/graft/subnet-evm/.github/workflows/trigger-antithesis.yml +++ b/.github/workflows/trigger-antithesis-subnet-evm.yml @@ -1,12 +1,11 @@ -name: Trigger Antithesis +name: Trigger Antithesis Subnet-EVM Setup on: schedule: # When adjusting the schedule and duration of execution, make sure - # to check the schedule of antithesis jobs scheduled by other - # repos (avalanchego and hypersdk). Ideally the schedules for - # different test setups should not overlap to avoid unintended - # resource contention. + # to check the schedule of other antithesis jobs (trigger-antithesis-*). + # The schedules for different test setups should not overlap to avoid + # unintended resource contention. - cron: '0 14 * * *' # Every day at 2PM UTC workflow_dispatch: inputs: @@ -16,7 +15,7 @@ on: required: true type: string recipients: - description: 'Comma-seperated email addresses to send the test report to' + description: 'Comma-separated email addresses to send the test report to' required: true type: string image_tag: @@ -26,8 +25,8 @@ on: type: string jobs: - antithesis: - name: Run Antithesis + antithesis_subnet_evm: + name: Run Antithesis Subnet-EVM Test Setup runs-on: ubuntu-latest steps: - uses: antithesishq/antithesis-trigger-action@6c0a27302c0a3cd97d87d40bd6704e673abed4bb #v0.9 diff --git a/.github/workflows/trigger-antithesis-xsvm.yml b/.github/workflows/trigger-antithesis-xsvm.yml index e5efddeb4b2f..f60701ebf040 100644 --- a/.github/workflows/trigger-antithesis-xsvm.yml +++ b/.github/workflows/trigger-antithesis-xsvm.yml @@ -2,6 +2,10 @@ name: Trigger Antithesis XSVM Setup on: schedule: + # When adjusting the schedule and duration of execution, make sure + # to check the schedule of other antithesis jobs (trigger-antithesis-*). + # The schedules for different test setups should not overlap to avoid + # unintended resource contention. - cron: '0 6 * * *' # Every day at 6AM UTC workflow_dispatch: inputs: diff --git a/graft/subnet-evm/docs/releasing/README.md b/RELEASING_README.md similarity index 99% rename from graft/subnet-evm/docs/releasing/README.md rename to RELEASING_README.md index 3887dd1fb157..6edc3ddd2252 100644 --- a/graft/subnet-evm/docs/releasing/README.md +++ b/RELEASING_README.md @@ -1,3 +1,5 @@ +# THIS README IS WHOLLY OUT OF DATE AND WILL BE UPDATED! + # Releasing ## When to release @@ -448,4 +450,4 @@ export P_VERSION=v0.7.4 gh pr merge "prep-$P_VERSION-release" --squash --subject "chore: prep next release $P_VERSION" ``` -1. Pat yourself on the back for a job well done. +1. Pat yourself on the back for a job well done. \ No newline at end of file diff --git a/Taskfile.yml b/Taskfile.yml index 230daca54dd0..24327ee2550d 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -26,6 +26,11 @@ tasks: TEST_SETUP: xsvm cmd: bash -x ./scripts/build_antithesis_images.sh + build-antithesis-images-subnet-evm: + desc: Builds docker images for antithesis for the subnet-evm test setup + dir: graft/subnet-evm + cmd: bash -x ./scripts/build_antithesis_images.sh + build-bootstrap-monitor: desc: Builds bootstrap-monitor cmd: ./scripts/build_bootstrap_monitor.sh @@ -38,6 +43,11 @@ tasks: desc: Builds docker image for avalanchego cmd: ./scripts/build_image.sh + build-subnet-evm-image: + desc: Builds docker image for subnet-evm + dir: graft/subnet-evm + cmd: ./scripts/build_docker_image.sh + build-race: desc: Builds avalanchego with race detection enabled cmd: ./scripts/build.sh -r diff --git a/graft/subnet-evm/.github/workflows/bench.yml b/graft/subnet-evm/.github/workflows/bench.yml deleted file mode 100644 index 4aa5d573cd16..000000000000 --- a/graft/subnet-evm/.github/workflows/bench.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Bench - -on: - workflow_dispatch: - pull_request: - merge_group: - types: [checks_requested] - -jobs: - bench: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: "go.mod" - - run: go mod download - shell: bash - - run: ./scripts/run_task.sh build-bench-precompiles - shell: bash diff --git a/graft/subnet-evm/.github/workflows/codeql-analysis.yml b/graft/subnet-evm/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 030c0cf1f22d..000000000000 --- a/graft/subnet-evm/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,72 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - merge_group: - types: [checks_requested] - schedule: - - cron: '44 11 * * 4' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'go' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://git.io/codeql-language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@45775bd8235c68ba998cffa5171334d58593da47 #v3.28.15 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - queries: security-extended - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@45775bd8235c68ba998cffa5171334d58593da47 #v3.28.15 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@45775bd8235c68ba998cffa5171334d58593da47 #v3.28.15 diff --git a/graft/subnet-evm/.github/workflows/notify-metrics-availability.sh b/graft/subnet-evm/.github/workflows/notify-metrics-availability.sh deleted file mode 100755 index fd69064045c1..000000000000 --- a/graft/subnet-evm/.github/workflows/notify-metrics-availability.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -# Timestamps are in seconds -from_timestamp="$(date '+%s')" -monitoring_period=900 # 15 minutes -to_timestamp="$((from_timestamp + monitoring_period))" - -# Grafana expects microseconds, so pad timestamps with 3 zeros -metrics_url="${GRAFANA_URL}&var-filter=gh_job_id%7C%3D%7C${GH_JOB_ID}&from=${from_timestamp}000&to=${to_timestamp}000" - -# Optionally ensure that the link displays metrics only for the shared -# network rather than mixing it with the results for private networks. -if [[ -n "${FILTER_BY_OWNER:-}" ]]; then - metrics_url="${metrics_url}&var-filter=network_owner%7C%3D%7C${FILTER_BY_OWNER}" -fi - -echo "::notice links::metrics ${metrics_url}" diff --git a/graft/subnet-evm/.github/workflows/publish_antithesis_images.yml b/graft/subnet-evm/.github/workflows/publish_antithesis_images.yml deleted file mode 100644 index 1daa222af5b3..000000000000 --- a/graft/subnet-evm/.github/workflows/publish_antithesis_images.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Publish Antithesis Images - -on: - workflow_dispatch: - push: - branches: - - master - -env: - REGISTRY: us-central1-docker.pkg.dev - REPOSITORY: molten-verve-216720/avalanche-repository - -jobs: - antithesis: - runs-on: ubuntu-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Login to GAR - uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 #v3.4.0 - with: - registry: ${{ env.REGISTRY }} - username: _json_key - password: ${{ secrets.ANTITHESIS_GAR_JSON_KEY }} - - - name: Build and publish images - run: ./scripts/run_task.sh build-antithesis-images - env: - IMAGE_PREFIX: ${{ env.REGISTRY }}/${{ env.REPOSITORY }} - IMAGE_TAG: latest diff --git a/graft/subnet-evm/.github/workflows/publish_docker.yml b/graft/subnet-evm/.github/workflows/publish_docker.yml deleted file mode 100644 index 257622620d07..000000000000 --- a/graft/subnet-evm/.github/workflows/publish_docker.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Publish Docker Image - -on: - workflow_dispatch: - inputs: - vm_id: - description: "The ID of the VM (binary dst in Docker image)" - default: "" - required: false - type: string - avalanche_version: - description: "The SHA or tag of avalanchego to use for the base image (must be compatible with the version in go.mod)" - default: "" - required: false - type: string - allow_tag_latest: - description: "Whether or not allowing to tag the image created as latest (only works for master branch)" - default: false - required: false - type: boolean - - push: - tags: - - "*" - branches: - - master - -jobs: - publish_docker_image: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 #v3.6.0 - - uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 #v3.10.0 - - uses: actions/setup-go@v5 - with: - go-version-file: "go.mod" - - name: Build and publish images to DockerHub - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASS: ${{ secrets.DOCKER_PASS }} - IMAGE_NAME: "avaplatform/subnet-evm_avalanchego" - VM_ID: ${{ inputs.vm_id }} - PUBLISH: 1 - PLATFORMS: "linux/amd64,linux/arm64" - AVALANCHE_VERSION: ${{ inputs.avalanche_version }} - ALLOW_TAG_LATEST: ${{ github.event_name != 'workflow_dispatch' || inputs.allow_tag_latest }} - run: ./scripts/run_task.sh build-docker-image diff --git a/graft/subnet-evm/.github/workflows/release.yml b/graft/subnet-evm/.github/workflows/release.yml deleted file mode 100644 index 2666610918ec..000000000000 --- a/graft/subnet-evm/.github/workflows/release.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Release - -on: - workflow_dispatch: - inputs: - tag: - description: "Tag to checkout & release" - required: true - release: - types: - - released - -jobs: - release: - runs-on: ubuntu-22.04 - steps: - - name: Git checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - path: subnet-evm - ref: ${{ github.event.inputs.tag }} - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version-file: "./subnet-evm/go.mod" - - name: Set up arm64 cross compiler - run: | - sudo apt-get -y update - sudo apt-get -y install gcc-aarch64-linux-gnu - - name: Checkout osxcross - uses: actions/checkout@v4 - with: - repository: tpoechtrager/osxcross - path: osxcross - - name: Build osxcross - run: | - sudo apt-get -y install clang llvm-dev libxml2-dev uuid-dev libssl-dev bash patch make tar xz-utils bzip2 gzip sed cpio libbz2-dev - cd osxcross - wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz -O tarballs/MacOSX11.3.sdk.tar.xz - echo cd4f08a75577145b8f05245a2975f7c81401d75e9535dcffbb879ee1deefcbf4 tarballs/MacOSX11.3.sdk.tar.xz | sha256sum -c - - UNATTENDED=1 ./build.sh - echo "$PWD/target/bin" >> "$GITHUB_PATH" - - name: Git checkout workflow event ref for .goreleaser.yml only - uses: actions/checkout@v4 - with: - fetch-depth: 0 - path: goreleaser - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 #v6.3.0 - with: - distribution: goreleaser - version: v2.5.1 - args: release --clean --config ../goreleaser/.goreleaser.yml - workdir: ./subnet-evm/ - env: - # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/graft/subnet-evm/.goreleaser.yml b/graft/subnet-evm/.goreleaser.yml deleted file mode 100644 index e7b46848978b..000000000000 --- a/graft/subnet-evm/.goreleaser.yml +++ /dev/null @@ -1,45 +0,0 @@ -version: 2 -# ref. https://goreleaser.com/customization/build/ -builds: - - id: subnet-evm - main: ./plugin - binary: subnet-evm - flags: - - -v - ldflags: -X github.com/ava-labs/subnet-evm/plugin/evm.Version=v{{.Version}} - goos: - - linux - - darwin - goarch: - - amd64 - - arm64 - env: - - CGO_ENABLED=1 - - CGO_CFLAGS=-O -D__BLST_PORTABLE__ # Set the CGO flags to use the portable version of BLST - overrides: - - goos: linux - goarch: arm64 - goarm64: v8.0 - env: - - CC=aarch64-linux-gnu-gcc - - goos: darwin - goarch: arm64 - goarm64: v8.0 - env: - - CC=oa64-clang - - goos: darwin - goarch: amd64 - goamd64: v1 - env: - - CC=o64-clang -release: - # Repo in which the release will be created. - # Default is extracted from the origin remote URL or empty if its private hosted. - github: - owner: ava-labs - name: subnet-evm - -git: - # Avoid picking the wrong tag when there is an RC tag and a non-RC tag - # pointing to the same commit. - prerelease_suffix: "-rc" diff --git a/graft/subnet-evm/Taskfile.yml b/graft/subnet-evm/Taskfile.yml index d1926f45903a..82bf90351888 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 # ci.yml + cmd: ./scripts/build.sh {{.CLI_ARGS}} # ci.yml build-antithesis-images: desc: Build Docker images for antithesis testing including avalanchego node and subnet-evm builder images diff --git a/graft/subnet-evm/compatibility.json b/graft/subnet-evm/compatibility.json index 4093aad3e2a8..976a4b19049b 100644 --- a/graft/subnet-evm/compatibility.json +++ b/graft/subnet-evm/compatibility.json @@ -1,5 +1,6 @@ { "rpcChainVMProtocolVersion": { + "v1.14.0": 44, "v0.8.0": 44, "v0.7.9": 43, "v0.7.8": 43, diff --git a/graft/subnet-evm/plugin/evm/version.go b/graft/subnet-evm/plugin/evm/version.go index f559f046d786..4c4f3b6cd4ed 100644 --- a/graft/subnet-evm/plugin/evm/version.go +++ b/graft/subnet-evm/plugin/evm/version.go @@ -8,8 +8,8 @@ import "fmt" var ( // GitCommit is set by the build script GitCommit string - // Version is the version of Subnet EVM - Version string = "v0.8.0" + // Version is the version of AvalancheGo/Subnet-EVM + Version string = "v1.14.0" ) func init() { diff --git a/graft/subnet-evm/scripts/build.sh b/graft/subnet-evm/scripts/build.sh index 657f76592058..364f6f211a40 100755 --- a/graft/subnet-evm/scripts/build.sh +++ b/graft/subnet-evm/scripts/build.sh @@ -4,11 +4,11 @@ set -o errexit set -o nounset set -o pipefail -# Root directory SUBNET_EVM_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" cd .. && pwd ) +REPO_ROOT="$SUBNET_EVM_PATH/../.." # Load the constants source "$SUBNET_EVM_PATH"/scripts/constants.sh @@ -16,7 +16,7 @@ source "$SUBNET_EVM_PATH"/scripts/constants.sh if [[ $# -eq 1 ]]; then BINARY_PATH=$1 elif [[ $# -eq 0 ]]; then - BINARY_PATH="$DEFAULT_PLUGIN_DIR/$DEFAULT_VM_ID" + BINARY_PATH="${AVALANCHEGO_BUILD_PATH:-$REPO_ROOT/build}/subnet-evm" else echo "Invalid arguments to build subnet-evm. Requires zero (default binary path) or one argument to specify the binary path." exit 1 @@ -24,4 +24,16 @@ fi # Build Subnet EVM, which is run as a subprocess echo "Building Subnet EVM @ GitCommit: $SUBNET_EVM_COMMIT at $BINARY_PATH" -go build -ldflags "-X github.com/ava-labs/avalanchego/graft/subnet-evm/plugin/evm.GitCommit=$SUBNET_EVM_COMMIT $STATIC_LD_FLAGS" -o "$BINARY_PATH" "plugin/"*.go \ No newline at end of file +go build -ldflags "-X github.com/ava-labs/avalanchego/graft/subnet-evm/plugin/evm.GitCommit=$SUBNET_EVM_COMMIT $STATIC_LD_FLAGS" -o "$BINARY_PATH" "plugin/"*.go + +# Symlink to both global and local plugin directories to simplify +# usage for testing. The local directory should be preferred but the +# global directory remains supported for backwards compatibility. +LOCAL_PLUGIN_PATH="$REPO_ROOT/build/plugins" +GLOBAL_PLUGIN_PATH="${HOME}/.avalanchego/plugins" +for plugin_dir in "${GLOBAL_PLUGIN_PATH}" "${LOCAL_PLUGIN_PATH}"; do + PLUGIN_PATH="${plugin_dir}/${DEFAULT_VM_ID}" + echo "Symlinking ${BINARY_PATH} to ${PLUGIN_PATH}" + mkdir -p "${plugin_dir}" + ln -sf "$(cd "$(dirname "$BINARY_PATH")" && pwd)/$(basename "$BINARY_PATH")" "${PLUGIN_PATH}" +done \ No newline at end of file