Documentation ¶
Index ¶
- Constants
- type DefaultLane
- func (l *DefaultLane) GetIgnoreList() []blockbuster.Lane
- func (l *DefaultLane) GetMaxBlockSpace() sdk.Dec
- func (l *DefaultLane) Logger() log.Logger
- func (l *DefaultLane) Match(tx sdk.Tx) bool
- func (l *DefaultLane) Name() string
- func (l *DefaultLane) PrepareLane(ctx sdk.Context, proposal blockbuster.BlockProposal, maxTxBytes int64, ...) (blockbuster.BlockProposal, error)
- func (l *DefaultLane) ProcessLane(ctx sdk.Context, txs []sdk.Tx, next blockbuster.ProcessLanesHandler) (sdk.Context, error)
- func (l *DefaultLane) ProcessLaneBasic(txs []sdk.Tx) error
- func (l *DefaultLane) SetAnteHandler(anteHandler sdk.AnteHandler)
- func (l *DefaultLane) VerifyTx(ctx sdk.Context, tx sdk.Tx) error
- type DefaultMempool
- func (am *DefaultMempool) Contains(tx sdk.Tx) (bool, error)
- func (am *DefaultMempool) CountTx() int
- func (am *DefaultMempool) Insert(ctx context.Context, tx sdk.Tx) error
- func (am *DefaultMempool) Remove(tx sdk.Tx) error
- func (am *DefaultMempool) Select(ctx context.Context, txs [][]byte) sdkmempool.Iterator
- type Mempool
Constants ¶
const (
// LaneName defines the name of the default lane.
LaneName = "default"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultLane ¶
type DefaultLane struct { // Mempool defines the mempool for the lane. Mempool // LaneConfig defines the base lane configuration. Cfg blockbuster.BaseLaneConfig }
DefaultLane defines a default lane implementation. The default lane orders transactions by the sdk.Context priority. The default lane will accept any transaction that is not a part of the lane's IgnoreList. By default, the IgnoreList is empty and the default lane will accept any transaction. The default lane on its own implements the same functionality as the pre v0.47.0 tendermint mempool and proposal handlers.
func NewDefaultLane ¶
func NewDefaultLane(cfg blockbuster.BaseLaneConfig) *DefaultLane
NewDefaultLane returns a new default lane.
func (*DefaultLane) GetIgnoreList ¶
func (l *DefaultLane) GetIgnoreList() []blockbuster.Lane
GetIgnoreList returns the lane's ignore list.
func (*DefaultLane) GetMaxBlockSpace ¶
func (l *DefaultLane) GetMaxBlockSpace() sdk.Dec
GetMaxBlockSpace returns the maximum block space for the lane as a relative percentage.
func (*DefaultLane) Logger ¶
func (l *DefaultLane) Logger() log.Logger
Logger returns the lane's logger.
func (*DefaultLane) Match ¶
func (l *DefaultLane) Match(tx sdk.Tx) bool
Match returns true if the transaction belongs to this lane. Since this is the default lane, it always returns true except for transactions that belong to lanes in the ignore list.
func (*DefaultLane) PrepareLane ¶
func (l *DefaultLane) PrepareLane( ctx sdk.Context, proposal blockbuster.BlockProposal, maxTxBytes int64, next blockbuster.PrepareLanesHandler, ) (blockbuster.BlockProposal, error)
PrepareLane will prepare a partial proposal for the default lane. It will select and include all valid transactions in the mempool that are not already in the partial proposal. The default lane orders transactions by the sdk.Context priority.
func (*DefaultLane) ProcessLane ¶
func (l *DefaultLane) ProcessLane(ctx sdk.Context, txs []sdk.Tx, next blockbuster.ProcessLanesHandler) (sdk.Context, error)
ProcessLane verifies the default lane's portion of a block proposal. Since the default lane's ProcessLaneBasic function ensures that all of the default transactions are in the correct order, we only need to verify the contiguous set of transactions that match to the default lane.
func (*DefaultLane) ProcessLaneBasic ¶
func (l *DefaultLane) ProcessLaneBasic(txs []sdk.Tx) error
transactions that belong to this lane are not misplaced in the block proposal i.e. the proposal only contains contiguous transactions that belong to this lane - there can be no interleaving of transactions from other lanes.
func (*DefaultLane) SetAnteHandler ¶
func (l *DefaultLane) SetAnteHandler(anteHandler sdk.AnteHandler)
SetAnteHandler sets the lane's antehandler.
type DefaultMempool ¶
type DefaultMempool struct {
// contains filtered or unexported fields
}
DefaultMempool defines the most basic 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 transactions.
func NewDefaultMempool ¶
func NewDefaultMempool(txEncoder sdk.TxEncoder) *DefaultMempool
NewDefaultMempool returns a new default mempool instance. The default mempool orders transactions by the sdk.Context priority.
func (*DefaultMempool) Contains ¶
func (am *DefaultMempool) Contains(tx sdk.Tx) (bool, error)
Contains returns true if the transaction is contained in the mempool.
func (*DefaultMempool) CountTx ¶
func (am *DefaultMempool) CountTx() int
func (*DefaultMempool) Insert ¶
Insert inserts a transaction into the mempool based on the transaction type (normal or keyshare).
func (*DefaultMempool) Remove ¶
func (am *DefaultMempool) Remove(tx sdk.Tx) error
Remove removes a transaction from the mempool based on the transaction type (normal or keyshare).
func (*DefaultMempool) Select ¶
func (am *DefaultMempool) Select(ctx context.Context, txs [][]byte) sdkmempool.Iterator