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

v047 upgrade #62

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
507ccc0
update proto files
jhernandezb Feb 21, 2024
4006211
update proto generation
jhernandezb Feb 21, 2024
76b257a
update proto
jhernandezb Feb 21, 2024
a19b43f
update ante
jhernandezb Feb 21, 2024
9db20d5
update generated types
jhernandezb Feb 21, 2024
40e9729
fix imports
jhernandezb Feb 21, 2024
26cca72
update modules and export, remove commands
jhernandezb Feb 21, 2024
7e6287d
fix import
jhernandezb Feb 21, 2024
e686289
add scalar
jhernandezb Feb 21, 2024
7327392
update annotations
jhernandezb Feb 21, 2024
bf64967
update modules
jhernandezb Feb 21, 2024
07ae5e4
fix app wiring
jhernandezb Feb 21, 2024
ca8d742
update go checker
jhernandezb Feb 21, 2024
47d1c3f
fix conflicts
jhernandezb Feb 21, 2024
3950e5c
fix app and root cmd
jhernandezb Feb 21, 2024
db0b081
fix libwasmvm version
jhernandezb Feb 21, 2024
0bb7787
fix genesis checker
jhernandezb Feb 22, 2024
b9eecfd
fix lint
jhernandezb Feb 22, 2024
5fbfd43
fix docker checksums
jhernandezb Feb 22, 2024
f7d7cd4
Remove obsolete github.com/informalsystems/tendermint entry
webmaster128 Feb 24, 2024
69dfd12
Use wasmapp.AllCapabilities()
webmaster128 Feb 24, 2024
d7b629a
Bring back make version
webmaster128 Feb 24, 2024
8195557
Ignore .DS_Store
webmaster128 Feb 25, 2024
3146258
Remove check_go_version
webmaster128 Feb 24, 2024
1d48adc
Update add-genesis-account/gentx/collect-gentxs
webmaster128 Feb 24, 2024
0039bed
Bring back PrepareGenesisCmd
webmaster128 Feb 25, 2024
53141dc
Set MinCommissionRate and MinInitialDepositRatio
webmaster128 Feb 25, 2024
0001263
Use the same validator mnemonic every time we generate a new genesis
webmaster128 Feb 25, 2024
a6608d4
fix encoding tx
jhernandezb Feb 26, 2024
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
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2.1
jobs:
build:
docker:
- image: cimg/go:1.20.2
- image: cimg/go:1.21.5
steps:
- checkout
- run:
Expand All @@ -16,13 +16,13 @@ jobs:
name: Check libwasmvm version
command: |
LIBWASMVM_VERSION=$(./build/noisd query wasm libwasmvm-version)
if [[ "$LIBWASMVM_VERSION" != "1.2.6" ]] ; then
if [[ "$LIBWASMVM_VERSION" != "1.5.2" ]] ; then
echo "Got unexpected libwasmvm version: $LIBWASMVM_VERSION"
exit 1
fi
tidy:
docker:
- image: cimg/go:1.20.2
- image: cimg/go:1.21.5
steps:
- checkout
- run:
Expand All @@ -39,7 +39,7 @@ jobs:
fi
format-go:
docker:
- image: cimg/go:1.20.2
- image: cimg/go:1.21.5
steps:
- run:
name: Install gofumpt
Expand All @@ -55,7 +55,7 @@ jobs:
[ "$(gofumpt -l .)" = "" ] || (gofumpt -d . && exit 1)
docker-image:
docker:
- image: cimg/go:1.20.2
- image: cimg/go:1.21.5
steps:
- checkout
- setup_remote_docker:
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ updates:
- dependency-name: "github.com/informalsystems/tendermint"
update-types: ["version-update:semver-major", "version-update:semver-minor"]
ignore:
- dependency-name: "github.com/tendermint/tendermint"
- dependency-name: "github.com/cometbft/cometbft"
update-types: ["version-update:semver-major", "version-update:semver-minor"]
ignore:
- dependency-name: "github.com/cosmos/cosmos-sdk"
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# show version: docker run --rm noislabs/noisd:manual
# libwasmvm version: docker run --rm noislabs/noisd:manual noisd query wasm libwasmvm-version
# shell: docker run --rm -it noislabs/noisd:manual sh
FROM golang:1.20.2-alpine3.17 AS go-builder
FROM golang:1.21.5-alpine3.17 AS go-builder

# this comes from standard alpine nightly file
# https://github.com/rust-lang/docker-rust-nightly/blob/master/alpine3.12/Dockerfile
Expand All @@ -23,11 +23,11 @@ RUN APK_ARCH="$(apk --print-arch)"; \
echo "Detected architecture: $APK_ARCH"; \
case "$APK_ARCH" in \
aarch64) \
wget -O /lib/libwasmvm_muslc.a https://github.com/CosmWasm/wasmvm/releases/download/v1.2.6/libwasmvm_muslc.aarch64.a \
&& sha256sum /lib/libwasmvm_muslc.a | grep 1014ebcce48bd7b019f66798ec8dbb42b383f324038296c64de35bdbf5f28243 ;; \
wget -O /lib/libwasmvm_muslc.a https://github.com/CosmWasm/wasmvm/releases/download/v1.5.2/libwasmvm_muslc.aarch64.a \
&& sha256sum /lib/libwasmvm_muslc.a | grep e78b224c15964817a3b75a40e59882b4d0e06fd055b39514d61646689cef8c6e ;; \
x86_64) \
wget -O /lib/libwasmvm_muslc.a https://github.com/CosmWasm/wasmvm/releases/download/v1.2.6/libwasmvm_muslc.x86_64.a \
&& sha256sum /lib/libwasmvm_muslc.a | grep d93b02f34d2da0aa7f20786add8abdca8224334db541f954d28fad64641b9136 ;; \
wget -O /lib/libwasmvm_muslc.a https://github.com/CosmWasm/wasmvm/releases/download/v1.5.2/libwasmvm_muslc.x86_64.a \
&& sha256sum /lib/libwasmvm_muslc.a | grep e660a38efb2930b34ee6f6b0bb12730adccb040b6ab701b8f82f34453a426ae7 ;; \
esac;

WORKDIR /code
Expand Down
32 changes: 15 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
LEDGER_ENABLED ?= true
SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g')
TM_VERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::')
TM_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::')
BUILDDIR ?= $(CURDIR)/build
DOCKER := $(shell which docker)

Expand Down Expand Up @@ -60,7 +60,7 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=nois \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" \
-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TM_VERSION)
-X github.com/cometbft/cometbft/version.TMCoreSemVer=$(TM_VERSION)

ifeq (cleveldb,$(findstring cleveldb,$(NOIS_BUILD_OPTIONS)))
ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb
Expand Down Expand Up @@ -135,28 +135,26 @@ BUF_IMAGE=bufbuild/buf@sha256:3cb1f8a4b48bd5ad8f09168f10f607ddc318af202f5c057d52
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(BUF_IMAGE)



###############################################################################
### Protobuf ###
###############################################################################
PROTO_BUILDER_IMAGE=tendermintdev/sdk-proto-gen:v0.2
PROTO_FORMATTER_IMAGE=tendermintdev/docker-build-proto@sha256:aabcfe2fc19c31c0f198d4cd26393f5e5ca9502d7ea3feafbfe972448fee7cae
protoVer=0.14.0
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-all: proto-format proto-lint proto-gen

proto-gen:
@echo "Generating Protobuf files"
$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(PROTO_BUILDER_IMAGE) 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) sh ./scripts/protocgen.sh

proto-swagger-gen:
@./scripts/protoc-swagger-gen.sh
@echo "Generating Protobuf Swagger"
@$(protoImage) sh ./scripts/protoc-swagger-gen.sh

proto-format:
@$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \;

# Show the version that `make build` is using
.PHONY: version
version:
@echo "$(VERSION)"
proto-lint:
@$(protoImage) buf lint --error-format=json
28 changes: 13 additions & 15 deletions app/ante.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package app

import (
errorsmod "cosmossdk.io/errors"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/cosmos/cosmos-sdk/codec"
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"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"
appante "github.com/noislabs/noisd/app/ante"
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
)

// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
Expand All @@ -19,7 +20,7 @@ type HandlerOptions struct {
ante.HandlerOptions
keeper *ibckeeper.Keeper
WasmConfig *wasmTypes.WasmConfig
TXCounterStoreKey sdk.StoreKey
TXCounterStoreKey storetypes.StoreKey
Codec codec.BinaryCodec
govKeeper govkeeper.Keeper
}
Expand All @@ -29,23 +30,23 @@ type HandlerOptions struct {
// signer.
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.AccountKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for ante builder")
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "account keeper is required for ante builder")
}

if options.BankKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for ante builder")
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for ante builder")
}

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")
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "tx counter key is required for ante builder")
}

sigGasConsumer := options.SigGasConsumer
Expand All @@ -58,23 +59,20 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
// limit simulation gas
wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit),
wasmkeeper.NewCountTXDecorator(options.TXCounterStoreKey),
appante.NewMinCommissionDecorator(options.Codec),
appante.NewMinDepositDecorator(options.Codec, options.govKeeper),
ante.NewRejectExtensionOptionsDecorator(),
ante.NewMempoolFeeDecorator(),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker),
ante.NewValidateBasicDecorator(),
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
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.NewValidateSigCountDecorator(options.AccountKeeper),
ante.NewSigGasConsumeDecorator(options.AccountKeeper, sigGasConsumer),
ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
// prevents submitting duplicated packets or transactions without update client message
ibcante.NewAnteDecorator(options.keeper),
ibcante.NewRedundantRelayDecorator(options.keeper),
}

return sdk.ChainAnteDecorators(anteDecorators...), nil
Expand Down
76 changes: 0 additions & 76 deletions app/ante/min_commission.go

This file was deleted.

80 changes: 0 additions & 80 deletions app/ante/min_deposit.go

This file was deleted.

Loading
Loading