substrate icon indicating copy to clipboard operation
substrate copied to clipboard

Integration tests for staking + election-provider-multi-phase

Open gpestana opened this issue 3 years ago • 1 comments

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:

  1. fn enters_emergency_phase_after_forcing_before_elect, which replicates the Kusama incident of 12/22.
  2. 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

gpestana avatar Dec 19 '22 11:12 gpestana

Once done, we can include usage of https://github.com/paritytech/polkadot-sdk/issues/432 in this PR as well.

kianenigma avatar Feb 06 '23 13:02 kianenigma

bot help

gpestana avatar Mar 13 '23 08:03 gpestana

Here's a link to docs

command-bot[bot] avatar Mar 13 '23 08:03 command-bot[bot]

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.

gpestana avatar Mar 13 '23 13:03 gpestana

bot merge

gpestana avatar Mar 16 '23 11:03 gpestana

Waiting for commit status.