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

Ensure generation passphrase is present for DKG. #65

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
- run slashing protection database garbage collection periodically
- add commit hash to log on startup
- enable gzip compression
- disallow generation of distributed accounts without passphrases

# Version 1.2.0
- add Amazon Secrets Manager (ASM) confidant
Expand Down
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,9 @@ func startProcess(ctx context.Context,
return nil, errors.Wrap(err, "failed to obtain account generation passphrase for process")
}
}
if len(generationPassphrase) == 0 {
log.Warn().Msg("No generation password supplied; distributed key generation cannot take place")
}

processSvc, err := standardprocess.New(ctx,
standardprocess.WithLogLevel(util.LogLevel("process")),
Expand Down
5 changes: 5 additions & 0 deletions services/process/standard/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ func (s *Service) OnPrepare(ctx context.Context,
defer span.Finish()
log.Trace().Uint64("sender_id", senderID).Str("account", account).Msg("Preparing for distributed key generation")

if len(s.generationPassphrase) == 0 {
log.Error().Msg("Instance does not have a generation passphrase; cannot continue")
return ErrNotCreated
}

s.generationsMu.Lock()
defer s.generationsMu.Unlock()

Expand Down
Loading