Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add venus7 for wasm upgrade #3243

Merged
merged 4 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -782,8 +782,7 @@ func NewOKExChainApp(
}
app.InitUpgrade(ctx)
app.WasmKeeper.UpdateGasRegister(ctx)
// TODO
// app.WasmKeeper.UpdateCurBlockNum(ctx)
app.WasmKeeper.UpdateCurBlockNum(ctx)
}

app.ScopedIBCKeeper = scopedIBCKeeper
Expand All @@ -805,8 +804,10 @@ func (app *OKExChainApp) InitUpgrade(ctx sdk.Context) {
tmtypes.InitMilestoneVenus6Height(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))
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,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.3-0.20230822083506-a7f577e8b87d
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/okex/grocksdb v1.6.45-okc2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,8 @@ github.com/okex/go-ethereum v1.10.8-okc2/go.mod h1:pJNuIUYfX5+JKzSD/BTdNsvJSZ1TJ
github.com/okex/grocksdb v1.6.45-okc2 h1:JuUg2NcAFHZn78+xANcEKn9bcuF0tX8Jx3iMFfPnAEQ=
github.com/okex/grocksdb v1.6.45-okc2/go.mod h1:+/BHUY+mT0tbaVXwO2wTtD9eytazyw1W5n2O7AGyXZA=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
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.3-0.20230822083506-a7f577e8b87d h1:7Bc5R2e6/45gOBhko9fbOKXOp8h8cVmvwORpwO9Bw/o=
github.com/okx/wasmvm v1.3.3-0.20230822083506-a7f577e8b87d/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=
Expand Down
23 changes: 23 additions & 0 deletions libs/tendermint/types/milestone.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ var (
MILESTONE_VENUS6_NAME = "venus6"
milestoneVenus6Height int64 = 0

MILESTONE_VENUS7_NAME = "venus7"
milestoneVenus7Height int64 = 0

// note: it stores the earlies height of the node,and it is used by cli
nodePruneHeight int64

Expand Down Expand Up @@ -331,3 +334,23 @@ func GetVenus6Height() int64 {

// =========== Venus6 ===============
// ==================================

// ==================================
// =========== 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 ===============
// ==================================
3 changes: 1 addition & 2 deletions x/wasm/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down