Skip to content

Commit 017b82e

Browse files
committed
Squashed: sdk upgrade to v0.50
1 parent 97b997e commit 017b82e

File tree

129 files changed

+3745
-3260
lines changed

Some content is hidden

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

129 files changed

+3745
-3260
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

+8
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,11 @@ pull_request_rules:
2828
backport:
2929
branches:
3030
- releases/v0.40.x
31+
- name: backport patches to sdk50 development branch
32+
conditions:
33+
- base=main
34+
- label=backport/dev-sdk50
35+
actions:
36+
backport:
37+
branches:
38+
- develop_sdk50

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.13.5
180180
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
181181
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
182182

app/ante.go

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

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

7-
errorsmod "cosmossdk.io/errors"
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,32 +22,37 @@ import (
2022
type HandlerOptions struct {
2123
ante.HandlerOptions
2224

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

2831
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
2932
if options.AccountKeeper == nil {
30-
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
33+
return nil, errors.New("account keeper is required for ante builder")
3134
}
3235
if options.BankKeeper == nil {
33-
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler")
36+
return nil, errors.New("bank keeper is required for ante builder")
3437
}
3538
if options.SignModeHandler == nil {
36-
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
39+
return nil, errors.New("sign mode handler is required for ante builder")
3740
}
3841
if options.WasmConfig == nil {
39-
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder")
42+
return nil, errors.New("wasm config is required for ante builder")
43+
}
44+
if options.TXCounterStoreService == nil {
45+
return nil, errors.New("wasm store service is required for ante builder")
4046
}
41-
if options.TXCounterStoreKey == nil {
42-
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "tx counter key is required for ante builder")
47+
if options.CircuitKeeper == nil {
48+
return nil, errors.New("circuit keeper is required for ante builder")
4349
}
4450

4551
anteDecorators := []sdk.AnteDecorator{
4652
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
4753
wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), // after setup context to enforce limits early
48-
wasmkeeper.NewCountTXDecorator(options.TXCounterStoreKey),
54+
wasmkeeper.NewCountTXDecorator(options.TXCounterStoreService),
55+
circuitante.NewCircuitBreakerDecorator(options.CircuitKeeper),
4956
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
5057
ante.NewValidateBasicDecorator(),
5158
ante.NewTxTimeoutHeightDecorator(),

0 commit comments

Comments
 (0)