diff --git a/consensus/replay.go b/consensus/replay.go index b69b4384f..124d3b5fb 100644 --- a/consensus/replay.go +++ b/consensus/replay.go @@ -101,6 +101,7 @@ func (cs *ConsensusState) catchupReplay(csHeight int) error { // Search for height marker gr, found, err = cs.wal.group.Search("#HEIGHT: ", makeHeightSearchFunc(csHeight)) if err == io.EOF { + log.Warn("Replay: wal.group.Search returned EOF", "height", csHeight) return nil } else if err != nil { return err diff --git a/consensus/state.go b/consensus/state.go index 31a2e2c9f..9dead0cfb 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -362,6 +362,14 @@ func (cs *ConsensusState) OnStart() error { // let's go for it anyways, maybe we're fine } + // If the latest block was applied in the tmsp handshake, + // we may not have written the current height to the wal, + // so write it here in case + if cs.Step == RoundStepNewHeight { + log.Warn("wal.writeHeight", "height", cs.Height) + cs.wal.writeHeight(cs.Height) + } + // now start the receiveRoutine go cs.receiveRoutine(0) diff --git a/state/execution.go b/state/execution.go index e1cea605b..47ca01498 100644 --- a/state/execution.go +++ b/state/execution.go @@ -344,6 +344,9 @@ func (h *Handshaker) Handshake(proxyApp proxy.AppConns) error { return errors.New(Fmt("Error on replay: %v", err)) } + // Save the state + h.state.Save() + // TODO: (on restart) replay mempool return nil @@ -378,7 +381,6 @@ func (h *Handshaker) ReplayBlocks(appHash []byte, appBlockHeight int, appConnCon // so load the intermediate state and update the hash h.state.LoadIntermediate() h.state.AppHash = appHash - h.state.Save() log.Debug("TMSP RelpayBlocks: Loaded intermediate state and updated state.AppHash") } else { PanicSanity(Fmt("Unexpected state.AppHash: state.AppHash %X; app.AppHash %X, lastBlock.AppHash %X", stateAppHash, appHash, lastBlockAppHash)) diff --git a/test/docker/Dockerfile b/test/docker/Dockerfile index 7cc952545..5a859a289 100644 --- a/test/docker/Dockerfile +++ b/test/docker/Dockerfile @@ -21,5 +21,8 @@ COPY . $REPO RUN go install ./cmd/tendermint RUN bash scripts/install_tmsp_apps.sh +# expose the volume for debugging +VOLUME $REPO + EXPOSE 46656 EXPOSE 46657 diff --git a/test/persist/test_failure_indices.sh b/test/persist/test_failure_indices.sh index 7302ccacd..d6012fbec 100644 --- a/test/persist/test_failure_indices.sh +++ b/test/persist/test_failure_indices.sh @@ -18,7 +18,7 @@ function start_procs(){ PID_TENDERMINT=$! else # run in foreground, fail - FAIL_TEST_INDEX=$indexToFail tendermint node &> tendermint_${name}.log + FAIL_TEST_INDEX=$indexToFail tendermint node --log_level=debug &> tendermint_${name}.log PID_TENDERMINT=$! fi }