ante

package
v11.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2023 License: LGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Copyright 2022 Evmos Foundation This file is part of the Evmos Network packages.

Evmos is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The Evmos packages are distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the Evmos packages. If not, see https://github.com/evmos/evmos/blob/main/LICENSE

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAnteHandler

func NewAnteHandler(options HandlerOptions) 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 AuthzLimiterDecorator added in v11.0.2

type AuthzLimiterDecorator struct {
	// contains filtered or unexported fields
}

AuthzLimiterDecorator blocks certain msg types from being granted or executed within the authorization module.

func NewAuthzLimiterDecorator added in v11.0.2

func NewAuthzLimiterDecorator(disabledMsgTypes ...string) AuthzLimiterDecorator

NewAuthzLimiterDecorator creates a decorator to block certain msg types from being granted or executed within authz.

func (AuthzLimiterDecorator) AnteHandle added in v11.0.2

func (ald AuthzLimiterDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)

type EthVestingTransactionDecorator

type EthVestingTransactionDecorator struct {
	// contains filtered or unexported fields
}

EthVestingTransactionDecorator validates if clawback vesting accounts are permitted to perform Ethereum Tx.

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 HandlerOptions

type HandlerOptions struct {
	AccountKeeper          evmtypes.AccountKeeper
	BankKeeper             evmtypes.BankKeeper
	ExtensionOptionChecker ante.ExtensionOptionChecker
	IBCKeeper              *ibckeeper.Keeper
	FeeMarketKeeper        ethante.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
	TxFeeChecker           ante.TxFeeChecker
}

HandlerOptions defines the list of module keepers required to run the Evmos AnteHandler decorators.

func (HandlerOptions) Validate

func (options HandlerOptions) Validate() error

Validate checks if the keepers are defined

type VestingDelegationDecorator

type VestingDelegationDecorator struct {
	// contains filtered or unexported fields
}

VestingDelegationDecorator validates delegation of vested coins

func NewVestingDelegationDecorator

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL