From 3b8c1ae119da990664f3b98bb2518032f5d837f9 Mon Sep 17 00:00:00 2001 From: Christopher Goes Date: Tue, 29 May 2018 03:11:17 +0200 Subject: [PATCH] Pin to an ABCI version --- Gopkg.lock | 5 ++--- Gopkg.toml | 4 ++-- consensus/replay.go | 4 ++-- state/execution.go | 5 +++-- state/execution_test.go | 11 ++++++----- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 87a53b126..107e9b767 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -229,7 +229,6 @@ revision = "714f901b98fdb3aa954b4193d8cbd64a28d80cad" [[projects]] - branch = "develop" name = "github.com/tendermint/abci" packages = [ "client", @@ -239,7 +238,7 @@ "server", "types" ] - revision = "bcfdd6dbaf10c947392e2b0a097b65b5fb247baf" + revision = "f9dce537281ffba5d1e047e6729429f7e5fb90c9" [[projects]] branch = "master" @@ -382,6 +381,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "fd7f01ccfa9bef049cfd6f9c6dd41c0b9fe1f7889f9feb73ab46423a686a94a3" + inputs-digest = "f428a5e2eb708af2e72274602d90fa5a3dc5711f568931aac2dde8521c1e29f1" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 857070766..d835bcb63 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -69,9 +69,9 @@ name = "github.com/stretchr/testify" version = "~1.2.1" -[[constraint]] +[[override]] name = "github.com/tendermint/abci" - branch = "develop" + revision = "f9dce537281ffba5d1e047e6729429f7e5fb90c9" [[constraint]] name = "github.com/tendermint/go-crypto" diff --git a/consensus/replay.go b/consensus/replay.go index a066c8733..34cf3218d 100644 --- a/consensus/replay.go +++ b/consensus/replay.go @@ -269,8 +269,8 @@ func (h *Handshaker) ReplayBlocks(state sm.State, appHash []byte, appBlockHeight if appBlockHeight == 0 { validators := types.TM2PB.Validators(state.Validators) req := abci.RequestInitChain{ - Validators: validators, - AppStateBytes: h.appState, + Validators: validators, + GenesisBytes: h.appState, } _, err := proxyApp.Consensus().InitChainSync(req) if err != nil { diff --git a/state/execution.go b/state/execution.go index b8676cad8..ded3585e8 100644 --- a/state/execution.go +++ b/state/execution.go @@ -187,10 +187,11 @@ func execBlockOnProxyApp(logger log.Logger, proxyAppConn proxy.AppConnConsensus, proxyAppConn.SetResponseCallback(proxyCb) // determine which validators did not sign last block - absentVals := make([]int32, 0) + absentVals := make([][]byte, 0) for valI, vote := range block.LastCommit.Precommits { + addr, _ := vs.GetByIndex(valI) if vote == nil { - absentVals = append(absentVals, int32(valI)) + absentVals = append(absentVals, addr) } } diff --git a/state/execution_test.go b/state/execution_test.go index 0462b0fed..e89a50b0c 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -19,6 +19,7 @@ import ( var ( privKey = crypto.GenPrivKeyEd25519FromSecret([]byte("execution_test")) + privKey2 = crypto.GenPrivKeyEd25519FromSecret([]byte("execution_test_2")) chainID = "execution_chain" testPartSize = 65536 nTxsPerBlock = 10 @@ -64,7 +65,7 @@ func TestBeginBlockAbsentValidators(t *testing.T) { testCases := []struct { desc string lastCommitPrecommits []*types.Vote - expectedAbsentValidators []int32 + expectedAbsentValidators [][]byte }{ {"none absent", []*types.Vote{{ValidatorIndex: 0, Timestamp: now, Type: types.VoteTypePrecommit}, {ValidatorIndex: 1, Timestamp: now}}, [][]byte{}}, {"one absent", []*types.Vote{{ValidatorIndex: 0, Timestamp: now, Type: types.VoteTypePrecommit}, nil}, [][]byte{privKey2.PubKey().Bytes()}}, @@ -109,10 +110,10 @@ func TestBeginBlockByzantineValidators(t *testing.T) { expectedByzantineValidators []abci.Evidence }{ {"none byzantine", []types.Evidence{}, []abci.Evidence{}}, - {"one byzantine", []types.Evidence{ev1}, []abci.Evidence{{ev1.Address(), ev1.Height()}}}, + {"one byzantine", []types.Evidence{ev1}, []abci.Evidence{{nil, ev1.Address(), ev1.Height(), int64(0)}}}, {"multiple byzantine", []types.Evidence{ev1, ev2}, []abci.Evidence{ - {ev1.Address(), ev1.Height()}, - {ev2.Address(), ev2.Height()}}}, + {nil, ev1.Address(), ev1.Height(), int64(0)}, + {nil, ev2.Address(), ev2.Height(), int64(0)}}}, } for _, tc := range testCases { @@ -161,7 +162,7 @@ var _ abci.Application = (*testApp)(nil) type testApp struct { abci.BaseApplication - AbsentValidators []int32 + AbsentValidators [][]byte ByzantineValidators []abci.Evidence }