Documentation ¶
Index ¶
- Variables
- type BeaconViewRetriever
- type BlockTxsVerifier
- type CoinsData
- type FeeEstimator
- type GetMempoolInfo
- func (info *GetMempoolInfo) GetBytes() uint64
- func (info *GetMempoolInfo) GetListTxs() []MempoolInfoTx
- func (info *GetMempoolInfo) GetMaxMempool() uint64
- func (info *GetMempoolInfo) GetMempoolMaxFee() uint64
- func (info *GetMempoolInfo) GetMempoolMinFee() uint64
- func (info *GetMempoolInfo) GetSize() int
- func (info *GetMempoolInfo) GetUsage() uint64
- type GetMempoolInfoTx
- type MempoolInfo
- type MempoolInfoTx
- type PoolManager
- func (pm *PoolManager) FilterMemPoolOutcoinsToSpent(outCoins []privacy.PlainCoin, sID int) []privacy.PlainCoin
- func (pm *PoolManager) GetMempoolInfo() MempoolInfo
- func (pm *PoolManager) GetShardTxsPool(shardID byte) (TxPool, error)
- func (pm *PoolManager) GetTransactionByHash(txHash string) (metadata.Transaction, error)
- func (pm *PoolManager) RemoveTransactionInPool(txHash string)
- func (pm *PoolManager) Start(relayShards []byte) error
- type PrefetchInterface
- type ShardViewRetriever
- type TxInfo
- type TxInfoDetail
- type TxPool
- type TxPoolLogger
- type TxPoolManager
- type TxVerifier
- type TxsData
- type TxsPool
- func (tp *TxsPool) CheckDoubleSpend(dataHelper map[[privacy.Ed25519KeySize]byte]struct{ ... }, ...) (bool, bool, TxInfo, map[uint]interface{})
- func (tp *TxsPool) CheckDoubleSpendWithCurMem(target metadata.Transaction) (bool, bool, string, []string)
- func (tp *TxsPool) CheckValidatedTxs(txs []metadata.Transaction) (valid []metadata.Transaction, needValidate []metadata.Transaction)
- func (tp *TxsPool) FilterWithNewView(cView metadata.ChainRetriever, sView metadata.ShardViewRetriever, ...)
- func (tp *TxsPool) GetInbox() chan metadata.Transaction
- func (tp *TxsPool) GetTxsTranferForNewBlock(cView metadata.ChainRetriever, sView metadata.ShardViewRetriever, ...) []metadata.Transaction
- func (tp *TxsPool) IsRunning() bool
- func (tp *TxsPool) RemoveTx(txHash string)
- func (tp *TxsPool) RemoveTxs(txHashes []string)
- func (tp *TxsPool) Start()
- func (tp *TxsPool) Stop()
- func (tp *TxsPool) UpdateTxVerifier(tv TxVerifier)
- func (tp *TxsPool) ValidateNewTx(tx metadata.Transaction) (bool, error, time.Duration)
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger = TxPoolLogger{}
Global instant to use
Functions ¶
This section is empty.
Types ¶
type BeaconViewRetriever ¶
type BeaconViewRetriever interface { GetAllCommitteeValidatorCandidate() (map[byte][]incognitokey.CommitteePublicKey, map[byte][]incognitokey.CommitteePublicKey, []incognitokey.CommitteePublicKey, []incognitokey.CommitteePublicKey, []incognitokey.CommitteePublicKey, []incognitokey.CommitteePublicKey, []incognitokey.CommitteePublicKey, []incognitokey.CommitteePublicKey, error) GetAllCommitteeValidatorCandidateFlattenListFromDatabase() ([]string, error) GetAutoStakingList() map[string]bool GetBeaconFeatureStateDB() *statedb.StateDB GetBeaconRewardStateDB() *statedb.StateDB GetBeaconSlashStateDB() *statedb.StateDB }
type BlockTxsVerifier ¶
type BlockTxsVerifier interface { FullValidateTransactions( txP TxPool, sView interface{}, bcView interface{}, txs []metadata.Transaction, ) (bool, error) ValidateBatchRangeProof([]metadata.Transaction) (bool, error) }
type FeeEstimator ¶
type FeeEstimator interface { RegisterBlock(block *types.ShardBlock) error EstimateFee(numBlocks uint64, tokenId *common.Hash) (uint64, error) GetLimitFeeForNativeToken() uint64 GetMinFeePerTx() uint64 GetSpecifiedFeeTx() uint64 GetSpecifiedFeePerKBType2() uint64 GetSpecifiedFeePerTxType2() uint64 }
type GetMempoolInfo ¶
type GetMempoolInfo struct { Size int Bytes uint64 Usage uint64 MaxMempool uint64 MempoolMinFee uint64 MempoolMaxFee uint64 ListTxs []MempoolInfoTx }
func (*GetMempoolInfo) GetBytes ¶
func (info *GetMempoolInfo) GetBytes() uint64
func (*GetMempoolInfo) GetListTxs ¶
func (info *GetMempoolInfo) GetListTxs() []MempoolInfoTx
func (*GetMempoolInfo) GetMaxMempool ¶
func (info *GetMempoolInfo) GetMaxMempool() uint64
func (*GetMempoolInfo) GetMempoolMaxFee ¶
func (info *GetMempoolInfo) GetMempoolMaxFee() uint64
func (*GetMempoolInfo) GetMempoolMinFee ¶
func (info *GetMempoolInfo) GetMempoolMinFee() uint64
func (*GetMempoolInfo) GetSize ¶
func (info *GetMempoolInfo) GetSize() int
func (*GetMempoolInfo) GetUsage ¶
func (info *GetMempoolInfo) GetUsage() uint64
type GetMempoolInfoTx ¶
func (*GetMempoolInfoTx) GetLockTime ¶
func (infoTx *GetMempoolInfoTx) GetLockTime() int64
func (*GetMempoolInfoTx) GetTxID ¶
func (infoTx *GetMempoolInfoTx) GetTxID() string
type MempoolInfo ¶
type MempoolInfoTx ¶
type PoolManager ¶
type PoolManager struct { ShardTxsPool []TxPool // contains filtered or unexported fields }
func NewPoolManager ¶
func NewPoolManager( activeShards int, ps *pubsub.PubSubManager, ttl time.Duration, ) ( *PoolManager, error, )
func (*PoolManager) FilterMemPoolOutcoinsToSpent ¶
func (*PoolManager) GetMempoolInfo ¶
func (pm *PoolManager) GetMempoolInfo() MempoolInfo
func (*PoolManager) GetShardTxsPool ¶
func (pm *PoolManager) GetShardTxsPool(shardID byte) (TxPool, error)
func (*PoolManager) GetTransactionByHash ¶
func (pm *PoolManager) GetTransactionByHash(txHash string) (metadata.Transaction, error)
func (*PoolManager) RemoveTransactionInPool ¶
func (pm *PoolManager) RemoveTransactionInPool(txHash string)
func (*PoolManager) Start ¶
func (pm *PoolManager) Start(relayShards []byte) error
type PrefetchInterface ¶
type ShardViewRetriever ¶
type TxInfoDetail ¶
type TxPool ¶
type TxPool interface { UpdateTxVerifier(tv TxVerifier) Start() Stop() GetInbox() chan metadata.Transaction IsRunning() bool RemoveTxs(txHashes []string) GetTxsTranferForNewBlock( cView metadata.ChainRetriever, sView metadata.ShardViewRetriever, bcView metadata.BeaconViewRetriever, ctx PrefetchInterface, ) []metadata.Transaction FilterWithNewView( cView metadata.ChainRetriever, sView metadata.ShardViewRetriever, bcView metadata.BeaconViewRetriever, ) CheckValidatedTxs( txs []metadata.Transaction, ) ( valid []metadata.Transaction, needValidate []metadata.Transaction, ) CheckDoubleSpendWithCurMem( target metadata.Transaction, ) ( bool, bool, string, []string, ) RemoveTx(txHash string) // contains filtered or unexported methods }
type TxPoolLogger ¶
func (*TxPoolLogger) Init ¶
func (self *TxPoolLogger) Init(inst common.Logger)
type TxPoolManager ¶
type TxVerifier ¶
type TxVerifier interface { ValidateWithoutChainstate(metadata.Transaction) (bool, error) ValidateWithChainState( tx metadata.Transaction, chainRetriever metadata.ChainRetriever, shardViewRetriever metadata.ShardViewRetriever, beaconViewRetriever metadata.BeaconViewRetriever, beaconHeight uint64, ) (bool, error) FullValidateTransactions( chainRetriever metadata.ChainRetriever, shardViewRetriever metadata.ShardViewRetriever, beaconViewRetriever metadata.BeaconViewRetriever, txs []metadata.Transaction, ) (bool, error) LoadCommitment( tx metadata.Transaction, shardViewRetriever metadata.ShardViewRetriever, ) (bool, error) PrepareDataForTxs( validTxs []metadata.Transaction, newTxs []metadata.Transaction, shardViewRetriever metadata.ShardViewRetriever, ) (bool, error) UpdateTransactionStateDB( newSDB *statedb.StateDB, ) UpdateFeeEstimator( estimator FeeEstimator, ) }
type TxsData ¶
type TxsData struct { TxByHash map[string]metadata.Transaction TxInfos map[string]TxInfo }
type TxsPool ¶
type TxsPool struct { Verifier TxVerifier Data TxsData Cacher *cache.Cache Inbox chan metadata.Transaction CData CoinsData // contains filtered or unexported fields }
func NewTxsPool ¶
func NewTxsPool( txVerifier TxVerifier, inbox chan metadata.Transaction, ttl time.Duration, ) *TxsPool
func (*TxsPool) CheckDoubleSpend ¶
func (tp *TxsPool) CheckDoubleSpend( dataHelper map[[privacy.Ed25519KeySize]byte]struct { Index uint Detail TxInfoDetail }, tx metadata.Transaction, txs *[]metadata.Transaction, ) ( bool, bool, TxInfo, map[uint]interface{}, )
func (*TxsPool) CheckDoubleSpendWithCurMem ¶
func (*TxsPool) CheckValidatedTxs ¶
func (tp *TxsPool) CheckValidatedTxs( txs []metadata.Transaction, ) ( valid []metadata.Transaction, needValidate []metadata.Transaction, )
func (*TxsPool) FilterWithNewView ¶
func (tp *TxsPool) FilterWithNewView( cView metadata.ChainRetriever, sView metadata.ShardViewRetriever, bcView metadata.BeaconViewRetriever, )
func (*TxsPool) GetInbox ¶
func (tp *TxsPool) GetInbox() chan metadata.Transaction
func (*TxsPool) GetTxsTranferForNewBlock ¶
func (tp *TxsPool) GetTxsTranferForNewBlock( cView metadata.ChainRetriever, sView metadata.ShardViewRetriever, bcView metadata.BeaconViewRetriever, ctx PrefetchInterface, ) []metadata.Transaction
func (*TxsPool) UpdateTxVerifier ¶
func (tp *TxsPool) UpdateTxVerifier(tv TxVerifier)
func (*TxsPool) ValidateNewTx ¶
Click to show internal directories.
Click to hide internal directories.