mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 06:42:16 +00:00
state.State and wal.writeHeight after handshake
This commit is contained in:
parent
0e7694ca94
commit
0c01b0ded9
@ -101,6 +101,7 @@ func (cs *ConsensusState) catchupReplay(csHeight int) error {
|
|||||||
// Search for height marker
|
// Search for height marker
|
||||||
gr, found, err = cs.wal.group.Search("#HEIGHT: ", makeHeightSearchFunc(csHeight))
|
gr, found, err = cs.wal.group.Search("#HEIGHT: ", makeHeightSearchFunc(csHeight))
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
|
log.Warn("Replay: wal.group.Search returned EOF", "height", csHeight)
|
||||||
return nil
|
return nil
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -362,6 +362,14 @@ func (cs *ConsensusState) OnStart() error {
|
|||||||
// let's go for it anyways, maybe we're fine
|
// 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
|
// now start the receiveRoutine
|
||||||
go cs.receiveRoutine(0)
|
go cs.receiveRoutine(0)
|
||||||
|
|
||||||
|
@ -344,6 +344,9 @@ func (h *Handshaker) Handshake(proxyApp proxy.AppConns) error {
|
|||||||
return errors.New(Fmt("Error on replay: %v", err))
|
return errors.New(Fmt("Error on replay: %v", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Save the state
|
||||||
|
h.state.Save()
|
||||||
|
|
||||||
// TODO: (on restart) replay mempool
|
// TODO: (on restart) replay mempool
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@ -378,7 +381,6 @@ func (h *Handshaker) ReplayBlocks(appHash []byte, appBlockHeight int, appConnCon
|
|||||||
// so load the intermediate state and update the hash
|
// so load the intermediate state and update the hash
|
||||||
h.state.LoadIntermediate()
|
h.state.LoadIntermediate()
|
||||||
h.state.AppHash = appHash
|
h.state.AppHash = appHash
|
||||||
h.state.Save()
|
|
||||||
log.Debug("TMSP RelpayBlocks: Loaded intermediate state and updated state.AppHash")
|
log.Debug("TMSP RelpayBlocks: Loaded intermediate state and updated state.AppHash")
|
||||||
} else {
|
} else {
|
||||||
PanicSanity(Fmt("Unexpected state.AppHash: state.AppHash %X; app.AppHash %X, lastBlock.AppHash %X", stateAppHash, appHash, lastBlockAppHash))
|
PanicSanity(Fmt("Unexpected state.AppHash: state.AppHash %X; app.AppHash %X, lastBlock.AppHash %X", stateAppHash, appHash, lastBlockAppHash))
|
||||||
|
@ -21,5 +21,8 @@ COPY . $REPO
|
|||||||
RUN go install ./cmd/tendermint
|
RUN go install ./cmd/tendermint
|
||||||
RUN bash scripts/install_tmsp_apps.sh
|
RUN bash scripts/install_tmsp_apps.sh
|
||||||
|
|
||||||
|
# expose the volume for debugging
|
||||||
|
VOLUME $REPO
|
||||||
|
|
||||||
EXPOSE 46656
|
EXPOSE 46656
|
||||||
EXPOSE 46657
|
EXPOSE 46657
|
||||||
|
@ -18,7 +18,7 @@ function start_procs(){
|
|||||||
PID_TENDERMINT=$!
|
PID_TENDERMINT=$!
|
||||||
else
|
else
|
||||||
# run in foreground, fail
|
# 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=$!
|
PID_TENDERMINT=$!
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user