Documentation ¶
Index ¶
- Constants
- func GetAggregateKeyshareMsgFromTx(tx sdk.Tx) (*types.MsgCreateAggregatedKeyShare, error)
- func TxPriority(config Factory) blockbuster.TxPriority[string]
- type DefaultKeyshareFactory
- type Factory
- type KeyShareLane
- func (l *KeyShareLane) Match(tx sdk.Tx) bool
- func (l *KeyShareLane) Name() string
- func (l *KeyShareLane) PrepareLane(ctx sdk.Context, proposal blockbuster.BlockProposal, maxTxBytes int64, ...) (blockbuster.BlockProposal, error)
- func (l *KeyShareLane) ProcessLane(ctx sdk.Context, txs []sdk.Tx, next blockbuster.ProcessLanesHandler) (sdk.Context, error)
- func (l *KeyShareLane) ProcessLaneBasic(txs []sdk.Tx) error
- func (l *KeyShareLane) VerifyTx(ctx sdk.Context, keyshareTx sdk.Tx) error
- type KeyShareMempool
- func (am *KeyShareMempool) Contains(tx sdk.Tx) (bool, error)
- func (am *KeyShareMempool) CountTx() int
- func (am *KeyShareMempool) Insert(ctx context.Context, tx sdk.Tx) error
- func (am *KeyShareMempool) Remove(tx sdk.Tx) error
- func (am *KeyShareMempool) Select(ctx context.Context, txs [][]byte) sdkmempool.Iterator
- type Mempool
- type TxWithTimeoutHeight
Constants ¶
const (
// LaneName defines the name of the free lane.
LaneName = "keyshare"
)
Variables ¶
This section is empty.
Functions ¶
func GetAggregateKeyshareMsgFromTx ¶
func GetAggregateKeyshareMsgFromTx(tx sdk.Tx) (*types.MsgCreateAggregatedKeyShare, error)
func TxPriority ¶
func TxPriority(config Factory) blockbuster.TxPriority[string]
TxPriority returns a TxPriority over AggregatedKeyShare transactions only. It is to be used in the AggregatedKeyShare 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 aggregate keyshare transactions.
func (*DefaultKeyshareFactory) GetKeyShareInfo ¶
func (config *DefaultKeyshareFactory) GetKeyShareInfo(tx sdk.Tx) (*types.AggregatedKeyShare, error)
func (*DefaultKeyshareFactory) IsKeyshareTx ¶
func (config *DefaultKeyshareFactory) IsKeyshareTx(tx sdk.Tx) bool
type Factory ¶
type Factory interface { sdk.Tx) bool GetKeyShareInfo(tx sdk.Tx) (*types.AggregatedKeyShare, error) }IsKeyshareTx(tx
Factory defines the interface for processing AggregateKeyShare transactions. It is a wrapper around all of the functionality that each application chain must implement in order for Aggregated keyshare processing to work.
func NewDefaultKeyshareFactory ¶
NewDefaultKeyshareFactory returns a default keyshare factory interface implementation.
type KeyShareLane ¶
type KeyShareLane struct { Mempool *base.DefaultLane // if a transaction is a aggregateKeyshare transaction and how to extract relevant // information from the transaction (creator Address). Factory }
KeyShareLane defines the lane that is responsible for processing AggregateKeyShare transactions.
func NewKeyShareLane ¶
func NewKeyShareLane( cfg blockbuster.BaseLaneConfig, maxTx int, af Factory, ) *KeyShareLane
NewKeyShareLane returns a new KeyShare lane.
func (*KeyShareLane) Match ¶
func (l *KeyShareLane) Match(tx sdk.Tx) bool
Match returns true if the transaction is a aated keyshareggreg transaction. This is determined by the KeyShareFactory.
func (*KeyShareLane) PrepareLane ¶
func (l *KeyShareLane) PrepareLane( ctx sdk.Context, proposal blockbuster.BlockProposal, maxTxBytes int64, next blockbuster.PrepareLanesHandler, ) (blockbuster.BlockProposal, error)
PrepareLane 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 (*KeyShareLane) ProcessLane ¶
func (l *KeyShareLane) ProcessLane(ctx sdk.Context, txs []sdk.Tx, next blockbuster.ProcessLanesHandler) (sdk.Context, error)
ProcessLane will ensure that block proposals that include transactions from the keyshare lane are valid.
func (*KeyShareLane) ProcessLaneBasic ¶
func (l *KeyShareLane) ProcessLaneBasic(txs []sdk.Tx) error
ProcessLaneBasic ensures that if keyshare transactions are present in a proposal,
- they are the first transaction in the partial proposal
- there are no other aggregate keyshare transactions in the proposal
type KeyShareMempool ¶
type KeyShareMempool struct { Factory // contains filtered or unexported fields }
KeyShareMempool defines an KeyShare mempool. It can be seen as an extension of an SDK PriorityNonceMempool, i.e. a mempool that supports <sender, nonce> two-dimensional priority ordering, with the additional support of prioritizing and indexing submitted aggregated keyshares.
func NewMempool ¶
func NewMempool(txEncoder sdk.TxEncoder, maxTx int, config Factory) *KeyShareMempool
NewMempool returns a new AggregateKeyShare mempool.
func (*KeyShareMempool) Contains ¶
func (am *KeyShareMempool) Contains(tx sdk.Tx) (bool, error)
Contains returns true if the transaction is contained in the mempool.
func (*KeyShareMempool) CountTx ¶
func (am *KeyShareMempool) CountTx() int
func (*KeyShareMempool) Remove ¶
func (am *KeyShareMempool) Remove(tx sdk.Tx) error
Remove removes a transaction from the mempool based.
func (*KeyShareMempool) Select ¶
func (am *KeyShareMempool) Select(ctx context.Context, txs [][]byte) sdkmempool.Iterator
type Mempool ¶
type Mempool interface { sdkmempool.Mempool // Contains returns true if the transaction is contained in the mempool. Contains(tx sdk.Tx) (bool, error) }
Mempool defines the interface of the keyshare mempool.
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.