Skip to content

Commit

Permalink
Merge pull request #65 from attestantio/require-generation-passphrase
Browse files Browse the repository at this point in the history
Ensure generation passphrase is present for DKG.
  • Loading branch information
mcdee authored Aug 28, 2024
2 parents 02515ab + b72248a commit 361fcdc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
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

0 comments on commit 361fcdc

Please sign in to comment.