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

Add a test case to confirm that the selected Proposer matches the VRF-selected one #190

Merged
merged 2 commits into from
Feb 24, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
revert: it's correct to create the Proposal Block iff privValidator i…
…s Proposer
  • Loading branch information
torao committed Feb 24, 2021
commit d9d01ed984278a04d2f91f6310761b4b231477ca
4 changes: 2 additions & 2 deletions consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -1096,14 +1096,14 @@ func (cs *State) createProposalBlock(round int) (block *types.Block, blockParts
if cs.privValidator == nil {
panic("entered createProposalBlock with privValidator being nil")
}
_, err := cs.privValidator.GetPubKey()
pubKey, err := cs.privValidator.GetPubKey()
if err != nil {
// If this node is a validator & proposer in the current round, it will
// miss the opportunity to create a block.
cs.Logger.Error("Error on retrival of pubkey", "err", err)
return
}
proposerAddr := cs.Validators.SelectProposer(cs.state.LastProofHash, cs.Height, round).Address
proposerAddr := pubKey.Address()
message := cs.state.MakeHashMessage(round)

proof, err := cs.privValidator.GenerateVRFProof(message)
Expand Down