Skip to content

Commit

Permalink
Merge PR:fix mismatch app hash when the node has been restarted (#1468)
Browse files Browse the repository at this point in the history
  • Loading branch information
KamiD authored Jan 20, 2022
1 parent 01f9180 commit 8849f59
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GithubTop=github.com



Version=v1.1.4.2
Version=v1.1.4.3
CosmosSDK=v0.39.2
Tendermint=v0.33.9
Iavl=v0.14.3
Expand Down
8 changes: 3 additions & 5 deletions libs/cosmos-sdk/server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ package server

import (
"fmt"
"os"
"runtime/pprof"

sdk "github.com/okex/exchain/libs/cosmos-sdk/types"
"github.com/okex/exchain/libs/system"
"github.com/okex/exchain/libs/tendermint/global"
"github.com/okex/exchain/libs/tendermint/libs/log"
"os"
"runtime/pprof"

"github.com/okex/exchain/libs/cosmos-sdk/baseapp"
"github.com/okex/exchain/libs/cosmos-sdk/client/context"
Expand Down Expand Up @@ -297,8 +297,6 @@ func startInProcess(ctx *Context, cdc *codec.Codec, appCreator AppCreator, appSt
return nil, err
}

global.SetGlobalHeight(tmNode.ConsensusState().Height)

app.SetOption(abci.RequestSetOption{
Key: "CheckChainID",
Value: tmNode.ConsensusState().GetState().ChainID,
Expand Down
3 changes: 3 additions & 0 deletions libs/tendermint/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"strings"
"time"

"github.com/okex/exchain/libs/tendermint/global"

"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
Expand Down Expand Up @@ -572,6 +574,7 @@ func NewNode(config *cfg.Config,
if err != nil {
return nil, err
}
global.SetGlobalHeight(state.LastBlockHeight)

// Create the proxyApp and establish connections to the ABCI app (consensus, mempool, query).
proxyApp, err := createAndStartProxyAppConns(clientCreator, logger)
Expand Down

0 comments on commit 8849f59

Please sign in to comment.