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

Cosmos-SDK v0.47 integration brach #1149

Merged
merged 65 commits into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
76dd72d
Start cosmos-sdk v0.47 integration (#1136)
alpe Jan 11, 2023
1e6a886
Bump bufbuild/buf-setup-action from 1.11.0 to 1.12.0
dependabot[bot] Jan 13, 2023
e9a80cf
Merge pull request #1152 from CosmWasm/mergify/bp/develop_sdk47/pr-1151
alpe Jan 13, 2023
ba499ae
Remove intertx for vanilla ICA
alpe Jan 17, 2023
50bda42
fix msg format in EVENTS.md
dev8723 Jan 22, 2023
42dc194
Merge pull request #1159 from CosmWasm/ica_noauth
alpe Jan 23, 2023
22880a8
Merge pull request #1168 from CosmWasm/mergify/bp/develop_sdk47/pr-1167
alpe Jan 23, 2023
cc28399
Better to sdk coin convertion (#1164)
alpe Jan 24, 2023
650af69
Merge pull request #1170 from CosmWasm/mergify/bp/develop_sdk47/pr-1164
alpe Jan 24, 2023
6b9d1c8
Disallow only address permission (#1163)
alpe Jan 25, 2023
a851656
Integrate wasmvm v1.2.0 (backport #1161) (#1175)
mergify[bot] Jan 26, 2023
fe57635
Merge pull request #1176 from CosmWasm/mergify/bp/develop_sdk47/pr-1163
alpe Jan 26, 2023
dff6528
Bump bufbuild/buf-setup-action from 1.12.0 to 1.13.0
dependabot[bot] Jan 27, 2023
db503d6
Emit events for setContractAdmin + setAccessConfig (#1179)
alpe Jan 27, 2023
83142ba
Merge pull request #1186 from CosmWasm/mergify/bp/develop_sdk47/pr-1181
alpe Jan 27, 2023
aa8db78
Dependency upgrades (#1172)
alpe Jan 27, 2023
9df3f60
Merge pull request #1187 from CosmWasm/mergify/bp/develop_sdk47/pr-1179
alpe Jan 27, 2023
6a0c2a3
Update to ibc-go v7 + protoVer=0.11.5
gjermundgaraba Jan 29, 2023
6a49301
Merge pull request #1190 from gjermundgaraba/develop_sdk47
alpe Jan 30, 2023
287aec8
Bump bufbuild/buf-setup-action from 1.13.0 to 1.13.1
dependabot[bot] Jan 30, 2023
a6fcba2
Merge pull request #1193 from CosmWasm/mergify/bp/develop_sdk47/pr-1191
alpe Jan 30, 2023
388b175
Fix typos (backport #1185) (#1194)
mergify[bot] Jan 30, 2023
524f773
Bump bufbuild/buf-setup-action from 1.13.1 to 1.14.0 (#1200)
dependabot[bot] Mar 1, 2023
fc4bbe1
Merge pull request #1219 from CosmWasm/mergify/bp/develop_sdk47/pr-1200
alpe Mar 1, 2023
466f206
list-contract-by-code bugfix
nik-suri Feb 13, 2023
3eca999
fix: stargate querier does not reset the state
dadamu Feb 23, 2023
92fde7a
test: add unit test
dadamu Feb 24, 2023
498b98e
Merge pull request #1223 from CosmWasm/mergify/bp/develop_sdk47/pr-1201
alpe Mar 2, 2023
05be122
Merge pull request #1224 from CosmWasm/mergify/bp/develop_sdk47/pr-1208
alpe Mar 2, 2023
b9d2771
Add Windows client support (#1197)
pinosu Mar 3, 2023
e3f36b2
Merge pull request #1227 from CosmWasm/mergify/bp/develop_sdk47/pr-1197
alpe Mar 3, 2023
00edea6
Bump bufbuild/buf-setup-action from 1.14.0 to 1.15.0
dependabot[bot] Mar 2, 2023
ddedb03
Merge pull request #1228 from CosmWasm/mergify/bp/develop_sdk47/pr-1222
alpe Mar 3, 2023
918d952
Rename windows client binary
alpe Mar 3, 2023
221cf02
Merge pull request #1235 from CosmWasm/mergify/bp/develop_sdk47/pr-1231
alpe Mar 6, 2023
f4f2fe8
Return IBC packet sequence number (backport #1225) (#1233)
mergify[bot] Mar 6, 2023
29225df
Test rust panic for regression
alpe Mar 6, 2023
e962674
Fix client checksum verification (#1234)
alpe Mar 6, 2023
0b8af25
Merge pull request #1238 from CosmWasm/mergify/bp/develop_sdk47/pr-1234
alpe Mar 6, 2023
7969723
Fix merge conflict
alpe Mar 6, 2023
ccf3a88
Fix linters
alpe Mar 6, 2023
30884e7
Merge pull request #1237 from CosmWasm/mergify/bp/develop_sdk47/pr-1236
alpe Mar 6, 2023
b1a6f11
Configure sonarcloud analysis
alpe Nov 22, 2022
651ca9c
Merge pull request #1241 from CosmWasm/mergify/bp/develop_sdk47/pr-1105
alpe Mar 6, 2023
52d6b1f
Merge pull request #1240 from CosmWasm/fix_linters
alpe Mar 7, 2023
a435474
Bump bufbuild/buf-setup-action from 1.15.0 to 1.15.1
dependabot[bot] Mar 9, 2023
c7fb329
Merge pull request #1252 from CosmWasm/mergify/bp/develop_sdk47/pr-1251
alpe Mar 9, 2023
c160867
Make `CaptureIbcEvents` in ibctesting public.
0xekez Mar 9, 2023
c48879b
Merge pull request #1253 from CosmWasm/mergify/bp/develop_sdk47/pr-1248
alpe Mar 9, 2023
4289001
Upgrade to wasmvm 1.2.1 (backport #1245) (#1254)
mergify[bot] Mar 10, 2023
12dabd6
WIP All cometbft (#1244)
alpe Mar 13, 2023
bae90d3
Add changelog for v0.31.0 (#1188)
alpe Mar 13, 2023
539c783
Merge pull request #1257 from CosmWasm/mergify/bp/develop_sdk47/pr-1188
alpe Mar 13, 2023
280dc4e
Merge branch 'main' into develop_sdk47_to_main
alpe Mar 14, 2023
9ba407c
Remove new message type event
alpe Mar 14, 2023
7d6a4c1
Merge pull request #1259 from CosmWasm/develop_sdk47_to_main
alpe Mar 15, 2023
d648261
Support msg update params gov proposal (#1247)
pinosu Mar 15, 2023
2eaa893
Fix test data generator (#1263)
alpe Mar 15, 2023
bb13192
linting 47 pr (#1261)
faddat Mar 15, 2023
299f792
Regenerate from proto; remove dead code; polish code
alpe Mar 15, 2023
c245f7d
Merge pull request #1265 from CosmWasm/chore_dev
alpe Mar 16, 2023
6ad6739
Set SDK version to v0.47x.0 (#1262)
alpe Mar 16, 2023
8579a24
Bump ibc-go to v7.0.0
gjermundgaraba Mar 19, 2023
f66036a
Merge pull request #1275 from gjermundgaraba/bump_ibc_to_7
alpe Mar 20, 2023
49ed6f0
faddat/re merge main (#1274)
faddat Mar 20, 2023
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
- run:
name: Run simulations
command: |
make test-sim-multi-seed-short
make test-sim-multi-seed-short test-sim-import-export test-sim-deterministic
- store_artifacts:
path: /tmp

Expand Down
60 changes: 31 additions & 29 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,65 @@
run:
tests: false
tests: true
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 5m

linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- errcheck
- exportloopref
- goconst
- gocritic
- gofmt
- goimports
- revive
- gofumpt
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- prealloc
- exportloopref
- nolintlint
- revive
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- varcheck

issues:
exclude-rules:
- text: "simtypes"
linters:
- staticcheck
- text: "Use of weak random number generator"
linters:
- gosec
- text: "ST1003:"
linters:
- stylecheck
# FIXME: Disabled until golangci-lint updates stylecheck with this fix:
# https://github.com/dominikh/go-tools/issues/389
- text: "ST1016:"
linters:
- stylecheck
- path: "migrations"
text: "SA1019:"
linters:
- staticcheck

max-issues-per-linter: 10000
max-same-issues: 10000

linters-settings:
dogsled:
max-blank-identifiers: 3
errcheck:
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: true
maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true
golint:
# minimal confidence for issues, default is 0.8
min-confidence: 0
prealloc:
# XXX: we don't recommend using this linter before doing performance profiling.
# For most programs usage of prealloc will be a premature optimization.
revive:
# When set to false, ignores files with "GENERATED" header, similar to golint
ignore-generated-header: true

# Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
# True by default.
simple: false
range-loops: true # Report preallocation suggestions on range loops, true by default
for-loops: true # Report preallocation suggestions on for loops, false by default
nolintlint:
allow-unused: false
allow-leading-space: true
require-explanation: false
require-specific: false
2 changes: 2 additions & 0 deletions INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ hardware it runs on.

| wasmd | Cosmos SDK |
|:-----:|:----------:|
| v0.40 | v0.47.0 |
| v0.31 | v0.45.14 |
| v0.30 | v0.45.11 |
| v0.29 | v0.45.8 |
| v0.28 | v0.45.5 |
Expand Down
21 changes: 12 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ test-sim-import-export: runsim

test-sim-multi-seed-short: runsim
@echo "Running short multi-seed application simulation. This may take awhile!"
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 10 TestFullAppSimulation
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 5 TestFullAppSimulation

test-sim-deterministic: runsim
@echo "Running short multi-seed application simulation. This may take awhile!"
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 1 1 TestAppStateDeterminism

###############################################################################
### Linting ###
Expand All @@ -159,31 +163,30 @@ format-tools:

lint: format-tools
golangci-lint run --tests=false
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "*_test.go" | xargs gofumpt -d -s
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "*_test.go" | xargs gofumpt -d

format: format-tools
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofumpt -w -s
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofumpt -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs goimports -w -local github.com/CosmWasm/wasmd


###############################################################################
### Protobuf ###
###############################################################################
PROTO_BUILDER_IMAGE=tendermintdev/sdk-proto-gen:v0.7
PROTO_FORMATTER_IMAGE=tendermintdev/docker-build-proto@sha256:aabcfe2fc19c31c0f198d4cd26393f5e5ca9502d7ea3feafbfe972448fee7cae
protoVer=0.11.6
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)

proto-all: proto-format proto-lint proto-gen format

proto-gen:
@echo "Generating Protobuf files"
$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(PROTO_BUILDER_IMAGE) sh ./scripts/protocgen.sh
@$(protoImage) sh ./scripts/protocgen.sh

proto-format:
@echo "Formatting Protobuf files"
$(DOCKER) run --rm -v $(CURDIR):/workspace \
--workdir /workspace $(PROTO_FORMATTER_IMAGE) \
find ./ -name *.proto -exec clang-format -i {} \;
@$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \;

proto-swagger-gen:
@./scripts/protoc-swagger-gen.sh
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ compatibility list:

| wasmd | wasmvm | cosmwasm-vm | cosmwasm-std |
|-------|--------------|-------------|--------------|
| 0.40 | v1.2.1 | | 1.0-1.2 |
| 0.31 | v1.2.0 | | 1.0-1.2 |
| 0.30 | v1.1.0 | | 1.0-1.1 |
| 0.29 | v1.1.0 | | 1.0-1.1 |
Expand Down
35 changes: 15 additions & 20 deletions app/ante.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package app

import (
errorsmod "cosmossdk.io/errors"
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"
ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
"github.com/cosmos/ibc-go/v4/modules/core/keeper"
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
"github.com/cosmos/ibc-go/v7/modules/core/keeper"

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types"
Expand All @@ -18,49 +20,42 @@ type HandlerOptions struct {

IBCKeeper *keeper.Keeper
WasmConfig *wasmTypes.WasmConfig
TXCounterStoreKey sdk.StoreKey
TXCounterStoreKey storetypes.StoreKey
}

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.AccountKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
}
if options.BankKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler")
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler")
}
if options.SignModeHandler == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
}
if options.WasmConfig == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder")
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder")
}
if options.TXCounterStoreKey == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "tx counter key is required for ante builder")
}

sigGasConsumer := options.SigGasConsumer
if sigGasConsumer == nil {
sigGasConsumer = ante.DefaultSigVerificationGasConsumer
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "tx counter key 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),
ante.NewRejectExtensionOptionsDecorator(),
ante.NewMempoolFeeDecorator(),
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
ante.NewValidateBasicDecorator(),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(options.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper),
// SetPubKeyDecorator must be called before all signature verification decorators
ante.NewSetPubKeyDecorator(options.AccountKeeper),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker),
ante.NewSetPubKeyDecorator(options.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators
ante.NewValidateSigCountDecorator(options.AccountKeeper),
ante.NewSigGasConsumeDecorator(options.AccountKeeper, sigGasConsumer),
ante.NewSigGasConsumeDecorator(options.AccountKeeper, options.SigGasConsumer),
ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewAnteDecorator(options.IBCKeeper),
ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
}

return sdk.ChainAnteDecorators(anteDecorators...), nil
Expand Down
Loading