Skip to content

Commit

Permalink
Merge pull request #575 from KiraCore/release/v0.3.34
Browse files Browse the repository at this point in the history
release/v0.3.34 -> master
  • Loading branch information
kmlbgn authored Oct 6, 2023
2 parents 20848d9 + d0b95fa commit f883a34
Show file tree
Hide file tree
Showing 296 changed files with 2,652 additions and 4,791 deletions.
30 changes: 24 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
DOCKER := $(shell which docker)

.PHONY: all install go.sum test test-local lint proto-gen proto-gen-local build start publish

all: install
Expand All @@ -23,15 +25,31 @@ lint:
@golangci-lint run
@go mod verify

containerProtoVer=v0.2
containerProtoImage=tendermintdev/sdk-proto-gen:$(containerProtoVer)
containerProtoGen=cosmos-sdk-proto-gen-$(containerProtoVer)
containerProtoVer=0.14.0
containerProtoImage=ghcr.io/cosmos/proto-builder:$(containerProtoVer)

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

proto-gen:
docker run --rm --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) sh ./scripts/protocgen.sh
@echo "Generating Protobuf files"
@$(DOCKER) run --user $(id -u):$(id -g) --rm -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \
sh ./scripts/protocgen.sh;

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

proto-swagger-gen:
@echo "Generating Protobuf Swagger"
@$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \
sh ./scripts/protoc-swagger-gen.sh;

proto-lint:
@$(DOCKER_BUF) lint --error-format=json

proto-gen-local:
./scripts/protogen-local.sh
proto-check-breaking:
@$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=main

build:
./scripts/build.sh
Expand Down
8 changes: 6 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Features:

- Update gitflow doker base-iamge v0.11.2 -> v0.13.14

- Upgrade Cosmos SDK to v0.47.5
- Upgrade go version to 1.19
- Upgrade from tendermint to cometbft
- Update protobuf generator
- Update few invalid protobuf package names
- Add posthandler for execution fees
12 changes: 7 additions & 5 deletions app/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,18 @@ func NewAnteHandler(
fk feeprocessingkeeper.Keeper,
ak keeper.AccountKeeper,
bk types.BankKeeper,
ck custodykeeper.Keeper,
feegrantKeeper ante.FeegrantKeeper,
extensionOptionChecker ante.ExtensionOptionChecker,
sigGasConsumer ante.SignatureVerificationGasConsumer,
signModeHandler signing.SignModeHandler,
ck custodykeeper.Keeper,
txFeeChecker ante.TxFeeChecker,
) sdk.AnteHandler {
return sdk.ChainAnteDecorators(
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
NewCustodyDecorator(ck, cgk),
NewZeroGasMeterDecorator(),
ante.NewRejectExtensionOptionsDecorator(),
ante.NewMempoolFeeDecorator(),
ante.NewExtensionOptionsDecorator(extensionOptionChecker),
ante.NewValidateBasicDecorator(),
ante.TxTimeoutHeightDecorator{},
ante.NewValidateMemoDecorator(ak),
Expand All @@ -51,7 +53,7 @@ func NewAnteHandler(
NewValidateFeeRangeDecorator(sk, cgk, tk, ak),
ante.NewSetPubKeyDecorator(ak), // SetPubKeyDecorator must be called before all signature verification decorators
ante.NewValidateSigCountDecorator(ak),
ante.NewDeductFeeDecorator(ak, bk, nil),
ante.NewDeductFeeDecorator(ak, bk, feegrantKeeper, txFeeChecker),
// poor network management decorator
NewPoorNetworkManagementDecorator(ak, cgk, sk),
NewBlackWhiteTokensCheckDecorator(cgk, sk, tk),
Expand Down Expand Up @@ -334,7 +336,7 @@ func (svd ValidateFeeRangeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simu
if tokensBlackWhite.IsFrozen(feeCoin.Denom, defaultDenom, properties.EnableTokenBlacklist, properties.EnableTokenWhitelist) {
return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("currency you are trying to use as fee is frozen"))
}
feeAmount = feeAmount.Add(feeCoin.Amount.ToDec().Mul(rate.FeeRate))
feeAmount = feeAmount.Add(sdk.NewDecFromInt(feeCoin.Amount).Mul(rate.FeeRate))
}

// execution fee should be prepaid
Expand Down
2 changes: 1 addition & 1 deletion app/ante/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ func (suite *AnteTestSuite) TestInfiniteGasMeterDecorator() {
suite.ctx = suite.ctx.WithBlockHeight(1)

// Context GasMeter Limit not set
suite.Require().Equal(uint64(0), suite.ctx.GasMeter().Limit(), "GasMeter set with limit before setup")
suite.Require().Equal(uint64(0xffffffffffffffff), suite.ctx.GasMeter().Limit(), "GasMeter set with limit before setup")

newCtx, err := antehandler(suite.ctx, tx, false)
suite.Require().Nil(err, "InfiniteGasMeterDecorator returned error")
Expand Down
8 changes: 6 additions & 2 deletions app/ante/testutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

simapp "github.com/KiraCore/sekai/app"
customante "github.com/KiraCore/sekai/app/ante"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/tx"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
Expand All @@ -19,7 +20,6 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
"github.com/stretchr/testify/suite"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
)

// TestAccount represents an account used in the tests in x/auth/ante.
Expand Down Expand Up @@ -63,14 +63,18 @@ func (suite *AnteTestSuite) SetupTest(isCheckTx bool) {

suite.anteHandler = customante.NewAnteHandler(
suite.app.CustomStakingKeeper,

suite.app.CustomGovKeeper,
suite.app.TokensKeeper,
suite.app.FeeProcessingKeeper,
suite.app.AccountKeeper,
suite.app.BankKeeper,
suite.app.CustodyKeeper,
nil,
nil,
ante.DefaultSigVerificationGasConsumer,
encodingConfig.TxConfig.SignModeHandler(),
suite.app.CustodyKeeper)
nil)
}

// CreateTestAccounts creates `numAccs` accounts, and return all relevant
Expand Down
Loading

0 comments on commit f883a34

Please sign in to comment.