ante

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MaxOracleMsgGasUsage = uint64(100000)

MaxOracleMsgGasUsage is constant expected oracle msg gas cost

Variables

This section is empty.

Functions

func NewAnteHandler

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)

NewAnteHandler returns an AnteHandler that checks and increments sequence numbers, checks signatures & account numbers, and deducts fees from the first signer.

Types

type HandlerOptions

type HandlerOptions struct {
	AccountKeeper   cosmosante.AccountKeeper
	BankKeeper      types.BankKeeper
	FeegrantKeeper  cosmosante.FeegrantKeeper
	OracleKeeper    OracleKeeper
	SignModeHandler signing.SignModeHandler
	SigGasConsumer  cosmosante.SignatureVerificationGasConsumer
}

type MempoolFeeDecorator

type MempoolFeeDecorator struct{}

MempoolFeeDecorator will check if the transaction's fee is at least as large as the local validator's minimum gasFee (defined in validator config). If fee is too low, decorator returns error and tx is rejected from mempool. Note this only applies when ctx.CheckTx = true If fee is high enough or not CheckTx, then call next AnteHandler CONTRACT: Tx must implement FeeTx to use MempoolFeeDecorator

func NewMempoolFeeDecorator

func NewMempoolFeeDecorator() MempoolFeeDecorator

func (MempoolFeeDecorator) AnteHandle

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

type OracleKeeper

type OracleKeeper interface {
	ValidateFeeder(ctx sdk.Context, feederAddr sdk.AccAddress, validatorAddr sdk.ValAddress) error
}

OracleKeeper for feeder validation

type SpamPreventionDecorator

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

SpamPreventionDecorator will check if the transaction's gas is smaller than configured hard cap.

func NewSpamPreventionDecorator

func NewSpamPreventionDecorator(oracleKeeper OracleKeeper) *SpamPreventionDecorator

NewSpamPreventionDecorator returns new spamming prevention decorator instance

func (*SpamPreventionDecorator) AnteHandle

func (spd *SpamPreventionDecorator) AnteHandle(
	ctx sdk.Context,
	tx sdk.Tx,
	simulate bool,
	next sdk.AnteHandler,
) (newCtx sdk.Context, err error)

AnteHandle handles msg tax fee checking

func (*SpamPreventionDecorator) CheckOracleSpam

func (spd *SpamPreventionDecorator) CheckOracleSpam(ctx sdk.Context, msgs []sdk.Msg) error

CheckOracleSpam check whether the msgs are spamming on purpose or not

Jump to

Keyboard shortcuts

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