-
Notifications
You must be signed in to change notification settings - Fork 840
chore: Create shared evm module
#4690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR creates a shared evm module to de-duplicate code between coreth and subnet-evm. The refactor extracts the common constants package into a new graft/evm module that both coreth and subnet-evm can depend on.
Key changes:
- Created new
graft/evmmodule with shared constants and supporting CI infrastructure - Updated coreth and subnet-evm to import constants from the shared module
- Added comprehensive CI configuration for the new module including linting and testing
Reviewed changes
Copilot reviewed 38 out of 41 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| graft/evm/go.mod | Defines the new shared evm module with dependencies |
| graft/evm/Taskfile.yml | Adds build, test, and lint tasks for the evm module |
| graft/evm/.golangci.yml | Configures linting rules for the evm module |
| graft/evm/scripts/*.sh | Adds shared scripts for linting, testing, and coverage reporting |
| graft/subnet-evm/constants/constants.go | Removes constants file (moved to shared module) |
| graft/subnet-evm/**/*.go | Updates imports to reference shared evm/constants |
| graft/subnet-evm/go.mod | Adds dependency on shared evm module |
| graft/coreth/**/*.go | Updates imports to reference shared evm/constants |
| graft/coreth/go.mod | Adds dependency on shared evm module |
| go.mod | Adds evm module dependency and replace directive |
| Dockerfile | Includes evm directory in build context |
| .github/workflows/evm-ci.yml | Adds CI workflow for the evm module |
| .github/CODEOWNERS | Adds codeowners for evm module |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
graft/evm/scripts/lint_setup.sh
Outdated
| local upstream_folders_file="./scripts/upstream_files.txt" | ||
| # Read the upstream_folders file into an array | ||
| mapfile -t upstream_folders <"$upstream_folders_file" | ||
| # check that the file exists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the department of redundant redundancies, maybe avoid comments that can be trivially inferred from the code? I'm more interested in learning the circumstances under which this file would not exist and what the impact of that absence will be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'll clarify behavior and remove the obvious part
JonathanOppenheimer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair to do the other things separately
| golang.org/x/sys v0.38.0 // indirect | ||
| ) | ||
|
|
||
| replace github.com/ava-labs/avalanchego => ../../ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we don't currently depend on avalanchego, this replace looks weird... But this is presumably in place for when this does depend on avalanchego.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah true! This is leftover from a rebase where it does... in any case it will soon
Why this should be merged
This creates all the groundwork to de-duplicate between coreth and subnet-evm in a shared repository. This includes CI and a trivial refactor to prove it works
How this works
Adds all coreth/subnet-evm CI (copy-paste) and lots of
go mod tidysHow this was tested
See #4688 for a complicated use case
Need to be documented in RELEASES.md?
No