From c230b7c41a226eca2e72ae8a217d3761f8a9731f Mon Sep 17 00:00:00 2001 From: TAKAMI Torao Date: Fri, 17 Apr 2020 15:07:37 +0900 Subject: [PATCH] fixed WALCrash skipping --- consensus/replay_test.go | 6 ------ consensus/state.go | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/consensus/replay_test.go b/consensus/replay_test.go index 5f9f14b48..4cf0d915d 100644 --- a/consensus/replay_test.go +++ b/consensus/replay_test.go @@ -114,9 +114,6 @@ func sendTxs(ctx context.Context, cs *State) { // TestWALCrash uses crashing WAL to test we can recover from any WAL failure. func TestWALCrash(t *testing.T) { - // FIXME - t.Skip("Temporarily excluded because this a case that doesn't end due to Proposer selection changes.") - testCases := []struct { name string initFn func(dbm.DB, *State, context.Context) @@ -313,9 +310,6 @@ var modes = []uint{0, 1, 2} // This is actually not a test, it's for storing validator change tx data for testHandshakeReplay func TestSimulateValidatorsChange(t *testing.T) { - // FIXME - t.Skip("Temporarily excluded because this a case that doesn't end due to Proposer selection changes.") - nPeers := 7 nVals := 4 css, genDoc, config, cleanup := randConsensusNetWithPeers( diff --git a/consensus/state.go b/consensus/state.go index 0729d6067..9999f141d 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -828,7 +828,13 @@ func (cs *State) enterNewRound(height int64, round int) { logger.Info(fmt.Sprintf("enterNewRound(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) // Select the current height and round Proposer + prevProposer := cs.Proposer cs.Proposer = types.SelectProposer(cs.Validators, cs.state.LastProofHash, height, round) + if prevProposer == nil || !bytes.Equal(prevProposer.Address, cs.Proposer.Address) { + logger.Info(fmt.Sprintf("Changing Proposer: %+v -> %+v", prevProposer, cs.Proposer)) + } else { + logger.Info(fmt.Sprintf("Current Proposer: %+v", cs.Proposer)) + } // Setup new round // we don't fire newStep for this step,