Skip to content

Commit

Permalink
SDK upgrade to v0.50 (branch) (#1611)
Browse files Browse the repository at this point in the history
* Start implementation

* Add implementation + some e2e test

* Fix lint

* Squashed: sdk upgrade to v0.50

* rebuild protos with newer proto builder

(cherry picked from commit fd8f4c1)

* update ibc-go

(cherry picked from commit fb86679)

* bump cosmos-sdk and ibc in the v50 branch (#1616)

* tidy

* upgade ibc

* remove the toolchain command

* Bump sdk version

* Use correct bech32 prefix

* Bump SDK

* Enable fraud system test again

* Fix genesis param name

* Fix import/export simulations

* set log level for benchmarks

(cherry picked from commit 1cfb930)

* Apply review comments

* Remove gov beta1 helpers

* Bump sdk version to latest in branch

* Fix linter

* Setup mergify for main

* Update mergify for better branch name

---------

Co-authored-by: Pino' Surace <pino.surace@live.it>
Co-authored-by: Jacob Gadikian <jacobgadikian@gmail.com>
  • Loading branch information
3 people authored Sep 25, 2023
1 parent 03f3c72 commit cd66f78
Show file tree
Hide file tree
Showing 136 changed files with 4,010 additions and 3,753 deletions.
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 @@ import (
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")
}
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")
}
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")
}
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")
}
if options.TXCounterStoreService == nil {
return nil, errors.New("wasm store service is required for ante builder")
}
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")
}

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

0 comments on commit cd66f78

Please sign in to comment.