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

Start cosmos-sdk v0.47 integration #1136

Merged
merged 30 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c9c96f3
Upgrade to sdk v0.47 branch
alpe Dec 6, 2022
9369b15
More integration work
alpe Dec 8, 2022
63002d5
SDK version upgrade; fixes
alpe Dec 8, 2022
9ea2721
More fixes
alpe Dec 8, 2022
8b252ca
Fixes
alpe Dec 9, 2022
557b898
Deactivate failing tests
alpe Dec 13, 2022
60794f1
SDK + ibc-go version upgrades
alpe Dec 21, 2022
8f25e84
limix gas fix
vuong177 Dec 19, 2022
cc7a20b
with valset in bench
vuong177 Aug 17, 2022
6c53bf1
Revert staking query handler; fix tests
alpe Dec 21, 2022
bd823d2
Minor cleanup
alpe Dec 21, 2022
9755e70
Rebased
alpe Dec 21, 2022
98e7e91
Address linter issues
alpe Dec 22, 2022
24c0a1b
Set legacy router proper
alpe Dec 22, 2022
ffd625c
Deactivate failing test. Race condition needs to handled in SDK
alpe Dec 22, 2022
d329a6f
Address some code smells
alpe Dec 22, 2022
ceedf72
Bump sdk version
alpe Jan 3, 2023
a14efe6
Use gov v1 internally for votes
alpe Jan 4, 2023
52673d8
Activate test after sdk fix
alpe Jan 4, 2023
06b715e
Add group test
alpe Jan 6, 2023
125f719
Add config template for wasm fields
alpe Jan 9, 2023
218c3c6
Add Rust backtrace flag for more debug output on simulations
alpe Jan 9, 2023
23917b3
Set unique node folder for tests
alpe Jan 9, 2023
150536e
Revert "Add Rust backtrace flag for more debug output on simulations"
alpe Jan 9, 2023
29f98b0
Simulations
alpe Jan 9, 2023
6fd3d4f
Run also im/export + deterministic sims
alpe Jan 9, 2023
5dc6c8b
Add package prefix to interfaces
alpe Jan 9, 2023
66913a1
Add signer annotation (https://github.com/cosmos/cosmos-sdk/issues/10…
alpe Jan 9, 2023
88fa13a
Bump sdk version
alpe Jan 9, 2023
f1d2972
Review comments
alpe Jan 11, 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
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,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 @@ -166,20 +170,19 @@ format: format-tools
###############################################################################
### Protobuf ###
###############################################################################
PROTO_BUILDER_IMAGE=tendermintdev/sdk-proto-gen:v0.7
PROTO_FORMATTER_IMAGE=tendermintdev/docker-build-proto@sha256:aabcfe2fc19c31c0f198d4cd26393f5e5ca9502d7ea3feafbfe972448fee7cae
protoVer=0.11.2
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
24 changes: 9 additions & 15 deletions app/ante.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package app

import (
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/v6/modules/core/ante"
"github.com/cosmos/ibc-go/v6/modules/core/keeper"

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

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

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
Expand All @@ -38,29 +39,22 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "tx counter key is required for ante builder")
}

sigGasConsumer := options.SigGasConsumer
if sigGasConsumer == nil {
sigGasConsumer = ante.DefaultSigVerificationGasConsumer
}

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