abci

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChainPrepareLanes

func ChainPrepareLanes(chain ...blockbuster.Lane) blockbuster.PrepareLanesHandler

ChainPrepareLanes chains together the proposal preparation logic from each lane into a single function. The first lane in the chain is the first lane to be prepared and the last lane in the chain is the last lane to be prepared.

In the case where any of the lanes fail to prepare the partial proposal, the lane that failed will be skipped and the next lane in the chain will be called to prepare the proposal.

func ChainProcessLanes

func ChainProcessLanes(chain ...blockbuster.Lane) blockbuster.ProcessLanesHandler

ChainProcessLanes chains together the proposal verification logic from each lane into a single function. The first lane in the chain is the first lane to be verified and the last lane in the chain is the last lane to be verified.

Types

type BaseApp

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

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

type CheckTxHandler

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

CheckTxHandler is a wrapper around baseapp's CheckTx method that allows us to verify aggregated keyshare 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 keyshare transaction.

func NewCheckTxHandler

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

NewCheckTxHandler is a constructor for CheckTxHandler.

func (*CheckTxHandler) CheckTx

func (handler *CheckTxHandler) CheckTx() CheckTx

CheckTxHandler is a wrapper around baseapp's CheckTx method that allows us to verify keyshare transactions against the latest committed state. All other transactions are executed normally. No state changes are applied to the state during this process.

func (*CheckTxHandler) GetContextForKeyshareTx

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

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

func (*CheckTxHandler) ValidateKeyshareTx

func (handler *CheckTxHandler) ValidateKeyshareTx(ctx sdk.Context, ksTx sdk.Tx, ksInfo *types.AggregatedKeyShare) (sdk.GasInfo, error)

ValidateKeyshareTx is utilized to verify the keyshare transaction against the latest committed state.

type KeyShareLane

type KeyShareLane interface {
	// GetKeyShareInfo is utilized to retrieve the Keyshare info of a transaction.
	GetKeyShareInfo(tx sdk.Tx) (*types.AggregatedKeyShare, error)

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

	// Remove is utilized to delete a transaction from the application-side mempool.
	Remove(tx sdk.Tx) error
}

KeyShareLane is the interface that defines all of the dependencies that are required to interact with the top of block lane.

type ProposalHandler

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

ProposalHandler is a wrapper around the ABCI++ PrepareProposal and ProcessProposal handlers.

func NewProposalHandler

func NewProposalHandler(logger log.Logger, txDecoder sdk.TxDecoder, mempool blockbuster.Mempool) *ProposalHandler

NewProposalHandler returns a new abci++ proposal handler.

func (*ProposalHandler) PrepareProposalHandler

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

PrepareProposalHandler prepares the proposal by selecting transactions from each lane according to each lane's selection logic. We select transactions in a greedy fashion. Note that each lane has an boundary on the number of bytes that can be included in the proposal. By default, the default lane will not have a boundary on the number of bytes that can be included in the proposal and will include all valid transactions in the proposal (up to MaxTxBytes).

func (*ProposalHandler) ProcessProposalHandler

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

ProcessProposalHandler processes the proposal by verifying all transactions in the proposal according to each lane's verification logic. We verify proposals in a greedy fashion. If a lane's portion of the proposal is invalid, we reject the proposal. After a lane's portion of the proposal is verified, we pass the remaining transactions to the next lane in the chain.

Jump to

Keyboard shortcuts

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