Documentation ¶
Index ¶
Constants ¶
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 ¶
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 ¶
CheckOracleSpam check whether the msgs are spamming on purpose or not