Documentation ΒΆ
Index ΒΆ
- Constants
- func GetDecodedTxs(txDecoder sdk.TxDecoder, txs [][]byte) ([]sdk.Tx, error)
- func GetMaxTxBytesForLane(maxTxBytes, totalTxBytes int64, ratio sdkmath.LegacyDec) int64
- func GetSubmitDecryptionKeyMsgFromTx(tx sdk.Tx) (*peptypes.MsgSubmitDecryptionKey, error)
- func GetTxHashStr(txEncoder sdk.TxEncoder, tx sdk.Tx) ([]byte, string, error)
- func RemoveTxsFromLane(txs map[sdk.Tx]struct{}, mempool sdkmempool.Mempool) error
- func TxPriority(config Factory) base.TxPriority[string]
- type DefaultKeyshareFactory
- func (config *DefaultKeyshareFactory) GetDecryptionKeyInfo(tx sdk.Tx) (*peptypes.DecryptionKey, error)
- func (config *DefaultKeyshareFactory) GetTimeoutHeight(tx sdk.Tx) (uint64, error)
- func (config *DefaultKeyshareFactory) IsKeyshareTx(tx sdk.Tx) bool
- func (config *DefaultKeyshareFactory) MatchHandler() base.MatchHandler
- type Factory
- type KeyshareLane
- type ProposalHandler
- type TxWithTimeoutHeight
Constants ΒΆ
const (
// LaneName defines the name of the keyshare lane.
LaneName = "keyshare"
)
Variables ΒΆ
This section is empty.
Functions ΒΆ
func GetDecodedTxs ΒΆ
GetDecodedTxs returns the decoded transactions from the given bytes.
func GetMaxTxBytesForLane ΒΆ
GetMaxTxBytesForLane returns the maximum number of bytes that can be included in the proposal for the given lane.
func GetSubmitDecryptionKeyMsgFromTx ΒΆ added in v0.10.0
func GetSubmitDecryptionKeyMsgFromTx(tx sdk.Tx) (*peptypes.MsgSubmitDecryptionKey, error)
func GetTxHashStr ΒΆ
GetTxHashStr returns the hex-encoded hash of the transaction alongside the transaction bytes.
func RemoveTxsFromLane ΒΆ
func RemoveTxsFromLane(txs map[sdk.Tx]struct{}, mempool sdkmempool.Mempool) error
RemoveTxsFromLane removes the transactions from the given lane's mempool.
func TxPriority ΒΆ
func TxPriority(config Factory) base.TxPriority[string]
TxPriority returns a TxPriority over Keyshare transactions only. It is to be used in the Keyshare index only.
Types ΒΆ
type DefaultKeyshareFactory ΒΆ
type DefaultKeyshareFactory struct {
// contains filtered or unexported fields
}
DefaultKeyshareFactory defines a default implmentation for the keyshare factory interface for processing keyshare transactions.
func (*DefaultKeyshareFactory) GetDecryptionKeyInfo ΒΆ added in v0.10.0
func (config *DefaultKeyshareFactory) GetDecryptionKeyInfo(tx sdk.Tx) (*peptypes.DecryptionKey, error)
func (*DefaultKeyshareFactory) GetTimeoutHeight ΒΆ
func (config *DefaultKeyshareFactory) GetTimeoutHeight(tx sdk.Tx) (uint64, error)
GetTimeoutHeight returns the timeout height of the transaction.
func (*DefaultKeyshareFactory) IsKeyshareTx ΒΆ
func (config *DefaultKeyshareFactory) IsKeyshareTx(tx sdk.Tx) bool
func (*DefaultKeyshareFactory) MatchHandler ΒΆ
func (config *DefaultKeyshareFactory) MatchHandler() base.MatchHandler
MatchHandler defines a default function that checks if a transaction matches the keyshare lane.
type Factory ΒΆ
type Factory interface { sdk.Tx) bool // GetDecryptionKeyInfo defines a function that returns the Keyshare info from the Tx GetDecryptionKeyInfo(tx sdk.Tx) (*peptypes.DecryptionKey, error) // MatchHandler defines a function that checks if a transaction matches the keyshare lane. MatchHandler() base.MatchHandler }IsKeyshareTx(tx
Factory defines the interface for processing Keyshare transactions. It is a wrapper around all of the functionality that each application chain must implement in order for keyshare processing to work.
func NewDefaultKeyshareFactory ΒΆ
func NewDefaultKeyshareFactory(txDecoder sdk.TxDecoder, extractor signer_extraction.Adapter) Factory
NewDefaultKeyshareFactory returns a default keyshare factory interface implementation.
type KeyshareLane ΒΆ added in v0.10.0
type KeyshareLane struct { // if a transaction is a Keyshare transaction and how to extract relevant // information from the transaction (creator Address). Factory }
KeyshareLane defines the lane that is responsible for processing Keyshare transactions.
func NewKeyshareLane ΒΆ added in v0.10.0
func NewKeyshareLane( cfg base.LaneConfig, factory Factory, matchHandler base.MatchHandler, ) *KeyshareLane
NewKeyshareLane returns a new Keyshare lane.
type ProposalHandler ΒΆ
type ProposalHandler struct {
// contains filtered or unexported fields
}
Implements the Keyshare lane's PrepareLaneHandler and ProcessLaneHandler.
func NewProposalHandler ΒΆ
func NewProposalHandler(lane *base.BaseLane, factory Factory) *ProposalHandler
NewProposalHandler returns a new keyshare proposal handler.
func (*ProposalHandler) PrepareLaneHandler ΒΆ
func (h *ProposalHandler) PrepareLaneHandler() base.PrepareLaneHandler
PrepareLaneHandler will attempt to select the keyshare transactions that are valid and include them in the proposal. It will return an empty partial proposal if no valid keyshare transactions are found.
func (*ProposalHandler) ProcessLaneHandler ΒΆ
func (h *ProposalHandler) ProcessLaneHandler() base.ProcessLaneHandler
ProcessLaneHandler ensures that if keyshare transactions are present in a proposal,
- they are the first transaction in the partial proposal
- there are no other keyshare transactions in the proposal
- block proposals that include transactions from the keyshare lane are valid
type TxWithTimeoutHeight ΒΆ
TxWithTimeoutHeight is used to extract timeouts from sdk.Tx transactions. In the case where, timeouts are explicitly set on the sdk.Tx, we can use this interface to extract the timeout.