e2e: add error logs when we get an unexpected height in ExtendVote or VerifyVoteExtension requests

Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
Thane Thomson
2022-04-14 17:40:53 -04:00
parent 61899b2dab
commit e4dd69118a
+7 -2
View File
@@ -429,6 +429,11 @@ func (app *Application) ExtendVote(req abci.RequestExtendVote) abci.ResponseExte
// We ignore any requests for vote extensions that don't match our expected
// next height.
if req.Height != int64(app.state.Height)+1 {
app.logger.Error(
"got unexpected height in ExtendVote request",
"expectedHeight", app.state.Height+1,
"requestHeight", req.Height,
)
return abci.ResponseExtendVote{}
}
ext := make([]byte, binary.MaxVarintLen64)
@@ -455,9 +460,9 @@ func (app *Application) VerifyVoteExtension(req abci.RequestVerifyVoteExtension)
}
if req.Height != int64(app.state.Height)+1 {
app.logger.Error(
"got request to verify a vote extension at an unexpected height",
"got unexpected height in VerifyVoteExtension request",
"expectedHeight", app.state.Height,
"requestHeight", req.Height,
"appHeight", app.state.Height,
)
return abci.ResponseVerifyVoteExtension{
Status: abci.ResponseVerifyVoteExtension_REJECT,