Skip to content

Commit

Permalink
chore: update deps (#334)
Browse files Browse the repository at this point in the history
Co-authored-by: John Letey <john@nobleassets.xyz>
  • Loading branch information
alexanderbez and johnletey committed Apr 19, 2024
1 parent 72fad33 commit d47d46a
Show file tree
Hide file tree
Showing 90 changed files with 2,185 additions and 13,397 deletions.
14 changes: 5 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CHAIN_NAME = noble
DAEMON_NAME = nobled

LEDGER_ENABLED ?= true
TM_VERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::') # grab everything after the space in "github.com/tendermint/tendermint v0.34.7"
TM_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::')
BUILDDIR ?= $(CURDIR)/build

export GO111MODULE = on
Expand Down Expand Up @@ -64,7 +64,7 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=$(CHAIN_NAME) \
-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)

ldflags += $(LDFLAGS)
ldflags := $(strip $(ldflags))
Expand Down Expand Up @@ -123,7 +123,8 @@ endif
### Protobuf ###
###############################################################################

BUF_VERSION=1.29.0
BUF_VERSION=1.30.0
BUILDER_VERSION=0.14.0

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

Expand All @@ -136,16 +137,11 @@ proto-format:
proto-gen:
@echo "🤖 Generating code from protobuf..."
@docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \
noble-proto sh ./proto/generate.sh
ghcr.io/cosmos/proto-builder:$(BUILDER_VERSION) sh ./proto/generate.sh
@echo "✅ Completed code generation!"

proto-lint:
@echo "🤖 Running protobuf linter..."
@docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \
bufbuild/buf:$(BUF_VERSION) lint
@echo "✅ Completed protobuf linting!"

proto-setup:
@echo "🤖 Setting up protobuf environment..."
@docker build --rm --tag noble-proto:latest --file proto/Dockerfile .
@echo "✅ Setup protobuf environment!"
37 changes: 17 additions & 20 deletions app/ante.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
package app

import (
errorsmod "cosmossdk.io/errors"
circuitante "cosmossdk.io/x/circuit/ante"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"
"github.com/noble-assets/noble/v5/x/forwarding"
forwardingkeeper "github.com/noble-assets/noble/v5/x/forwarding/keeper"
feeante "github.com/noble-assets/noble/v5/x/globalfee/ante"
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
)

type HandlerOptions struct {
ante.HandlerOptions
IBCKeeper *ibckeeper.Keeper
GlobalFeeSubspace paramtypes.Subspace
StakingSubspace paramtypes.Subspace
ForwardingKeeper *forwardingkeeper.Keeper

IBCKeeper *ibckeeper.Keeper
CircuitKeeper circuitante.CircuitBreaker
StakingSubspace paramtypes.Subspace
}

// maxTotalBypassMinFeeMsgGasUsage is the allowed maximum gas usage
Expand All @@ -32,38 +31,36 @@ var maxTotalBypassMinFeeMsgGasUsage uint64 = 1_000_000
// signer
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")
}

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

anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
ante.NewRejectExtensionOptionsDecorator(),
forwarding.NewAnteDecorator(options.ForwardingKeeper, options.AccountKeeper),
ante.NewMempoolFeeDecorator(),
circuitante.NewCircuitBreakerDecorator(options.CircuitKeeper),
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
ante.NewValidateBasicDecorator(),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(options.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
feeante.NewFeeDecorator(options.GlobalFeeSubspace, options.StakingSubspace, maxTotalBypassMinFeeMsgGasUsage),

ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper),
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.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewAnteDecorator(options.IBCKeeper),
ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
}
return sdk.ChainAnteDecorators(anteDecorators...), nil

return sdk.ChainAnteDecorators(anteDecorators...), nil
}
Loading

0 comments on commit d47d46a

Please sign in to comment.