Skip to content

Commit

Permalink
Merge pull request #1141 from irisnet/upgrade/class2-patch
Browse files Browse the repository at this point in the history
R4R: release version v0.10.2-patch
  • Loading branch information
wukongcheng authored Jan 22, 2019
2 parents 7f83970 + 3a79572 commit c92d168
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.10.2-patch

*January 21th, 2019*

- [iris] Fix the app hash conflict issue caused by the system halt proposal


## 0.10.2

*January 17th, 2019*
Expand Down
2 changes: 1 addition & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions app/replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,28 @@ func Replay(logger log.Logger) int64 {

curState := sm.LoadState(stateDB)
preState := sm.LoadPreState(stateDB)
if curState.LastBlockHeight <= preState.LastBlockHeight {
if curState.LastBlockHeight == preState.LastBlockHeight && preState.LastBlockHeight == 0 {
panic(fmt.Errorf("there is no block now, can't replay"))
}
var loadHeight int64
if blockStore.Height() == curState.LastBlockHeight {
logger.Info(fmt.Sprintf("blockstore height equals to current state height %d", curState.LastBlockHeight))
logger.Info(fmt.Sprintf("Blockstore height equals to current state height %d", curState.LastBlockHeight))
logger.Info("Just reset state DB to last height")
sm.SaveState(stateDB, preState)
loadHeight = preState.LastBlockHeight
} else if blockStore.Height() == curState.LastBlockHeight+1 {
logger.Info(fmt.Sprintf("blockstore height %d, current state height %d", blockStore.Height(), curState.LastBlockHeight))
logger.Info(fmt.Sprintf("Blockstore height %d, current state height %d", blockStore.Height(), curState.LastBlockHeight))
logger.Info(fmt.Sprintf("Retreat block %d in block store and reset state DB to last height", blockStore.Height()))
blockStore.RetreatLastBlock()
sm.SaveState(stateDB, preState)
loadHeight = preState.LastBlockHeight
} else if blockStore.Height() == curState.LastBlockHeight+2 && curState.LastBlockHeight == preState.LastBlockHeight {
logger.Info(fmt.Sprintf("Blockstore height %d, current state height %d, pre-state height %d", blockStore.Height(), curState.LastBlockHeight, preState.LastBlockHeight))
logger.Info("State store has already been retreat to last height, only retreat block store to last height")
blockStore.RetreatLastBlock()
loadHeight = preState.LastBlockHeight
} else {
panic(fmt.Errorf("tendermint block store height should be at most one ahead of the its state height"))
panic(fmt.Errorf("unexpected situation: tendermint block store height %d, tendermint state store height %d", blockStore.Height(), curState.LastBlockHeight))
}

return loadHeight
Expand Down
2 changes: 1 addition & 1 deletion app/v1/gov/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (keeper Keeper) NewSystemHaltProposal(ctx sdk.Context, title string, descri
Status: StatusDepositPeriod,
TallyResult: EmptyTallyResult(),
TotalDeposit: sdk.Coins{},
SubmitTime: time.Now(),
SubmitTime: ctx.BlockHeader().Time,
}
var proposal Proposal = &SystemHaltProposal{
textProposal,
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

// Version - Iris Version
const ProtocolVersion = 1
const Version = "0.10.2"
const Version = "0.10.2-patch"
// GitCommit set by build flags
var GitCommit = ""

Expand Down

0 comments on commit c92d168

Please sign in to comment.