Closed rvagg closed 6 days ago
Also removed CircleCI config from here; although it may be useful as a historical reference for setting up GitHub Actions. But @snissn also has something comparable here already: https://github.com/consensus-shipyard/fevm-contract-tests/blob/main/.github/workflows/ci.yaml
One outstanding item here is that I haven't sped up openzeppelin tests like the others, I think it might still be using the 4s polling interval with ethers.js but the fix I came up with doesn't apply to the way it's built. Later version of hardhat or something. I need to spend some time figuring that one out.
PR to get @snissn write permissions to the repo: https://github.com/filecoin-project/github-mgmt/pull/63 (This will also allow us to request his review).
.. I just looked back over my set up and I see what my confusion was earlier. With these two changes I'm able to get the tests to run locally
running
git submodule init
git submodule update
the extern/fevm-hardhat-kit is expected a private key environment variable defined as PRIVATE_KEY but it doesn't seem to be set up anywhere in this PR
For above either fixing in documentation or in the setup scripts should be good.
Also I just want to document that am finding the test somewhat flaky I believe because of the 200ms block time. make test-libs
is occasionally failing for me and make test-uniswap-v3-core
consistently fails for example
initialized with 5 observations with starting time of 5
✔ index, cardinality, cardinality next (65ms)
✔ latest observation same time as latest
✔ latest observation 5 seconds after latest (665ms)
✔ current observation 5 seconds after latest (687ms)
✔ between latest observation and just before latest observation at same time as latest
✔ between latest observation and just before latest observation after the latest observation (662ms)
3) older than oldest reverts
I think leaving a note right now to document the issue is a good start and we can also: a. set time to be higher b. implement retry with doubling up to a certain number of times
I was trying to abstract away all of the submodule stuff and the env var stuff too and make it handled by the Makefile.
Submodules are handled by the node building, but I think we could probably pull that up since it's not the only thing that needs submodules updated. The PRIVATE_KEY
and all of the other uses of keys are all done in the Makefile. For fevm-hardhat Iinsert a new line into the hardhat config that picks it up properly and set up an .env in each of the submodules that has the vars they need.
My ideal here is that it's all make
, nothing special, just a couple of top-level targets that handle it all for you. Then we can use that in CI too.
The PRIVATE_KEY and all of the other uses of keys are all done in the Makefile. For fevm-hardhat Iinsert a new line into the hardhat config that picks it up properly and set up an .env in each of the submodules that has the vars they need.
~Can you verify that? I see the Makefile setting up DEPLOYER_PRIVATE_KEY
and USER_1_PRIVATE_KEY
but not PRIVATE_KEY
~
Ok I see the line here in the makefile https://github.com/filecoin-project/fevm-contract-tests/pull/26/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R45
I think I hit a really weird edge case where I ran make install before the submodules were checked out. This created a .env file in the project directory which prevented the make scripts from generating the .env file at extern/fevm-hardhat-kit/.env
I think that this a very common pattern for a future developer to run into and is worth either making a section in the readme or adding to the install scripts.
Otherwise it looks great to me! I think we should merge this as is and discuss the submodule nuance in a new ticket - at the very least it's a good way to document it.
@rvagg : are we good to merge this now?
FYI I still have some work to do on this, I've just got pulled away on more important things and haven't had time to fit this back in my head yet. I'll try and wrap this up soon but I have FIP0081 and ChainIndexer to chew through first.
Some very minor tweaks and dependency updates but I'm calling this done for now. I'm currently running the full test suite and will post the results here afterward. But we don't have them all passing right now, particularly annoying is the ApplyWithGas errors that lotus throws that we need to sort out before this can be properly passing.
A pretty large work-over to get this updated and running nicely, with easier setup and execute steps. In broad strokes:
Makefile
to do all of the things - install, build, run tests, and some miscellaneous fixy thingssed
in apollingInterval
so we get quicker tests runs and don't have to wait 4s for every .. single .. testMakefile
justsed
's the config back in so it works again with the latest; we also just rundeploy
with this repo, there are no tests (I notice it was entirely removed from https://github.com/consensus-shipyard/fevm-contract-tests but deploy seems worthwhile to still do).The tests run, but there are some failures in openzeppelin and uniswap, I'll post a follow-up with details of those.