Documentation
¶
Index ¶
- Constants
- Variables
- func IsDumpTxsInQueue() bool
- func IsMessageTurbo(chainConf protocol.ChainConf) bool
- func IsMetrics() bool
- func IsTxTimeVerify(chainConf protocol.ChainConf) bool
- func MaxCommonTxPoolSize() int
- func MaxConfigTxPoolSize() int
- func MaxTxCount(chainConf protocol.ChainConf) int
- func MaxTxTimeTimeout(chainConf protocol.ChainConf) float64
- func NewNormalPool(nodeId string, chainId string, txFilter protocol.TxFilter, ...) (protocol.TxPool, error)
- func QueryUpperLimit() int
- type Dispatcher
- type LogHelper
- type ReBroadcastConfig
- type TxPoolReBroadcast
Constants ¶
const TxPoolType = "NORMAL"
TxPoolType is tx_pool type
Variables ¶
var ( // TxPoolConfig is tx_pool global configuration TxPoolConfig *txPoolConfig // MonitorEnabled indicates whether monitoring is enabled MonitorEnabled bool )
Functions ¶
func IsDumpTxsInQueue ¶
func IsDumpTxsInQueue() bool
IsDumpTxsInQueue Whether to dump config and common transaction in queue
func IsMessageTurbo ¶
IsMessageTurbo Whether block clipping
func IsTxTimeVerify ¶
IsTxTimeVerify Whether transaction timestamp is verified
func MaxCommonTxPoolSize ¶
func MaxCommonTxPoolSize() int
MaxCommonTxPoolSize Maximum number of common transaction in the pool
func MaxConfigTxPoolSize ¶
func MaxConfigTxPoolSize() int
MaxConfigTxPoolSize The maximum number of configure transaction in the pool
func MaxTxCount ¶
MaxTxCount Maximum number of transactions in a block
func MaxTxTimeTimeout ¶
MaxTxTimeTimeout return maximum timeout for a transaction
func NewNormalPool ¶
func NewNormalPool( nodeId string, chainId string, txFilter protocol.TxFilter, chainStore protocol.BlockchainStore, msgBus msgbus.MessageBus, chainConf protocol.ChainConf, singer protocol.SigningMember, ac protocol.AccessControlProvider, netService protocol.NetService, log protocol.Logger, monitorEnabled bool, poolConfig map[string]interface{}) (protocol.TxPool, error)
NewNormalPool create normal tx pool normalPool
Types ¶
type Dispatcher ¶
type Dispatcher interface {
// DistTx distribute a tx to a specific common queues
DistTx(txId string, queueNum int) int
// DistTxs distribute txs to different common queues
DistTxs(txs []*commonPb.Transaction, queueNum int) (txsTable [][]*commonPb.Transaction)
// DistTxsToMemTxs distribute txs to different common queues and generate mtxsTable
DistTxsToMemTxs(txs []*commonPb.Transaction, queueNum int, height uint64) (mtxsTable [][]*memTx)
// DistTxIds distribute txIds to different common queues
DistTxIds(txIds []string, queueNum int) (txIdsTable [][]string)
}
Dispatcher is used to distribute transaction to different common queues
type LogHelper ¶ added in v2.3.2
type LogHelper struct {
// contains filtered or unexported fields
}
LogHelper Auxiliary printing
type ReBroadcastConfig ¶ added in v2.4.0
type ReBroadcastConfig struct {
// TxPoolSyncEnable enable tx pool sync or not for common node
TxPoolSyncEnable bool `mapstructure:"tx_pool_sync_enable"`
// TxPoolStatusTick trigger tick of sync tx pool
TxPoolStatusTick float64 `mapstructure:"tx_pool_status_tick"`
// TxPoolSyncProportion trigger proportion of sync tx pool
TxPoolSyncProportion float64 `mapstructure:"tx_pool_sync_proportion"`
}
ReBroadcastConfig common node tx pool secondary broadcast to prevent stranded txs in common tx pool
type TxPoolReBroadcast ¶ added in v2.4.0
type TxPoolReBroadcast struct {
// contains filtered or unexported fields
}
TxPoolReBroadcast inner config
func NewTxPoolReBroadcast ¶ added in v2.4.0
func NewTxPoolReBroadcast(reBroadcastConfig ReBroadcastConfig, netService protocol.NetService) *TxPoolReBroadcast
NewTxPoolReBroadcast new rebroadcast struct
Source Files
¶
- log_helper.go
- mocks.go
- normal_tx_batch_builder.go
- normal_tx_dispatcher.go
- normal_tx_pool.go
- normal_tx_queue.go
- normal_tx_recover.go
- pool_config.go
- tx_list.go
- tx_pool_rebroadcast.go
- tx_validator.go
- types.go
- utils.go