mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-14 13:51:21 +00:00
state compiles
This commit is contained in:
@ -5,7 +5,6 @@ import (
|
|||||||
|
|
||||||
fail "github.com/ebuchman/fail-test"
|
fail "github.com/ebuchman/fail-test"
|
||||||
abci "github.com/tendermint/abci/types"
|
abci "github.com/tendermint/abci/types"
|
||||||
crypto "github.com/tendermint/go-crypto"
|
|
||||||
"github.com/tendermint/tendermint/proxy"
|
"github.com/tendermint/tendermint/proxy"
|
||||||
"github.com/tendermint/tendermint/types"
|
"github.com/tendermint/tendermint/types"
|
||||||
dbm "github.com/tendermint/tmlibs/db"
|
dbm "github.com/tendermint/tmlibs/db"
|
||||||
@ -192,11 +191,10 @@ func execBlockOnProxyApp(logger log.Logger, proxyAppConn proxy.AppConnConsensus,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: determine which validators were byzantine
|
byzantineVals := make([]*abci.Evidence, len(block.Evidence.Evidence))
|
||||||
byzantineVals := make([]abci.Evidence, len(block.Evidence.Evidence))
|
|
||||||
for i, ev := range block.Evidence.Evidence {
|
for i, ev := range block.Evidence.Evidence {
|
||||||
byzantineVals[i] = abci.Evidence{
|
byzantineVals[i] = &abci.Evidence{
|
||||||
PubKey: ev.Address(), // XXX
|
// TODO: fill this in
|
||||||
Height: ev.Height(),
|
Height: ev.Height(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -205,7 +203,7 @@ func execBlockOnProxyApp(logger log.Logger, proxyAppConn proxy.AppConnConsensus,
|
|||||||
_, err := proxyAppConn.BeginBlockSync(abci.RequestBeginBlock{
|
_, err := proxyAppConn.BeginBlockSync(abci.RequestBeginBlock{
|
||||||
Hash: block.Hash(),
|
Hash: block.Hash(),
|
||||||
Header: types.TM2PB.Header(block.Header),
|
Header: types.TM2PB.Header(block.Header),
|
||||||
AbsentValidators: absentVals,
|
// TODO: fill this in
|
||||||
ByzantineValidators: byzantineVals,
|
ByzantineValidators: byzantineVals,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -241,9 +239,9 @@ func execBlockOnProxyApp(logger log.Logger, proxyAppConn proxy.AppConnConsensus,
|
|||||||
// If more or equal than 1/3 of total voting power changed in one block, then
|
// If more or equal than 1/3 of total voting power changed in one block, then
|
||||||
// a light client could never prove the transition externally. See
|
// a light client could never prove the transition externally. See
|
||||||
// ./lite/doc.go for details on how a light client tracks validators.
|
// ./lite/doc.go for details on how a light client tracks validators.
|
||||||
func updateValidators(currentSet *types.ValidatorSet, updates []abci.Validator) error {
|
func updateValidators(currentSet *types.ValidatorSet, updates []*abci.Validator) error {
|
||||||
for _, v := range updates {
|
for _, v := range updates {
|
||||||
pubkey, err := crypto.PubKeyFromBytes(v.PubKey) // NOTE: expects go-amino encoded pubkey
|
pubkey, err := types.PB2TM.PubKey(v.PubKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user