Skip to content
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

Merged
merged 7 commits into from
Jul 31, 2024
Merged

validate new reshare #970

merged 7 commits into from
Jul 31, 2024

Conversation

JesseAbram
Copy link
Member

@JesseAbram JesseAbram commented Jul 30, 2024

Related #941

  • Adds validate reshare

@JesseAbram JesseAbram marked this pull request as ready for review July 30, 2024 19:46
Copy link
Contributor

@ameba23 ameba23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

crates/threshold-signature-server/src/helpers/launch.rs Outdated Show resolved Hide resolved
@@ -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
Copy link
Contributor

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.

Copy link
Member Author

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

Copy link
Member Author

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)

Copy link
Collaborator

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

@JesseAbram JesseAbram merged commit c29e49a into master Jul 31, 2024
14 checks passed
@JesseAbram JesseAbram deleted the validate-new-reshare branch July 31, 2024 16:20
@github-actions github-actions bot locked and limited conversation to collaborators Jul 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants