Skip to content

test: add import compliance tests#4537

Merged
maru-ava merged 39 commits intomasterfrom
JonathanOppenheimer/import-testing
Dec 17, 2025
Merged

test: add import compliance tests#4537
maru-ava merged 39 commits intomasterfrom
JonathanOppenheimer/import-testing

Conversation

@JonathanOppenheimer
Copy link
Member

@JonathanOppenheimer JonathanOppenheimer commented Nov 21, 2025

Why this should be merged

This PR prevents files inside of the vms/evm directory from importing packages within the graft/ directory.

  • This is important because with the removal of coreth, there is not longer a natural boundary between the uplifted and non-uplifted code. We need to enforce such a boundary.
  • This boundary is important, especially as other people individuals start work on properly uplfiting code post monorepo. Reviewers and developers may not be familiar with why we want this distinction to exist and programmatically enforcing this boundary will prevent mistakes and leakage of legacy EVM code into AvalancheGo.
  • See this issue for additional context Remove libevm import restriction test from graft/ post merge. #4541

Closes #4541, #4643

How this works

The boundaries are as follows:

  • graft/coreth can be imported everywhere in AvalancheGo except vms/evm.
    • However, vms/evm/emulate is an exception to this rule
  • graft/subnet-evm can not be imported anywhere in AvalancheGo
    • However, vms/evm/emulate is an exception to this rule

How this was tested

Existing CI.

Need to be documented in RELEASES.md?

No

@JonathanOppenheimer JonathanOppenheimer self-assigned this Nov 21, 2025
@JonathanOppenheimer JonathanOppenheimer added the testing This primarily focuses on testing label Nov 21, 2025
@JonathanOppenheimer JonathanOppenheimer marked this pull request as ready for review November 21, 2025 23:37
@JonathanOppenheimer JonathanOppenheimer requested a review from a team as a code owner December 12, 2025 19:01
@JonathanOppenheimer
Copy link
Member Author

Feel free to open a PR to move pseudo into internal/libevm instead of checking here. If I remember I'll do it myself but it's low priority so I may not get around to it soon.

I've done so! That PR is available here: ava-labs/libevm#250

I've removed the pseudo check from this PR, and also remove the tests this replaces. This PR is relevant as Austin and I worked through the subnet-evm monorepo PRs, with some assumptions that this PR enforces.

@JonathanOppenheimer
Copy link
Member Author

The above PR is now merged in. Thanks to @maru-ava for the suggestion.

@JonathanOppenheimer JonathanOppenheimer linked an issue Dec 16, 2025 that may be closed by this pull request
Copy link
Contributor

@alarso16 alarso16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely worth some more thought about exactly what we want to enforce, and the boolean logic is overly complicated (and incorrect I think)

JonathanOppenheimer and others added 3 commits December 16, 2025 11:35
Co-authored-by: Austin Larson <78000745+alarso16@users.noreply.github.com>
Signed-off-by: Jonathan Oppenheimer <147infiniti@gmail.com>
Copy link
Contributor

@maru-ava maru-ava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm but I leave it to an evm team member to merge.

@maru-ava maru-ava added this pull request to the merge queue Dec 17, 2025
Merged via the queue into master with commit 21b1a7d Dec 17, 2025
52 checks passed
@maru-ava maru-ava deleted the JonathanOppenheimer/import-testing branch December 17, 2025 18:50
@github-project-automation github-project-automation bot moved this from In Progress 🏗️ to Done 🎉 in avalanchego Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devinfra testing This primarily focuses on testing

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Remove old EVM import testing Remove libevm import restriction test from graft/ post merge.

4 participants