subnet-evm icon indicating copy to clipboard operation
subnet-evm copied to clipboard

Switch from using HardHat to Foundry

Open aaronbuchwald opened this issue 3 years ago • 1 comments

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.

aaronbuchwald avatar Aug 24 '22 01:08 aaronbuchwald

https://github.com/ava-labs/subnet-evm/pull/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.

gyuho avatar Aug 29 '22 09:08 gyuho

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) https://github.com/ava-labs/subnet-evm/issues/358.

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

aaronbuchwald avatar Nov 22 '22 16:11 aaronbuchwald

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: https://github.com/ava-labs/subnet-evm/blob/c4d0e2d6200477a3cdf5d2ca047271656a74519c/tests/e2e/precompile-upgrade/suites.go#L212

aaronbuchwald avatar Mar 20 '23 16:03 aaronbuchwald