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

SDK upgrade to v0.50 (branch) #1611

Merged
merged 22 commits into from
Sep 25, 2023
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
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ orbs:
executors:
golang:
docker:
- image: cimg/go:1.20
- image: cimg/go:1.21

commands:
make:
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
test-system:
executor: golang
parallelism: 1
resource_class: large
resource_class: xlarge
steps:
- attach_workspace:
at: /tmp/workspace
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
simulations:
executor: golang
parallelism: 1
resource_class: large
resource_class: xlarge
steps:
- checkout
- run:
Expand Down
8 changes: 4 additions & 4 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ queue_rules:
pull_request_rules:
- name: backport patches to main branch
conditions:
- base=releases/v0.40.x
- base=releases/v0.4x
- label=backport/main
actions:
backport:
Expand All @@ -20,11 +20,11 @@ pull_request_rules:
backport:
branches:
- releases/v0.3x
- name: backport patches to v0.40.x release branch
- name: backport patches to sdk47 release branch
conditions:
- base=main
- label=backport/v0.40.x
- label=backport/v0.4x
actions:
backport:
branches:
- releases/v0.40.x
- releases/v0.4x
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# docker build . -t cosmwasm/wasmd:latest
# docker run --rm -it cosmwasm/wasmd:latest /bin/sh
FROM golang:1.19-alpine3.15 AS go-builder
FROM golang:1.21-alpine3.17 AS go-builder
ARG arch=x86_64

# this comes from standard alpine nightly file
Expand Down Expand Up @@ -29,7 +29,7 @@ RUN echo "Ensuring binary is statically linked ..." \
&& (file /code/build/wasmd | grep "statically linked")

# --------------------------------------------------------
FROM alpine:3.15
FROM alpine:3.17

COPY --from=go-builder /code/build/wasmd /usr/bin/wasmd

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ format: format-tools
###############################################################################
### Protobuf ###
###############################################################################
protoVer=0.13.1
protoVer=0.14.0
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)

Expand Down
39 changes: 23 additions & 16 deletions app/ante.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package app

import (
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
"github.com/cosmos/ibc-go/v7/modules/core/keeper"
"errors"

errorsmod "cosmossdk.io/errors"
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
"github.com/cosmos/ibc-go/v8/modules/core/keeper"

corestoretypes "cosmossdk.io/core/store"
circuitante "cosmossdk.io/x/circuit/ante"
circuitkeeper "cosmossdk.io/x/circuit/keeper"

storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
Expand All @@ -20,34 +22,39 @@
type HandlerOptions struct {
ante.HandlerOptions

IBCKeeper *keeper.Keeper
WasmKeeper *wasmkeeper.Keeper
WasmConfig *wasmTypes.WasmConfig
TXCounterStoreKey storetypes.StoreKey
IBCKeeper *keeper.Keeper
WasmConfig *wasmTypes.WasmConfig
WasmKeeper *wasmkeeper.Keeper
TXCounterStoreService corestoretypes.KVStoreService
CircuitKeeper *circuitkeeper.Keeper
}

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.AccountKeeper == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
return nil, errors.New("account keeper is required for ante builder")

Check warning on line 34 in app/ante.go

View check run for this annotation

Codecov / codecov/patch

app/ante.go#L34

Added line #L34 was not covered by tests
}
if options.BankKeeper == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler")
return nil, errors.New("bank keeper is required for ante builder")

Check warning on line 37 in app/ante.go

View check run for this annotation

Codecov / codecov/patch

app/ante.go#L37

Added line #L37 was not covered by tests
}
if options.SignModeHandler == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
return nil, errors.New("sign mode handler is required for ante builder")

Check warning on line 40 in app/ante.go

View check run for this annotation

Codecov / codecov/patch

app/ante.go#L40

Added line #L40 was not covered by tests
}
if options.WasmConfig == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder")
return nil, errors.New("wasm config is required for ante builder")

Check warning on line 43 in app/ante.go

View check run for this annotation

Codecov / codecov/patch

app/ante.go#L43

Added line #L43 was not covered by tests
}
if options.TXCounterStoreService == nil {
return nil, errors.New("wasm store service is required for ante builder")

Check warning on line 46 in app/ante.go

View check run for this annotation

Codecov / codecov/patch

app/ante.go#L46

Added line #L46 was not covered by tests
}
if options.TXCounterStoreKey == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "tx counter key is required for ante builder")
if options.CircuitKeeper == nil {
return nil, errors.New("circuit keeper is required for ante builder")

Check warning on line 49 in app/ante.go

View check run for this annotation

Codecov / codecov/patch

app/ante.go#L49

Added line #L49 was not covered by tests
}

anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), // after setup context to enforce limits early
wasmkeeper.NewCountTXDecorator(options.TXCounterStoreKey),
wasmkeeper.NewCountTXDecorator(options.TXCounterStoreService),
wasmkeeper.NewGasRegisterDecorator(options.WasmKeeper.GetGasRegister()),
circuitante.NewCircuitBreakerDecorator(options.CircuitKeeper),
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
ante.NewValidateBasicDecorator(),
ante.NewTxTimeoutHeightDecorator(),
Expand Down
Loading