dependencygraph

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager is the main component of the dependency graph module. It is responsible for managing the local dependency constructor and the global dependency manager.

func NewManager

func NewManager(p *Parameters) *Manager

NewManager creates a new dependency graph manager.

func (*Manager) Run

func (m *Manager) Run(ctx context.Context)

Run starts the dependency graph manager by starting the local dependency constructors and global dependency graph manager.

type Parameters added in v0.1.5

type Parameters struct {
	// IncomingTxs is the channel for dependency manager to receive
	// incoming transactions.
	IncomingTxs <-chan *TransactionBatch
	// OutgoingDepFreeTxsNode is the channel dependency manager to send
	// dependency free transactions for validation and commit.
	OutgoingDepFreeTxsNode chan<- TxNodeBatch
	// IncomingValidatedTxsNode is the channel for dependency manager
	// to receive validated transactions.
	IncomingValidatedTxsNode <-chan TxNodeBatch
	// NumOfLocalDepConstructors defines the number of local
	// dependency constructors.
	NumOfLocalDepConstructors int
	// WaitingTxsLimit defines the maximum number of transactions
	// that can be waiting at the dependency manager.
	WaitingTxsLimit int
	// PrometheusMetricsProvider is the provider for Prometheus metrics.
	PrometheusMetricsProvider *monitoring.Provider
}

Parameters holds the configuration for the dependency graph manager.

type SimpleManager

type SimpleManager struct {
	// contains filtered or unexported fields
}

SimpleManager is the simpler version of the dependency graph module. It uses only 3 go routines, and a single regular map.

func NewSimpleManager

func NewSimpleManager(p *Parameters) *SimpleManager

NewSimpleManager create a simple dependency graph manager.

func (*SimpleManager) Run

func (m *SimpleManager) Run(ctx context.Context)

Run starts the dependency graph manager.

type TransactionBatch

type TransactionBatch struct {
	ID          uint64
	BlockNumber uint64
	Txs         []*protoblocktx.Tx
	TxsNum      []uint32
}

TransactionBatch holds a batch of transactions to be included in the dependency graph. The id field denotes the order in which the batch needs to be processed.

type TransactionNode

type TransactionNode struct {
	Tx         *protovcservice.Transaction
	Signatures [][]byte
	// contains filtered or unexported fields
}

TransactionNode is a node in the dependency graph.

type TxNodeBatch

type TxNodeBatch []*TransactionNode

TxNodeBatch is a batch of transaction nodes.

Jump to

Keyboard shortcuts

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