Skip to content

Commit cd66f78

Browse files
alpepinosufaddat
authored
SDK upgrade to v0.50 (branch) (#1611)
* 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 <[email protected]> Co-authored-by: Jacob Gadikian <[email protected]>
1 parent 03f3c72 commit cd66f78

File tree

136 files changed

+4010
-3753
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+4010
-3753
lines changed

.circleci/config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ orbs:
55
executors:
66
golang:
77
docker:
8-
- image: cimg/go:1.20
8+
- image: cimg/go:1.21
99

1010
commands:
1111
make:
@@ -101,7 +101,7 @@ jobs:
101101
test-system:
102102
executor: golang
103103
parallelism: 1
104-
resource_class: large
104+
resource_class: xlarge
105105
steps:
106106
- attach_workspace:
107107
at: /tmp/workspace
@@ -135,7 +135,7 @@ jobs:
135135
simulations:
136136
executor: golang
137137
parallelism: 1
138-
resource_class: large
138+
resource_class: xlarge
139139
steps:
140140
- checkout
141141
- run:

.mergify.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ queue_rules:
66
pull_request_rules:
77
- name: backport patches to main branch
88
conditions:
9-
- base=releases/v0.40.x
9+
- base=releases/v0.4x
1010
- label=backport/main
1111
actions:
1212
backport:
@@ -20,11 +20,11 @@ pull_request_rules:
2020
backport:
2121
branches:
2222
- releases/v0.3x
23-
- name: backport patches to v0.40.x release branch
23+
- name: backport patches to sdk47 release branch
2424
conditions:
2525
- base=main
26-
- label=backport/v0.40.x
26+
- label=backport/v0.4x
2727
actions:
2828
backport:
2929
branches:
30-
- releases/v0.40.x
30+
- releases/v0.4x

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# docker build . -t cosmwasm/wasmd:latest
22
# docker run --rm -it cosmwasm/wasmd:latest /bin/sh
3-
FROM golang:1.19-alpine3.15 AS go-builder
3+
FROM golang:1.21-alpine3.17 AS go-builder
44
ARG arch=x86_64
55

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

3131
# --------------------------------------------------------
32-
FROM alpine:3.15
32+
FROM alpine:3.17
3333

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

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ format: format-tools
176176
###############################################################################
177177
### Protobuf ###
178178
###############################################################################
179-
protoVer=0.13.1
179+
protoVer=0.14.0
180180
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
181181
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
182182

app/ante.go

+23-16
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
package app
22

33
import (
4-
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
5-
"github.com/cosmos/ibc-go/v7/modules/core/keeper"
4+
"errors"
65

7-
errorsmod "cosmossdk.io/errors"
6+
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
7+
"github.com/cosmos/ibc-go/v8/modules/core/keeper"
8+
9+
corestoretypes "cosmossdk.io/core/store"
10+
circuitante "cosmossdk.io/x/circuit/ante"
11+
circuitkeeper "cosmossdk.io/x/circuit/keeper"
812

9-
storetypes "github.com/cosmos/cosmos-sdk/store/types"
1013
sdk "github.com/cosmos/cosmos-sdk/types"
11-
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
1214
"github.com/cosmos/cosmos-sdk/x/auth/ante"
1315

1416
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
@@ -20,34 +22,39 @@ import (
2022
type HandlerOptions struct {
2123
ante.HandlerOptions
2224

23-
IBCKeeper *keeper.Keeper
24-
WasmKeeper *wasmkeeper.Keeper
25-
WasmConfig *wasmTypes.WasmConfig
26-
TXCounterStoreKey storetypes.StoreKey
25+
IBCKeeper *keeper.Keeper
26+
WasmConfig *wasmTypes.WasmConfig
27+
WasmKeeper *wasmkeeper.Keeper
28+
TXCounterStoreService corestoretypes.KVStoreService
29+
CircuitKeeper *circuitkeeper.Keeper
2730
}
2831

2932
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
3033
if options.AccountKeeper == nil {
31-
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
34+
return nil, errors.New("account keeper is required for ante builder")
3235
}
3336
if options.BankKeeper == nil {
34-
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler")
37+
return nil, errors.New("bank keeper is required for ante builder")
3538
}
3639
if options.SignModeHandler == nil {
37-
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
40+
return nil, errors.New("sign mode handler is required for ante builder")
3841
}
3942
if options.WasmConfig == nil {
40-
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder")
43+
return nil, errors.New("wasm config is required for ante builder")
44+
}
45+
if options.TXCounterStoreService == nil {
46+
return nil, errors.New("wasm store service is required for ante builder")
4147
}
42-
if options.TXCounterStoreKey == nil {
43-
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "tx counter key is required for ante builder")
48+
if options.CircuitKeeper == nil {
49+
return nil, errors.New("circuit keeper is required for ante builder")
4450
}
4551

4652
anteDecorators := []sdk.AnteDecorator{
4753
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
4854
wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), // after setup context to enforce limits early
49-
wasmkeeper.NewCountTXDecorator(options.TXCounterStoreKey),
55+
wasmkeeper.NewCountTXDecorator(options.TXCounterStoreService),
5056
wasmkeeper.NewGasRegisterDecorator(options.WasmKeeper.GetGasRegister()),
57+
circuitante.NewCircuitBreakerDecorator(options.CircuitKeeper),
5158
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
5259
ante.NewValidateBasicDecorator(),
5360
ante.NewTxTimeoutHeightDecorator(),

0 commit comments

Comments
 (0)