Skip to content

Commit 74021de

Browse files
authored
upgrade: prepare upgrade (#80)
* add missing opchild ante and prepare upgrade * add checking
1 parent 0a50ef0 commit 74021de

File tree

5 files changed

+27
-20
lines changed

5 files changed

+27
-20
lines changed

app/ante/ante.go

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
1313

1414
opchildante "github.com/initia-labs/OPinit/x/opchild/ante"
15-
opchildtypes "github.com/initia-labs/OPinit/x/opchild/types"
15+
opchildkeeper "github.com/initia-labs/OPinit/x/opchild/keeper"
1616
"github.com/initia-labs/initia/app/ante/accnum"
1717
"github.com/initia-labs/initia/app/ante/sigverify"
1818

@@ -30,8 +30,8 @@ type HandlerOptions struct {
3030
ante.HandlerOptions
3131
Codec codec.BinaryCodec
3232
IBCkeeper *ibckeeper.Keeper
33-
OPChildKeeper opchildtypes.AnteKeeper
34-
AuctionKeeper auctionkeeper.Keeper
33+
OPChildKeeper *opchildkeeper.Keeper
34+
AuctionKeeper *auctionkeeper.Keeper
3535
TxEncoder sdk.TxEncoder
3636
MevLane auctionante.MEVLane
3737
FreeLane block.Lane
@@ -49,26 +49,30 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
4949
if options.AccountKeeper == nil {
5050
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "account keeper is required for ante builder")
5151
}
52-
5352
if options.BankKeeper == nil {
5453
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for ante builder")
5554
}
56-
5755
if options.SignModeHandler == nil {
5856
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
5957
}
60-
6158
if options.WasmConfig == nil {
6259
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder")
6360
}
64-
6561
if options.WasmKeeper == nil {
6662
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm keeper is required for ante builder")
6763
}
68-
6964
if options.TXCounterStoreService == nil {
7065
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm store service is required for ante builder")
7166
}
67+
if options.OPChildKeeper == nil {
68+
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "opchild keeper is required for ante builder")
69+
}
70+
if options.AuctionKeeper == nil {
71+
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "auction keeper is required for ante builder")
72+
}
73+
if options.IBCkeeper == nil {
74+
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "IBC keeper is required for ante builder")
75+
}
7276

7377
sigGasConsumer := options.SigGasConsumer
7478
if sigGasConsumer == nil {
@@ -116,6 +120,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
116120
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
117121
ibcante.NewRedundantRelayDecorator(options.IBCkeeper),
118122
auctionante.NewAuctionDecorator(options.AuctionKeeper, options.TxEncoder, options.MevLane),
123+
opchildante.NewRedundantBridgeDecorator(options.OPChildKeeper),
119124
}
120125

121126
return sdk.ChainAnteDecorators(anteDecorators...), nil

app/blocksdk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func setupBlockSDK(
9898
Codec: app.appCodec,
9999
OPChildKeeper: app.OPChildKeeper,
100100
TxEncoder: app.txConfig.TxEncoder(),
101-
AuctionKeeper: *app.AuctionKeeper,
101+
AuctionKeeper: app.AuctionKeeper,
102102
MevLane: mevLane,
103103
FreeLane: freeLane,
104104
WasmKeeper: app.WasmKeeper,

app/upgrade.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
opchildtypes "github.com/initia-labs/OPinit/x/opchild/types"
1010
)
1111

12-
const upgradeName = "0.6.2"
12+
const upgradeName = "0.6.3"
1313

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

2424
// set non-zero default values for new params
25-
params.HookMaxGas = opchildtypes.DefaultHookMaxGas
25+
if params.HookMaxGas == 0 {
26+
params.HookMaxGas = opchildtypes.DefaultHookMaxGas
2627

27-
err = app.OPChildKeeper.SetParams(ctx, params)
28-
if err != nil {
29-
return nil, err
28+
err = app.OPChildKeeper.SetParams(ctx, params)
29+
if err != nil {
30+
return nil, err
31+
}
3032
}
3133

3234
return vm, nil

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ require (
3535
github.com/gorilla/mux v1.8.1
3636
github.com/grpc-ecosystem/grpc-gateway v1.16.0
3737
github.com/hashicorp/go-metrics v0.5.3
38-
github.com/initia-labs/OPinit v0.5.7
38+
github.com/initia-labs/OPinit v0.6.0
3939
github.com/initia-labs/initia v0.6.1
4040
github.com/initia-labs/kvindexer v0.1.9
4141
github.com/initia-labs/kvindexer/submodules/block v0.1.0
@@ -173,7 +173,7 @@ require (
173173
github.com/iancoleman/strcase v0.3.0 // indirect
174174
github.com/improbable-eng/grpc-web v0.15.0 // indirect
175175
github.com/inconshreveable/mousetrap v1.1.0 // indirect
176-
github.com/initia-labs/OPinit/api v0.5.7 // indirect
176+
github.com/initia-labs/OPinit/api v0.6.0 // indirect
177177
github.com/jmespath/go-jmespath v0.4.0 // indirect
178178
github.com/jmhodges/levigo v1.0.0 // indirect
179179
github.com/jsternberg/zap-logfmt v1.3.0 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,10 +1425,10 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt
14251425
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
14261426
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
14271427
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
1428-
github.com/initia-labs/OPinit v0.5.7 h1:25G0o2VXcO4EXzh9afdTdsXl1PTdYG9VMUx4efmWCuM=
1429-
github.com/initia-labs/OPinit v0.5.7/go.mod h1:lx1amLMszculwPu8ln+btJno38UV28fd2nP7XC88ZeE=
1430-
github.com/initia-labs/OPinit/api v0.5.7 h1:jghTmrrDEmowrqSpy7iL7IW9xJh40rn/S1y/LrwPkyE=
1431-
github.com/initia-labs/OPinit/api v0.5.7/go.mod h1:gHK6DEWb3/DqQD5LjKirUx9jilAh2UioXanoQdgqVfU=
1428+
github.com/initia-labs/OPinit v0.6.0 h1:V9jQf8+PjNctLX31FHMGUsk6fpnygVJO1WYzCmBMzkU=
1429+
github.com/initia-labs/OPinit v0.6.0/go.mod h1:gDpCh4Zx94mihwgzP/PLav8eVHLroZBu3dFyzCy8iIs=
1430+
github.com/initia-labs/OPinit/api v0.6.0 h1:Q3hDHpTd9EqlDfY/OryCKIwuXYWJxGJdGfJicV1RjL4=
1431+
github.com/initia-labs/OPinit/api v0.6.0/go.mod h1:gHK6DEWb3/DqQD5LjKirUx9jilAh2UioXanoQdgqVfU=
14321432
github.com/initia-labs/cometbft v0.0.0-20241104064728-ef8cadf1bed8 h1:6msSRQr/WzQ7cIm1+foXoksqo2BH2fjBZM8j9q49Wpo=
14331433
github.com/initia-labs/cometbft v0.0.0-20241104064728-ef8cadf1bed8/go.mod h1:q/3WRJxVVB19paSM7eB4g+8PxZKWpPBBTaHfxyICuLU=
14341434
github.com/initia-labs/cometbft-client v0.0.0-20240924071428-ef115cefa07e h1:k+pg63SFozCAK4LZFSiZtof6z69Tlu0O/Zftj1aAwes=

0 commit comments

Comments
 (0)