At Acala, we have developed e2e-tests to catch XCM issues. It has being successfully identified multiple XCM issues, and some before the runtime upgrade happens. The Core Fellowship has also requested such test setup to catch issues of new runtimes. So we have refactored and designed the new Polkadot Ecosystem Tests that aims to be suitable for the Core Fellowship as well as other parachain teams to use and contribute.
This aims to fulfill the Ecosystem Test Environment Bounty.
Would love to see a test that ensures the correctness of all reserve-backed assets, if possible: “The amount of funds locked in the source chain being equal to the issuance of the wrapped equivalent token on the destination chain”.
It is something can be done but maybe not part of this. I see it is more of an ongoing monitoring / consistency check thing, rather part of test suites. Besides, it is not something holds true 100% of the time (there are delays of XCM processing so the value will mismatch after a XCM is sent but not yet processed on dest chain) and that will make either the tests complicated or flaky. A proper monitoring solution can be configured to report error only if in the error state for more than few minutes and I don’t want to reimplement all those logic here.
As a basic test this sounds reasonable? Shouldn’t this be very easy to setup? Like you send the XCM message and then ensure in a post check that the issuance is correct?
For sure this should be some constant monitoring as well, but as some sort of “smoke test” I think this makes sense.
Note that we round numbers and redact some values (e.g. XCM topic ID) to avoid flaky tests due to onchain changes such as tx fee factor.
What’s missing is to assert that the reserve chain have corresponding tokens. This check is tricky because:
We modify storage directly to gain some token for testing so there will be some number mismatch. It is possible to offset those numbers though.
The tests are run against mainnet head data, which could have inconsistency due to reason I stated previously. i.e. if we run the test on a block numbers that someone is sending XCM transfer and it is processed on source chain but not yet reserve chain, then the number will mismatch and it will fail the test because of this.
Do you think if it is easy to add a new chain? e.g. chain def for Acala 4
There should be one chain that is using the most available features with comments on what is doing what. Otherwise looks okay.
Do you think if it is easy to add new tests? e.g. tests between Acala and Moonbeam 1
How would this integrate into the Fellowship? Do we have to fork it into there?
And how would new tests be added, to the upstream repo and then syncing the fork?
Before we continue to develop new tests, I would like to request a review from the community for feedback and suggestions.
I would just like to try it on the runtimes master branch, that should give some feedback on where to improve since it looks good in general.
But what is a clean state? A previous known good state? But it wouldn’t catch problems introduced by state changes (e.g. if an asset metadata is changed).
It should be relatively easy to have a GH Action that: build wasm, clone this repo, run the tests using the new wasm.