What if we implement the multichain fork tests #1164
Replies: 1 comment 2 replies
-
Very cool idea Andrei. I will think about it later but leaving some questions for you:
I am considering the idea if the value addition by running multichain fork tests would exceed the efforts into building and maintaining it. PS: nice reference to the Happy Path. |
Beta Was this translation helpful? Give feedback.
-
Background
We have had this idea before but abandoned it for two reasons:
Problem
The above issue existed in the first place because of our current fork test structure:
fuzz
fork tests instead of unit/concrete tests.New Proposal
What if we implement these multichain fork tests in a more minimal way?
What I mean is to simply test a happy flow with a minimal scenario in a unit/concrete setup, for a single token. Specifically, we would test:
createLD
cancel
createLL
withdraw
createLT
renounce
We can choose whether to run assertions or not. The important part is simply calling these functions against a chain fork to ensure they execute correctly.
Another idea, besides the happy flow, is to add
admin
tests to verify that the setup is correct across all chains.Motivation
This approach would be useful and relevant for app integration, eliminating the need for manual testing on all chains before going live. And it would skip a step in case of bad deployments.
These tests would be most beneficial between the deployment of new contracts and the app integrating those new contracts.
About Implementation
Important: This will most likely not be part of the current fork tests and won't be run in the CI, as it serves a very specific use case.
We can add a JSON file format to store admin addresses and new deployments, which would be automatically generated using the
multichain-deployer
tool.Then, we can simply read the data using Foundry's VM and JSON tools, similar to how we do in BaseScript.
This approach will result in very low maintenance costs. See below the details block:
Example of flow
The JSON format may vary, but let's assume
admins.json
:sablier_lockup.json
:For the above JSON, we would have the following test:
Conclusion
I believe this approach would work well in practice, making the tests more robust and secure.
Curious to hear your thoughts, @sablier-labs/solidity.
Beta Was this translation helpful? Give feedback.
All reactions