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

upgrade: prepare upgrade #80

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
21 changes: 13 additions & 8 deletions app/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"

opchildante "github.com/initia-labs/OPinit/x/opchild/ante"
opchildtypes "github.com/initia-labs/OPinit/x/opchild/types"
opchildkeeper "github.com/initia-labs/OPinit/x/opchild/keeper"
"github.com/initia-labs/initia/app/ante/accnum"
"github.com/initia-labs/initia/app/ante/sigverify"

Expand All @@ -30,8 +30,8 @@
ante.HandlerOptions
Codec codec.BinaryCodec
IBCkeeper *ibckeeper.Keeper
OPChildKeeper opchildtypes.AnteKeeper
AuctionKeeper auctionkeeper.Keeper
OPChildKeeper *opchildkeeper.Keeper
AuctionKeeper *auctionkeeper.Keeper
TxEncoder sdk.TxEncoder
MevLane auctionante.MEVLane
FreeLane block.Lane
Expand All @@ -49,26 +49,30 @@
if options.AccountKeeper == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "account keeper is required for ante builder")
}

if options.BankKeeper == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for ante builder")
}

if options.SignModeHandler == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
}

if options.WasmConfig == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder")
}

if options.WasmKeeper == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm keeper is required for ante builder")
}

if options.TXCounterStoreService == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm store service is required for ante builder")
}
if options.OPChildKeeper == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "opchild keeper is required for ante builder")
}

Check warning on line 69 in app/ante/ante.go

View check run for this annotation

Codecov / codecov/patch

app/ante/ante.go#L68-L69

Added lines #L68 - L69 were not covered by tests
if options.AuctionKeeper == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "auction keeper is required for ante builder")
}

Check warning on line 72 in app/ante/ante.go

View check run for this annotation

Codecov / codecov/patch

app/ante/ante.go#L71-L72

Added lines #L71 - L72 were not covered by tests
if options.IBCkeeper == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "IBC keeper is required for ante builder")
}

Check warning on line 75 in app/ante/ante.go

View check run for this annotation

Codecov / codecov/patch

app/ante/ante.go#L74-L75

Added lines #L74 - L75 were not covered by tests

sigGasConsumer := options.SigGasConsumer
if sigGasConsumer == nil {
Expand Down Expand Up @@ -116,6 +120,7 @@
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewRedundantRelayDecorator(options.IBCkeeper),
auctionante.NewAuctionDecorator(options.AuctionKeeper, options.TxEncoder, options.MevLane),
opchildante.NewRedundantBridgeDecorator(options.OPChildKeeper),
}

return sdk.ChainAnteDecorators(anteDecorators...), nil
Expand Down
2 changes: 1 addition & 1 deletion app/blocksdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func setupBlockSDK(
Codec: app.appCodec,
OPChildKeeper: app.OPChildKeeper,
TxEncoder: app.txConfig.TxEncoder(),
AuctionKeeper: *app.AuctionKeeper,
AuctionKeeper: app.AuctionKeeper,
MevLane: mevLane,
FreeLane: freeLane,
WasmKeeper: app.WasmKeeper,
Expand Down
12 changes: 7 additions & 5 deletions app/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
opchildtypes "github.com/initia-labs/OPinit/x/opchild/types"
)

const upgradeName = "0.6.2"
const upgradeName = "0.6.3"

// RegisterUpgradeHandlers returns upgrade handlers
func (app *MinitiaApp) RegisterUpgradeHandlers(cfg module.Configurator) {
Expand All @@ -22,11 +22,13 @@
}

// set non-zero default values for new params
params.HookMaxGas = opchildtypes.DefaultHookMaxGas
if params.HookMaxGas == 0 {
params.HookMaxGas = opchildtypes.DefaultHookMaxGas

Check warning on line 26 in app/upgrade.go

View check run for this annotation

Codecov / codecov/patch

app/upgrade.go#L25-L26

Added lines #L25 - L26 were not covered by tests

err = app.OPChildKeeper.SetParams(ctx, params)
if err != nil {
return nil, err
err = app.OPChildKeeper.SetParams(ctx, params)
if err != nil {
return nil, err
}

Check warning on line 31 in app/upgrade.go

View check run for this annotation

Codecov / codecov/patch

app/upgrade.go#L28-L31

Added lines #L28 - L31 were not covered by tests
}

return vm, nil
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ require (
github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/hashicorp/go-metrics v0.5.3
github.com/initia-labs/OPinit v0.5.7
github.com/initia-labs/OPinit v0.6.0
github.com/initia-labs/initia v0.6.1
github.com/initia-labs/kvindexer v0.1.9
github.com/initia-labs/kvindexer/submodules/block v0.1.0
Expand Down Expand Up @@ -173,7 +173,7 @@ require (
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/improbable-eng/grpc-web v0.15.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/initia-labs/OPinit/api v0.5.7 // indirect
github.com/initia-labs/OPinit/api v0.6.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/jsternberg/zap-logfmt v1.3.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1425,10 +1425,10 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/initia-labs/OPinit v0.5.7 h1:25G0o2VXcO4EXzh9afdTdsXl1PTdYG9VMUx4efmWCuM=
github.com/initia-labs/OPinit v0.5.7/go.mod h1:lx1amLMszculwPu8ln+btJno38UV28fd2nP7XC88ZeE=
github.com/initia-labs/OPinit/api v0.5.7 h1:jghTmrrDEmowrqSpy7iL7IW9xJh40rn/S1y/LrwPkyE=
github.com/initia-labs/OPinit/api v0.5.7/go.mod h1:gHK6DEWb3/DqQD5LjKirUx9jilAh2UioXanoQdgqVfU=
github.com/initia-labs/OPinit v0.6.0 h1:V9jQf8+PjNctLX31FHMGUsk6fpnygVJO1WYzCmBMzkU=
github.com/initia-labs/OPinit v0.6.0/go.mod h1:gDpCh4Zx94mihwgzP/PLav8eVHLroZBu3dFyzCy8iIs=
github.com/initia-labs/OPinit/api v0.6.0 h1:Q3hDHpTd9EqlDfY/OryCKIwuXYWJxGJdGfJicV1RjL4=
github.com/initia-labs/OPinit/api v0.6.0/go.mod h1:gHK6DEWb3/DqQD5LjKirUx9jilAh2UioXanoQdgqVfU=
github.com/initia-labs/cometbft v0.0.0-20241104064728-ef8cadf1bed8 h1:6msSRQr/WzQ7cIm1+foXoksqo2BH2fjBZM8j9q49Wpo=
github.com/initia-labs/cometbft v0.0.0-20241104064728-ef8cadf1bed8/go.mod h1:q/3WRJxVVB19paSM7eB4g+8PxZKWpPBBTaHfxyICuLU=
github.com/initia-labs/cometbft-client v0.0.0-20240924071428-ef115cefa07e h1:k+pg63SFozCAK4LZFSiZtof6z69Tlu0O/Zftj1aAwes=
Expand Down
Loading