Generate and distribute trust quorum shares during rack setup#1182
Merged
Conversation
Collaborator
smklein
approved these changes
Jun 9, 2022
Comment on lines
+19
to
+21
| // TODO-cleanup This is currently optional because we don't do trust quorum | ||
| // shares for single-node deployments (i.e., most dev/test environments), | ||
| // but eventually this should be required. |
Collaborator
There was a problem hiding this comment.
Thanks for including this - I think it's important we make progress on multi-node, but not breaking single-node seems critical too
Comment on lines
+273
to
+305
| // Create a rack secret, unless we're in the single-sled case. | ||
| let mut rack_secret_shares = if bootstrap_addrs.len() > 1 { | ||
| let total_shares = bootstrap_addrs.len(); | ||
| if config.rack_secret_threshold > 1 { | ||
| let secret = RackSecret::new(); | ||
| let (shares, verifier) = secret | ||
| .split(config.rack_secret_threshold, total_shares) | ||
| .map_err(SetupServiceError::SplitRackSecret)?; | ||
|
|
||
| // Sanity check that `split` returned the expected number of | ||
| // shares (one per bootstrap agent) | ||
| assert_eq!(shares.len(), total_shares); | ||
|
|
||
| Some(shares.into_iter().map(move |share| ShareDistribution { | ||
| threshold: config.rack_secret_threshold, | ||
| total_shares, | ||
| verifier: verifier.clone(), | ||
| share, | ||
| })) | ||
| } else { | ||
| warn!( | ||
| self.log, | ||
| concat!( | ||
| "Skipping rack secret creation due to config", | ||
| " (despite discovery of {} bootstrap agents)" | ||
| ), | ||
| total_shares, | ||
| ); | ||
| None | ||
| } | ||
| } else { | ||
| None | ||
| }; |
Collaborator
There was a problem hiding this comment.
WDYT about splitting this into a separate function so we can add a test?
Contributor
Author
There was a problem hiding this comment.
Seems perfectly reasonable; will do.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The primary change in this PR is that trust quorum shares are now created by RSS and sent to sleds as part of the
SledAgentRequests distributed during rack setup instead of being generated ahead of time and installed bything-flinger. Ancillary changes:Closes #513 (complete) and #517 (no longer relevant).