Versions in this module Expand all Collapse all v0 v0.1.0 Jan 19, 2024 Changes in this version + const BtcConfirmedGap + const CrawlerHeightPath + const FlagEnablePendingPool + const MempoolChannel + const MetricsSubsystem + const PullZeroDataInterval + const UnknownPeerID + const ZeroTxPath + var ErrNoSuchTx = errors.New("no such tx in mempool") + var ErrTxInCache = errors.New("tx already exists in cache") + var GlobalRecommendedGP = big.NewInt(1) + var IsCongested = false + func GetRealTxFromWrapCMTx(data types.Tx) types.Tx + func IsPreCheckError(err error) bool + func MultiPriceBump(rawPrice *big.Int, priceBump int64) *big.Int + func RegisterMessages(cdc *amino.Codec) + type AccountRetriever interface + GetAccountNonce func(address string) uint64 + type AddressNonce struct + type AddressRecord struct + func (ar *AddressRecord) AddItem(address string, cElement *clist.CElement) + func (ar *AddressRecord) CleanItems(address string, nonce uint64, cb func(element *clist.CElement)) + func (ar *AddressRecord) DeleteItem(e *clist.CElement) + func (ar *AddressRecord) GetAddressList() []string + func (ar *AddressRecord) GetAddressNonce(address string) (uint64, bool) + func (ar *AddressRecord) GetAddressTxs(address string, max int) types.Txs + func (ar *AddressRecord) GetAddressTxsCnt(address string) int + func (ar *AddressRecord) GetItems(address string) []*clist.CElement + type AddressRecorder interface + CleanItems func(address string, nonce uint64) + GetAddressList func() []string + GetAddressNonce func(address string) (uint64, bool) + GetAddressTxs func(address string, max int) types.Txs + GetAddressTxsCnt func(address string) int + type BaseTxQueue struct + func NewBaseTxQueue() *BaseTxQueue + func (q *BaseTxQueue) Back() *clist.CElement + func (q *BaseTxQueue) BroadcastFront() *clist.CElement + func (q *BaseTxQueue) BroadcastLen() int + func (q *BaseTxQueue) CleanItems(address string, nonce uint64) + func (q *BaseTxQueue) Front() *clist.CElement + func (q *BaseTxQueue) Insert(tx *mempoolTx) error + func (q *BaseTxQueue) Len() int + func (q *BaseTxQueue) Load(hash [sha256.Size]byte) (*clist.CElement, bool) + func (q *BaseTxQueue) Remove(element *clist.CElement) + func (q *BaseTxQueue) RemoveByKey(key [32]byte) (ele *clist.CElement) + func (q *BaseTxQueue) TxsWaitChan() <-chan struct{} + type CListMempool struct + func NewCListMempool(config *cfg.MempoolConfig, proxyAppConn proxy.AppConnMempool, height int64, ...) *CListMempool + func (mem *CListMempool) BroadcastTxsFront() *clist.CElement + func (mem *CListMempool) CheckAndGetWrapCMTx(tx types.Tx, txInfo TxInfo) *types.WrapCMTx + func (mem *CListMempool) CheckTx(tx types.Tx, cb func(*abci.Response), txInfo TxInfo) error + func (mem *CListMempool) ConfirmZeroDataByBTCHeight(btcHeight int64) + func (mem *CListMempool) DelAllPrevZeroDataBeforeHeight(height int64) + func (mem *CListMempool) DelZeroDataByBTCHeight(btcHeight int64) + func (mem *CListMempool) EnableTxsAvailable() + func (mem *CListMempool) Flush() + func (mem *CListMempool) FlushAppConn() error + func (mem *CListMempool) GetAddressList() []string + func (mem *CListMempool) GetConfig() *cfg.MempoolConfig + func (mem *CListMempool) GetCurrentZeroData() map[int64]types.ZeroData + func (mem *CListMempool) GetEnableDeleteMinGPTx() bool + func (mem *CListMempool) GetPendingNonce(address string) (uint64, bool) + func (mem *CListMempool) GetPendingPoolTxsBytes() map[string]map[string]types.WrappedMempoolTx + func (mem *CListMempool) GetTxByHash(hash [sha256.Size]byte) (types.Tx, error) + func (mem *CListMempool) GetTxSimulateGas(txHash string) int64 + func (mem *CListMempool) GetUserPendingTxsCnt(address string) int + func (mem *CListMempool) GetZeroDataByBTCHeight(btcHeight int64) (types.ZeroData, error) + func (mem *CListMempool) GetZeroDataMaxHeight() int64 + func (mem *CListMempool) GetZeroDataMinHeight() int64 + func (mem *CListMempool) Height() int64 + func (mem *CListMempool) InsertZeroData(btcHeight int64, btcBlockHash string, txs []types.Tx) + func (mem *CListMempool) Lock() + func (mem *CListMempool) ReapEssentialTx(tx types.Tx) abci.TxEssentials + func (mem *CListMempool) ReapMaxTxs(max int) types.Txs + func (mem *CListMempool) ReapUserTxs(address string, max int) types.Txs + func (mem *CListMempool) ReapUserTxsCnt(address string) int + func (mem *CListMempool) SetAccountRetriever(retriever AccountRetriever) + func (mem *CListMempool) SetEventBus(eventBus types.TxEventPublisher) + func (mem *CListMempool) SetLogger(l log.Logger) + func (mem *CListMempool) SetTxInfoParser(parser TxInfoParser) + func (mem *CListMempool) SetZeroDataDelivered(btcH int64, value bool) + func (mem *CListMempool) Size() int + func (mem *CListMempool) TxsAvailable() <-chan struct{} + func (mem *CListMempool) TxsBytes() int64 + func (mem *CListMempool) TxsFront() *clist.CElement + func (mem *CListMempool) TxsWaitChan() <-chan struct{} + func (mem *CListMempool) Unlock() + func (mem *CListMempool) Update(height int64, txs types.Txs, deliverTxResponses []*abci.ResponseDeliverTx, ...) error + func (mem *CListMempool) UpdateForBRCZeroData(height int64, btcHeight int64) + func (mem *CListMempool) ZeroReorgChan() <-chan int64 + type CListMempoolOption func(*CListMempool) + func WithMetrics(metrics *Metrics) CListMempoolOption + func WithPostCheck(f PostCheckFunc) CListMempoolOption + func WithPreCheck(f PreCheckFunc) CListMempoolOption + type ErrMempoolIsFull struct + func (e ErrMempoolIsFull) Error() string + type ErrPendingPoolAddressLimit struct + func (e ErrPendingPoolAddressLimit) Error() string + type ErrPendingPoolIsFull struct + func (e ErrPendingPoolIsFull) Error() string + type ErrPreCheck struct + Reason error + func (e ErrPreCheck) Error() string + type ErrTxAlreadyInPendingPool struct + func (e ErrTxAlreadyInPendingPool) Error() string + type ErrTxTooLarge struct + func (e ErrTxTooLarge) Error() string + type ExTxInfo struct + GasPrice *big.Int + Nonce uint64 + Sender string + SenderNonce uint64 + type GPOConfig struct + Blocks int + Default *big.Int + Weight int + func NewGPOConfig(weight int, checkBlocks int) GPOConfig + type GasInfo struct + GasUsed uint64 + GasWanted uint64 + type GasTxQueue struct + func NewGasTxQueue(txPriceBump int64) *GasTxQueue + func (q *GasTxQueue) Back() *clist.CElement + func (q *GasTxQueue) BroadcastFront() *clist.CElement + func (q *GasTxQueue) BroadcastLen() int + func (q *GasTxQueue) CleanItems(address string, nonce uint64) + func (q *GasTxQueue) Front() *clist.CElement + func (q *GasTxQueue) Insert(memTx *mempoolTx) error + func (q *GasTxQueue) Len() int + func (q *GasTxQueue) Load(hash [sha256.Size]byte) (*clist.CElement, bool) + func (q *GasTxQueue) Remove(element *clist.CElement) + func (q *GasTxQueue) RemoveByKey(key [32]byte) (ele *clist.CElement) + func (q *GasTxQueue) TxsWaitChan() <-chan struct{} + type ITransactionQueue interface + Back func() *clist.CElement + BroadcastFront func() *clist.CElement + BroadcastLen func() int + Front func() *clist.CElement + Insert func(tx *mempoolTx) error + Len func() int + Load func(hash [sha256.Size]byte) (*clist.CElement, bool) + Remove func(element *clist.CElement) + RemoveByKey func(key [sha256.Size]byte) *clist.CElement + TxsWaitChan func() <-chan struct{} + func NewOptimizedTxQueue(txPriceBump int64) ITransactionQueue + type Mempool interface + CheckTx func(tx types.Tx, callback func(*abci.Response), txInfo TxInfo) error + DelAllPrevZeroDataBeforeHeight func(height int64) + DelZeroDataByBTCHeight func(btcHeight int64) + EnableTxsAvailable func() + Flush func() + FlushAppConn func() error + GetAddressList func() []string + GetConfig func() *cfg.MempoolConfig + GetCurrentZeroData func() map[int64]types.ZeroData + GetEnableDeleteMinGPTx func() bool + GetPendingNonce func(address string) (uint64, bool) + GetPendingPoolTxsBytes func() map[string]map[string]types.WrappedMempoolTx + GetTxByHash func(hash [sha256.Size]byte) (types.Tx, error) + GetTxSimulateGas func(txHash string) int64 + GetUserPendingTxsCnt func(address string) int + GetZeroDataByBTCHeight func(btcHeight int64) (types.ZeroData, error) + GetZeroDataMinHeight func() int64 + Lock func() + ReapEssentialTx func(tx types.Tx) abci.TxEssentials + ReapMaxTxs func(max int) types.Txs + ReapUserTxs func(address string, max int) types.Txs + ReapUserTxsCnt func(address string) int + SetAccountRetriever func(retriever AccountRetriever) + SetEventBus func(eventBus types.TxEventPublisher) + SetTxInfoParser func(parser TxInfoParser) + SetZeroDataDelivered func(btcH int64, value bool) + Size func() int + TxsAvailable func() <-chan struct{} + TxsBytes func() int64 + Unlock func() + Update func(blockHeight int64, blockTxs types.Txs, ...) error + UpdateForBRCZeroData func(height int64, btcHeight int64) + ZeroReorgChan func() <-chan int64 + type Message interface + type Metrics struct + FailedTxs metrics.Counter + GasUsed metrics.Gauge + PendingPoolSize metrics.Gauge + RecheckTimes metrics.Counter + Size metrics.Gauge + TxSizeBytes metrics.Histogram + func NopMetrics() *Metrics + func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics + type Oracle struct + BlockGPQueue *types.BlockGPResults + CurrentBlockGPs *types.SingleBlockGPs + func NewOracle(params GPOConfig) *Oracle + func (gpo *Oracle) RecommendGP() (*big.Int, bool) + type PeerState interface + GetHeight func() int64 + type PendingPool struct + func (p *PendingPool) GetWrappedAddressTxsMap() map[string]map[string]types.WrappedMempoolTx + func (p *PendingPool) Size() int + type PostCheckFunc func(types.Tx, *abci.ResponseCheckTx) error + func PostCheckMaxGas(maxGas int64) PostCheckFunc + type PreCheckFunc func(types.Tx) error + func PreCheckAminoMaxBytes(maxBytes int64) PreCheckFunc + type Reactor struct + func NewReactor(config *cfg.MempoolConfig, mempool *CListMempool) *Reactor + func (memR *Reactor) AddPeer(peer p2p.Peer) + func (memR *Reactor) GetChannels() []*p2p.ChannelDescriptor + func (memR *Reactor) InitPeer(peer p2p.Peer) p2p.Peer + func (memR *Reactor) OnStart() error + func (memR *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) + func (memR *Reactor) RemovePeer(peer p2p.Peer, reason interface{}) + func (memR *Reactor) SetLogger(l log.Logger) + func (memR *Reactor) SetNodeKey(key *p2p.NodeKey) + type Result struct + Data []byte + Events []abci.Event + Log string + type SimulationResponse struct + Result *Result + type TxInfo struct + SenderID uint16 + SenderP2PID p2p.ID + type TxInfoParser interface + GetRawTxInfo func(tx types.Tx) ExTxInfo + GetRealTxFromRawTx func(rawTx types.Tx) abci.TxEssentials + GetTxHistoryGasUsed func(tx types.Tx, gasLimit int64) (int64, bool) + type TxMessage struct + From string + Tx types.Tx + func (m *TxMessage) String() string + func (m *TxMessage) UnmarshalFromAmino(_ *amino.Codec, data []byte) error + func (m TxMessage) AminoSize(_ *amino.Codec) int + func (m TxMessage) MarshalAminoTo(_ *amino.Codec, buf *bytes.Buffer) error + func (m TxMessage) MarshalToAmino(cdc *amino.Codec) ([]byte, error) + type WrapCMTxMessage struct + From string + Wtx *types.WrapCMTx + type WrappedTx struct + From string + NodeKey []byte + Payload []byte + Signature []byte + func (wtx *WrappedTx) GetFrom() string + func (wtx *WrappedTx) GetNodeKey() []byte + func (wtx *WrappedTx) GetPayload() []byte + func (wtx *WrappedTx) GetSignature() []byte + type WtxMessage struct + Wtx *WrappedTx + func (m *WtxMessage) String() string