Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultTestChainHeight = uint64(1) DefaultTestBatchSize = uint64(4) DefaultTestTxSetSize = uint64(1) )
View Source
const ( DefaultPoolSize = 50000 DefaultTxCacheSize = 10000 DefaultBatchSize = 500 DefaultTxSetSize = 10 DefaultTxSetTick = 100 * time.Millisecond )
Variables ¶
View Source
var (
InterchainContractAddr = types.NewAddressByStr("000000000000000000000000000000000000000a")
)
Functions ¶
This section is empty.
Types ¶
type ChainState ¶ added in v1.4.0
type External ¶ added in v1.4.0
type External interface { // GetPendingNonceByAccount will return the latest pending nonce of a given account GetPendingNonceByAccount(account string) uint64 // IsPoolFull check if memPool has exceeded the limited txSize. IsPoolFull() bool }
External is a concurrent and safe interface, which can be called by api module directly.
type GetAccountNonceFunc ¶ added in v1.6.1
type MemPool ¶
type MemPool interface { // ProcessTransactions process transaction from api and other vp nodes. ProcessTransactions(txs []*pb.Transaction, isLeader, isLocal bool) *raftproto.RequestBatch // GenerateBlock generate a block GenerateBlock() *raftproto.RequestBatch // Remove removes the committed transactions from mempool CommitTransactions(state *ChainState) // HasPendingRequest checks if there is non-batched tx(s) in mempool pool or not HasPendingRequest() bool SetBatchSeqNo(batchSeq uint64) GetTimeoutTransactions(rebroadcastDuration time.Duration) [][]*pb.Transaction External }
func NewMempool ¶
NewMempool return the mempool instance.
type TxCache ¶
type TxCache struct { TxSetC chan *raftproto.TxSlice RecvTxC chan *pb.Transaction // contains filtered or unexported fields }
func NewTxCache ¶ added in v1.4.0
func (*TxCache) ListenEvent ¶ added in v1.4.0
func (tc *TxCache) ListenEvent()
Click to show internal directories.
Click to hide internal directories.