-
Notifications
You must be signed in to change notification settings - Fork 667
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
feat!: Introduce feemarket module #3028
Changes from 27 commits
67ed1ef
5a68fa1
cc65aae
0c4d33a
ffbe220
247596b
9b9ac32
22fdf42
0be4697
943a116
dff7000
080ffa1
d745944
c517b48
8cdce49
b9859d4
0b51473
b69c7b5
0fce83e
2e52f4f
686744f
37541f9
2ae514c
bd887ff
f57b72e
eedc862
9f3afd2
18fc6e4
9c52fe7
d387a7f
4d4662c
417c987
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- Add feemarket module | ||
- Remove globalfee module from the app and repository | ||
- Remove auth module 'DeductFeeDecorator' | ||
- Remove x/globalfee module | ||
([\#3028](https://github.com/cosmos/gaia/pull/3028)) | ||
MSalopek marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- Add feemarket module | ||
- Remove globalfee module from the app and repository | ||
- Remove auth module 'DeductFeeDecorator' | ||
- Remove x/globalfee module | ||
([\#3028](https://github.com/cosmos/gaia/pull/3028)) | ||
MSalopek marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ BUILDDIR ?= $(CURDIR)/build | |
TEST_DOCKER_REPO=cosmos/contrib-gaiatest | ||
|
||
GO_SYSTEM_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1-2) | ||
REQUIRE_GO_VERSION = 1.21 | ||
REQUIRE_GO_VERSION = 1.22 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to bump the go version? If so, please add a changelog entry. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. Added changelog. |
||
|
||
export GO111MODULE = on | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
package ante | ||
|
||
import ( | ||
feemarketante "github.com/skip-mev/feemarket/x/feemarket/ante" | ||
feemarketkeeper "github.com/skip-mev/feemarket/x/feemarket/keeper" | ||
|
||
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" | ||
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" | ||
|
||
|
@@ -9,22 +12,23 @@ import ( | |
"github.com/cosmos/cosmos-sdk/codec" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/x/auth/ante" | ||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" | ||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" | ||
|
||
gaiaerrors "github.com/cosmos/gaia/v18/types/errors" | ||
gaiafeeante "github.com/cosmos/gaia/v18/x/globalfee/ante" | ||
) | ||
|
||
// UseFeeMarketDecorator to make the integration testing easier: we can switch off its ante and post decorators with this flag | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a workaround to make the integration tests based on IBC testing framework work without the need to override the |
||
var UseFeeMarketDecorator = true | ||
|
||
// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC | ||
// channel keeper. | ||
type HandlerOptions struct { | ||
ante.HandlerOptions | ||
Codec codec.BinaryCodec | ||
IBCkeeper *ibckeeper.Keeper | ||
GlobalFeeSubspace paramtypes.Subspace | ||
StakingKeeper *stakingkeeper.Keeper | ||
TxFeeChecker ante.TxFeeChecker | ||
Codec codec.BinaryCodec | ||
IBCkeeper *ibckeeper.Keeper | ||
StakingKeeper *stakingkeeper.Keeper | ||
FeeMarketKeeper *feemarketkeeper.Keeper | ||
TxFeeChecker ante.TxFeeChecker | ||
} | ||
|
||
func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { | ||
|
@@ -40,9 +44,8 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { | |
if opts.IBCkeeper == nil { | ||
return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "IBC keeper is required for AnteHandler") | ||
} | ||
|
||
if opts.GlobalFeeSubspace.Name() == "" { | ||
return nil, errorsmod.Wrap(gaiaerrors.ErrNotFound, "globalfee param store is required for AnteHandler") | ||
if opts.FeeMarketKeeper == nil { | ||
return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "FeeMarket keeper is required for AnteHandler") | ||
} | ||
|
||
if opts.StakingKeeper == nil { | ||
|
@@ -62,8 +65,6 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { | |
ante.NewValidateMemoDecorator(opts.AccountKeeper), | ||
ante.NewConsumeGasForTxSizeDecorator(opts.AccountKeeper), | ||
NewGovVoteDecorator(opts.Codec, opts.StakingKeeper), | ||
gaiafeeante.NewFeeDecorator(opts.GlobalFeeSubspace, opts.StakingKeeper), | ||
ante.NewDeductFeeDecorator(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper, opts.TxFeeChecker), | ||
ante.NewSetPubKeyDecorator(opts.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators | ||
ante.NewValidateSigCountDecorator(opts.AccountKeeper), | ||
ante.NewSigGasConsumeDecorator(opts.AccountKeeper, sigGasConsumer), | ||
|
@@ -72,5 +73,16 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { | |
ibcante.NewRedundantRelayDecorator(opts.IBCkeeper), | ||
} | ||
|
||
if UseFeeMarketDecorator { | ||
anteDecorators = append(anteDecorators, | ||
feemarketante.NewFeeMarketCheckDecorator( | ||
opts.FeeMarketKeeper, | ||
ante.NewDeductFeeDecorator( | ||
opts.AccountKeeper, | ||
opts.BankKeeper, | ||
opts.FeegrantKeeper, | ||
opts.TxFeeChecker))) | ||
} | ||
|
||
return sdk.ChainAnteDecorators(anteDecorators...), nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add one more changelog entry under api-breaking. Removing the globalfee module breaks the API, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.