From ced42255f8a3fd07dcac3dda367713cd09f48227 Mon Sep 17 00:00:00 2001 From: Raymond Date: Tue, 15 Jan 2019 16:23:29 +0800 Subject: [PATCH 1/6] fix SystemHaltProposal consensus failure issue --- app/v1/gov/keeper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/v1/gov/keeper.go b/app/v1/gov/keeper.go index 33c44fe69..76a5c0d58 100644 --- a/app/v1/gov/keeper.go +++ b/app/v1/gov/keeper.go @@ -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, From 519f29ff38d89299aab71b6ff6c01008efceed3e Mon Sep 17 00:00:00 2001 From: Raymond Date: Tue, 15 Jan 2019 16:39:44 +0800 Subject: [PATCH 2/6] update tendermint to v0.27.3-iris1 --- Gopkg.lock | 6 +++--- Gopkg.toml | 2 +- version/version.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index ec7c6de5a..ace4b7df9 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -496,7 +496,7 @@ version = "v0.12.0-iris" [[projects]] - digest = "1:4416561b9d6e7de60334a880810e9d02c348b2549f5a327ccd34e90edac16271" + digest = "1:ffa35a4a4ce4ee278c208a1e5f75b2d92eaba36d2f614e3ffa2863651429e4ed" name = "github.com/tendermint/tendermint" packages = [ "abci/client", @@ -561,9 +561,9 @@ "version", ] pruneopts = "UT" - revision = "ae55f6ecaab71915ff86bf7303c43f1e91b9dac2" + revision = "f261e73ea0164abe584fbdf7370dbd777f348d56" source = "https://github.com/irisnet/tendermint.git" - version = "v0.27.3-iris" + version = "v0.27.3-iris1" [[projects]] digest = "1:bf6d9a827ea3cad964c2f863302e4f6823170d0b5ed16f72cf1184a7c615067e" diff --git a/Gopkg.toml b/Gopkg.toml index c17a11e4f..743fa66e2 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -32,7 +32,7 @@ [[override]] name = "github.com/tendermint/tendermint" source = "https://github.com/irisnet/tendermint.git" - version = "=v0.27.3-iris" + version = "=v0.27.3-iris1" [[constraint]] name = "github.com/emicklei/proto" diff --git a/version/version.go b/version/version.go index 7e623100e..fd2c1d1e8 100644 --- a/version/version.go +++ b/version/version.go @@ -9,7 +9,7 @@ import ( // Version - Iris Version const ProtocolVersion = 1 -const Version = "0.10.1" +const Version = "0.10.1-patch" // GitCommit set by build flags var GitCommit = "" From e61c4fd1f706e6b07bcce495f1c3d91b53fa14b9 Mon Sep 17 00:00:00 2001 From: Raymond Date: Wed, 16 Jan 2019 17:36:24 +0800 Subject: [PATCH 3/6] update tendermint version --- Gopkg.lock | 6 +++--- Gopkg.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index ace4b7df9..abc981012 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -496,7 +496,7 @@ version = "v0.12.0-iris" [[projects]] - digest = "1:ffa35a4a4ce4ee278c208a1e5f75b2d92eaba36d2f614e3ffa2863651429e4ed" + digest = "1:6cdabe9ae8dbe1346d33970fb753a266d4ec9382aeb3435254c7f16dab2cdc5e" name = "github.com/tendermint/tendermint" packages = [ "abci/client", @@ -561,9 +561,9 @@ "version", ] pruneopts = "UT" - revision = "f261e73ea0164abe584fbdf7370dbd777f348d56" + revision = "9505c83f9d41f020b8fc77d411025e8394264554" source = "https://github.com/irisnet/tendermint.git" - version = "v0.27.3-iris1" + version = "v0.27.3-iris2" [[projects]] digest = "1:bf6d9a827ea3cad964c2f863302e4f6823170d0b5ed16f72cf1184a7c615067e" diff --git a/Gopkg.toml b/Gopkg.toml index 743fa66e2..084e5e3a3 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -32,7 +32,7 @@ [[override]] name = "github.com/tendermint/tendermint" source = "https://github.com/irisnet/tendermint.git" - version = "=v0.27.3-iris1" + version = "=v0.27.3-iris2" [[constraint]] name = "github.com/emicklei/proto" From 53b78c7dc2229f3fcff9c1002f70c8caaa7d766f Mon Sep 17 00:00:00 2001 From: Raymond Date: Thu, 17 Jan 2019 18:18:19 +0800 Subject: [PATCH 4/6] use v1/gov in the lcd --- client/gov/lcd/query.go | 2 +- client/gov/lcd/sendtx.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/gov/lcd/query.go b/client/gov/lcd/query.go index 5390c037d..ebb2ae1fe 100644 --- a/client/gov/lcd/query.go +++ b/client/gov/lcd/query.go @@ -9,7 +9,7 @@ import ( client "github.com/irisnet/irishub/client/gov" "github.com/irisnet/irishub/client/utils" "github.com/irisnet/irishub/codec" - "github.com/irisnet/irishub/modules/gov" + "github.com/irisnet/irishub/app/v1/gov" sdk "github.com/irisnet/irishub/types" "github.com/pkg/errors" ) diff --git a/client/gov/lcd/sendtx.go b/client/gov/lcd/sendtx.go index 52b4343a1..ac18aac48 100644 --- a/client/gov/lcd/sendtx.go +++ b/client/gov/lcd/sendtx.go @@ -9,7 +9,7 @@ import ( client "github.com/irisnet/irishub/client/gov" "github.com/irisnet/irishub/client/utils" "github.com/irisnet/irishub/codec" - "github.com/irisnet/irishub/modules/gov" + "github.com/irisnet/irishub/app/v1/gov" sdk "github.com/irisnet/irishub/types" ) From 9ac73c227dacabf907933d1678fc20a4656a786d Mon Sep 17 00:00:00 2001 From: Raymond Date: Mon, 21 Jan 2019 13:43:26 +0800 Subject: [PATCH 5/6] release the 0.10.2-patch version --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee0b550d9..19411231b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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* From 082db2b6b0f6c070346468266591cb8560c6db29 Mon Sep 17 00:00:00 2001 From: HaoyangLiu Date: Mon, 21 Jan 2019 16:41:13 +0800 Subject: [PATCH 6/6] Handle expected abort during replay last block --- app/replay.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/replay.go b/app/replay.go index dbce07e04..8fae9855d 100644 --- a/app/replay.go +++ b/app/replay.go @@ -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