state: send byzantine validators in BeginBlock

This commit is contained in:
Ethan Buchman
2017-12-29 11:26:55 -05:00
parent e97e0bacd1
commit 28bbeac763
6 changed files with 117 additions and 60 deletions

View File

@ -191,13 +191,20 @@ func execBlockOnProxyApp(logger log.Logger, proxyAppConn proxy.AppConnConsensus,
}
// TODO: determine which validators were byzantine
byzantineVals := make([]*abci.Evidence, len(block.Evidence.Evidence))
for i, ev := range block.Evidence.Evidence {
byzantineVals[i] = &abci.Evidence{
PubKey: ev.Address(), // XXX
Height: ev.Height(),
}
}
// Begin block
_, err := proxyAppConn.BeginBlockSync(abci.RequestBeginBlock{
Hash: block.Hash(),
Header: types.TM2PB.Header(block.Header),
AbsentValidators: absentVals,
ByzantineValidators: nil,
ByzantineValidators: byzantineVals,
})
if err != nil {
logger.Error("Error in proxyAppConn.BeginBlock", "err", err)