checktx

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseApp

type BaseApp interface {
	// CommitMultiStore is utilized to retrieve the latest committed state.
	CommitMultiStore() storetypes.CommitMultiStore

	// Logger is utilized to log errors.
	Logger() log.Logger

	// LastBlockHeight is utilized to retrieve the latest block height.
	LastBlockHeight() int64

	// GetConsensusParams is utilized to retrieve the consensus params.
	GetConsensusParams(ctx sdk.Context) *cmtproto.ConsensusParams
}

BaseApp is an interface that allows us to call baseapp's CheckTx method as well as retrieve the latest committed state.

type CheckTx

CheckTx is baseapp's CheckTx method that checks the validity of a transaction.

type MEVCheckTxHandler

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

MevCheckTxHandler is a wrapper around baseapp's CheckTx method that allows us to verify bid transactions against the latest committed state. All other transactions are executed normally using base app's CheckTx. This defines all of the dependencies that are required to verify a bid transaction.

func NewMEVCheckTxHandler

func NewMEVCheckTxHandler(
	baseApp BaseApp,
	txDecoder sdk.TxDecoder,
	mevLane MEVLaneI,
	anteHandler sdk.AnteHandler,
	checkTxHandler CheckTx,
	chainID string,
) *MEVCheckTxHandler

NewCheckTxHandler constructs a new CheckTxHandler instance. This method fails if the given LanedMempool does not have a lane adhering to the MevLaneI interface

func (*MEVCheckTxHandler) CheckTx

func (handler *MEVCheckTxHandler) CheckTx() CheckTx

CheckTxHandler is a wrapper around baseapp's CheckTx method that allows us to verify bid transactions against the latest committed state. All other transactions are executed normally. We must verify each bid tx and all of its bundled transactions before we can insert it into the mempool against the latest commit state because otherwise the auction can be griefed. No state changes are applied to the state during this process.

func (*MEVCheckTxHandler) GetContextForBidTx

func (handler *MEVCheckTxHandler) GetContextForBidTx(req cometabci.RequestCheckTx) sdk.Context

GetContextForBidTx is returns the latest committed state and sets the context given the checkTx request.

func (*MEVCheckTxHandler) ValidateBidTx

func (handler *MEVCheckTxHandler) ValidateBidTx(ctx sdk.Context, bidTx sdk.Tx, bidInfo *types.BidInfo) (sdk.GasInfo, error)

ValidateBidTx is utilized to verify the bid transaction against the latest committed state.

type MEVLaneI

type MEVLaneI interface {
	block.Lane
	mevlane.Factory
	GetTopAuctionTx(ctx context.Context) sdk.Tx
}

MEVLaneI defines the interface for the mev auction lane. This interface is utilized by both the x/auction module and the checkTx handler.

type MempoolParityCheckTx

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

MempoolParityCheckTx is a CheckTx function that evicts txs that are not in the app-side mempool on ReCheckTx. This handler is used to enforce parity in the app-side / comet mempools.

func NewMempoolParityCheckTx

func NewMempoolParityCheckTx(logger log.Logger, mempl block.Mempool, txDecoder sdk.TxDecoder, checkTxHandler CheckTx) MempoolParityCheckTx

NewMempoolParityCheckTx returns a new MempoolParityCheckTx handler.

func (MempoolParityCheckTx) CheckTx

func (m MempoolParityCheckTx) CheckTx() CheckTx

CheckTx returns a CheckTx handler that wraps a given CheckTx handler and evicts txs that are not in the app-side mempool on ReCheckTx.

Jump to

Keyboard shortcuts

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