Documentation ¶
Index ¶
- Constants
- Variables
- func GetDep(deps TxnInputOutput) map[int]map[int]bool
- func HasReadDep(txFrom TxnOutput, txTo TxnInput) bool
- func SetProcs(specProcs int)
- func UpdateDeps(deps map[int]map[int]bool, t TxDep) map[int]map[int]bool
- func ValidateVersion(txIdx int, lastInputOutput *TxnInputOutput, versionedData *MVHashMap) (valid bool)
- type DAG
- type ErrExecAbortError
- type ExecResult
- type ExecTask
- type ExecVersionView
- type ExecutionStat
- type IntHeap
- type Key
- type MVHashMap
- func (mv *MVHashMap) Delete(k Key, txIdx int)
- func (mv *MVHashMap) FlushMVWriteSet(writes []WriteDescriptor)
- func (mv *MVHashMap) MarkEstimate(k Key, txIdx int)
- func (mv *MVHashMap) Read(k Key, txIdx int) (res MVReadResult)
- func (mv *MVHashMap) ReadStorage(k Key, fallBack func() any) any
- func (mv *MVHashMap) Write(k Key, v Version, data interface{})
- type MVReadResult
- type ParallelExecFailedError
- type ParallelExecutionResult
- type ParallelExecutor
- type PropertyCheck
- type ReadDescriptor
- type SafeFIFOQueue
- type SafePriorityQueue
- type SafeQueue
- type TxDep
- type TxnIndexCells
- type TxnInput
- type TxnInputOutput
- func (io *TxnInputOutput) AllWriteSet(txnIdx int) []WriteDescriptor
- func (io *TxnInputOutput) HasWritten(txnIdx int, k Key) bool
- func (io *TxnInputOutput) ReadSet(txnIdx int) []ReadDescriptor
- func (io *TxnInputOutput) RecordAllWriteAtOnce(outputs [][]WriteDescriptor)
- func (io *TxnInputOutput) RecordReadAtOnce(inputs [][]ReadDescriptor)
- func (io *TxnInputOutput) WriteSet(txnIdx int) []WriteDescriptor
- type TxnOutput
- type Version
- type WriteCell
- type WriteDescriptor
Constants ¶
View Source
const ( MVReadResultDone = 0 MVReadResultDependency = 1 MVReadResultNone = 2 )
View Source
const ( ReadKindMap = 0 ReadKindStorage = 1 )
View Source
const FlagDone = 0
View Source
const FlagEstimate = 1
View Source
const KeyLength = common.AddressLength + common.HashLength + 2
Variables ¶
View Source
var NumSpeculativeProcs int = 8
Functions ¶
func HasReadDep ¶
func ValidateVersion ¶
func ValidateVersion(txIdx int, lastInputOutput *TxnInputOutput, versionedData *MVHashMap) (valid bool)
Types ¶
type DAG ¶
func BuildDAG ¶
func BuildDAG(deps TxnInputOutput) (d DAG)
func (DAG) LongestPath ¶
func (d DAG) LongestPath(stats map[int]ExecutionStat) ([]int, uint64)
Find the longest execution path in the DAG
type ErrExecAbortError ¶
func (ErrExecAbortError) Error ¶
func (e ErrExecAbortError) Error() string
type ExecResult ¶
type ExecResult struct {
// contains filtered or unexported fields
}
type ExecTask ¶
type ExecTask interface { Execute(mvh *MVHashMap, incarnation int) error MVReadList() []ReadDescriptor MVWriteList() []WriteDescriptor MVFullWriteList() []WriteDescriptor Hash() common.Hash Sender() common.Address Settle() Dependencies() []int }
type ExecVersionView ¶
type ExecVersionView struct {
// contains filtered or unexported fields
}
func (*ExecVersionView) Execute ¶
func (ev *ExecVersionView) Execute() (er ExecResult)
type ExecutionStat ¶
type Key ¶
func NewAddressKey ¶
func (Key) GetAddress ¶
func (Key) GetStateKey ¶
func (Key) GetSubpath ¶
type MVHashMap ¶
type MVHashMap struct {
// contains filtered or unexported fields
}
func MakeMVHashMap ¶
func MakeMVHashMap() *MVHashMap
func (*MVHashMap) FlushMVWriteSet ¶
func (mv *MVHashMap) FlushMVWriteSet(writes []WriteDescriptor)
func (*MVHashMap) MarkEstimate ¶
type MVReadResult ¶
type MVReadResult struct {
// contains filtered or unexported fields
}
func (*MVReadResult) DepIdx ¶
func (res *MVReadResult) DepIdx() int
func (*MVReadResult) Incarnation ¶
func (res *MVReadResult) Incarnation() int
func (MVReadResult) Status ¶
func (mvr MVReadResult) Status() int
func (*MVReadResult) Value ¶
func (res *MVReadResult) Value() interface{}
type ParallelExecFailedError ¶
type ParallelExecFailedError struct {
Msg string
}
func (ParallelExecFailedError) Error ¶
func (e ParallelExecFailedError) Error() string
type ParallelExecutionResult ¶
type ParallelExecutionResult struct { TxIO *TxnInputOutput Stats *map[int]ExecutionStat Deps *DAG AllDeps map[int]map[int]bool }
func ExecuteParallel ¶
type ParallelExecutor ¶
type ParallelExecutor struct {
// contains filtered or unexported fields
}
func NewParallelExecutor ¶
func NewParallelExecutor(tasks []ExecTask, profile bool, metadata bool) *ParallelExecutor
func (*ParallelExecutor) Close ¶
func (pe *ParallelExecutor) Close(wait bool)
func (*ParallelExecutor) Step ¶
func (pe *ParallelExecutor) Step(res *ExecResult) (result ParallelExecutionResult, err error)
nolint: gocognit
type PropertyCheck ¶
type PropertyCheck func(*ParallelExecutor) error
type ReadDescriptor ¶
type SafeFIFOQueue ¶
type SafeFIFOQueue struct {
// contains filtered or unexported fields
}
func NewSafeFIFOQueue ¶
func NewSafeFIFOQueue(capacity int) *SafeFIFOQueue
func (*SafeFIFOQueue) Len ¶
func (q *SafeFIFOQueue) Len() int
func (*SafeFIFOQueue) Pop ¶
func (q *SafeFIFOQueue) Pop() interface{}
func (*SafeFIFOQueue) Push ¶
func (q *SafeFIFOQueue) Push(v int, d interface{})
type SafePriorityQueue ¶
type SafePriorityQueue struct {
// contains filtered or unexported fields
}
A thread safe priority queue
func NewSafePriorityQueue ¶
func NewSafePriorityQueue(capacity int) *SafePriorityQueue
func (*SafePriorityQueue) Len ¶
func (pq *SafePriorityQueue) Len() int
func (*SafePriorityQueue) Pop ¶
func (pq *SafePriorityQueue) Pop() interface{}
func (*SafePriorityQueue) Push ¶
func (pq *SafePriorityQueue) Push(v int, d interface{})
type TxDep ¶
type TxDep struct { Index int ReadList []ReadDescriptor FullWriteList [][]WriteDescriptor }
type TxnIndexCells ¶
type TxnIndexCells struct {
// contains filtered or unexported fields
}
type TxnInput ¶
type TxnInput []ReadDescriptor
type TxnInputOutput ¶
type TxnInputOutput struct {
// contains filtered or unexported fields
}
func MakeTxnInputOutput ¶
func MakeTxnInputOutput(numTx int) *TxnInputOutput
func (*TxnInputOutput) AllWriteSet ¶
func (io *TxnInputOutput) AllWriteSet(txnIdx int) []WriteDescriptor
func (*TxnInputOutput) HasWritten ¶
func (io *TxnInputOutput) HasWritten(txnIdx int, k Key) bool
func (*TxnInputOutput) ReadSet ¶
func (io *TxnInputOutput) ReadSet(txnIdx int) []ReadDescriptor
func (*TxnInputOutput) RecordAllWriteAtOnce ¶
func (io *TxnInputOutput) RecordAllWriteAtOnce(outputs [][]WriteDescriptor)
func (*TxnInputOutput) RecordReadAtOnce ¶
func (io *TxnInputOutput) RecordReadAtOnce(inputs [][]ReadDescriptor)
func (*TxnInputOutput) WriteSet ¶
func (io *TxnInputOutput) WriteSet(txnIdx int) []WriteDescriptor
type TxnOutput ¶
type TxnOutput []WriteDescriptor
type WriteDescriptor ¶
Click to show internal directories.
Click to hide internal directories.