scheduler

package
v0.0.0-...-bda353b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

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

func IsOptimizeChargeGasEnabled

func IsOptimizeChargeGasEnabled(chainConf protocol.ChainConf) bool

func VerifyOptimizeChargeGasTx

func VerifyOptimizeChargeGasTx(block *commonPb.Block, snapshot protocol.Snapshot) error

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 TxExecType

type TxExecType int
const (
	ConflictTx TxExecType = iota
	NormalTx
)

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

func (*TxScheduler) SimulateWithDag

func (ts *TxScheduler) 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 transactions

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL