Integration tests for staking + election-provider-multi-phase
This PR creates an integration test crate for EPM and staking that is intended to test as accurately as possible protocol edge cases and critical states. Another goal of the integration test crate is to document how to recover from those edge cases in production and inform future improvements.
The current PR includes two e2e tests:
fn enters_emergency_phase_after_forcing_before_elect, which replicates the Kusama incident of 12/22.fn continous_slashes_below_offending_threshold, which applies a slash to a % of the active validators below the offending threshold until EPM enters in emergency phase (due to the election min score checks).
Closes https://github.com/paritytech/substrate/issues/9057
Once done, we can include usage of https://github.com/paritytech/polkadot-sdk/issues/432 in this PR as well.
bot help
Here's a link to docs
Won't block this, but some improvements can be done.
Hard to judge at this point if the mock file is good, as not so many tests are there.
Hope you can address most my comments, merge, use it to test further PRs, then evaluate.
What I am worried is that a shitty mock file with too much unused functionality will be a headache waiting to happen and since this pallet is focused toward testing, we should make sure the mock build remains AAA.
I agree with your comments, I'll address your comments and improve the current PR and ask for another pass before merging.
bot merge
Waiting for commit status.