abci

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: Apache-2.0 Imports: 13 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseApp added in v1.0.1

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

	// CheckTx is baseapp's CheckTx method that checks the validity of a
	// transaction.
	CheckTx(cometabci.RequestCheckTx) cometabci.ResponseCheckTx

	// 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) *tmproto.ConsensusParams
}

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

type CheckTx added in v1.0.1

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

type CheckTxHandler added in v1.0.1

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

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 using base app's CheckTx. This defines all of the dependencies that are required to verify a bid transaction.

func NewCheckTxHandler added in v1.0.1

func NewCheckTxHandler(baseApp BaseApp, txDecoder sdk.TxDecoder, mempool CheckTxMempool, anteHandler sdk.AnteHandler, chainID string) *CheckTxHandler

NewCheckTxHandler is a constructor for CheckTxHandler.

func (*CheckTxHandler) CheckTx added in v1.0.1

func (handler *CheckTxHandler) 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 (*CheckTxHandler) GetContextForBidTx added in v1.0.1

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

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

func (*CheckTxHandler) ValidateBidTx added in v1.0.1

func (handler *CheckTxHandler) ValidateBidTx(ctx sdk.Context, bidTx sdk.Tx, bidInfo *mempool.AuctionBidInfo) (sdk.GasInfo, error)

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

type CheckTxMempool added in v1.0.1

type CheckTxMempool interface {
	// GetAuctionBidInfo is utilized to retrieve the bid info of a transaction.
	GetAuctionBidInfo(tx sdk.Tx) (*mempool.AuctionBidInfo, error)

	// Insert is utilized to insert a transaction into the application-side mempool.
	Insert(ctx context.Context, tx sdk.Tx) error

	// WrapBundleTransaction is utilized to wrap a transaction included in a bid transaction
	// into an sdk.Tx.
	WrapBundleTransaction(tx []byte) (sdk.Tx, error)
}

CheckTxMempool is the interface that defines all of the dependencies that are required to interact with the application-side mempool.

type Mempool

type Mempool interface {
	sdkmempool.Mempool

	// The AuctionFactory interface is utilized to retrieve, validate, and wrap bid
	// information into the block proposal.
	mempool.AuctionFactory

	// AuctionBidSelect returns an iterator that iterates over the top bid
	// transactions in the mempool.
	AuctionBidSelect(ctx context.Context) sdkmempool.Iterator
}

type ProposalHandler

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

func NewProposalHandler

func NewProposalHandler(
	mp Mempool,
	logger log.Logger,
	anteHandler sdk.AnteHandler,
	txEncoder sdk.TxEncoder,
	txDecoder sdk.TxDecoder,
) *ProposalHandler

func (*ProposalHandler) PrepareProposalHandler

func (h *ProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHandler

PrepareProposalHandler returns the PrepareProposal ABCI handler that performs top-of-block auctioning and general block proposal construction.

func (*ProposalHandler) PrepareProposalVerifyTx

func (h *ProposalHandler) PrepareProposalVerifyTx(ctx sdk.Context, tx sdk.Tx) ([]byte, error)

PrepareProposalVerifyTx encodes a transaction and verifies it.

func (*ProposalHandler) ProcessProposalHandler

func (h *ProposalHandler) ProcessProposalHandler() sdk.ProcessProposalHandler

ProcessProposalHandler returns the ProcessProposal ABCI handler that performs block proposal verification.

func (*ProposalHandler) ProcessProposalVerifyTx

func (h *ProposalHandler) ProcessProposalVerifyTx(ctx sdk.Context, txBz []byte) (sdk.Tx, error)

ProcessProposalVerifyTx decodes a transaction and verifies it.

func (*ProposalHandler) RemoveTx

func (h *ProposalHandler) RemoveTx(tx sdk.Tx)

Jump to

Keyboard shortcuts

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