-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix BABE smoke tests #845
base: master
Are you sure you want to change the base?
Fix BABE smoke tests #845
Conversation
WASM runtime size check:Compared to target branchdancebox runtime: 1412 KB (no changes) ✅ flashbox runtime: 824 KB (no changes) ✅ dancelight runtime: 2172 KB (no changes) ✅ container chain template simple runtime: 1116 KB (no changes) ✅ container chain template frontier runtime: 1404 KB (no changes) ✅ |
Coverage Report@@ Coverage Diff @@
## master agustin-fix-babe-smoke-test +/- ##
==============================================================
Coverage 66.04% 66.04% 0.00%
Files 335 335
Lines 58858 58858
==============================================================
Hits 38869 38869
Misses 19989 19989
|
`Missing babe key for block author: ${expectedAuthor}` | ||
).toBeTruthy(); | ||
const pubKey = hexToU8a(authorKeys.babe); | ||
const authorBabe = accountsWithBabeKeys.find((acc) => acc[0] == expectedAuthor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think will not be covering some cases, for instance, what happens if we are adding or removing one validator?
Here the more important problem is that we are doing the following:
- in the first test, we are going to the block where the session started, we are getting the validators that are outputed by the digest log and compare them against the current set of babe validaotrs:
// Assert that authorities from log == authorities from pallet
This is wrong, as the digest in session N is expressing the babe validators for session N+1, and we are comparing it against those in session N
What we should do instead is go to the session N-1 start block, get the digest, and compare it against those in session N
What does it do?
Fixes two smoke tests related to BABE, that were failing within a certain period of time in which session keys for validators were changed.
This PR aims to adapt the tests for future situations and make them consistent even if there is a change in session keys.