Enum fuel_core_interfaces::txpool::TxPoolMpsc
source · pub enum TxPoolMpsc {
PendingNumber {
response: Sender<usize>,
},
ConsumableGas {
response: Sender<u64>,
},
Includable {
response: Sender<Vec<ArcPoolTx>>,
},
Insert {
txs: Vec<Arc<Transaction>>,
response: Sender<Vec<Result<InsertionResult>>>,
},
Find {
ids: Vec<TxId>,
response: Sender<Vec<Option<TxInfo>>>,
},
FindOne {
id: TxId,
response: Sender<Option<TxInfo>>,
},
FindDependent {
ids: Vec<TxId>,
response: Sender<Vec<ArcPoolTx>>,
},
Remove {
ids: Vec<TxId>,
response: Sender<Vec<ArcPoolTx>>,
},
FilterByNegative {
ids: Vec<TxId>,
response: Sender<Vec<TxId>>,
},
Stop,
}
Expand description
RPC commands that can be sent to the TxPool through an MPSC channel.
Responses are returned using response
oneshot channel.
Variants§
PendingNumber
The number of pending transactions in the pool.
ConsumableGas
The amount of gas in all includable transactions combined
Includable
Return all sorted transactions that are includable in next block. This is going to be heavy operation, use it only when needed.
Insert
import list of transaction into txpool. All needed parents need to be known and parent->child order should be enforced in Vec, we will not do that check inside txpool and will just drop child and include only parent. Additional restrain is that child gas_price needs to be lower then parent gas_price. Transaction can be received from p2p RespondTransactions or from userland. Because of userland we are returning error for every insert for better user experience.
Find
find all tx by their hash
FindOne
find one tx by its hash
FindDependent
find all dependent tx and return them with requested dependencies in one list sorted by Price.
Remove
remove transaction from pool needed on user demand. Low priority
FilterByNegative
Iterate over hashes
and return all hashes that we don’t have.
Needed when we receive list of new hashed from peer with
BroadcastTransactionHashes, so txpool needs to return
tx that we don’t have, and request them from that particular peer.
Stop
stop txpool