Documentation ¶
Index ¶
- type BaseApp
- type CheckTx
- type KeyshareCheckTxHandler
- func (handler *KeyshareCheckTxHandler) CheckTx() CheckTx
- func (handler *KeyshareCheckTxHandler) GetContextForKeyshareTx(req *cometabci.RequestCheckTx) sdk.Context
- func (handler *KeyshareCheckTxHandler) ValidateKeyshareTx(ctx sdk.Context, ksTx sdk.Tx, ksInfo *peptypes.DecryptionKey) (sdk.GasInfo, error)
- type KeyshareLaneI
- type MempoolParityCheckTx
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 ¶
type CheckTx func(req *cometabci.RequestCheckTx) (*cometabci.ResponseCheckTx, error)
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 { sdk.Tx) (*peptypes.DecryptionKey, error) Insert(ctx context.Context, tx sdk.Tx) error Remove(tx sdk.Tx) error }GetDecryptionKeyInfo(tx
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.