Skip to content
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

Switch from using HardHat to Foundry #223

Closed
6 tasks
aaronbuchwald opened this issue Aug 24, 2022 · 3 comments · Fixed by #601
Closed
6 tasks

Switch from using HardHat to Foundry #223

aaronbuchwald opened this issue Aug 24, 2022 · 3 comments · Fixed by #601
Assignees

Comments

@aaronbuchwald
Copy link
Collaborator

aaronbuchwald commented Aug 24, 2022

This ticket is to switch from using HardHat to the Foundry tool with the goal of switching from JS to Rust dependency for security reasons.

Use Foundry cli tooling with DS-test instead of HardHat. Benefits include (but are not limited to):

  • removes dependency on npm/node-modules as a potential attack vector on CI

Implementation plan

  • Make sure DS-test works with a local subnet
  • add docs for installing foundry locally
  • add script(s) for running local tests locally
  • add github action (CI) for foundry tests (https://github.com/foundry-rs/foundry-toolchain)
  • Migrate precompile tests to solidity-based tests (DS-test) using Foundry/Forge for deployment
  • deprecate HardHat tests in CI
@gyuho
Copy link
Contributor

gyuho commented Aug 29, 2022

#238 is the first attempt to integrate with foundry (awesome tool btw).

And for testing precompiles, rather than hardcode individual genesis files for each case (how it's done now in the tests/e2e/solidity), I suggest we automate the upgrade config test using chain config (e.g., write fee config manager file and restart the process and ensures that it's upgraded), to simulate the real world operations.

@aaronbuchwald
Copy link
Collaborator Author

As a first pass, we should migrate from starting an entire network to the approach outlined in this ticket to make running e2e tests of the VM behavior (where consensus/networking does not need to be tested) #358.

This should reduce the complexity of orchestrating the e2e tests significantly.

@aaronbuchwald
Copy link
Collaborator Author

We have migrated all of the e2e precompile tests to run on a single node network as in #358 and simplified the code to construct a network from a given genesis and then execute the HardHat tests on that subnet (ref: https://github.com/ava-labs/subnet-evm/blob/master/tests/precompile/solidity/suites.go#L29-L34).

We should be able to use the code from @gyuho 's previous pass at integrating Foundry here:

s, err := utils.RunCommand(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants