-
Notifications
You must be signed in to change notification settings - Fork 2
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
validate new reshare #970
validate new reshare #970
Conversation
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.
🥇
@@ -231,12 +233,22 @@ pub mod pallet { | |||
proactive_refresh_keys: self.proactive_refresh_data.1.clone(), | |||
}; | |||
ProactiveRefresh::<T>::put(refresh_info); | |||
|
|||
// mocks a signer rotation for tss new_reshare tests |
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.
If this is staying long term i think it would be ideal if it was kept out of the production binary. Normally i would say put it in a if cfg!(test) {}
- but we can't do that because we test against the release version of the chain node.
Maybe it could go behind a feature flag.
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.
ya but then we would have to build it like that for tests, this line of code goes into the genesis file but only if you specify in the chainspec file. The only chainspec file that does this is integration test, so this does stay out of the production binary
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.
that being said this is because I need state that isn't changeable (only on session and idk if a 4 hour long test makes sense) if we go the feature flag route we can make a generalizable test function that changes any state......it would get rid of this, idk if we are cool with that im fine with it as a refactor (looping in @HCastano)
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.
@JesseAbram I do agree with Peg here, I would like to keep test related code more clearly marked as such for future readers.
To be fair to Jesse though, the compiler would remove this code for the condition that mock_signer_rotate
is false
, which should be the case for production builds.
On the session length, our tests should have this configured to be less than four hours (like a few blocks, maybe?). And we can always force a session rotation in test code as well
Related #941