Skip to content

Commit ac1828c

Browse files
authored
Merge branch 'initia-labs:main' into main
2 parents 1810120 + cf52e77 commit ac1828c

22 files changed

+210
-128
lines changed

.github/config/.codespellignore

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
cips
2+
pullrequest
3+
keypair
4+
pastTime
5+
hasTables
6+
Nam
7+
EyT
8+
upTo
9+
initia
10+
minitia
11+
expRes
12+
crate
13+
totalIn
14+
totalOut

.github/workflows/build-darwin-amd64.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Go
1616
uses: actions/setup-go@v4
1717
with:
18-
go-version: "1.22.5"
18+
go-version: "1.22"
1919

2020
- name: Set environment variables
2121
run: |

.github/workflows/build-darwin-arm64.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Set up Go
1515
uses: actions/setup-go@v4
1616
with:
17-
go-version: "1.22.5"
17+
go-version: "1.22"
1818
- name: Set environment variables
1919
run: |
2020
MINIWASM_NETWORK_NAME="miniwasm-1"

.github/workflows/build-linux-amd64.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Set up Go
1313
uses: actions/setup-go@v4
1414
with:
15-
go-version: "1.22.5"
15+
go-version: "1.22"
1616

1717
- name: Set environment variables
1818
run: |

.github/workflows/lint.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ concurrency:
2323
jobs:
2424
golangci:
2525
env:
26-
GOLANGCI_LINT_VERSION: v1.59.1
26+
GOLANGCI_LINT_VERSION: v1.61.0
2727
name: golangci-lint
2828
runs-on: ubuntu-latest
2929
steps:
3030
- uses: actions/checkout@v4
3131
- uses: actions/setup-go@v5
3232
with:
33-
go-version: 1.22
33+
go-version: 1.23
3434
check-latest: true
3535
- uses: technote-space/[email protected]
3636
id: git_diff
@@ -72,7 +72,7 @@ jobs:
7272
- name: Setup go
7373
uses: actions/setup-go@v5
7474
with:
75-
go-version: 1.22
75+
go-version: 1.23
7676
check-latest: true
7777
- run: |
7878
go mod tidy

.github/workflows/spellcheck.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Spell Check
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
spellcheck:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Run codespell
13+
continue-on-error: true
14+
run: |
15+
sudo apt-get install codespell -y
16+
codespell -w --skip="*.pulsar.go,*.pb.go,*.pb.gw.go,*.cosmos_orm.go,*.json,*.git,*.js,crypto/keys,fuzz,*.h,proto/tendermint,*.bin,go.sum,go.work.sum,go.mod,statik.go,*.map,swagger.yaml" --ignore-words=.github/config/.codespellignore
17+
- uses: peter-evans/[email protected]
18+
if: github.event_name != 'pull_request'
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
commit-message: "chore: fix typos"
22+
title: "chore: fix typos"
23+
branch: "chore/fix-typos"
24+
delete-branch: true
25+
body: |
26+
This PR fixes typos in the codebase.
27+
Please review it, and merge if everything is fine.
28+
If there are proto changes, run `make proto-gen` and commit the changes.

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM golang:1.22-alpine3.19 AS go-builder
22
#ARG arch=x86_64
33

44
# See https://github.com/CosmWasm/wasmvm/releases
5-
ENV LIBWASMVM_VERSION=v2.1.2
5+
ENV LIBWASMVM_VERSION=v2.1.3
66

77
# this comes from standard alpine nightly file
88
# https://github.com/rust-lang/docker-rust-nightly/blob/master/alpine3.12/Dockerfile

Dockerfile.arm64

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM arm64v8/golang:1.22-bullseye AS go-builder
33
# Install minimum necessary dependencies, build Cosmos SDK, remove packages
44
RUN apt update
55
RUN apt install -y curl git build-essential
6-
# debug: for live editting in the image
6+
# debug: for live editing in the image
77
RUN apt install -y vim
88

99
WORKDIR /code

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ MiniWasm is an optimistic rollup consumer chain powered by WasmVM, designed to s
44

55
## Prerequisites
66

7-
- Go v1.22.5+
7+
- Go v1.22.7+
88

99
## Getting Started
1010

app/ante/ante.go

+16-10
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ 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"
17+
"github.com/initia-labs/initia/app/ante/sigverify"
1718

1819
"github.com/skip-mev/block-sdk/v2/block"
1920
auctionante "github.com/skip-mev/block-sdk/v2/x/auction/ante"
@@ -29,8 +30,8 @@ type HandlerOptions struct {
2930
ante.HandlerOptions
3031
Codec codec.BinaryCodec
3132
IBCkeeper *ibckeeper.Keeper
32-
OPChildKeeper opchildtypes.AnteKeeper
33-
AuctionKeeper auctionkeeper.Keeper
33+
OPChildKeeper *opchildkeeper.Keeper
34+
AuctionKeeper *auctionkeeper.Keeper
3435
TxEncoder sdk.TxEncoder
3536
MevLane auctionante.MEVLane
3637
FreeLane block.Lane
@@ -48,30 +49,34 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
4849
if options.AccountKeeper == nil {
4950
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "account keeper is required for ante builder")
5051
}
51-
5252
if options.BankKeeper == nil {
5353
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for ante builder")
5454
}
55-
5655
if options.SignModeHandler == nil {
5756
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
5857
}
59-
6058
if options.WasmConfig == nil {
6159
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder")
6260
}
63-
6461
if options.WasmKeeper == nil {
6562
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm keeper is required for ante builder")
6663
}
67-
6864
if options.TXCounterStoreService == nil {
6965
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm store service is required for ante builder")
7066
}
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+
}
7176

7277
sigGasConsumer := options.SigGasConsumer
7378
if sigGasConsumer == nil {
74-
sigGasConsumer = ante.DefaultSigVerificationGasConsumer
79+
sigGasConsumer = sigverify.DefaultSigVerificationGasConsumer
7580
}
7681

7782
txFeeChecker := options.TxFeeChecker
@@ -111,10 +116,11 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
111116
ante.NewSetPubKeyDecorator(options.AccountKeeper),
112117
ante.NewValidateSigCountDecorator(options.AccountKeeper),
113118
ante.NewSigGasConsumeDecorator(options.AccountKeeper, sigGasConsumer),
114-
ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
119+
sigverify.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
115120
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
116121
ibcante.NewRedundantRelayDecorator(options.IBCkeeper),
117122
auctionante.NewAuctionDecorator(options.AuctionKeeper, options.TxEncoder, options.MevLane),
123+
opchildante.NewRedundantBridgeDecorator(options.OPChildKeeper),
118124
}
119125

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

app/blocksdk.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func setupBlockSDK(
4747
Logger: app.Logger(),
4848
TxEncoder: app.txConfig.TxEncoder(),
4949
TxDecoder: app.txConfig.TxDecoder(),
50-
MaxBlockSpace: math.LegacyMustNewDecFromStr("0.01"),
50+
MaxBlockSpace: math.LegacyMustNewDecFromStr("0.1"),
5151
MaxTxs: 1,
5252
SignerExtractor: signerExtractor,
5353
}, opchildlanes.SystemLaneMatchHandler())
@@ -57,7 +57,7 @@ func setupBlockSDK(
5757
Logger: app.Logger(),
5858
TxEncoder: app.txConfig.TxEncoder(),
5959
TxDecoder: app.txConfig.TxDecoder(),
60-
MaxBlockSpace: math.LegacyMustNewDecFromStr("0.09"),
60+
MaxBlockSpace: math.LegacyMustNewDecFromStr("0.1"),
6161
MaxTxs: 100,
6262
SignerExtractor: signerExtractor,
6363
}, factory, factory.MatchHandler())
@@ -75,7 +75,7 @@ func setupBlockSDK(
7575
Logger: app.Logger(),
7676
TxEncoder: app.txConfig.TxEncoder(),
7777
TxDecoder: app.txConfig.TxDecoder(),
78-
MaxBlockSpace: math.LegacyMustNewDecFromStr("0.8"),
78+
MaxBlockSpace: math.LegacyMustNewDecFromStr("0.7"),
7979
MaxTxs: mempoolMaxTxs,
8080
SignerExtractor: signerExtractor,
8181
})
@@ -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/keepers/keepers.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func NewAppKeeper(
244244
appKeepers.OracleKeeper = &oracleKeeper
245245

246246
// Add the oracle keeper as a hook to market map keeper so new market map entries can be created
247-
// and propogated to the oracle keeper.
247+
// and propagated to the oracle keeper.
248248
appKeepers.MarketMapKeeper.SetHooks(appKeepers.OracleKeeper.Hooks())
249249

250250
appKeepers.OPChildKeeper = opchildkeeper.NewKeeper(
@@ -293,6 +293,7 @@ func NewAppKeeper(
293293
appKeepers.FeeGrantKeeper = &feeGrantKeeper
294294

295295
authzKeeper := authzkeeper.NewKeeper(runtime.NewKVStoreService(appKeepers.keys[authzkeeper.StoreKey]), appCodec, bApp.MsgServiceRouter(), appKeepers.AccountKeeper)
296+
authzKeeper = authzKeeper.SetBankKeeper(appKeepers.BankKeeper)
296297
appKeepers.AuthzKeeper = &authzKeeper
297298

298299
groupConfig := group.DefaultConfig()

app/upgrade.go

+22-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,33 @@ import (
55

66
upgradetypes "cosmossdk.io/x/upgrade/types"
77
"github.com/cosmos/cosmos-sdk/types/module"
8+
9+
opchildtypes "github.com/initia-labs/OPinit/x/opchild/types"
810
)
911

10-
const upgradeName = "0.2.4"
12+
const upgradeName = "0.6.4"
1113

1214
// RegisterUpgradeHandlers returns upgrade handlers
1315
func (app *MinitiaApp) RegisterUpgradeHandlers(cfg module.Configurator) {
14-
app.UpgradeKeeper.SetUpgradeHandler(upgradeName,
15-
func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
16-
return fromVM, nil
16+
app.UpgradeKeeper.SetUpgradeHandler(
17+
upgradeName,
18+
func(ctx context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
19+
params, err := app.OPChildKeeper.GetParams(ctx)
20+
if err != nil {
21+
return nil, err
22+
}
23+
24+
// set non-zero default values for new params
25+
if params.HookMaxGas == 0 {
26+
params.HookMaxGas = opchildtypes.DefaultHookMaxGas
27+
28+
err = app.OPChildKeeper.SetParams(ctx, params)
29+
if err != nil {
30+
return nil, err
31+
}
32+
}
33+
34+
return vm, nil
1735
},
1836
)
1937
}

client/docs/statik/statik.go

+1-1
Large diffs are not rendered by default.

client/docs/swagger-ui/swagger.yaml

+8-16
Original file line numberDiff line numberDiff line change
@@ -37125,10 +37125,8 @@ paths:
3712537125
description: bridge_config is the configuration of the bridge.
3712637126
type: object
3712737127
properties:
37128-
challengers:
37129-
type: array
37130-
items:
37131-
type: string
37128+
challenger:
37129+
type: string
3713237130
description: The address of the challenger.
3713337131
proposer:
3713437132
type: string
@@ -70722,10 +70720,8 @@ definitions:
7072270720
description: bridge_config is the configuration of the bridge.
7072370721
type: object
7072470722
properties:
70725-
challengers:
70726-
type: array
70727-
items:
70728-
type: string
70723+
challenger:
70724+
type: string
7072970725
description: The address of the challenger.
7073070726
proposer:
7073170727
type: string
@@ -70853,10 +70849,8 @@ definitions:
7085370849
description: bridge_config is the configuration of the bridge.
7085470850
type: object
7085570851
properties:
70856-
challengers:
70857-
type: array
70858-
items:
70859-
type: string
70852+
challenger:
70853+
type: string
7086070854
description: The address of the challenger.
7086170855
proposer:
7086270856
type: string
@@ -71629,10 +71623,8 @@ definitions:
7162971623
opinit.ophost.v1.BridgeConfig:
7163071624
type: object
7163171625
properties:
71632-
challengers:
71633-
type: array
71634-
items:
71635-
type: string
71626+
challenger:
71627+
type: string
7163671628
description: The address of the challenger.
7163771629
proposer:
7163871630
type: string

cmd/minitiad/launch.go

+9-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@ package main
22

33
import (
44
"encoding/json"
5-
"os"
65

76
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
87
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
8+
99
sdk "github.com/cosmos/cosmos-sdk/types"
1010
"github.com/cosmos/cosmos-sdk/types/module"
11+
1112
"github.com/initia-labs/OPinit/contrib/launchtools"
1213
"github.com/initia-labs/OPinit/contrib/launchtools/steps"
14+
1315
"github.com/initia-labs/initia/app/params"
1416
minitiaapp "github.com/initia-labs/miniwasm/app"
17+
18+
"github.com/initia-labs/miniwasm/contrib"
19+
1520
"github.com/pkg/errors"
1621
"github.com/spf13/cobra"
1722
)
@@ -69,13 +74,14 @@ func LaunchCommand(ac *appCreator, enc params.EncodingConfig, mbm module.BasicMa
6974
func StoreAndInstantiateNFTContracts(input *launchtools.Config) launchtools.LauncherStepFunc {
7075
return func(ctx launchtools.Launcher) error {
7176
ctx.Logger().Info("Storing and instantiating cw721 and ics721 contracts")
77+
fs := contrib.FS()
7278

73-
cw721, err := os.ReadFile("contrib/wasm/cw721_base.wasm")
79+
cw721, err := fs.ReadFile("wasm/cw721_base.wasm")
7480
if err != nil {
7581
return errors.Wrapf(err, "failed to read cw721_base.wasm")
7682
}
7783

78-
ics721, err := os.ReadFile("contrib/wasm/ics721_base.wasm")
84+
ics721, err := fs.ReadFile("wasm/ics721_base.wasm")
7985
if err != nil {
8086
return errors.Wrapf(err, "failed to read ics721_base.wasm")
8187
}

0 commit comments

Comments
 (0)