diff --git a/app/app.go b/app/app.go index 2eea6b86a..bc611a4bd 100644 --- a/app/app.go +++ b/app/app.go @@ -721,8 +721,7 @@ func NewOKBChainApp( } app.InitUpgrade(ctx) app.WasmKeeper.UpdateGasRegister(ctx) - // TODO - // app.WasmKeeper.UpdateCurBlockNum(ctx) + app.WasmKeeper.UpdateCurBlockNum(ctx) } app.ScopedIBCKeeper = scopedIBCKeeper @@ -745,8 +744,10 @@ func (app *OKBChainApp) InitUpgrade(ctx sdk.Context) { }) app.ParamsKeeper.ClaimReadyForUpgrade(tmtypes.MILESTONE_MERCURY, func(info paramstypes.UpgradeInfo) { tmtypes.InitMilestoneMercuryHeight(int64(info.EffectiveHeight)) - // TODO - // app.WasmKeeper.UpdateMilestone(ctx, "wasm_v1", info.EffectiveHeight) + }) + app.ParamsKeeper.ClaimReadyForUpgrade(tmtypes.MILESTONE_VENUS7_NAME, func(info paramstypes.UpgradeInfo) { + tmtypes.InitMilestoneVenus7Height(int64(info.EffectiveHeight)) + app.WasmKeeper.UpdateMilestone(ctx, "wasm_v1", info.EffectiveHeight) }) if err := app.ParamsKeeper.ApplyEffectiveUpgrade(ctx); err != nil { tmos.Exit(fmt.Sprintf("failed apply effective upgrade height info: %s", err)) diff --git a/go.mod b/go.mod index 4c31dbb7e..9366f413a 100644 --- a/go.mod +++ b/go.mod @@ -172,7 +172,7 @@ require ( ) replace ( - github.com/CosmWasm/wasmvm => github.com/okx/wasmvm v1.3.3-0.20230802074406-d0ce412e3e0c + github.com/CosmWasm/wasmvm => github.com/okx/wasmvm v1.3.5 github.com/buger/jsonparser => github.com/buger/jsonparser v1.0.0 // imported by nacos-go-sdk, upgraded to v1.0.0 in case of a known vulnerable bug github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 github.com/cosmos/gorocksdb => github.com/okx/grocksdb v1.6.45-okc2 diff --git a/go.sum b/go.sum index 89ce34466..fe4d5cd8d 100644 --- a/go.sum +++ b/go.sum @@ -615,8 +615,8 @@ github.com/okx/go-ethereum v1.10.26-0.20230605041300-9db59c1d91e6 h1:pXsdHnWHejH github.com/okx/go-ethereum v1.10.26-0.20230605041300-9db59c1d91e6/go.mod h1:f9/CleoGkiU7NWF9tdpWGfEYmFbN7zUi17jGick31KM= github.com/okx/grocksdb v1.6.45-okc2 h1:Dbmax+uY71YuGTkJftpF55dbGW7hfIVOfNz2mnFqXl0= github.com/okx/grocksdb v1.6.45-okc2/go.mod h1:+/BHUY+mT0tbaVXwO2wTtD9eytazyw1W5n2O7AGyXZA= -github.com/okx/wasmvm v1.3.3-0.20230802074406-d0ce412e3e0c h1:P/iVsWWUAH0gDn3liTum9DzggVUpHs+dCasturoJU/0= -github.com/okx/wasmvm v1.3.3-0.20230802074406-d0ce412e3e0c/go.mod h1:vW/E3h8j9xBQs9bCoijDuawKo9kCtxOaS8N8J7KFtkc= +github.com/okx/wasmvm v1.3.5 h1:2eCD8Niy4Bdwssj3ztE5dZy+mz27dZJB5XdG+oaT4lU= +github.com/okx/wasmvm v1.3.5/go.mod h1:vW/E3h8j9xBQs9bCoijDuawKo9kCtxOaS8N8J7KFtkc= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= diff --git a/libs/tendermint/types/milestone.go b/libs/tendermint/types/milestone.go index ad4e1823f..333b88bca 100644 --- a/libs/tendermint/types/milestone.go +++ b/libs/tendermint/types/milestone.go @@ -14,6 +14,7 @@ var ( milestoneEarthHeight int64 milestoneVenus4Height int64 milestoneMercuryHeight int64 + milestoneVenus7Height int64 // note: it stores the earlies height of the node,and it is used by cli nodePruneHeight int64 @@ -26,6 +27,8 @@ const ( MILESTONE_EARTH = "earth" MILESTONE_Venus4 = "venus4" MILESTONE_MERCURY = "mercury" + + MILESTONE_VENUS7_NAME = "venus7" ) func SetupMainNetEnvironment(pruneH int64) { @@ -139,3 +142,23 @@ func InitMilestoneMercuryHeight(h int64) { // =========== Mercury =============== // ================================== + +// ================================== +// =========== Venus7 =============== +func HigherThanVenus7(h int64) bool { + if milestoneVenus7Height == 0 { + return false + } + return h > milestoneVenus7Height +} + +func InitMilestoneVenus7Height(h int64) { + milestoneVenus7Height = h +} + +func GetVenus7Height() int64 { + return milestoneVenus7Height +} + +// =========== Venus7 =============== +// ================================== diff --git a/x/wasm/module.go b/x/wasm/module.go index 7dac5f1e7..c23932b4b 100644 --- a/x/wasm/module.go +++ b/x/wasm/module.go @@ -186,8 +186,7 @@ func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { keeper.GetWasmParamsCache().SetNeedBlockedUpdate() } am.keeper.UpdateGasRegister(ctx) - // TODO - // am.keeper.UpdateCurBlockNum(ctx) + am.keeper.UpdateCurBlockNum(ctx) } // EndBlock returns the end blocker for the wasm module. It returns no validator