Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove constants.sh
  • Loading branch information
alarso16 committed Dec 4, 2025
commit fb808b947443562b476df86bec2441f05db172fd
16 changes: 3 additions & 13 deletions graft/coreth/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
# Coreth and the C-Chain

[Avalanche](https://www.avax.network/) is a network composed of multiple blockchains.
Each blockchain is an instance of a Virtual Machine (VM), much like an object in an object-oriented language is an instance of a class.
That is, the VM defines the behavior of the blockchain.
Coreth (from core Ethereum) is the [Virtual Machine (VM)](https://docs.avax.network/learn/virtual-machines) that defines the Contract Chain (C-Chain).
This chain implements the Ethereum Virtual Machine and supports Solidity smart contracts as well as most other Ethereum client functionality.
Each blockchain is an instance of a Virtual Machine (VM), much like an object in an object-oriented language is an instance of a class. That is, the VM defines the behavior of the blockchain. Coreth (from core Ethereum) is the [Virtual Machine (VM)](https://docs.avax.network/learn/virtual-machines) that defines the Contract Chain (C-Chain). This chain implements the Ethereum Virtual Machine and supports Solidity smart contracts as well as most other Ethereum client functionality.

## Building

Coreth is a dependency of AvalancheGo which is used to implement the EVM based Virtual Machine for the Avalanche C-Chain. In order to run with a local version of Coreth, users can simply build AvalancheGo from source.

Note: the C-Chain originally ran in a separate process from the main AvalancheGo process and communicated with it over a local gRPC connection. When this was the case, AvalancheGo's build script would download Coreth, compile it, and place the binary into the `avalanchego/build/plugins` directory.

### Optional Dev Shell

Some activities, such as collecting metrics and logs from the nodes targeted by an e2e
test run, require binary dependencies. One way of making these dependencies available is
to use a nix shell which will give access to the dependencies expected by the test
tooling. See [flake.nix](../../flake.nix) for how to start.
Some activities, such as collecting metrics and logs from the nodes targeted by an e2e test run, require binary dependencies. One way of making these dependencies available is to use a nix shell which will give access to the dependencies expected by the test tooling. See [flake.nix](../../flake.nix) for how to start.

This repo also defines a `.envrc` file to configure [devenv](https://direnv.net/). With
`devenv` and `nix` installed, a shell at the root of the repo will automatically start a nix
dev shell.
This repo also defines a `.envrc` file to configure [devenv](https://direnv.net/). With `devenv` and `nix` installed, a shell at the root of the repo will automatically start a nix dev shell.

## API

Expand Down
6 changes: 1 addition & 5 deletions graft/coreth/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ env:
tasks:
default: ./scripts/run_task.sh --list

build:
desc: Compile Coreth binary with git commit and static linking flags
cmd: ./scripts/build.sh # ci.yml

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
Expand Down Expand Up @@ -100,7 +96,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-e2e-warp:
desc: Run end-to-end warp tests using Ginkgo test framework
Expand Down
32 changes: 0 additions & 32 deletions graft/coreth/scripts/build.sh

This file was deleted.

2 changes: 1 addition & 1 deletion graft/coreth/scripts/build_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

set -euo pipefail


REPO_ROOT=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd ../../../ && pwd )
# shellcheck disable=SC1091
source "$REPO_ROOT"/scripts/constants.sh

# We pass in the arguments to this script directly to enable easily passing parameters such as enabling race detection,
Expand Down
33 changes: 0 additions & 33 deletions graft/coreth/scripts/constants.sh

This file was deleted.

2 changes: 1 addition & 1 deletion graft/coreth/scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail

if ! [[ "$0" =~ scripts/lint.sh ]]; then
echo "must be run from repository root"
echo "must be run from coreth root"
exit 255
fi

Expand Down
2 changes: 1 addition & 1 deletion graft/coreth/scripts/lint_fix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail

if ! [[ "$0" =~ scripts/lint_fix.sh ]]; then
echo "must be run from repository root"
echo "must be run from coreth root"
exit 255
fi

Expand Down
3 changes: 2 additions & 1 deletion graft/coreth/scripts/run_ginkgo_warp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ CORETH_PATH=$(
cd .. && pwd
)

source "$CORETH_PATH"/scripts/constants.sh
# shellcheck disable=SC1091
source "$CORETH_PATH"/../../scripts/constants.sh

EXTRA_ARGS=()
AVALANCHEGO_BUILD_PATH="${AVALANCHEGO_BUILD_PATH:-}"
Expand Down
18 changes: 1 addition & 17 deletions graft/coreth/scripts/shellcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ set -euo pipefail

VERSION="v0.9.0"

# Scripts that are sourced from upstream and not maintained in this repo will not be shellchecked.
# Also ignore the local avalanchego clone.
IGNORED_FILES="
cmd/evm/transition-test.sh
metrics/validate.sh
avalanchego/*
"

function get_version {
local target_path=$1
if command -v "${target_path}" > /dev/null; then
Expand Down Expand Up @@ -44,12 +36,4 @@ else
fi
fi

IGNORED_CONDITIONS=()
for file in ${IGNORED_FILES}; do
if [[ -n "${IGNORED_CONDITIONS-}" ]]; then
IGNORED_CONDITIONS+=(-o)
fi
IGNORED_CONDITIONS+=(-path "${REPO_ROOT}/${file}" -prune)
done

find "${REPO_ROOT}" \( "${IGNORED_CONDITIONS[@]}" \) -o -type f -name "*.sh" -print0 | xargs -0 "${SHELLCHECK}" "${@}"
find "${REPO_ROOT}" -type f -name "*.sh" -print0 | xargs -0 "${SHELLCHECK}" "${@}"
Loading