Skip to content
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
14 changes: 12 additions & 2 deletions agreement/pseudonode.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ import (

// TODO put these in config
const (
pseudonodeVerificationBacklog = 32
maxPseudonodeOutputWaitDuration = 2 * time.Second
pseudonodeVerificationBacklog = 32
maxPseudonodeOutputWaitDuration = 2 * time.Second
votingKeysLoggingDurationThreashold = 200 * time.Millisecond
)

var errPseudonodeBacklogFull = fmt.Errorf("pseudonode input channel is full")
Expand Down Expand Up @@ -215,9 +216,18 @@ func (n *asyncPseudonode) loadRoundParticipationKeys(voteRound basics.Round) []a
}
balanceRound := balanceRound(voteRound, cparams)

// measure the time it takes to acquire the voting keys.
beforeVotingKeysTime := time.Now()

// otherwise, we want to load the participation keys.
n.participationKeys = n.keys.VotingKeys(voteRound, balanceRound)
n.participationKeysRound = voteRound

votingKeysDuration := time.Since(beforeVotingKeysTime)
if votingKeysDuration > votingKeysLoggingDurationThreashold {
n.log.Warnf("asyncPseudonode: acquiring the %d voting keys for round %d took %v", len(n.participationKeys), voteRound, votingKeysDuration)
}

return n.participationKeys
}

Expand Down