Documentation
¶
Index ¶
- Constants
- Variables
- func BatchMaxSize(chainConf protocol.ChainConf) int
- func IsDumpTxsInQueue() 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 NewBatchTxPool(nodeId string, chainId string, txFilter protocol.TxFilter, ...) (protocol.TxPool, error)
- func QueryUpperLimit() int
- type ForwardMod
- type Forwarder
- type ReBroadcastConfig
- type StageMod
- type TxBatchSourceMod
- type TxPoolReBroadcast
- type TxVerifyMod
Constants ¶
const ( // TxPoolType is tx_pool type TxPoolType = "BATCH" // BatchPoolAddtionalDataKey is the key for AddtionalData BatchPoolAddtionalDataKey = "BatchPoolAddtionalDataKey" )
Variables ¶
var ( // TxPoolConfig is tx_pool global configuration TxPoolConfig *txPoolConfig // MonitorEnabled indicates whether monitoring is enabled MonitorEnabled bool )
Functions ¶
func BatchMaxSize ¶ added in v2.3.0
BatchMaxSize Maximum number of common transaction in a batch
func IsDumpTxsInQueue ¶ added in v2.3.0
func IsDumpTxsInQueue() bool
IsDumpTxsInQueue Whether to dump config and common transaction in queue
func IsTxTimeVerify ¶
IsTxTimeVerify Whether transactions require validation
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 The maximum timeout for a transaction
func NewBatchTxPool ¶
func NewBatchTxPool( 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)
NewBatchTxPool creates batch tx_pool
Types ¶
type ForwardMod ¶ added in v2.3.0
type ForwardMod string
ForwardMod identify transaction forward mod
const ( // ForwardModSelf is no forward (default) ForwardModSelf ForwardMod = "0" // ForwardModAVG is forward to all consensus nodes on average ForwardModAVG ForwardMod = "1" // ForwardModNode is forward to a consensus node ForwardModNode ForwardMod = "DEFAULT_NODE_ID" )
type Forwarder ¶ added in v2.3.0
type Forwarder interface {
// ForwardTx forward tx to a node
ForwardTx(tx *commonPb.Transaction) (to string)
}
Forwarder forward tx to a node
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 StageMod ¶ added in v2.3.0
type StageMod int
StageMod identify the location of the transaction
const ( // StageUnknown is unknown StageUnknown StageMod = iota // StageInQueue identify that the transaction is in a queue, is unpacked StageInQueue // StageInPending identify that the transaction is in a pendingCache, has been packed StageInPending // StageInQueueAndPending identify that the transaction is in a queue or pendingCache StageInQueueAndPending )
type TxBatchSourceMod ¶ added in v2.3.0
type TxBatchSourceMod int
TxBatchSourceMod is the source of batch
const ( // TxBatchSourceUnknown is unknown TxBatchSourceUnknown TxBatchSourceMod = iota // TxBatchByBroadcast identify the batch is from other node by broadcasting TxBatchByBroadcast // TxBatchByRecover identify the batch is from proposer by recovering TxBatchByRecover // TxBatchByRetry identify the batch is from core by pruning TxBatchByRetry // TxBatchByRePlay identify the batch is from wal by replaying TxBatchByRePlay )
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
type TxVerifyMod ¶ added in v2.3.1
type TxVerifyMod int
TxVerifyMod is the verify mod of tx
const ( // VerifyTxTime verify timestamp VerifyTxTime TxVerifyMod = iota // VerifyTxAuth verify tx format and signature VerifyTxAuth // VerifyTxInDB verify in full db VerifyTxInDB )
Source Files
¶
- batch_list.go
- batch_pruner.go
- batch_queue.go
- batch_recover.go
- batch_tx_pool.go
- batch_tx_validator.go
- mocks.go
- pool_config.go
- tx_cache.go
- tx_forwarder.go
- tx_pool_rebroadcast.go
- types.go
- utils.go