ante

package
v0.0.0-...-69704c5 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAnteHandler

func NewAnteHandler(ak auth.AccountKeeper, evmKeeper EVMKeeper, sk types.SupplyKeeper, validateMsgHandler ValidateMsgHandler, option wasmkeeper.HandlerOption, ibcChannelKeepr *ibc.Keeper, s staking.Keeper) 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 AccountAnteDecorator

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

func NewAccountAnteDecorator

func NewAccountAnteDecorator(ak auth.AccountKeeper, ek EVMKeeper, sk types.SupplyKeeper) AccountAnteDecorator

NewAccountVerificationDecorator creates a new AccountVerificationDecorator

func (AccountAnteDecorator) AnteHandle

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

type AccountBlockedVerificationDecorator

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

AccountBlockedVerificationDecorator check whether signer is blocked.

func NewAccountBlockedVerificationDecorator

func NewAccountBlockedVerificationDecorator(evmKeeper EVMKeeper) AccountBlockedVerificationDecorator

NewAccountBlockedVerificationDecorator creates a new AccountBlockedVerificationDecorator instance

func (AccountBlockedVerificationDecorator) AnteHandle

func (abvd AccountBlockedVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)

AnteHandle check wether signer of tx(contains cosmos-tx and eth-tx) is blocked.

type AccountVerificationDecorator

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

AccountVerificationDecorator validates an account balance checks

func NewAccountVerificationDecorator

func NewAccountVerificationDecorator(ak auth.AccountKeeper, ek EVMKeeper) AccountVerificationDecorator

NewAccountVerificationDecorator creates a new AccountVerificationDecorator

func (AccountVerificationDecorator) AnteHandle

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

AnteHandle validates the signature and returns sender address

type EVMKeeper

type EVMKeeper interface {
	innertx.InnerTxKeeper
	GetParams(ctx sdk.Context) evmtypes.Params
	IsAddressBlocked(ctx sdk.Context, addr sdk.AccAddress) bool
}

EVMKeeper defines the expected keeper interface used on the Eth AnteHandler

type EthGasConsumeDecorator

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

EthGasConsumeDecorator validates enough intrinsic gas for the transaction and gas consumption.

func NewEthGasConsumeDecorator

func NewEthGasConsumeDecorator(ak auth.AccountKeeper, sk types.SupplyKeeper, ek EVMKeeper) EthGasConsumeDecorator

NewEthGasConsumeDecorator creates a new EthGasConsumeDecorator

func (EthGasConsumeDecorator) AnteHandle

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

AnteHandle validates that the Ethereum tx message has enough to cover intrinsic gas (during CheckTx only) and that the sender has enough balance to pay for the gas cost.

Intrinsic gas for a transaction is the amount of gas that the transaction uses before the transaction is executed. The gas is a constant value of 21000 plus any cost inccured by additional bytes of data supplied with the transaction.

type EthMempoolFeeDecorator

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

EthMempoolFeeDecorator validates that sufficient fees have been provided that meet a minimum threshold defined by the proposer (for mempool purposes during CheckTx).

func NewEthMempoolFeeDecorator

func NewEthMempoolFeeDecorator(ek EVMKeeper) EthMempoolFeeDecorator

NewEthMempoolFeeDecorator creates a new EthMempoolFeeDecorator

func (EthMempoolFeeDecorator) AnteHandle

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

AnteHandle verifies that enough fees have been provided by the Ethereum transaction that meet the minimum threshold set by the block proposer.

NOTE: This should only be run during a CheckTx mode.

type EthSetupContextDecorator

type EthSetupContextDecorator struct{}

EthSetupContextDecorator sets the infinite GasMeter in the Context and wraps the next AnteHandler with a defer clause to recover from any downstream OutOfGas panics in the AnteHandler chain to return an error with information on gas provided and gas used. CONTRACT: Must be first decorator in the chain CONTRACT: Tx must implement GasTx interface

func NewEthSetupContextDecorator

func NewEthSetupContextDecorator() EthSetupContextDecorator

NewEthSetupContextDecorator creates a new EthSetupContextDecorator

func (EthSetupContextDecorator) AnteHandle

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

AnteHandle sets the infinite gas meter to done to ignore costs in AnteHandler checks. This is undone at the EthGasConsumeDecorator, where the context is set with the ethereum tx GasLimit.

type EthSigVerificationDecorator

type EthSigVerificationDecorator struct{}

EthSigVerificationDecorator validates an ethereum signature

func NewEthSigVerificationDecorator

func NewEthSigVerificationDecorator() EthSigVerificationDecorator

NewEthSigVerificationDecorator creates a new EthSigVerificationDecorator

func (EthSigVerificationDecorator) AnteHandle

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

AnteHandle validates the signature and returns sender address

type GasLimitDecorator

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

func NewGasLimitDecorator

func NewGasLimitDecorator(evm EVMKeeper) GasLimitDecorator

NewGasLimitDecorator creates a new GasLimitDecorator.

func (GasLimitDecorator) AnteHandle

func (g GasLimitDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)

type IncrementSenderSequenceDecorator

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

IncrementSenderSequenceDecorator increments the sequence of the signers. The main difference with the SDK's IncrementSequenceDecorator is that the MsgEthereumTx doesn't implement the SigVerifiableTx interface.

CONTRACT: must be called after msg.VerifySig in order to cache the sender address.

func NewIncrementSenderSequenceDecorator

func NewIncrementSenderSequenceDecorator(ak auth.AccountKeeper) IncrementSenderSequenceDecorator

NewIncrementSenderSequenceDecorator creates a new IncrementSenderSequenceDecorator.

func (IncrementSenderSequenceDecorator) AnteHandle

func (issd IncrementSenderSequenceDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)

AnteHandle handles incrementing the sequence of the sender.

type NonceVerificationDecorator

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

NonceVerificationDecorator checks that the account nonce from the transaction matches the sender account sequence.

func NewNonceVerificationDecorator

func NewNonceVerificationDecorator(ak auth.AccountKeeper) NonceVerificationDecorator

NewNonceVerificationDecorator creates a new NonceVerificationDecorator

func (NonceVerificationDecorator) AnteHandle

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

AnteHandle validates that the transaction nonce is valid (equivalent to the sender account’s current nonce).

type ValidateMsgHandler

type ValidateMsgHandler func(ctx sdk.Context, msgs []sdk.Msg) error

type ValidateMsgHandlerDecorator

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

func NewValidateMsgHandlerDecorator

func NewValidateMsgHandlerDecorator(validateHandler ValidateMsgHandler) ValidateMsgHandlerDecorator

func (ValidateMsgHandlerDecorator) AnteHandle

func (vmhd ValidateMsgHandlerDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)

Jump to

Keyboard shortcuts

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