mempool

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: LGPL-3.0 Imports: 34 Imported by: 6

Documentation

Index

Constants

View Source
const (
	All         = TxMapFilter(1)
	Priority    = TxMapFilter(2)
	NotPriority = TxMapFilter(3)
)
View Source
const (
	Folder = "mempool-txs"
)
View Source
const (
	MaxDeferredTxs = 100
)

Variables

View Source
var (
	KeyIsAlreadyPublished = errors.New("sender has already published his keys")
	KeySkipped            = errors.New("key has been skipped")
)
View Source
var (
	DuplicateTxError = errors.New("tx with same hash already exists")
	MempoolFullError = errors.New("mempool is full")
)

Functions

func EncryptPrivateKeysPackage

func EncryptPrivateKeysPackage(publicFlipKey *ecies.PrivateKey, privateFlipKey *ecies.PrivateKey, pubKeys [][]byte) []byte

func NewTxKeeper added in v0.25.3

func NewTxKeeper(datadir string) *txKeeper

Types

type AsyncKeysPool added in v0.19.3

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

func (*AsyncKeysPool) AddPrivateKeysPackage added in v0.19.3

func (pool *AsyncKeysPool) AddPrivateKeysPackage(keysPackage *types.PrivateFlipKeysPackage, _ bool) error

func (*AsyncKeysPool) AddPublicFlipKey added in v0.19.3

func (pool *AsyncKeysPool) AddPublicFlipKey(key *types.PublicFlipKey, _ bool) error

func (*AsyncKeysPool) GetFlipKeysForSync added in v0.22.0

func (pool *AsyncKeysPool) GetFlipKeysForSync(shardId common.ShardId, noFilter bool) []*types.PublicFlipKey

func (*AsyncKeysPool) GetFlipPackagesHashesForSync added in v0.22.0

func (pool *AsyncKeysPool) GetFlipPackagesHashesForSync(shardId common.ShardId, noFilter bool) []common.Hash128

func (*AsyncKeysPool) GetPriorityFlipKeysForSync added in v0.27.3

func (pool *AsyncKeysPool) GetPriorityFlipKeysForSync() []*types.PublicFlipKey

func (*AsyncKeysPool) GetPriorityFlipPackagesHashesForSync added in v0.27.3

func (pool *AsyncKeysPool) GetPriorityFlipPackagesHashesForSync() []common.Hash128

type AsyncTxPool

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

func NewAsyncTxPool

func NewAsyncTxPool(txPool *TxPool) *AsyncTxPool

func (*AsyncTxPool) AddExternalTxs added in v0.25.3

func (pool *AsyncTxPool) AddExternalTxs(txType validation.TxType, txs ...*types.Transaction) error

func (*AsyncTxPool) AddInternalTx added in v0.25.3

func (pool *AsyncTxPool) AddInternalTx(tx *types.Transaction) error

func (*AsyncTxPool) GetPendingTransaction

func (pool *AsyncTxPool) GetPendingTransaction(noFilter bool, addHighPriority bool, shardId common.ShardId, count bool) []*types.Transaction

func (*AsyncTxPool) GetPriorityTransaction added in v0.27.3

func (pool *AsyncTxPool) GetPriorityTransaction() []*types.Transaction

func (*AsyncTxPool) IsSyncing added in v0.22.0

func (pool *AsyncTxPool) IsSyncing() bool

type FlipKeysPool added in v0.19.3

type FlipKeysPool interface {
	AddPrivateKeysPackage(keysPackage *types.PrivateFlipKeysPackage, own bool) error
	AddPublicFlipKey(key *types.PublicFlipKey, own bool) error
	GetFlipPackagesHashesForSync(shardId common.ShardId, noFilter bool) []common.Hash128
	GetFlipKeysForSync(shardId common.ShardId, noFilter bool) []*types.PublicFlipKey
	GetPriorityFlipPackagesHashesForSync() []common.Hash128
	GetPriorityFlipKeysForSync() []*types.PublicFlipKey
}

func NewAsyncKeysPool added in v0.19.3

func NewAsyncKeysPool(inner *KeysPool) FlipKeysPool

type KeysPool

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

func NewKeysPool

func NewKeysPool(db dbm.DB, appState *appstate.AppState, bus eventbus.Bus, secStore *secstore.SecStore) *KeysPool

func (*KeysPool) Add

func (p *KeysPool) Add(hash common.Hash128, entry interface{}, id common.ShardId, highPriority bool)

func (*KeysPool) AddPrivateFlipKeysPackages added in v0.19.3

func (p *KeysPool) AddPrivateFlipKeysPackages(batch []*types.PrivateFlipKeysPackage)

func (*KeysPool) AddPrivateKeysPackage

func (p *KeysPool) AddPrivateKeysPackage(keysPackage *types.PrivateFlipKeysPackage, own bool) error

func (*KeysPool) AddPublicFlipKey

func (p *KeysPool) AddPublicFlipKey(key *types.PublicFlipKey, own bool) error

func (*KeysPool) AddPublicFlipKeys added in v0.19.3

func (p *KeysPool) AddPublicFlipKeys(batch []*types.PublicFlipKey)

func (*KeysPool) Clear

func (p *KeysPool) Clear()

func (*KeysPool) Get

func (p *KeysPool) Get(hash common.Hash128) (entry interface{}, id common.ShardId, highPriority bool, present bool)

func (*KeysPool) GetEncryptedPrivateFlipKey added in v0.23.1

func (p *KeysPool) GetEncryptedPrivateFlipKey(indexInPackage int, address common.Address) []byte

func (*KeysPool) GetFlipKeysForSync added in v0.22.0

func (p *KeysPool) GetFlipKeysForSync(shardId common.ShardId, noFilter bool) []*types.PublicFlipKey

func (*KeysPool) GetFlipPackagesHashesForSync added in v0.22.0

func (p *KeysPool) GetFlipPackagesHashesForSync(shardId common.ShardId, noFilter bool) []common.Hash128

func (*KeysPool) GetPriorityFlipKeysForSync added in v0.27.3

func (p *KeysPool) GetPriorityFlipKeysForSync() []*types.PublicFlipKey

func (*KeysPool) GetPriorityFlipPackagesHashesForSync added in v0.27.3

func (p *KeysPool) GetPriorityFlipPackagesHashesForSync() []common.Hash128

func (*KeysPool) GetPublicFlipKey

func (p *KeysPool) GetPublicFlipKey(address common.Address) *ecies.PrivateKey

func (*KeysPool) Has

func (p *KeysPool) Has(hash common.Hash128) bool

func (*KeysPool) Initialize

func (p *KeysPool) Initialize(head *types.Header)

func (*KeysPool) MaxParallelPulls added in v0.19.5

func (p *KeysPool) MaxParallelPulls() uint32

func (*KeysPool) PushTracker added in v0.19.5

func (p *KeysPool) PushTracker() pushpull.PendingPushTracker

func (*KeysPool) StopSyncing added in v0.22.0

func (p *KeysPool) StopSyncing()

func (*KeysPool) SupportPendingRequests added in v0.19.5

func (p *KeysPool) SupportPendingRequests() bool

type TransactionPool

type TransactionPool interface {
	AddInternalTx(tx *types.Transaction) error
	AddExternalTxs(txType validation.TxType, txs ...*types.Transaction) error
	GetPendingTransaction(noFilter bool, addHighPriority bool, shardId common.ShardId, count bool) []*types.Transaction
	GetPriorityTransaction() []*types.Transaction
	IsSyncing() bool
}

type TxMapFilter added in v0.27.3

type TxMapFilter = byte

type TxPool

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

func NewTxPool

func NewTxPool(appState *appstate.AppState, bus eventbus.Bus, cfg *config.Config, statsCollector collector.StatsCollector) *TxPool

func (*TxPool) Add

func (pool *TxPool) Add(hash common.Hash128, entry interface{}, shardId common.ShardId, highPriority bool)

func (*TxPool) AddExternalTxs added in v0.25.3

func (pool *TxPool) AddExternalTxs(txType validation.TxType, txs ...*types.Transaction) error

func (*TxPool) AddInternalTx added in v0.25.3

func (pool *TxPool) AddInternalTx(tx *types.Transaction) error

func (*TxPool) BuildBlockTransactions

func (pool *TxPool) BuildBlockTransactions() []*types.Transaction

func (*TxPool) Get added in v0.28.0

func (pool *TxPool) Get(hash common.Hash128) (entry interface{}, shardId common.ShardId, highPriority bool, present bool)

func (*TxPool) GetPendingByAddress

func (pool *TxPool) GetPendingByAddress(address common.Address) []*types.Transaction

func (*TxPool) GetPendingTransaction

func (pool *TxPool) GetPendingTransaction(noFilter bool, addHighPriority bool, shardId common.ShardId, count bool) []*types.Transaction

func (*TxPool) GetPriorityTransaction added in v0.27.3

func (pool *TxPool) GetPriorityTransaction() []*types.Transaction

func (*TxPool) GetTx

func (pool *TxPool) GetTx(hash common.Hash) *types.Transaction

func (*TxPool) Has added in v0.28.0

func (pool *TxPool) Has(hash common.Hash128) bool

func (*TxPool) Initialize

func (pool *TxPool) Initialize(head *types.Header, coinbase common.Address, useTxKeeper bool)

func (*TxPool) IsSyncing added in v0.22.0

func (pool *TxPool) IsSyncing() bool

func (*TxPool) MaxParallelPulls added in v0.28.0

func (pool *TxPool) MaxParallelPulls() uint32

func (*TxPool) PushTracker added in v0.28.0

func (pool *TxPool) PushTracker() pushpull.PendingPushTracker

func (*TxPool) Remove

func (pool *TxPool) Remove(transaction *types.Transaction)

func (*TxPool) ResetTo

func (pool *TxPool) ResetTo(block *types.Block)

func (*TxPool) StartSync

func (pool *TxPool) StartSync()

func (*TxPool) StopSync

func (pool *TxPool) StopSync(block *types.Block)

func (*TxPool) SupportPendingRequests added in v0.28.0

func (pool *TxPool) SupportPendingRequests() bool

func (*TxPool) Validate

func (pool *TxPool) Validate(tx *types.Transaction) error

validate tx as inbound transaction

Jump to

Keyboard shortcuts

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