ante

package
v2.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const MaxOracleMsgGasUsage = uint64(100000)

MaxOracleMsgGasUsage defines the maximum gas allowed for an oracle transaction.

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 defines a custom Umee AnteHandler decorator that is responsible for allowing oracle transactions from oracle feeders to bypass the minimum fee CheckTx check. However, if an oracle transaction's gas limit is beyond the accepted threshold, the minimum fee check is still applied.

For non-oracle transactions, the minimum fee check is applied.

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 defines a custom Umee AnteHandler decorator that is responsible for preventing oracle message spam. Specifically, it prohibits oracle feeders from submitting multiple oracle messages in a single block.

func NewSpamPreventionDecorator

func NewSpamPreventionDecorator(oracleKeeper OracleKeeper) *SpamPreventionDecorator

func (*SpamPreventionDecorator) AnteHandle

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

func (*SpamPreventionDecorator) CheckOracleSpam

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

CheckOracleSpam performs the check of whether or not we've seen an oracle message from an oracle feeder in the current block or not. If we have, we return an error which prohibits the transaction from being processed.

Jump to

Keyboard shortcuts

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