checktx

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

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

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

	// 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

	// ChainID is utilized to retrieve the chain ID.
	ChainID() string
}

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 KeyshareCheckTxHandler

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

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

func NewKeyshareCheckTxHandler

func NewKeyshareCheckTxHandler(
	baseApp BaseApp,
	txDecoder sdk.TxDecoder,
	keyshareLane KeyshareLaneI,
	anteHandler sdk.AnteHandler,
	checkTxHandler CheckTx,
) *KeyshareCheckTxHandler

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

func (*KeyshareCheckTxHandler) CheckTx

func (handler *KeyshareCheckTxHandler) 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 (*KeyshareCheckTxHandler) GetContextForKeyshareTx

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

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

func (*KeyshareCheckTxHandler) ValidateKeyshareTx

func (handler *KeyshareCheckTxHandler) ValidateKeyshareTx(
	ctx sdk.Context,
	ksTx sdk.Tx,
	ksInfo *peptypes.DecryptionKey,
) (sdk.GasInfo, error)

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

type KeyshareLaneI added in v0.10.0

type KeyshareLaneI interface {
	// GetDecryptionKeyInfo is utilized to retrieve the Keyshare info of a transaction.
	GetDecryptionKeyInfo(tx sdk.Tx) (*peptypes.DecryptionKey, 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
}

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

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