Documentation ¶
Overview ¶
Package ante defines the SDK auth module's AnteHandler as well as an internal AnteHandler for an Ethereum transaction (i.e MsgEthereumTx).
During CheckTx, the transaction is passed through a series of pre-message execution validation checks such as signature and account verification in addition to minimum fees being checked. Otherwise, during DeliverTx, the transaction is simply passed to the EVM which will also perform the same series of checks. The distinction is made in CheckTx to prevent spam and DoS attacks.
Index ¶
- func NewAnteHandler(options HandlerOptions, gravityKeeper *gravitykeeper.Keeper, ...) sdk.AnteHandler
- type CreateValidatorMessage
- type EthVestingTransactionDecorator
- type EvmKeeper
- type GovernanceSubmitProposalMessage
- type HandlerOptions
- type MinCommissionDecorator
- type StakingDelegationMessage
- type ValidatorCommissionDecorator
- type VestingDelegationDecorator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAnteHandler ¶
func NewAnteHandler( options HandlerOptions, gravityKeeper *gravitykeeper.Keeper, accountKeeper *authkeeper.AccountKeeper, bankKeeper *bankkeeper.BaseKeeper, feegrantKeeper *feegrantkeeper.Keeper, ibcKeeper *ibckeeper.Keeper, cdc codec.BinaryCodec, ) sdk.AnteHandler
NewAnteHandler returns an ante handler responsible for attempting to route an Ethereum or SDK transaction to an internal ante handler for performing transaction-level processing (e.g. fee payment, signature verification) before being passed onto it's respective handler.
Types ¶
type CreateValidatorMessage ¶
type CreateValidatorMessage struct {
// contains filtered or unexported fields
}
CreateValidatorMessage applies a WhiteList Filtering for Standing Member Creation
func NewCreateValidatorMessage ¶
func NewCreateValidatorMessage(sk vestingtypes.StakingKeeper, cdc codec.BinaryCodec, pk permissionsmodulekeeper.Keeper) CreateValidatorMessage
NewCreateValidatorMessage creates a new CreateValidatorMessage
func (CreateValidatorMessage) AnteHandle ¶
func (sd CreateValidatorMessage) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)
AnteHandle checks if the tx contains a staking delegation. It errors if the coins are still locked or the bond amount is greater than the coins already vested
type EthVestingTransactionDecorator ¶
type EthVestingTransactionDecorator struct {
// contains filtered or unexported fields
}
EthVestingTransactionDecorator validates if clawback vesting accounts are permitted to perform Ethereum Tx.
func NewEthVestingTransactionDecorator ¶
func NewEthVestingTransactionDecorator(ak evmtypes.AccountKeeper) EthVestingTransactionDecorator
func (EthVestingTransactionDecorator) AnteHandle ¶
func (vtd EthVestingTransactionDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)
AnteHandle validates that a clawback vesting account has surpassed the vesting cliff and lockup period.
This AnteHandler decorator will fail if:
- the message is not a MsgEthereumTx
- sender account cannot be found
- sender account is not a ClawbackvestingAccount
- blocktime is before surpassing vesting cliff end (with zero vested coins) AND
- blocktime is before surpassing all lockup periods (with non-zero locked coins)
type EvmKeeper ¶
type EvmKeeper interface { GetParams(ctx sdk.Context) (params evmtypes.Params) ChainID() *big.Int GetBaseFee(ctx sdk.Context, ethCfg *params.ChainConfig) *big.Int }
EvmKeeper defines the expected keeper interface used on the AnteHandler
type GovernanceSubmitProposalMessage ¶
type GovernanceSubmitProposalMessage struct {
// contains filtered or unexported fields
}
func NewGovernanceSubmitProposalMessage ¶
func NewGovernanceSubmitProposalMessage(cdc codec.BinaryCodec, pk permissionsmodulekeeper.Keeper, gk govkeeper.Keeper) GovernanceSubmitProposalMessage
func (GovernanceSubmitProposalMessage) AnteHandle ¶
type HandlerOptions ¶
type HandlerOptions struct { GovKeeper govkeeper.Keeper PermissionsKeeper permissionskeeper.Keeper AccountKeeper evmtypes.AccountKeeper BankKeeper evmtypes.BankKeeper IBCKeeper *ibckeeper.Keeper FeeMarketKeeper evmtypes.FeeMarketKeeper StakingKeeper vestingtypes.StakingKeeper EvmKeeper ethante.EVMKeeper FeegrantKeeper ante.FeegrantKeeper SignModeHandler authsigning.SignModeHandler SigGasConsumer func(meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params) error Cdc codec.BinaryCodec MaxTxGasWanted uint64 }
HandlerOptions defines the list of module keepers required to run the Reapchain AnteHandler decorators.
func (HandlerOptions) Validate ¶
func (options HandlerOptions) Validate() error
Validate checks if the keepers are defined
type MinCommissionDecorator ¶
type MinCommissionDecorator struct {
// contains filtered or unexported fields
}
MinCommissionDecorator was originally included in the Juno project at github.com/CosmosContracts/juno/app/sdkante.go This version was added to Juno by github user the-frey https://github.com/the-frey and Giancarlos Salas https://github.com/giansalex The Juno project obtained their initial version of this decorator from github.com/public-awesome/stargaze with original author Jorge Hernandez https://github.com/jhernandezb
func NewMinCommissionDecorator ¶
func NewMinCommissionDecorator(cdc codec.BinaryCodec) MinCommissionDecorator
func (MinCommissionDecorator) AnteHandle ¶
type StakingDelegationMessage ¶
type StakingDelegationMessage struct {
// contains filtered or unexported fields
}
func NewStakingDelegationMessage ¶
func NewStakingDelegationMessage(sk vestingtypes.StakingKeeper, cdc codec.BinaryCodec, pk permissionsmodulekeeper.Keeper) StakingDelegationMessage
func (StakingDelegationMessage) AnteHandle ¶
type ValidatorCommissionDecorator ¶
type ValidatorCommissionDecorator struct {
// contains filtered or unexported fields
}
ValidatorCommissionDecorator validates that the validator commission is always greater or equal than the min commission rate
func NewValidatorCommissionDecorator ¶
func NewValidatorCommissionDecorator(cdc codec.BinaryCodec) ValidatorCommissionDecorator
NewValidatorCommissionDecorator creates a new NewValidatorCommissionDecorator
func (ValidatorCommissionDecorator) AnteHandle ¶
func (vcd ValidatorCommissionDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)
AnteHandle checks if the tx contains a staking create validator or edit validator. It errors if the the commission rate is below the min threshold.
type VestingDelegationDecorator ¶
type VestingDelegationDecorator struct {
// contains filtered or unexported fields
}
VestingDelegationDecorator validates delegation of vested coins
func NewVestingDelegationDecorator ¶
func NewVestingDelegationDecorator(ak evmtypes.AccountKeeper, bk evmtypes.BankKeeper, sk vestingtypes.StakingKeeper, cdc codec.BinaryCodec) VestingDelegationDecorator
NewVestingDelegationDecorator creates a new VestingDelegationDecorator
func (VestingDelegationDecorator) AnteHandle ¶
func (vdd VestingDelegationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)
AnteHandle checks if the tx contains a staking delegation. It errors if the coins are still locked or the bond amount is greater than the coins already vested