Documentation ¶
Index ¶
- Constants
- func IsOptimizeChargeGasEnabled(chainConf protocol.ChainConf) bool
- func VerifyOptimizeChargeGasTx(block *commonPb.Block, snapshot protocol.Snapshot) error
- type ConflictsBitWindow
- type SenderCollection
- type SenderGroup
- type TxCollection
- type TxExecType
- type TxIdAndExecOrderType
- type TxScheduler
- func (ts *TxScheduler) Halt()
- func (ts *TxScheduler) Schedule(block *commonPb.Block, txBatch []*commonPb.Transaction, ...) (map[string]*commonPb.TxRWSet, map[string][]*commonPb.ContractEvent, error)
- func (ts *TxScheduler) SimulateWithDag(block *commonPb.Block, snapshot protocol.Snapshot) (map[string]*commonPb.TxRWSet, map[string]*commonPb.Result, error)
- type TxSchedulerEvidence
- func (ts *TxSchedulerEvidence) Halt()
- func (ts *TxSchedulerEvidence) Schedule(block *commonPb.Block, txBatch []*commonPb.Transaction, ...) (map[string]*commonPb.TxRWSet, map[string][]*commonPb.ContractEvent, error)
- func (ts *TxSchedulerEvidence) SimulateWithDag(block *commonPb.Block, snapshot protocol.Snapshot) (map[string]*commonPb.TxRWSet, map[string]*commonPb.Result, error)
- type TxSchedulerFactory
Constants ¶
View Source
const ( AdjustWindowSize = 64 MinAdjustTimes = 2 MinPoolCapacity = 2 BaseConflictRate = 0.05 TopConflictRate = 0.2 DescendCoefficient = 0.25 AscendCoefficient = 3 )
View Source
const ( ScheduleTimeout = 10 ScheduleWithDagTimeout = 20 )
View Source
const (
ErrMsgOfGasLimitNotSet = "field `GasLimit` must be set in payload."
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConflictsBitWindow ¶
type ConflictsBitWindow struct {
// contains filtered or unexported fields
}
ConflictsBitWindow holds a bitWindow to adjust goroutine pool size for runtime.
func NewConflictsBitWindow ¶
func NewConflictsBitWindow(txBatchSize int) *ConflictsBitWindow
NewConflictsBitWindow returns an empty queue.
func (*ConflictsBitWindow) Enqueue ¶
func (q *ConflictsBitWindow) Enqueue(v TxExecType, currPoolCapacity int) int
Enqueue puts the given value v at the tail of the queue.
type SenderCollection ¶
type SenderCollection struct {
// contains filtered or unexported fields
}
SenderCollection contains: key: address value: tx collection will address's other data
func NewSenderCollection ¶
func NewSenderCollection( txBatch []*commonPb.Transaction, snapshot protocol.Snapshot, log protocol.Logger) *SenderCollection
func (SenderCollection) Clear ¶
func (s SenderCollection) Clear()
type SenderGroup ¶
type SenderGroup struct {
// contains filtered or unexported fields
}
func NewSenderGroup ¶
func NewSenderGroup(txBatch []*commonPb.Transaction) *SenderGroup
type TxCollection ¶
type TxCollection struct {
// contains filtered or unexported fields
}
func (*TxCollection) String ¶
func (g *TxCollection) String() string
type TxIdAndExecOrderType ¶
type TxIdAndExecOrderType struct { protocol.ExecOrderTxType // contains filtered or unexported fields }
type TxScheduler ¶
type TxScheduler struct { VmManager protocol.VmManager StoreHelper config.StoreHelper // contains filtered or unexported fields }
TxScheduler transaction scheduler structure
func (*TxScheduler) Halt ¶
func (ts *TxScheduler) Halt()
func (*TxScheduler) Schedule ¶
func (ts *TxScheduler) Schedule(block *commonPb.Block, txBatch []*commonPb.Transaction, snapshot protocol.Snapshot) (map[string]*commonPb.TxRWSet, map[string][]*commonPb.ContractEvent, error)
Schedule according to a batch of transactions, and generating DAG according to the conflict relationship
type TxSchedulerEvidence ¶
type TxSchedulerEvidence struct {
// contains filtered or unexported fields
}
TxScheduler evidence transaction scheduler structure
func (*TxSchedulerEvidence) Halt ¶
func (ts *TxSchedulerEvidence) Halt()
func (*TxSchedulerEvidence) Schedule ¶
func (ts *TxSchedulerEvidence) Schedule(block *commonPb.Block, txBatch []*commonPb.Transaction, snapshot protocol.Snapshot) (map[string]*commonPb.TxRWSet, map[string][]*commonPb.ContractEvent, error)
func (*TxSchedulerEvidence) SimulateWithDag ¶
func (ts *TxSchedulerEvidence) SimulateWithDag(block *commonPb.Block, snapshot protocol.Snapshot) (map[string]*commonPb.TxRWSet, map[string]*commonPb.Result, error)
SimulateWithDag based on the dag in the block, perform scheduling and execution evidence transactions
type TxSchedulerFactory ¶
type TxSchedulerFactory struct { }
func (TxSchedulerFactory) NewTxScheduler ¶
func (sf TxSchedulerFactory) NewTxScheduler(vmMgr protocol.VmManager, chainConf protocol.ChainConf, storeHelper conf.StoreHelper, ledgerCache protocol.LedgerCache) protocol.TxScheduler
NewTxScheduler building a transaction scheduler
Click to show internal directories.
Click to hide internal directories.