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

dkg: replace hex with base64 for definition_hash #756

Merged
merged 1 commit into from
Jul 1, 2022
Merged
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
5 changes: 3 additions & 2 deletions dkg/dkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package dkg
import (
"context"
crand "crypto/rand"
"encoding/base64"
"fmt"
"time"

Expand Down Expand Up @@ -98,7 +99,7 @@ func Run(ctx context.Context, conf Config) (err error) {
if err != nil {
return errors.Wrap(err, "hash definition")
}
clusterID := fmt.Sprintf("%x", defHash[:])
clusterID := base64.StdEncoding.EncodeToString(defHash[:])

peerIds, err := def.PeerIDs()
if err != nil {
Expand Down Expand Up @@ -133,7 +134,7 @@ func Run(ctx context.Context, conf Config) (err error) {

tp := newFrostP2P(ctx, tcpNode, peerMap, clusterID)

log.Info(ctx, "Connecting to peers...", z.Hex("definition_hash", defHash[:]))
log.Info(ctx, "Connecting to peers...", z.Str("definition_hash", clusterID))

ctx, cancel, err = waitPeers(ctx, tcpNode, peers)
if err != nil {
Expand Down