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

log vote's signer and block when vote is invalid #1982

Merged
merged 4 commits into from Feb 15, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions cmd/bootstrap/cmd/finalize.go
Expand Up @@ -285,9 +285,10 @@ func readRootBlockVotes() []*hotstuff.Vote {
}

// read file and append to partners
var p hotstuff.Vote
readJSON(f, &p)
votes = append(votes, &p)
var vote hotstuff.Vote
readJSON(f, &vote)
votes = append(votes, &vote)
log.Info().Msgf("read vote %v for block %v from signerID %v", vote.ID(), vote.BlockID, vote.SignerID)
}
return votes
}
Expand Down
1 change: 1 addition & 0 deletions cmd/bootstrap/cmd/finalize_test.go
Expand Up @@ -29,6 +29,7 @@ const finalizeHappyPathLogs = "^deterministic bootstrapping random seed" +
`assembling network and staking keys` +
`reading root block data` +
`reading root block votes` +
`read vote .*` +
`reading dkg data` +
`constructing root QC` +
`computing collection node clusters` +
Expand Down
6 changes: 5 additions & 1 deletion cmd/bootstrap/run/qc.go
Expand Up @@ -65,7 +65,11 @@ func GenerateRootQC(block *flow.Block, votes []*model.Vote, participantData *Par
for _, vote := range votes {
err := processor.Process(vote)
if err != nil {
return nil, err
return nil, fmt.Errorf("fail to process vote %v for block %v from signer %v: %w",
vote.ID(),
block.ID(),
vote.SignerID,
err)
}
}

Expand Down